From 0bc380a96b87ee02b01a7d4677ad4d973563a84e Mon Sep 17 00:00:00 2001 From: Bram Moolenaar <Bram@vim.org> Date: Sat, 10 Jul 2010 13:52:13 +0200 Subject: [PATCH] Fixed ":s" message. Docs updates. --- runtime/doc/eval.txt | 4 ++++ runtime/doc/mbyte.txt | 4 ++-- runtime/doc/options.txt | 28 ++++++++++++++-------------- runtime/doc/pattern.txt | 9 +++++---- runtime/doc/todo.txt | 3 +++ runtime/doc/version7.txt | 3 +++ src/ex_cmds.c | 2 ++ src/normal.c | 6 ++++-- 8 files changed, 37 insertions(+), 22 deletions(-) diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 5d6a205001..34a1fdb067 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -5571,6 +5571,10 @@ synstack({lnum}, {col}) *synstack()* for id in synstack(line("."), col(".")) echo synIDattr(id, "name") endfor +< When the position specified with {lnum} and {col} is invalid + nothing is returned. The position just after the last + character in a line and the first column in an empty line are + valid positions. system({expr} [, {input}]) *system()* *E677* Get the output of the shell command {expr}. diff --git a/runtime/doc/mbyte.txt b/runtime/doc/mbyte.txt index 96b5b4dd0e..5bcb5059c6 100644 --- a/runtime/doc/mbyte.txt +++ b/runtime/doc/mbyte.txt @@ -1267,8 +1267,8 @@ is no longer relevant in the GTK+ 2 GUI. When reading a file a BOM (Byte Order Mark) can be used to recognize the Unicode encoding: EF BB BF utf-8 - FF FE utf-16 big endian - FE FF utf-16 little endian + FE FF utf-16 big endian + FF FE utf-16 little endian 00 00 FE FF utf-32 big endian FF FE 00 00 utf-32 little endian diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index a80c4c8a93..ec19680d55 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1169,7 +1169,7 @@ A jump table for the options with a short description can be found at |Q_op|. Win32 GUI} Which directory to use for the file browser: last Use same directory as with last file browser, where a - file was opened or saved. + file was opened or saved. buffer Use the directory of the related buffer. current Use the current directory. {path} Use the specified directory @@ -3485,15 +3485,15 @@ A jump table for the options with a short description can be found at |Q_op|. 'i' Use a Vim icon. For GTK with KDE it is used in the left-upper corner of the window. It's black&white on non-GTK, because of limitations of X11. For a color icon, see |X11-icon|. - *'go-m'* + *'go-m'* 'm' Menu bar is present. - *'go-M'* + *'go-M'* 'M' The system menu "$VIMRUNTIME/menu.vim" is not sourced. Note that this flag must be added in the .vimrc file, before switching on syntax or filetype recognition (when the |gvimrc| file is sourced the system menu has already been loaded; the ":syntax on" and ":filetype on" commands load the menu too). - *'go-g'* + *'go-g'* 'g' Grey menu items: Make menu items that are not active grey. If 'g' is not included inactive menu items are not shown at all. Exception: Athena will always use grey menu items. @@ -3505,36 +3505,36 @@ A jump table for the options with a short description can be found at |Q_op|. and Athena GUIs. *'go-r'* 'r' Right-hand scrollbar is always present. - *'go-R'* + *'go-R'* 'R' Right-hand scrollbar is present when there is a vertically split window. - *'go-l'* + *'go-l'* 'l' Left-hand scrollbar is always present. - *'go-L'* + *'go-L'* 'L' Left-hand scrollbar is present when there is a vertically split window. *'go-b'* 'b' Bottom (horizontal) scrollbar is present. Its size depends on the longest visible line, or on the cursor line if the 'h' flag is included. |gui-horiz-scroll| - *'go-h'* + *'go-h'* 'h' Limit horizontal scrollbar size to the length of the cursor line. Reduces computations. |gui-horiz-scroll| And yes, you may even have scrollbars on the left AND the right if you really want to :-). See |gui-scrollbars| for more information. - *'go-v'* + *'go-v'* 'v' Use a vertical button layout for dialogs. When not included, a horizontal layout is preferred, but when it doesn't fit a vertical layout is used anyway. - *'go-p'* + *'go-p'* 'p' Use Pointer callbacks for X11 GUI. This is required for some window managers. If the cursor is not blinking or hollow at the right moment, try adding this flag. This must be done before starting the GUI. Set it in your |gvimrc|. Adding or removing it after the GUI has started has no effect. - *'go-F'* + *'go-F'* 'F' Add a footer. Only for Motif. See |gui-footer|. @@ -4454,7 +4454,7 @@ A jump table for the options with a short description can be found at |Q_op|. is off and there is text preceding the character visible in the first column. conceal:c Character to show in place of concealed text, when - 'conceallevel' is set to 1. + 'conceallevel' is set to 1. nbsp:c Character to show for a non-breakable space (character 0xA0, 160). Left blank when omitted. @@ -4917,7 +4917,7 @@ A jump table for the options with a short description can be found at |Q_op|. respectively; see |CTRL-A| for more info on these commands. alpha If included, single alphabetical characters will be incremented or decremented. This is useful for a list with a - letter index a), b), etc. + letter index a), b), etc. *octal* octal If included, numbers that start with a zero will be considered to be octal. Example: Using CTRL-A on "007" results in "010". hex If included, numbers starting with "0x" or "0X" will be @@ -6628,7 +6628,7 @@ A jump table for the options with a short description can be found at |Q_op|. a buffer. Otherwise: do not split, use current window. Supported in |quickfix| commands that display errors. newtab Like "split", but open a new tab page. Overrules - "split" when both are present. + "split" when both are present. *'synmaxcol'* *'smc'* 'synmaxcol' 'smc' number (default 3000) diff --git a/runtime/doc/pattern.txt b/runtime/doc/pattern.txt index 3549906e54..c93b573b3e 100644 --- a/runtime/doc/pattern.txt +++ b/runtime/doc/pattern.txt @@ -995,7 +995,8 @@ x A single character, with no special meaning, matches itself in the collection: "[^xyz]" matches anything but 'x', 'y' and 'z'. - If two characters in the sequence are separated by '-', this is shorthand for the full list of ASCII characters between them. E.g., - "[0-9]" matches any decimal digit. + "[0-9]" matches any decimal digit. Non-ASCII characters can be + used, but the character values must not be more than 256 apart. - A character class expression is evaluated to the set of characters belonging to that character class. The following character classes are supported: @@ -1043,9 +1044,9 @@ x A single character, with no special meaning, matches itself "^"): "[]xyz]" or "[^]xyz]" {not in Vi}. For '-' you can also make it the first or last character: "[-xyz]", "[^-xyz]" or "[xyz-]". For '\' you can also let it be followed by - any character that's not in "^]-\bertn". "[\xyz]" matches '\', 'x', - 'y' and 'z'. It's better to use "\\" though, future expansions may - use other characters after '\'. + any character that's not in "^]-\bdertnoUux". "[\xyz]" matches '\', + 'x', 'y' and 'z'. It's better to use "\\" though, future expansions + may use other characters after '\'. - The following translations are accepted when the 'l' flag is not included in 'cpoptions' {not in Vi}: \e <Esc> diff --git a/runtime/doc/todo.txt b/runtime/doc/todo.txt index 1fb87e1e0d..038cb571f6 100644 --- a/runtime/doc/todo.txt +++ b/runtime/doc/todo.txt @@ -1089,6 +1089,9 @@ Patch to support horizontal scroll wheel in GTK. Untested. (Bjorn Winckler, Vim 7.3: +- :s messages concatenate (Tony) +- Windows XP: copying only gets first letter of bad spelled word. (Cesar + Romani, 2010 Jul 7) - in August remove UF_VERSION_CRYPT_PREV and UF_VERSION_PREV. - Conceal feature: no update when moving to another window. (Dominique Pelle, 2010 Jul 5) Vince will look into it. diff --git a/runtime/doc/version7.txt b/runtime/doc/version7.txt index 94714d67b1..8b537fc7ef 100644 --- a/runtime/doc/version7.txt +++ b/runtime/doc/version7.txt @@ -7232,5 +7232,8 @@ MS-Windows: The self-installing executable now also works on 64-bit systems. The gvim executable is 32 bits, the installed gvimext.dll is either a 32 or 64 bit version. (George Reilly) +synstack() did not return anything when just past the end of the line. Useful +when using the cursor position in Insert mode. + vim:tw=78:ts=8:ft=help:norl: diff --git a/src/ex_cmds.c b/src/ex_cmds.c index e1d270ca52..c0668cf0ef 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -5176,6 +5176,8 @@ do_sub_msg(count_only) { if (got_int) STRCPY(msg_buf, _("(Interrupted) ")); + else + *msg_buf = NUL; if (sub_nsubs == 1) vim_snprintf_add((char *)msg_buf, sizeof(msg_buf), "%s", count_only ? _("1 match") : _("1 substitution")); diff --git a/src/normal.c b/src/normal.c index 14578834f3..efcdb79929 100644 --- a/src/normal.c +++ b/src/normal.c @@ -5410,6 +5410,7 @@ nv_ident(cap) { char_u *ptr = NULL; char_u *buf; + char_u *newbuf; char_u *p; char_u *kp; /* value of 'keywordprg' */ int kp_help; /* 'keywordprg' is ":help" */ @@ -5562,13 +5563,14 @@ nv_ident(cap) vim_free(buf); return; } - buf = (char_u *)vim_realloc(buf, STRLEN(buf) + STRLEN(p) + 1); - if (buf == NULL) + newbuf = (char_u *)vim_realloc(buf, STRLEN(buf) + STRLEN(p) + 1); + if (newbuf == NULL) { vim_free(buf); vim_free(p); return; } + buf = newbuf; STRCAT(buf, p); vim_free(p); } -- GitLab