VERSION 5.4 *version-5.4* Version 5.4 adds new features, useful changes and a lot of bug fixes. Runtime directory introduced *new-runtime-dir* The distributed runtime files are now in $VIMRUNTIME, the user files in $VIM. You normally don't set $VIMRUNTIME but let Vim find it, by using $VIM/vim{version}, or use $VIM when that doesn't exist. This allows for separating the user files from the distributed files and makes it more easy to upgrade to another version. It also makes it possible to keep two versions of Vim around, each with their own runtime files. In the Unix distribution the runtime files have been moved to the "runtime" directory. This makes it possible to copy all the runtime files at once, without the need to know what needs to be copied. The archives for DOS, Windows, Amiga and OS/2 now have an extra top-level "vim" directory. This is to make clear that user-modified files should be put here. The directory that contains the executables doesn't have '-' or '.' characters. This avoids strange extensions. The $VIM and $VIMRUNTIME variables are set when they are first used. This allows them to be used by Perl, for example. The runtime files are also found in a directory called "$VIM/runtime". This helps when running Vim after just unpacking the runtime archive. When using an executable in the "src" directory, Vim checks if "vim54" or "runtime" can be added after removing it. This make the runtime files be found just after compiling. A default for $VIMRUNTIME can be given in the Unix Makefile. This is useful if $VIM doesn't point to above the runtime directory but to e.g., "/etc/". Filetype introduced *new-filetype-5.4* Syntax files are now loaded with the new FileType autocommand. Old "mysyntaxfile" files will no longer work. |filetypes| The scripts for loading syntax highlighting have been changed to use the new Syntax autocommand event. This combination of Filetype and Syntax events allows tuning the syntax highlighting a bit more, also when selected from the Syntax menu. The FileType autocommand can also be used to set options and mappings specifically for that type of file. The "$VIMRUNTIME/filetype.vim" file is not loaded automatically. The ":filetype on" command has been added for this. ":syntax on" also loads it. The 'filetype' option has been added. It is used to trigger the FileType autocommand event, like the 'syntax' option does for the Syntax event. ":set syntax=OFF" and ":set syntax=ON" can be used (in a modeline) to switch syntax highlighting on/off for the current file. The Syntax menu commands have been moved to $VIMRUNTIME/menu.vim. The Syntax menu is included both when ":filetype on" and when ":syntax manual" is used. Renamed the old 'filetype' option to 'osfiletype'. It was only used for RISCOS. 'filetype' is now used for the common file type. Added the ":syntax manual" command. Allows manual selection of the syntax to be used, e.g., from a modeline. Vim script line continuation *new-line-continuation* When an Ex line starts with a backslash, it is concatenated to the previous line. This avoids the need for long lines. |line-continuation| (Roemer) Example: if has("dialog_con") || \ has("dialog_gui") :let result = confirm("Enter your choice", \ "&Yes\n&No\n&Maybe", \ 2) endif Improved session files *improved-sessions* New words for 'sessionoptions': - "help" Restore the help window. - "blank" Restore empty windows. - "winpos" Restore the Vim window position. Uses the new ":winpos" command - "buffers" Restore hidden and unloaded buffers. Without it only the buffers in windows are restored. - "slash" Replace backward by forward slashes in file names. - "globals" Store global variables. - "unix" Use unix file format (<NL> instead of <CR><NL>) The ":mksession" and 'sessionoptions' are now in the +mksession feature. The top line of the window is also restored when using a session file. ":mksession" and ":mkvimrc" don't store 'fileformat', it should be detected when loading a file. (Most of this was done by Vince Negri and Robert Webb) Autocommands improved *improved-autocmds-5.4* New events: |FileType| When the file type has been detected. |FocusGained| When Vim got input focus. (Negri) |FocusLost| When Vim lost input focus. (Negri) |BufCreate| Called just after a new buffer has been created or has been renamed. (Madsen) |CursorHold| Triggered when no key has been typed for 'updatetime'. Can be used to do something with the word under the cursor. (Negri) Implemented CursorHold autocommand event for Unix. (Zellner) Also for Amiga and MS-DOS. |GUIEnter| Can be used to do something with the GUI window after it has been created (e.g., a ":winpos 100 50"). |BufHidden| When a buffer becomes hidden. Used to delete the option-window when it becomes hidden. Also trigger |BufDelete| just before a buffer is going to be renamed. (Madsen) The "<amatch>" pattern can be used like "<afile>" for autocommands, except that it is the matching value for the FileType and Syntax events. When ":let @/ = <string>" is used in an autocommand, this last search pattern will be used after the autocommand finishes. Made loading autocommands a bit faster. Avoid doing strlen() on each exiting pattern for each new pattern by remembering the length. Encryption *new-encryption* Files can be encrypted when writing and decrypted when reading. Added the 'key' option, "-x" command line argument and ":X" command. |encryption| (based on patch from Mohsin Ahmed) When reading a file, there is an automatic detection whether it has been crypted. Vim will then prompt for the key. Note that the encryption method is not compatible with Vi. The encryption is not unbreakable. This allows it to be exported from the US. GTK GUI port *new-GTK-GUI* New GUI port for GTK+. Includes a toolbar, menu tearoffs, etc. |gui-gtk| Added the |:helpfind| command. (Kahn and Dalecki) Menu changes *menu-changes-5.4* Menus can now also be used in the console. It is enabled by the new 'wildmenu' option. This shows matches for command-line completion like a menu. This works as a minimal file browser. The new |:emenu| command can be used to execute a menu item. Uses the last status line to list items, or inserts a line just above the command line. (Negri) The 'wildcharx' option can be used to trigger 'wildmenu' completion from a mapping. When compiled without menus, this can be detected with has("menu"). Also show this in the ":version" output. Allow compiling GUI versions without menu support. Only include toolbar support when there is menu support. Moved the "Window" menu all the way to the right (priority 70). Looks more familiar for people working with MS-Windows, shouldn't matter for others. Included "Buffers" menu. Works with existing autocommands and functions. It can be disabled by setting the "no_buffers_menu" variable. (Aaron and Madsen) Win32 supports separators in a menu: "-.*-". (Geddes) Menu separators for Motif now work too. Made Popup menu for Motif GUI work. (Madsen) 'M' flag in 'guioptions': Don't source the system menu. All the menu code has been moved from gui.c to menu.c. Viminfo improved *improved-viminfo* New flags for 'viminfo': '!' Store global variables in the viminfo file if they are in uppercase letters. (Negri) 'h' Do ":nohlsearch" when loading a viminfo file. Store search patterns in the viminfo file with their offset, magic, etc. Also store the flag whether 'hlsearch' highlighting is on or off (which is not used if the 'h' flag is in 'viminfo'). Give an error message when setting 'viminfo' without commas. Various new commands *new-commands-5.4* Operator |g?|: rot13 encoding. (Negri) |zH| and |zL| commands: Horizontal scrolling by half a page. |gm| move cursor to middle of screen line. (Ideas by Campbell) Operations on Visual blocks: |v_b_I|, |v_b_A|, |v_b_c|, |v_b_C|, |v_b_r|, |v_b_<| and |v_b_>|. (Kelly) New command: CTRL-\ CTRL-N, which does nothing in Normal mode, and goes to Normal mode when in Insert or Command-line mode. Can be used by VisVim or other OLE programs to make sure Vim is in Normal mode, without causing a beep. |CTRL-\_CTRL-N| ":cscope kill" command to use the connection filename. |:cscope| (Kahn) |:startinsert| command: Start Insert mode next. |:history| command, to show all four types of histories. (Roemer) |[m|, |[M|, |]m| and |]M| commands, for jumping backward/forward to start/end of method in a (Java) class. ":@*" executes the * register. |:@| (Acevedo) |go| and |:goto| commands: Jump to byte offset in the file. |gR| and |gr| command: Virtual Replace mode. Replace characters without changing the layout. (Webb) ":cd -" changes to the directory from before the previous ":cd" command. |:cd-| (Webb) Tag preview commands |:ptag|. Shows the result of a ":tag" in a dedicated window. Can be used to see the context of the tag (e.g., function arguments). (Negri) |:pclose| command, and CTRL-W CTRL-Z: Close preview window. (Moore) 'previewheight' option, height for the preview window. Also |:ppop|, |:ptnext|, |:ptprevious|, |:ptNext|, |:ptrewind|, |:ptlast|. |:find| and |:sfind| commands: Find a file in 'path', (split window) and edit it. The |:options| command opens an option window that shows the current option values. Or use ":browse set" to open it. Options are grouped by function. Offers short help on each option. Hit <CR> to jump to more help. Edit the option value and hit <CR> on a "set" line to set a new value. Various new options *new-options-5.4* Scroll-binding: 'scrollbind' and 'scrollopt' options. Added |:syncbind| command. Makes windows scroll the same amount (horizontally and/or vertically). (Ralston) 'conskey' option for MS-DOS. Use direct console I/O. This should work with telnet (untested!). 'statusline' option: Configurable contents of the status line. Also allows showing the byte offset in the file. Highlighting with %1* to %9*, using the new highlight groups User1 to User9. (Madsen) 'rulerformat' option: Configurable contents of the ruler, like 'statusline'. (Madsen) 'write' option: When off, writing files is not allowed. Avoids overwriting a file even with ":w!". The |-m| command line option resets 'write'. 'clipboard' option: How the clipboard is used. Value "unnamed": Use unnamed register like "*. (Cortopassi) Value "autoselect": Like what 'a' in 'guioptions' does but works in the terminal. 'guifontset' option: Specify fonts for the +fontset feature, for the X11 GUI versions. Allows using normal fonts when vim is compiled with this feature. (Nam) 'guiheadroom' option: How much room to allow above/below the GUI window. Used for Motif, Athena and GTK. Implemented 'tagstack' option: When off, pushing tags onto the stack is disabled (Vi compatible). Useful for mappings. 'shellslash' option. Only for systems that use a backslash as a file separator. This option will use a forward slash in file names when expanding it. Useful when 'shell' is sh or csh. 'pastetoggle' option: Key sequence that toggles 'paste'. Works around the problem that mappings don't work in Insert mode when 'paste' is set. 'display' option: When set to "lastline", the last line fills the window, instead of being replaced with "@" lines. Only the last three characters are replaced with "@@@", to indicate that the line has not finished yet. 'switchbuf' option: Allows re-using existing windows on a buffer that is being jumped to, or split the window to open a new buffer. (Roemer) 'titleold' option. Replaces the fixed string "Thanks for flying Vim", which is used to set the title when exiting. (Schild) Vim scripts *new-script-5.4* The |exists()| function can also check for existence of a function. (Roemer) An internal function is now found with a binary search, should be a bit faster. (Roemer) New functions: - |getwinposx()| and |getwinposy()|: get Vim window position. (Webb) - |histnr()|, |histadd()|, |histget()| and |histdel()|: Make history available. (Roemer) - |maparg()|: Returns rhs of a mapping. Based on a patch from Vikas. - |mapcheck()|: Check if a map name matches with an existing one. - |visualmode()|: Return type of last Visual mode. (Webb) - |libcall()|: Call a function in a library. Currently only for Win32. (Negri) - |bufwinnr()|: find window that contains the specified buffer. (Roemer) - |bufloaded()|: Whether a buffer exists and is loaded. - |localtime()| and |getftime()|: wall clock time and last modification time of a file (Webb) - |glob()|: expand file name wildcards only. - |system()|: get the raw output of an external command. (based on a patch from Aaron). - |strtrans()|: Translate String into printable characters. Used for 2html.vim script. - |append()|: easy way to append a line of text in a buffer. Changed functions: - Optional argument to |strftime()| to give the time in seconds. (Webb) - |expand()| now also returns names for files that don't exist. Allow numbers in the name of a user command. (Webb) Use "v:" for internal Vim variables: "v:errmsg", "v:shell_error", etc. The ones from version 5.3 can be used without "v:" too, for backwards compatibility. New variables: "v:warningmsg" and "v:statusmsg" internal variables. Contain the last given warning and status message. |v:warningmsg| |v:statusmsg| (Madsen) "v:count1" variable: like "v:count", but defaults to one when no count is used. |v:count1| When compiling without expression evaluation, "if 1" can be used around the not supported commands to avoid it being executed. Works like in Vim 4.x. Some of the runtime scripts gave errors when used with a Vim that was compiled with minimal features. Now "if 1" is used around code that is not always supported. When evaluating an expression with && and ||, skip the parts that will not influence the outcome. This makes it faster and avoids error messages. (Webb) Also optimized the skipping of expressions inside an "if 0". Avoid hit-enter prompt *avoid-hit-enter* Added 'T' flag to 'shortmess': Truncate all messages that would cause the hit-enter prompt (unless that would happen anyway). The 'O' flag in 'shortmess' now also applies to quickfix messages, e.g., from the ":cn" command. The default for 'shortmess' is now "filnxtToO", to make most messages fit on the command line, and not cause the hit-enter prompt. Previous messages can be viewed with the new |:messages| command. Some messages are shown fully, even when 'shortmess' tells to shorten messages, because the user is expected to want to see them in full: CTRL-G and some quickfix commands. Improved quickfix *improved-quickfix* Parse change-directory lines for gmake: "make[1]: Entering directory 'name'"'. Uses "%D" and "%X" in 'errorformat'. Also parse "Making {target} in {dir}" messages from make. Helps when not using GNU make. (Schandl) Use 'isfname' for "%f" in 'errorformat'. Parsing of multi-line messages. |errorformat-multi-line| Allow a range for the |:clist| command. (Roemer) Support for "global" file names, for error formats that output the file name once for several errors. (Roemer) |:cnfile| jumps to first error in next file. "$*" in 'makeprg' is replaced by arguments to ":make". (Roemer) Regular expressions *regexp-changes-5.4* In a regexp, a '$' before "\)" is also considered to be an end-of-line. |/$| In patterns "^" after "\|" or "\(" is a start-of-line. |/^| (Robinson)||| In a regexp, in front of "\)" and "\|" both "$" and "\$" were considered end-of-line. Now use "$" as end-of-line and "\$" for a literal dollar. Same for '^' after "\(" and "\|". |/\$| |/\^|||||| Some search patterns can be extremely slow, even though they are not really illegal. For example: "\([^a-z]\+\)\+Q". Allow interrupting any regexp search with CTRL-C. Register "/: last search string (read-only). (Kohan) Changed to use last used search pattern (like what 'hlsearch' uses). Can set the search pattern with ":let @/ = {expr}". Added character classes to search patterns, to avoid the need for removing the 'l' flag from 'cpoptions': |[:tab:]|, |[:return:]|, |[:backspace:]| and |[:escape:]|. By adding a '?' after a comparative operator in an expression, the comparison is done by ignoring case. |expr-==?| Other improvements made between version 5.3 and 5.4 Changed *changed-5.4* Unix: Use $TMPDIR for temporary files, if it is set and exists. Removed "Empty buffer" message. It isn't useful and can cause a hit-enter prompt. (Negri) "ex -" now reads commands from stdin and works in silent mode. This is to be compatible with the original "ex" command that is used for scripts. Default range for ":tcldo" is the whole file. Cancelling Visual mode with ESC moved the cursor. There appears to be no reason for this. Now leave the cursor where it is. The ":grep" and ":make" commands see " as part of the arguments, instead of the start of a comment. In expressions the "=~" and "!~" operators no longer are affected by 'ignorecase'. Renamed vimrc_example to vimrc_example.vim and gvimrc_example to gvimrc_example.vim. Makes them being recognized as vim scripts. "gd" no longer starts searching at the end of the previous function, but at the first blank line above the start of the current function. Avoids that using "gd" in the first function finds global a variable. Default for 'complete' changed from ".,b" to ".,w,b,u,t,i". Many more matches will be found, at the cost of time (the search can be interrupted). It is no longer possible to set 'shell*' options from a modeline. Previously only a warning message was given. This reduces security risks. The ordering of the index of documentation files was changed to make it more easy to find a subject. On MS-DOS and win32, when $VIM was not set, $HOME was used. This caused trouble if $HOME was set to e.g., "C:\" for some other tool, the runtime files would not be found. Now use $HOME only for _vimrc, _gvimrc, etc., not to find the runtime file. When 'tags' is "./{fname}" and there is no file name for the current buffer, just use it. Previously it was skipped, causing "vim -t {tag}" not to find many tags. When trying to select text in the 'scrolloff' area by mouse dragging, the resulting scrolling made this difficult. Now 'scrolloff' is temporarily set to 0 or 1 to avoid this. But still allow scrolling in the top line to extend to above the displayed text. Default for 'comments' now includes "sl:/*,mb: *,ex:*/", to make javadoc comments work. Also helps for C comments that start with "/*******". CTRL-X CTRL-] Insert mode tag expansion tried to expand to all tags when used after a non-ID character, which can take a very long time. Now limit this to 200 matches. Also used for command-line tag completion. The OS/2 distribution has been split in two files. It was too big to fit on a floppy. The same runtime archive as for the PC is now used. In the documentation, items like <a-z> have been replaced with {a-z} for non-optional arguments. This avoids confusion with key names: <C-Z> is a CTRL-Z, not a character between C and Z, that is {C-Z}. Added *added-5.4* Color support for the iris-ansi builtin termcap entry. (Tubman) Included VisVim version 1.3a. (Erhardt) Win32 port for SNiFF+ interface. (Leherbauer) Documentation file for sniff interface: if_sniff.txt. (Leherbauer) Included the "SendToVim" and "OpenWithVim" programs in the OleVim directory. To be used with the OLE version of gvim under MS-Windows. (Schaller) Included Exuberant Ctags version 3.2.4 with Eiffel support. (Hiebert) When a file that is being edited is deleted, give a warning (like when the time stamp changed). Included newer versions of the HTML-generating Awk and Perl scripts. (Colombo) Linux console mouse support through "gpm". (Tsindlekht) Security fix: Disallow changing 'secure' and 'exrc' from a modeline. When 'secure' is set, give a warning for changing options that contain a program name. Made the Perl interface work with Perl 5.005 and threads. (Verdoolaege) When giving an error message for an ambiguous mapping, include the offending mapping. (Roemer) Command line editing: - Command line completion of mappings. (Roemer) - Command line completion for ":function", ":delfunction", ":let", ":call", ":if", etc. (Roemer) - When using CTRL-D completion for user commands that have "-complete=tag_listfiles" also list the file names. (Madsen) - Complete the arguments of the ":command" command. (Webb) - CTRL-R . in command line inserts last inserted text. CTRL-F, CTRL-P, CTRL-W and CTRL-A after CTRL-R are used to insert an object from under the cursor. (Madsen) Made the text in uganda.txt about copying Vim a bit more clear. Updated the Vim tutor. Added the "vimtutor" command, which copies the tutor and starts Vim on it. "make install" now also copies the tutor. In the output of ":clist" the current entry is highlighted, with the 'i' highlighting (same as used for 'incsearch'). For the ":clist" command, you can scroll backwards with "b" (one screenful), "u" (half a screenful) and "k" (one line). Multi-byte support: - X-input method for multi-byte characters. And various fixes for multi-byte support. (Nam) - Hangul input method feature: |hangul|. (Nam) - Cleaned up configuration of multi-byte support, XIM, fontset and Hangul input. Each is now configurable separately. - Changed check for GTK_KEYBOARD to HANGUL_KEYBOARD_TYPE. (Nam) - Added doc/hangulin.txt: Documentation for the Hangul input code. (Nam) - XIM support for GTK+. (Nam) - First attempt to include support for SJIS encoding. (Nagano) - When a double-byte character doesn't fit at the end of the line, put a "~" there and print it on the next line. - Optimize output of multi-byte text. (Park) - Win32 IME: preedit style is like over-the-spot. (Nagano) - Win32 IME: IME mode change now done with ImmSetOpenStatus. (Nagano) - GUI Athena: file selection dialog can display multi-byte characters. (Nagano) - Selection reply for XA_TEXT as XA_STRING. (Nagano) "runtime/macros/diffwin.vim". Mappings to make a diff window. (Campbell) Added ".obj" to the 'suffixes' option. Reduced size of syntax/synload.vim by using the ":SynAu" user command. Automated numbering of Syntax menu entries in menu.vim. In the Syntax menu, insert separators between syntax names that start with a different letter. (Geddes) Xterm: - Clipboard support when using the mouse in an xterm. (Madsen) - When using the xterm mouse, track dragging of the mouse. Use xterm escape sequences when possible. It is more precise than other methods, but requires a fairly recent xterm version. It is enabled with "xterm2" in 'ttymouse'. (Madsen) - Check xterm patch level, to set the value of 'ttymouse'. Has only been added to xterm recently (patch level > 95). Uses the new 't_RV' termcap option. Set 'ttymouse' to "xterm2" when a correct response is recognized. Will make xterm mouse dragging work better. - Support for shifted function keys on xterm. Changed codes for shifted cursor keys to what the xterm actually produces. Added codes for shifted <End> and <Home>. - Added 't_WP' to set the window position in pixels and 't_WS' to set the window size in characters. Xterm can now move (used for ":winpos") and resize (use for ":set lines=" and ":set columns="). X11: - When in Visual mode but not owning the selection, display the Visual area with the VisualNOS group to show this. (Madsen) - Support for requesting the type of clipboard support. Used for AIX and dtterm. (Wittig) - Support compound_text selection (even when compiled without multi-byte). Swap file: - New variation for naming swap files: Replace path separators into %, place all swap files in one directory. Used when a name in 'dir' ends in two path separators. (Madsen) - When a swap file is found, show whether it contains modifications or not in the informative message. (Madsen) - When dialogs are supported, use a dialog to ask the user what to do when a swapfile already exists. "popup_setpos" in 'mousemodel' option. Allows for moving the cursor when using the right mouse button. When a buffer is deleted, the selection for which buffer to display instead now uses the most recent entry from the jump list. (Madsen) When using CTRL-O/CTRL-I, skip deleted buffers. A percentage is shown in the ruler, when there is room. Used autoconf 1.13 to generate configure. Included get_lisp_indent() from Dirk van Deun. Does better Lisp indenting when 'p' flag in 'cpoptions' is not included. Made the 2html.vim script quite a bit faster. (based on ideas from Geddes) Unix: - Included the name of the user that compiled Vim and the system name it was compiled on in the version message. - "make install" now also installs the "tools" directory. Makes them available for everybody. - "make check" now does the same as "make test". "make test" checks for Visual block mode shift, insert, replace and change. - Speed up comparing a file name with existing buffers by storing the device/inode number with the buffer. - Added configure arguments "--disable-gtk", "--disable-motif" and "--disable-athena", to be able to disable a specific GUI (when it doesn't work). - Renamed the configure arguments for disabling the check for specific GUIs. Should be clearer now. (Kahn) - On a Digital Unix system ("OSF1") check for the curses library before termlib and termcap. (Schild) - "make uninstall_runtime" will only delete the version-specific files. Can be used to delete the runtime files of a previous version. Macintosh: (St-Amant) - Dragging the scrollbar, like it's done for the Win32 GUI. Moved common code from gui_w32.c to gui.c - Added dialogs and file browsing. - Resource fork preserved, warning when it will be lost. - Copy original file attributes to newly written file. - Set title/notitle bug solved. - Filename completion improved. - Grow box limit resize to a char by char size. - Use of rgb.txt for more colors (but give back bad color). - Apple menu works (beside the about...). - Internal border now vim compliant. - Removing a menu doesn't crash anymore. - Weak-linking of Python 1.5.1 (only on PPC). Python is supported when the library is available. - If an error is encountered when sourcing the users .vimrc, the alert box now shows right away with the OK button defaulted. There's no more "Delete"-key sign at the start of each line - Better management of environment variables. Now $VIM is calculated only once, not regenerated every time it is used. - No more CPU hog when in background. - In a sourced Vim script the Mac file format can be recognized, just like DOS file format is. When both "unix" and "mac" are present in 'fileformats', prefer "mac" format when there are more CR than NL characters. When using "mac" fileformat, use CR instead of a NL, because NL is used for NUL. Will preserve all characters in a file. (Madsen) The DOS install.exe now contains checks for an existing installation. It avoids setting $VIM and $PATH again. The install program for Dos/Windows can now install Vim in the popup menu, by adding two registry keys. Port to EGCS/mingw32. New Makefile.ming. (Aaron) DOS 16 bit: Don't include cursor shape stuff. Save some bytes. TCL support to Makefile.w32. (Duperval) OS/2: Use argv[0] to find runtime files. When using "gf" to go to a buffer that has already been used, jump to the line where the cursor last was. Colored the output of ":tselect" a bit more. Different highlighting between tag name and file name. Highlight field name ("struct:") separately from argument. Backtick expansion for non-Unix systems. Based on a patch from Aaron. Allows the use of things like ":n `grep -l test *.c`" and "echo expand('`ls m*`')". Check for the 'complete' option when it is set. (Acevedo) 'd' flag in 'complete' searches for defined names or macros. While searching for Insert mode completions in include files and tags files, check for typeahead, so that you can use matches early. (Webb) The '.' flag in 'complete' now scans the current buffer completely, ignoring 'nowrapscan'. (Webb) Added '~' flag to 'whichwrap'. (Acevedo) When ending the Visual mode (e.g., with ESC) don't grab ownership of the selection. In a color terminal, "fg" and "bg" can be used as color names. They stand for the "Normal" colors. A few cscope cleanups. (Kahn) Included changed vimspell.sh from Schemenauer. Concatenation of strings in an expression with "." is a bit faster. (Roemer) The ":redir" command can now redirect to a register: ":redir @r". (Roemer) Made the output of ":marks" and ":jumps" look similar. When the mark is in the current file, show the text at the mark. Also for ":tags". When configure finds ftello() and fseeko(), they are used in tag.c (for when you have extremely big tags files). Configure check for "-FOlimit,2000" argument for the compiler. (Borsenkow) GUI: - When using ":gui" in a non-GUI Vim, give a clear error message. - "gvim -v" doesn't start the GUI (if console support is present). - When in Ex mode, use non-Visual selection for the whole screen. - When starting with "gvim -f" and using ":gui" in the .gvimrc file, Vim forked anyway. Now the "-f" flag is remembered for ":gui". Added "gui -b" to run gvim in the background anyway. Motif GUI: - Check for "-lXp" library in configure (but it doesn't work yet...). - Let configure check for Lesstif in "/usr/local/Lesstif/Motif*". Changed the order to let a local Motif version override a system standard version. Win32 GUI: - When using "-register" or "-unregister" in the non-OLE version, give an error message. - Use GTK toolbar icons. Make window border look better. Use sizing handles on the lower left&right corners of the window. (Negri) - When starting an external command with ":!start" and the command can not be executed, give an error message. (Webb) - Use sizing handles for the grey rectangles below the scrollbars. Can draw toolbar in flat mode now, looks better. (Negri) - Preparations for MS-Windows 3.1 addition. Mostly changing WIN32 to MSWIN and USE_GUI_WIN32 to USE_GUI_MSWIN. (Negri) Avoid allocating the same string four times in buflist_findpat(). (Williams) Set title and icon text with termcap options 't_ts', 't_fs', 't_IS' and 't_IE'. Allows doing this on any terminal that supports setting the title and/or icon text. (Schild) New 'x' flag in 'comments': Automatically insert the end part when its last character is typed. Helps to close a /* */ comment in C. (Webb) When expand() has a second argument which is non-zero, don't use 'suffixes' and 'wildignore', return all matches. 'O' flag in 'cpoptions: When not included, Vim will not overwrite a file, if it didn't exist when editing started but it does exist when the buffer is written to the file. The file must have been created outside of Vim, possibly without the user knowing it. When this is detected after a shell command, give a warning message. When editing a new file, CTRL-G will show [New file]. When there were errors while reading the file, CTRL-G will show [Read errors]. ":wall" can now use a dialog and file-browsing when needed. Grouped functionality into new features, mainly to reduce the size of the minimal version: +linebreak: 'showbreak', 'breakat' and 'linebreak' +visualextra: "I"nsert and "A"ppend in Visual block mode, "c"hange all lines in a block, ">" and "<": Shifting a block, "r": Replacing a Visual area with one character. +comments: 'comments' +cmdline_info: 'ruler' and 'showcmd'. Replaces +showcmd. "+title" Don't add code to set title or icon for MSDOS, this was not possible anyway. +cmdline_compl Disable commandline completion at compile time, except for files, directories and help items. Moved features from a list of function calls into an array. Should save a bit of space. While entering the body of a function, adjust indent according to "if" and "while" commands. VMS: Adjusted os_vms.mms a bit according to suggestions from Arpadffy. The flags in the 'comments' option can now include an offset. This makes it possible to align "/*****", "/* xxx" and "/*" comments with the same 'comments' setting. The default value for 'comments' uses this. Added 'O' flag: Don't use this part for the "O" command. Useful for "set com=sO:*\ -,mO:*\ \ ,exO:*/" FileType autocommands recognize ".bak", ".orig" and "~" extensions and remove them to find the relevant extension. The tutorial for writing a Vim script file has been extended. Some more highlighting in help files, for items that are not typed literally. Can use "CTRL-W CTRL-G" like "CTRL-W g". "make test" for OS/2. Adjusted configure to automatically use the GUI for BeOS. Fixed *fixed-5.4* 5.3.1: When using an autocommand for BufWritePre that changes the name of the buffer, freed memory would be used. (Geddes) Mac: Compiler didn't understand start of skip_class_name(). Win32 GUI: - When cancelling the font requester, don't give an error message. - When a tearoff-menu is open and its menu is deleted, Vim could crash. (Negri) - There was a problem on Windows 95 with (un)maximizing the window. (Williams) - when 'mousehide' is set, the mouse would stay hidden when a menu is dropped with the keyboard. (Ralston) - The tempname() function already created the file. Caused problems when using ":w". Now the file is deleted. - Cursor disappeared when ending up in the top-left character on the screen after scrolling. (Webb) - When adding a submenu for a torn-off menu, it was not updated. - Menu tooltip was using the toolbar tooltip. (Negri) - Setting 'notitle' didn't remove the title. (Steed) - Using ":!start cmd" scrolled the screen one line up, and didn't wait for return when the command wasn't found. Cscope interface: Sorting of matches was wrong. Starting the interface could fail. (Kahn) Motif GUI: Could not compile with Motif 1.1, because some tear-off functionality was not in #ifdefs. Configure could sometimes not compile or link the test program for sizeof(int) properly. This caused alignment problems for the undo structure allocations. Added a safety check that SIZEOF_INT is not zero. Added configure check to test if strings.h can be included after string.h. Some systems can't handle it. Some systems need both string.h and strings.h included. Adjusted vim.h for that. Removed including string.h from os_unixx.h, since it's already in vim.h. (Savage) AIX: defining _NO_PROTO in os_unix.h causes a conflict between string.h and strings.h, but after the configure check said it was OK. Also define _NO_PROTO for AIX in the configure check. (Winn) When closing a window with CTRL-W c, the value of 'hidden' was not taken into account, the buffer was always unloaded. (Negri) Unix Makefile: "make install" always tried to rename an older executable and remove it. This caused an error message when it didn't exit. Added a check for the existence of an old executable. The command line for "make install" could get too long, because of the many syntax files. Now first do a "cd" to reduce the length. On RISCOS and MSDOS, reading a file could fail, because the short filename was used, which can be wrong after a ":!cd". In the DOS versions, the wrong install.exe was included (required Windows). Now the install.exe version is included that is the same as the Vim version. This also supports long file names where possible. When recording, and stopping while in Insert mode with CTRL-O q, the CTRL-O would also be recorded. 32bit DOS version: "vim \file", while in a subdirectory, resulted in "new file" for "file" in the local directory, while "\file" did exist. When "file" in the current directory existed, this didn't happen. MSDOS: Mouse could not go beyond 80 columns in 132 columns mode. (Young) "make test" failed in the RedHat RPM, because compatible is off by default. In Insert mode <C-O><C-W><C-W> changes to other window, but the status bars were not updated until another character was typed. MSDOS: environment options in lowercase didn't work, although they did in the Win32 versions. (Negri) After ":nohlsearch", a tag command switched highlighting back on. When using "append" command as the last line in an autocommand, Vim would crash. RISCOS: The scroll bumpers (?) were not working properly. (Leonard) "zl" and "zh" could move the cursor, but this didn't set the column in which e.g., "k" would move the cursor. When doing ":set all&" the value of 'scroll' was not set correctly. This caused an error message when later setting any other number option. When 'hlsearch' highlighting has been disabled with ":nohlsearch", incremental searching would switch it back on too early. When listing tags for ":tselect", and using a non-search command, and the last character was equal to the first (e.g., "99"), the last char would not be shown. When searching for tags with ":tag" Vim would assume that all matches had been found when there were still more (e.g. from another tags file). Win32: Didn't recognize "c:\" (e.g., in tags file) as absolute path when upper/lowercase was different. Some xterms (Debian) send <Esc>OH for HOME and <Esc>OF for END. Added these to the builtin-xterm. In ex mode, any CR was seen as the end of the line. Only a NL should be handled that way. broke ":s/foo/some^Mtext/". In menu.vim, a vmenu was used to override an amenu. That didn't work, because the system menu file doesn't overwrite existing menus. Added explicit vunmenu to solve this. Configure check for terminal library could find a library that doesn't work at runtime (Solaris: shared library not found). Added a check that a program with tgoto() can run correctly. Unix: "echo -n" in the Makefile doesn't work on all systems, causing errors compiling pathdef.c. Replaced it with "tr". Perl: DO_JOIN was redefined by Perl. Undefined it in the perl files. Various XIM and multi-byte fixes: - Fix user cannot see his language while he is typing his language with off-the-spot method. (Nagano) - Fix preedit position using text/edit area (using gui.wid). (Nagano) - remove 'fix dead key' codes. It was needed since XNFocusWindow was "x11_window", XNFocusWindow is now gui.wid. (Nagano) - Remove some compile warnings and fix typos. (Namsh) - For status area, check the gtk+ version while Vim runs. I believe it is better than compile time check. (Namsh) - Remove one FIXME for gtk+-xim. (Namsh) - XIM: Dead keys didn't work for Czech. (Vyskovsky) - Multibyte: If user input only 3byte such as mb1_mb2_eng or eng_mb1_mb2 VIM could convert it to special character. (Nam) - Athena/Motif with XIM: fix preedit area. (Nam) - XIM: Composed strings were sometimes ignored. Vim crashed when compose string was longer than 256 bytes. IM's geometry control is fixed. (Nam, Nagano) - Win32 multi-byte: hollowed cursor width on a double byte char was wrong. (Nagano) - When there is no GUI, selecting XIM caused compilation problems. Automatically disable XIM when there is no GUI in configure. - Motif and Athena: When compiled with XIM, but the input method was not enabled, there would still be a status line. Now the status line is gone if the input method doesn't work. (Nam) Win32: tooltip was not removed when selecting a parent menu (it was when selecting a menu entry). (Negri) Unix with X: Some systems crash on exit, because of the XtCloseDisplay() call. Removed it, it should not be necessary when exiting. Win32: Crash on keypress when compiled with Borland C++. (Aaron) When checking for Motif library files, prefer the same location as the include files (with "include" replaced with "lib") above another entry. Athena GUI: Changed "XtOffset()" in gui_at_fs.c to "XtOffsetOf()", like it's used in gui_x11.c. Win32: When testing for a timestamp of a file on floppy, would get a dialog box when the floppy has been removed. Now return with an error. (Negri) Win32 OLE: When forced to come to the foreground, a minimized window was still minimized, now it's restored. (Zivkov) There was no check for a positive 'shiftwidth'. A negative value could cause a hangup, a zero value a crash. Athena GUI: horizontal scrollbar wasn't updated correctly when clicking right or left of the thumb. When making a Visual-block selection in one window, and trying to scroll another, could cause errors for accessing non-existent line numbers. When 'matchpairs' contains "`:'"', jumping from the ` to the '' didn't work properly. Changed '\"' to '"'' to make it compatible with old C compilers. The command line expansion for mappings caused a script with a TAB between lhs and rhs of a map command to fail. Assume the TAB is to separate lhs and rhs when there are no mappings to expand. When editing a file with very long lines with 'scrolloff' set, "j" would sometimes end up in a line which wasn't displayed. When editing a read-only file, it was completely read into memory, even when it would not fit. Now create a swap file for a read-only file when running out of memory while reading the file. When using ":set cino={s,e-s", a line after "} else {" was not indented properly. Also added a check for this in test3.in. The Hebrew mapping for the command line was remembered for the next command line. That isn't very useful, a command is not Hebrew. (Kol) When completing file names with embedded spaces, like "Program\ files", this didn't work. Also for user commands. Moved backslash_halve() down to mch_expandpath(). When using "set mouse=a" in Ex mode, mouse events were handled like typed text. Then typing "quit" screwed up the mouse behavior of the xterm. When repeating an insert with "." that contains a CTRL-Y, a number 5 was inserted as "053". Yanking a Visual area, with the cursor past the line, didn't move the cursor back onto the line. Same for "~", "u", "U" and "g?" Win32: Default for 'grepprg' could be "findstr /n" even though there is no findstr.exe (Windows 95). Check if it exists, and fall back to "grep -n" if it doesn't. Because gui_mouse_moved() inserted a leftmouse click in the input buffer, remapping a leftmouse click caused strange effects. Now Insert another code in the input buffer. Also insert a leftmouse release, to avoid the problem with ":map <LeftMouse> l" that the next release is seen as the release for the focus click. With 'wrap' on, when using a line that doesn't fit on the screen, if the start of the Visual area is before the start of the screen, there was no highlighting. Also, 'showbreak' doesn't work properly. DOS, Win32: A pattern "[0-9]\+" didn't work in autocommands. When creating a swap file for a buffer which isn't the current buffer, could get a mixup of short file name, resulting in a long file name when a short file name was required. makeswapname() was calling modname() instead of buf_modname(). When a function caused an error, and the error message was very long because of recursiveness, this would cause a crash. 'suffixes' were always compared with matching case. For MS-DOS, Win32 and OS/2 case is now ignored. The use of CHARBITS in regexp.c didn't work on some Linux. Don't use it. When generating a script file, 'cpo' was made empty. This caused backslashes to disappear from mappings. Set it to "B" to avoid that. Lots of typos in the documentation. (Campbell) When editing an existing (hidden) buffer, jump to the last used cursor position. (Madsen) On a Sun the xterm screen was not restored properly when suspending. (Madsen) When $VIMINIT is processed, 'nocompatible' was only set after processing it. Unix: Polling for a character wasn't done for GPM, Sniff and Xterm clipboard all together. Cleaned up the code for using select() too. When executing external commands from the GUI, some typeahead was lost. Added some code to regain as much typeahead as possible. When the window height is 5 lines or fewer, <PageDown> didn't use a one-line overlap, while <PageUp> does. Made sure that <PageUp> uses the same overlap as <PageDown>, so that using them both always displays the same lines. Removed a few unused functions and variables (found with lint). Dictionary completion didn't use 'infercase'. (Raul) Configure tests failed when the Perl library was not in LD_LIBRARY_PATH. Don't use the Perl library for configure tests, add it to the linker line only when linking Vim. When using ncurses/terminfo, could get a 't_Sf' and 't_Sb' termcap entry that has "%d" instead of "%p1%d". The light background colors didn't work then. GTK GUI with ncurses: Crashed when starting up in tputs(). Don't use tputs() when the GUI is active. Could use the ":let" command to set the "count", "shell_error" and "version" variables, but that didn't work. Give an error message when trying to set them. On FreeBSD 3.0, tclsh is called tclsh8.0. Adjusted configure.in to find it. When Vim is linked with -lncurses, but python uses -ltermcap, this causes trouble: "OOPS". Configure now removes the -ltermcap. :@" and :*" didn't work properly, because the " was recognized as the start of a comment. Win32s GUI: Minimizing the console where a filter command runs in caused trouble for detecting that the filter command has finished. (Negri) After executing a filter command from an xterm, the mouse would be disabled. It would work again after changing the mode. Mac GUI: Crashed in newenv(). (St-Amant) The menus and mappings in mswin.vim didn't handle text ending in a NL correctly. (Acevedo) The ":k" command didn't check if it had a valid argument or extra characters. Now give a meaningful error message. (Webb) On SGI, the signal function doesn't always have three arguments. Check for struct sigcontext to find out. Might still be wrong... Could crash when using 'hlsearch' and search pattern is "^". When search patterns were saved and restored, status of no_hlsearch was not also saved and restored (from ":nohlsearch" command). When using setline() to make a line shorter, the cursor position was not adjusted. MS-DOS and Win95: When trying to edit a file and accidentally adding a slash or backslash at the end, the file was deleted. Probably when trying to create the swap file. Explicitly check for a trailing slash or backslash before trying to read a file. X11 GUI: When starting the GUI failed and received a deadly signal while setting the title, would lock up when trying to exit, because the title is reset again. Avoid using mch_settitle() recursively. X11 GUI: When starting the GUI fails, and then trying it again, would crash, because argv[] has been freed and x11_display was reset to NULL. Win32: When $HOME was set, would put "~user" in the swap file, which would never compare with a file name, and never cause the attention message. Put the full path in the swap file instead. Win32 console: There were funny characters at the end of the "vim -r" swap files message (direct output of CR CR LF). DOS 32 bit: "vim -r" put the text at the top of the window. GUI: With 'mousefocus' set, got mouse codes as text with "!sleep 100" or "Q". Motif and Win32 GUI: When changing 'guifont' to a font of the same size the screen wasn't redrawn. Unix: When using ":make", jumping to a file b.c, which is already open as a symbolic link a.c, opened a new buffer instead of using the existing one. Inserting text in the current buffer while sourcing the .vimrc file would cause a crash or hang. The memfile for the current buffer was never allocated. Now it's allocated as soon as something is written in the buffer. DOS 32 bit: "lightblue" background worked for text, but not drawn parts were black. DOS: Colors of console were not restored upon exiting. When recording, with 'cmdheight' set to 2 and typing Esc> in Insert mode caused the "recording" message to be doubled. Spurious "file changed" messages could happen on Windows. Now tolerate a one second difference, like for Linux. GUI: When returning from Ex mode, scrollbars were not updated. Win32: Copying text to the clipboard containing a <CR>, pasting it would replace it with a <NL> and drop the next character. Entering a double byte character didn't work if the second byte is in [xXoO]. (Eric Lee) vim_realloc was both defined and had a prototype in proto/misc2.pro. Caused conflicts on Solaris. A pattern in an autocommand was treated differently on DOS et al. than on Unix. Now it's the same, also when using backslashes. When using <Tab> twice for command line completion, without a match, the <Tab> would be inserted. (Negri) Bug in MS-Visual C++ 6.0 when compiling ex_docmd.c with optimization. (Negri) Testing the result of mktemp() for failure was wrong. Could cause a crash. (Peters) GUI: When checking for a ".gvimrc" file in the current directory, didn't check for a "_gvimrc" file too. Motif GUI: When using the popup menu and then adding an item to the menu bar, the menu bar would get very high. Mouse clicks and special keys (e.g. cursor keys) quit the more prompt and dialogs. Now they are ignored. When at the more-prompt, xterm selection didn't work. Now use the 'r' flag in 'mouse' also for the more-prompt. When selecting a Visual area of more than 1023 lines, with 'guioptions' set to "a", could mess up the display because of a message in free_yank(). Removed that message, except for the Amiga. Moved auto-selection from ui_write() to the screen update functions. Avoids unexpected behavior from a low-level function. Also makes the different feedback of owning the selection possible. Vi incompatibility: Using "i<CR>" in an indent, with 'ai' set, used the original indent instead of truncating it at the cursor. (Webb) ":echo x" didn't stop at "q" for the more prompt. Various fixes for Macintosh. (St-Amant) When using 'selectmode' set to "exclusive", selecting a word and then using CTRL-] included the character under the cursor. Using ":let a:name" in a function caused a crash. (Webb) When using ":append", an empty line didn't scroll up. DOS etc.: A file name starting with '!' didn't work. Added '!' to default for 'isfname'. BeOS: Compilation problem with prototype of skip_class_name(). (Price) When deleting more than one line, e.g., with "de", could still use "U" command, which didn't work properly then. Amiga: Could not compile ex_docmd.c, it was getting too big. Moved some functions to ex_cmds.c. The expand() function would add a trailing slash for directories. Didn't give an error message when trying to assign a value to an argument of a function. (Webb) Moved including sys/ptem.h to after termios.h. Needed for Sinix. OLE interface: Don't delete the object in CVimCF::Release() when the reference count becomes zero. (Cordell) VisVim could still crash on exit. (Erhardt) "case a: case b:" (two case statements in one line) aligned with the second case. Now it uses one 'sw' for indent. (Webb) Font initialisation wasn't right for Athena/Motif GUI. Moved the call to highlight_gui_started() gui_mch_init() to gui_mch_open(). (Nam) In Replace mode, backspacing over a TAB before where the replace mode started while 'sts' is different from 'ts', would delete the TAB. Win32 console: When executing external commands and switching between the two console screens, Vim would copy the text between the buffers. That caused the screen to be messed up for backtick expansion. ":winpos -1" then ":winpos" gave wrong error message. Windows commander creates files called c:\tmp\$wc\abc.txt. Don't remove the backslash before the $. Environment variables were not expanded anyway, because of the backslash before the dollar. Using "-=" with ":set" could remove half a part when it contains a "\,". E.g., ":set path+=a\\,b" and then "set path-=b" removed ",b". When Visually selecting lines, with 'selection' set to "inclusive", including the last char of the line, "<<" moved an extra line. Also for other operators that always work on lines. link.sh changed "-lnsl_s" to "_s" when looking for "nsl" to be removed. Now it only remove whole words. When jumped to a mark or using "fz", and there is an error, the current column was lost. E.g. when using "$fzj". The "g CTRL-G" command could not be interrupted, even though it can take a long time. Some terminals do have <F4> and <xF4>. <xF4> was always interpreted as <F4>. Now map <xF4> to <F4>, so that the user can override this. When compiling os_win32.c with MIN_FEAT the apply_autocmds() should not be used. (Aaron) This autocommand looped forever: ":au FileChangedShell * nested e <afile>" Now FileChangeShell never nests. (Roemer) When evaluating an ":elseif" that was not going to matter anyway, ignore errors. (Roemer) GUI Lesstif: Tearoff bar was the last item, instead of the first. GUI Motif: Colors of tear-off widgets was wrong when 't' flag added to 'guioptions' afterwards. When 't' flag in 'guioptions' is excluded, would still get a tearoff item in a new menu. An inode number can be "long long". Use ino_t instead of long. Added configure check for ino_t. Binary search for tags was using a file offset "long" instead of "off_t". Insert mode completion of tags was not using 'ignorecase' properly. In Insert mode, the <xFn> keys were not properly mapped to <Fn> for the default mappings. Also caused errors for ":mkvimrc" and ":mksession". When jumping to another window while in Insert mode, would get the "warning: changing readonly file" even when not making a change. A '(' or '{' inside a trailing "//" comment would disturb C-indenting. When using two labels below each other, the second one was not indented properly. Comments could mess up C-indenting in many places. (Roemer) Could delete or redefine a function while it was being used. Could cause a crash. In a function it's logical to prepend "g:" to a system variable, but this didn't work. (Roemer) Hangul input: Buffer would overflow when user inputs invalid key sequence. (Nam) When BufLoad or BufEnter autocommands change the topline of the buffer in the window, it was overruled and the cursor put halfway the window. Now only put the cursor halfway if the autocommands didn't change the topline. Calling exists("&option") always returned 1. (Roemer) Win32: Didn't take actually available memory into account. (Williams) White space after an automatically inserted comment leader was not removed when 'ai' is not set and <CR> hit just after inserting it. (Webb) A few menus had duplicated accelerators. (Roemer) Spelling errors in documentation, quite a few "the the". (Roemer) Missing prototypes for Macintosh. (Kielhorn) Win32: When using 'shellquote' or 'shellxquote', the "!start cmd" wasn't executed in a disconnected process. When resizing the window, causing a line before the cursor to wrap or unwrap, the cursor was displayed in the wrong position. There was quite a bit of dead code when compiling with minimal features. When doing a ":%s///" command that makes lines shorter, such that lines above the final cursor position no longer wrap, the cursor position was not updated. get_id_list() could allocate an array one too small, when a "contains=" item has a wildcard that matches a group name that is added just after it. E.g.: "contains=a.*b,axb". Give an error message for it. When yanking a Visual area and using the middle mouse button -> crash. When clipboard doesn't work, now make "* always use "". Win32: Using ":buf a\ b\file" didn't work, it was interpreted as "ab\file". Using ":ts ident", then hit <CR>, with 'cmdheight' set to 2: command line was not cleared, the tselect prompt was on the last but one line. mksession didn't restore the cursor column properly when it was after a tab. Could not get all windows back when using a smaller terminal screen. Didn't restore all windows when "winsize" was not in 'sessionoptions'. (Webb) Command line completion for ":buffer" depended on 'ignorecase' for Unix, but not for DOS et al.. Now don't use 'ignorecase', but let it depend on whether file names are case sensitive or not (like when expanding file names). Win32 GUI: (Negri) - Redrawing the background caused flicker when resizing the window. Removed _OnEraseBG(). Removed CS_HREDRAW and CS_VREDRAW flags from the sndclass.style. - Some parts of the window were drawn in grey, instead of using the color from the user color scheme. - Dropping a file on gvim didn't activate the window. - When there is no menu ('guioptions' excludes 'm'), never use the ALT key for it. GUI: When resizing the window, would make the window height a bit smaller. Now round off to the nearest char cell size. (Negri) In Vi the ")" and "(" commands don't stop at a single space after a dot. Added 'J' flag in 'cpoptions' to make this behave Vi compatible. (Roemer) When saving a session without any buffers loaded, there would be a ":normal" command without arguments in it. (Webb) Memory leaks fixed: (Madsen) - eval.c: forgot to release func structure when func deleted - ex_docmd.c: forgot to release string after "<sfile>" - misc1.c: leak when completion pattern had no matches. - os_unix.c: forgot to release regexp after file completions Could crash when using a buffer without a name. (Madsen) Could crash when doing file name completion, because of backslash_halve(). (Madsen) ":@a" would do mappings on register a, which is not Vi compatible. (Roemer) ":g/foo.*()/s/foobar/_&/gc" worked fine, but then "n" searched for "foobar" and displayed "/foo.*()". (Roemer) OS/2: get_cmd_output() was not included. Didn't check for $VIM/.vimrc file. Command line completion of options didn't work after "+=" and "-=". Unix configure: Test for memmove()/bcopy()/memcpy() tried redefining these functions, which could fail if they are defined already. Use mch_memmove() to redefine. Unix: ":let a = expand("`xterm`&")" started an xterm asynchronously, but ":let a = expand("`xterm&`")" generated an error message, because the redirection was put after the '&'. Win32 GUI: Dialog buttons could not be selected properly with cursor keys, when the default is not the first button. (Webb) The "File has changed since editing started" (when regaining focus) could not always be seen. (Webb) When starting with "ex filename", the file message was overwritten with the "entering Ex mode" message. Output of ":tselect" listed name of file directly from the tags file. Now it is corrected for the position of the tags file. When 'backspace' is 0, could backspace over autoindent. Now it is no longer allowed (Vi compatible). In Replace mode, when 'noexpandtab' and 'smarttab' were set, and inserting Tabs, backspacing didn't work correctly for Tabs inserted at the start of the line (unless 'sts' was set too). Also, when replacing the first non-blank after which is a space, rounding the indent was done on the first non-blank instead of on the character under the cursor. When 'sw' at 4, 'ts' at 8 and 'smarttab' set: When a tab was appended after four spaces (they are replaced with a tab) couldn't backspace over the tab. In Insert mode, with 'bs' set to 0, couldn't backspace to before autoindent, even when it was removed with CTRL-D. When repeating an insert command where a <BS>, <Left> or other key causes an error, would flush buffers and remain in Insert mode. No longer flush buffers, only beep and continue with the insert command. Dos and Win32 console: Setting t_me didn't work to get another color. Made this works backwards compatible. For Turkish (LANG = "tr") uppercase 'i' is not an 'I'. Use ASCII uppercase translation in vim_strup() to avoid language problems. (Komur) Unix: Use usleep() or nanosleep() for mch_delay() when available. Hopefully this avoids a hangup in select(0, ..) for Solaris 2.6. Vim would crash when using a script file with 'let &sp = "| tee"', starting vim with "vim -u test", then doing ":set sp=". The P_WAS_SET flag wasn't set for a string option, could cause problems with any string option. When using "cmd | vim -", stdin is not a terminal. This gave problems with GPM (Linux console mouse) and when executing external commands. Now close stdin and re-open it as a copy of stderr. Syntax highlighting: A "nextgroup" item was not properly stored in the state list. This caused missing of next groups when not redrawing from start to end, but starting halfway. Didn't check for valid values of 'ttymouse'. When executing an external command from the GUI, waiting for the child to terminate might not work, causing a hang. (Parmelan) "make uninstall" didn't delete the vimrc_example.vim and gvimrc_example.vim files and the vimtutor. Win32: "expand("%:p:h")" with no buffer name removed the directory name. "fnamemodify("", ":p")" did not add a trailing slash, fname_case() removed it. Fixed: When 'hlsearch' was set and the 'c' flag was not in 'cpoptions': highlighting was not correct. Now overlapping matches are handled correctly. Athena, Motif and GTK GUI: When started without focus, cursor was shown as if with focus. Don't include 'shellpipe' when compiled without quickfix, it's not used. Don't include 'dictionary' option when compiled without the +insert_expand feature. Only include the 'shelltype' option for the Amiga. When making a change to a line, with 'hlsearch' on, causing it to wrap, while executing a register, the screen would not be updated correctly. This was a generic problem in update_screenline() being called while must_redraw is VALID. Using ":bdelete" in a BufUnload autocommand could cause a crash. The window height was added to another window twice in close_window(). Win32 GUI: When removing a menu item, the tearoff wasn't updated. (Negri) Some performance bottlenecks removed. Allocating memory was not efficient. For Win32 checking for available memory was slow, don't check it every time now. On NT obtaining the user name takes a long time, cache the result (for all systems). fnamemodify() with an argument ":~:." or ":.:~" didn't work properly. When editing a new file and exiting, the marks for the buffer were not saved in the viminfo file. ":confirm only" didn't put up a dialog. These text objects didn't work when 'selection' was "exclusive": va( vi( va{ vi{ va< vi< vi[ va[. The dialog for writing a readonly file didn't have a valid default. (Negri) The line number used for error messages when sourcing a file was reset when modelines were inspected. It was wrong when executing a function. The file name and line number for an error message wasn't displayed when it was the same as for the last error, even when this was long ago. Now reset the name/lnum after a hit-enter prompt. In a session file, a "%" in a file name caused trouble, because fprintf() was used to write it to the file. When skipping statements, a mark in an address wasn't skipped correctly: "ka|if 0|'ad|else|echo|endif". (Roemer) ":wall" could overwrite a not-edited file without asking. GUI: When $DISPLAY was not set or starting the GUI failed in another way, the console mode then started with wrong colors and skipped initializations. Now do an early check if the GUI can be started. Don't source the menu.vim or gvimrc when it will not. Also do normal terminal initializations if the GUI might not start. When using a BufEnter autocommand to position the cursor and scroll the window, the cursor was always put at the last used line and halfway the window anyhow. When 'wildmode' was set to "longest,list:full", ":e *.c<Tab><Tab>" didn't list the matches. Also avoid that listing after a "longest" lists the wrong matches when the first expansion changed the string in front of the cursor. When using ":insert", ":append" or ":change" inside a while loop, was not able to break out of it with a CTRL-C. Win32: ":e ." took an awful long time before an error message when used in "C:\". Was caused by adding another backslash and then trying to get the full name for "C:\\". ":winpos -10 100" was working like ":winpos -10 -10", because a pointer was not advanced past the '-' sign. When obtaining the value of a hidden option, would give an error message. Now just use a zero value. OS/2: Was using argv[0], even though it was not a useful name. It could be just "vim", found in the search path. Xterm: ":set columns=78" didn't redraw properly (when lines wrap/unwrap) until after a delay of 'updatetime'. Didn't check for the size-changed signal. 'scrollbind' didn't work in Insert mode. Horizontal scrollbinding didn't always work for "0" and "$" commands (e.g., when 'showcmd' was off). When compiled with minimal features but with GUI, switching on the mouse in an xterm caused garbage, because the mouse codes were not recognized. Don't enable the mouse when it can't be recognized. In the GUI it also didn't work, the arguments to the mouse code were not interpreted. When 'showbreak' used, in Insert mode, when the cursor is just after the last character in the line, which is also the in the rightmost column, the cursor position would be like the 'showbreak' string is shown, but it wasn't. Autocommands could move the cursor in a new file, so that CTRL-W i didn't show the right line. Same for when using a filemark to jump to another file. When redefining the argument list, the title used for other windows could be showing the wrong info about the position in the argument list. Also update this for a ":split" command without arguments. When editing file 97 of 13, ":Next" didn't work. Now it goes to the last file in the argument list. Insert mode completion (for dictionaries or included files) could not be interrupted by typing an <Esc>. Could get hit-enter prompt after line completion, or whenever the informative message would get too long. When using the ":edit" command to re-edit the same file, an autocommand to jump to the last cursor position caused the cursor to move. Now set the last used cursor position to avoid this. When 'comments' has a part that starts with white space, formatting the comment didn't work. At the ":tselect" prompt Normal mode mappings were used. That has been disabled. When 'selection' is not "old", some commands still didn't allow the cursor past the end-of-line in Visual mode. Athena: When a menu was deleted, it would appear again (but not functional) when adding another menu. Now they don't reappear anymore (although they are not really deleted either). Borland C++ 4.x had an optimizer problem in fill_breakat_flags(). (Negri) "ze" didn't work when 'number' was on. (Davis) Win32 GUI: Intellimouse code didn't work properly on Windows 98. (Robinson) A few files were including proto.h a second time, after vim.h had already done that, which could cause problems with the vim_realloc() macro. Win32 console: <M-x> or ALT-x was not recognized. Also keypad '+', '-' and '*'. (Negri) MS-DOS: <M-x> didn't work, produced a two-byte code. Now the alphabetic and number keys work. (Negri) When finding a lot of matches for a tag completion, the check for avoiding double matches could take a lot of time. Add a line_breakcheck() to be able to interrupt this. (Deshpande) When the command line was getting longer than the screen, the more-prompt would be given regularly, and the cursor position would be wrong. Now only show the part of the command line that fits on the screen and force the cursor to be positioned on the visible part. There can be text after the cursor which isn't editable. At the more prompt and with the console dialog, a cursor key was interpreted as <Esc> and OA. Now recognize special keys in get_keystroke(). Ignore mouse and scrollbar events. When typing a BS after inserting a middle comment leader, typing the last char of the end comment leader still changed it into the end comment leader. (Webb) When a file system is full, writing to a swap file failed. Now first try to write one block to the file. Try next entry in 'dir' if it fails. When "~" is in 'whichwrap', doing "~" on last char of a line didn't update the display. Unix: Expanding wildcards for ":file {\\}" didn't work, because "\}" was translated to "}" before the shell got it. Now don't remove backslashes when wildcards are going to be expanded. Unix: ":e /tmp/$uid" didn't work. When expanding environment variables in a file name doesn't work, use the shell to expand the file name. ":e /tmp/$tty" still doesn't work though. "make test" didn't always work on DOS/Windows for test30, because it depended on the external "echo" command. The link.sh script used "make" instead of $MAKE from the Makefile. Caused problems for generating pathdef.c when "make" doesn't work properly. On versions that can do console and GUI: In the console a typed CSI code could cause trouble. The patterns in expression evaluation didn't ignore the 'l' flag in 'cpoptions'. This broke the working of <CR> in the options window. When 'hls' off and 'ai' on, "O<Esc>" did remove the indent, but it was still highlighted red for trailing space. Win32 GUI: Dropping an encrypted file on a running gvim didn't work right. Vim would loop while outputting "*" characters. vgetc() was called recursively, thus it returns NUL. Added safe_vgetc(), which reads input directly from the user in this situation. While reading text from stdin, only an empty screen was shown. Now show that Vim is reading from stdin. The cursor shape wasn't set properly when returning to Insert mode, after using a CTRL-O /asdf command which fails. It would be OK after a few seconds. Now it's OK right away. The 'isfname' default for DOS/Windows didn't include the '@' character. File names that contained "dir\@file" could not be edited. Win32 console: <C-S-Left> could cause a crash when compiled with Borland or egcs. (Aaron) Unix and VMS: "#if HAVE_DIRENT_H" caused problems for some compilers. Use "#ifdef HAVE_DIRENT_H" instead. (Jones) When a matching tag is in the current file but has a search pattern that doesn't match, the cursor would jump to the first line. Unix: Dependencies for pty.c were not included in Makefile. Dependency of ctags/config.h was not included (only matters for parallel make). Removed a few Uninitialized Memory Reads (potential crashes). In do_call() calling clear_var() when not evaluating. In win32_expandpath() and dos_expandpath() calling backslash_halve() past the end of a file name. Removed memory leaks: Set_vim_var_string() never freed the value. The next_list for a syntax keyword was never freed. On non-Unix systems, using a file name with wildcards without a match would silently fail. E.g., ":e *.sh".  The life/life.mac, urm/urm.mac and hanoi/hanoi.mac files were not recognized as Vim scripts. Renamed them to *.vim. [Note: some numbered patches are not relevant when upgrading from version 5.3, they have been removed] Patch 5.4m.1 Problem: When editing a file with a long name, would get the hit-enter prompt, even though all settings are such that the name should be truncated to avoid that. filemess() was printing the file name without truncating it. Solution: Truncate the message in filemess(). Use the same code as for msg_trunc_attr(), which is moved to the new function msg_may_trunc(). Files: src/message.c, src/proto/message.pro, src/fileio.c Patch 5.4m.3 Problem: The Motif libraries were not found by configure for Digital Unix. Solution: Add "/usr/shlib" to the search path. (Andy Kahn) Files: src/configure.in, src/configure Patch 5.4m.5 Problem: Win32 GUI: When using the Save-As menu entry and selecting an existing file in the file browser, would get a dialog to confirm overwriting twice. (Ed Krall) Solution: Removed the dialog from the file browser. It would be nicer to set the "forceit" flag and skip Vim's ":confirm" dialog, but it requires quite a few changes to do that. Files: src/gui_w32.c Patch 5.4m.6 Problem: Win32 GUI: When reading text from stdin, e.g., "cat foo | gvim -", a message box would pop up with "-stdin-" (when exiting). (Michael Schaap) Solution: Don't switch off termcap mode for versions that are GUI-only. They use another terminal to read from stdin. Files: src/main.c, src/fileio.c Patch 5.4m.7 Problem: Unix: running configure with --enable-gtk-check, --enable-motif-check, --enable-athena-check or --enable-gtktest had the reverse effect. (Thomas Koehler) Solution: Use $enable_gtk_check variable correctly in AC_ARG_ENABLE(). Files: src/configure.in, src/configure Patch 5.4m.9 Problem: Multi-byte: With wrapping lines, the cursor was sometimes 2 characters to the left. Syntax highlighting was wrong when a double-byte character was split for a wrapping line. When 'showbreak' was on the splitting also didn't work. Solution: Adjust getvcol() and win_line(). (Chong-Dae Park) Files: src/charset.c, src/screen.c Patch 5.4m.11 Problem: The ":call" command didn't check for illegal trailing characters. (Stefan Roemer) Solution: Add the check in do_call(). Files: src/eval.c Patch 5.4m.13 Problem: With the ":s" command: 1. When performing a substitute command, the mouse would be disabled and enabled for every substitution. 2. The cursor position could be beyond the end of the line. Calling line_breakcheck() could try to position the cursor, which causes a crash in the Win32 GUI. 3. When using ":s" in a ":g" command, the cursor was not put on the first non-white in the line. 4. There was a hit-enter prompt when confirming the substitution and the replacement was a bit longer. Solution: 1. Only disable/enable the mouse when asking for confirmation. 2. Always put the cursor on the first character, it is going to be moved to the first non-blank anyway. Don't use the cursor position in gui_mch_draw_hollow_cursor(), get the character from the screen buffer. 3. Added global_need_beginline flag to call beginline() after ":g" has finished all substitutions. 4. Clear the need_wait_return flag after prompting the user. Files: src/ex_cmds.c, src/gui_w32.c Patch 5.4m.14 Problem: When doing "vim xxx", ":opt", ":only" and then ":e xxx" we end up with two swapfiles for "xxx". That is caused by the ":bdel" command which is executed when unloading the option-window. Also, there was no check if closing a buffer made the new one invalid, this could cause a crash. Solution: When closing a buffer causes the current buffer to be deleted, use the new buffer to replace it. Also detect that the new buffer has become invalid as a side effect of closing the current one. Make autocommand that calls ":bdel" in optwin.vim nested, so that the buffer loading it triggers also executes autocommands. Also added a test for this in test13. Files: runtime/optwin.vim, src/buffer.c, src/ex_cmds.c, src/globals.h src/testdir/test13.in, src/testdir/test13.ok Patch 5.4m.15 Problem: When using a BufEnter autocommand to reload the syntax file, conversion to HTML caused a crash. (Sung-Hyun Nam) Solution: When using ":syntax clear" the current stack of syntax items was not cleared. This will cause memory to be used that has already been freed. Added call to invalidate_current_state() in syntax_clear(). Files: src/syntax.c Patch 5.4m.17 Problem: When omitting a ')' in an expression it would not be seen as a failure. When detecting an error inside (), there would be an error message for a missing ')' too. When using ":echo 1+|echo 2" there was no error message. (Roemer) When using ":exe 1+" there was no error message. When using ":return 1+" there was no error message. Solution: Fix do_echo(), do_execute() and do_return() to give an error message when eval1() returns FAIL. Fix eval6() to handle trailing ')' correctly and return FAIL when it's missing. Files: src/eval.c Patch 5.4m.18 Problem: When using input() from inside an expression entered with "CTRL-R =" on the command line, there could be a crash. And the resulting command line was wrong. Solution: Added getcmdline_prompt(), which handles recursive use of getcmdline() correctly. It also sets the command line prompt. Removed cmdline_prompt(). Also use getcmdline_prompt() for getting the crypt key in get_crypt_key(). Files: src/proto/ex_getln.pro, src/ex_getln.c, src/eval.c, src/misc2.c Patch 5.4m.21 Problem: When starting up, the screen structures were first allocated at the minimal size, then initializations were done with Rows possibly different from screen_Rows. Caused a crash in rare situations (GTK with XIM and fontset). Solution: Call screenalloc() in main() only after calling ui_get_winsize(). Also avoids a potential delay because of calling screenclear() while "starting" is non-zero. Files: src/main.c Patch 5.4m.22 Problem: In the GUI it was possible that the screen was resized and the screen structures re-allocated while redrawing the screen. This could cause a crash (hard to reproduce). The call sequence goes through update_screen() .. syntax_start() .. ui_breakcheck() .. gui_resize_window() .. screenalloc(). Solution: Set updating_screen while redrawing. If the window is resized remember the new size and handle it only after redrawing is finished. This also fixes that resizing the screen while still redrawing (slow syntax highlighting) would not work properly. Also disable display_hint, it was never used. Files: src/globals.h, src/gui.c, src/screen.c, src/proto/gui.pro Patch 5.4m.23 Problem: When using expand("<cword>") when there was no word under the cursor, would get an error message. Same for <cWORD> and <cfile>. Solution: Don't give an error message, return an empty string. Files: src/eval.c Patch 5.4m.24 Problem: ":help \|" didn't find anything. It was translated to "/\\|". Solution: Translate "\|" into "\\bar". First check the table for specific translations before checking for "\x". Files: src/ex_cmds.c Patch 5.4m.25 Problem: Unix: When using command line completion on files that contain ''', '"'' or '|' the file name could not be used. Adding this file name to the Buffers menu caused an error message. Solution: Insert a backslash before these three characters. Adjust Mungename() function to insert a backslash before '|'. Files: src/ex_getln.c, runtime/menu.vim Patch 5.4m.26 Problem: When using a mapping of two function keys, e.g., <F1><F1>, and only the first char of the second key has been read, the mapping would not be recognized. Noticed on some Unix systems with xterm. Solution: Add 'K' flag to 'cpoptions' to wait for the whole key code, even when halfway a mapping. Files: src/option.h, src/term.c Patch 5.4m.27 Problem: When making test33 without the lisp feature it hangs. Interrupting the execution of the script then might cause a crash. Solution: In inchar(), after closing a script, don't use buf[] anymore. closescript() has freed typebuf[] and buf[] might be pointing inside typebuf[]. Avoid that test33 hangs when the lisp feature is missing. Files: src/getchar.c src/testdir/test33.in "os2" was missing from the feature list. Useful for has("os2"). BeOS: - Included patches from Richard Offer for BeOS R4.5. - menu code didn't work right. Crashed in the Buffers menu. The window title wasn't set. (Offer) Patch 5.4n.3 Problem: C-indenting was wrong after " } else". The white space was not skipped. Visible when 'cino' has "+10". Solution: Skip white space before calling cin_iselse(). (Norbert Zeh) Files: src/misc1.c Patch 5.4n.4 Problem: When the 't' flag in 'cpoptions' is included, after a ":nohlsearch" the search highlighting would not be enabled again after a tag search. (Norbert Zeh) Solution: When setting the new search pattern in jumpto_tag(), don't restore no_hlsearch. Files: src/tag.c Patch 5.4n.5 Problem: When using ":normal" from a CursorHold autocommand Vim hangs. The autocommand is executed down from vgetc(). Calling vgetc() recursively to execute the command doesn't work then. Solution: Forbid the use of ":normal" when vgetc_busy is set. Give an error message when this happens. Files: src/ex_docmd.c, runtime/doc/autocmd.txt Patch 5.4n.6 Problem: "gv" could reselect a Visual that starts and/or ends past the end of a line. (Robert Webb) Solution: Check that the start and end of the Visual area are on a valid character by calling adjust_cursor(). Files: src/normal.c Patch 5.4n.8 Problem: When a mark was on a non existing line (e.g., when the .viminfo was edited), jumping to it caused ml_get errors. (Alexey Marinichev). Solution: Added check_cursor_lnum() in nv_gomark(). Files: src/normal.c Patch 5.4n.9 Problem: ":-2" moved the cursor to a negative line number. (Ralf Schandl) Solution: Give an error message for a negative line number. Files: src/ex_docmd.c Patch 5.4n.10 Problem: Win32 GUI: At the hit-enter prompt, it was possible to scroll the text. This erased the prompt and made Vim look like it is in Normal mode, while it is actually still waiting for a <CR>. Solution: Disallow scrolling at the hit-enter prompt for systems that use on the fly scrolling. Files: src/message.c Patch 5.4n.14 Problem: Win32 GUI: When using ":winsize 80 46" and the height is more than what fits on the screen, the window size was made smaller than asked for (that's OK) and Vim crashed (that's not OK)> Solution: Call check_winsize() from gui_set_winsize() to resize the windows. Files: src/gui.c Patch 5.4n.16 Problem: Win32 GUI: The <F10> key both selected the menu and was handled as a key hit. Solution: Apply 'winaltkeys' to <F10>, like it is used for Alt keys. Files: src/gui_w32.c Patch 5.4n.17 Problem: Local buffer variables were freed when the buffer is unloaded. That's not logical, since options are not freed. (Ron Aaron) Solution: Free local buffer variables only when deleting the buffer. Files: src/buffer.c Patch 5.4n.19 Problem: Doing ":e" (without argument) in an option-window causes trouble. The mappings for <CR> and <Space> are not removed. When there is another buffer loaded, the swap file for it gets mixed up. (Steve Mueller) Solution: Also remove the mappings at the BufUnload event, if they are still present. When re-editing the same file causes the current buffer to be deleted, don't try editing it. Also added a test for this situation. Files: runtime/optwin.vim, src/ex_cmds.c, src/testdir/test13.in, src/testdir/test13.ok Patch 5.4n.24 Problem: BeOS: configure never enabled the GUI, because $with_x was "no". Unix prototypes caused problems, because Display and Widget are undefined. Freeing fonts on exit caused a crash. Solution: Only disable the GUI when $with_x is "no" and $BEOS is not "yes". Add dummy defines for Display and Widget in proto.h. Don't free the fonts in gui_exit() for BeOS. Files: src/configure.in, src/configure, src/proto.h, src/gui.c. The runtime/vim48x48.xpm icon didn't have a transparent background. (Schild) Some versions of the mingw32/egcs compiler didn't have WINBASEAPI defined. (Aaron) VMS: - mch_setenv() had two arguments instead of three. - The system vimrc and gvimrc files were called ".vimrc" and ".gvimrc". Removed the dot. - call to RealWaitForChar() had one argument too many. (Campbell) - WaitForChar() is static, removed the prototype from proto/os_vms.pro. - Many file accesses failed, because Unix style file names were used. Translate file names to VMS style by using vim_fopen(). - Filtering didn't work, because the temporary file name was generated wrong. - There was an extra newline every 9192 characters when writing a file. Work around it by writing line by line. (Campbell) - os_vms.c contained "# typedef int DESC". Should be "typedef int DESC;". Only mattered for generating prototypes. - Added file name translation to many places. Made easy by defining macros mch_access(), mch_fopen(), mch_fstat(), mch_lstat() and mch_stat(). - Set default for 'tagbsearch' to off, because binary tag searching apparently doesn't work for VMS. - make mch_get_host_name() work with /dec and /standard=vaxc. (Campbell) Patch 5.4o.2 Problem: Crash when using "gf" on "file.c://comment here". (Scott Graham) Solution: Fix wrong use of pointers in get_file_name_in_path(). Files: src/window.c Patch 5.4o.3 Problem: The horizontal scrollbar was not sized correctly when 'number' is set and 'wrap' not set. Athena: Horizontal scrollbar wasn't updated when the cursor was positioned with a mouse click just after dragging. Solution: Subtract 8 from the size when 'number' set and 'wrap' not set. Reset gui.dragged_sb when a mouse click is received. Files: src/gui.c Patch 5.4o.4 Problem: When running in an xterm and $WINDOWID is set to an illegal value, Vim would exit with "Vim: Got X error". Solution: When using the display which was opened for the xterm clipboard, check if x11_window is valid by trying to obtain the window title. Also add a check in setup_xterm_clip(), for when using X calls to get the pointer position in an xterm. Files: src/os_unix.c Patch 5.4o.5 Problem: Motif version with Lesstif: When removing the menubar and then using a menu shortcut key, Vim would crash. (raf) Solution: Disable the menu mnemonics when the menu bar is removed. Files: src/gui_motif.c Patch 5.4o.9 Problem: The DOS install.exe program used the "move" program. That doesn't work on Windows NT, where "move" is internal to cmd.exe. Solution: Don't use an external program for moving the executables. Use C functions to copy the file and delete the original. Files: src/dosinst.c Motif and Athena obtained the status area height differently from GTK. Moved status_area_enabled from global.h to gui_x11.c and call xim_get_status_area_height() to get the status area height. Patch 5.4p.1 Problem: When using auto-select, and the "gv" command is used, would not always obtain ownership of the selection. Caused by the Visual area still being the same, but ownership taken away by another program. Solution: Reset the clipboard Visual mode to force updating the selection. Files: src/normal.c Patch 5.4p.2 Problem: Motif and Athena with XIM: Typing 3-byte <multibyte><multibyte><space> doesn't work correctly with Ami XIM. Solution: Avoid using key_sym XK_VoidSymbol. (Nam) Files: src/multbyte.c, src/gui_x11.c Patch 5.4p.4 Problem: Win32 GUI: The scrollbar values were reduced for a file with more than 32767 lines. But this info was kept global for all scrollbars, causing a mixup between the windows. Using the down arrow of a scrollbar in a large file didn't work. Because of round-off errors there is no scroll at all. Solution: Give each scrollbar its own scroll_shift field. When the down arrow is used, scroll several lines. Files: src/gui.h, src/gui_w32.c Patch 5.4p.5 Problem: When changing buffers in a BufDelete autocommand, there could be ml_line errors and/or a crash. (Schandl) Was caused by deleting the current buffer. Solution: When the buffer to be deleted unexpectedly becomes the current buffer, don't delete it. Also added a check for this in test13. Files: src/buffer.c, src/testdir/test13.in, src/testdir/test13.ok Patch 5.4p.7 Problem: Win32 GUI: When using 'mousemodel' set to "popup_setpos" and clicking the right mouse button outside of the selected area, the selected area wasn't removed until the popup menu has gone. (Aaron) Solution: Set the cursor and update the display before showing the popup menu. Files: src/normal.c Patch 5.4p.8 Problem: The generated bugreport didn't contain information about $VIMRUNTIME and whether runtime files actually exist. Solution: Added a few checks to the bugreport script. Files: runtime/bugreport.vim Patch 5.4p.9 Problem: The windows install.exe created a wrong entry in the popup menu. The "%1" was "". The full directory was included, even when the executable had been moved elsewhere. (Ott) Solution: Double the '%' to get one from printf. Only include the path to gvim.exe when it wasn't moved and it's not in $PATH. Files: src/dosinst.c Patch 5.4p.10 Problem: Win32: On top of 5.4p.9: The "Edit with Vim" entry sometimes used a short file name for a directory. Solution: Change the "%1" to "%L" in the registry entry. Files: src/dosinst.c Patch 5.4p.11 Problem: Motif, Athena and GTK: When closing the GUI window when there is a changed buffer, there was only an error message and Vim would not exit. Solution: Put up a dialog, like for ":confirm qa". Uses the code that was already used for MS-Windows. Files: src/gui.c, src/gui_w32.c Patch 5.4p.12 Problem: Win32: Trying to expand a string that is longer than 256 characters could cause a crash. (Steed) Solution: For the buffer in win32_expandpath() don't use a fixed size array, allocate it. Files: src/os_win32.c MSDOS: Added "-Wall" to Makefile.djg compile flags. Function prototypes for fname_case() and mch_update_cursor() were missing. "fd" was unused in mf_sync(). "puiLocation" was unused in myputch(). "newcmd" unused in mch_call_shell() for DJGPP version.
VERSION 5.5 *version-5.5* Version 5.5 is a bug-fix version of 5.4. Changed *changed-5.5* The DJGPP version is now compiled with "-O2" instead of "-O4" to reduce the size of the executables. Moved the src/STYLE file to runtime/doc/develop.txt. Added the design goals to it. 'backspace' is now a string option. See patch 5.4.15. Added *added-5.5* Included Exuberant Ctags version 3.3. (Darren Hiebert) In runtime/mswin.vim, map CTRL-Q to CTRL-V, so that CTRL-Q can be used everywhere to do what CTRL-V used to do. Support for decompression of bzip2 files in vimrc_example.vim. When a patch is included, the patch number is entered in a table in version.c. This allows skipping a patch without breaking a next one. Support for mouse scroll wheel in X11. See patch 5.5a.14. line2byte() can be used to get the size of the buffer. See patch 5.4.35. The CTRL-R CTRL-O r and CTRL-R CTRL-P r commands in Insert mode are used to insert a register literally. See patch 5.4.48. Uninstall program for MS-Windows. To be able to remove the registry entries for "Edit with Vim". It is registered to be run from the "Add/Remove programs" application. See patch 5.4.x7. Fixed *fixed-5.5* When using vimrc_example.vim: An error message when the cursor is on a line higher than the number of lines in the compressed file. Move the autocommand for jumping to the last known cursor position to after the decompressing autocommands. ":mkexrc" and ":mksession" wrote the current value of 'textmode'. That may mark a file as modified, which causes problems. This is a buffer-specific setting, it should not affect all files. "vim --version" wrote two empty lines. Unix: The alarm signal could kill Vim. It is generated by the Perl alarm() function. Ignore SIGALRM. Win32 GUI: Toolbar still had the yellow bitmap for running a Vim script. BeOS: "tmo" must be bigtime_t, instead of double. (Seibert) Patch 5.4.1 Problem: Test11 fails when $GZIP is set to "-v". (Matthew Jackson) Solution: Set $GZIP to an empty string. Files: src/testdir/test11.in Patch 5.4.2 Problem: Typing <Esc> at the crypt key prompt caused a crash. (Kallingal) Solution: Check for a NULL pointer returned from get_crypt_key(). Files: src/fileio.c Patch 5.4.3 Problem: Python: Trying to use the name of an unnamed buffer caused a crash. (Daniel Burrows) Solution: Check for b_fname being a NULL pointer. Files: src/if_python.c Patch 5.4.4 Problem: Win32: When compiled without toolbar, but the 'T' flag is in 'guioptions', there would be an empty space for the toolbar. Solution: Add two #ifdefs where checking for the 'T' flag. (Vince Negri) Files: src/gui.c Patch 5.4.5 Problem: Athena GUI: Using the Buffers.Refresh menu entry caused a crash. Looks like any ":unmenu" command may cause trouble. Solution: Disallow ":unmenu" in the Athena version. Disable the Buffers menu, because the Refresh item would not work. Files: src/menu.c, runtime/menu.vim Patch 5.4.6 Problem: GTK GUI: Using ":gui" in the .gvimrc file caused an error. Only happens when the GUI forks. Solution: Don't fork in a recursive call of gui_start(). Files: src/gui.c Patch 5.4.7 Problem: Typing 'q' at the more prompt for the ATTENTION message causes the file loading to be interrupted. (Will Day) Solution: Reset got_int after showing the ATTENTION message. Files: src/memline.c Patch 5.4.8 Problem: Edit some file, ":he", ":opt": options from help window are shown, but pressing space updates from the other window. (Phillipps) Also: When there are changes in the option-window, ":q!" gives an error message. Solution: Before creating the option-window, go to a non-help window. Use ":bdel!" to delete the buffer. Files: runtime/optwin.vim Patch 5.4.9 Just updates version.h. The real patch has been moved to 5.4.x1. This patch is just to keep the version number correct. Patch 5.4.10 Problem: GTK GUI: When $DISPLAY is invalid, "gvim -f" just exits. It should run in the terminal. Solution: Use gtk_init_check() instead of gtk_init(). Files: src/gui_gtk_x11.c Patch 5.4.11 Problem: When using the 'S' flag in 'cpoptions', 'tabstop' is not copied to the next buffer for some commands, e.g., ":buffer". Solution: When the BCO_NOHELP flag is given to buf_copy_options(), still copy the options used by do_help() when neither the "from" or "to" buffer is a help buffer. Files: src/option.c Patch 5.4.12 Problem: When using 'smartindent', there would be no extra indent if the current line did not have any indent already. (Hanus Adler) Solution: There was a wrongly placed "else", that previously matched with the "if" that set trunc_line. Removed the "else" and added a check for trunc_line to be false. Files: src/misc1.c Patch 5.4.13 Problem: New SGI C compilers need another option for optimisation. Solution: Add a check in configure for "-OPT:Olimit". (Chin A Young) Files: src/configure.in, src/configure Patch 5.4.14 Problem: Motif GUI: When the popup menu is present, a tiny window appears on the desktop for some users. Solution: Set the menu widget ID for a popup menu to 0. (Thomas Koehler) Files: src/gui_motif.c Patch 5.4.15 Problem: Since 'backspace' set to 0 has been made Vi compatible, it is no longer possible to only allow deleting autoindent. Solution: Make 'backspace' a list of parts, to allow each kind of backspacing separately. Files: src/edit.c, src/option.c, src/option.h, src/proto/option.pro, runtime/doc/option.txt, runtime/doc/insert.txt Patch 5.4.16 Problem: Multibyte: Locale zh_TW.Big5 was not checked for in configure. Solution: Add zh_TW.Big5 to configure check. (Chih-Tsun Huang) Files: src/configure.in, src/configure Patch 5.4.17 Problem: GUI: When started from inside gvim with ":!gvim", Vim would not start. ":!gvim -f" works fine. Solution: After forking, wait a moment in the parent process, to give the child a chance to set its process group. Files: src/gui.c Patch 5.4.18 Problem: Python: The clear_history() function also exists in a library. Solution: Rename clear_history() to clear_hist(). Files: src/ex_getln.c, src/eval.c, src/proto/ex_getln.pro Patch 5.4.19 Problem: In a terminal with 25 lines, there is a more prompt after the ATTENTION message. When hitting 'q' here the dialog prompt doesn't appear and file loading is interrupted. (Will Day) Solution: Don't allow quitting the printing of a message for the dialog prompt. Added the msg_noquit_more flag for this. Files: src/message.c Patch 5.4.20 Problem: GTK: When starting gvim, would send escape sequences to the terminal to switch the cursor off and on. Solution: Don't call msg_start() if the GUI is expected to start. Files: src/main.c Patch 5.4.21 Problem: Motif: Toplevel menu ordering was wrong when using tear-off items. Solution: Don't add one to the index for a toplevel menu. Files: src/gui_motif.c Patch 5.4.22 Problem: In Insert mode, <C-Left>, <S-Left>, <C-Right> and <S-Right> didn't update the column used for vertical movement. Solution: Set curwin->w_set_curswant for those commands. Files: src/edit.c Patch 5.4.23 Problem: When a Visual selection is lost to another program, and then the same text is Visually selected again, the clipboard ownership wasn't regained. Solution: Set clipboard.vmode to NUL to force regaining the clipboard. Files: src/normal.c Patch 5.4.24 Problem: Encryption: When using ":r file" while 'key' has already entered, the 'key' option would be messed up. When writing the file it would be encrypted with an unknown key and lost! (Brad Despres) Solution: Don't free cryptkey when it is equal to the 'key' option. Files: src/fileio.c Patch 5.4.25 Problem: When 'cindent' is set, but 'autoindent' isn't, comments are not properly indented when starting a new line. (Mitterand) Solution: When there is a comment leader for the new line, but 'autoindent' isn't set, do C-indenting. Files: src/misc1.c Patch 5.4.26 Problem: Multi-byte: a multi-byte character is never recognized in a file name, causing a backslash before it to be removed on Windows. Solution: Assume that a leading-byte character is a file name character in vim_isfilec(). Files: src/charset.c Patch 5.4.27 Problem: Entries in the PopUp[nvic] menus were added for several modes, but only deleted for the mode they were used for. This resulted in the entry remaining in the PopUp menu. When removing a PopUp[nvic] menu, the name had been truncated, could result in greying-out the whole PopUp menu. Solution: Remove entries for all modes from the PopUp[nvic] menus. Remove the PopUp[nvic] menu entries first, before the name is changed. Files: src/menu.c Patch 5.4.28 Problem: When using a BufWritePre autocommand to change 'fileformat', the new value would not be used for writing the file. Solution: Check 'fileformat' after executing the autocommands instead of before. Files: src/fileio.c Patch 5.4.29 Problem: Athena GUI: When removing the 'g' flag from 'guioptions', using a menu can result in a crash. Solution: Always grey-out menus for Athena, don't hide them. Files: src/menu.c Patch 5.4.30 Problem: BeOS: Suspending Vim with CTRL-Z didn't work (killed Vim). The first character typed after ":sh" goes to Vim, instead of the started shell. Solution: Don't suspend Vim, start a new shell. Kill the async read thread when starting a new shell. It will be restarted later. (Will Day) Files: src/os_unix.c, src/ui.c Patch 5.4.31 Problem: GUI: When 'mousefocus' is set, moving the mouse over where a window boundary was, causes a hit-enter prompt to be finished. (Jeff Walker) Solution: Don't use 'mousefocus' at the hit-enter prompt. Also ignore it for the more prompt and a few other situations. When an operator is pending, abort it first. Files: src/gui.c Patch 5.4.32 Problem: Unix: $LDFLAGS was not passed to configure. Solution: Pass $LDFLAGS to configure just like $CFLAGS. (Jon Miner) Files: src/Makefile Patch 5.4.33 Problem: Unix: After expanding an environment variable with the shell, the next expansion would also use the shell, even though it is not needed. Solution: Reset "recursive" before returning from gen_expand_wildcards(). Files: src/misc1.c Patch 5.4.34 (also see 5.4.x5) Problem: When editing a file, and the file name is relative to a directory above the current directory, the file name was made absolute. (Gregory Margo) Solution: Add an argument to shorten_fnames() which indicates if all file names should be shortened, or only absolute names. In main() only use shorten_fnames() to shorten absolute names. Files: src/ex_docmd.c, src/fileio.c, src/main.c, src/proto/fileio.pro Patch 5.4.35 Problem: There is no function to get the current file size. Solution: Allow using line2byte() with the number of lines in the file plus one. This returns the offset of the line past the end of the file, which is the file size plus one. Files: src/eval.c, runtime/doc/eval.txt Patch 5.4.36 Problem: Comparing strings while ignoring case didn't work correctly for some machines. (Mide Steed) Solution: vim_stricmp() and vim_strnicmp() only returned 0 or 1. Changed them to return -1 when the first argument is smaller. Files: src/misc2.c Patch 5.4.37 (also see 5.4.40 and 5.4.43) Problem: Long strings from the viminfo file are truncated. Solution: When writing a long string to the viminfo file, first write a line with the length, then the string itself in a second line. Files: src/eval.c, src/ex_cmds.c, src/ex_getln.c, src/mark.c, src/ops.c, src/search.c, src/proto/ex_cmds.pro, runtime/syntax/viminfo.vim Patch 5.4.38 Problem: In the option-window, ":set go&" resulted in 'go' being handled like a boolean option. Mappings for <Space> and <CR> were overruled by the option-window. Solution: When the value of an option isn't 0 or 1, don't handle it like a boolean option. Save and restore mappings for <Space> and <CR> when entering and leaving the option-window. Files: runtime/optwin.vim Patch 5.4.39 Problem: When setting a hidden option, spaces before the equal sign were not skipped and cause an error message. E.g., ":set csprg =cmd". Solution: When skipping over a hidden option, check for a following "=val" and skip it too. Files: src/option.c Patch 5.4.40 (depends on 5.4.37) Problem: Compiler error for "atol(p + 1)". (Axel Kielhorn) Solution: Add a typecast: "atol((char *)p + 1)". Files: src/ex_cmds.c Patch 5.4.41 Problem: Some commands that were not included would give an error message, even when after "if 0". Solution: Don't give an error message for an unsupported command when not executing the command. Files: src/ex_docmd.c Patch 5.4.42 Problem: ":w" would also cause a truncated message to appear in the message history. Solution: Don't put a kept message in the message history when it starts with "<". Files: src/message.c Patch 5.4.43 (depends on 5.4.37) Problem: Mixing long lines with multiple lines in a register causes errors when writing the viminfo file. (Robinson) Solution: When reading the viminfo file to skip register contents, skip lines that start with "<". Files: src/ops.c Patch 5.4.44 Problem: When 'whichwrap' includes '~', a "~" command that goes on to the next line cannot be properly undone. (Zellner) Solution: Save each line for undo in n_swapchar(). Files: src/normal.c Patch 5.4.45 (also see 5.4.x8) Problem: When expand("$ASDF") fails, there is an error message. Solution: Remove the global expand_interactively. Pass a flag down to skip the error message. Also: expand("$ASDF") returns an empty string if $ASDF isn't set. Previously it returned "$ASDF" when 'shell' is "sh". Also: system() doesn't print an error when the command returns an error code. Files: many Patch 5.4.46 Problem: Backspacing did not always use 'softtabstop' after hitting <CR>, inserting a register, moving the cursor, etc. Solution: Reset inserted_space much more often in edit(). Files: src/edit.c Patch 5.4.47 Problem: When executing BufWritePre or BufWritePost autocommands for a hidden buffer, the cursor could be moved to a non-existing position. (Vince Negri) Solution: Save and restore the cursor and topline for the current window when it is going to be used to execute autocommands for a hidden buffer. Use an existing window for the buffer when it's not hidden. Files: src/fileio.c Patch 5.4.48 Problem: A paste with the mouse in Insert mode was not repeated exactly the same with ".". For example, when 'autoindent' is set and pasting text with leading indent. (Perry) Solution: Add the CTRL-R CTRL-O r and CTRL-R CTRL-P r commands in Insert mode, which insert the contents of a register literally. Files: src/edit.c, src/normal.c, runtime/doc/insert.txt Patch 5.4.49 Problem: When pasting text with [ <MiddleMouse>, the cursor could end up after the last character of the line. Solution: Correct the cursor position for the change in indent. Files: src/ops.c Patch 5.4.x1 (note: Replaces patch 5.4.9) Problem: Win32 GUI: menu hints were never used, because WANT_MENU is not defined until vim.h is included. Solution: Move the #ifdef WANT_MENU from where MENUHINTS is defined to where it is used. Files: src/gui_w32.c Patch 5.4.x2 Problem: BeOS: When pasting text, one character was moved to the end. Solution: Re-enable the BeOS code in fill_input_buf(), and fix timing out with acquire_sem_etc(). (Will Day) Files: src/os_beos.c, src/ui.c Patch 5.4.x3 Problem: Win32 GUI: When dropping a directory on a running gvim it crashes. Solution: Avoid using a NULL file name. Also display a message to indicate that the current directory was changed. Files: src/gui_w32.c Patch 5.4.x4 Problem: Win32 GUI: Removing an item from the popup menu doesn't work. Solution: Don't remove the item from the menubar, but from the parent popup menu. Files: src/gui_w32.c Patch 5.4.x5 (addition to 5.4.34) Files: src/gui_w32.c Patch 5.4.x6 Problem: Win32: Expanding (dir)name starting with a dot doesn't work. (McCormack) Only when there is a path before it. Solution: Fix the check, done before expansion, if the file name pattern starts with a dot. Files: src/os_win32.c Patch 5.4.x7 Problem: Win32 GUI: Removing "Edit with Vim" from registry is difficult. Solution: Add uninstall program to remove the registry keys. It is installed in the "Add/Remove programs" list for ease of use. Also: don't set $VIM when the executable is with the runtime files. Also: Add a text file with a step-by-step description of how to uninstall Vim for DOS and Windows. Files: src/uninstal.c, src/dosinst.c, src/Makefile.w32, uninstal.txt Patch 5.4.x8 (addition to 5.4.45) Files: many Patch 5.4.x9 Problem: Win32 GUI: After executing an external command, focus is not always regained (when using focus-follows-mouse). Solution: Add SetFocus() in mch_system(). (Mike Steed) Files: src/os_win32.c Patch 5.5a.1 Problem: ":let @* = @:" did not work. The text was not put on the I clipboard. (Fisher) Solution: Own the clipboard and put the text on it. Files: src/ops.c Patch 5.5a.2 Problem: append() did not mark the buffer modified. Marks below the new line were not adjusted. Solution: Fix the f_append() function. Files: src/eval.c Patch 5.5a.3 Problem: Editing compressed ".gz" files doesn't work on non-Unix systems, because there is no "mv" command. Solution: Add the rename() function and use it instead of ":!mv". Also: Disable the automatic jump to the last position, because it changes the jumplist. Files: src/eval.c, runtime/doc/eval.txt, runtime/vimrc_example.vim Patch 5.5a.4 Problem: When using whole-line completion in insert mode while the cursor is in the indent, get "out of memory" error. (Stekrt) Solution: Don't allocate a negative amount of memory in ins_complete(). Files: src/edit.c Patch 5.5a.5 Problem: Win32: The 'path' option can hold only up to 256 characters, because _MAX_PATH is 256. (Robert Webb) Solution: Use a fixed path length of 1024. Files: src/os_win32.h Patch 5.5a.6 Problem: Compiling with gcc on Win32, using the Unix Makefile, didn't work. Solution: Add $(SUFFIX) to all places where an executable is used. Also pass it to ctags. (Reynolds) Files: src/Makefile Patch 5.5a.7 Problem: When using "cat | vim -" in an xterm, the xterm version reply would end up in the file. Solution: Read the file from stdin before switching the terminal to RAW mode. Should also avoid problems with programs that use a specific terminal setting. Also: when using the GUI, print "Reading from stdin..." in the GUI window, to give a hint why it doesn't do anything. Files: src/main.c, src/fileio.c Patch 5.5a.8 Problem: On multi-threaded Solaris, suspending doesn't work. Solution: Call pause() when the SIGCONT signal was not received after sending the SIGTSTP signal. (Nagano) Files: src/os_unix.c Patch 5.5a.9 Problem: 'winaltkeys' could be set to an empty argument, which is illegal. Solution: Give an error message when doing ":set winaltkeys=". Files: src/option.c Patch 5.5a.10 Problem: Win32 console: Using ALTGR on a German keyboard to produce "}" doesn't work, because the 8th bit is set when ALT is pressed. Solution: Don't set the 8th bit when ALT and CTRL are used. (Leipert) Files: src/os_win32.c Patch 5.5a.11 Problem: Tcl: Configure always uses tclsh8.0. Also: Loading a library doesn't work. Solution: Add "--with-tclsh" configure argument to allow specifying another name for the tcl shell. Call Tcl_Init() in tclinit() to make loading libraries work. (Johannes Zellner) Files: src/configure.in, src/configure, src/if_tcl.c Patch 5.5a.12 Problem: The "user_commands" feature is called "user-commands". Solution: Replace "user-commands" with "user_commands". (Kim Sung-bom) Keep "user-commands" for the has() function, to remain backwards compatible with 5.4. Files: src/eval.c, src/version.c Patch 5.5a.13 Problem: OS/2: When $HOME is not defined, "C:/" is used for the viminfo file. That is very wrong when OS/2 is on another partition. Solution: Use $VIM for the viminfo file when it is defined, like for MSDOS. Also: Makefile.os2 didn't depend on os_unix.h. Files: src/os_unix.h, src/Makefile.os2 Patch 5.5a.14 Problem: Athena, Motif and GTK: The Mouse scroll wheel doesn't work. Solution: Interpret a click of the wheel as a key press of the <MouseDown> or <MouseUp> keys. Default behavior is to scroll three lines, or a full page when Shift is used. Files: src/edit.c, src/ex_getln.c, src/gui.c, src/gui_gtk_x11.c, src/gui_x11.c, src/keymap.h, src/message.c, src/misc1.c, src/misc2.c, src/normal.c, src/proto/normal.pro, src/vim.h, runtime/doc/scroll.txt Patch 5.5a.15 Problem: Using CTRL-A in Insert mode doesn't work correctly when the insert started with the <Insert> key. (Andreas Rohrschneider) Solution: Replace <Insert> with "i" before setting up the redo buffer. Files: src/normal.c Patch 5.5a.16 Problem: VMS: GUI does not compile and run. Solution: Various fixes. (Zoltan Arpadffy) Moved functions from os_unix.c to ui.c, so that VMS can use them too: open_app_context(), x11_setup_atoms() and clip_x11* functions. Made xterm_dpy global, it's now used by ui.c and os_unix.c. Use gethostname() always, sys_hostname doesn't exist. Files: src/globals.h, src/gui_x11.c, src/os_vms.mms, src/os_unix.c, src/os_vms.c, src/ui.c, src/proto/os_unix.pro, src/proto/ui.pro Renamed AdjustCursorForMultiByteCharacter() to AdjustCursorForMultiByteChar() to avoid symbol length limit of 31 characters. (Steve P. Wall) Patch 5.5b.1 Problem: SASC complains about dead assignments and implicit type casts. Solution: Removed the dead assignments. Added explicit type casts. Files: src/buffer.c, src/edit.c, src/eval.c, src/ex_cmds.c, src/ex_getln.c, src/fileio.c, src/getchar.c, src/memline.c, src/menu.c, src/misc1.c, src/normal.c, src/ops.c, src/quickfix.c, src/screen.c Patch 5.5b.2 Problem: When using "CTRL-O O" in Insert mode, hit <Esc> and then "o" in another line truncates that line. (Devin Weaver) Solution: When using a command that starts Insert mode from CTRL-O, reset "restart_edit" first. This avoids that edit() is called with a mix of starting a new edit command and restarting a previous one. Files: src/normal.c