version5

version5.txt 适用于 Vim 9.2 版本。 最近更新: 2026年10月 VIM 参考手册 by Bram Moolenaar 译者: Willis 欢迎来到 Vim 5.0 版本! 本文档列出 Vim 4.x 升级至 Vim 5.0 的不兼容变更。虽然标题写 5.0,但同样适用于 5.1、5.2 等后续版本。 vi_diff.txt 概览 Vi 和 Vim 5.0 的差异。 version4.txt 概览 Vim 3.0 和 Vim 4.0 的差异。 不 兼 容 点: incompatible-5 'compatible' 缺省值变更 cp-default 文本排版命令 "Q" 变更 Q-command-changed 命令行参数变更 cmdline-changed 自动命令保留机制 autocmds-kept 'hidden' 用法变更 hidden-changed 文本对象命令变更 text-objects-changed X-Windows 资源移除 x-resources $VIM 的用法 $VIM-use MS-DOS 与 Win32 $HOME 用法 $HOME-use 标签文件格式变更 tags-file-changed 选项变更 options-changed 插入模式下 CTRL-B 移除 i_CTRL-B-gone 新 特 性: new-5 语法高亮 new-highlighting 内置脚本语言 new-script Perl 与 Python 支持 new-perl-python Win32 GUI 版本 added-win32-GUI VMS 版本 added-VMS BeOS 版本 added-BeOS Macintosh GUI 版本 added-Mac 更强的 Vi 兼容性 more-compatible 从标准输入读取 read-stdin 正则表达式模式 added-regexp 标签重载 tag-overloaded 新增命令 new-commands 新增选项 added-options 新增命令行参数 added-cmdline-args 其他新增 added-various 改 进 improvements-5 编 译 时 改 动 compile-changes-5 漏 洞 修 正 bug-fixes-5 5.1 版 本 version-5.1 改动 changed-5.1 新增 added-5.1 修正 fixed-5.1 5.2 版 本 version-5.2 长行可编辑 long-lines 新增文件浏览器 file-browser-5.2 新增对话框 dialogs-added 新增弹出菜单 popup-menu-added 新增选择模式 new-Select-mode 新增会话文件 new-session-files 用户自定义函数与命令 new-user-defined 新增接口 interfaces-5.2 新增移植版本 ports-5.2 多字节支持 new-multi-byte 新增函数 new-functions-5.2 新增选项 new-options-5.2 新增 Ex 命令 new-ex-commands-5.2 改动 changed-5.2 新增 added-5.2 修正 fixed-5.2 5.3 版 本 version-5.3 改动 changed-5.3 新增 added-5.3 修正 fixed-5.3 5.4 版 本 version-5.4 引入运行时目录 new-runtime-dir 引入文件类型 new-filetype-5.4 Vim 脚本续行符 new-line-continuation 会话文件改进 improved-sessions 自动命令改进 improved-autocmds-5.4 加密 new-encryption GTK GUI 移植版本 new-GTK-GUI 菜单变更 menu-changes-5.4 Viminfo 改进 improved-viminfo 若干新增命令 new-commands-5.4 若干新增选项 new-options-5.4 Vim 脚本 new-script-5.4 避免按-回车提示 avoid-hit-enter 快速修复改进 improved-quickfix 正则表达式 regexp-changes-5.4 改动 changed-5.4 新增 added-5.4 修正 fixed-5.4 5.5 版 本 version-5.5 改动 changed-5.5 新增 added-5.5 修正 fixed-5.5 5.6 版 本 version-5.6 改动 changed-5.6 新增 added-5.6 修正 fixed-5.6 5.7 版 本 version-5.7 改动 changed-5.7 新增 added-5.7 修正 fixed-5.7 5.8 版 本 version-5.8 改动 changed-5.8 新增 added-5.8 修正 fixed-5.8 (译者注: 各版本的修正一节,因内容过于琐碎,保留原文未翻译)

不 兼 容 点 incompatible-5

'compatible' 缺省值变更 cp-default

Vim 5.0 致力于更好地兼容 Vi。这方便将 Vim 直接替代 Vi 使用,但会造成部分行为与 4.x 版本不兼容。 4.x 版本中 'compatible' 选项缺省关闭。现在该选项缺省开启。最先会察觉到的是 'u' 命令撤销自身操作。其他连带影响包括映射行为改变甚至失效。 大量从 Vim 4.x 升级至 5.0 的用户会对此感到困扰,因此: Vim 检测到 vimrc 文件存 在时,自动关闭 'compatible'。这项特殊机制保证九成 Vim 用户不会被该改动影响。 具体影响是: - 要用兼容模式、且无 vimrc 文件,无需任何操作。 - 要用非兼容模式、且存在 vimrc 文件,无需任何操作。 - 要用兼容模式、且存在 vimrc 文件,可在 vimrc 文件最开头写入: :set compatible - 要用非兼容模式、且无 vimrc 文件,可选方案之一: - 创建空 vimrc 文件 (Unix 为 '~/.vimrc')。 - 在 .exrc 文件或 $EXINIT 中加入命令: :set nocompatible - 使用 -N 参数启动 Vim。 如果刚接触 Vi 和 Vim,强烈推荐开启 'nocompatible'。Vi 存在很多非预期副作用, 开启非兼容模式可以规避这些问题。参见 'compatible'。 如果需要部分兼容特性与部分非兼容特性,可通过 'cpoptions' 微调兼容行为。 当以 "ex" 或 "gex" 程序名调用 Vim 时,Vim 总是以兼容模式启动。 文本排版命令 "Q" 变更 Q-command-changed

Q 命令过去用于按 'textwidth' 指定宽度格式化文本行。该功能现在改为 gq 。改动 原因是, Q 是 Vi 标准命令,用于进入 Ex 模式;Vim 现已完整实现 Ex 模式。 如果仍想用 "Q" 执行格式化,添加映射: :noremap Q gq 如果同时需要保留原 "Q" 的功能: :noremap gQ Q 命令行参数变更 cmdline-changed

现在命令行的文件参数与选项参数可以混合使用,选项可以写在文件名之后。示例: vim main.c -g 编辑以 '-' 开头的文件时不能这样使用,此时用 "--" 参数 --- : vim -g -- -main.c -v 现在代表以 Vi 模式启动 Ex;只读模式改用 -R 。 旧版: "vim -v file" -v 新版: "vim -R file" -R -e 现在代表以 Ex 模式启动 Vi;快复模式改用 -q 。 旧版: "vim -e errorfile" -e 新版: "vim -q errorfile" -q Ex 模式下的 "-s" 现在代表静默 (批处理) 模式。 -s-ex -x 预留给加密功能;Amiga 平台用 -f 避免启动时新建 CLI。 旧版: 'vim -x file' -x 新版: 'vim -f file' -f Vim 最多支持十个 "+cmd" 与 "-c cmd" 参数。旧版只会执行最后一条。 -n 会覆盖 vimrc 内 'updatecount' 的设置,但不影响 gvimrc。 自动命令保留机制 autocmds-kept

5.0 之前: 事件、文件名匹配规则、命令完全相同的自动命令,仅能定义一次。简单自动 命令 (设置选项) 不受影响;但复杂场景下,同一条命令需要重复注册时,该限制会引发 问题。Vim 5.0 会保存全部自动命令,并严格按定义顺序执行。 最明显的副作用是,如果多次加载同一个 vimrc,其中的自动命令会重复注册。可任选下 面方法规避: - 定义前先清除已存在的同名自动命令。示例: :au! * *.ext :au BufEnter *.ext ... - 将自动命令包裹在 ":if" 判断中。示例: if !exists("did_ext_autocmds") let did_ext_autocmds = 1 autocmd BufEnter *.ext ... endif - 使用自动命令组,定义前清空组内规则 :augroup : augroup uncompress au! au BufReadPost *.gz ... augroup END 'hidden' 用法变更 hidden-changed

4.x 版本中,仅有部分命令会用到 'hidden' 选项。现在所有缓冲区从窗口里消失的命令 都会遵循该选项。 过去在已修改的缓冲区执行 ":buf xxx",缓冲区就会转为隐藏。现在必须手动开启 'hidden' 选项才能实现该行为。 新逻辑更简洁: Vim 隐藏缓冲区与否,不再取决于执行的具体命令。 - 未置位 'hidden': 不会产生隐藏缓冲区。例外: :hide 、 :close !;极少数场景 中,不隐藏就会丢失缓冲区修改内容。 - 置位 'hidden': 几乎不会卸载缓冲区。例外: :bunload 、 :bdel 。 :buffer 现在支持感叹号 "!": 丢弃当前缓冲区的改动。 :bnext 、 :brewind 等命 令同样支持。 文本对象命令变更 text-objects-changed

文本对象命令启用新命名。此举可扩充更多文本对象,腾出单字符给其他可视模式命令。 可用单字符已耗尽,因此文本对象名称改为双字符,首字符固定为 'i' 或 'a'。 旧版 新版 a aw 一个单词 v_aw A aW 一个字串 v_aW s as 一个句子 v_as p ap 一个段落 v_ap S ab 一个 () 块 v_ab P aB 一个 {} 块 v_aB 另有一组以 "i" 开头的文本对象,代表 "内含" (inner)。选中范围和对应 "a" 对象一 致,但不包含空白。 X-Windows 资源移除 x-resources

Vim 不再支持以下 X 资源: - boldColor - italicColor - underlineColor - cursorColor Vim 现改用高亮组设置颜色,避免粗体字体附带固定颜色带来的混淆。参见 :highlight 与 gui-resources 。 $VIM 的用法 $VIM-use

Vim 现通过 VIM 环境变量查找全部系统文件,包括全局 vimrc、gvimrc、menu.vim、联 机帮助与语法文件。参见 $VIM 。5.4 版本起,也可使用 $VIMRUNTIME 。 Unix 平台执行 "make install" 时,Vim 会自动设置 $VIM 缺省值。 如果未设置 $VIM,缺省值取自 'helpfile' 的目录但去掉末尾 "/doc/help.txt"。 MS-DOS 与 Win32 $HOME 的用法 $HOME-use

MS-DOS 和 Win32 版 Vim 在查找 vimrc 或 exrc 文件、读写 viminfo 文件时,现优先 读取 $HOME。旧版在这些平台使用 $VIM,多用户环境下会引发问题。现在仅当未设置 $HOME 或目标文件在 $HOME 不存在时,才回退使用 $VIM。参见 _vimrc 。 标签文件格式变更 tags-file-changed

标签文件 (tags) 的字段仅允许制表符分隔。方便支持文件名包含空格,同时保持 Vi 兼 容性。旧版 Vim 允许任意空白符分隔字段。如果现有标签文件字段之间不是单一制表 符,可打开标签文件并执行: :%s/\(\S*\)\s\+\(\S*\)\s\+\(.*\)/\1\t\2\t\3/ 选项变更 options-changed

'errorfile' 缺省值由 "errors.vim" 改为 "errors.err"。原因是 ".vim" 后缀应当仅 用于 Vim 脚本。 :make 不再使用 'errorfile' 选项,防止手动保存的错误文件被该命令输出覆盖。现 改用 'makeef' 选项,可生成唯一文件名,避免多个并发 :make 命令互相覆盖文件。 开启 'insertmode' 后,额外行为变化: - 普通模式下按 <Esc> 进入插入模式。 - 插入模式下按 <Esc> 不会退出插入模式。 - 执行 `:set im` 时,立刻切换至插入模式。 当 'fileformat' (旧名 'textmode') 和缓冲区初始格式不一致时,Vim 会判定缓冲区已 修改。 插入模式下 CTRL-B 移除 i_CTRL-B-gone

编译开启 +rightleft 特性时,曾经可用 CTRL-B 切换 'revins' 选项。但部分用户在 按 CTRL-V / CTRL-N 时误触 'B' 键,触发后很难发现如何恢复。 切换 'revins' 可通过如下映射轻易实现,因此决定移除该快捷键。仍可用 CTRL-_ 完成 切换 i_CTRL-_ 。 :imap <C-B> <C-O>:set revins!<CR>

新 特 性 new-5

语法高亮 new-highlighting

Vim 新增一套高度灵活的机制,几乎可以为任意类型文件提供高亮。参见 syntax 。概 要: :syntax on 可为语法高亮设置颜色与属性;'highlight' 选项的 ':' 场景的其他高亮项同样适用。 所有高亮项都会绑定一个高亮组,由该组定义渲染样式。参见 :highlight 。缺省配色 已优化。 可使用 "Normal" 组设置彩色终端的缺省前景与背景色;GUI 版本还能通过该组指定字 体。 "2html.vim" 脚本可将带语法高亮的文件转为 HTML,颜色与 Vim 内显示完全一致。借助 HTML 查看器还能彩色打印文件。 内置脚本语言 new-script

新增若干命令与表达式求值器,可编写简洁且功能强大的脚本。包含 ":if"、":while" 等命令。表达式可处理数值与字符串。可使用 '=' 寄存器直接插入表达式计算结果。参 见 expression 。 Perl 与 Python 支持 new-perl-python

Vim 可通过 :perldo 、 :perl 等调用 Perl 代码。参见 perl 。补丁由 Sven Verdoolaege、Matt Gerassimoff 贡献。 Vim 可通过 :python 、 :pyfile 等调用 Python 代码。参见 python 。 这两项功能均需要编译时开启才可用。 Win32 GUI 版本 added-win32-GUI

GUI 已移植到 Windows 95 和 NT。Windows 用户现在可以拥有 X11 GUI 的全部特性。 gui-w32 同时修复 Win32 控制台版在 Windows95 下运行的问题,该系统原生控制台支持一直不 佳。 另有支持 OLE 自动化接口的版本。 if_ole.txt 可通过 VisVim DLL 将 Vim 集成进 Microsoft Developer Studio。 可使用 Borland C++ 编译生成 gvim 的 DLL 版本 (Aaron)。 VMS 版本 added-VMS

Vim 现已支持 VMS 系统。移植工作由 Henk Elbers 完成。 该版本测试尚不充分,但应当可以运行。 抱歉,暂无配套文档! BeOS 版本 added-BeOS

Vim 可运行在 BeOS 系统 (含 BeBox)。 (Olaf Seibert) 参见 os_beos.txt 。 Macintosh GUI 版本 added-Mac

Vim 现已支持 Macintosh。 (Dany St-Amant) 测试尚不充分,请谨慎使用! 参见 os_mac.txt 。 更强的 Vi 兼容性 more-compatible

实现了真正的 Ex 模式。可通过 Q 命令进入,或直接以 "ex" 或 "gex" 程序名启动。 Ex-mode 多级撤销现在始终可用,Vi 兼容模式下同样支持。'cpoptions' 包含 'u' 标志位时, CTRL-R 可用于重做或重复撤销 (类似 Nvi 里 "." 的行为)。 从标准输入读取 read-stdin

使用 "-" 命令行参数时,Vim 从标准输入读取文本。可放在管道末端使用: grep "^a.*" *.c | vim - 参见 -- 。 正则表达式模式 added-regexp

新增原子匹配次数范围写法: "\{a,b}"。 /\{ 新增 "最短匹配" 正则: "\{-}" (Webb)。 /\{- 新增 "\s",匹配空白字符。可替代 "[ \t]"。 /\s 新增 "\S",匹配非空白字符。可替代 "[^ \t]"。 /\S 标签重载 tag-overloaded

使用 C++ 这类语言时,同一个标签名可能对应多个标签。新增命令,可跳转至任意一个 重载标签: :tselect 列出匹配标签,并选择跳转。 :stselect 同上,同时分割窗口。 g_CTRL-] 对光标下的单词执行 :tselect 。 执行 ":ta {标签名}" 存在多条匹配结果后: :tnext 跳转到下一个匹配标签。 :tprevious 跳转到上一个匹配标签。 :trewind 跳转到第一个匹配标签。 :tlast 跳转到最后一个匹配标签。 :tag 命令现支持通配符。对标签进行命令行补全时,末尾可启用大小写不敏感匹配。 新增命令 new-commands

:amenu 为所有模式定义菜单;插入模式会自动插入 CTRL-O,可视模式插入 ESC,命令行模式插入 CTRL-C。用于内置缺省菜单与语法菜单。 :augroup 设定后续自动命令所属组。可对自动命令分组,支持删除指定组。 :crewind 跳转至第一条错误。 :clast 跳转至最后一条错误。 :doautoall 对所有已加载缓冲区执行自动命令。 :echo 输出表达式参数,可展示包含变量的消息。 :execute 执行表达式参数,可动态拼接 Ex 命令。 :hide 类似 ':close'。 :if 内置脚本语言的条件执行。 :intro 显示启动欢迎信息。不带文件参数启动 Vim 时总会执行。 :let 给内部变量赋值。 :omap 为操作符等待模式建立专用映射,支持文本对象命令映射。 :redir 将消息输出重定向至文件。 :update 缓冲区已修改时才写入磁盘。 :while 内置脚本语言的 while 循环。 可视模式: v_O 列块可视模式下按 "O",将光标移至水平对角。 v_D 列块可视模式下按 "D",删除至行尾。 插入模式: i_CTRL-] 触发缩写展开,无需插入任何字符。 新增选项 added-options

'background' 用于选择高亮缺省配色,"syntax.vim" 依据它选取语法颜色。常根据 终端自动设置。 'complete' 设定插入模式补全行为。 'eventignore' 临时忽略自动命令。 'fileformat' 当前文件格式,替代旧选项 'textmode'。 'fileformats' 识别的文件格式列表,替代旧选项 'textauto'。 新增支持 Macintosh 格式: 单个 <CR> 作为换行符。 MS-DOS、Win32、OS/2 平台缺省值为 "dos,unix",即使开启兼容模式 也是如此。设为空时,Unix 格式文件本就无法正常识别。 'guicursor' 设置多种模式下光标形状与闪烁。缺省在插入、替换、操作符等待模式 下自动切换光标;闪烁缺省开启。 'fkmap' 波斯语按键映射。 'hlsearch' 高亮所有匹配上一次搜索模式的文本。 'hkmapp' 音译 (phonetic) 希伯来语映射。(Ilya Dogolazky) 'iconstring' 自定义图标名,非空时生效 (5.2 版本: 字符串按本义使用,换行可生 成两行文本)。 'lazyredraw' 执行宏、寄存器或非手动输入命令时,不刷新屏幕。 'makeef' :make 使用的错误文件。"##" 会替换为唯一编号,防止多 Vim 实例 互相覆盖错误文件。Unix 缺省为 "/tmp/vim##.err";Amiga 则为 "t:vim##.Err";其他平台则为 "vim##.err"。 'matchtime' 开启 'showmatch' 时,括号配对提示的显示时长,单位 0.1 秒,风格 类似 Nvi。 'mousehide' GUI 版本输入文本时隐藏鼠标指针。 'nrformats' 定义 CTRL-A、CTRL-X 识别数值的基底。缺省: "hex,octal"。 'shellxquote' 给整条外壳命令 (含重定向) 增加外层引号。 'softtabstop' 让输入体验等效于 'tabstop' 设为此值,但不修改 'tabstop'。例 如,'ts' 可保持为 8,同时按 <Tab> 得到 4 个空格。 'titlestring' 窗口标题字符串,非空时生效 (5.2 版本: 字符串按本义使用,换行可 生成两行文本)。 'verbose' 日志详细等级。可查看实际加载的 .vimrc、.exrc、.viminfo 等初始 化文件,以及执行的自动命令。也可通过 -V 命令行参数设置。 新增命令行参数 added-cmdline-args

-U 指定加载的 gvimrc 文件,对应 vimrc 的 -u 。 -V 设置 'verbose' 选项,示例: "vim -V10"。 -N 以非兼容模式启动。 -C 以兼容模式启动。 -Z 以受限模式启动,禁止外壳命令;调用 "rvim" 程序名也等效。 -h 显示帮助信息并退出。 其他新增 added-various

新增支持 SNiFF+ 连接 (Toni Leherbauer 提交补丁),Vim 可作为 SNiFF 的编辑器。暂 无配套文档。 内置 bugreport.vim 可用于生成漏洞报告。执行 `:so $VIMRUNTIME/bugreport.vim`, 在当前目录生成 bugreport.txt。 bugs :normal 命令支持范围。可对范围内每一行重复执行同一条命令。 :normal-range 内置波斯语言支持 (Shiran),需编译时开启。参见 farsi 。

改 进 improvements-5

性能优化: - 开启 'showcmd' 时,旧版映射执行很慢,原因是频繁刷新输出。现在大幅改善,开启 'showcmd' 运行 "生命游戏宏" 时效果明显。 - 加入标签文件二分查找补丁 (David O'Neill)。可通过复位 'tagbsearch' 选项关闭该 功能。 - 重复插入时不再更新标尺 (该操作曾严重拖慢速度)。 - Unix 平台: 文件名展开改为内部实现,不再启动外壳。 - 使用 expand_env() 展开环境变量,不再调用外壳。使 `:so $VIMRUNTIME/syntax/syntax.vim` 速度大幅提升。 - 优化光标定位输出: 移动到后续几行靠前列时使用 CR-LF;termios 模式下不重复输出 CR。 - 光标定位算法优化: 当 CR、BS、NL 更短时,优先使用,而不是绝对坐标定位。 - 重复插入 1000ii<Esc> 期间禁止屏幕重绘。 - 长行的 d$ 或 D 命令大幅提速: 一次性删除全部字符,而非逐个删除。 - 选项表按首字母检索,不再从头遍历。 - 使用 highlight_attr[] 数组设置特殊高亮属性,不再在 'highlight' 字符串内搜 索,显著提速。 - 关闭重绘时,不显示模式提示。 - 修改选项时,仅在必要时刷新屏幕。 - Ex 命令用首字母查找表,提升执行性能。 选项变更: 'cinoptions' 新增 'g' 标志位,用于 C++ 作用域声明。 'cpoptions' 新增 'E' 标志位: 禁止对空文本区域执行复制、删除等操作。默认允 许空复制。包含时,空行执行 'y$' 会报错 (符合 Vi 行为)。 新增 'j' 标志位: 仅在 '.' 后合并行时添加两个空格,'?' 和 '!' 后不添加。 新增 'A' 标志位: 不输出 注意 (ATTENTION) 提示消息。 新增 'L' 标志位: 不含且 'list' 打开时,'textwidth' 格式化效果 等同于 'list' 关闭。 新增 'W' 标志位: :w! 行为对齐 Vi: 不覆盖只读文件或他人所属文 件。 'highlight' 新增 '@' 标志位: 控制屏幕最后一行之后的 '@' 字符,以及开启 'list' 时行尾的 '$' 的高亮。 新增 'i' 标志位: 为增量搜索 'incsearch' 设置高亮。默认使用 "IncSearch" 高亮组,链接至 "Visual"。 移除 'h' 标志位 (3.0 版本起已不再使用)。 'guifont' 仅 Win32 GUI: 设为 "*" 时弹出字体选择对话框。 'guipty' 默认开启,大量用户需要该功能。 'path' 支持通配符,"**" 可递归搜索整个目录树。 'shortmess' 新增 'I' 标志位,屏蔽启动欢迎信息。 'viminfo' 新增 '%' 标志位: 在 viminfo 文件中保存缓冲区列表。 - Unix、Win32 平台上调 'maxmem' 和 'maxmemtot' 缺省值。内存硬件降价,多数机器 内存更大。 - 实现 `:set all&`,将全部选项重置为缺省值。 :set 交换文件: - 只读文件不创建交换文件;首次修改时才生成。内存占用过高时也会创建交换文件。 swap-file - 尽可能将交换文件设为隐藏。Unix 通过文件名前置点号实现。DJGPP、Win32 使用长文 件名时同样前置点号,适配挂载的 Unix 文件系统。 :swapname MSDOS 不 设置隐藏 属性,否则会与 share.exe 产生冲突。 - 'updatecount' 缺省值恒非零,Vi 兼容模式也一样。保证存在交换文件,支持崩溃恢 复。 标签相关: - 内置 ctags 2.0 (Darren Hiebert)。静态标签语法从 {tag}:{fname} {fname} {command} 改为 {tag} {fname} {command};" file: 解析更快、更简短,同时兼容 Vi。旧格式仍可识别,但可在 'src/feature.h' 通过 'OLD_STATIC_TAGS' 禁用。 tags-file-format - 标签补全也包含其他文件的静态标签,放在最后。 - 引入 Stephen Riehm 编写的 shtags。 - 找到匹配标签但目标文件不存在时,继续查找其他匹配项。在使用同一 tags 文件 (带 软链接) 维护多版本源码场景很有用。 - 当前文件内的全局匹配标签,优先级高于其他文件内的全局匹配标签。 内置 xxd V1.8 (Juergen Weigert)。 自动命令: - VimLeave 自动命令从写入 viminfo 文件之前改为之后执行。 VimLeave - 允许在自动命令运行过程中修改自动命令,支持自修改自动命令。(来自 Goldberg 的 想法) - 原先带有两个及以上匹配模式的自动命令,":if/:endif" 不能跨行书写;现在所有匹 配到的自动命令在同一个 do_cmdline() 中执行。 - 自动命令不再修改 . 重复执行的命令。 - 自动命令执行完毕后恢复搜索模式,避免 'hlsearch' 高亮被自动命令打乱。 - 匹配自动命令模式时,同时尝试使用短文件名匹配;适合短文件名与展开符号链接后的 全名不一致的场景。 autocmd-patterns - :autocmd 的输出精简,显示效果优化。 - 定义自动命令时展开 <sfile>。 <sfile> - 为 :autocmd 新增 nested 标志位,支持自动命令嵌套。 autocmd-nested - :autocmd 新增 [group] 参数,可覆盖当前生效的组。 autocmd-groups - 新增事件: BufUnload 缓冲区卸载前触发 BufDelete 缓冲区从缓冲区列表删除前触发 FileChangedShell 执行外壳命令后,文件修改时间发生变化时触发 User 用户自定义自动命令 - BufRead* 系列自动命令置位 'modified' 时,该标志位此前会被复位;现在 `:set modified` 的状态会保留。 GUI: - 重绘慢于滚动条事件生成时,滚动条处理逻辑优化。 - `vim -u NONE` 现在不再加载 .gvimrc 和其他图形界面初始化项。 -u 使用 '-U' 指 定其他 gvimrc 文件。 -U - 外部命令支持捕获 CTRL-C,在支持 "setsid()" 的系统同样生效。 - 启动 GUI 时,窗口尺寸限制在屏幕范围内。 - 缺省菜单从 $VIMRUNTIME/menu.vim 读取,便于自定义缺省菜单。 menu.vim - 缺省菜单改进,新增 文件/打印、窗口菜单、语法菜单等。 - :menu 命令支持优先级,菜单放置位置由优先级决定,不受定义顺序影响。 menu-priority 在 Windows 95 上运行 Win32 控制台版本时,启动提示界面给出警告,该版本在 Win95 存在兼容问题。 win32-problems :substitute 命令新增 'e' 标志位: 找不到匹配项时不报错 (Campbell)。 :s 映射内使用搜索命令时,仅最后一条搜索记录存入历史,避免长映射污染搜索历史。 检测启动模式时忽略程序名中 "ex"、"view"、"gvim" 之后的字符,支持 gvim5 这类名 称。 gvim "gview" 以只读模式启动 GUI。 gview 窗口大小调整时,尽可能保持光标相对位置不变。 (Webb) :all 、 :ball 不再先关闭再重新打开同一缓冲区窗口,防止选项、跳跃表等信息丢 失。 如果编译时未开启 GUI 支持, -f 参数会被忽略。 列块可视模式下,鼠标右键选取离点击位置最近的角点。 修改 DOS 等平台缺省映射: 移除 DOS 专属映射,仅保留 Windows 映射;新增 Shift-Insert、Ctrl-Insert、Ctrl-Del、Shift-Del。 :jumps 输出格式调整,可直观看到 {count} CTRL-O 跳转目标。 所有系统都支持用 "~" 代表 $HOME 。 Unix: 除 CTRL-C 外,也读取终端设置里的 INTR 中断字符,部分用户将 INTR 设置为 DEL。 :help 命令参数内允许 <NL> 结束帮助命令,后面可以接续其他命令。 在行首为 " #if" 的行使用 % ,不再跳转到匹配的 "#else";当 'cpo' 包含 "%" 标 志位时, % 不再识别 "#if"、"#else" 等预编译指令。 插入模式 CTRL-N、CTRL-P、CTRL-X 补全机制优化 ins-completion : - 新增 'complete' 选项。 - 开启 'nowrapscan' 且无匹配项时,报错信息中给出搜索方向。 - 重复执行 CTRL-X 系列命令,在匹配项之后追加后续单词或行。 - 追加补全内容时,支持单字符匹配。 - 重复 CTRL-X CTRL-N 不会打断撤销链, . 可以重复整段插入;同时修复 CTRL-N 插 入单词后无法用退格删除的问题。 插入模式下用 CTRL-E、CTRL-Y 从上行/下行复制字符时,不再受 'textwidth' 限制。 i_CTRL-E 参数列表移动命令,如 :n 、 :rew ,保留文件原有光标位置 (基本兼容 Vi)。 Vim 为每个缓冲区独立保存 '<和 '> 位置标记。修复了在一个缓冲区删行后,另一个缓 冲区的 '<、'> 位置标记失效的问题。 '< MSDOS、Unix、OS/2: 未设置 $VIM 时,从可执行文件路径推导。由可执行路径生成 $VIM 时,自动剔除末尾 "src/"。编译后直接运行也能找到文档与语法文件。 $VIM 按 <Esc> 退出可视模式,光标移至选区起始端 (和执行操作符后的行为一致)。 Win32、Unix: 移除外部命令 1100 字符长度限制。 `:edit +命令` 的参数里,反斜杠可用来转义空格。 +cmd 文件恢复后,会执行 BufReadPost 自动命令。 :recover OS/2 控制台 "os2ansi" 新增色彩支持。(Slootman) % 为空时也支持 "%:p:h"。 :_% 新增 "<sfile>": :source 对应的文件名。 <sfile> 新增 "<Bslash>" 特殊字符,减少映射、菜单里多层反斜杠转义。 帮助窗口内双击,跳转到光标下标签 (等价 CTRL-])。 <C-Left>、<C-Right> 改为和 <S-Left>、<S-Right> 一样,按单词前后移动 (适配 Windows)。 <C-Left> 不再要求 .vimrc 里写 :version ,该指令原本无实际作用;版本判断改用 ":if"。 :version MS-DOS、Win32、OS/2: 自动命令匹配文件名时,'/' 和 '\' 路径分隔符不区分。 新增终端能力项: "mb": 闪烁属性,只能赋值给其他高亮项使用。 t_mb "bc": 退格字符。 t_bc "nd": GUI 内光标右移序列,避免粗体最后字符的末尾像素被擦除。 t_nd "xs": hpterm 用,覆盖文字不会清除高亮;配合 'weirdinvert',hpterm 可正常使用可 视模式。 t_xs Unix: 补丁文件、备份文件的修改时间和原文件保持一致。(Hiebert) Amiga: 快速修复模式不再新开窗口;支持执行外壳命令。 并入 David Binette 的 decmouse 补丁,支持 Dec、Netterm 鼠标;需编译时开启。 新增 '#' 寄存器: 轮换文件名。 quote# :dis 命令可查看 '#' 寄存器。 :display Unix: 'isfname' 缺省值移除 ':';仍会识别 "://",MS-DOS 额外识别 ":\\"。 K 命令支持计数;当 'keywordprg' 为 "man" 时,计数传给 man。 2K 等价 `!man 2 <cword>`。 gf 打开相对路径时,自动消去 "../",和 tags 文件处理逻辑一致。 宏录制结束后,录制用的寄存器不会被设为缺省放置寄存器。 "!!" 不再往命令行填入 ":5,5!",而是 ":.!";多处优化,尽可能用 "." 或 "$" 替代 行号。 MSDOS 等: $VIM/viminfo 改名为 $VIM/_viminfo,和 .vimrc/_vimrc 和 .viminfo/_viminfo 命名统一。 文件名大小写不敏感系统 (MSDOS、Amiga) 上,文件名排序忽略大小写,缓冲区名同理。 标准输入读取失败时,改从标准错误读取 (适配 "foo | xargs vim")。 32 位 MS-DOS: csdpmi3 替换为 csdpmi4。 <C-Left>、<C-Right> 修改为按 WORD (字串) 跳转,而非单词。 覆盖文件时提示修改时间变更的警告,不再仅限 Unix。 Unix: configure 缺省配置和 Makefile 缺省对齐,默认开启 GUI、Perl、Python。 部分 Motif 版本需要 "-lXpm",configure 增加该库检测。 链接不再自动添加 "-L/usr/lib",避免在部分系统引发链接故障。

编 译 时 改 动 compile-changes-5

编译时,只需修改 src/feature.h 内一行,即可便捷选择最小、常规、完整特性集。 DOS16 版本编译为最小特性集,避免内存快速耗尽。 Win32、DJGPP、OS/2 版本使用完整特性集,内存充足。 Amiga 提供常规、完整两种特性集版本。 Unix 的 Makefile 新增 "make test",快速校验大部分常规命令及若干特定命令。 DJGPP 版本加入带代码页支持的 setlocale()。 autoconf: - 新增 -lXdmcp 检测。 - 加入 -lXmu 检测,无需手动修改 Makefile。 - 升级至 autoconf 2.12。 - 新增 <poll.h> 检测,Linux 集成 Perl 时可能需要。 - 优先检测 termlib,后检测 termcap。 - 新增 strncasecmp()、stricmp()、strnicmp() 检测。无原生 stricmp 时使用 vim_stricmp()。 - configure 使用 "datadir",不再自行检测 HELPDIR。 Makefile.manx 删除 "make proto",大量 #ifdef 条件编译难以适配。 proto.h 路径移除 "proto/",适配 Mac 移植。 Makefile.mint 大幅重构,现在直接引入 Unix 版 Makefile。 Makefile.b32 更名 Makefile.bor,并在其中加入 Dos16 支持。 全部源码文件制表宽度改为 8 (原先 4),调试与其他工具更友好。'softtabstop' 设为 4,方便编辑。 Unix: 新增 "link.sh" 脚本,移除链接行里部分冗余库。 缺省不启用 HPUX 二合字母,仅在定义 HPUX_DIGRAPHS 时开启。 digraphs-default

漏 洞 修 正 bug-fixes-5

注意: 部分修正仅适用于 4.6 之后 5.0 之前的测试版。 When doing ":bdel", try going to the next loaded buffer. Don't rewind to the start of the buffer list. mch_isdir() for Unix returned TRUE for "" on some systems. Win32: 'shell' set to "mksnt/sh.exe" breaks ":!" commands. Don't use backslashes in the temp file names. On linux, with a FAT file system, could get spurious "file xxx changed since editing started" messages, because the time is rounded off to two seconds unexpectedly. Crash in GUI, when selecting a word (double click) and then extend until an empty line. For systems where isdigit() can't handle characters > 255, get_number() caused a crash when moving the mouse during the prompt for recovery. In Insert mode, "CTRL-O P" left the cursor on the last inserted character. Now the cursor is left after the last putted character. When quickfix found an error type other than 'e' or 'w', it was never printed. A setting for 'errorfile' in a .vimrc overruled the "-q errorfile" argument. Some systems create a file when generating a temp file name. Filtering would then create a backup file for this, which was never deleted. Now no backup file is made when filtering. simplify_filename() could remove a ".." after a link, resulting in the wrong file name. Made simplify_filename also work for MSDOS. Don't use it for Amiga, since it doesn't have "../". otherfile() was unreliable when using links. Could think that reading/writing was for a different file, when it was the same. Pasting with mouse in Replace mode didn't replace anything. Window height computed wrong when resizing a window with an autocommand (could cause a crash). ":s!foo!bar!" wasn't possible (Vi compatible). do_bang() freed memory twice when called recursively, because of autocommands (test11). Thanks to Electric Fence! "v$d" on an empty line didn't remove the "-- VISUAL --" mode message from the command-line, and inverted the cursor. ":mkexrc" didn't check for failure to open the file, causing a crash. (Felderhoff). Win32 mch_write() wrote past fixed buffer, causing terminal keys no longer to be recognized. Both console and GUI version. Athena GUI: Crash when removing a menu item. Now Vim doesn't crash, but the reversing of the menu item is still wrong. Always reset 'list' option for the help window. When 'scrolloff' is non-zero, a 'showmatch' could cause the shown match to be in the wrong line and the window to be scrolled (Acevedo). After ":set all&", 'lines' and 'ttytype' were still non-default, because the defaults never got set. Now the defaults for 'lines' and 'columns' are set after detecting the window size. 'term' and 'ttytype' defaults are set when detecting the terminal type. For (most) non-Unix systems, don't add file names with illegal characters when expanding. Fixes "cannot open swapfile" error when doing ":e *.burp", when there is no match. In X11 GUI, drawing part of the cursor obscured the text. Now the text is drawn over the cursor, like when it fills the block. (Seibert) when started with "-c cmd -q errfile", the cursor would be left in line 1. Now a ":cc" is done after executing "cmd". ":ilist" never ignored case, even when 'ignorecase' set. "vim -r file" for a readonly file, then making a change, got ATTENTION message in insert mode, display mixed up until <Esc> typed. Also don't give ATTENTION message after recovering a file. The abbreviation ":ab #i #include" could not be removed. CTRL-L completion (longest common match) on command-line didn't work properly for case-insensitive systems (MS-DOS, Windows, etc.). (suggested by Richard Kilgore). For terminals that can hide the cursor ("vi" termcap entry), resizing the window caused the cursor to disappear. Using an invalid mark in an Ex address didn't abort the command. When 'smarttab' set, would use 'shiftround' when inserting a TAB after a space. Now it always rounds to a tabstop. Set '[ and '] marks for ":copy", ":move", ":append", ":insert", ":substitute" and ":change". (Acevedo). "d$" in an empty line still caused an error, even when 'E' is not in 'cpoptions'. Help files were stored in the viminfo buffer list without a path. GUI: Displaying cursor was not synchronized with other displaying. Caused several display errors. For example, when the last two lines in the file start with spaces, "dd" on the last line copied text to the (then) last line. Win32: Needed to type CTRL-SHIFT-- to get CTRL-_. GUI: Moving the cursor forwards over bold text would remove one column of bold pixels. X11 GUI: When a bold character in the last column was scrolled up or down, one column of pixels would not be copied. Using <BS> to move the cursor left can sometimes erase a character. Now use "le" termcap entry for this. Keyword completion with regexp didn't work. e.g., for "b.*crat". Fixed: With CTRL-O that jumps to another file, cursor could end up just after the line. Amiga: '$' was missing from character recognized as wildcards, causing $VIM sometimes not to be expanded. ":change" didn't adjust marks for deleted lines. ":help [range]" didn't work. Also for [pattern], [count] and [quotex]. For 'cindent'ing, typing "class::method" doesn't align like a label when the second ':' is typed. When inserting a CR with 'cindent' set (and a bunch of other conditions) the cursor went to a wrong location. 'cindent' was wrong for a line that ends in '}'. 'cindent' was wrong after "else {". While editing the cmdline in the GUI, could not use the mouse to select text from the command-line itself. When deleting lines, marks in tag stack were only adjusted for the current window, not for other windows on the same buffer. Tag guessing could find a function "some_func" instead of the "func" we were looking for. Tags file name relative to the current file didn't work. ":g/pat2/s//pat2/g", causing the number of subs to be reported, used to cause a scroll up. Now you no longer have to hit <CR>. X11 GUI: Selecting text could cause a crash. 32 bit DOS version: CTRL-C in external command killed Vim. When SHELL is set to "sh.exe", external commands didn't work. Removed using of command.com, no longer need to set 'shellquote'. Fixed crash when using ":g/pat/i". Fixed (potential) crash for X11 GUI, when using an X selection. Was giving a pointer on the stack to a callback function, now it's static. Using "#" and "*" with an operator didn't work. E.g. "c#". Command-line expansion didn't work properly after ":*". (Acevedo) Setting 'weirdinvert' caused highlighting to be wrong in the GUI. ":e +4 #" didn't work, because the "4" was in unallocated memory (could cause a crash). Cursor position was wrong for ":e #", after ":e #" failed, because of changes to the buffer. When doing ":buf N", going to a buffer that was edited with ":view", the readonly flag was reset. Now make a difference between ":e file" and ":buf file": Only set/reset 'ro' for the first one. Avoid hit-enter prompt when not able to write viminfo on exit. When giving error messages in the terminal where the GUI was started, GUI escape codes would be written to the terminal. In an xterm this could be seen as a '$' after the message. Mouse would not work directly after ":gui", because full_screen isn't set, which causes starttermcap() not to do its work. 'incsearch' did not scroll the window in the same way as the actual search. When 'nowrap' set, incsearch didn't show a match when it was off the side of the screen. Now it also shows the whole match, instead of just the cursor position (if possible). ":unmap", ":unab" and ":unmenu" did not accept a double quote, it was seen as the start of a comment. Now it's Vi compatible. Using <Up><Left><Left><Up> in the command-line, when there is no previous cmdline in the history, inserted a NUL on the command-line. "i<Esc>" when on a <Tab> in column 0 left the cursor in the wrong place. GUI Motif: When adding a lot of menu items, the menu bar goes into two rows. Deleting menu items, reducing the number of rows, now also works. With ":g/pat/s//foo/c", a match in the first line was scrolled off of the screen, so you could not see it. When using ":s//c", with 'nowrap' set, a match could be off the side of the screen, so you could not see it. When 'helpfile' was set to a fixed, non-absolute path in feature.h, Vim would crash. mch_Fullname can now handle file names in read-only memory. (Lottem) When using CTRL-A or CTRL-@ in Insert mode, there could be strange effects when using CTRL-D next. Also, when repeating inserted text that included "0 CTRL-D" or "^ CTRL-D" this didn't work. (Acevedo) Using CTRL-D after using CTRL-E or CTRL-Y in Insert mode that inserted a '0' or '^', removed the '0' or '^' and more indent. The command "2".p" caused the last inserted text to be executed as commands. (Acevedo) Repeating the insert of "CTRL-V 048" resulted in "^@" to be inserted. Repeating Insert completion could fail if there are special characters in the text. (Acevedo) ":normal /string<CR>" caused the window to scroll. Now all ":normal" commands are executed without scrolling messages. Redo of CTRL-E or CTRL-Y in Insert mode interpreted special characters as commands. Line wrapping for 'tw' was done one character off for insert expansion inserts. buffer_exists() function didn't work properly for buffer names with a symbolic link in them (e.g. when using buffer_exists(#)). Removed the "MOTIF_COMMENT" construction from Makefile. It now works with FreeBSD make, and probably with NeXT make too. Matching the 'define' and 'include' arguments now honor the settings for 'ignorecase'. (Acevedo) When one file shown in two windows, Visual selection mixed up cursor position in current window and other window. When doing ":e file" from a help file, the 'isk' option wasn't reset properly, because of a modeline in the help file. When doing ":e!", a cursor in another window on the same buffer could become invalid, leading to "ml_get: invalid lnum" errors. Matching buffer name for when expanded name has a different path from not expanded name (Brugnara). Normal mappings didn't work after an operator. For example, with ":map Q gq", "QQ" didn't work. When ":make" resulted in zero errors, a "No Errors" error message was given (which breaks mappings). When ":sourcing" a file, line length was limited to 1024 characters. CTRL-V before <EOL> was not handled Vi compatible. (Acevedo) Unexpected exit for X11 GUI, caused by SAVE_YOURSELF event. (Heimann) CTRL-X CTRL-I only found one match per line. (Acevedo) When using an illegal CTRL-X key in Insert mode, the CTRL-X mode message was stuck. Finally managed to ignore the "Quit" menu entry of the Window manager! Now Vim only exists when there are no changed buffers. Trying to start the GUI when $DISPLAY is not set resulted in a crash. When $DISPLAY is not set and gvim starts vim, title was restored to "Thanks for flying Vim". When $DISPLAY not set, starting "gvim" (dropping back to vim) and then selecting text with the mouse caused a crash. "J", with 'joinspaces' set, on a line ending in ". ", caused one space too many to be added. (Acevedo) In insert mode, a CTRL-R {regname} which didn't insert anything left the '"' on the screen. ":z10" didn't work. (Clapp) "Help "*" didn't work. Renamed a lot of functions, to avoid clashes with POSIX name space. When adding characters to a line, making it wrap, the following lines were sometimes not shifted down (e.g. after a tag jump). CTRL-E, with 'so' set and cursor on last line, now does not move cursor as long as the last line is on the screen. When there are two windows, doing "^W+^W-" in the bottom window could cause the status line to be doubled (not redrawn correctly). This command would hang: ":n cat ". Now connect stdin of the external command to /dev/null, when expanding. Fixed lalloc(0,) error for ":echo %:e:r". (Acevedo) The "+command" argument to ":split" didn't work when there was no file name. When selecting text in the GUI, which is the output of a command-line command or an external command, the inversion would sometimes remain. GUI: "-mh 70" argument was broken. Now, when menuheight is specified, it is not changed anymore. GUI: When using the scrollbar or mouse while executing an external command, this caused garbage characters. Showmatch sometimes jumped to the wrong position. Was caused by a call to findmatch() when redrawing the display (when syntax highlighting is on). Search pattern "\(a *\)\{3} did not work correctly, also matched "a a". Problem with brace_count not being decremented. Wildcard expansion added too many non-matching file names. When 'iskeyword' contains characters like '~', "*" and "#" didn't work properly. (Acevedo) On Linux, on a FAT file system, modification time can change by one second. Avoid a "file has changed" warning for a one second difference. When using the page-switching in an xterm, Vim would position the cursor on the last line of the window on exit. Also removed the cursor positioning for ":!" commands. ":g/pat/p" command (partly) overwrote the command. Now the output is on a separate line. With 'ic' and 'scs' set, a search for "Keyword", ignore-case matches were highlighted too. "^" on a line with only white space, put cursor beyond the end of the line. When deleting characters before where insertion started ('bs' == 2), could not use abbreviations. CTRL-E at end of file puts cursor below the file, in Visual mode, when 'so' is non-zero. CTRL-E didn't work when 'so' is big and the line below the window wraps. CTRL-E, when 'so' is non-zero, at end of the file, caused jumping up-down. ":retab" didn't work well when 'list' is set. Amiga: When inserting characters at the last line on the screen, causing it to wrap, messed up the display. It appears that a '\n' on the last line doesn't always cause a scroll up. In Insert mode "0<C-D><C-D>" deleted an extra character, because Vim thought that the "0" was still there. (Acevedo) "z{count}l" ignored the count. Also for "zh" et. al. (Acevedo) "S" when 'autoindent' is off didn't delete leading white space. "/<Tab>" landed on the wrong character when 'incsearch' is set. Asking a yes/no question could cause a hit-enter prompt. When the file consists of one long line (>4100 characters), making changes caused various errors and a crash. DJGPP version could not save long lines (>64000) for undo. "yw" on the last char in the file didn't work. Also fixed "6x" at the end of the line. "6X" at the start of a line fails, but does not break a mapping. In general, a movement for an operator doesn't beep or flush a mapping, but when there is nothing to operate on it beeps (this is Vi compatible). "m'" and "m`" now set the '' mark at the cursor position. Unix: Resetting of signals for external program didn't work, because SIG_DFL and NULL are the same! For "!!yes|dd count=1|, the yes command kept on running. Partly fixed: Unix GUI: Typeahead while executing an external command was lost. Now it's not lost while the command is producing output. Typing <S-Tab> in Insert mode, when it isn't mapped, inserted "<S-Tab>". Now it works like a normal <Tab>, just like <C-Tab> and <M-Tab>. Redrawing ruler didn't check for old value correctly (caused UMR warnings in Purify). Negative array index in finish_viminfo_history(). ":g/^/d|mo $" deleted all the lines. The ":move" command now removes the :global mark from the moved lines. Using "vG" while the last line in the window is a "@" line, didn't update correctly. Just the "v" showed "~" lines. "daw" on the last char of the file, when it's a space, moved the cursor beyond the end of the line. When 'hlsearch' was set or reset, only the current buffer was redrawn, while this affects all windows. CTRL-^, positioning the cursor somewhere from 1/2 to 1 1/2 screen down the file, put the cursor at the bottom of the window, instead of halfway. When scrolling up for ":append" command, not all windows were updated correctly. When 'hlsearch' is set, and an auto-indent is highlighted, pressing <Esc> didn't remove the highlighting, although the indent was deleted. When 'ru' set and 'nosc', using "$j" showed a wrong ruler. Under Xfree 3.2, Shift-Tab didn't work (wrong keysym is used). Mapping <S-Tab> didn't work. Changed the key translations to use the shortest key code possible. This makes the termcode translations and mappings more consistent. Now all modifiers work in all combinations, not only with <Tab>, but also with <Space>, <CR>, etc. For Unix, restore three more signals. And Vim catches SIGINT now, so CTRL-C in Ex mode doesn't make Vim exit. ""a5Y" yanked 25 lines instead of 5. "vrxxx<Esc>" in an empty line could not be undone. A CTRL-C that breaks ":make" caused the errorfile not to be read (annoying when you want to handle what ":make" produced so far). ":0;/pat" didn't find "pat" in line 1. Search for "/test/s+1" at first char of file gave bottom-top message, or didn't work at all with 'nowrapscan'. Bug in viminfo history. Could cause a crash on exit. ":print" didn't put cursor on first non-blank in line. ":0r !cat </dev/null" left cursor in line zero, with very strange effects. With 'showcmd' set and 'timeoutlen' set to a few seconds, trick to position the cursor leftwards didn't work. AIX stty settings were restored to cs5 instead of cs8 (Winn). File name completion didn't work for "zsh" versions that put spaces between file names, instead of NULs. Changed "XawChain*" to "XtChain*", should work for more systems. Included quite a few fixes for rightleft mode (Lottem). Didn't ask to hit-enter when GUI is started and error messages are printed. When trying to edit a file in a non-existent directory, ended up with editing "No file". "gqap" to format a paragraph did too much redrawing. When 'hlsearch' set, only the current window was updated for a new search pattern. Sometimes error messages on startup didn't cause a hit-enter prompt, because of autocommands containing an empty line. Was possible to select part of the window in the border, below the command line. '< and '> marks were not at the correct position after linewise Visual selection. When translating a help argument to "CTRL-x", prepend or append a '_', when applicable. Blockwise visual mode wasn't correct when moving vertically over a special character (displayed as two screen characters). Renamed "struct option" to "struct vimoption" to avoid name clash with GNU getopt(). ":abclear" didn't work (but ":iabclear" and ":cabclear" did work). When 'nowrap' used, screen wasn't always updated correctly. "vim -c split file" displayed extra lines. After starting the GUI, searched the termcap for a "gui" term. When 'hls' used, search for "^$" caused a hang. When 'hls' was set, an error in the last regexp caused trouble. Unix: Only output an extra <EOL> on exit when outputted something in the alternate screen, or when there is a message that needs to be cleared. "/a\{" did strange things, depending on previous search. "c}" only redrew one line (with -u NONE). For mappings, CTRL-META-A was shown as <M-^A> instead of <MC-A>, while :map only accepts <MC-A>. Now <M-C-A> is shown. Unix: When using full path name in a tags file, which contains a link, and 'hidden' set and jumping to a tag in the current file, would get bogus ATTENTION message. Solved by always expanding file names, even when starting with '/'. 'hlsearch' highlighting of special characters (e.g., a TAB) didn't highlight the whole thing. "r<CR>" didn't work correctly on the last char of a line. Sometimes a window resize or other signal caused an endless loop, involving set_winsize(). "vim -r" didn't work, it would just hang (using tgetent() while 'term' is empty). "gk" while 'nowrap' set moved two lines up. When windows are split, a message that causes a scroll-up messed up one of the windows, which required a CTRL-L to be typed. Possible endless loop when using shell command in the GUI. Menus defined in the .vimrc were removed when GUI started. Crash when pasting with the mouse in insert mode. Crash with ":unmenu *" in .gvimrc for Athena. "5>>" shifted 5 lines 5 times, instead of 1 time. CTRL-C when getting a prompt in ":global" didn't interrupt. When 'so' is non-zero, and moving the scrollbar completely to the bottom, there was a lot of flashing. GUI: Scrollbar ident must be long for DEC Alpha. Some functions called vim_regcomp() without setting reg_magic, which could lead to unpredictable magicness. Crash when clicking around the status line, could get a selection with a backwards range. When deleting more than one line characterwise, the last character wasn't deleted. GUI: Status line could be overwritten when moving the scrollbar quickly (or when 'wd' is non-zero). An ESC at the end of a ":normal" command caused a wait for a terminal code to finish. Now, a terminal code is not recognized when its start comes from a mapping or ":normal" command. Included patches from Robert Webb for GUI. Layout of the windows is now done inside Vim, instead of letting the layout manager do this. Makes Vim work with Lesstif! UMR warning in set_expand_context(). Memory leak: b_winlnum list was never freed. Removed TIOCLSET/TIOCLGET code from os_unix.c. Was changing some of the terminal settings, and looked like it wasn't doing anything good. (suggested by Juergen Weigert). Ruler overwrote "is a directory" message. When starting up, and 'cmdheight' set to > 1, first message could still be in the last line. Removed prototype for putenv() from proto.h, it's already in osdef2.h.in. In replace mode, when moving the cursor and then backspacing, wrong characters were inserted. Win32 GUI was checking for a CTRL-C too often, making it slow. Removed mappings for MS-DOS that were already covered by commands. When visually selecting all lines in a file, cursor at last line, then "J". Gave ml_get errors. Was a problem with scrolling down during redrawing. When doing a linewise operator, and then an operator with a mouse click, it was also linewise, instead of characterwise. When 'list' is set, the column of the ruler was wrong. Spurious error message for "/\(b\+\)*". When visually selected many lines, message from ":w file" disappeared when redrawing the screen. ":set <M-b>=^[b", then insert "^[b", waited for another character. And then inserted "<M-b>" instead of the real <M-b> character. Was trying to insert K_SPECIAL x NUL. CTRL-W ] didn't use count to set window height. GUI: "-font" command-line argument didn't override 'guifont' setting from .gvimrc. (Acevedo) GUI: clipboard wasn't used for "*y". And some more Win32/X11 differences fixed for the clipboard (Webb). Jumping from one help file to another help file, with 'compatible' set, removed the 'help' flag from the buffer. File-writable bit could be reset when using ":w!" for a readonly file. There was a wait for CTRL-O n in Insert mode, because the search pattern was shown. Reduced wait, to allow reading a message, from 10 to 3 seconds. It seemed nothing was happening. ":recover" found same swap file twice. GUI: "*yy only worked the second time (when pasting to an xterm)." DJGPP version (dos32): The system flags were cleared. Dos32 version: Underscores were sometimes replaced with y-umlaut (Levin). Version 4.1 of ncurses can't handle tputs("", ..). Avoid calling tputs() with an empty string. <S-Tab> in the command-line worked like CTRL-P when no completion started yet. Now it does completion, last match first. Unix: Could get annoying "can't write viminfo" message after doing "su". Now the viminfo file is overwritten, and the user set back to the original one. ":set term=builtin_gui" started the GUI in a wrong way. Now it's not allowed anymore. But "vim -T gui" does start the GUI correctly now. GUI: Triple click after a line only put last char in selection, when it is a single character word. When the window is bigger than the screen, the scrolling up of messages was wrong (e.g. ":vers", ":hi"). Also when the bottom part of the window was obscured by another window. When using a wrong option only an error message is printed, to avoid that the usage information makes it scroll off the screen. When exiting because of not being able to read from stdin, didn't preserve the swap files properly. Visual selecting all chars in more than one line, then hit "x" didn't leave an empty line. For one line it did leave an empty line. Message for which autocommand is executing messed up file write message (for FileWritePost event). "vim -h" included "-U" even when GUI is not available, and "-l" when lisp is not available. Crash for ":he <C-A>" (command-line longer than screen). ":s/this/that/gc", type "y" two times, then undo, did reset the modified option, even though the file is still modified. Empty lines in a tags file caused a ":tag" to be aborted. When hitting 'q' at the more prompt for ":menu", still scrolled a few lines. In an xterm that uses the bold trick a single row of characters could remain after an erased bold character. Now erase one extra char after the bold char, like for the GUI. ":pop!" didn't work. When the reading a buffer was interrupted, ":w" should not be able to overwrite the file, ":w!" is required. ":cf%" caused a crash. ":gui longfilename", when forking is enabled, could leave part of the longfilename at the shell prompt.

5.1 版 本 version-5.1

5.0 至 5.1 版本之间的改进。 该版本以修复缺陷为主,新增功能不多。 改动 changed-5.1

expand() 函数现在使用 <NL> 分隔文件名,不再用空格,解决含空格文件名的问题。 如需旧行为: 可用 `substitute(expand(foo), "\n", "","g")`。 插入模式词典补全支持反斜杠转义通配符;当 'isk' 包含反斜杠时,可以展开 "ze\kra"。 Win32 GUI 更换新图标。 :tag 、 :tselect 等命令,仅当参数以 '/' 开头时才视作正则表达式。避免 `:tag xx~` 报错 "没有前一个替换正则表达式"。同时修正通配符参数不符合 Vi 兼容的 问题。 带 '/' 时,优先按本义精确匹配,优先级高于通配符匹配。 仅当使用 '/' 形式时,才会忽略大小写查找匹配项,不受 'ignorecase' 开关影响。 修改 g^] : 仅存在多个匹配标签时才执行 :tselect 。 调整部分缺省配色,改善深色背景下可读性。 搜索模式附加字符偏移可以跨到上或下一行;修复 "/pattern/e+2" 在行尾匹配时卡住的 问题。 状态栏双击不再进入可视模式;拖动状态栏也不会终止可视模式。 Perl 接口: Buffers()、Windows() 参数逻辑调整,和 Vim 其余接口保持一致 (Moore)。 初始化 '" 位置标记为首行首字符,自动命令中使用 '" 不会报错。 新增 added-5.1

内部变量 "shell_error": 保存上一条外壳命令返回结果。 :echohl 命令: 设置 :echo 的高亮样式。 'highlight' 选项新增 'S' 标志位、新增 StatusLineNC 高亮组: 非当前窗口状态栏高 亮。缺省当前窗口状态栏为粗体。 新增 buffer_name() 、 buffer_number() 函数 (Aaron)。 substitute() 函数新增 "g" 标志位 (Aaron)。 新增 winheight() 函数。 Win32: 外部命令以 "start " 开头时,不再弹出控制台窗口 (Aaron)。 Win32 控制台: 依据当前控制台属性,用终端能力项序列实现粗体、反色。 configure 增加 strip 工具检测 (Napier)。 插入模式 CTRL-R CTRL-R x: 按寄存器原始文本插入,而非按输入时的转义解析。 部分 "无匹配" 报错附带搜索模式,信息更明确。 "make install" 同步复制宏文件。 tools/tcltags: 外壳脚本,用于从 TCL 文件生成标签文件。 configure 支持 '--with-tlib',方便指定 termlib 库: './configure --with-tlib=termlib'。 'cino' 新增 'u' 标志位,控制内嵌 () 块缩进。 Win32 OLE 版本加载注册类型库失败时,询问是否立即注册 Vim (Erhardt)。 Win32 OLE: 自动注册完成后退出 Vim。 内置 VisVim 1.1b,附带若干改进与新图标 (Heiko Erhardt)。 并入 Vince Negri 的 Win32s 支持补丁,需 VC 4.1 编译。 Perl 接口: 新增 $curbuf;整理 Buffers()、Windows();Msg() 新增 group 参数 (Moore)。 DOS 源码包加入 Perl 相关文件;Makefile.bor、Makefile.w32 支持编译带 Perl 的 Win32 版本。 内置 Ken Scott 新版 Makefile.w32,可编译全部 Win32 版本,含 OLE、Perl、 Python。 新增 CTRL-W g ]、CTRL-W g ^]: 拆分窗口并执行 g] 或 g^] 。 新增 g] : 直接对光标下标识符执行 :tselect 。 新增 :tjump 、 :stjump 命令。 优化标签名较长时 :tselect 的列表展示。 并入 Mac 版本补丁,含 Python 接口支持 (St-Amant)。 `:buf foo` 切换到曾经打开过的缓冲区时,恢复光标列位置。 调整 Makefile,适配 Debian Linux,支持语法文件与脚本部署到不同目标路径。 Amiga: $VIM 全局可用。未定义 $VIM 时缺省使用 "VIM:"。解决了帮助文件需要配置 "VIM:"、语法文件又要配置 $VIM 的问题,二者任选其一即可。 部分 xterm 发送兼容 vt100 的 F1-F4 功能键序列。因无法自动识别该情况,Vim 同时 识别两类按键序列,统一转译为 <F1>–<F4>。 新增 VimEnter 自动事件: 全部启动项加载完成后触发。 BeOS 版本现已支持 Intel CPU (Seibert)。 修正 fixed-5.1

":ts" changed position in the tag stack when cancelled with <CR>. ":ts" changed the cursor position for CTRL-T when cancelled with <CR>. ":tn" would always jump to the second match. Was using the wrong entry in the tag stack. Doing "tag foo", then ":tselect", overwrote the original cursor position in the tag stack. "make install" changed the vim.1 manpage in a wrong way, causing "doc/doc" to appear for the documentation files. When compiled with MAX_FEAT, xterm mouse handling failed. Was caused by DEC mouse handling interfering. Was leaking memory when using selection in X11. CTRL-D halfway a command-line left some characters behind the first line(s) of the listing. When expanding directories for ":set path=", put two extra backslashes before a space in a directory name. When 'lisp' set, first line of a function would be indented. Now its indent is set to zero. And use the indent of the first previous line that is at the same () level. Added test33. "so<Esc>u" in an empty file didn't work. DOS: "seek error in swap file write" errors, when using DOS 6.2 share.exe, because the swap file was made hidden. It's no longer hidden. ":global" command would sometimes not execute on a matching line. Happened when a data block is full in ml_replace(). For AIX use a tgetent buffer of 2048 bytes, instead of 1024. Win32 gvim now only sets the console size for external commands to 25x80 on Windows 95, not on NT. Win32 console: Dead key could cause a crash, because of a missing "WINAPI" (Deshpande). The right mouse button started Visual mode, even when 'mouse' is empty, and in the command-line, a left click moved the cursor when 'mouse' is empty. In Visual mode, 'n' in 'mouse' would be used instead of 'v'. A blinking cursor or focus change cleared a non-Visual selection. CTRL-Home and CTRL-End didn't work for MS-DOS versions. Could include NUL in 'iskeyword', causing a crash when doing insert mode completion. Use _dos_commit() to flush the swap file to disk for MSDOS 16 bit version. In mappings, CTRL-H was replaced by the backspace key code. This caused problems when it was used as text, e.g. ":map _U :%s/.^H//g<CR>". ":set t_Co=0" was not handled like a normal term. Now it's translated into ":set t_Co=", which works. For ":syntax keyword" the "transparent" option did work, although not mentioned in the help. But synID() returned wrong name. "gqG" in a file with one-word-per-line (e.g. a dictionary) was very slow and not interruptible. "gq" operator inserted screen lines in the wrong situation. Now screen lines are inserted or deleted when this speeds up displaying. cindent was wrong when an "if" contained "((". 'r' flag in 'viminfo' was not used for '%'. Could get files in the buffer list from removable media. Win32 GUI with OLE: if_ole_vc.mak could not be converted into a project. Hand-edited to fix this... With 'nosol' set, doing "$kdw" below an empty line positioned the cursor at the end of the line. Dos32 version changed "\dir\file" into "/dir/file", to work around a DJGPP bug. That bug appears to have been fixed, therefore this translation has been removed. "/^*" didn't work (find '*' in first column). "<afile>" was not always set for autocommands. E.g., for ":au BufEnter * let &tags = expand("<afile>:p:h") . "/tags". In an xterm, the window may be a child of the outer xterm window. Use the parent window when getting the title and icon names. (Smith) When starting with "gvim -bg black -fg white", the value of 'background' is only set after reading the .gvimrc file. This causes a ":syntax on" to use the wrong colors. Now allow using ":gui" to open the GUI window and set the colors. Previously ":gui" in a gvimrc crashed Vim. tempname() returned the same name all the time, unless the file was actually created. Now there are at least 26 different names. File name used for <afile> was sometimes full path, sometimes file name relative to current directory. When 'background' was set after the GUI window was opened, it could change colors that were set by the user in the .gvimrc file. Now it only changes colors that have not been set by the user. Ignore special characters after a CSI in the GUI version. These could be interpreted as special characters in a wrong way. (St-Amant) Memory leak in farsi code, when using search or ":s" command. Farsi string reversing for a mapping was only done for new mappings. Now it also works for replacing a mapping. Crash in Win32 when using a file name longer than _MAX_PATH. (Aaron) When BufDelete autocommands were executed, some things for the buffer were already deleted (esp. Perl stuff). Perl interface: Buffer specific items were deleted too soon; fixes "screen no longer exists" messages. (Moore) The Perl functions didn't set the 'modified' flag. link.sh did not return an error on exit, which may cause Vim to start installing, even though there is no executable to install. (Riehm) Vi incompatibility: In Vi "." redoes the "y" command. Added the 'y' flag to 'cpoptions'. Only for 'compatible' mode. ":echohl" defined a new group, when the argument was not an existing group. "syn on" and ":syn off" could move the cursor, if there is a hidden buffer that is shorter that the current cursor position. The " mark was not set when doing ":b file". When a "nextgroup" is used with "skipwhite" in syntax highlighting, space at the end of the line made the nextgroup also be found in the next line. ":he g<CTRL-D>", then ":" and backspace to the start didn't redraw. X11 GUI: "gvim -rv" reversed the colors twice on Sun. Now Vim checks if the result is really reverse video (background darker than foreground). "cat link.sh | vim -" didn't set syntax highlighting. Win32: Expanding "file.sw?" matched ".file.swp". This is an error of FindnextFile() that we need to work around. (Kilgore) "gqgq" gave an "Invalid lnum" error on the last line. Formatting with "gq" didn't format the first line after a change of comment leader. There was no check for out-of-memory in win_alloc(). "vim -h" didn't mention "-register" and "-unregister" for the OLE version. Could not increase 'cmdheight' when the last window is only one line. Now other windows are also made smaller, when necessary. Added a few {} to avoid "suggest braces around" warnings from gcc 2.8.x. Changed return type of main() from void to int. (Nam) Using '~' twice in a substitute pattern caused a crash. "syn on" and ":syn off" could scroll the window, if there is a hidden buffer that is shorter that the current cursor position. ":if 0 | if 1 | endif | endif" didn't work. Same for ":while" and "elseif". With two windows on modified files, with 'autowrite' set, cursor in second window, ":qa" gave a warning for the file in the first window, but then auto-wrote the file in the second window. (Webb) Win32 GUI scrollbar could only handle 32767 lines. Also makes the intellimouse wheel use the configurable number of scrolls. (Robinson) When using 'patchmode', and the backup file is on another partition, the file copying messed up the write-file message. GUI X11: Alt-Backspace and Alt-Delete didn't work. "`0" could put the cursor after the last character in the line, causing trouble for other commands, like "i". When completing tags in insert mode with ^X^], some matches were skipped, because the compare with other tags was wrong. E.g., when "mnuFileSave" was already there, "mnuFile" would be skipped. (Negri) When scrolling up/down, a syntax item with "keepend" didn't work properly. Now the flags are also stored for the syntax state at the start of each line. When 'ic' was changed while 'hlsearch' is on, there was no redraw to show the effect. Win32 GUI: Don't display "No write since last chance" in a message box, but in the Vim window.

5.2 版 本 version-5.2

5.1 和 5.2 版本之间的改进。 长行可编辑 long-lines

窗口容纳不下的单行超长文本不再全部显示为 @@@。重绘从该行靠后的字符开始,保证光 标附近文字可见。开启折行时即可编辑这类长行。 新增文件浏览器 file-browser-5.2

Win32、Athena、Motif 图形界面下, :browse 配合 :e 、 :w 、 :r 、 :so 、 :redirect 、:mkexrc/vimrc/vsess 会弹出文件选择框。`:browse e /foo/bar` 在 /foo/bar 目录打开选择框,适合映射如 `:browse so $vim/macros 。 :browse e` 未指 定初始目录时,编译选项可设为从当前目录或当前缓冲区目录启动。(Negri、Kahn) 新增 'browsedir' 选项,可选值 "current"、"last"、"buffer": 决定浏览对话框起始 目录为上次目录、当前缓冲区目录或工作目录。`:browse w` 不受该选项影响。缺省菜单 改为使用 :browse 。 新增对话框 dialogs-added

新增 :confirm 命令,支持 ":e"、":q"、":w"、":cl"。Win32、Athena、Motif GUI 使用窗口对话框;其余平台在命令行给出提示。`:confirm qa` 询问是否保存全部修改文 件。 新增 confirm() 函数,对外提供确认交互能力。 'guioptions' 新增 'v' 标志位: Win32 GUI 对话框按钮垂直排列;否则优先水平排布。 Win32 GUI: :promptfind 、 :promptrepl 弹出查找替代对话框,供菜单调用。 (Negri) 新增弹出菜单 popup-menu-added

'mousemodel' 设为 "popup" 时,右键唤起名为 "PopUp" 的顶层上下文菜单。"PopUp" 菜单不在普通菜单栏显示。当前仅支持 Win32、Athena GUI。 新增选择模式 new-Select-mode

新增选择模式: 类似可视模式,但输入可打印字符会直接替换选中内容。 - CTRL-G: 在可视模式与选择模式之间切换。 - CTRL-O: 选择模式下临时切到可视模式执行单条命令。 - 新增 'selectmode': 控制何时进入选择模式而非可视模式。 - 新增 'mousemodel': 修改鼠标按键行为。 - 新增 'keymodel': 配置带 Shift + 特殊键触发可视 / 选择模式选区。 - 新增 :behave : 快速切换 'selectmode'、'mousemodel'、'keymodel',适配 MS-Windows 或 xterm 风格。 - xterm 式选区现在称为无模式选区。 - 可视模式映射与菜单在选择模式可用,会自动先切到可视模式;操作后自动重选区域 (选区被删除时除外)。映射中可用 gV 跳过重选。 - 新增 gh 、 gH 、 g_CTRL-H : 进入选择 (高亮) 模式。 - 选择模式下退格删除选中区域。 附带 "mswin.vim" 脚本,配置贴近微软 Windows 的操作习惯。 新增会话文件 new-session-files

:mksession (简写 :mks ) 类似 :mkvimrc ,额外写入已加载缓冲区完整路径与当前 目录,加载该文件时重新打开文件并切换目录,同时保存窗口布局。文件路径相对于会话 文件。 'sessionoptions' 控制 :mksession' 的行为。(Negri) 用户自定义函数与命令 new-user-defined

新增用户自定义函数: 以 :function 开头、 :endfunction 结尾,调用格式 Func() ,支持可变参数。 支持局部变量 "l:name";用 :return 返回值。参见 :function 。 :call 调用函数;带范围时,对范围内每一行执行一次函数。 :call "macros/justify.vim" 是自定义函数示例。 用户函数不会修改最近搜索模式、 . 重复命令。 新增 'maxfuncdepth': 限制函数调用深度,防止无限递归导致内存崩溃。 新增用户自定义 Ex 命令: :command 、 :delcommand 、 :comclear 。(Moore) 参见 user-commands 。 新增接口 interfaces-5.2

Tcl 接口 (Wilken)。参见 tcl 。 提供 :tcl 、 :tcldo 、 :tclfile 命令。 Cscope 支持 (Kahn、Sekera)。参见 cscope 。 提供 :cscope 、 :cstag 命令;配套选项: cscopeprg 、 cscopetag 、 cscopetagorder 、 cscopeverbose 。 新增移植版本 ports-5.2

Amiga GUI 移植版 (Nielsen),尚未经过充分测试! RISC OS 版本 (Thomas Leonard)。参见 riscos 。 可根据调用环境选择 GUI 或文本模式运行。 移除 "os_archie" 相关文件,该部分原本就无法工作。 多字节支持 new-multi-byte new-multibyte

Win32 GUI 增加多字节支持 (Baek)。 'fileencoding' 选项控制文件文本编码。 :ascii 可作用于多字节字符。Windows 95 (英文版) 也支持多字节字符 (Aaron)。 需要在 feature.h 中开启该特性。 尚未经过充分测试! 新增函数 new-functions-5.2

browse() 弹出文件选择框 (Negri) escape() 用反斜杠转义字符串内字符 fnamemodify() 修改文件名 input() 读取用户输入一行 (Aaron);输入内容拥有独立历史记录 argc() argv() 访问命令行参数列表 winbufnr() 获取窗口对应的缓冲区编号 (Aaron) winnr() 获取窗口编号 (Aaron) matchstr() 返回匹配到的字符串 setline() 将一行内容设为指定字符串 新增选项 new-options-5.2

'allowrevins' 开启插入、命令行模式下的 CTRL-_ 'browsedir' 浏览对话框的初始目录 'confirm' 开启后, :q 、 :w 、 :e 自动等效带 :confirm (Negri) 'cscopeprg' 'cscopetag' 'cscopetagorder' 'cscopeverbose' 控制 cscope 行为 'filetype' RISC-OS 专属文件类型 'grepformat' 'grepprg' :grep 命令配套 'keymodel' Shift+特殊键触发可视 / 选择选区 'listchars' 'list' 模式下,行尾、制表符、拖尾空格的显示字符;置位 'nowrap' 时行溢出标记 (部分由 Smith 贡献) 'matchpairs' 支持 '<' 和 '>' 等单字符配对 'mousefocus' 鼠标跟随窗口焦点 (部分由 Terhaar 贡献)。键盘切窗口时移动鼠标指 针;分割窗口、调整窗口高度时同步移动指针 'mousemodel' 修改鼠标按键行为 'selection' "inclusive" 或 "exclusive" 时,光标在可视或选择模式下可到行尾 之后一个字符的位置。设为 "old" 时,使用旧行为。为 "inclusive" 时,包含光标字符。为 "exclusive" 时,使用 'guicursor' 新的 "ve" 项。缺省为垂直线 'selectmode' 配置何时进入选择模式而非可视模式 'sessionoptions' 控制 :mksession 行为 (Negri) 'showfulltag' 插入模式标签补全时,附带展示整理后的标签搜索模式 'swapfile' 是否为缓冲区使用交换文件 'syntax' 加载指定语法;可在模式行里设置 'ttymouse' 让名字不以 "xterm" 开始的终端也能使用 "xterm" 鼠标序列 'wildignore' 补全时忽略的文件匹配模式列表 'wildmode' 'wildchar' 命令行补全展开方式;替代原 CTRL-T;列出全部匹配项时 不响铃 'winaltkeys' Win32、Motif GUI: "yes" 由窗口系统接管 Alt;"no" Vim 接管 Alt,不传递给窗口系统;"menu" 仅菜单快捷键交给窗口系统 'winminheight' 窗口最小高度,缺省 1;设为 0 允许零行窗口,零高窗口隐藏滚动条 (Negri) 新增 Ex 命令 new-ex-commands-5.2

:badd 将文件名添加到缓冲区列表,无副作用。(Negri) :behave 快速设置 MS-Windows 或 xterm 行为。 :browse 使用文件选择对话框。 :call 调用一个函数,可带范围。 :cnewer :colder 访问快修错误列表栈。 :comclear 清除所有用户自定义命令。 :command 定义一个用户命令。 :continue 返回 :while 。 :confirm 若发生意外情况则请求确认。 :cscope 执行 cscope 命令。 :cstag 使用 cscope 跳转至标签。 :delcommand 删除一个用户自定义命令。 :delfunction 删除一个用户自定义函数。 :endfunction 用户自定义函数的结束。 :function 定义一个用户函数。 :grep 工作方式类似 :make 。(Negri) :mksession 创建一个会话文件。 :nohlsearch 暂时停止 'hlsearch' 高亮。 :Print 与 Vi 兼容。与 :print 作用相同。 :promptfind 搜索对话框 (Win32 GUI)。 :promptrepl 搜索 / 替代对话框 (Win32 GUI)。 :return 从用户自定义函数返回。 :simalt Win32 GUI: 模拟按下 Alt 键。(Negri) :smagic 类似 :substitute ,但始终使用 'magic'。 :snomagic 类似 :substitute ,但始终使用 'nomagic'。 :tcl 执行 TCL 命令。 :tcldo 对一定范围的行执行 TCL 命令。 :tclfile 执行一个 TCL 脚本文件。 :tearoff 可撕菜单 (Win32 GUI)。 :tmenu :tunmenu Win32 GUI: 菜单工具提示。(Negri) :star :* 执行一个寄存器。 改动 changed-5.2

重命名的函数: buffer_exists() -> bufexists() buffer_name() -> bufname() buffer_number() -> bufnr() file_readable() -> filereadable() highlight_exists() -> hlexists() highlightID() -> hlID() last_buffer_nr() -> bufnr("$") 旧名称仍然存在,以保持向后兼容。 插入模式和命令行模式下的 CTRL-_ 命令只有在设置新的 'allowrevins' 选项时才可用。 这可避免想输入 SHIFT-_ 的用户意外进入反向插入模式却不知如何退出。 当 :tselect 列表中的文件路径过长时,删除中间的一部分并放入 "..."。 Win32 GUI: 使字体选择器出现在 Vim 窗口内部,而不是随便某个位置。(Negri) :bn 跳过帮助缓冲区,除非当前正处于帮助缓冲区中。(Negri) 当存在状态行且只有一个窗口时,当前窗口的状态行中不显示 '^'。 ":*" 过去用于 "'<,'>",即可视区域。但在 Vi 中它被用作 :@ 的替代。当 'cpoptions' 包含 '*' 时,使用 Vi 兼容行为。 置位 'insertmode' 时,使用 CTRL-O 执行映射将如同未置位 'insertmode' 一样工作。 这允许即使在置位 'insertmode' 时也能使用 "普通" 映射。 'mouse' 已被设置 (例如,在 .vimrc 文件中) 时,GUI 启动时不要自动设置 'mouse'。 从 'mouse' 选项中移除了 'N'、'I' 和 'A' 标志。 将 "开关选项" 更名为 "布尔选项"。有些人以为 ":set xyz" 每次会切换 'xyz' 的开关 状态。 内部变量 "shell_error" 包含外壳返回的错误码,而不只是 0 或 1。 在插入或替换时,输入 CTRL-V CTRL-<CR> 过去会插入 "<C-CR>"。这没什么用处。现在 CTRL 键被忽略,插入一个 <CR>。所有其他带修饰键的 "普通" 键也是如此。映射这些带 修饰的键组合仍然可行。 在插入模式中,可用 CTRL-K 再输入该特殊字符来插入 <C-CR> 和 <S-Space>。 将 "quotes" 文件移至 doc/quotes.txt,将 "todo" 文件移至 doc/todo.txt。它们现在 与其他文档文件一样被安装。 winheight() 函数对不存在的窗口返回 -1。过去返回零,但现在零已是合法的高度。 'selection' 的缺省值是 "inclusive",在使用 "$" 或鼠标在可视模式移动光标时会有 所不同。 当存在已修改但隐藏的缓冲区时, :q! 不退出。请使用 :qa! 强制退出。 缺省禁用 Perl/Python/Tcl 接口。使用它们的人不多,而且它们使可执行文件大很多。 内部脚本语言现在已足够强大,可胜任大多数任务。 'titlestring' 和 'iconstring' 选项的字符串原样用于窗口标题和图标。这样可包含 <CR>。以前 <CR> 会显示为 "^M" (两个字符)。 当在从插入模式启动的可视或选择模式中开始一个映射 (模式显示为 "(插入) 可视") 时,在映射结束前不返回插入模式。这使得可视模式中使用的映射在可视模式由选择模式 启动时也同样有效。 $VIMRUNTIME/menu.vim 中的菜单不再覆盖已存在的菜单。这在 .vimrc 文件中定义菜单 或加载 mswin.vim 时很有帮助。 Unix: 如果 /var/tmp 存在,则用它存放 .swp 文件。那里的文件在重启后仍然存在 (至 少在 Linux 上如此)。 新增 added-5.2

--with-motif-lib configure 参数。允许使用静态 Motif 库。 支持映射数字小键盘的 +、-、*、/ 键。(Negri) 未映射时,它们产生正常的字符。 Win32 GUI: 当目录被拖放到 gVim 上时,切换至该目录并编辑新缓冲区。(Negri) Win32 GUI: 使 CTRL-Break 作为中断工作,这样 CTRL-C 可用于映射。 在 :map 的输出中,高亮 "*",以表明它不是右手边的一部分。(Roemer) 显示可视区域时,光标不被关闭,以便定位。在 GUI 中,可视区域现在以灰色背景高亮。 这使得光标即使反显也可见。 Win32: 当以单个完整路径名启动时 (例如通过双击文件),切换至该文件所在目录。 (Negri) Win32 GUI: 可撕菜单,使用 `:tearoff <菜单名>` 命令。(Negri) 'guioptions' 的 't' 选项: 为 Win32 GUI 和 Motif 添加可撕菜单项。缺省包含。 Win32 GUI: 带子菜单的可撕菜单以 ">>" 标示。(Negri) 新增 ^Kaa 和 ^KAA 二合字母。 在 digraph.c 中新增 "euro" 符号。(Corry) 支持 Motif 菜单快捷键,像 MS-Windows 一样使用 '&' (Ollis)。 其他 GUI 会忽略菜单名中的 '&'。 DJGPP: 更快屏幕更新 (John Lange)。 语法簇 ":syntax cluster" (Bigham)。 包含语法文件: ":syntax include" (Bigham)。 设置 'nosol' 时,切换缓冲区保持列位置 (Radics)。 为 Perl 接口提供 Number 函数。 Athena GUI 中支持 Intellimouse (智能鼠标)。(Jensen) 当使用 "m" 时, :sleep 也接受以毫秒为单位的参数。 在 'guioptions' 中新增 'p' 标志位: 为进入 / 离开窗口事件安装回调。这对 Terhaar 使光标闪烁正常工作,而我的环境则反而不正常。 新增 --help 和 --version 命令行参数。 :list 输出中的非文本以 NonText 高亮。 新增文本对象: "i(" 和 "i)" 作为 "ib" 的同义词。"i{" 和 "i}" 作为 "iB" 的同义 词。新增: "i<" 和 "i>",用于选择 <标签>。所有这些同样适用于 "a" 对象。 'shortmess' 中的 'O' 标志位: 读取文件的提示信息覆盖任何先前信息。(Negri) Win32 GUI: 'guioptions' 中的 'T' 标志位: 开关工具栏。 包含一份自制的工具栏位图列表。(Negri) 为子菜单新增菜单优先级。已在 Win32 和 Motif GUI 中实现。用 :menu 命令显示菜 单优先级。 缺省和语法菜单现在包含条目的优先级。允许在缺省条目之间插入菜单条目。 当 'number' 选项打开时,用 LineNr 组高亮行号。 "Ignore" 高亮组: 以此高亮的文本变为空白。它用于隐藏帮助文本中的特殊字符。 收录 Exuberant Ctags 2.3 版,支持 C++、Java 及递归进入目录。(Hiebert) 当标签文件未排序,且以 (简单方式) 检测到这一点时,给出错误信息。 :unlet 接受 "!" 以忽略不存在的变量,并接受多个参数。(Roemer) 为 :unlet 补全变量名。(Roemer) 当一个被另一函数调用的函数出错时,在错误信息中显示调用栈。 新文件名修饰符: ":.": 将文件名缩减为相对于当前目录。 ":~": 将文件名缩减为相对于主目录。 ":s?pat?sub?": 用 "sub" 替换一次 "pat"。 ":gs?pat?sub?": 用 "sub" 全局替换 "pat"。 新增 configure 参数: --enable-min-features 和 --enable-max-features。 轻松切换至最少或最多特性。 新增编译时特性: modify_fname。用于文件名修饰符,如 "%:p:h"。可禁用以节省一些代 码 (16 位 DOS)。 在插入模式使用整行补全且置位 'cindent' 时,正确缩进行。 MSDOS 和 Win32 控制台: 'guicursor' 设置光标粗细。(Negri) 收录一组新波斯语字体。(Shiran) 加速键文本现在在 Motif 中同样有效。所有菜单都可用 & 定义助记符、用 TAB 定义加 速键文本。在不支持它们的系统上会被忽略。 删除或替换菜单时,只比较助记符之前直到 <Tab> 的菜单名。 :substitute 后的 'i' 和 'I' 标志位: 忽略大小写与否。 若运行时文件缺失,"make install" 会提出警告。 Unix: 当发现一个无法打开的现有交换文件时,在 注意 (ATTENTION) 提示消息中提及文 件的所有者。 'complete' 中的 'i'、't' 和 'k' 选项现在还会输出它们查找匹配的位置。(Acevedo) gJ 命令: 连接行而不插入空格。 将 'keywordprg' 设置为 "man -s" 时会被特别处理。未给计数时移除 "-s",否则加上 计数。configure 检查 "man -s 2 read" 是否可用,并相应设置 'keywordprg' 的缺省 值。 执行 :bd 且只有一个窗口打开时,Vim 会尝试移动到同类型的缓冲区 (即非帮助到非 帮助,帮助到帮助),以便与 :bnext / :bprev 行为一致。(Negri) 允许 "<Nop>"用作映射的右手边。`:map xx <Nop>` 将 "xx" 映射为空操作。 在 :menu 命令中,菜单路径里可用 "<Tab>" 代替真实的制表符。这样更易输入,无需 反斜杠。 为正则模式提供 POSIX 兼容字符类: [:alnum:]、[:alpha:]、[:blank:]、[:cntrl:], [:digit:]、[:graph:]、[:lower:],[:print:],[:punct:],[:space:]、[:upper:] 和 [:xdigit:]。(Briscoe) 正则字符类 (用于快速语法高亮匹配): 数字: \d [0-9] \D 非数位 (Roemer) 十六进制: \x [0-9a-fA-F] \X 非十六进制 八进制: \o [0-7] \O 非八进制 单词: \w [a-zA-Z0-9_] \W 非单词 词首: \h [a-zA-Z_] \H 非词首 字母: \a [a-zA-Z] \A 非字母 小写: \l [a-z] \L 非小写 大写: \u [A-Z] \U 非大写 :set 现在接受 "+="、"^=" 和 "-=": 向字符串选项添加或移除部分内容,向数值选项 加上或减去一个数值。对于以逗号分隔列表的选项,逗号会被自动插入或删除。 新增用于自动命令的文件类型特性。用文件类型而非模式来匹配文件。目前仅用于 RISC OS。(Leonard) 在自动命令的模式中可使用环境变量。它们在自动命令定义时被展开。 BufFilePre 和 BufFilePost 自动命令事件: 在应用 :file 命令更改缓冲区名称 之前和之后。 VimLeavePre 自动命令事件: 在写入 .viminfo 文件之前。 自动命令参数: <abuf> 是缓冲区编号,与 <afile> 类似。 通过保留更多的同步上下文,使向后滚动时语法高亮更快一些。 Win32 GUI: 删除或插入屏幕行时避免重绘,使滚动更快。 GUI: 当滚动条拇指移动不足一个像素时不再重绘滚动条,使滚动更快。 在 bugreport.vim 中包含了 ":highlight"。 创建 install.exe 程序,用于在 DOS 和 MS-Windows 上简单安装。 新寄存器: '_',黑洞。写入它时,什么都不发生。读取它时,它总是空的。可用于避免 删除或修改命令改变寄存器,或减少大改动时的内存使用。 CTRL-V xff 以十六进制数输入字符。CTRL-V o123 以八进制数输入字符。(Aaron) 通过在没有 "keepend" 时跳过检查,提高了语法高亮的性能。 将模式消息 ("-- 插入 --") 移至屏幕最后一行。当 'cmdheight' 大于一时,消息将保 持可读。 列出匹配文件时,它们也按 'suffixes' 排序,使其列出的顺序与 CTRL-N 检索它们时相 同。 synIDattr() 接受第三个 (可选) 参数,用于指明为哪种终端类型获取属性。这使得在 gvim 之外运行 2html.vim 成为可能 (使用颜色名称而非 #RRGGBB)。 内存剖析,仅用于调试。在退出时以及用 g_CTRL-A 命令时显示。(Kahn) DOS: 当使用当前驱动器中的文件时,移除驱动器名: "A:\dir\file" -> "\dir\file"。 这有助于将软盘上的会话文件从 "A:\dir" 移至 "B:\dir"。 将每个窗口记住的跳转次数从 30 增加到 50。 暂时禁用 'hls' 高亮直至下一次搜索的命令: :nohlsearch 。 gp 和 gP 命令: 类似 p 和 P ,但将光标留在插入文本之后。用于 MS-Windows 模式中的 CTRL-V 命令。 修正 fixed-5.2

Win32 GUI: Could draw text twice in one place, for fake-bold text. Removed this, Windows will handle the bold text anyway. (Negri) patch 5.1.1: Win32s GUI: pasting caused a crash (Negri) patch 5.1.2: When entering another window, where characters before the cursor have been deleted, could have a cursor beyond the end of the line. patch 5.1.3: Win32s GUI: Didn't wait for external command to finish. (Negri) patch 5.1.4: Makefile.w32 can now also be used to generate the OLE version (Scott). patch 5.1.5: Crashed when using syntax highlighting: cursor on a line that doesn't fit in the window, and splitting that line in two. patch 5.1.6: Visual highlighting bug: After ":set nowrap", go to end of line (so that the window scrolls horizontally), ":set wrap". Following Visual selection was wrong. patch 5.1.7: When 'tagbsearch' off, and 'ignorecase' off, still could do binary searching. patch 5.1.8: Win32 GUI: dragging the scrollbar didn't update the ruler. patch 5.1.9: Using ":gui" in .vimrc, caused xterm cursor to disappear. patch 5.1.10: A CTRL-N in Insert mode could cause a crash, when a buffer without a name exists. patch 5.1.11: "make test" didn't work in the shadow directory. Also adjusted "make shadow" for the links in the ctags directory. patch 5.1.12: "buf 123foo" used "123" as a count, instead as the start of a buffer name. patch 5.1.13: When completing file names on the command-line, reallocating the command-line may go wrong. patch 5.1.14: ":[nvci]unmenu" removed menu for all modes, when full menu patch specified. Graceful handling of NULLs in drag-dropped file list. Handle passing NULL to Fullname_save(). (Negri) Win32: ":!start" to invoke a program without opening a console, swapping screens, or waiting for completion in either console or gui version. e.g. you can type ":!start winfile". ALSO fixes "can't delete swapfile after spawning a shell" bug. (enhancement of Aaron patch) (Negri) Win32 GUI: Fix CTRL-X default keymapping to be more Windows-like. (Negri) Shorten filenames on startup. If in /foo/bar, entering "vim ../bar/bang.c" displays "bang.c" in status bar, not "/foo/bar/bang.c" (Negri) Win32 GUI: No copy to Windows clipboard when it's not desired. Win32s: Fix pasting from clipboard - made an assumption not valid under Win32s. (Negri) Win32 GUI: Speed up calls to gui_mch_draw_string() and cursor drawing functions. (Negri) Win32 GUI: Middle mouse button emulation now works in GUI! (Negri) Could skip messages when combining commands in one line, e.g.: ":echo "hello" | write". Perl interpreter was disabled before executing VimLeave autocommands. Could not use ":perl" in them. (Aaron) Included patch for the Intellimouse (Aaron/Robinson). Could not set 'ls' to one, when last window has only one line. (Mitterand) Fixed a memory leak when removing menus. After ":only" the ruler could overwrite a message. Dos32: removed changing of __system_flags. It appears to work better when it's left at the default value. p_aleph was an int instead of along, caused trouble on systems where sizeof(int) != sizeof(long). (Schmidt) Fixed enum problems for Ultrix. (Seibert) Small redraw problem: "dd" on last line in file cleared wrong line. Didn't interpret "cmd | endif" when "cmd" starts with a range. E.g. "if 0 | .d | endif". Command "+|" on the last line of the file caused ml_get errors. Memory underrun in eval_vars(). (Aaron) Don't rename files in a difficult way, except on Windows 95 (was also done on Windows NT). Win32 GUI: An external command that produces an error code put the error message in a dialog box. had to close the window and close the dialog. Now the error code is displayed in the console. (Negri) "comctl32.lib" was missing from the GUI libraries in Makefile.w32. (Battle) In Insert mode, when entering a window in Insert mode, allow the cursor to be one char beyond the text. Renamed machine dependent rename() to mch_rename(). Define mch_rename() to rename() when it works properly. Rename vim_chdir() to mch_chdir(), because it's machine dependent. When using an arglist, and editing file 5 of 4, ":q" could cause "-1 more files to edit" error. In if_python.c, VimCommand() caused an assertion when a do_cmdline() failed. Moved the Python_Release_Vim() to before the VimErrorCheck(). (Harkins) Give an error message for an unknown argument after "--". E.g. for "vim --xyz". The FileChangedShell autocommand didn't set <afile> to the name of the changed file. When doing ":e file", causing the attention message, there sometimes was no hit-enter prompt. Caused by empty line or "endif" at end of sourced file. A large number of patches for the VMS version. (Hunsaker) When CTRL-L completion (find longest match) results in a shorter string, no completion is done (happens with ":help"). Crash in Win32 GUI version, when using an Ex "@" command, because LinePointers[] was used while not initialized. Win32 GUI: allow mapping of Alt-Space. Output from "vim -h" was sent to stderr. Sending it to stdout is better, so one can use "vim -h | more". In command-line mode, ":vi[!]" should reload the file, just like ":e[!]". In Ex mode, ":vi" stops Ex mode, but doesn't reload the file. This is Vi compatible. When using a ":set ls=1" in the .gvimrc file, would get a status line for a single window. (Robinson) Didn't give an error message for ":set ai,xx". (Roemer) Didn't give an error message for ":set ai?xx", ":set ai&xx", ":set ai!xx". Non-Unix systems: That a file exists but is unreadable is recognized as "new file". Now check for existence when file can't be opened (like Unix). Unix: osdef.sh didn't handle declarations where the function name is at the first column of the line. DJGPP: Shortening of file names didn't work properly, because get_cwd() returned a path with backslashes. (Negri) When using a 'comments' part where a space is required after the middle part, always insert a space when starting a new line. Helps for C comments, below a line with "/****". Replacing path of home directory with "~/" could be wrong for file names with embedded spaces or commas. A few fixes for the Sniff interface. (Leherbauer) When asking to hit 'y' or 'n' (e.g. for ":3,1d"), using the mouse caused trouble. Same for ":s/x/y/c" prompt. With 'nowrap' and 'list', a Tab halfway on the screen was displayed as blanks, instead of the characters specified with 'listchars'. Also for other characters that take more than one screen character. When setting 'guifont' to an unknown font name, the previous font was lost and a default font would be used. (Steed) DOS: Filenames in the root directory didn't get shortened properly. (Negri) DJGPP: making a full path name out of a file name didn't work properly when there is no _fullpath() function. (Negri) Win32 console: ":sh" caused a crash. (Negri) Win32 console: Setting 'lines' and/or 'columns' in the _vimrc failed miserably (could hang Windows 95). (Negri) Win32: The change-drive function was not correct, went to the wrong drive. (Tsindlekht) GUI: When editing a command line in Ex mode, Tabs were sometimes not backspaced properly, and unprintable characters were displayed directly. non-GUI can still be wrong, because a system function is called for this. ":set" didn't stop after an error. For example ":set no ai" gave an error for "no", but still set "ai". Now ":set" stops after the first error. When running configure for ctags, $LDFLAGS wasn't passed to it, causing trouble for IRIX. "@%" and "@#" when file name not set gave an error message. Now they just return an empty string. (Steed) CTRL-X and CTRL-A didn't work correctly with negative hex and octal numbers. (Steed) ":echo" always started with a blank. Updating GUI cursor shape didn't always work (e.g., when blinking is off). In silent Ex mode ("ex -s" or "ex <file") ":s///p" didn't print a line. Also a few other commands that explicitly print a text line didn't work. Made this Vi compatible. Win32 version of _chdrive() didn't return correct value. (Tsindlekht) When using 't' in 'complete' option, no longer give an error message for a missing tags file. Unix: tgoto() can return NULL, which was not handled correctly in configure. When doing ":help" from a buffer where 'binary' is set, also edited the help file in binary mode. Caused extra ^Ms for DOS systems. Cursor position in a file was reset to 1 when closing a window. ":!ls" in Ex mode switched off echo. When doing a double click in window A, while currently in window B, first click would reset double click time, had to click three times to select a word. When using <F11> in mappings, ":mkexrc" produced an exrc file that can't be used in Vi compatible mode. Added setting of 'cpo' to avoid this. Also, add a CTRL-V in front of a '<', to avoid a normal string to be interpreted as a special key name. Gave confusing error message for ":set guifont=-*-lucida-*": first "font is not fixed width", then "Unknown font". Some options were still completely left out, instead of included as hidden options. While running the X11 GUI, ignore SIGHUP signals. Avoids a crash after executing an external command (in rare cases). In os_unixx.h, signal() was defined to sigset(), while it already was. Memory leak when executing autocommands (was reported as a memory leak in syntax highlighting). Didn't print source of error sometimes, because pointers were the same, although names were different. Avoid a number of UMR errors from Purify (third argument to open()). A swap file could still be created just after setting 'updatecount' to zero, when there is an empty buffer and doing ":e file". (Kutschera) Test 35 failed on 64 bit machines. (Schild) With "p" and "P" commands, redrawing was slow. Awk script for html documentation didn't work correctly with AIX awk. Replaced "[ ,.);\] ]" with "[] ,.); ]". (Briscoe) The makehtml.awk script had a small problem, causing extra lines to be inserted. (Briscoe) "gqgq" could not be repeated. Repeating for "gugu" and "gUgU" worked in a wrong way. Also made "gqq" work to be consistent with "guu". C indent was wrong after "case ':':". ":au BufReadPre *.c put": Line from put text was deleted, because the buffer was still assumed to be empty. Text pasted with the Edit/Paste menu was subject to 'textwidth' and 'autoindent'. That was inconsistent with using the mouse to paste. Now "*p is used. When using CTRL-W CTRL-] on a word that's not a tag, and then CTRL-] on a tag, window was split. ":ts" got stuck on a tags line that has two extra fields. In Insert mode, with 'showmode' on, <C-O><C-G> message was directly overwritten by mode message, if preceded with search command warning message. When putting the result of an expression with "=<expr>p, newlines were inserted like ^@ (NUL in the file). Now the string is split up in lines at the newline. putenv() was declared with "const char *" in pty.c, but with "char *" in osdef2.h.in. Made the last one also "const char *". ":help {word}", where +{word} is a feature, jumped to the feature list instead of where the command was explained. E.g., ":help browse", ":help autocmd". Using the "\<xx>" form in an expression only got one byte, even when using a special character that uses several bytes (e.g., "\<F9>"). Changed "\<BS>" to produce CTRL-H instead of the special key code for the backspace key. "\<Del>" produces 0x7f. ":mkvimrc" didn't write a command to set 'compatible' or 'nocompatible'. The shell syntax didn't contain a "syn sync maxlines" setting. In a long file without recognizable items, syncing took so long it looked like Vim hangs. Added a maxlines setting, and made syncing interruptible. The "gs" command didn't flush output before waiting. Memory leaks for: ":if 0 | let a = b . c | endif" "let a = b[c]" ":so {file}" where {file} contains a ":while" GUI: allocated fonts were never released. (Leonard) Makefile.bor: - Changed $(DEFINES) into a list of "-D" options, so that it can also be used for the resource compiler. (not tested!) - "bcc.cfg" was used for all configurations. When building for another configuration, the settings for the previous one would be used. Moved "bcc.cfg" to the object directory. (Geddes) - Included targets for vimrun, install, ctags and xxd. Changed the default to use the Borland DLL Runtime Library, makes Vim.exe a log smaller. (Aaron) "2*" search for the word under the cursor with "2" prepended. (Leonard) When deleting into a specific register, would still overwrite the non-Win32 GUI selection. Now ""x"*P works. When deleting into the "" register, would write to the last used register. Now ""x always writes to the unnamed register. GUI Athena: A submenu with a '.' in it didn't work. E.g., ":amenu Syntax.XY\.Z.foo lll". When first doing ":tag foo" and then ":tnext" and/or ":tselect" the order of matching tags could change, because the current file is different. Now the existing matches are kept in the same order, newly found matches are added after them, not matter what the current file is. ":ta" didn't find the second entry in a tags file, if the second entry was longer than the first one. When using ":set si tw=7" inserting "foo {^P}" made the "}" inserted at the wrong position. can_si was still TRUE when the cursor is not in the indent of the line. Running an external command in Win32 version had the problem that Vim exits when the X on the console is hit (and confirmed). Now use the "vimrun" command to start the external command indirectly. (Negri) Win32 GUI: When running an external filter, do it in a minimized DOS box. (Negri) ":let" listed variables without translation into printable characters. Win32 console: When resizing the window, switching back to the old size (when exiting or executing an external command) sometimes failed. (Negri) This appears to also fix a "non fixable" problem: Win32 console in NT 4.0: When running Vim in a cmd window with a scrollbar, the scrollbar disappeared and was not restored when Vim exits. This does work under NT 3.51, it appears not to be a Vim problem. When executing BufDelete and BufUnload autocommands for a buffer without a name, the name of the current buffer was used for <afile>. When jumping to a tag it reported "tag 1 of >2", while in fact there could be only two matches. Changed to "tag 1 of 2 or more". ":tjump tag" did a linear search in the tags file, which can be slow. Configure didn't find "LibXm.so.2.0", a Xm library with a version number. Win32 GUI: When using a shifted key with ALT, the shift modifier would remain set, even when it was already used by changing the used key. E.g., "<M-S-9>" resulted in "<M-S-(>", but it should be "<M-(>". (Negri) A call to ga_init() was often followed by setting growsize and itemsize. Created ga_init2() for this, which looks better. (Aaron) Function filereadable() could call fopen() with an empty string, which might be illegal. X Windows GUI: When executing an external command that outputs text, could write one character beyond the end of a buffer, which caused a crash. (Kohan) When using "*" or "#" on a string that includes '/' or '?' (when these are included in 'isk'), they were not escaped. (Parmelan) When adding a ToolBar menu in the Motif GUI, the submenu_id field was not cleared, causing random problems. When adding a menu, the check if this menu (or submenu) name already exists didn't compare with the simplified version (no mnemonic or accelerator) of the new menu. Could get two menus with the same name, e.g., "File" and "&File". Breaking a line because of 'textwidth' at the last line in the window caused a redraw of the whole window instead of a scroll. Speeds up normal typing with 'textwidth' a lot for slow terminals. An invalid line number produced an "invalid range" error, even when it wasn't to be executed (inside "if 0"). When the unnamed, first buffer is re-used, the "BufDelete" autocommand was not called. It would stick in a buffer list menu. When doing "%" on the NUL after the line, a "{" or "}" in the last character of the line was not found. The Insert mode menu was not used for the "s" command, the Operator-pending menu was used instead. With 'compatible' set, some syntax highlighting was not correct, because of using "[\t]" for a search pattern. Now use the regexps for syntax highlighting like the 'cpoptions' option is empty (as was documented already). When using "map <M-Space> ms" or "map <Space> sss" the output of ":map" didn't show any lhs for the mapping (if 'isprint' includes 160). Now always use <Space> and <M-Space>, even when they are printable. Adjusted the Syntax menu, so that the lowest entry fits on a small screen (for Athena, where menus don't wrap). When using CTRL-E or CTRL-Y in Insert mode for characters like 'o', 'x' and digits, repeating the insert didn't work. The file "tools/ccfilter.README.txt" could not be unpacked when using short file names, because of the two dots. Renamed it to "tools/ccfilter_README.txt". For a dark 'background', using Blue for Directory and SpecialKey highlight groups is not very readable. Use Cyan instead. In the function uc_scan_attr() in ex_docmd.c there was a goto that jumped into a block with a local variable. That's illegal for some compilers. Win32 GUI: There was a row of pixels at the bottom of the window which was not drawn. (Aaron) Under DOS, editing "filename/" created a swap file of "filename/.swp". Should be "filename/_swp". Win32 GUI: pointer was hidden when executing an external command. When 'so' is 999, "J" near the end of the file didn't redisplay correctly. ":0a" inserted after the first line, instead of before the first line. Unix: Wildcard expansion didn't handle single quotes and {} patterns. Now ":file 'window.c'" removes the quotes and ":e 'main*.c'" works (literal '*'). ":file {o}{n}{e}" now results in file name "one". Memory leak when setting a string option back to its default value.

5.3 版 本 version-5.3

5.3 版本是 5.2 的漏洞修正版。改动不多。 5.2 和 5.3 之间的改进: 改动 changed-5.3

"IDE" 菜单更名为 "Tools" 菜单。 新增 added-5.3

Win32 GUI: 激活 Vim 时如果发现已经开始的编辑文件被改变,给出警告。(Negri) 修正 fixed-5.3

5.2.1: Win32 GUI: space for external command was not properly allocated, could cause a crash. (Aaron) This was the reason to bring out 5.3 quickly after 5.2. 5.2.2: Some commands didn't complain when used without an argument, although they need one: ":badd", ":browse", ":call", ":confirm", ":behave", ":delfunction", ":delcommand" and ":tearoff". ":endfunction" outside of a function gave wrong error message: "Command not implemented". Should be ":endfunction not inside a function". 5.2.3: Win32 GUI: When gvim was installed in "Program files", or another path with a space in it, executing external commands with vimrun didn't work. 5.2.4: Pasting with the mouse in Insert mode left the cursor on the last pasted character, instead of behind it. 5.2.5: In Insert mode, cursor after the end of the line, a shift-cursor-left didn't include the last character in the selection. 5.2.6: When deleting text from Insert mode (with "<C-O>D" or the mouse), which includes the last character in the line, the cursor could be left on the last character in the line, instead of just after it. 5.2.7: Win32 GUI: scrollbar was one pixel too big. 5.2.8: Completion of "PopUp" menu showed the derivatives "PopUpc", "PopUPi", etc. ":menu" also showed these. 5.2.9: When using two input() functions on a row, the prompt would not be drawn in column 0. 5.2.10: A loop with input() could not be broken with CTRL-C. 5.2.11: ":call asdf" and ":call asdf(" didn't give an error message. 5.2.12: Recursively using ":normal" crashes Vim after a while. E.g.: ":map gq :normal gq<CR>" 5.2.13: Syntax highlighting used 'iskeyword' from wrong buffer. When using ":help", then "/\k*" in another window with 'hlsearch' set. 5.2.14: When using ":source" from a function, global variables would not be available unless "g:" was used. 5.2.15: XPM files can have the extension ".pm", which is the same as for Perl modules. Added "syntax/pmfile.vim" to handle this. 5.2.16: On Win32 and Amiga, "echo expand("%:p:h")" removed one dirname in an empty buffer. mch_Fullname() didn't append a slash at the end of a directory name. Should include the character under the cursor in the Visual area when using 'selection' "exclusive". This wasn't done for "%", "e", "E", "t" and "f". ""p would always put register 0, instead of the unnamed (last used) register. Reverse the change that ""x doesn't write in the unnamed (last used) register. It would always write in register 0, which isn't very useful. Use "-x for the paste mappings in Visual mode. When there is one long line on the screen, and 'showcmd' is off, "0$" didn't redraw the screen. Win32 GUI: When using 'mousehide', the pointer would flicker when the cursor shape is changed. (Negri) When cancelling Visual mode, and the cursor moves to the start, the wanted column wasn't set, "k" or "j" moved to the wrong column. When using ":browse" or ":confirm", was checking for a comment and separating bar, which can break some commands. Included fixes for Macintosh. (Kielhorn)

5.4 版 本 version-5.4

版本 5.4 新增了若干特性、有用的变更以及大量错误修复。 引入运行时目录 new-runtime-dir

发布的运行时文件现在位于 $VIMRUNTIME,用户文件位于 $VIM。通常不设置 $VIMRUNTIME,而是让 Vim 自行找到它: 使用 $VIM/vim {version},或在该目录不存在 时使用 $VIM。这样可将用户文件与发布文件分开,也更容易升级到另一版本。同时还可 能保留两个版本的 Vim,各自带有自己的运行时文件。 在 Unix 发行版中,运行时文件已移至 "runtime" 目录。这可以一次复制全部运行时文 件,无需知道需要复制什么。 DOS、Windows、Amiga 和 OS/2 的压缩包现在多了一个顶层 "vim" 目录。这是为了表明 用户修改过的文件应放在这里。包含可执行文件的目录名不含 '-' 或 '.' 字符,以避免 奇怪的扩展名。 $VIM 和 $VIMRUNTIME 变量在首次使用时被设置。这使得它们可被例如 Perl 使用。 运行时文件也会在名为 "$VIM/runtime" 的目录中被找到。这在刚解压运行时压缩包后运 行 Vim 时很有帮助。当使用 "src" 目录中的可执行文件时,Vim 会检查移除它之后能否 加上 "vim54" 或 "runtime"。这使得编译后立刻就能找到运行时文件。 可在 Unix Makefile 中给出 $VIMRUNTIME 的缺省值。当 $VIM 不指向运行时目录的上层 而指向例如 "/etc/" 时,这很有用。 引入文件类型 new-filetype-5.4

语法文件现在通过新的 FileType 自动命令加载。旧的 "mysyntaxfile" 文件将不再起作 用。 filetypes 用于加载语法高亮的脚本已改为使用新的 Syntax 自动命令事件。 Filetype 和 Syntax 事件的这种组合允许对语法高亮做更精细的调整,从 Syntax 菜单 选择时也是如此。FileType 自动命令还可用于为该文件类型专门设置选项和映射。 $VIMRUNTIME/filetype.vim 文件不会被自动加载。为此新增 `:filetype on` 命令。 `:syntax on` 也会加载它。 新增了 'filetype' 选项。用于触发 FileType 自动命令事件,就像 'syntax' 选项之于 Syntax 事件。 可用 `:set syntax=OFF` 和 `:set syntax=ON` (在模式行中) 为当前文件切换语法高亮 的开 / 关。 语法菜单命令已移至 $VIMRUNTIME/menu.vim。使用 `:filetype on` 和 `:syntax manual` 时都会加载语法菜单。 旧 'filetype' 选项更名为 'osfiletype',仅用于 RISCOS。'filetype' 现在用于通用 文件类型。 新增 `:syntax manual` 命令。允许手动 (包括从模式行中) 选择要使用的语法。 Vim 脚本续行符 new-line-continuation

当 Ex 行以反斜杠开头时,它会与上一行连接。这避免了长行的需要。 line-continuation (Roemer) 例如: if has("dialog_con") || \ has("dialog_gui") :let result = confirm("Enter your choice", \ "&Yes\n&No\n&Maybe", \ 2) endif 会话文件改进 improved-sessions

'sessionoptions' 的新词: - "help" 恢复帮助窗口。 - "blank" 恢复空窗口。 - "winpos" 恢复 Vim 窗口位置。使用新的 :winpos 命令 - "buffers" 恢复隐藏和未加载的缓冲区。不含时只恢复窗口中的缓冲区。 - "slash" 在文件名中将反斜杠替换为正斜杠。 - "globals" 存储全局变量。 - "unix" 使用 unix 文件格式 (<NL> 而非 <CR><NL>) :mksession 和 'sessionoptions' 现在属于 +mksession 特性。 使用会话文件时,窗口的顶行也会被恢复。 :mksession 和 :mkvimrc 不存储 'fileformat',它应在加载文件时被检测。 (这项工作的大部分由 Vince Negri 和 Robert Webb 完成) 自动命令改进 improved-autocmds-5.4

新事件: FileType 当文件类型被检测到时。 FocusGained 当 Vim 获得输入焦点时。(Negri) FocusLost 当 Vim 失去输入焦点时。(Negri) BufCreate 在新缓冲区被创建或被重命名后立即调用。(Madsen) CursorHold 当 'updatetime' 时间内没有输入任何键时触发。可用于对光标下的单 词进行操作。(Negri) 为 Unix 实现了 CursorHold 自动命令事件。(Zellner) 也为 Amiga 和 MS-DOS 实现。 GUIEnter 可用于在 GUI 窗口创建后进行操作 (例如 `:winpos 100 50`)。 BufHidden 当缓冲区变为隐藏时。用于在选项窗口隐藏时删除它。 在缓冲区即将被重命名之前也会触发 BufDelete 。(Madsen) 对自动命令而言,"<amatch>"模式可以像 "<afile>" 一样使用,区别在于它是 FileType 和 Syntax 事件的匹配值。 当在自动命令中使用 `:let @/ = <string>` 时,该最近搜索模式将在自动命令结束后被 使用。 通过记住长度,避免为每个新模式对每个现有模式调用 strlen()。使自动命令的加载更 快一些。 加密 new-encryption

文件在写入时可加密,读取时可解密。新增了 'key' 选项、 -x 命令行参数和 :X 命 令。 encryption (基于 Mohsin Ahmed 的补丁) 读取文件时,会自动检测文件是否已被加密。Vim 随后会提示输入密钥。 注意该加密方法与 Vi 不兼容。该加密方法并非不可破解。这是为了满足能从美国出口的 条件。 GTK GUI 移植版本 new-GTK-GUI

新 GTK+ GUI 移植版本。包含工具栏、可撕菜单等。 gui-gtk 新增 :helpfind 命令。(Kahn and Dalecki) 菜单变更 menu-changes-5.4

菜单现在也可以在控制台中使用。这由新的 'wildmenu' 选项启用。它以菜单形式显示命 令行补全的匹配项。可当作一个极简的文件浏览器使用。 新的 :emenu 命令可用于执行一个菜单项。 使用最后一条状态行列出条目,或在命令行上方插入一行。(Negri) 'wildcharx' 选项可用于从映射中触发 'wildmenu' 补全。 可用 has("menu") 检测编译时是否不带菜单支持。在 :version 输出中也会显示。 允许编译不带菜单支持的 GUI 版本。仅在存在菜单支持时才包含工具栏支持。 将 "Window" 菜单移到最右侧 (优先级 70)。对使用 MS-Windows 的人看起来更熟悉,对 其他人无影响。 新增 "缓冲区" 菜单。与现有的自动命令和函数协同工作。可通过设置 "no_buffers_menu" 变量禁用它。(Aaron and Madsen) Win32 支持菜单中的分隔符: "-.*-"。(Geddes) Motif 的菜单分隔符现在也能工作了。 使 Motif GUI 的弹出菜单正常工作。(Madsen) 'guioptions' 中的 'M' 标志位: 不加载系统菜单。 所有菜单代码已从 gui.c 移至 menu.c。 Viminfo 改进 improved-viminfo

'viminfo' 的新标志位: '!' 将大写字母开头的全局变量存储在 viminfo 文件中。(Negri) 'h' 加载 viminfo 文件时执行 :nohlsearch 。 在 viminfo 文件中存储搜索模式及其偏移、magic 等。还存储 'hlsearch' 高亮开启或 关闭的标志位 ('viminfo' 含 'h' 标志位则不存储搜索高亮状态)。 当设置不含逗号的 'viminfo' 时给出错误信息。 若干新增命令 new-commands-5.4

操作符 g? : rot13 编码。(Negri) zH 和 zL 命令: 水平滚动半页。 gm 将光标移动到屏幕行的中间。(Ideas by Campbell) 对可视列块的操作: v_b_I 、 v_b_A 、 v_b_c 、 v_b_C 、 v_b_r 、 v_b_< 和 v_b_> 。(Kelly) 新命令: CTRL-\ CTRL-N,在普通模式下为空操作,在插入或命令行模式下则进入普通模 式。可被 VisVim 或其他 OLE 程序用于确保 Vim 处于普通模式,而不会发出响铃。 CTRL-\_CTRL-N `:cscope kill` 命令使用连接文件名。 :cscope (Kahn) :startinsert 命令: 接下来开始插入模式。 :history 命令,显示全部四种类型的历史。(Roemer) [m 、 [M 、 ]m 和 ]M 命令,用于在 (Java) 类中反向 / 正向跳转到方法的开始 / 结束处。 :@* 执行 * 寄存器。 :@ (Acevedo) go 和 :goto 命令: 跳转到文件中的字节偏移处。 gR 和 gr 命令: 虚拟替换模式。替换字符而不改变布局。(Webb) `:cd -` 切换到上一个 :cd 命令之前的目录。 :cd- (Webb) 标签预览命令 :ptag 。在专用窗口中显示 :tag 的结果。可用于查看标签的上下文 (例如函数参数)。(Negri) :pclose 命令,以及 CTRL-W CTRL-Z: 关闭预览窗口。(Moore) 'previewheight' 选项,预览窗口的高度。 还有 :ppop 、 :ptnext 、 :ptprevious 、 :ptNext 、 :ptrewind 、 :ptlast 。 :find 和 :sfind 命令: 在 'path' 中查找文件,(分割窗口) 并编辑它。 :options 命令打开一个显示当前选项值的选项窗口。也可用 `:browse set` 打开它。 选项按功能分组。对每个选项提供简短帮助。按 <CR> 跳到更多帮助。编辑选项值并在 "set" 行按 <CR> 以设置新值。 若干新增选项 new-options-5.4

滚动绑定: 'scrollbind' 和 'scrollopt' 选项。新增 :syncbind 命令。使窗口滚动 相同的量 (水平或垂直)。(Ralston) MS-DOS 的 'conskey' 选项。使用直接的控制台 I/O。这应该能在 telnet 下工作 (未经 测试!)。 'statusline' 选项: 状态行的可配置内容。也允许显示文件中的字节偏移。用 %1* 到 %9* 高亮,使用新的高亮组 User1 到 User9。(Madsen) 'rulerformat' 选项: 标尺的可配置内容,类似 'statusline'。(Madsen) write 选项: 关闭时,不允许写入文件。即使 :w! 也避免覆盖文件。 -m 命令行选 项复位 'write'。 'clipboard' 选项: 剪贴板的使用方式。值 "unnamed": 像 "* 一样使用未命名寄存器。 (Cortopassi) 值 "autoselect": 类似 'guioptions' 中的 'a' 行为 ,但用于终端。 'guifontset' 选项: 为 +fontset 特性指定字体,用于 X11 GUI 版本。当 vim 以此 特性编译时允许使用普通字体。(Nam) 'guiheadroom' 选项: 允许在 GUI 窗口上方 / 下方保留多少空间。用于 Motif、Athena 和 GTK。 实现了 'tagstack' 选项: 关闭时,禁用将标签压入栈中 (Vi 兼容)。对映射很有用。 'shellslash' 选项。仅用于以反斜杠作为文件分隔符的系统。该选项在展开文件名时使 用正斜杠。当 'shell' 是 sh 或 csh 时很有用。 'pastetoggle' 选项: 切换 'paste' 的键序列。解决了置位 'paste' 时映射在插入模式 不工作的问题。 'display' 选项: 设置为 "lastline" 时,最后一行填满窗口,而不是被 "@" 行替换。 只有最后三个字符被替换为 "@@@",以表明该行尚未结束。 'switchbuf' 选项: 允许在跳转到缓冲区时重用现有窗口,或分割窗口打开新缓冲区。 (Roemer) 'titleold' 选项。替换固定字符串 "Thanks for flying Vim",该字符串用于退出时设 置标题。(Schild) Vim 脚本 new-script-5.4

exists() 函数现在也可以检查函数是否存在。(Roemer) 现在用二分法查找内部函数,应该会快一些。(Roemer) 新函数: - getwinposx() 和 getwinposy() : 获取 Vim 窗口位置。(Webb) - histnr() 、 histadd() 、 histget() 和 histdel() : 使历史可用。(Roemer) - maparg() : 返回映射的右手边。基于 Vikas 的补丁。 - mapcheck() : 检查映射名是否与现有映射匹配。 - visualmode() : 返回最后一次可视模式的类型。(Webb) - libcall() : 调用库中的函数。目前仅用于 Win32。(Negri) - bufwinnr() : 找到包含指定缓冲区的窗口。(Roemer) - bufloaded() : 缓冲区是否存在且已加载。 - localtime() 和 getftime() : 时钟时间和文件的最后修改时间 (Webb) - glob() : 仅展开文件名通配符。 - system() : 获取外部命令的原始输出。 (基于 Aaron 的补丁) - strtrans() : 将字符串翻译为可显示字符。用于 2html.vim 脚本。 - append() : 在缓冲区中追加一行文本的简便方法。 函数变更: - strftime() 的可选参数,给出以秒为单位的时间。(Webb) - expand() 现在也返回不存在文件的名称。 允许用户命令名称中出现数值。(Webb) 使用 "v:" 表示 Vim 内部变量: "v:errmsg"、"v:shell_error" 等。来自 5.3 版的那些 变量不带 "v:" 也可使用,以保持向后兼容。 新变量: v:warningmsg 和 v:statusmsg 内部变量。包含最近给出的警告和状态消息。 (Madsen) v:count1 变量: 类似 v:count ,但未使用计数时缺省为一。 当编译时不含表达式求值时,可在不受支持的命令周围使用 "if 1" 以避免其被执行。工 作方式与 Vim 4.x 中相同。 某些运行时脚本在使用以最小特性包编译的 Vim 时给出错误。现在可在并非始终受支持 的代码周围使用 "if 1"。 当求值含 && 和 || 的表达式时,跳过不会影响结果的部分。这使其更快并避免错误消 息。(Webb) 同时优化了 "if 0" 内部表达式的跳过。 避免按-回车提示 avoid-hit-enter

为 'shortmess' 新增 'T' 标志位: 截断所有会导致按-回车提示的消息 (除非无论如何 都会出现该提示)。 'shortmess' 中的 'O' 标志位现在也适用于快修消息,例如来自 :cn 命令的消息。 'shortmess' 的缺省值现在是 "filnxtToO",以使大多数消息适合命令行,并且不引起按 -回车提示。 先前的消息可用新的 :messages 命令查看。 有些消息即使 'shortmess' 要求缩短消息也会完整显示,因为用户期待看到完整消息: CTRL-G 和部分快修命令。 快速修复改进 improved-quickfix

解析 gmake 的切换目录行: "make [1]: Entering directory 'name'"。在 'errorformat' 中使用 "%D" 和 "%X"。 也解析 make 的 "Making {target} in {dir}" 消息。在不使用 GNU make 时有帮助。 (Schandl) 对 'errorformat' 中的 "% f" 使用 'isfname'。 多行消息的解析。 errorformat-multi-line 允许为 :clist 命令指定范围。(Roemer) 支持 "全局" 文件名,用于为多个错误输出一次文件名的错误格式。(Roemer) :cnfile 跳转到下一个文件中的第一个错误。 'makeprg' 中的 "$*" 被 :make 的参数替换。(Roemer) 正则表达式 regexp-changes-5.4

在正则表达式中,"\)" 之前的 '$' 也被视为行尾。 /$ 在模式中,"\|" 或 "\(" 之后的 "^" 是行首。 /^ (Robinson) 在正则表达式中,"\)" 和 "\|" 之前,'$' 和 '\$' 都被视为行尾。现在将 "$" 用作行 尾,将 "\$" 用作按本义的美元符号。"\(" 和 "\|" 之后的 '^' 同理。 /\$ /\^ 某些搜索模式可能极其缓慢,即使它们并非真正非法。例如: "\([^a-z]\+\)\+Q"。允许 用 CTRL-C 中断任何正则表达式搜索。 寄存器 "/: 最后的搜索字符串 (只读)。(Kohan) 改为使用最后使用的搜索模式 (类似 'hlsearch' 所使用的)。可用 `:let @/ = {expr}` 设置搜索模式。 向搜索模式新增字符类,以避免从 'cpoptions' 移除 'l' 标志位的需要: [:tab:] 、 [:return:] 、 [:backspace:] 和 [:escape:] 。 在表达式的比较运算符后添加 '?',比较时忽略大小写。 expr-==? 版本 5.3 至 5.4 之间的其他改进

改动 changed-5.4

Unix: $TMPDIR 已设置且存在时,则用于存放临时文件。 移除了 "Empty buffer" 消息。它没什么用,且会引起按-回车提示。(Negri) "ex -" 现在从标准输入读取命令并以静默模式工作。这是为了与用于脚本的原始 "ex" 命令兼容。 :tcldo 的缺省范围是整个文件。 用 ESC 取消可视模式曾移动光标。似乎没有理由这样做。现在光标留在原处。 :grep 和 :make 命令将 " 视为参数的一部分,而不是注释的开始。 表达式中 "=~" 和 "!~" 运算符不再受 'ignorecase' 影响。 将 vimrc_example 更名为 vimrc_example.vim,将 gvimrc_example 更名为 gvimrc_example.vim。使它们被识别为 vim 脚本。 gd 不再从前一个函数的末尾开始搜索,而是从当前函数开头上方第一个空白行开始。 避免在第一个函数中使用 gd 时找到全局变量。 'complete' 的缺省值从 ".,b" 改为 ".,w,b,u,t,i"。会找到更多匹配,代价是时间 (搜 索可被中断)。 不再可能从模式行设置 'shell*' 选项。以前只给出警告消息。这降低了安全风险。 文档索引的排序被更改,使查找主题更容易。 在 MS-DOS 和 win32 上,未设置 $VIM 时曾使用 $HOME。如果 $HOME 被某个其他工具设 置为例如 "C:\",就会出问题,运行时文件将无法被找到。现在仅将 $HOME 用于 _vimrc、_gvimrc 等,而不用于查找运行时文件。 当 'tags' 为 "./{fname}" 且当前缓冲区没有文件名时,直接使用它。以前它会跳过, 导致 "vim -t {tag}" 找不到许多标签。 当试图通过鼠标拖动选择 'scrolloff' 区域中的文本时,产生的滚动使这一操作困难。 现在 'scrolloff' 被临时设置为 0 或 1 以避免此问题。但仍允许在顶行滚动以延伸到 显示的文本之上。 'comments' 的缺省值现在包含 "sl:/*,mb: *,ex:*/",使 javadoc 注释正常工作。对以 "/*******" 开头的 C 注释也有帮助。 CTRL-X CTRL-] 插入模式标签展开在非 ID 字符之后使用时曾试图展开为所有标签,这可 能耗时很长。现在将其限制为 200 个匹配。也用于命令行标签补全。 OS/2 发行版被拆分为两个文件。它太大,无法放入一张软盘。现在使用与 PC 相同的运 行时压缩包。 在文档中,类似 <a-z> 的条目已为非可选参数替换为 {a-z}。这避免了与键名的混淆: <C-Z> 是 CTRL-Z,而不是 C 与 Z 之间的字符,即 {C-Z}。 新增 added-5.4

为 iris-ansi 内建终端能力项添加颜色支持。(Tubman) 收录 VisVim 1.3a 版。(Erhardt) SNiFF+ 接口的 Win32 移植。(Leherbauer) sniff 接口的文档文件: if_sniff.txt。(Leherbauer) 在 OleVim 目录中收录 "SendToVim" 和 "OpenWithVim" 程序。用于 MS-Windows 下的 OLE 版 gvim。(Schaller) 收录 Exuberant Ctags 3.2.4 版,支持 Eiffel。(Hiebert) 当正在编辑的文件被删除时,给出警告 (如同时间戳改变时)。 收录更新版本的 HTML 生成 Awk 和 Perl 脚本。(Colombo) 通过 "gpm" 支持 Linux 控制台鼠标。(Tsindlekht) 安全修复: 不允许从模式行更改 'secure' 和 'exrc'。设置 'secure' 时,对更改包含 程序名的选项给出警告。 使 Perl 接口与 Perl 5.005 和线程协同工作。(Verdoolaege) 当给出模糊映射的错误消息时,包含违规的映射。(Roemer) 命令行编辑: - 映射的命令行补全。(Roemer) - 为 :function 、 :delfunction 、 :let 、 :call 、 :if 等提供命令行补全。 (Roemer) - 当对具有 "-complete=tag_listfiles" 的用户命令使用 CTRL-D 补全时,也列出文件 名。(Madsen) - 补全 :command 命令的参数。(Webb) - 命令行中的 CTRL-R . 插入最后插入的文本。CTRL-R 之后的 CTRL-F、CTRL-P、CTRL-W 和 CTRL-A 用于插入光标下的对象。(Madsen) 使 uganda.txt 中关于复制 Vim 的文本更加明确。 更新了 Vim 教程。新增 "vimtutor" 命令,该命令复制教程并在其上启动 Vim。 "make install" 现在也会复制教程。 在 :clist 的输出中,当前条目被高亮,使用 'i' 高亮方式 (与 'incsearch' 使用的 相同)。 对于 :clist 命令,可以用 "b" (一屏)、"u" (半屏) 和 "k" (一行) 向后滚动。 多字节支持: - 用于多字节字符的 X 输入法。以及多字节支持的各种修复。(Nam) - 韩语输入法特性: hangul 。(Nam) - 清理了多字节支持、XIM、字体集和韩语输入的配置。现在各自可单独配置。 - 将 GTK_KEYBOARD 检查改为 HANGUL_KEYBOARD_TYPE。(Nam) - 新增 doc/hangulin.txt: 韩语输入代码的文档。(Nam) - GTK+ 的 XIM 支持。(Nam) - 首次尝试包含 SJIS 编码支持。(Nagano) - 当双字节字符无法放入行尾时,在该处放一个 "~",并在下一行打印它。 - 优化多字节文本的输出。(Park) - Win32 IME: 预编辑样式如同 over-the-spot。(Nagano) - Win32 IME: IME 模式更改现在用 ImmSetOpenStatus 完成。(Nagano) - GUI Athena: 文件选择对话框可显示多字节字符。(Nagano) - 对 XA_TEXT 的选区请求,以 XA_STRING 格式返回数据。(Nagano) "runtime/macros/diffwin.vim"。制作比较窗口的映射。(Campbell) 在 'suffixes' 选项中新增 ".obj"。 通过使用 ":SynAu" 用户命令减小了 syntax/synload.vim 的大小。 menu.vim 中自动为语法菜单条目编号。 在语法菜单中,在以不同字母开头的语法名称之间插入分隔符。(Geddes) xterm: - 在 xterm 中使用鼠标时的剪贴板支持。(Madsen) - 使用 xterm 鼠标时,跟踪鼠标拖动。尽可能使用 xterm 转义序列。它比其他方法更精 确,但需要相当新的 xterm 版本。通过在 'ttymouse' 中设置 "xterm2" 启用。 (Madsen) - 检查 xterm 补丁级别,以设置 'ttymouse' 的值。该功能仅最近才加入 xterm (补丁 级别 > 95)。使用新的 't_RV' 终端能力项。识别到正确应答时将 'ttymouse' 设置为 "xterm2"。这将使 xterm 鼠标拖动工作得更好。 - 支持 xterm 上的 Shift+功能键。将 Shift+光标键的代码改为 xterm 实际产生值。为 Shift+<End> 和 Shift+<Home> 添加了代码。 - 新增 't_WP' 设置以像素为单位的窗口位置,新增 't_WS' 设置以字符为单位的窗口大 小。xterm 现在可以移动 (用于 :winpos ) 和调整大小 (用于 `:set lines=` 和 `:set columns=`)。 X11: - 当处于可视模式但不拥有选区时,用 VisualNOS 组显示可视选区以示区别。(Madsen) - 支持请求剪贴板支持的类型。用于 AIX 和 dtterm。(Wittig) - 支持 compound_text 选区 (即使编译时不带多字节)。 交换文件: - 交换文件命名的新变体: 将路径分隔符替换为 %,将所有交换文件放在一个目录中。当 'dir' 中的名称以两个路径分隔符结尾时使用。(Madsen) - 发现交换文件时,在提示信息中显示它是否包含修改。(Madsen) - 支持对话框时,使用对话框询问用户交换文件已存在时该如何处理。 'mousemodel' 选项中的 "popup_setpos"。允许在使用鼠标右键时移动光标。 当缓冲区被删除时,改为使用跳转列表中最近的条目来选择显示哪个缓冲区。(Madsen) 使用 CTRL-O/CTRL-I 时,跳过已删除的缓冲区。 标尺在有空位时显示百分比。 使用 autoconf 1.13 生成 configure。 收录 Dirk van Deun 的 get_lisp_indent()。当 'cpoptions' 中不含 'p' 标志时, Lisp 缩进更好。 使 2html.vim 脚本效率大幅提升。 (基于 Geddes 的想法) Unix: - 在版本消息中包含编译 Vim 的用户名和编译所用系统的名称。 - "make install" 现在也会安装 "tools" 目录。使其对所有人都可用。 - "make check" 现在与 "make test" 做同样的事。"make test" 检查可视列块模式的移 位、插入、替换和更改。 - 通过将设备 / 索引节点号与缓冲区一起存储,加快文件名与现有缓冲区的比较。 - 新增 configure 参数 "--disable-gtk"、"--disable-motif" 和 "--disable-athena",以便禁用特定的 GUI (当它无法工作时)。 - 重命名了用于禁用特定 GUI 检查的 configure 参数。现在应该更清楚了。(Kahn) - 在 Digital Unix 系统 ("OSF1") 上,在 termlib 和 termcap 之前检查 curses 库。 (Schild) - "make uninstall_runtime" 只删除版本特定的文件。可用于删除以前版本的运行时文 件。 Macintosh: (St-Amant) - 拖动滚动条,类似 Win32 GUI。将公共代码从 gui_w32.c 移至 gui.c。 - 新增对话框和文件浏览。 - 保留资源分叉,将丢失时给出警告。 - 将原始文件属性复制到新写入的文件。 - 解决了设置标题 / 不设标题的漏洞。 - 改进了文件名补全。 - 将伸缩框限制调整为逐字符的大小。 - 使用 rgb.txt 以获得更多颜色 (但会退回坏颜色)。 - Apple 菜单正常工作 (除了关于… 之外)。 - 内部边框现在符合 vim 规范。 - 删除菜单不再崩溃。 - Python 1.5.1 的弱链接 (仅限 PPC)。库可用时支持 Python。 - 加载用户的 .vimrc 时遇到错误,警告框现在立即显示,OK 按钮为缺省。每行开头不 再有 "Delete" 键符号。 - 更好地管理环境变量。现在 $VIM 只计算一次,不在每次使用时重新生成。 - 在后台时不再占用 CPU。 - 在加载的 Vim 脚本中可以识别 Mac 文件格式,就像识别 DOS 文件格式一样。 当 'fileformats' 同时包含 "unix" 和 "mac" 时,如果 CR 多于 NL 字符,则优先采用 "mac" 格式。 使用 "mac" 文件格式时,用 CR 代替 NL,因为 NL 用于表示 NUL。这将保留文件中的所 有字符。(Madsen) DOS 的 install.exe 现在包含对现有安装的检查。它避免再次设置 $VIM 和 $PATH。 Dos/Windows 的安装程序现在可以通过添加两个注册表键,将 Vim 安装到弹出菜单中。 移植到 EGCS/mingw32。新的 Makefile.ming。(Aaron) DOS 16 位: 不包含光标形状内容。节省一些字节。 对 Makefile.w32 的 TCL 支持。(Duperval) OS/2: 使用 argv [0] 查找运行时文件。 使用 gf 前往已使用过的缓冲区时,跳转到光标上次所在的行。 对 :tselect 的输出着色更多一些。标签名与文件名使用不同的高亮。将字段名 ("struct:") 与参数分开高亮。 非 Unix 系统的反引号展开。基于 Aaron 的补丁。可用如 `:n 'grep -l test *.c'` 和 "echo expand ('`ls m*'`)" 之类的内容。 设置 'complete' 选项时对其进行检查。(Acevedo) 'complete' 中的 'd' 标志位搜索已定义的名字或宏。 在头文件和标签文件中搜索插入模式补全时,检查顷输入,以便能及早使用匹配项。 (Webb) 'complete' 中的 '.' 标志现在完整扫描当前缓冲区,忽略 'nowrapscan'。(Webb) 向 'whichwrap' 新增 '~' 标志位。(Acevedo) 结束可视模式 (例如用 ESC) 时,不夺取选区的所有权。 在彩色终端中,"fg" 和 "bg" 可用作颜色名。它们代表 "Normal" 颜色。 一些 cscope 清理。(Kahn) 收录 Schemenauer 修改过的 vimspell.sh。 表达式中用 "." 连接字符串稍微快了一些。(Roemer) :redir 命令现在可以重定向到寄存器: `:redir @r`。(Roemer) 使 :marks 和 :jumps 的输出看起来相似。当位置标记在当前文件中时,显示位置标 记处的文本。 :tags 同样。 当 configure 找到 ftello() 和 fseeko() 时,在 tag.c 中使用它们 (用于超大的标签 文件)。 configure 检查编译器的 "-FOlimit,2000" 参数。(Borsenkow) GUI: - 在非 GUI 的 Vim 中使用 :gui 时,给出清晰的错误消息。 - "gvim -v" 不启动 GUI (如果存在控制台支持)。 - 在 Ex 模式时,对全屏使用非可视选区。 - 以 "gvim -f" 启动并在 .gvimrc 文件中使用 :gui 时,Vim 仍然会分叉。现在 :gui 记住了 "-f" 标志位。新增 `gui -b` 以无论如何都在后台运行 gvim。 Motif GUI: - 在 configure 中检查 "-lXp" 库 (但还不能工作…)。 - 让 configure 在 "/usr/local/Lesstif/Motif*" 中检查 Lesstif。更改了顺序,让本 地 Motif 版本覆盖系统标准版本。 Win32 GUI: - 在非 OLE 版本中使用 "-register" 或 "-unregister" 时,给出错误消息。 - 使用 GTK 工具栏图标。使窗口边框更好看。在窗口的左下和右下角使用尺寸手柄。 (Negri) - 用 :!start 启动外部命令而命令无法执行时,给出错误消息。(Webb) - 为滚动条下方的灰色矩形使用尺寸手柄。现在可以绘制扁平模式工具栏,更好看了。 (Negri) - 为 MS-Windows 3.1 的加入做准备。主要是将 WIN32 改为 MSWIN、USE_GUI_WIN32 改 为 USE_GUI_MSWIN。(Negri) 避免在 buflist_findpat() 中四次分配同一个字符串。(Williams) 用终端能力项 't_ts'、't_fs'、't_IS' 和 't_IE' 设置标题和图标文本。允许在任何支 持设置标题或图标文本的终端上这样做。(Schild) 'comments' 中的新 'x' 标志位: 当输入其最后一个字符时自动插入结束部分。帮助闭合 C 中的 /* */ 注释。(Webb) 当 expand() 有第二个非零参数时,不使用 'suffixes' 和 'wildignore',返回所有 匹配。 'cpoptions' 中的 'O' 标志位: 当未包含时,如果文件在开始编辑时不存在但在缓冲区 写入该文件时已存在,Vim 不会覆盖它。该文件必定是在 Vim 之外创建的,可能用户并 不知道。在外壳命令之后检测到这种情况时,给出警告消息。 编辑新文件时,CTRL-G 会显示 [新文件]。读取文件时有错误时,CTRL-G 会显示 [读错误]。 :wall 现在可以在需要时使用对话框和文件浏览。 将功能分组为新的特性,主要是为了减小最小版本集的大小: +linebreak: 'showbreak'、'breakat' 和 'linebreak' +visualextra: 可视列块模式的插入 ("I") 和附加 ("A")、在列块所有行上修改 ("c")、">" 和 "<": 左/右移列块、"r": 用单个字符替换可视选区。 +comments: 'comments' +cmdline_info: 'ruler' 和 'showcmd'。取代 +showcmd。 "+title" 不为 MSDOS 添加设置标题或图标的代码,反正这也不可能。 +cmdline_compl 在编译时禁用命令行补全,文件、目录和帮助条目除外。 将特性从函数调用列表移入数组。应该能节省一些空间。 在输入函数体时,根据 "if" 和 "while" 命令调整缩进。 VMS: 根据 Arpadffy 的建议调整了 os_vms.mms。 'comments' 选项中的标志现在可以包含偏移。这使得可以用相同的 'comments' 设置对 齐 "/*****"、"/* xxx" 和 "/*" 注释。'comments' 的缺省值使用了这一点。 新增 'O' 标志: 不用这部分作为 "O" 命令。对 `set com=sO:*\ -,mO:*\ \ ,exO:*/` 有用。 FileType 自动命令识别 ".bak"、".orig" 和 "~" 扩展名并移除它们,以找到相关的扩 展名。 关于编写 Vim 脚本文件的教程已被扩展。 帮助文件中有更多高亮,用于不按本义输入的项目。 可以像 "CTRL-W g" 一样使用 "CTRL-W CTRL-G"。 OS/2 的 "make test"。 调整 configure 为 BeOS 自动使用 GUI。 修正 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 multibyte 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 multibyte: 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 removes 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". Now give a "No match" error message. The life/life.mac, urm/urm.mac and hanoi/hanoi.mac files were not recognized as Vim scripts. Renamed them to *.vim. [备注: 有些编号的补丁在从 5.3 版本升级时没有意义,它们被删除了] Patch 5.4m.1 问题: 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. 解决方案: Truncate the message in filemess(). Use the same code as for msg_trunc_attr(), which is moved to the new function msg_may_trunc(). 相关文件: src/message.c, src/proto/message.pro, src/fileio.c Patch 5.4m.3 问题: The Motif libraries were not found by configure for Digital Unix. 解决方案: Add "/usr/shlib" to the search path. (Andy Kahn) 相关文件: src/configure.in, src/configure Patch 5.4m.5 问题: 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) 解决方案: 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. 相关文件: src/gui_w32.c Patch 5.4m.6 问题: Win32 GUI: When reading text from stdin, e.g., "cat foo | gvim -", a message box would pop up with "-stdin-" (when exiting). (Michael Schaap) 解决方案: Don't switch off termcap mode for versions that are GUI-only. They use another terminal to read from stdin. 相关文件: src/main.c, src/fileio.c Patch 5.4m.7 问题: Unix: running configure with --enable-gtk-check, --enable-motif-check, --enable-athena-check or --enable-gtktest had the reverse effect. (Thomas Koehler) 解决方案: Use $enable_gtk_check variable correctly in AC_ARG_ENABLE(). 相关文件: src/configure.in, src/configure Patch 5.4m.9 问题: 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. 解决方案: Adjust getvcol() and win_line(). (Chong-Dae Park) 相关文件: src/charset.c, src/screen.c Patch 5.4m.11 问题: The ":call" command didn't check for illegal trailing characters. (Stefan Roemer) 解决方案: Add the check in do_call(). 相关文件: src/eval.c Patch 5.4m.13 问题: 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. 解决方案: 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. 相关文件: src/ex_cmds.c, src/gui_w32.c Patch 5.4m.14 问题: 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. 解决方案: 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. 相关文件: 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 问题: When using a BufEnter autocommand to reload the syntax file, conversion to HTML caused a crash. (Sung-Hyun Nam) 解决方案: 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(). 相关文件: src/syntax.c Patch 5.4m.17 问题: 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. 解决方案: 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. 相关文件: src/eval.c Patch 5.4m.18 问题: 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. 解决方案: 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(). 相关文件: src/proto/ex_getln.pro, src/ex_getln.c, src/eval.c, src/misc2.c Patch 5.4m.21 问题: 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). 解决方案: Call screenalloc() in main() only after calling ui_get_winsize(). Also avoids a potential delay because of calling screenclear() while "starting" is non-zero. 相关文件: src/main.c Patch 5.4m.22 问题: 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(). 解决方案: 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. 相关文件: src/globals.h, src/gui.c, src/screen.c, src/proto/gui.pro Patch 5.4m.23 问题: When using expand("<cword>") when there was no word under the cursor, would get an error message. Same for <cWORD> and <cfile>. 解决方案: Don't give an error message, return an empty string. 相关文件: src/eval.c Patch 5.4m.24 问题: ":help \|" didn't find anything. It was translated to "/\\|". 解决方案: Translate "\|" into "\\bar". First check the table for specific translations before checking for "\x". 相关文件: src/ex_cmds.c Patch 5.4m.25 问题: 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. 解决方案: Insert a backslash before these three characters. Adjust Mungename() function to insert a backslash before '|'. 相关文件: src/ex_getln.c, runtime/menu.vim Patch 5.4m.26 问题: 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. 解决方案: Add 'K' flag to 'cpoptions' to wait for the whole key code, even when halfway a mapping. 相关文件: src/option.h, src/term.c Patch 5.4m.27 问题: When making test33 without the lisp feature it hangs. Interrupting the execution of the script then might cause a crash. 解决方案: 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. 相关文件: 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 问题: C-indenting was wrong after " } else". The white space was not skipped. Visible when 'cino' has "+10". 解决方案: Skip white space before calling cin_iselse(). (Norbert Zeh) 相关文件: src/misc1.c Patch 5.4n.4 问题: 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) 解决方案: When setting the new search pattern in jumpto_tag(), don't restore no_hlsearch. 相关文件: src/tag.c Patch 5.4n.5 问题: 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. 解决方案: Forbid the use of ":normal" when vgetc_busy is set. Give an error message when this happens. 相关文件: src/ex_docmd.c, runtime/doc/autocmd.txt Patch 5.4n.6 问题: "gv" could reselect a Visual that starts and/or ends past the end of a line. (Robert Webb) 解决方案: Check that the start and end of the Visual area are on a valid character by calling adjust_cursor(). 相关文件: src/normal.c Patch 5.4n.8 问题: 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). 解决方案: Added check_cursor_lnum() in nv_gomark(). 相关文件: src/normal.c Patch 5.4n.9 问题: ":-2" moved the cursor to a negative line number. (Ralf Schandl) 解决方案: Give an error message for a negative line number. 相关文件: src/ex_docmd.c Patch 5.4n.10 问题: 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>. 解决方案: Disallow scrolling at the hit-enter prompt for systems that use on the fly scrolling. 相关文件: src/message.c Patch 5.4n.14 问题: 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)> 解决方案: Call check_winsize() from gui_set_winsize() to resize the windows. 相关文件: src/gui.c Patch 5.4n.16 问题: Win32 GUI: The <F10> key both selected the menu and was handled as a key hit. 解决方案: Apply 'winaltkeys' to <F10>, like it is used for Alt keys. 相关文件: src/gui_w32.c Patch 5.4n.17 问题: Local buffer variables were freed when the buffer is unloaded. That's not logical, since options are not freed. (Ron Aaron) 解决方案: Free local buffer variables only when deleting the buffer. 相关文件: src/buffer.c Patch 5.4n.19 问题: 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) 解决方案: 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. 相关文件: runtime/optwin.vim, src/ex_cmds.c, src/testdir/test13.in, src/testdir/test13.ok Patch 5.4n.24 问题: 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. 解决方案: 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. 相关文件: 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 问题: Crash when using "gf" on "file.c://comment here". (Scott Graham) 解决方案: Fix wrong use of pointers in get_file_name_in_path(). 相关文件: src/window.c Patch 5.4o.3 问题: 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. 解决方案: Subtract 8 from the size when 'number' set and 'wrap' not set. Reset gui.dragged_sb when a mouse click is received. 相关文件: src/gui.c Patch 5.4o.4 问题: When running in an xterm and $WINDOWID is set to an illegal value, Vim would exit with "Vim: Got X error". 解决方案: 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. 相关文件: src/os_unix.c Patch 5.4o.5 问题: Motif version with Lesstif: When removing the menubar and then using a menu shortcut key, Vim would crash. (raf) 解决方案: Disable the menu mnemonics when the menu bar is removed. 相关文件: src/gui_motif.c Patch 5.4o.9 问题: The DOS install.exe program used the "move" program. That doesn't work on Windows NT, where "move" is internal to cmd.exe. 解决方案: Don't use an external program for moving the executables. Use C functions to copy the file and delete the original. 相关文件: 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 问题: 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. 解决方案: Reset the clipboard Visual mode to force updating the selection. 相关文件: src/normal.c Patch 5.4p.2 问题: Motif and Athena with XIM: Typing 3-byte <multibyte><multibyte><space> doesn't work correctly with Ami XIM. 解决方案: Avoid using key_sym XK_VoidSymbol. (Nam) 相关文件: src/multbyte.c, src/gui_x11.c Patch 5.4p.4 问题: 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. 解决方案: Give each scrollbar its own scroll_shift field. When the down arrow is used, scroll several lines. 相关文件: src/gui.h, src/gui_w32.c Patch 5.4p.5 问题: 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. 解决方案: When the buffer to be deleted unexpectedly becomes the current buffer, don't delete it. Also added a check for this in test13. 相关文件: src/buffer.c, src/testdir/test13.in, src/testdir/test13.ok Patch 5.4p.7 问题: 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) 解决方案: Set the cursor and update the display before showing the popup menu. 相关文件: src/normal.c Patch 5.4p.8 问题: The generated bugreport didn't contain information about $VIMRUNTIME and whether runtime files actually exist. 解决方案: Added a few checks to the bugreport script. 相关文件: runtime/bugreport.vim Patch 5.4p.9 问题: 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) 解决方案: 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. 相关文件: src/dosinst.c Patch 5.4p.10 问题: Win32: On top of 5.4p.9: The "Edit with Vim" entry sometimes used a short file name for a directory. 解决方案: Change the "%1" to "%L" in the registry entry. 相关文件: src/dosinst.c Patch 5.4p.11 问题: 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. 解决方案: Put up a dialog, like for ":confirm qa". Uses the code that was already used for MS-Windows. 相关文件: src/gui.c, src/gui_w32.c Patch 5.4p.12 问题: Win32: Trying to expand a string that is longer than 256 characters could cause a crash. (Steed) 解决方案: For the buffer in win32_expandpath() don't use a fixed size array, allocate it. 相关文件: 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.

5.5 版 本 version-5.5

5.5 版本是 5.4 的漏洞修正版。 改动 changed-5.5

DJGPP 版本现在用 "-O2" 编译而非 "-O4",以减少可执行文件的大小。 src/STYLE 文件移到 runtime/doc/develop.txt。加入设计目标。 'backspace' 现在成为字符串选项。见 5.4.15 补丁。 新增 added-5.5

加入 Exuberant Ctags 3.3 版本。(Darren Hiebert) runtime/mswin.vim 里,把 CTRL-Q 映射为 CTRL-V,任意 CTRL-V 操作均可改用 CTRL-Q。 vimrc_example.vim 里支持 bzip2 文件的解压。 加入补丁的编号加入 version.c 表格。方便跳过一个补丁而不影响后续补丁。 支持 X11 的鼠标滚轮。见 5.5a.14 补丁。 line2byte() 可以用来得到缓冲区的大小。见 5.4.35 补丁。 插入模式下 CTRL-R CTRL-O r 和 CTRL-R CTRL-P r 命令可按本义插入寄存器。见 5.4.48 补丁。 MS-Windows 的卸载 (uninstall) 程序。可以删除 "Edit with Vim" 的注册表项目。也 进行注册使 "Add/Remove programs" 应用可以找到它。见 5.4.x7 补丁。 修正 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 问题: Test11 fails when $GZIP is set to "-v". (Matthew Jackson) 解决方案: Set $GZIP to an empty string. 相关文件: src/testdir/test11.in Patch 5.4.2 问题: Typing <Esc> at the crypt key prompt caused a crash. (Kallingal) 解决方案: Check for a NULL pointer returned from get_crypt_key(). 相关文件: src/fileio.c Patch 5.4.3 问题: Python: Trying to use the name of an unnamed buffer caused a crash. (Daniel Burrows) 解决方案: Check for b_fname being a NULL pointer. 相关文件: src/if_python.c Patch 5.4.4 问题: Win32: When compiled without toolbar, but the 'T' flag is in 'guioptions', there would be an empty space for the toolbar. 解决方案: Add two #ifdefs where checking for the 'T' flag. (Vince Negri) 相关文件: src/gui.c Patch 5.4.5 问题: Athena GUI: Using the Buffers.Refresh menu entry caused a crash. Looks like any ":unmenu" command may cause trouble. 解决方案: Disallow ":unmenu" in the Athena version. Disable the Buffers menu, because the Refresh item would not work. 相关文件: src/menu.c, runtime/menu.vim Patch 5.4.6 问题: GTK GUI: Using ":gui" in the .gvimrc file caused an error. Only happens when the GUI forks. 解决方案: Don't fork in a recursive call of gui_start(). 相关文件: src/gui.c Patch 5.4.7 问题: Typing 'q' at the more prompt for the ATTENTION message causes the file loading to be interrupted. (Will Day) 解决方案: Reset got_int after showing the ATTENTION message. 相关文件: src/memline.c Patch 5.4.8 问题: 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. 解决方案: Before creating the option-window, go to a non-help window. Use ":bdel!" to delete the buffer. 相关文件: 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 问题: GTK GUI: When $DISPLAY is invalid, "gvim -f" just exits. It should run in the terminal. 解决方案: Use gtk_init_check() instead of gtk_init(). 相关文件: src/gui_gtk_x11.c Patch 5.4.11 问题: When using the 'S' flag in 'cpoptions', 'tabstop' is not copied to the next buffer for some commands, e.g., ":buffer". 解决方案: 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. 相关文件: src/option.c Patch 5.4.12 问题: When using 'smartindent', there would be no extra indent if the current line did not have any indent already. (Hanus Adler) 解决方案: 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. 相关文件: src/misc1.c Patch 5.4.13 问题: New SGI C compilers need another option for optimisation. 解决方案: Add a check in configure for "-OPT:Olimit". (Chin A Young) 相关文件: src/configure.in, src/configure Patch 5.4.14 问题: Motif GUI: When the popup menu is present, a tiny window appears on the desktop for some users. 解决方案: Set the menu widget ID for a popup menu to 0. (Thomas Koehler) 相关文件: src/gui_motif.c Patch 5.4.15 问题: Since 'backspace' set to 0 has been made Vi compatible, it is no longer possible to only allow deleting autoindent. 解决方案: Make 'backspace' a list of parts, to allow each kind of backspacing separately. 相关文件: 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 问题: Multibyte: Locale zh_TW.Big5 was not checked for in configure. 解决方案: Add zh_TW.Big5 to configure check. (Chih-Tsun Huang) 相关文件: src/configure.in, src/configure Patch 5.4.17 问题: GUI: When started from inside gvim with ":!gvim", Vim would not start. ":!gvim -f" works fine. 解决方案: After forking, wait a moment in the parent process, to give the child a chance to set its process group. 相关文件: src/gui.c Patch 5.4.18 问题: Python: The clear_history() function also exists in a library. 解决方案: Rename clear_history() to clear_hist(). 相关文件: src/ex_getln.c, src/eval.c, src/proto/ex_getln.pro Patch 5.4.19 问题: 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) 解决方案: Don't allow quitting the printing of a message for the dialog prompt. Added the msg_noquit_more flag for this. 相关文件: src/message.c Patch 5.4.20 问题: GTK: When starting gvim, would send escape sequences to the terminal to switch the cursor off and on. 解决方案: Don't call msg_start() if the GUI is expected to start. 相关文件: src/main.c Patch 5.4.21 问题: Motif: Toplevel menu ordering was wrong when using tear-off items. 解决方案: Don't add one to the index for a toplevel menu. 相关文件: src/gui_motif.c Patch 5.4.22 问题: In Insert mode, <C-Left>, <S-Left>, <C-Right> and <S-Right> didn't update the column used for vertical movement. 解决方案: Set curwin->w_set_curswant for those commands. 相关文件: src/edit.c Patch 5.4.23 问题: When a Visual selection is lost to another program, and then the same text is Visually selected again, the clipboard ownership wasn't regained. 解决方案: Set clipboard.vmode to NUL to force regaining the clipboard. 相关文件: src/normal.c Patch 5.4.24 问题: 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) 解决方案: Don't free cryptkey when it is equal to the 'key' option. 相关文件: src/fileio.c Patch 5.4.25 问题: When 'cindent' is set, but 'autoindent' isn't, comments are not properly indented when starting a new line. (Mitterand) 解决方案: When there is a comment leader for the new line, but 'autoindent' isn't set, do C-indenting. 相关文件: src/misc1.c Patch 5.4.26 问题: Multi-byte: a multibyte character is never recognized in a file name, causing a backslash before it to be removed on Windows. 解决方案: Assume that a leading-byte character is a file name character in vim_isfilec(). 相关文件: src/charset.c Patch 5.4.27 问题: 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. 解决方案: Remove entries for all modes from the PopUp[nvic] menus. Remove the PopUp[nvic] menu entries first, before the name is changed. 相关文件: src/menu.c Patch 5.4.28 问题: When using a BufWritePre autocommand to change 'fileformat', the new value would not be used for writing the file. 解决方案: Check 'fileformat' after executing the autocommands instead of before. 相关文件: src/fileio.c Patch 5.4.29 问题: Athena GUI: When removing the 'g' flag from 'guioptions', using a menu can result in a crash. 解决方案: Always grey-out menus for Athena, don't hide them. 相关文件: src/menu.c Patch 5.4.30 问题: 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. 解决方案: 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) 相关文件: src/os_unix.c, src/ui.c Patch 5.4.31 问题: GUI: When 'mousefocus' is set, moving the mouse over where a window boundary was, causes a hit-enter prompt to be finished. (Jeff Walker) 解决方案: 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. 相关文件: src/gui.c Patch 5.4.32 问题: Unix: $LDFLAGS was not passed to configure. 解决方案: Pass $LDFLAGS to configure just like $CFLAGS. (Jon Miner) 相关文件: src/Makefile Patch 5.4.33 问题: Unix: After expanding an environment variable with the shell, the next expansion would also use the shell, even though it is not needed. 解决方案: Reset "recursive" before returning from gen_expand_wildcards(). 相关文件: src/misc1.c Patch 5.4.34 (also see 5.4.x5) 问题: 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) 解决方案: 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. 相关文件: src/ex_docmd.c, src/fileio.c, src/main.c, src/proto/fileio.pro Patch 5.4.35 问题: There is no function to get the current file size. 解决方案: 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. 相关文件: src/eval.c, runtime/doc/eval.txt Patch 5.4.36 问题: Comparing strings while ignoring case didn't work correctly for some machines. (Mide Steed) 解决方案: vim_stricmp() and vim_strnicmp() only returned 0 or 1. Changed them to return -1 when the first argument is smaller. 相关文件: src/misc2.c Patch 5.4.37 (also see 5.4.40 and 5.4.43) 问题: Long strings from the viminfo file are truncated. 解决方案: When writing a long string to the viminfo file, first write a line with the length, then the string itself in a second line. 相关文件: 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 问题: 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. 解决方案: 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. 相关文件: runtime/optwin.vim Patch 5.4.39 问题: When setting a hidden option, spaces before the equal sign were not skipped and cause an error message. E.g., ":set csprg =cmd". 解决方案: When skipping over a hidden option, check for a following "=val" and skip it too. 相关文件: src/option.c Patch 5.4.40 (depends on 5.4.37) 问题: Compiler error for "atol(p + 1)". (Axel Kielhorn) 解决方案: Add a typecast: "atol((char *)p + 1)". 相关文件: src/ex_cmds.c Patch 5.4.41 问题: Some commands that were not included would give an error message, even when after "if 0". 解决方案: Don't give an error message for an unsupported command when not executing the command. 相关文件: src/ex_docmd.c Patch 5.4.42 问题: ":w" would also cause a truncated message to appear in the message history. 解决方案: Don't put a kept message in the message history when it starts with "<". 相关文件: src/message.c Patch 5.4.43 (depends on 5.4.37) 问题: Mixing long lines with multiple lines in a register causes errors when writing the viminfo file. (Robinson) 解决方案: When reading the viminfo file to skip register contents, skip lines that start with "<". 相关文件: src/ops.c Patch 5.4.44 问题: When 'whichwrap' includes '~', a "~" command that goes on to the next line cannot be properly undone. (Zellner) 解决方案: Save each line for undo in n_swapchar(). 相关文件: src/normal.c Patch 5.4.45 (also see 5.4.x8) 问题: When expand("$ASDF") fails, there is an error message. 解决方案: 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. 相关文件: many Patch 5.4.46 问题: Backspacing did not always use 'softtabstop' after hitting <CR>, inserting a register, moving the cursor, etc. 解决方案: Reset inserted_space much more often in edit(). 相关文件: src/edit.c Patch 5.4.47 问题: When executing BufWritePre or BufWritePost autocommands for a hidden buffer, the cursor could be moved to a non-existing position. (Vince Negri) 解决方案: 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. 相关文件: src/fileio.c Patch 5.4.48 问题: 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) 解决方案: 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. 相关文件: src/edit.c, src/normal.c, runtime/doc/insert.txt Patch 5.4.49 问题: When pasting text with [ <MiddleMouse>, the cursor could end up after the last character of the line. 解决方案: Correct the cursor position for the change in indent. 相关文件: src/ops.c Patch 5.4.x1 (note: Replaces patch 5.4.9) 问题: Win32 GUI: menu hints were never used, because WANT_MENU is not defined until vim.h is included. 解决方案: Move the #ifdef WANT_MENU from where MENUHINTS is defined to where it is used. 相关文件: src/gui_w32.c Patch 5.4.x2 问题: BeOS: When pasting text, one character was moved to the end. 解决方案: Re-enable the BeOS code in fill_input_buf(), and fix timing out with acquire_sem_etc(). (Will Day) 相关文件: src/os_beos.c, src/ui.c Patch 5.4.x3 问题: Win32 GUI: When dropping a directory on a running gvim it crashes. 解决方案: Avoid using a NULL file name. Also display a message to indicate that the current directory was changed. 相关文件: src/gui_w32.c Patch 5.4.x4 问题: Win32 GUI: Removing an item from the popup menu doesn't work. 解决方案: Don't remove the item from the menubar, but from the parent popup menu. 相关文件: src/gui_w32.c Patch 5.4.x5 (addition to 5.4.34) 相关文件: src/gui_w32.c Patch 5.4.x6 问题: Win32: Expanding (dir)name starting with a dot doesn't work. (McCormack) Only when there is a path before it. 解决方案: Fix the check, done before expansion, if the file name pattern starts with a dot. 相关文件: src/os_win32.c Patch 5.4.x7 问题: Win32 GUI: Removing "Edit with Vim" from registry is difficult. 解决方案: 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. 相关文件: src/uninstal.c, src/dosinst.c, src/Makefile.w32, uninstal.txt Patch 5.4.x8 (addition to 5.4.45) 相关文件: many Patch 5.4.x9 问题: Win32 GUI: After executing an external command, focus is not always regained (when using focus-follows-mouse). 解决方案: Add SetFocus() in mch_system(). (Mike Steed) 相关文件: src/os_win32.c Patch 5.5a.1 问题: ":let @* = @:" did not work. The text was not put on the I clipboard. (Fisher) 解决方案: Own the clipboard and put the text on it. 相关文件: src/ops.c Patch 5.5a.2 问题: append() did not mark the buffer modified. Marks below the new line were not adjusted. 解决方案: Fix the f_append() function. 相关文件: src/eval.c Patch 5.5a.3 问题: Editing compressed ".gz" files doesn't work on non-Unix systems, because there is no "mv" command. 解决方案: Add the rename() function and use it instead of ":!mv". Also: Disable the automatic jump to the last position, because it changes the jumplist. 相关文件: src/eval.c, runtime/doc/eval.txt, runtime/vimrc_example.vim Patch 5.5a.4 问题: When using whole-line completion in insert mode while the cursor is in the indent, get "out of memory" error. (Stekrt) 解决方案: Don't allocate a negative amount of memory in ins_complete(). 相关文件: src/edit.c Patch 5.5a.5 问题: Win32: The 'path' option can hold only up to 256 characters, because _MAX_PATH is 256. (Robert Webb) 解决方案: Use a fixed path length of 1024. 相关文件: src/os_win32.h Patch 5.5a.6 问题: Compiling with gcc on Win32, using the Unix Makefile, didn't work. 解决方案: Add $(SUFFIX) to all places where an executable is used. Also pass it to ctags. (Reynolds) 相关文件: src/Makefile Patch 5.5a.7 问题: When using "cat | vim -" in an xterm, the xterm version reply would end up in the file. 解决方案: 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. 相关文件: src/main.c, src/fileio.c Patch 5.5a.8 问题: On multi-threaded Solaris, suspending doesn't work. 解决方案: Call pause() when the SIGCONT signal was not received after sending the SIGTSTP signal. (Nagano) 相关文件: src/os_unix.c Patch 5.5a.9 问题: 'winaltkeys' could be set to an empty argument, which is illegal. 解决方案: Give an error message when doing ":set winaltkeys=". 相关文件: src/option.c Patch 5.5a.10 问题: Win32 console: Using ALTGR on a German keyboard to produce "}" doesn't work, because the 8th bit is set when ALT is pressed. 解决方案: Don't set the 8th bit when ALT and CTRL are used. (Leipert) 相关文件: src/os_win32.c Patch 5.5a.11 问题: Tcl: Configure always uses tclsh8.0. Also: Loading a library doesn't work. 解决方案: 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) 相关文件: src/configure.in, src/configure, src/if_tcl.c Patch 5.5a.12 问题: The "user_commands" feature is called "user-commands". 解决方案: Replace "user-commands" with "user_commands". (Kim Sung-bom) Keep "user-commands" for the has() function, to remain backwards compatible with 5.4. 相关文件: src/eval.c, src/version.c Patch 5.5a.13 问题: 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. 解决方案: Use $VIM for the viminfo file when it is defined, like for MSDOS. Also: Makefile.os2 didn't depend on os_unix.h. 相关文件: src/os_unix.h, src/Makefile.os2 Patch 5.5a.14 问题: Athena, Motif and GTK: The Mouse scroll wheel doesn't work. 解决方案: 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. 相关文件: 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 问题: Using CTRL-A in Insert mode doesn't work correctly when the insert started with the <Insert> key. (Andreas Rohrschneider) 解决方案: Replace <Insert> with "i" before setting up the redo buffer. 相关文件: src/normal.c Patch 5.5a.16 问题: VMS: GUI does not compile and run. 解决方案: 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. 相关文件: 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 问题: SASC complains about dead assignments and implicit type casts. 解决方案: Removed the dead assignments. Added explicit type casts. 相关文件: 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 问题: When using "CTRL-O O" in Insert mode, hit <Esc> and then "o" in another line truncates that line. (Devin Weaver) 解决方案: 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. 相关文件: src/normal.c

5.6 版 本 version-5.6

5.6 版本是 5.5 的漏洞修正版。 改动 changed-5.6

OleVim 文件的小改动。(Christian Schaller) src/version.c 的补丁号之间加入 "/**/"。提供一行上下文,有些版本的 patch 需要如 此。 重新排列 Syntax 菜单,避免子菜单过长。删除字母表项目的键盘快捷键,避免和固定项 目发生冲突。 新增 added-5.6

加入 Exuberant Ctags 3.4 版本。(Darren Hiebert) Python 的 OpenWithVim。(Christian Schaller) Win32 GUI: gvimext.dll,用于关联菜单 "Edit with Vim" 项目。避免了 MS Office 任务栏上报告的问题。现在用作外壳扩展。(Tianmiao Hu) 新语法文件: abel Abel (John Cook) aml Arc Macro Language (Nikki Knuit) apachestyle Apache-style config file (Christian Hammers) cf Cold Fusion (Jeff Lanzarotta) ctrlh 带有 CTRL-H 序列的文件 (Bram Moolenaar) cupl CUPL (John Cook) cuplsim CUPL simulation (John Cook) erlang Erlang (Kresimir Marzic) gedcom Gedcom (Paul Johnson) icon Icon (Wendell Turner) ist MakeIndex style (Peter Meszaros) jsp Java Server Pages (Rafael Garcia-Suarez) rcslog Rcslog (Joe Karthauser) remind Remind (Davide Alberani) sqr Structured Query Report Writer (Paul Moore) tads TADS (Amir Karger) texinfo Texinfo (Sandor Kopanyi) xpm2 X Pixmap v2 (Steve Wall) 'cpoptions' 的 'C' 标志位可关闭源代码行的合并功能。见下 5.5.013 补丁。 line-continuation :syntax 命令的 "excludenl" 参数。见下 5.5.032 补丁。 :syn-excludenl 实现 z+ 和 z^ 命令。见下 5.5.050 补丁。 Corel Draw 格式的 Vim 标志 (logo)。可以使用任意精度比例。 修正 fixed-5.6

Using this mapping in Select mode, terminated completion: ":vnoremap <C-N> <Esc>a<C-N>" (Benji Fisher) Ignore K_SELECT in ins_compl_prep(). VMS (Zoltan Arpadffy, David Elins): - ioctl() in pty.c caused trouble, #ifndef VMS added. - Cut & paste mismatch corrected. - Popup menu line crash corrected. (Patch 5.5.047) - Motif directories during open and save as corrected. - Handle full file names with version numbers. (Patch 5.5.046) - Directory handling (CD command etc.) - Corrected file name conversion VMS to Unix and v.v. - Recovery was not working. - Terminal and signal handling was outdated compared to os_unix.c. - Improved os_vms.txt. Configure used fprintf() instead of printf() to check for __DATE__ and __TIME__. (John Card II) BeOS: Adjust computing the char_height and char_ascent. Round them up separately, avoids redrawing artifacts. (Mike Steed) Fix a few multibyte problems in menu_name_skip(), set_reg_ic(), searchc() and findmatchlimit(). (Taro Muraoka) GTK GUI: - With GTK 1.2.5 and later the scrollbars were not redrawn correctly. - Adjusted the gtk_form_draw() function. - SNiFF connection didn't work. - 'mousefocus' was not working. (Dalecki) - Some keys were not working with modifiers: Shift-Tab, Ctrl-Space and CTRL-@. Patch 5.5.001 问题: Configure in the top directory did not pass on an argument with a space correctly. For example "./configure --previs="/My home". (Stephane Chazelas) 解决方案: Use '"$@"' instead of '$*' to pass on the arguments. 相关文件: configure Patch 5.5.002 问题: Compilation error for using "fds[] & POLLIN". (Jeff Walker) 解决方案: Use "fds[].revents & POLLIN". 相关文件: src/os_unix.c Patch 5.5.003 问题: The autoconf check for sizeof(int) is wrong on machines where sizeof(size_t) != sizeof(int). 解决方案: Use our own configure check. Also fixes the warning for cross-compiling. 相关文件: src/configure.in, src/configure Patch 5.5.004 问题: On Unix it's not possible to interrupt ":sleep 100". 解决方案: Switch terminal to cooked mode while asleep, to allow a SIGINT to wake us up. But switch off echo, added TMODE_SLEEP. 相关文件: src/term.h, src/os_unix.c Patch 5.5.005 问题: When using <f-args> with a user command, an empty argument to the command resulted in one empty string, while no string was expected. 解决方案: Catch an empty argument and pass no argument to the function. (Paul Moore) 相关文件: src/ex_docmd.c Patch 5.5.006 问题: Python: When platform-dependent files are in another directory than the platform-independent files it doesn't work. 解决方案: Also check the executable directory, and add it to CFLAGS. (Tessa Lau) 相关文件: src/configure.in, src/configure Patch 5.5.007 (extra) 问题: Win32 OLE: Occasional crash when exiting while still being used via OLE. 解决方案: Move OleUninitialize() to before deleting the application object. (Vince Negri) 相关文件: src/if_ole.cpp Patch 5.5.008 问题: 10000@@ takes a long time and cannot be interrupted. 解决方案: Check for CTRL-C typed while in the loop to push the register. 相关文件: src/normal.c Patch 5.5.009 问题: Recent Sequent machines don't link with "-linet". (Kurtis Rader) 解决方案: Remove configure check for Sequent. 相关文件: src/configure.in, src/configure Patch 5.5.010 问题: Ctags freed a memory block twice when exiting. When out of memory, a misleading error message was given. 解决方案: Update to ctags 3.3.2. Also fixes a few other problems. (Darren Hiebert) 相关文件: src/ctags/* Patch 5.5.011 问题: After "CTRL-V s", the cursor jumps back to the start, while all other operators leave the cursor on the last changed character. (Xiangjiang Ma) 解决方案: Position cursor on last changed character, if possible. 相关文件: src/ops.c Patch 5.5.012 问题: Using CTRL-] in Visual mode doesn't work when the text includes a space (just where it's useful). (Stefan Bittner) 解决方案: Don't escape special characters in a tag name with a backslash. 相关文件: src/normal.c Patch 5.5.013 问题: The ":append" and ":insert" commands allow using a leading backslash in a line. The ":source" command concatenates those lines. (Heinlein) 解决方案: Add the 'C' flag in 'cpoptions' to switch off concatenation. 相关文件: src/ex_docmd.c, src/option.h, runtime/doc/options.txt, runtime/filetype.vim, runtime/scripts.vim Patch 5.5.014 问题: When executing a register with ":@", the ":append" command would get text lines with a ':' prepended. (Heinlein) 解决方案: Remove the ':' characters. 相关文件: src/ex_docmd.c, src/ex_getln.c, src/globals.h Patch 5.5.015 问题: When using ":g/pat/p", it's hard to see where the output starts, the ":g" command is overwritten. Vi keeps the ":g" command. 解决方案: Keep the ":g" command, but allow overwriting it with the report for the number of changes. 相关文件: src/ex_cmds.c Patch 5.5.016 (extra) 问题: Win32: Using regedit to install Vim in the popup menu requires the user to confirm this in a dialog. 解决方案: Use "regedit /s" to avoid the dialog 相关文件: src/dosinst.c Patch 5.5.017 问题: If an error occurs when closing the current window, Vim could get stuck in the error handling. 解决方案: Don't set curwin to NULL when closing the current window. 相关文件: src/window.c Patch 5.5.018 问题: Absolute paths in shell scripts do not always work. 解决方案: Use /usr/bin/env to find out the path. 相关文件: runtime/doc/vim2html.pl, runtime/tools/efm_filter.pl, runtime/tools/shtags.pl Patch 5.5.019 问题: A function call in 'statusline' stops using ":q" twice from exiting, when the last argument hasn't been edited. 解决方案: Don't decrement quitmore when executing a function. (Madsen) 相关文件: src/ex_docmd.c Patch 5.5.020 问题: When the output of CTRL-D completion in the commandline goes all the way to the last column, there is an empty line. 解决方案: Don't add a newline when the cursor wrapped already. (Madsen) 相关文件: src/ex_getln.c Patch 5.5.021 问题: When checking if a file name in the tags file is relative, environment variables were not expanded. 解决方案: Expand the file name before checking if it is relative. (Madsen) 相关文件: src/tag.c Patch 5.5.022 问题: When setting or resetting 'paste' the ruler wasn't updated. 解决方案: Update the status lines when 'ruler' changes because of 'paste'. 相关文件: src/option.c Patch 5.5.023 问题: When editing a new file and autocommands change the cursor position, the cursor was moved back to the first non-white, unless 'startofline' was reset. 解决方案: Keep the new column, just like the line number. 相关文件: src/ex_cmds.c Patch 5.5.024 (extra) 问题: Win32 GUI: When using confirm() to put up a dialog without a default button, the dialog would not have keyboard focus. (Krishna) 解决方案: Always set focus to the dialog window. Only set focus to a button when a default one is specified. 相关文件: src/gui_w32.c Patch 5.5.025 问题: When using "keepend" in a syntax region, a contained match that includes the end-of-line could still force that region to continue, if there is another contained match in between. 解决方案: Check the keepend_level in check_state_ends(). 相关文件: src/syntax.c Patch 5.5.026 问题: When starting Vim in a white-on-black xterm, with 'bg' set to "dark", and then starting the GUI with ":gui", setting 'bg' to "light" in the gvimrc, the highlighting isn't set. (Tsjokwing) 解决方案: Set the highlighting when 'bg' is changed in the gvimrc, even though full_screen isn't set. 相关文件: src/option.c Patch 5.5.027 问题: Unix: os_unix.c doesn't compile when XTERM_CLIP is used but WANT_TITLE isn't. (Barnum) 解决方案: Move a few functions that are used by the X11 title and clipboard and put another "#if" around it. 相关文件: src/os_unix.c Patch 5.5.028 (extra) 问题: Win32 GUI: When a file is dropped on Win32 gvim while at the ":" prompt, the file is edited but the command line is actually still there, the cursor goes back to command line on the next command. (Krishna) 解决方案: When dropping a file or directory on gvim while at the ":" prompt, insert the name of the file/directory. Allows using the file/directory name for any Ex command. 相关文件: src/gui_w32.c Patch 5.5.029 问题: "das" at the end of the file didn't delete the last character of the sentence. 解决方案: When there is no character after the sentence, make the operation inclusive in current_sent(). 相关文件: src/search.c Patch 5.5.030 问题: Unix: in os_unix.c, "term_str" is used, which is also defined in vim.h as a macro. (wuxin) 解决方案: Renamed "term_str" to "buf" in do_xterm_trace(). 相关文件: src/os_unix.c Patch 5.5.031 (extra) 问题: Win32 GUI: When exiting Windows, gvim will leave swap files behind and will be killed ungracefully. (Krishna) 解决方案: Catch the WM_QUERYENDSESSION and WM_ENDSESSION messages and try to exit gracefully. Allow the user to cancel the shutdown if there is a changed buffer. 相关文件: src/gui_w32.c Patch 5.5.032 问题: Patch 5.5.025 wasn't right. And C highlighting was still not working correctly for a #define. 解决方案: Added "excludenl" argument to ":syntax", to be able not to extend a containing item when there is a match with the end-of-line. 相关文件: src/syntax.c, runtime/doc/syntax.txt, runtime/syntax/c.vim Patch 5.5.033 问题: When reading from stdin, a long line in viminfo would mess up the file message. readfile() uses IObuff for keep_msg, which could be overwritten by anyone. 解决方案: Copy the message from IObuff to msg_buf and set keep_msg to that. Also change vim_fgets() to not use IObuff any longer. 相关文件: src/fileio.c Patch 5.5.034 问题: "gvim -rv" caused a crash. Using 't_Co' before it's set. 解决方案: Don't try to initialize the highlighting before it has been initialized from main(). 相关文件: src/syntax.c Patch 5.5.035 问题: GTK with XIM: Resizing with status area was messy, and ":set guioptions+=b" didn't work. 解决方案: Make status area a separate widget, but not a separate window. (Chi-Deok Hwang) 相关文件: src/gui_gtk_f.c, src/gui_gtk_x11.c, src/multbyte.c Patch 5.5.036 问题: The GZIP_read() function in $VIMRUNTIME/vimrc_example.vim to uncompress a file did not do detection for 'fileformat'. This is because the filtering is done with 'binary' set. 解决方案: Split the filtering into separate write, filter and read commands. 相关文件: runtime/vimrc_example.vim Patch 5.5.037 问题: The "U" command didn't mark the buffer as changed. (McCormack) 解决方案: Set the 'modified' flag when using "U". 相关文件: src/undo.c Patch 5.5.038 问题: When typing a long ":" command, so that the screen scrolls up, causes the hit-enter prompt, even though the user just typed return to execute the command. 解决方案: Reset need_wait_return if (part of) the command was typed in getcmdline(). 相关文件: src/ex_getln.c Patch 5.5.039 问题: When using a custom status line, "%a" (file # of #) reports the index of the current window for all windows. 解决方案: Pass a window pointer to append_arg_number(), and pass the window being updated from build_stl_str_hl(). (Stephen P. Wall) 相关文件: src/buffer.c, src/screen.c, src/proto/buffer.pro Patch 5.5.040 问题: Multi-byte: When there is some error in xim_real_init(), it can close XIM and return. After this there can be a segv. 解决方案: Test "xic" for being non-NULL, don't set "xim" to NULL. Also try to find more matches for supported styles. (Sung-Hyun Nam) 相关文件: src/multbyte.c Patch 5.5.041 问题: X11 GUI: CTRL-_ requires the SHIFT key only on some machines. 解决方案: Translate CTRL-- to CTRL-_. (Robert Webb) 相关文件: src/gui_x11.c Patch 5.5.042 问题: X11 GUI: keys with ALT were assumed to be used for the menu, even when the menu has been disabled by removing 'm' from 'guioptions'. 解决方案: Ignore keys with ALT only when gui.menu_is_active is set. (Raf) 相关文件: src/gui_x11.c Patch 5.5.043 问题: GTK: Handling of fontset fonts was not right when 'guifontset' contains exactly 14 times '-'. 解决方案: Avoid setting fonts when working with a fontset. (Sung-Hyun Nam) 相关文件: src/gui_gtk_x11.c Patch 5.5.044 问题: pltags.pl contains an absolute path "/usr/local/bin/perl". That might not work everywhere. 解决方案: Use "/usr/bin/env perl" instead. 相关文件: runtime/tools/pltags.pl Patch 5.5.045 问题: Using "this_session" variable does not work, requires preceding it with "v:". Default filename for ":mksession" isn't mentioned in the docs. (Fisher) 解决方案: Support using "this_session" to be backwards compatible. 相关文件: src/eval.c, runtime/doc/options.txt Patch 5.5.046 (extra) 问题: VMS: problems with path and filename. 解决方案: Truncate file name at last ';', etc. (Zoltan Arpadffy) 相关文件: src/buffer.c, src/fileio.c, src/gui_motif.c, src/os_vms.c, src/proto/os_vms.pro Patch 5.5.047 问题: VMS: Crash when using the popup menu 解决方案: Turn the #define MENU_MODE_CHARS into an array. (Arpadffy) 相关文件: src/structs.h, src/menu.c Patch 5.5.048 问题: HP-UX 11: Compiling doesn't work, because both string.h and strings.h are included. (Squassabia) 解决方案: The configure test for including both string.h and strings.h must include <Xm/Xm.h> first, because it causes problems. 相关文件: src/configure.in, src/configure, src/config.h.in Patch 5.5.049 问题: Unix: When installing Vim, the protection bits of files might be influenced by the umask. 解决方案: Add $(FILEMOD) to Makefile. (Shetye) 相关文件: src/Makefile Patch 5.5.050 问题: "z+" and "z^" commands are missing. 解决方案: Implemented "z+" and "z^". 相关文件: src/normal.c, runtime/doc/scroll.txt, runtime/doc/index.txt Patch 5.5.051 问题: Several Unix systems have a problem with the optimization limits check in configure. 解决方案: Removed the configure check, let the user add it manually in Makefile or the environment. 相关文件: src/configure.in, src/configure, src/Makefile Patch 5.5.052 问题: Crash when using a cursor key at the ATTENTION prompt. (Alberani) 解决方案: Ignore special keys at the console dialog. Also ignore characters > 255 for other uses of tolower() and toupper(). 相关文件: src/menu.c, src/message.c, src/misc2.c Patch 5.5.053 问题: Indenting is wrong after a function when 'cino' has "fs". Another problem when 'cino' has "{s". 解决方案: Put line after closing "}" of a function at the left margin. Apply ind_open_extra in the right way after a '{'. 相关文件: src/misc1.c, src/testdir/test3.in, src/testdir/test3.ok Patch 5.5.054 问题: Unix: ":e #" doesn't work if the alternate file name contains a space or backslash. (Hudacek) 解决方案: When replacing "#", "%" or other items that stand for a file name, prepend a backslash before special characters. 相关文件: src/ex_docmd.c Patch 5.5.055 问题: Using "<C-V>$r-" in blockwise Visual mode replaces one character beyond the end of the line. (Zivkov) 解决方案: Only replace existing characters. 相关文件: src/ops.c Patch 5.5.056 问题: After "z20<CR>" messages were printed at the old command line position once. (Veselinovic) 解决方案: Set msg_row and msg_col when changing cmdline_row in win_setheight(). 相关文件: src/window.c Patch 5.5.057 问题: After "S<Esc>" it should be possible to restore the line with "U". (Veselinovic) 解决方案: Don't call u_clearline() in op_delete() when changing only one line. 相关文件: src/ops.c Patch 5.5.058 问题: Using a long search pattern and then "n" causes the hit-enter prompt. (Krishna) 解决方案: Truncate the echoed pattern, like other messages. Moved code for truncating from msg_attr() to msg_strtrunc(). 相关文件: src/message.c, src/proto/message.pro, src/search.c Patch 5.5.059 问题: GTK GUI: When $term is invalid, using "gvim" gives an error message, even though $term isn't really used. (Robbins) 解决方案: When the GUI is about to start, skip the error messages for a wrong $term. 相关文件: src/term.c Patch 5.5.060 (extra) 问题: Dos 32 bit: When a directory in 'backupdir' doesn't exist, ":w" causes the file to be renamed to "axlqwqhy.ba~". (Matzdorf) 解决方案: The code to work around a LFN bug in Windows 95 doesn't handle a non-existing target name correctly. When renaming fails, make sure the file has its original name. Also do this for the Win32 version, although it's unlikely that it runs into this problem. 相关文件: src/os_msdos.c, src/os_win32.c Patch 5.5.061 问题: When using "\:" in a modeline, the backslash is included in the option value. (Mohsin) 解决方案: Remove one backslash before the ':' in a modeline. 相关文件: src/buffer.c, runtime/doc/options.txt Patch 5.5.062 (extra) 问题: Win32 console: Temp files are created in the root of the current drive, which may be read-only. (Peterson) 解决方案: Use the same mechanism of the GUI version: Use $TMP, $TEMP or the current directory. Cleaned up vim_tempname() a bit. 相关文件: src/fileio.c, src/os_win32.h, runtime/doc/os_dos.txt Patch 5.5.063 问题: When using whole-line completion in Insert mode, 'cindent' is applied, even after changing the indent of the line. 解决方案: Don't reindent the completed line after inserting/removing indent. (Robert Webb) 相关文件: src/edit.c Patch 5.5.064 问题: has("sniff") doesn't work correctly. 解决方案: Return 1 when Vim was compiled with the +sniff feature. (Pruemmer) 相关文件: src/eval.c Patch 5.5.065 问题: When dropping a file on Vim, the 'shellslash' option is not effective. (Krishna) 解决方案: Fix the slashes in the dropped file names according to 'shellslash'. 相关文件: src/ex_docmd.c, runtime/doc/options.txt Patch 5.5.066 问题: For systems with backslash in file name: Setting a file name option to a value starting with "\\machine" removed a backslash. 解决方案: Keep the double backslash for "\\machine", but do change "\\\\machine" to "\\machine" for backwards compatibility. 相关文件: src/option.c, runtime/doc/options.txt Patch 5.5.067 问题: With 'hlsearch' set, the pattern "\>" doesn't highlight the first match in a line. (Benji Fisher) 解决方案: Fix highlighting an empty match. Also highlight the first character in an empty line for "$". 相关文件: src/screen.c Patch 5.5.068 问题: Crash when a ":while" is used with an argument that has an error. (Sylvain Viart) 解决方案: Was using an uninitialized index in the cs_line[] array. The crash only happened when the index was far off. Made sure the uninitialized index isn't used. 相关文件: src/ex_docmd.c Patch 5.5.069 问题: Shifting lines in blockwise Visual mode didn't set the 'modified' flag. 解决方案: Do set the 'modified' flag. 相关文件: src/ops.c Patch 5.5.070 问题: When editing a new file, creating that file outside of Vim, then editing it again, ":w" still warns for overwriting an existing file. (Nam) 解决方案: The BF_NEW flag in the "b_flags" field wasn't cleared properly. 相关文件: src/buffer.c, src/fileio.c Patch 5.5.071 问题: Using a matchgroup in a ":syn region", which is the same syntax group as the region, didn't stop a contained item from matching in the start pattern. 解决方案: Also push an item on the stack when the syntax ID of the matchgroup is the same as the syntax ID of the region. 相关文件: src/syntax.c Patch 5.5.072 (extra) 问题: Dos 32 bit: When setting 'columns' to a too large value, Vim may crash, and the DOS console too. 解决方案: Check that the value of 'columns' isn't larger than the number of columns that the BIOS reports. 相关文件: src/os_msdos.c, src/proto/os_msdos.pro, src/option.c Patch 5.5.073 (extra) 问题: Win 32 GUI: The Find and Find/Replace dialogs didn't show the "match case" checkbox. The Find/Replace dialog didn't handle the "match whole word" checkbox. 解决方案: Support the "match case" and "match whole word" checkboxes. 相关文件: src/gui_w32.c Patch 5.6a.001 问题: Using <C-End> with a count doesn't work like it does with "G". (Benji Fisher) 解决方案: Accept a count for <C-End> and <C-Home>. 相关文件: src/normal.c Patch 5.6a.002 问题: The script for conversion to HTML was an older version. 解决方案: Add support for running 2html.vim on a color terminal. 相关文件: runtime/syntax/2html.vim Patch 5.6a.003 问题: Defining a function inside a function didn't give an error message. A missing ":endfunction" doesn't give an error message. 解决方案: Allow defining a function inside a function. 相关文件: src/eval.c, runtime/doc/eval.txt Patch 5.6a.004 问题: A missing ":endwhile" or ":endif" doesn't give an error message. (Johannes Zellner) 解决方案: Check for missing ":endwhile" and ":endif" in sourced files. Add missing ":endif" in file selection macros. 相关文件: src/ex_docmd.c, runtime/macros/file_select.vim Patch 5.6a.005 问题: 'hlsearch' was not listed alphabetically. The value of 'toolbar' was changed when 'compatible' is set. 解决方案: Moved entry of 'hlsearch' in options[] table down. Don't reset 'toolbar' option to the default value when 'compatible' is set. 相关文件: src/option.c Patch 5.6a.006 问题: Using a backwards range inside ":if 0" gave an error message. 解决方案: Don't complain about a range when it is not going to be used. (Stefan Roemer) 相关文件: src/ex_docmd.c Patch 5.6a.007 问题: ":let" didn't show internal Vim variables. (Ron Aaron) 解决方案: Do show ":v" variables for ":let" and ":let v:name". 相关文件: src/eval.c Patch 5.6a.008 问题: Selecting a syntax from the Syntax menu gives an error message. 解决方案: Replace "else if" in SetSyn() with "elseif". (Ronald Schild) 相关文件: runtime/menu.vim Patch 5.6a.009 问题: When compiling with +extra_search but without +syntax, there is a compilation error in screen.c. (Axel Kielhorn) 解决方案: Adjust the #ifdef for declaring and initializing "line" in win_line(). Also solve compilation problem when +statusline is used without +eval. Another one when +cmdline_compl is used without +eval. 相关文件: src/screen.c, src/misc2.c Patch 5.6a.010 问题: In a function, ":startinsert!" does not append to the end of the line if a ":normal" command was used to move the cursor. (Fisher) 解决方案: Reset "w_set_curswant" to avoid that w_curswant is changed again. 相关文件: src/ex_docmd.c Patch 5.6a.011 (depends on 5.6a.004) 问题: A missing ":endif" or ":endwhile" in a function doesn't give an error message. 解决方案: Give that error message. 相关文件: src/ex_docmd.c Patch 5.6a.012 (depends on 5.6a.008) 问题: Some Syntax menu entries caused a hit-enter prompt. 解决方案: Call a function to make the command shorter. Also rename a few functions to avoid name clashes. 相关文件: runtime/menu.vim Patch 5.6a.013 问题: Command line completion works different when another completion was done earlier. (Johannes Zellner) 解决方案: Reset wim_index when starting a new completion. 相关文件: src/ex_getln.c Patch 5.6a.014 问题: Various warning messages when compiling and running lint with different combinations of features. 解决方案: Fix the warning messages. 相关文件: src/eval.c, src/ex_cmds.c, src/ex_docmd.c, src/gui_gtk_x11.c, src/option.c, src/screen.c, src/search.c, src/syntax.c, src/feature.h, src/globals.h Patch 5.6a.015 问题: The vimtutor command doesn't always know the value of $VIMRUNTIME. 解决方案: Let Vim expand $VIMRUNTIME, instead of the shell. 相关文件: src/vimtutor Patch 5.6a.016 (extra) 问题: Mac: Window size is restricted when starting. Cannot drag the window all over the desktop. 解决方案: Get real screen size instead of assuming 640x400. Do not use a fixed number for the drag limits. (Axel Kielhorn) 相关文件: src/gui_mac.c Patch 5.6a.017 问题: The "Paste" entry in popup menu for Visual, Insert and Cmdline mode is in the wrong position. (Stol) 解决方案: Add priority numbers for all Paste menu entries. 相关文件: runtime/menu.vim Patch 5.6a.018 问题: GTK GUI: submenu priority doesn't work. Help dialog could be destroyed too soon. When closing a dialog window (e.g. the "ATTENTION" one), Vim would just hang. When GTK theme is changed, Vim doesn't adjust to the new colors. Argument for ":promptfind" isn't used. 解决方案: Fixed the mentioned problems. Made the dialogs look&feel nicer. Moved functions to avoid the need for a forward declaration. Fixed reentrancy of the file browser dialog. Added drag&drop support for GNOME. Init the text for the Find/replace dialog from the last used search string. Set "match whole word" toggle button correctly. Made repeat rate for drag outside of window depend on the distance from the window. (Marcin Dalecki) Made the drag in Visual mode actually work. Removed recursiveness protection from gui_mch_get_rgb(), it might cause more trouble than it solves. 相关文件: src/ex_docmd.c, src/gui_gtk.c, src/gui_gtk_x11.c, src/ui.c, src/proto/ui.pro, src/misc2.c Patch 5.6a.019 问题: When trying to recover through NFS, which uses a large block size, Vim might think the swap file is empty, because mf_blocknr_max is zero. (Scott McDermott) 解决方案: When computing the number of blocks of the file in mf_open(), round up instead of down. 相关文件: src/memfile.c Patch 5.6a.020 问题: GUI GTK: Could not set display for gvim. 解决方案: Add "-display" and "--display" arguments. (Marcin Dalecki) 相关文件: src/gui_gtk_x11.c Patch 5.6a.021 问题: Recovering still may not work when the block size of the device where the swap file is located is larger than 4096. 解决方案: Read block 0 with the minimal block size. 相关文件: src/memline.c, src/memfile.c, src/vim.h Patch 5.6a.022 (extra) 问题: Win32 GUI: When an error in the vimrc causes a dialog to pop up (e.g., for an existing swap file), Vim crashes. (David Elins) 解决方案: Before showing a dialog, open the main window. 相关文件: src/gui_w32.c Patch 5.6a.023 问题: Using expand("%:gs??/?") causes a crash. (Ron Aaron) 解决方案: Check for running into the end of the string in do_string_sub(). 相关文件: src/eval.c Patch 5.6a.024 问题: Using an autocommand to delete a buffer when leaving it can cause a crash when jumping to a tag. (Franz Gorkotte) 解决方案: In do_tag(), store tagstacklen before jumping to another buffer. Check tagstackidx after jumping to another buffer. Add extra check in win_split() if tagname isn't NULL. 相关文件: src/tag.c, src/window.c Patch 5.6a.025 (extra) 问题: Win32 GUI: The tables for toupper() and tolower() are initialized too late. (Mike Steed) 解决方案: Move the initialization to win32_init() and call it from main(). 相关文件: src/main.c, src/os_w32.c, src/proto/os_w32.pro Patch 5.6a.026 问题: When the SNiFF connection is open, shell commands hang. (Pruemmer) 解决方案: Skip a second wait() call if waitpid() already detected that the child has exited. 相关文件: src/os_unix.c Patch 5.6a.027 (extra) 问题: Win32 GUI: The "Edit with Vim" popup menu entry causes problems for the Office toolbar. 解决方案: Use a shell extension dll. (Tianmiao Hu) Added it to the install and uninstal programs, replaces the old "Edit with Vim" menu registry entries. 相关文件: src/dosinst.c, src/uninstal.c, gvimext/*, runtime/doc/gui_w32.txt Patch 5.6a.028 (extra) 问题: Win32 GUI: Dialogs and tear-off menus can't handle multibyte characters. 解决方案: Adjust nCopyAnsiToWideChar() to handle multibyte characters correctly. 相关文件: src/gui_w32.c

5.7 版 本 version-5.7

5.7 版本是 5.6 的漏洞修正版。 改动 changed-5.7

src/INSTALL.mac 更名为 INSTALL_mac.txt,以避免错认文件类型。同时更名 src/INSTALL.amiga 为 INSTALL_ami.txt。 新增 added-5.7

新增语法文件: stp Stored Procedures (Jeff Lanzarotta) snnsnet、snnspat、snnsres SNNS (Davide Alberani) mel MEL (Robert Minsk) ruby Ruby (Mirko Nasato) tli TealInfo (Kurt W. Andrews) ora Oracle config file (Sandor Kopanyi) abaqus Abaqus (Carl Osterwisch) jproperties Java Properties (Simon Baldwin) apache Apache config (Allan Kelly) csp CSP (Jan Bredereke) samba Samba config (Rafael Garcia-Suarez) kscript KDE script (Thomas Capricelli) hb Hyper Builder (Alejandro Forero Cuervo) fortran Fortran (rewritten) (Ajit J. Thakkar) sml SML (Fabrizio Zeno Cornelli) cvs CVS commit (Matt Dunford) aspperl ASP Perl (Aaron Hope) bc BC calculator (Vladimir Scholtz) latte Latte (Nick Moffitt) wml WML (Gerfried Fuchs) 加入 Exuberant ctags 3.5.1。(Darren Hiebert) 语法项目的 "display" 和 "fold" 参数,为了将来扩展用。现在忽略它们。 Macintosh 的 strftime() 函数。 macros/explorer.vim: 文件浏览器脚本 (M A Aziz Ahmed) 修正 fixed-5.7

The 16 bit MS-DOS version is now compiled with Bcc 3.1 instead of 4.0. The executable is smaller. When a "make test" failed, the output file was lost. Rename it to test99.failed to be able to see what went wrong. After sourcing bugreport.vim, it's not clear that bugreport.txt has been written in the current directory. Edit bugreport.txt to avoid that. Adding IME support when using Makefile.w32 didn't work. (Taro Muraoka) Win32 console: Mouse drags were passed on even when the mouse didn't move. Perl interface: In Buffers(), type of argument to SvPV() was int, should be STRLEN. (Tony Leneis) Problem with prototype for index() on AIX 4.3.0. Added check for _AIX43 in os_unix.h. (Jake Hamby) Mappings in mswin.vim could break when some commands are mapped. Add "nore" to most mappings to avoid re-mapping. modify_fname() made a copy of a file name for ":p" when it already was a full path name, which is a bit slow. Win32 with Borland C++ 5.5: Pass the path to the compiler on to xxd and ctags, to avoid depending on $PATH. Fixed "make clean". Many fixes to Macintosh specific parts: (mostly by Dany StAmant) - Only one Help menu. - No more crash when removing a menu item. - Support as External Editor for Codewarrior (still some little glitches). - Popup menu support. - Fixed crash when pasting after application switch. - Color from rgb.txt properly displayed. - 'isprint' default includes all chars above '~'. (Axel Kielhorn) - mac_expandpath() was leaking memory. - Add digraphs table. (Axel Kielhorn) - Multi-byte support: (Kenichi Asai) Switch keyscript when going in/out of Insert mode. Draw multibyte character correctly. Don't use mblen() but highest bit of char to detect multibyte char. Display value of multibyte in statusline (also for other systems). - mouse button was not initialized properly to MOUSE_LEFT when USE_CTRLCLICKMENU not defined. - With Japanese SJIS characters: Make "w", "b", and "e" work properly. (Kenichi Asai) - Replaced old CodeWarrior file os_mac.CW9.hqx with os_mac.cw5.sit.hqx. Fixes for VMS: (Zoltan Arpadffy) (also see patch 5.6.045 below) - Added Makefile_vms.mms and vimrc.vms to src/testdir to be able to run the tests. - Various fixes. - Set 'undolevels' to 1000 by default. - Made mch_settitle() equivalent to the one in os_unix.c. RiscOS: A few prototypes for os_riscos.c were outdated. Generate prototypes automatically. 预发布补丁: Patch 5.6.001 问题: When using "set bs=0 si cin", Inserting "#<BS>" or "}<BS>" which reduces the indent doesn't delete the "#" or "}". (Lorton) 解决方案: Adjust ai_col in ins_try_si(). 相关文件: src/edit.c Patch 5.6.002 问题: When using the vim.vim syntax file, a comment with all uppercase characters causes a hang. 解决方案: Adjust pattern for vimCommentTitle (Charles Campbell) 相关文件: runtime/syntax/vim.vim Patch 5.6.003 问题: GTK GUI: Loading a user defined toolbar bitmap gives a warning about the colormap. Probably because the window has not been opened yet. 解决方案: Use gdk_pixmap_colormap_create_from_xpm() to convert the xpm file. (Keith Radebaugh) 相关文件: src/gui_gtk.c Patch 5.6.004 (extra) 问题: Win32 GUI with IME: When setting 'guifont' to "*", the font requester appears twice. 解决方案: In gui_mch_init_font() don't call get_logfont() but copy norm_logfont from fh. (Yasuhiro Matsumoto) 相关文件: src/gui_w32.c Patch 5.6.005 问题: When 'winminheight' is zero, CTRL-W - with a big number causes a crash. (David Kotchan) 解决方案: Check for negative window height in win_setheight(). 相关文件: src/window.c Patch 5.6.006 问题: GTK GUI: Bold font cannot always be used. Memory is freed too early in gui_mch_init_font(). 解决方案: Move call to g_free() to after where sdup is used. (Artem Hodyush) 相关文件: src/gui_gtk_x11.c Patch 5.6.007 (extra) 问题: Win32 IME: Font is not changed when screen font is changed. And IME composition window does not trace the cursor. 解决方案: Initialize IME font. When cursor is moved, set IME composition window with ImeSetCompositionWindow(). Add call to ImmReleaseContext() in several places. (Taro Muraoka) 相关文件: src/gui.c, src/gui_w32.c, src/proto/gui_w32.pro Patch 5.6.008 (extra) 问题: Win32: When two files exist with the same name but different case (through NFS or Samba), fixing the file name case could cause the wrong one to be edited. 解决方案: Prefer a perfect match above a match while ignoring case in fname_case(). (Flemming Madsen) 相关文件: src/os_win32.c Patch 5.6.009 (extra) 问题: Win32 GUI: Garbage in Windows Explorer help line when selecting "Edit with Vim" popup menu entry. 解决方案: Only return the help line when called with the GCS_HELPTEXT flag. (Tianmiao Hu) 相关文件: GvimExt/gvimext.cpp Patch 5.6.010 问题: A file name which contains a TAB was not read correctly from the viminfo file and the ":ls" listing was not aligned properly. 解决方案: Parse the buffer list lines in the viminfo file from the end backwards. Count a Tab for two characters to align the ":ls" list. 相关文件: src/buffer.c Patch 5.6.011 问题: When 'columns' is huge (using a tiny font) and 'statusline' is used, Vim can crash. 解决方案: Limit maxlen to MAXPATHL in win_redr_custom(). (John Mullin) 相关文件: src/screen.c Patch 5.6.012 问题: When using "zsh" for /bin/sh, toolcheck may hang until "exit" is typed. (Kuratczyk) 解决方案: Add "-c exit" when checking for the shell version. 相关文件: src/toolcheck Patch 5.6.013 问题: Multibyte char in tooltip is broken. 解决方案: Consider multibyte char in replace_termcodes(). (Taro Muraoka) Files: src/term.c Patch 5.6.014 问题: When cursor is at the end of line and the character under cursor is a multibyte character, "yl" doesn't yank 1 multibyte-char. (Takuhiro Nishioka) 解决方案: Recognize a multibyte-char at end-of-line correctly in oneright(). (Taro Muraoka) Also: make "+quickfix" in ":version" output appear alphabetically. 相关文件: src/edit.c Patch 5.6.015 问题: New xterm delete key sends <Esc>[3~ by default. 解决方案: Added <kDel> and <kIns> to make the set of keypad keys complete. 相关文件: src/edit.c, src/ex_getln.c, src/keymap.h, src/misc1.c, src/misc2.c, src/normal.c, src/os_unix.c, src/term.c Patch 5.6.016 问题: When deleting a search string from history from inside a mapping, another entry is deleted too. (Benji Fisher) 解决方案: Reset last_maptick when deleting the last entry of the search history. Also: Increment maptick when starting a mapping from typed characters to avoid a just added search string being overwritten or removed from history. 相关文件: src/ex_getln.c, src/getchar.c Patch 5.6.017 问题: ":s/e/\^M/" should replace an "e" with a CTRL-M, not split the line. (Calder) 解决方案: Replace the backslash with a CTRL-V internally. (Stephen P. Wall) 相关文件: src/ex_cmds.c Patch 5.6.018 问题: ":help [:digit:]" takes a long time to jump to the wrong place. 解决方案: Insert a backslash to avoid the special meaning of '[]'. 相关文件: src/ex_cmds.c Patch 5.6.019 问题: "snd.c", "snd.java", etc. were recognized as "mail" filetype. 解决方案: Make pattern for mail filetype more strict. 相关文件: runtime/filetype.vim Patch 5.6.020 (extra) 问题: The DJGPP version eats processor time (Walter Briscoe). 解决方案: Call __dpmi_yield() in the busy-wait loop. 相关文件: src/os_msdos.c Patch 5.6.021 问题: When 'selection' is "exclusive", a double mouse click in Insert mode doesn't select last char in line. (Lutz) 解决方案: Allow leaving the cursor on the NUL past the line in this case. 相关文件: src/edit.c Patch 5.6.022 问题: ":e \~<Tab>" expands to ":e ~\$ceelen", which doesn't work. 解决方案: Re-insert the backslash before the '~'. 相关文件: src/ex_getln.c Patch 5.6.023 (extra) 问题: Various warnings for the Ming compiler. 解决方案: Changes to avoid the warnings. (Bill McCarthy) 相关文件: src/ex_cmds.c, src/gui_w32.c, src/os_w32exe.c, src/os_win32.c, src/syntax.c, src/vim.rc Patch 5.6.024 (extra) 问题: Win32 console: Entering CTRL-_ requires the shift key. (Kotchan) 解决方案: Specifically catch keycode 0xBD, like the GUI. 相关文件: src/os_win32.c Patch 5.6.025 问题: GTK GUI: Starting the GUI could be interrupted by a SIGWINCH. (Nils Lohner) 解决方案: Repeat the read() call to get the gui_in_use value when interrupted by a signal. 相关文件: src/gui.c Patch 5.6.026 (extra) 问题: Win32 GUI: Toolbar bitmaps are searched for in $VIMRUNTIME/bitmaps, while GTK looks in $VIM/bitmaps. (Keith Radebaugh) 解决方案: Use $VIM/bitmaps for both, because these are not part of the distribution but defined by the user. 相关文件: src/gui_w32.c, runtime/doc/gui.txt Patch 5.6.027 问题: TCL: Crash when using a Tcl script (reported for Win32). 解决方案: Call Tcl_FindExecutable() in main(). (Brent Fulgham) 相关文件: src/main.c Patch 5.6.028 问题: Xterm patch level 126 sends codes for mouse scroll wheel. Fully works with xterm patch level 131. 解决方案: Recognize the codes for button 4 (0x60) and button 5 (0x61). 相关文件: src/term.c Patch 5.6.029 问题: GTK GUI: Shortcut keys cannot be used for a dialog. (Johannes Zellner) 解决方案: Add support for shortcut keys. (Marcin Dalecki) 相关文件: src/gui_gtk.c Patch 5.6.030 问题: When closing a window and 'ea' is set, Vim can crash. (Yasuhiro Matsumoto) 解决方案: Set "curbuf" to a valid value in win_close(). 相关文件: src/window.c Patch 5.6.031 问题: Multi-byte: When a double-byte character ends in CSI, Vim waits for another character to be typed. 解决方案: Recognize the CSI as the second byte of a character and don't wait for another one. (Yasuhiro Matsumoto) 相关文件: src/getchar.c Patch 5.6.032 问题: Functions with an argument that is a line number don't all accept ".", "$", etc. (Ralf Arens) 解决方案: Add get_art_lnum() and use it for setline(), line2byte() and synID(). 相关文件: src/eval.c Patch 5.6.033 问题: Multi-byte: "f " sometimes skips to the second space. (Sung-Hyun Nam) 解决方案: Change logic in searchc() to skip trailing byte of a double-byte character. Also: Ask for second byte when searching for double-byte character. (Park Chong-Dae) 相关文件: src/search.c Patch 5.6.034 (extra) 问题: Compiling with Borland C++ 5.5 fails on tolower() and toupper(). 解决方案: Use TO_LOWER() and TO_UPPER() instead. Also adjust the Makefile to make using bcc 5.5 easier. 相关文件: src/edit.c, src/ex_docmd.c, src/misc1.c, src/Makefile.bor Patch 5.6.035 问题: Listing the"+comments" feature in the ":version" output depended on the wrong ID. (Stephen P. Wall) 解决方案: Change "CRYPTV" to "COMMENTS". 相关文件: src/version.c Patch 5.6.036 问题: GTK GUI: Copy/paste text doesn't work between gvim and Eterm. 解决方案: Support TEXT and COMPOUND_TEXT selection targets. (ChiDeok Hwang) 相关文件: src/gui_gtk_x11.c Patch 5.6.037 问题: Multi-byte: Can't use "f" command with multibyte character in GUI. 解决方案: Enable XIM in Normal mode for the GUI. (Sung-Hyun Nam) 相关文件: src/gui_gtk_x11.c, src/multbyte.c Patch 5.6.038 问题: Multi-clicks in GUI are interpreted as a mouse wheel click. When 'ttymouse' is "xterm" a mouse click is interpreted as a mouse wheel click. 解决方案: Don't recognize the mouse wheel in check_termcode() in the GUI. Use 0x43 for a mouse drag in do_xterm_trace(), not 0x63. 相关文件: src/term.c, src/os_unix.c Patch 5.6.039 问题: Motif GUI under KDE: When trying to logout, Vim hangs up the system. (Hermann Rochholz) 解决方案: When handling the WM_SAVE_YOURSELF event, set the WM_COMMAND property of the window to let the session manager know we finished saving ourselves. 相关文件: src/gui_x11.c Patch 5.6.040 问题: When using ":s" command, matching the regexp is done twice. 解决方案: After copying the matched line, adjust the pointers instead of finding the match again. (Loic Grenie) Added vim_regnewptr(). 相关文件: src/ex_cmds.c, src/regexp.c, src/proto/regexp.pro Patch 5.6.041 问题: GUI: Athena, Motif and GTK don't give more than 10 dialog buttons. 解决方案: Remove the limit on the number of buttons. Also support the 'v' flag in 'guioptions'. For GTK: Center the buttons. 相关文件: src/gui_athena.c, src/gui_gtk.c, src/gui_motif.c Patch 5.6.042 问题: When doing "vim -u vimrc" and vimrc contains ":q", the cursor in the terminal can remain off. 解决方案: Call cursor_on() in mch_windexit(). 相关文件: src/os_unix.c Patch 5.6.043 (extra) 问题: Win32 GUI: When selecting guifont with the dialog, 'guifont' doesn't include the bold or italic attributes. 解决方案: Append ":i" and/or ":b" to 'guifont' in gui_mch_init_font(). 相关文件: src/gui_w32.c Patch 5.6.044 (extra) 问题: MS-DOS and Windows: The line that dosinst.exe appends to autoexec.bat to set PATH is wrong when Vim is in a directory with an embedded space. 解决方案: Use double quotes for the value when there is an embedded space. 相关文件: src/dosinst.c Patch 5.6.045 (extra) (fixed version) 问题: VMS: Various small problems. 解决方案: Many small changes. (Zoltan Arpadffy) File name modifier ":h" keeps the path separator. File name modifier ":e" also removes version. Compile with MAX_FEAT by default. When checking for autocommands ignore version in file name. Be aware of file names being case insensitive. Added vt320 builtin termcap. Be prepared for an empty default_vim_dir. 相关文件: runtime/gvimrc_example.vim, runtime/vimrc_example.vim, runtime/doc/os_vms.txt, src/eval.c, src/feature.h, src/fileio.c, src/gui_motif.c, src/gui_vms_conf.h, src/main.c, src/memline.c, src/misc1.c, src/option.c, src/os_vms_conf.h, src/os_vms.c, src/os_vms.h, src/os_vms.mms, src/tag.c, src/term.c, src/version.c Patch 5.6.046 问题: Systems with backslash in file name: With 'shellslash' set, "vim */*.c" only uses a slash for the first file name. (Har'El) 解决方案: Fix slashes in file name arguments after reading the vimrc file. 相关文件: src/option.c Patch 5.6.047 问题: $CPPFLAGS is not passed on to ctags configure. 解决方案: Add it. (Walter Briscoe) 相关文件: src/config.mk.in, src/Makefile Patch 5.6.048 问题: CTRL-R in Command-line mode is documented to insert text as typed, but inserts text literally. 解决方案: Make CTRL-R insert text as typed, use CTRL-R CTRL-R to insert literally. This is consistent with Insert mode. But characters that end Command-line mode are inserted literally. 相关文件: runtime/doc/index.txt, runtime/doc/cmdline.txt, src/ex_getln.c, src/ops.c, src/proto/ops.pro Patch 5.6.049 问题: Documentation for [!] after ":ijump" is wrong way around. (Benji Fisher) 解决方案: Fix the documentation. Also improve the code to check for a match after a /* */ comment. 相关文件: runtime/doc/tagsearch.txt, src/search.c Patch 5.6.050 问题: Replacing is wrong when replacing a single-byte char with double-byte char or the other way around. 解决方案: Shift the text after the character when it is replaced. (Yasuhiro Matsumoto) 相关文件: src/normal.c, src/misc1.c Patch 5.6.051 问题: ":tprev" and ":tnext" don't give an error message when trying to go before the first or beyond the last tag. (Robert Webb) 解决方案: Added error messages. Also: Delay a second when a file-read message is going to overwrite an error message, otherwise it won't be seen. 相关文件: src/fileio.c, src/tag.c Patch 5.6.052 问题: Multi-byte: When an Ex command has a '|' or '"' as a second byte, it terminates the command. 解决方案: Skip second byte of multibyte char when checking for '|' and '"'. (Asai Kenichi) 相关文件: src/ex_docmd.c Patch 5.6.053 问题: CTRL-] doesn't work on a tag that contains a '|'. (Cesar Crusius) 解决方案: Escape '|', '"' and '\' in tag names when using CTRL-] and also for command-line completion. 相关文件: src/ex_getln.c, src/normal.c Patch 5.6.054 问题: When using ":e" and ":e #" the cursor is put in the first column when 'startofline' is set. (Cordell) 解决方案: Use the last known column when 'startofline' is set. Also, use ECMD_LAST more often to simplify the code. 相关文件: src/buffer.c, src/ex_cmds.c, src/ex_docmd.c, src/proto/buffer.pro Patch 5.6.055 问题: When 'statusline' only contains a text without "%" and doesn't fit in the window, Vim crashes. (Ron Aaron) 解决方案: Don't use the pointer for the first item if there is no item. 相关文件: src/screen.c Patch 5.6.056 (extra) 问题: MS-DOS: F11 and F12 don't work when 'bioskey' is set. 解决方案: Use enhanced keyboard functions. (Vince Negri) Detect presence of enhanced keyboard and set bioskey_read and bioskey_ready. 相关文件: src/os_msdos.c Patch 5.6.057 (extra) 问题: Win32 GUI: Multi-byte characters are wrong in dialogs and tear-off menus. 解决方案: Use system font instead of a fixed font. (Matsumoto, Muraoka) 相关文件: src/gui_w32.c Patch 5.6.058 问题: When the 'a' flag is not in 'guioptions', non-Windows systems copy Visually selected text to the clipboard/selection on a yank or delete command anyway. On Windows it isn't done even when the 'a' flag is included. 解决方案: Respect the 'a' flag in 'guioptions' on all systems. 相关文件: src/normal.c Patch 5.6.059 (extra) 问题: When moving the cursor over italic text and the characters spill over to the cell on the right, that spill-over is deleted. Noticed in the Win32 GUI, can happen on other systems too. 解决方案: Redraw italic text starting from a blank, like this is already done for bold text. (Vince Negri) 相关文件: src/gui.c, src/gui.h, src/gui_w32.c Patch 5.6.060 问题: Some bold characters spill over to the cell on the left, that spill-over can remain sometimes. 解决方案: Redraw a character when the next character was bold and needs redrawing. (Robert Webb) 相关文件: src/screen.c Patch 5.6.061 问题: When xterm sends 8-bit controls, recognizing the version response doesn't work. When using CSI instead of <Esc>[ for the termcap color codes, using 16 colors doesn't work. (Neil Bird) 解决方案: Also accept CSI in place of <Esc>[ for the version string. Also check for CSI when handling colors 8-15 in term_color(). Use CSI for builtin xterm termcap entries when 'term' contains "8bit". 相关文件: runtime/doc/term.txt, src/ex_cmds.c, src/option.c, src/term.c, src/os_unix.c, src/proto/option.pro, src/proto/term.pro Patch 5.6.062 问题: The documentation says that setting 'smartindent' doesn't have an effect when 'cindent' is set, but it does make a difference for lines starting with "#". (Neil Bird) 解决方案: Really ignore 'smartindent' when 'cindent' is set. 相关文件: src/misc1.c, src/ops.c Patch 5.6.063 问题: Using "I" in Visual-block mode doesn't accept a count. (Johannes Zellner) 解决方案: Pass the count on to do_insert() and edit(). (Allan Kelly) 相关文件: src/normal.c, src/ops.c, src/proto/ops.pro Patch 5.6.064 问题: MS-DOS and Win32 console: Mouse doesn't work correctly after including patch 5.6.28. (Vince Negri) 解决方案: Don't check for mouse scroll wheel when the mouse code contains the number of clicks. 相关文件: src/term.c Patch 5.6.065 问题: After moving the cursor around in Insert mode, typing a space can still trigger an abbreviation. (Benji Fisher) 解决方案: Don't check for an abbreviation after moving around in Insert mode. 相关文件: src/edit.c Patch 5.6.066 问题: Still a few bold character spill-over remains after patch 60. 解决方案: Clear character just in front of blanking out rest of the line. (Robert Webb) 相关文件: src/screen.c Patch 5.6.067 问题: When a file name contains a NL, the viminfo file is corrupted. 解决方案: Use viminfo_writestring() to convert the NL to CTRL-V n. Also fix the Buffers menu and listing a menu name with a newline. 相关文件: runtime/menu.vim, src/buffer.c, src/mark.c, src/menu.c Patch 5.6.068 问题: Compiling the Perl interface doesn't work with Perl 5.6.0. (Bernhard Rosenkraenzer) 解决方案: Also check xs_apiversion for the version number when prepending defines for PL_*. 相关文件: src/Makefile Patch 5.6.069 问题: "go" doesn't always end up at the right character when 'fileformat' is "dos". (Bruce DeVisser) 解决方案: Correct computations in ml_find_line_or_offset(). 相关文件: src/memline. Patch 5.6.070 (depends on 5.6.068) 问题: Compiling the Perl interface doesn't work with Perl 5.6.0. (Bernhard Rosenkraenzer) 解决方案: Simpler check instead of the one from patch 68. 相关文件: src/Makefile Patch 5.6.071 问题: "A" in Visual block mode on a Tab positions the cursor one char to the right. (Michael Haumann) 解决方案: Correct the column computation in op_insert(). 相关文件: src/ops.c Patch 5.6.072 问题: When starting Vim with "vim +startinsert", it enters Insert mode only after typing the first command. (Andrew Pimlott) 解决方案: Insert a dummy command in the stuff buffer. 相关文件: src/main.c Patch 5.6.073 (extra) (depends on 5.6.034) 问题: Win32 GUI: When compiled with Bcc 5.5 menus don't work. In dosinst.c toupper() and tolower() give an "internal compiler error" for Bcc 5.5. 解决方案: Define WINVER to 4 to avoid compiling for Windows 2000. (Dan Sharp) Also cleaned up compilation arguments. Use our own implementation of toupper() in dosinst.c. Use mytoupper() instead of tolower(). 相关文件: src/Makefile.bor, src/dosinst.c Patch 5.6.074 (extra) 问题: Entering CSI directly doesn't always work, because it's recognized as the start of a special key. Mostly a problem with multibyte in the GUI. 解决方案: Use K_CSI for a typed CSI character. Use <CSI> for a normal CSI, <xCSI> for a CSI typed in the GUI. 相关文件: runtime/doc/intro.txt, src/getchar.c, src/gui_amiga.c, src/gui_gtk_x11.c, src/gui_mac.c, src/gui_riscos.c, src/gui_w32.c, src/keymap.h, src/misc2.c Patch 5.6.075 问题: When using "I" or "A" in Visual block mode while 'sts' is set may change spaces to a Tab the inserted text is not correct. (Mike Steed) And some other problems when using "A" to append after the end of the line. 解决方案: Check for change in spaces/tabs after inserting the text. Append spaces to fill the gap between the end-of-line and the right edge of the block. 相关文件: src/ops.c Patch 5.6.076 问题: GTK GUI: Mapping <M-Space> doesn't work. 解决方案: Don't use the "Alt" modifier twice in key_press_event(). 相关文件: src/gui_gtk_x11.c Patch 5.6.077 问题: GUI: When interrupting an external program with CTRL-C, gvim might crash. (Benjamin Korvemaker) 解决方案: Avoid using a NULL pointer in ui_inchar_undo(). 相关文件: src/ui.c Patch 5.6.078 问题: Locale doesn't always work on FreeBSD. (David O'Brien) 解决方案: Link with the "xpg4" library when available. 相关文件: src/configure.in, src/configure Patch 5.6.079 问题: Vim could crash when several Tcl interpreters are created and destroyed. 解决方案: handle the "exit" command and nested ":tcl" commands better. (Ingo Wilken) 相关文件: runtime/doc/if_tcl.txt, src/if_tcl.c Patch 5.6.080 问题: When jumping to a tag, generating the tags file and jumping to the same tag again uses the old search pattern. (Sung-Hyun Nam) 解决方案: Flush cached tag matches when executing an external command. 相关文件: src/misc2.c, src/proto/tag.pro, src/tag.c Patch 5.6.081 问题: ":syn include" uses a level for the included file, this confuses contained items included at the same level. 解决方案: Use a unique tag for each included file. Changed sp_syn_inc_lvl to sp_syn_inc_tag. (Scott Bigham) 相关文件: src/syntax.c, src/structs.h Patch 5.6.082 问题: When using cscope, Vim can crash. 解决方案: Initialize tag_fname in find_tags(). (Anton Blanchard) 相关文件: src/tag.c Patch 5.6.083 (extra) 问题: Win32: The visual beep can't be seen. (Eric Roesinger) 解决方案: Flush the output before waiting with GdiFlush(). (Maurice S. Barnum) Also: Allow specifying the delay in t_vb for the GUI. 相关文件: src/gui.c, src/gui_amiga.c, src/gui_gtk_x11.c, src/gui_mac.c, src/gui_riscos.c, src/gui_w32.c, src/gui_x11.c, src/gui_beos.cc, src/proto/gui_amiga.pro, src/proto/gui_gtk_x11.pro, src/proto/gui_mac.pro, src/proto/gui_riscos.pro, src/proto/gui_w32.pro, src/proto/gui_x11.pro, src/proto/gui_beos.pro Patch 5.6.084 (depends on 5.6.074) 问题: GUI: Entering CSI doesn't always work for Athena and Motif. 解决方案: Handle typed CSI as <xCSI> (forgot this bit in 5.6.074). 相关文件: src/gui_x11.c Patch 5.6.085 问题: Multi-byte: Using "r" to replace a double-byte char with a single-byte char moved the cursor one character. (Matsumoto) Also, using a count when replacing a single-byte char with a double-byte char didn't work. 解决方案: Don't use del_char() to delete the second byte. Get "ptr" again after calling ins_char(). 相关文件: src/normal.c Patch 5.6.086 (extra) 问题: Win32: When using libcall() and the returned value is not a valid pointer, Vim crashes. 解决方案: Use IsBadStringPtr() to check if the pointer is valid. 相关文件: src/os_win32.c Patch 5.6.087 问题: Multi-byte: Commands and messages with multibyte characters are displayed wrong. 解决方案: Detect double-byte characters. (Yasuhiro Matsumoto) 相关文件: src/ex_getln.c, src/message.c, src/misc2.c, src/screen.c Patch 5.6.088 问题: Multi-byte with Motif or Athena: The message "XIM requires fontset" is annoying when Vim was compiled with XIM support but it is not being used. 解决方案: Remove that message. 相关文件: src/multbyte.c Patch 5.6.089 问题: On non-Unix systems it's possible to overwrite a read-only file without using "!". 解决方案: Check if the file permissions allow overwriting before moving the file to become the backup file. 相关文件: src/fileio.c Patch 5.6.090 问题: When editing a file in "/home/dir/home/dir" this was replaced with "~~". (Andreas Jellinghaus) 解决方案: Replace the home directory only once in home_replace(). 相关文件: src/misc1.c Patch 5.6.091 问题: When editing many "no file" files, can't create swap file, because .sw[a-p] have all been used. (Neil Bird) 解决方案: Also use ".sv[a-z]", ".su[a-z]", etc. 相关文件: src/memline.c Patch 5.6.092 问题: FreeBSD: When setting $TERM to a non-valid terminal name, Vim hangs in tputs(). 解决方案: After tgetent() returns an error code, call it again with the terminal name "dumb". This apparently creates an environment in which tputs() doesn't fail. 相关文件: src/term.c Patch 5.6.093 (extra) 问题: Win32 GUI: "ls | gvim -" will show a message box about reading stdin when Vim exits. (Donohue) 解决方案: Don't write a message about the file read from stdin until the GUI has started. 相关文件: src/fileio.c Patch 5.6.094 问题: Problem with multibyte string for ":echo var". 解决方案: Check for length in msg_outtrans_len_attr(). (Sung-Hyun Nam) Also make do_echo() aware of multibyte characters. 相关文件: src/eval.c, src/message.c Patch 5.6.095 问题: With an Emacs TAGS file that include another a relative path doesn't always work. 解决方案: Use expand_tag_fname() on the name of the included file. (Utz-Uwe Haus) 相关文件: src/tag.c Patch 5.6.096 问题: Unix: When editing many files, startup can be slow. (Paul Ackersviller) 解决方案: Halve the number of stat() calls used to add a file to the buffer list. 相关文件: src/buffer.c Patch 5.7a.001 问题: GTK doesn't respond on drag&drop from ROX-Filer. 解决方案: Add "text/uri-list" target. (Thomas Leonard) Also: fix problem with checking for trash arguments. 相关文件: src/gui_gtk_x11.c Patch 5.7a.002 问题: Multi-byte: 'showmatch' is performed when second byte of an inserted double-byte char is a paren or brace. 解决方案: Check IsTrailByte() before calling showmatch(). (Taro Muraoka) 相关文件: src/misc1.c Patch 5.7a.003 问题: Multi-byte: After using CTRL-O in Insert mode with the cursor at the end of the line on a multibyte character the cursor moves to the left. 解决方案: Check for multibyte character at end-of-line. (Taro Muraoka) Also: fix cls() to detect a double-byte character. (Chong-Dae Park) 相关文件: src/edit.c, src/search.c Patch 5.7a.004 问题: When reporting the search pattern offset, the string could be unterminated, which may cause a crash. 解决方案: Terminate the string for the search offset. (Stephen P. Wall) 相关文件: src/search.c Patch 5.7a.005 问题: When ":s//~/" doesn't find a match it reports "[NULL]" for the pattern. 解决方案: Use get_search_pat() to obtain the actually used pattern. 相关文件: src/ex_cmds.c, src/proto/search.pro, src/search.c Patch 5.7a.006 (extra) 问题: VMS: Various problems, also with the VAXC compiler. 解决方案: In many places use the Unix code for VMS too. Added time, date and compiler version to version message. (Zoltan Arpadffy) 相关文件: src/ex_cmds.c, src/ex_docmd.c, src/globals.h, src/gui_vms_conf.h, src/main.c, src/message.c, src/misc1.c, src/os_vms.c, src/os_vms.h, src/os_vms.mms, src/os_vms_conf.h, src/proto/os_vms.pro, src/proto/version.pro, src/term.c, src/version.c, src/xxd/os_vms.mms, src/xxd/xxd.c Patch 5.7a.007 问题: Motif and Athena GUI: CTRL-@ is interpreted as CTRL-C. 解决方案: Only use "intr_char" when it has been set. 相关文件: src/gui_x11.c Patch 5.7a.008 问题: GTK GUI: When using CTRL-L the screen is redrawn twice, causing trouble for bold characters. Also happens when moving with the scrollbar. Best seen when 'writedelay' is non-zero. When starting the GUI with ":gui" the screen is redrawn once with the wrong colors. 解决方案: Only set the geometry hints when the window size really changed. This avoids setting it each time the scrollbar is forcefully redrawn. Don't redraw in expose_event() when gui.starting is still set. 相关文件: src/gui_gtk_x11.c

5.8 版 本 version-5.8

5.8 版本是 5.7 的漏洞修正版。 改动 changed-5.8

Vim 不再包含 ctags。它已经成为独立的项目。这里可以找到: http://ctags.sf.net。 编写程序时,高度建议和 Vim 一起使用。 新增 added-5.8

新语法文件: acedb AceDB (Stewart Morris) aflex Aflex (Mathieu Clabaut) antlr Antlr (Mathieu Clabaut) asm68k 68000 Assembly (Steve Wall) automake Automake (John Williams) ayacc Ayacc (Mathieu Clabaut) b B (Mathieu Clabaut) bindzone BIND zone (glory hump) blank Blank (Rafal Sulejman) cfg Configure 文件 (Igor Prischepoff) changelog ChangeLog (Gediminas Paulauskas) cl Clever (Phil Uren) crontab Crontab (John Hoelzel) csc Essbase 脚本 (Raul Segura Acevedo) cynlib Cynlib(C++) (Phil Derrick) cynpp Cyn++ (Phil Derrick) debchangelog Debian Changelog (Wichert Akkerman) debcontrol Debian Control (Wichert Akkerman) dns DNS 区域文件 (Jehsom) dtml Zope 的 DTML (Jean Jordaan) dylan Dylan、Dylan-intr 和 Dylan-lid (Brent Fulgham) ecd Embedix Component Description (John Beppu) fgl Informix 4GL (Rafal Sulejman) foxpro FoxPro (Powing Tse) gsp GNU Server Pages (Nathaniel Harward) gtkrc GTK rc (David Necas) hercules Hercules (Avant! Corporation) (Dana Edwards) htmlos Aestiva 的 HTML/OS (Jason Rust) inittab SysV process control (David Necas) iss Inno Setup (Dominique Stephan) jam Jam (Ralf Lemke) jess Jess (Paul Baleme) lprolog LambdaProlog (Markus Mottl) ia64 Intel Itanium (parth malwankar) kix Kixtart (Nigel Gibbs) mgp MaGic Point (Gerfried Fuchs) mason Mason (带 Perl 的 HTML) (Andrew Smith) mma Mathematica (Wolfgang Waltenberger) nqc Not Quite C (Stefan Scherer) omnimark Omnimark (Paul Terray) openroad OpenROAD (Luis Moreno Serrano) named BIND configuration (glory hump) papp PApp (Marc Lehmann) pfmain Postfix main config (Peter Kelemen) pic PIC assembly (Aleksandar Veselinovic) ppwiz PPWizard (Stefan Schwarzer) progress Progress (Phil Uren) psf Product Specification File (Rex Barzee) r R (Tom Payne) registry MS-Windows 注册表 (Dominique Stephan) robots Robots.txt (Dominique Stephan) rtf Rich Text Format (Dominique Stephan) setl SETL (Alex Poylisher) sgmldecl SGML Declarations (Daniel A. Molina W.) sinda Sinda input (Adrian Nagle) sindacmp Sinda compare (Adrian Nagle) sindaout Sinda output (Adrian Nagle) smith SMITH (Rafal Sulejman) snobol4 Snobol 4 (Rafal Sulejman) strace Strace (David Necas) tak TAK input (Adrian Nagle) takcmp TAK compare (Adrian Nagle) takout TAK output (Adrian Nagle) tasm Turbo assembly (FooLman) texmf TeX configuration (David Necas) trasys Trasys input (Adrian Nagle) tssgm TSS Geometry (Adrian Nagle) tssop TSS Optics (Adrian Nagle) tsscl TSS Command line (Adrian Nagle) virata Virata Configuration Script (Manuel M.H. Stol) vsejcl VSE JCL (David Ondrejko) wdiff Wordwise diff (Gerfried Fuchs) wsh Windows Scripting Host (Paul Moore) xkb X Keyboard Extension (David Necas) php3 更名为 php,现在同时支持 php4 (Lutz Eymers) Patch 5.7.015 问题: Vim 6.0 的语法文件不能用于 5.x。 解决方案: ":highlight" 命令加入 "default" 参数: 如果已经指定高亮,忽略命令。 相关文件: src/syntax.c 用 makemenu.vim 生成 Syntax 菜单,从而不需要在 Vim 启动时完成。减少了 GUI 启动 时间。 修正 fixed-5.8

Conversion of docs to HTML didn't convert " tag s" to a hyperlink. Fixed compiling under NeXT. (Jeroen C.M. Goudswaard) optwin.vim gave an error when used in Vi compatible mode ('cpo' contains 'C'). Tcl interpreter: "buffer" command didn't check for presence of an argument. (Dave Bodenstab) dosinst.c: Added checks for too long file name. Amiga: a file name starting with a colon was considered absolute but it isn't. Amiga: ":pwd" added a slash when in the root of a drive. Macintosh: Warnings for unused variables. (Bernhard Pruemmer) Unix: When catching a deadly signal, handle it in such a way that it's unlikely that Vim will hang. Call _exit() instead of exit() in case of a severe problem. Setting the window title from nothing to something didn't work after patch 29. Check for ownership of .exrc and .vimrc was done with stat(). Use lstat() as well for extra security. Win32 GUI: Printing a file with 'fileformat' "unix" didn't work. Set 'fileformat' to "dos" before writing the temp file. Unix: Could start waiting for a character when checking for a CTRL-C typed when an X event is received. Could not use Perl and Python at the same time on FreeBSD, because Perl used "-lc" and Python used the threaded C library. Win32: The Mingw compiler gave a few warning messages. When using "ZZ" and an autocommand for writing uses an abbreviation it didn't work. Don't stuff the ":x" command but execute it directly. (Mikael Berthe) VMS doesn't always have lstat(), added an #ifdef around it. Added a few corrections for the Macintosh. (Axel Kielhorn) Win32: GvimExt could not edit more than a few files at once, the length of the argument was fixed. Vim 5.7 预发布补丁: Patch 5.7.001 问题: When the current buffer is encrypted, and another modified buffer isn't, ":wall" will encrypt the other buffer. 解决方案: In buf_write() use "buf" instead of "curbuf" to check for the crypt key. 相关文件: src/fileio.c Patch 5.7.002 问题: When 'showmode' is set, using "CTRL-O :r file" waits three seconds before displaying the read text. (Wichert Akkerman) 解决方案: Set "keep_msg" to the file message so that the screen is redrawn before the three seconds wait for displaying the mode message. 相关文件: src/fileio.c Patch 5.7.003 问题: Searching for "[[:cntrl:]]" doesn't work. 解决方案: Exclude NUL from the matching characters, it terminates the list. 相关文件: src/regexp.c Patch 5.7.004 问题: GTK: When selecting a new font, Vim can crash. 解决方案: In gui_mch_init_font() unreference the old font, not the new one. 相关文件: src/gui_gtk_x11.c Patch 5.7.005 问题: Multibyte: Inserting a wrapped line corrupts kterm screen. Pasting TEXT/COMPOUND_TEXT into Vim does not work. On Motif no XIM status line is displayed even though it is available. 解决方案: Don't use xterm trick for wrapping lines for multibyte mode. Correct a missing "break", added TEXT/COMPOUND_TEXT selection request. Add XIMStatusArea fallback code. (Katsuhito Nagano) 相关文件: src/gui_gtk_x11.c, src/multbyte.c, src/screen.c, src/ui.c Patch 5.7.006 问题: GUI: redrawing the non-Visual selection is wrong when the window is unobscured. (Jean-Pierre Etienne) 解决方案: Redraw the selection properly and don't clear it. Added "len" argument to clip_may_redraw_selection(). 相关文件: src/gui.c, src/ui.c, src/proto/ui.pro Patch 5.7.007 问题: Python: Crash when using the current buffer twice. 解决方案: Increase the reference count for buffer and window objects. (Johannes Zellner) 相关文件: src/if_python.c Patch 5.7.008 问题: In Ex mode, backspacing over the first TAB doesn't work properly. (Wichert Akkerman) 解决方案: Switch the cursor on before printing the newline. 相关文件: src/ex_getln.c Patch 5.7.009 (extra) 问题: Mac: Crash when using a long file. 解决方案: Don't redefine malloc() and free(), because it will break using realloc(). 相关文件: src/os_mac.h Patch 5.7.010 问题: When using CTRL-A on a very long number Vim can crash. (Michael Naumann) 解决方案: Truncate the length of the new number to avoid a buffer overflow. 相关文件: src/ops.c Patch 5.7.011 (extra) 问题: Win32 GUI on NT 5 and Win98: Displaying Hebrew is reversed. 解决方案: Output each character separately, to avoid that Windows reverses the text for some fonts. (Ron Aaron) 相关文件: src/gui_w32.c Patch 5.7.012 问题: When using "-complete=buffer" for ":command" the user command fails. 解决方案: In a user command don't replace the buffer name with a count for the buffer number. 相关文件: src/ex_docmd.c Patch 5.7.013 问题: "gD" didn't always find a match in the first line, depending on the column the search started at. 解决方案: Reset the column to zero before starting to search. 相关文件: src/normal.c Patch 5.7.014 问题: Rot13 encoding was done on characters with accents, which is wrong. (Sven Gottwald) 解决方案: Only do rot13 encoding on ASCII characters. 相关文件: src/ops.c Patch 5.7.016 问题: When hitting 'n' for a ":s///c" command, the ignore-case flag was not restored, some matches were skipped. (Daniel Blaustein) 解决方案: Restore the reg_ic variable when 'n' was hit. 相关文件: src/ex_cmds.c Patch 5.7.017 问题: When using a Vim script for Vim 6.0 with <SID> before a function name, it produces an error message even when inside an "if version >= 600". (Charles Campbell) 解决方案: Ignore errors in the function name when the function is not going to be defined. 相关文件: src/eval.c Patch 5.7.018 问题: When running "rvim" or "vim -Z" it was still possible to execute a shell command with system() and backtick-expansion. (Antonios A. Kavarnos) 解决方案: Disallow executing a shell command in get_cmd_output() and mch_expand_wildcards(). 相关文件: src/misc1.c, src/os_unix.c Patch 5.7.019 问题: Multibyte: In a substitute string, a multibyte character isn't skipped properly, can be a problem when the second byte is a backslash. 解决方案: Skip an extra byte for a double-byte character. (Muraoka Taro) 相关文件: src/ex_cmds.c Patch 5.7.020 问题: Compilation doesn't work on MacOS-X. 解决方案: Add a couple of #ifdefs. (Jamie Curmi) 相关文件: src/regexp.c, src/ctags/general.h Patch 5.7.021 问题: Vim sometimes produces a beep when started in an xterm. Only happens when compiled without mouse support. 解决方案: Requesting the xterm version results in a K_IGNORE. This wasn't handled when mouse support is disabled. Accept K_IGNORE always. 相关文件: src/normal.c Patch 5.7.022 问题: %v in 'statusline' is not displayed when it's equal to %c. 解决方案: Check if %V or %v is used and handle them differently. 相关文件: src/screen.c Patch 5.7.023 问题: Crash when a WinLeave autocommand deletes the buffer in the other window. 解决方案: Check that after executing the WinLeave autocommands there still is a window to be closed. Also update the test that was supposed to check for this problem. 相关文件: src/window.c, testdir/test13.in, testdir/test13.ok Patch 5.7.024 问题: Evaluating an expression for 'statusline' can have side effects. 解决方案: Evaluate the expression in a sandbox. 相关文件: src/edit.c, src/eval.c, src/proto/eval.pro, src/ex_cmds.c, src/ex_cmds.h, src/ex_docmd.c, src/globals.h, src/option.c, src/screen.c, src/undo.c Patch 5.7.025 (fixed) 问题: Creating a temp file has a race condition. 解决方案: Create a private directory to write the temp files in. 相关文件: src/fileio.c, src/misc1.c, src/proto/misc1.pro, src/proto/fileio.pro, src/memline.c, src/os_unix.h Patch 5.7.026 (extra) 问题: Creating a temp file has a race condition. 解决方案: Create a private directory to write the temp files in. This is the extra part of patch 5.7.025. 相关文件: src/os_msdos.h Patch 5.7.027 问题: Starting to edit a file can cause a crash. For example when in Insert mode, using CTRL-O :help abbr<Tab> to scroll the screen and then <CR>, which edits a help file. (Robert Bogomip) 解决方案: Check if keep_msg is NULL before copying it. 相关文件: src/fileio.c Patch 5.7.028 问题: Creating a backup or swap file could fail in rare situations. 解决方案: Use O_EXCL for open(). 相关文件: src/fileio.c, src/memfile.c Patch 5.7.029 问题: Editing a file with an extremely long name crashed Vim. 解决方案: Check for length of the name when setting the window title. 相关文件: src/buffer.c Patch 5.7.030 问题: A ":make" or ":grep" command with a very long argument could cause a crash. 解决方案: Allocate the buffer for the shell command. 相关文件: src/ex_docmd.c vim:tw=78:ts=8:noet:ft=help:norl: