[76dd250] | 1 | Submitted By: Jim Gifford (jim at linuxfromscratch dot org)
|
---|
| 2 | Date: 12-20-2008
|
---|
| 3 | Initial Package Version: 7.2
|
---|
| 4 | Origin: Upstream
|
---|
| 5 | Upstream Status: Applied
|
---|
| 6 | Description: Contains all upstream patches up to 7.2.069
|
---|
| 7 | The following patches were skipped
|
---|
| 8 | 007 036 041 049
|
---|
| 9 |
|
---|
| 10 | diff -Naur vim72.orig/Filelist vim72/Filelist
|
---|
| 11 | --- vim72.orig/Filelist 2008-07-06 11:02:23.000000000 -0700
|
---|
| 12 | +++ vim72/Filelist 2008-12-20 15:00:39.000000000 -0800
|
---|
| 13 | @@ -285,6 +285,7 @@
|
---|
| 14 | src/proto/os_win32.pro \
|
---|
| 15 | src/proto/os_mswin.pro \
|
---|
| 16 | src/testdir/Make_dos.mak \
|
---|
| 17 | + src/testdir/Make_ming.mak \
|
---|
| 18 | src/testdir/dos.vim \
|
---|
| 19 | src/uninstal.c \
|
---|
| 20 | src/vim.def \
|
---|
| 21 | diff -Naur vim72.orig/runtime/doc/cmdline.txt vim72/runtime/doc/cmdline.txt
|
---|
| 22 | --- vim72.orig/runtime/doc/cmdline.txt 2008-08-09 07:22:59.000000000 -0700
|
---|
| 23 | +++ vim72/runtime/doc/cmdline.txt 2008-12-20 15:01:04.000000000 -0800
|
---|
| 24 | @@ -1,4 +1,4 @@
|
---|
| 25 | -*cmdline.txt* For Vim version 7.2. Last change: 2008 Jul 29
|
---|
| 26 | +*cmdline.txt* For Vim version 7.2. Last change: 2008 Sep 18
|
---|
| 27 |
|
---|
| 28 |
|
---|
| 29 | VIM REFERENCE MANUAL by Bram Moolenaar
|
---|
| 30 | @@ -157,6 +157,11 @@
|
---|
| 31 | (doesn't work at the expression prompt; some
|
---|
| 32 | things such as changing the buffer or current
|
---|
| 33 | window are not allowed to avoid side effects)
|
---|
| 34 | + When the result is a |List| the items are used
|
---|
| 35 | + as lines. They can have line breaks inside
|
---|
| 36 | + too.
|
---|
| 37 | + When the result is a Float it's automatically
|
---|
| 38 | + converted to a String.
|
---|
| 39 | See |registers| about registers. {not in Vi}
|
---|
| 40 | Implementation detail: When using the |expression| register
|
---|
| 41 | and invoking setcmdpos(), this sets the position before
|
---|
| 42 | @@ -730,19 +735,29 @@
|
---|
| 43 | In Ex commands, at places where a file name can be used, the following
|
---|
| 44 | characters have a special meaning. These can also be used in the expression
|
---|
| 45 | function expand() |expand()|.
|
---|
| 46 | - % is replaced with the current file name *:_%*
|
---|
| 47 | - # is replaced with the alternate file name *:_#*
|
---|
| 48 | + % Is replaced with the current file name. *:_%* *c_%*
|
---|
| 49 | + # Is replaced with the alternate file name. *:_#* *c_#*
|
---|
| 50 | #n (where n is a number) is replaced with the file name of
|
---|
| 51 | - buffer n. "#0" is the same as "#"
|
---|
| 52 | - ## is replaced with all names in the argument list *:_##*
|
---|
| 53 | + buffer n. "#0" is the same as "#".
|
---|
| 54 | + ## Is replaced with all names in the argument list *:_##* *c_##*
|
---|
| 55 | concatenated, separated by spaces. Each space in a name
|
---|
| 56 | is preceded with a backslash.
|
---|
| 57 | -Note that these give the file name as it was typed. If an absolute path is
|
---|
| 58 | -needed (when using the file name from a different directory), you need to add
|
---|
| 59 | -":p". See |filename-modifiers|.
|
---|
| 60 | + #<n (where n is a number > 0) is replaced with old *:_#<* *c_#<*
|
---|
| 61 | + file name n. See |:oldfiles| or |v:oldfiles| to get the
|
---|
| 62 | + number. *E809*
|
---|
| 63 | + {only when compiled with the +eval and +viminfo features}
|
---|
| 64 | +
|
---|
| 65 | +Note that these, except "#<n", give the file name as it was typed. If an
|
---|
| 66 | +absolute path is needed (when using the file name from a different directory),
|
---|
| 67 | +you need to add ":p". See |filename-modifiers|.
|
---|
| 68 | +
|
---|
| 69 | +The "#<n" item returns an absolute path, but it will start with "~/" for files
|
---|
| 70 | +below your home directory.
|
---|
| 71 | +
|
---|
| 72 | Note that backslashes are inserted before spaces, so that the command will
|
---|
| 73 | correctly interpret the file name. But this doesn't happen for shell
|
---|
| 74 | -commands. For those you probably have to use quotes: >
|
---|
| 75 | +commands. For those you probably have to use quotes (this fails for files
|
---|
| 76 | +that contain a quote and wildcards): >
|
---|
| 77 | :!ls "%"
|
---|
| 78 | :r !spell "%"
|
---|
| 79 |
|
---|
| 80 | diff -Naur vim72.orig/runtime/doc/eval.txt vim72/runtime/doc/eval.txt
|
---|
| 81 | --- vim72.orig/runtime/doc/eval.txt 2008-08-09 07:22:59.000000000 -0700
|
---|
| 82 | +++ vim72/runtime/doc/eval.txt 2008-12-20 15:02:44.000000000 -0800
|
---|
| 83 | @@ -1,4 +1,4 @@
|
---|
| 84 | -*eval.txt* For Vim version 7.2. Last change: 2008 Aug 09
|
---|
| 85 | +*eval.txt* For Vim version 7.2. Last change: 2008 Nov 27
|
---|
| 86 |
|
---|
| 87 |
|
---|
| 88 | VIM REFERENCE MANUAL by Bram Moolenaar
|
---|
| 89 | @@ -1484,6 +1484,17 @@
|
---|
| 90 | This is the screen column number, like with |virtcol()|. The
|
---|
| 91 | value is zero when there was no mouse button click.
|
---|
| 92 |
|
---|
| 93 | + *v:oldfiles* *oldfiles-variable*
|
---|
| 94 | +v:oldfiles List of file names that is loaded from the |viminfo| file on
|
---|
| 95 | + startup. These are the files that Vim remembers marks for.
|
---|
| 96 | + The length of the List is limited by the ' argument of the
|
---|
| 97 | + 'viminfo' option (default is 100).
|
---|
| 98 | + Also see |:oldfiles| and |c_#<|.
|
---|
| 99 | + The List can be modified, but this has no effect on what is
|
---|
| 100 | + stored in the |viminfo| file later. If you use values other
|
---|
| 101 | + than String this will cause trouble.
|
---|
| 102 | + {only when compiled with the +viminfo feature}
|
---|
| 103 | +
|
---|
| 104 | *v:operator* *operator-variable*
|
---|
| 105 | v:operator The last operator given in Normal mode. This is a single
|
---|
| 106 | character except for commands starting with <g> or <z>,
|
---|
| 107 | @@ -1695,7 +1706,7 @@
|
---|
| 108 | exists( {expr}) Number TRUE if {expr} exists
|
---|
| 109 | extend({expr1}, {expr2} [, {expr3}])
|
---|
| 110 | List/Dict insert items of {expr2} into {expr1}
|
---|
| 111 | -expand( {expr}) String expand special keywords in {expr}
|
---|
| 112 | +expand( {expr} [, {flag}]) String expand special keywords in {expr}
|
---|
| 113 | feedkeys( {string} [, {mode}]) Number add key sequence to typeahead buffer
|
---|
| 114 | filereadable( {file}) Number TRUE if {file} is a readable file
|
---|
| 115 | filewritable( {file}) Number TRUE if {file} is a writable file
|
---|
| 116 | @@ -1747,8 +1758,9 @@
|
---|
| 117 | getwinposx() Number X coord in pixels of GUI Vim window
|
---|
| 118 | getwinposy() Number Y coord in pixels of GUI Vim window
|
---|
| 119 | getwinvar( {nr}, {varname}) any variable {varname} in window {nr}
|
---|
| 120 | -glob( {expr}) String expand file wildcards in {expr}
|
---|
| 121 | -globpath( {path}, {expr}) String do glob({expr}) for all dirs in {path}
|
---|
| 122 | +glob( {expr} [, {flag}]) String expand file wildcards in {expr}
|
---|
| 123 | +globpath( {path}, {expr} [, {flag}])
|
---|
| 124 | + String do glob({expr}) for all dirs in {path}
|
---|
| 125 | has( {feature}) Number TRUE if feature {feature} supported
|
---|
| 126 | has_key( {dict}, {key}) Number TRUE if {dict} has entry {key}
|
---|
| 127 | haslocaldir() Number TRUE if current window executed |:lcd|
|
---|
| 128 | @@ -3275,14 +3287,16 @@
|
---|
| 129 | :let list_is_on = getwinvar(2, '&list')
|
---|
| 130 | :echo "myvar = " . getwinvar(1, 'myvar')
|
---|
| 131 | <
|
---|
| 132 | - *glob()*
|
---|
| 133 | -glob({expr}) Expand the file wildcards in {expr}. See |wildcards| for the
|
---|
| 134 | +glob({expr} [, {flag}]) *glob()*
|
---|
| 135 | + Expand the file wildcards in {expr}. See |wildcards| for the
|
---|
| 136 | use of special characters.
|
---|
| 137 | The result is a String.
|
---|
| 138 | When there are several matches, they are separated by <NL>
|
---|
| 139 | characters.
|
---|
| 140 | - The 'wildignore' option applies: Names matching one of the
|
---|
| 141 | - patterns in 'wildignore' will be skipped.
|
---|
| 142 | + Unless the optional {flag} argument is given and is non-zero,
|
---|
| 143 | + the 'suffixes' and 'wildignore' options apply: Names matching
|
---|
| 144 | + one of the patterns in 'wildignore' will be skipped and
|
---|
| 145 | + 'suffixes' affect the ordering of matches.
|
---|
| 146 | If the expansion fails, the result is an empty string.
|
---|
| 147 | A name for a non-existing file is not included.
|
---|
| 148 |
|
---|
| 149 | @@ -3296,20 +3310,22 @@
|
---|
| 150 | See |expand()| for expanding special Vim variables. See
|
---|
| 151 | |system()| for getting the raw output of an external command.
|
---|
| 152 |
|
---|
| 153 | -globpath({path}, {expr}) *globpath()*
|
---|
| 154 | +globpath({path}, {expr} [, {flag}]) *globpath()*
|
---|
| 155 | Perform glob() on all directories in {path} and concatenate
|
---|
| 156 | the results. Example: >
|
---|
| 157 | :echo globpath(&rtp, "syntax/c.vim")
|
---|
| 158 | < {path} is a comma-separated list of directory names. Each
|
---|
| 159 | directory name is prepended to {expr} and expanded like with
|
---|
| 160 | - glob(). A path separator is inserted when needed.
|
---|
| 161 | + |glob()|. A path separator is inserted when needed.
|
---|
| 162 | To add a comma inside a directory name escape it with a
|
---|
| 163 | backslash. Note that on MS-Windows a directory may have a
|
---|
| 164 | trailing backslash, remove it if you put a comma after it.
|
---|
| 165 | If the expansion fails for one of the directories, there is no
|
---|
| 166 | error message.
|
---|
| 167 | - The 'wildignore' option applies: Names matching one of the
|
---|
| 168 | - patterns in 'wildignore' will be skipped.
|
---|
| 169 | + Unless the optional {flag} argument is given and is non-zero,
|
---|
| 170 | + the 'suffixes' and 'wildignore' options apply: Names matching
|
---|
| 171 | + one of the patterns in 'wildignore' will be skipped and
|
---|
| 172 | + 'suffixes' affect the ordering of matches.
|
---|
| 173 |
|
---|
| 174 | The "**" item can be used to search in a directory tree.
|
---|
| 175 | For example, to find all "README.txt" files in the directories
|
---|
| 176 | @@ -5332,10 +5348,12 @@
|
---|
| 177 | "fg" foreground color (GUI: color name used to set
|
---|
| 178 | the color, cterm: color number as a string,
|
---|
| 179 | term: empty string)
|
---|
| 180 | - "bg" background color (like "fg")
|
---|
| 181 | + "bg" background color (as with "fg")
|
---|
| 182 | + "sp" special color (as with "fg") |highlight-guisp|
|
---|
| 183 | "fg#" like "fg", but for the GUI and the GUI is
|
---|
| 184 | running the name in "#RRGGBB" form
|
---|
| 185 | "bg#" like "fg#" for "bg"
|
---|
| 186 | + "sp#" like "fg#" for "sp"
|
---|
| 187 | "bold" "1" if bold
|
---|
| 188 | "italic" "1" if italic
|
---|
| 189 | "reverse" "1" if reverse
|
---|
| 190 | @@ -5823,7 +5841,8 @@
|
---|
| 191 | mouse_pterm Compiled with support for qnx pterm mouse.
|
---|
| 192 | mouse_sysmouse Compiled with support for sysmouse (*BSD console mouse)
|
---|
| 193 | mouse_xterm Compiled with support for xterm mouse.
|
---|
| 194 | -multi_byte Compiled with support for editing Korean et al.
|
---|
| 195 | +multi_byte Compiled with support for 'encoding'
|
---|
| 196 | +multi_byte_encoding 'encoding' is set to a multi-byte encoding.
|
---|
| 197 | multi_byte_ime Compiled with support for IME input method.
|
---|
| 198 | multi_lang Compiled with support for multiple languages.
|
---|
| 199 | mzscheme Compiled with MzScheme interface |mzscheme|.
|
---|
| 200 | diff -Naur vim72.orig/runtime/doc/options.txt vim72/runtime/doc/options.txt
|
---|
| 201 | --- vim72.orig/runtime/doc/options.txt 2008-08-09 07:22:59.000000000 -0700
|
---|
| 202 | +++ vim72/runtime/doc/options.txt 2008-12-20 15:02:01.000000000 -0800
|
---|
| 203 | @@ -1,4 +1,4 @@
|
---|
| 204 | -*options.txt* For Vim version 7.2. Last change: 2008 Aug 06
|
---|
| 205 | +*options.txt* For Vim version 7.2. Last change: 2008 Nov 25
|
---|
| 206 |
|
---|
| 207 |
|
---|
| 208 | VIM REFERENCE MANUAL by Bram Moolenaar
|
---|
| 209 | @@ -7472,7 +7472,9 @@
|
---|
| 210 | {not available when compiled without the |+wildignore|
|
---|
| 211 | feature}
|
---|
| 212 | A list of file patterns. A file that matches with one of these
|
---|
| 213 | - patterns is ignored when completing file or directory names.
|
---|
| 214 | + patterns is ignored when completing file or directory names, and
|
---|
| 215 | + influences the result of |expand()|, |glob()| and |globpath()| unless
|
---|
| 216 | + a flag is passed to disable this.
|
---|
| 217 | The pattern is used like with |:autocmd|, see |autocmd-patterns|.
|
---|
| 218 | Also see 'suffixes'.
|
---|
| 219 | Example: >
|
---|
| 220 | diff -Naur vim72.orig/runtime/doc/spell.txt vim72/runtime/doc/spell.txt
|
---|
| 221 | --- vim72.orig/runtime/doc/spell.txt 2008-08-09 07:23:00.000000000 -0700
|
---|
| 222 | +++ vim72/runtime/doc/spell.txt 2008-12-20 15:02:27.000000000 -0800
|
---|
| 223 | @@ -1,4 +1,4 @@
|
---|
| 224 | -*spell.txt* For Vim version 7.2. Last change: 2008 Jun 21
|
---|
| 225 | +*spell.txt* For Vim version 7.2. Last change: 2008 Nov 30
|
---|
| 226 |
|
---|
| 227 |
|
---|
| 228 | VIM REFERENCE MANUAL by Bram Moolenaar
|
---|
| 229 | @@ -831,8 +831,11 @@
|
---|
| 230 |
|
---|
| 231 | # comment line ~
|
---|
| 232 |
|
---|
| 233 | -With some items it's also possible to put a comment after it, but this isn't
|
---|
| 234 | -supported in general.
|
---|
| 235 | +Items with a fixed number of arguments can be followed by a comment. But only
|
---|
| 236 | +if none of the arguments can contain white space. The comment must start with
|
---|
| 237 | +a "#" character. Example:
|
---|
| 238 | +
|
---|
| 239 | + KEEPCASE = # fix case for words with this flag ~
|
---|
| 240 |
|
---|
| 241 |
|
---|
| 242 | ENCODING *spell-SET*
|
---|
| 243 | @@ -965,6 +968,9 @@
|
---|
| 244 |
|
---|
| 245 | Note: When using utf-8 only characters up to 65000 may be used for flags.
|
---|
| 246 |
|
---|
| 247 | +Note: even when using "num" or "long" the number of flags available to
|
---|
| 248 | +compounding and prefixes is limited to about 250.
|
---|
| 249 | +
|
---|
| 250 |
|
---|
| 251 | AFFIXES
|
---|
| 252 | *spell-PFX* *spell-SFX*
|
---|
| 253 | @@ -1178,6 +1184,9 @@
|
---|
| 254 | The flag also applies to the word with affixes, thus this can be used to mark
|
---|
| 255 | a whole bunch of related words as bad.
|
---|
| 256 |
|
---|
| 257 | + *spell-FORBIDDENWORD*
|
---|
| 258 | +FORBIDDENWORD can be used just like BAD. For compatibility with Hunspell.
|
---|
| 259 | +
|
---|
| 260 | *spell-NEEDAFFIX*
|
---|
| 261 | The NEEDAFFIX flag is used to require that a word is used with an affix. The
|
---|
| 262 | word itself is not a good word (unless there is an empty affix). Example:
|
---|
| 263 | @@ -1268,6 +1277,10 @@
|
---|
| 264 |
|
---|
| 265 | NEEDCOMPOUND & ~
|
---|
| 266 |
|
---|
| 267 | + *spell-ONLYINCOMPOUND*
|
---|
| 268 | +The ONLYINCOMPOUND does exactly the same as NEEDCOMPOUND. Supported for
|
---|
| 269 | +compatiblity with Hunspell.
|
---|
| 270 | +
|
---|
| 271 | *spell-COMPOUNDMIN*
|
---|
| 272 | The minimal character length of a word used for compounding is specified with
|
---|
| 273 | COMPOUNDMIN. Example:
|
---|
| 274 | @@ -1328,6 +1341,20 @@
|
---|
| 275 | rules. Can also be used for an affix to count the affix as a compounding
|
---|
| 276 | word.
|
---|
| 277 |
|
---|
| 278 | + *spell-CHECKCOMPOUNDPATTERN*
|
---|
| 279 | +CHECKCOMPOUNDPATTERN is used to define patterns that, when matching at the
|
---|
| 280 | +position where two words are compounded together forbids the compound.
|
---|
| 281 | +For example:
|
---|
| 282 | + CHECKCOMPOUNDPATTERN o e ~
|
---|
| 283 | +
|
---|
| 284 | +This forbids compounding if the first word ends in "o" and the second word
|
---|
| 285 | +starts with "e".
|
---|
| 286 | +
|
---|
| 287 | +The arguments must be plain text, no patterns are actually supported, despite
|
---|
| 288 | +the item name. Case is always ignored.
|
---|
| 289 | +
|
---|
| 290 | +The Hunspell feature to use three arguments and flags is not supported.
|
---|
| 291 | +
|
---|
| 292 | *spell-SYLLABLE*
|
---|
| 293 | The SYLLABLE item defines characters or character sequences that are used to
|
---|
| 294 | count the number of syllables in a word. Example:
|
---|
| 295 | @@ -1496,6 +1523,10 @@
|
---|
| 296 | ACCENT (Hunspell) *spell-ACCENT*
|
---|
| 297 | Use MAP instead. |spell-MAP|
|
---|
| 298 |
|
---|
| 299 | +BREAK (Hunspell) *spell-BREAK*
|
---|
| 300 | + Define break points. Unclear how it works exactly.
|
---|
| 301 | + Not supported.
|
---|
| 302 | +
|
---|
| 303 | CHECKCOMPOUNDCASE (Hunspell) *spell-CHECKCOMPOUNDCASE*
|
---|
| 304 | Disallow uppercase letters at compound word boundaries.
|
---|
| 305 | Not supported.
|
---|
| 306 | @@ -1512,9 +1543,6 @@
|
---|
| 307 | Forbid three identical characters when compounding. Not
|
---|
| 308 | supported.
|
---|
| 309 |
|
---|
| 310 | -CHECKCOMPOUNDPATTERN (Hunspell) *spell-CHECKCOMPOUNDPATTERN*
|
---|
| 311 | - Forbid compounding when patterns match. Not supported.
|
---|
| 312 | -
|
---|
| 313 | COMPLEXPREFIXES (Hunspell) *spell-COMPLEXPREFIXES*
|
---|
| 314 | Enables using two prefixes. Not supported.
|
---|
| 315 |
|
---|
| 316 | @@ -1536,13 +1564,18 @@
|
---|
| 317 | COMPOUNDMIDDLE (Hunspell) *spell-COMPOUNDMIDDLE*
|
---|
| 318 | Use COMPOUNDRULE instead. |spell-COMPOUNDRULE|
|
---|
| 319 |
|
---|
| 320 | +COMPOUNDRULES (Hunspell) *spell-COMPOUNDRULES*
|
---|
| 321 | + Number of COMPOUNDRULE lines following. Ignored, but the
|
---|
| 322 | + argument must be a number.
|
---|
| 323 | +
|
---|
| 324 | COMPOUNDSYLLABLE (Hunspell) *spell-COMPOUNDSYLLABLE*
|
---|
| 325 | Use SYLLABLE and COMPOUNDSYLMAX instead. |spell-SYLLABLE|
|
---|
| 326 | |spell-COMPOUNDSYLMAX|
|
---|
| 327 |
|
---|
| 328 | -FORBIDDENWORD (Hunspell) *spell-FORBIDDENWORD*
|
---|
| 329 | - Use BAD instead. |spell-BAD|
|
---|
| 330 | -
|
---|
| 331 | +KEY (Hunspell) *spell-KEY*
|
---|
| 332 | + Define characters that are close together on the keyboard.
|
---|
| 333 | + Used to give better suggestions. Not supported.
|
---|
| 334 | +
|
---|
| 335 | LANG (Hunspell) *spell-LANG*
|
---|
| 336 | This specifies language-specific behavior. This actually
|
---|
| 337 | moves part of the language knowledge into the program,
|
---|
| 338 | @@ -1553,10 +1586,7 @@
|
---|
| 339 | Only needed for morphological analysis.
|
---|
| 340 |
|
---|
| 341 | MAXNGRAMSUGS (Hunspell) *spell-MAXNGRAMSUGS*
|
---|
| 342 | - Not supported.
|
---|
| 343 | -
|
---|
| 344 | -ONLYINCOMPOUND (Hunspell) *spell-ONLYINCOMPOUND*
|
---|
| 345 | - Use NEEDCOMPOUND instead. |spell-NEEDCOMPOUND|
|
---|
| 346 | + Set number of n-gram suggestions. Not supported.
|
---|
| 347 |
|
---|
| 348 | PSEUDOROOT (Hunspell) *spell-PSEUDOROOT*
|
---|
| 349 | Use NEEDAFFIX instead. |spell-NEEDAFFIX|
|
---|
| 350 | diff -Naur vim72.orig/runtime/doc/starting.txt vim72/runtime/doc/starting.txt
|
---|
| 351 | --- vim72.orig/runtime/doc/starting.txt 2008-08-09 07:23:00.000000000 -0700
|
---|
| 352 | +++ vim72/runtime/doc/starting.txt 2008-12-20 15:01:04.000000000 -0800
|
---|
| 353 | @@ -1,4 +1,4 @@
|
---|
| 354 | -*starting.txt* For Vim version 7.2. Last change: 2008 Jun 21
|
---|
| 355 | +*starting.txt* For Vim version 7.2. Last change: 2008 Nov 09
|
---|
| 356 |
|
---|
| 357 |
|
---|
| 358 | VIM REFERENCE MANUAL by Bram Moolenaar
|
---|
| 359 | @@ -1337,8 +1337,9 @@
|
---|
| 360 | *viminfo-read*
|
---|
| 361 | When Vim is started and the 'viminfo' option is non-empty, the contents of
|
---|
| 362 | the viminfo file are read and the info can be used in the appropriate places.
|
---|
| 363 | -The marks are not read in at startup (but file marks are). See
|
---|
| 364 | -|initialization| for how to set the 'viminfo' option upon startup.
|
---|
| 365 | +The |v:oldfiles| variable is filled. The marks are not read in at startup
|
---|
| 366 | +(but file marks are). See |initialization| for how to set the 'viminfo'
|
---|
| 367 | +option upon startup.
|
---|
| 368 |
|
---|
| 369 | *viminfo-write*
|
---|
| 370 | When Vim exits and 'viminfo' is non-empty, the info is stored in the viminfo
|
---|
| 371 | @@ -1372,6 +1373,8 @@
|
---|
| 372 | that start with any string given with the "r" flag in 'viminfo'. This can be
|
---|
| 373 | used to avoid saving marks for files on removable media (for MS-DOS you would
|
---|
| 374 | use "ra:,rb:", for Amiga "rdf0:,rdf1:,rdf2:").
|
---|
| 375 | +The |v:oldfiles| variable is filled with the file names that the viminfo file
|
---|
| 376 | +has marks for.
|
---|
| 377 |
|
---|
| 378 | *viminfo-file-marks*
|
---|
| 379 | Uppercase marks ('A to 'Z) are stored when writing the viminfo file. The
|
---|
| 380 | @@ -1463,8 +1466,8 @@
|
---|
| 381 | *:rv* *:rviminfo* *E195*
|
---|
| 382 | :rv[iminfo][!] [file] Read from viminfo file [file] (default: see above).
|
---|
| 383 | If [!] is given, then any information that is
|
---|
| 384 | - already set (registers, marks, etc.) will be
|
---|
| 385 | - overwritten. {not in Vi}
|
---|
| 386 | + already set (registers, marks, |v:oldfiles|, etc.)
|
---|
| 387 | + will be overwritten {not in Vi}
|
---|
| 388 |
|
---|
| 389 | *:wv* *:wviminfo* *E137* *E138* *E574*
|
---|
| 390 | :wv[iminfo][!] [file] Write to viminfo file [file] (default: see above).
|
---|
| 391 | @@ -1479,4 +1482,20 @@
|
---|
| 392 | the .viminfo file.
|
---|
| 393 | {not in Vi}
|
---|
| 394 |
|
---|
| 395 | + *:ol* *:oldfiles*
|
---|
| 396 | +:ol[dfiles] List the files that have marks stored in the viminfo
|
---|
| 397 | + file. This list is read on startup and only changes
|
---|
| 398 | + afterwards with ":rviminfo!". Also see |v:oldfiles|.
|
---|
| 399 | + The number can be used with |c_#<|.
|
---|
| 400 | + {not in Vi, only when compiled with the +eval feature}
|
---|
| 401 | +
|
---|
| 402 | +:bro[wse] ol[dfiles][!]
|
---|
| 403 | + List file names as with |:oldfiles|, and then prompt
|
---|
| 404 | + for a number. When the number is valid that file from
|
---|
| 405 | + the list is edited.
|
---|
| 406 | + If you get the |press-enter| prompt you can press "q"
|
---|
| 407 | + and still get the prompt to enter a file number.
|
---|
| 408 | + Use ! to abondon a modified buffer. |abandon|
|
---|
| 409 | + {not when compiled with tiny or small features}
|
---|
| 410 | +
|
---|
| 411 | vim:tw=78:ts=8:ft=help:norl:
|
---|
| 412 | diff -Naur vim72.orig/runtime/doc/usr_21.txt vim72/runtime/doc/usr_21.txt
|
---|
| 413 | --- vim72.orig/runtime/doc/usr_21.txt 2008-08-09 07:23:01.000000000 -0700
|
---|
| 414 | +++ vim72/runtime/doc/usr_21.txt 2008-12-20 15:01:04.000000000 -0800
|
---|
| 415 | @@ -1,4 +1,4 @@
|
---|
| 416 | -*usr_21.txt* For Vim version 7.2. Last change: 2007 May 01
|
---|
| 417 | +*usr_21.txt* For Vim version 7.2. Last change: 2008 Nov 09
|
---|
| 418 |
|
---|
| 419 | VIM USER MANUAL - by Bram Moolenaar
|
---|
| 420 |
|
---|
| 421 | @@ -153,7 +153,7 @@
|
---|
| 422 | to be lost. Each item can be remembered only once.
|
---|
| 423 |
|
---|
| 424 |
|
---|
| 425 | -GETTING BACK TO WHERE YOU WERE
|
---|
| 426 | +GETTING BACK TO WHERE YOU STOPPED VIM
|
---|
| 427 |
|
---|
| 428 | You are halfway editing a file and it's time to leave for holidays. You exit
|
---|
| 429 | Vim and go enjoy yourselves, forgetting all about your work. After a couple
|
---|
| 430 | @@ -168,6 +168,48 @@
|
---|
| 431 | The |:marks| command is useful to find out where '0 to '9 will take you.
|
---|
| 432 |
|
---|
| 433 |
|
---|
| 434 | +GETTING BACK TO SOME FILE
|
---|
| 435 | +
|
---|
| 436 | +If you want to go back to a file that you edited recently, but not when
|
---|
| 437 | +exiting Vim, there is a slightly more complicated way. You can see a list of
|
---|
| 438 | +files by typing the command: >
|
---|
| 439 | +
|
---|
| 440 | + :oldfiles
|
---|
| 441 | +< 1: ~/.viminfo ~
|
---|
| 442 | + 2: ~/text/resume.txt ~
|
---|
| 443 | + 3: /tmp/draft ~
|
---|
| 444 | +
|
---|
| 445 | +Now you would like to edit the second file, which is in the list preceded by
|
---|
| 446 | +"2:". You type: >
|
---|
| 447 | +
|
---|
| 448 | + :e #<2
|
---|
| 449 | +
|
---|
| 450 | +Instead of ":e" you can use any command that has a file name argument, the
|
---|
| 451 | +"#<2" item works in the same place as "%" (current file name) and "#"
|
---|
| 452 | +(alternate file name). So you can also split the window to edit the third
|
---|
| 453 | +file: >
|
---|
| 454 | +
|
---|
| 455 | + :split #<3
|
---|
| 456 | +
|
---|
| 457 | +That #<123 thing is a bit complicated when you just want to edit a file.
|
---|
| 458 | +Fortunately there is a simpler way: >
|
---|
| 459 | +
|
---|
| 460 | + :browse oldfiles
|
---|
| 461 | +< 1: ~/.viminfo ~
|
---|
| 462 | + 2: ~/text/resume.txt ~
|
---|
| 463 | + 3: /tmp/draft ~
|
---|
| 464 | + -- More --
|
---|
| 465 | +
|
---|
| 466 | +You get the same list of files as with |:oldfiles|. If you want to edit
|
---|
| 467 | +"resume.txt" first press "q" to stop the listing. You will get a prompt:
|
---|
| 468 | +
|
---|
| 469 | + Type number and <Enter> (empty cancels): ~
|
---|
| 470 | +
|
---|
| 471 | +Type "2" and press <Enter> to edit the second file.
|
---|
| 472 | +
|
---|
| 473 | +More info at |:oldfiles|, |v:oldfiles| and |c_#<|.
|
---|
| 474 | +
|
---|
| 475 | +
|
---|
| 476 | MOVE INFO FROM ONE VIM TO ANOTHER
|
---|
| 477 |
|
---|
| 478 | You can use the ":wviminfo" and ":rviminfo" commands to save and restore the
|
---|
| 479 | diff -Naur vim72.orig/runtime/scripts.vim vim72/runtime/scripts.vim
|
---|
| 480 | --- vim72.orig/runtime/scripts.vim 2008-08-08 15:27:21.000000000 -0700
|
---|
| 481 | +++ vim72/runtime/scripts.vim 2008-12-20 14:59:55.000000000 -0800
|
---|
| 482 | @@ -234,6 +234,10 @@
|
---|
| 483 | elseif s:line1 =~ '\<DTD\s\+XHTML\s'
|
---|
| 484 | set ft=xhtml
|
---|
| 485 |
|
---|
| 486 | + " HTML (e.g.: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN")
|
---|
| 487 | + elseif s:line1 =~? '\<DOCTYPE\s\+html\>'
|
---|
| 488 | + set ft=html
|
---|
| 489 | +
|
---|
| 490 | " PDF
|
---|
| 491 | elseif s:line1 =~ '^%PDF-'
|
---|
| 492 | set ft=pdf
|
---|
| 493 | diff -Naur vim72.orig/src/auto/configure vim72/src/auto/configure
|
---|
| 494 | --- vim72.orig/src/auto/configure 2008-07-24 05:40:36.000000000 -0700
|
---|
| 495 | +++ vim72/src/auto/configure 2008-12-20 15:01:40.000000000 -0800
|
---|
| 496 | @@ -16819,21 +16819,29 @@
|
---|
| 497 | LDFLAGS="$LDFLAGS -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
|
---|
| 498 | fi
|
---|
| 499 |
|
---|
| 500 | -{ $as_echo "$as_me:$LINENO: checking for GCC 3 or later" >&5
|
---|
| 501 | -$as_echo_n "checking for GCC 3 or later... " >&6; }
|
---|
| 502 | DEPEND_CFLAGS_FILTER=
|
---|
| 503 | if test "$GCC" = yes; then
|
---|
| 504 | + { $as_echo "$as_me:$LINENO: checking for GCC 3 or later" >&5
|
---|
| 505 | +$as_echo_n "checking for GCC 3 or later... " >&6; }
|
---|
| 506 | gccmajor=`echo "$gccversion" | sed -e 's/^\([1-9]\)\..*$/\1/g'`
|
---|
| 507 | if test "$gccmajor" -gt "2"; then
|
---|
| 508 | DEPEND_CFLAGS_FILTER="| sed 's+-I */+-isystem /+g'"
|
---|
| 509 | - fi
|
---|
| 510 | -fi
|
---|
| 511 | -if test "$DEPEND_CFLAGS_FILTER" = ""; then
|
---|
| 512 | - { $as_echo "$as_me:$LINENO: result: no" >&5
|
---|
| 513 | + { $as_echo "$as_me:$LINENO: result: yes" >&5
|
---|
| 514 | +$as_echo "yes" >&6; }
|
---|
| 515 | + else
|
---|
| 516 | + { $as_echo "$as_me:$LINENO: result: no" >&5
|
---|
| 517 | $as_echo "no" >&6; }
|
---|
| 518 | -else
|
---|
| 519 | - { $as_echo "$as_me:$LINENO: result: yes" >&5
|
---|
| 520 | + fi
|
---|
| 521 | + { $as_echo "$as_me:$LINENO: checking whether we need -D_FORTIFY_SOURCE=1" >&5
|
---|
| 522 | +$as_echo_n "checking whether we need -D_FORTIFY_SOURCE=1... " >&6; }
|
---|
| 523 | + if test "$gccmajor" -gt "3"; then
|
---|
| 524 | + CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=1"
|
---|
| 525 | + { $as_echo "$as_me:$LINENO: result: yes" >&5
|
---|
| 526 | $as_echo "yes" >&6; }
|
---|
| 527 | + else
|
---|
| 528 | + { $as_echo "$as_me:$LINENO: result: no" >&5
|
---|
| 529 | +$as_echo "no" >&6; }
|
---|
| 530 | + fi
|
---|
| 531 | fi
|
---|
| 532 |
|
---|
| 533 |
|
---|
| 534 | diff -Naur vim72.orig/src/buffer.c vim72/src/buffer.c
|
---|
| 535 | --- vim72.orig/src/buffer.c 2008-08-06 04:00:48.000000000 -0700
|
---|
| 536 | +++ vim72/src/buffer.c 2008-12-20 15:02:33.000000000 -0800
|
---|
| 537 | @@ -647,6 +647,9 @@
|
---|
| 538 | vim_free(buf->b_start_fenc);
|
---|
| 539 | buf->b_start_fenc = NULL;
|
---|
| 540 | #endif
|
---|
| 541 | +#ifdef FEAT_SPELL
|
---|
| 542 | + ga_clear(&buf->b_langp);
|
---|
| 543 | +#endif
|
---|
| 544 | }
|
---|
| 545 |
|
---|
| 546 | /*
|
---|
| 547 | @@ -1237,7 +1240,7 @@
|
---|
| 548 | * "buf" if one exists */
|
---|
| 549 | if ((swb_flags & SWB_USEOPEN) && buf_jump_open_win(buf))
|
---|
| 550 | return OK;
|
---|
| 551 | - /* If 'switchbuf' contians "usetab": jump to first window in any tab
|
---|
| 552 | + /* If 'switchbuf' contains "usetab": jump to first window in any tab
|
---|
| 553 | * page containing "buf" if one exists */
|
---|
| 554 | if ((swb_flags & SWB_USETAB) && buf_jump_open_tab(buf))
|
---|
| 555 | return OK;
|
---|
| 556 | @@ -1351,11 +1354,12 @@
|
---|
| 557 | }
|
---|
| 558 | }
|
---|
| 559 | #ifdef FEAT_AUTOCMD
|
---|
| 560 | + /* An autocommand may have deleted "buf", already entered it (e.g., when
|
---|
| 561 | + * it did ":bunload") or aborted the script processing! */
|
---|
| 562 | # ifdef FEAT_EVAL
|
---|
| 563 | - /* An autocommand may have deleted buf or aborted the script processing! */
|
---|
| 564 | - if (buf_valid(buf) && !aborting())
|
---|
| 565 | + if (buf_valid(buf) && buf != curbuf && !aborting())
|
---|
| 566 | # else
|
---|
| 567 | - if (buf_valid(buf)) /* an autocommand may have deleted buf! */
|
---|
| 568 | + if (buf_valid(buf) && buf != curbuf)
|
---|
| 569 | # endif
|
---|
| 570 | #endif
|
---|
| 571 | enter_buffer(buf);
|
---|
| 572 | @@ -1397,6 +1401,9 @@
|
---|
| 573 | curwin->w_cursor.coladd = 0;
|
---|
| 574 | #endif
|
---|
| 575 | curwin->w_set_curswant = TRUE;
|
---|
| 576 | +#ifdef FEAT_AUTOCMD
|
---|
| 577 | + curwin->w_topline_was_set = FALSE;
|
---|
| 578 | +#endif
|
---|
| 579 |
|
---|
| 580 | /* Make sure the buffer is loaded. */
|
---|
| 581 | if (curbuf->b_ml.ml_mfp == NULL) /* need to load the file */
|
---|
| 582 | @@ -1436,7 +1443,8 @@
|
---|
| 583 | maketitle();
|
---|
| 584 | #endif
|
---|
| 585 | #ifdef FEAT_AUTOCMD
|
---|
| 586 | - if (curwin->w_topline == 1) /* when autocmds didn't change it */
|
---|
| 587 | + /* when autocmds didn't change it */
|
---|
| 588 | + if (curwin->w_topline == 1 && !curwin->w_topline_was_set)
|
---|
| 589 | #endif
|
---|
| 590 | scroll_cursor_halfway(FALSE); /* redisplay at correct position */
|
---|
| 591 |
|
---|
| 592 | @@ -3963,7 +3971,7 @@
|
---|
| 593 | width = vim_strsize(out);
|
---|
| 594 | if (maxwidth > 0 && width > maxwidth)
|
---|
| 595 | {
|
---|
| 596 | - /* Result is too long, must trunctate somewhere. */
|
---|
| 597 | + /* Result is too long, must truncate somewhere. */
|
---|
| 598 | l = 0;
|
---|
| 599 | if (itemcnt == 0)
|
---|
| 600 | s = out;
|
---|
| 601 | @@ -5062,7 +5070,7 @@
|
---|
| 602 | {
|
---|
| 603 | if (buf->b_sfname != NULL)
|
---|
| 604 | return (char *)buf->b_sfname;
|
---|
| 605 | - return "[Scratch]";
|
---|
| 606 | + return _("[Scratch]");
|
---|
| 607 | }
|
---|
| 608 | #endif
|
---|
| 609 | if (buf->b_fname == NULL)
|
---|
| 610 | diff -Naur vim72.orig/src/configure.in vim72/src/configure.in
|
---|
| 611 | --- vim72.orig/src/configure.in 2008-07-24 05:40:26.000000000 -0700
|
---|
| 612 | +++ vim72/src/configure.in 2008-12-20 15:01:40.000000000 -0800
|
---|
| 613 | @@ -3152,18 +3152,25 @@
|
---|
| 614 | dnl But only when making dependencies, cproto and lint don't take "-isystem".
|
---|
| 615 | dnl Mac gcc returns "powerpc-apple-darwin8-gcc-4.0.1 (GCC)...", need to allow
|
---|
| 616 | dnl the number before the version number.
|
---|
| 617 | -AC_MSG_CHECKING(for GCC 3 or later)
|
---|
| 618 | DEPEND_CFLAGS_FILTER=
|
---|
| 619 | if test "$GCC" = yes; then
|
---|
| 620 | + AC_MSG_CHECKING(for GCC 3 or later)
|
---|
| 621 | gccmajor=`echo "$gccversion" | sed -e 's/^\([[1-9]]\)\..*$/\1/g'`
|
---|
| 622 | if test "$gccmajor" -gt "2"; then
|
---|
| 623 | DEPEND_CFLAGS_FILTER="| sed 's+-I */+-isystem /+g'"
|
---|
| 624 | + AC_MSG_RESULT(yes)
|
---|
| 625 | + else
|
---|
| 626 | + AC_MSG_RESULT(no)
|
---|
| 627 | + fi
|
---|
| 628 | + dnl -D_FORTIFY_SOURCE=2 crashes Vim on strcpy(buf, "000") when buf is
|
---|
| 629 | + dnl declared as char x[1] but actually longer. Introduced in gcc 4.0.
|
---|
| 630 | + AC_MSG_CHECKING(whether we need -D_FORTIFY_SOURCE=1)
|
---|
| 631 | + if test "$gccmajor" -gt "3"; then
|
---|
| 632 | + CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=1"
|
---|
| 633 | + AC_MSG_RESULT(yes)
|
---|
| 634 | + else
|
---|
| 635 | + AC_MSG_RESULT(no)
|
---|
| 636 | fi
|
---|
| 637 | -fi
|
---|
| 638 | -if test "$DEPEND_CFLAGS_FILTER" = ""; then
|
---|
| 639 | - AC_MSG_RESULT(no)
|
---|
| 640 | -else
|
---|
| 641 | - AC_MSG_RESULT(yes)
|
---|
| 642 | fi
|
---|
| 643 | AC_SUBST(DEPEND_CFLAGS_FILTER)
|
---|
| 644 |
|
---|
| 645 | diff -Naur vim72.orig/src/diff.c vim72/src/diff.c
|
---|
| 646 | --- vim72.orig/src/diff.c 2008-03-05 03:16:56.000000000 -0800
|
---|
| 647 | +++ vim72/src/diff.c 2008-12-20 15:02:24.000000000 -0800
|
---|
| 648 | @@ -73,6 +73,8 @@
|
---|
| 649 | {
|
---|
| 650 | tp->tp_diffbuf[i] = NULL;
|
---|
| 651 | tp->tp_diff_invalid = TRUE;
|
---|
| 652 | + if (tp == curtab)
|
---|
| 653 | + diff_redraw(TRUE);
|
---|
| 654 | }
|
---|
| 655 | }
|
---|
| 656 | }
|
---|
| 657 | @@ -102,6 +104,7 @@
|
---|
| 658 | {
|
---|
| 659 | curtab->tp_diffbuf[i] = NULL;
|
---|
| 660 | curtab->tp_diff_invalid = TRUE;
|
---|
| 661 | + diff_redraw(TRUE);
|
---|
| 662 | }
|
---|
| 663 | }
|
---|
| 664 | }
|
---|
| 665 | @@ -131,6 +134,7 @@
|
---|
| 666 | {
|
---|
| 667 | curtab->tp_diffbuf[i] = buf;
|
---|
| 668 | curtab->tp_diff_invalid = TRUE;
|
---|
| 669 | + diff_redraw(TRUE);
|
---|
| 670 | return;
|
---|
| 671 | }
|
---|
| 672 |
|
---|
| 673 | @@ -661,6 +665,7 @@
|
---|
| 674 | char_u *tmp_diff;
|
---|
| 675 | FILE *fd;
|
---|
| 676 | int ok;
|
---|
| 677 | + int io_error = FALSE;
|
---|
| 678 |
|
---|
| 679 | /* Delete all diffblocks. */
|
---|
| 680 | diff_clear(curtab);
|
---|
| 681 | @@ -697,18 +702,26 @@
|
---|
| 682 | {
|
---|
| 683 | ok = FALSE;
|
---|
| 684 | fd = mch_fopen((char *)tmp_orig, "w");
|
---|
| 685 | - if (fd != NULL)
|
---|
| 686 | + if (fd == NULL)
|
---|
| 687 | + io_error = TRUE;
|
---|
| 688 | + else
|
---|
| 689 | {
|
---|
| 690 | - fwrite("line1\n", (size_t)6, (size_t)1, fd);
|
---|
| 691 | + if (fwrite("line1\n", (size_t)6, (size_t)1, fd) != 1)
|
---|
| 692 | + io_error = TRUE;
|
---|
| 693 | fclose(fd);
|
---|
| 694 | fd = mch_fopen((char *)tmp_new, "w");
|
---|
| 695 | - if (fd != NULL)
|
---|
| 696 | + if (fd == NULL)
|
---|
| 697 | + io_error = TRUE;
|
---|
| 698 | + else
|
---|
| 699 | {
|
---|
| 700 | - fwrite("line2\n", (size_t)6, (size_t)1, fd);
|
---|
| 701 | + if (fwrite("line2\n", (size_t)6, (size_t)1, fd) != 1)
|
---|
| 702 | + io_error = TRUE;
|
---|
| 703 | fclose(fd);
|
---|
| 704 | diff_file(tmp_orig, tmp_new, tmp_diff);
|
---|
| 705 | fd = mch_fopen((char *)tmp_diff, "r");
|
---|
| 706 | - if (fd != NULL)
|
---|
| 707 | + if (fd == NULL)
|
---|
| 708 | + io_error = TRUE;
|
---|
| 709 | + else
|
---|
| 710 | {
|
---|
| 711 | char_u linebuf[LBUFLEN];
|
---|
| 712 |
|
---|
| 713 | @@ -761,6 +774,8 @@
|
---|
| 714 | }
|
---|
| 715 | if (!ok)
|
---|
| 716 | {
|
---|
| 717 | + if (io_error)
|
---|
| 718 | + EMSG(_("E810: Cannot read or write temp files"));
|
---|
| 719 | EMSG(_("E97: Cannot create diffs"));
|
---|
| 720 | diff_a_works = MAYBE;
|
---|
| 721 | #if defined(MSWIN) || defined(MSDOS)
|
---|
| 722 | @@ -925,10 +940,10 @@
|
---|
| 723 | {
|
---|
| 724 | # ifdef TEMPDIRNAMES
|
---|
| 725 | if (vim_tempdir != NULL)
|
---|
| 726 | - mch_chdir((char *)vim_tempdir);
|
---|
| 727 | + ignored = mch_chdir((char *)vim_tempdir);
|
---|
| 728 | else
|
---|
| 729 | # endif
|
---|
| 730 | - mch_chdir("/tmp");
|
---|
| 731 | + ignored = mch_chdir("/tmp");
|
---|
| 732 | shorten_fnames(TRUE);
|
---|
| 733 | }
|
---|
| 734 | #endif
|
---|
| 735 | diff -Naur vim72.orig/src/eval.c vim72/src/eval.c
|
---|
| 736 | --- vim72.orig/src/eval.c 2008-08-07 12:37:22.000000000 -0700
|
---|
| 737 | +++ vim72/src/eval.c 2008-12-20 15:02:44.000000000 -0800
|
---|
| 738 | @@ -348,6 +348,7 @@
|
---|
| 739 | {VV_NAME("mouse_col", VAR_NUMBER), 0},
|
---|
| 740 | {VV_NAME("operator", VAR_STRING), VV_RO},
|
---|
| 741 | {VV_NAME("searchforward", VAR_NUMBER), 0},
|
---|
| 742 | + {VV_NAME("oldfiles", VAR_LIST), 0},
|
---|
| 743 | };
|
---|
| 744 |
|
---|
| 745 | /* shorthand */
|
---|
| 746 | @@ -355,6 +356,7 @@
|
---|
| 747 | #define vv_nr vv_di.di_tv.vval.v_number
|
---|
| 748 | #define vv_float vv_di.di_tv.vval.v_float
|
---|
| 749 | #define vv_str vv_di.di_tv.vval.v_string
|
---|
| 750 | +#define vv_list vv_di.di_tv.vval.v_list
|
---|
| 751 | #define vv_tv vv_di.di_tv
|
---|
| 752 |
|
---|
| 753 | /*
|
---|
| 754 | @@ -426,7 +428,6 @@
|
---|
| 755 | static long list_idx_of_item __ARGS((list_T *l, listitem_T *item));
|
---|
| 756 | static void list_append __ARGS((list_T *l, listitem_T *item));
|
---|
| 757 | static int list_append_tv __ARGS((list_T *l, typval_T *tv));
|
---|
| 758 | -static int list_append_string __ARGS((list_T *l, char_u *str, int len));
|
---|
| 759 | static int list_append_number __ARGS((list_T *l, varnumber_T n));
|
---|
| 760 | static int list_insert_tv __ARGS((list_T *l, typval_T *tv, listitem_T *item));
|
---|
| 761 | static int list_extend __ARGS((list_T *l1, list_T *l2, listitem_T *bef));
|
---|
| 762 | @@ -845,11 +846,17 @@
|
---|
| 763 | p = &vimvars[i];
|
---|
| 764 | if (p->vv_di.di_tv.v_type == VAR_STRING)
|
---|
| 765 | {
|
---|
| 766 | - vim_free(p->vv_di.di_tv.vval.v_string);
|
---|
| 767 | - p->vv_di.di_tv.vval.v_string = NULL;
|
---|
| 768 | + vim_free(p->vv_str);
|
---|
| 769 | + p->vv_str = NULL;
|
---|
| 770 | + }
|
---|
| 771 | + else if (p->vv_di.di_tv.v_type == VAR_LIST)
|
---|
| 772 | + {
|
---|
| 773 | + list_unref(p->vv_list);
|
---|
| 774 | + p->vv_list = NULL;
|
---|
| 775 | }
|
---|
| 776 | }
|
---|
| 777 | hash_clear(&vimvarht);
|
---|
| 778 | + hash_init(&vimvarht); /* garbage_collect() will access it */
|
---|
| 779 | hash_clear(&compat_hashtab);
|
---|
| 780 |
|
---|
| 781 | /* script-local variables */
|
---|
| 782 | @@ -1256,23 +1263,26 @@
|
---|
| 783 |
|
---|
| 784 | /*
|
---|
| 785 | * Top level evaluation function, returning a string.
|
---|
| 786 | + * When "convert" is TRUE convert a List into a sequence of lines and convert
|
---|
| 787 | + * a Float to a String.
|
---|
| 788 | * Return pointer to allocated memory, or NULL for failure.
|
---|
| 789 | */
|
---|
| 790 | char_u *
|
---|
| 791 | -eval_to_string(arg, nextcmd, dolist)
|
---|
| 792 | +eval_to_string(arg, nextcmd, convert)
|
---|
| 793 | char_u *arg;
|
---|
| 794 | char_u **nextcmd;
|
---|
| 795 | - int dolist; /* turn List into sequence of lines */
|
---|
| 796 | + int convert;
|
---|
| 797 | {
|
---|
| 798 | typval_T tv;
|
---|
| 799 | char_u *retval;
|
---|
| 800 | garray_T ga;
|
---|
| 801 | + char_u numbuf[NUMBUFLEN];
|
---|
| 802 |
|
---|
| 803 | if (eval0(arg, &tv, nextcmd, TRUE) == FAIL)
|
---|
| 804 | retval = NULL;
|
---|
| 805 | else
|
---|
| 806 | {
|
---|
| 807 | - if (dolist && tv.v_type == VAR_LIST)
|
---|
| 808 | + if (convert && tv.v_type == VAR_LIST)
|
---|
| 809 | {
|
---|
| 810 | ga_init2(&ga, (int)sizeof(char), 80);
|
---|
| 811 | if (tv.vval.v_list != NULL)
|
---|
| 812 | @@ -1280,6 +1290,13 @@
|
---|
| 813 | ga_append(&ga, NUL);
|
---|
| 814 | retval = (char_u *)ga.ga_data;
|
---|
| 815 | }
|
---|
| 816 | +#ifdef FEAT_FLOAT
|
---|
| 817 | + else if (convert && tv.v_type == VAR_FLOAT)
|
---|
| 818 | + {
|
---|
| 819 | + vim_snprintf((char *)numbuf, NUMBUFLEN, "%g", tv.vval.v_float);
|
---|
| 820 | + retval = vim_strsave(numbuf);
|
---|
| 821 | + }
|
---|
| 822 | +#endif
|
---|
| 823 | else
|
---|
| 824 | retval = vim_strsave(get_tv_string(&tv));
|
---|
| 825 | clear_tv(&tv);
|
---|
| 826 | @@ -3277,7 +3294,7 @@
|
---|
| 827 |
|
---|
| 828 | if (*startarg != '(')
|
---|
| 829 | {
|
---|
| 830 | - EMSG2(_("E107: Missing braces: %s"), eap->arg);
|
---|
| 831 | + EMSG2(_("E107: Missing parentheses: %s"), eap->arg);
|
---|
| 832 | goto end;
|
---|
| 833 | }
|
---|
| 834 |
|
---|
| 835 | @@ -3657,8 +3674,8 @@
|
---|
| 836 | }
|
---|
| 837 |
|
---|
| 838 | /*
|
---|
| 839 | - * Return TRUE if typeval "tv" is locked: Either tha value is locked itself or
|
---|
| 840 | - * it refers to a List or Dictionary that is locked.
|
---|
| 841 | + * Return TRUE if typeval "tv" is locked: Either that value is locked itself
|
---|
| 842 | + * or it refers to a List or Dictionary that is locked.
|
---|
| 843 | */
|
---|
| 844 | static int
|
---|
| 845 | tv_islocked(tv)
|
---|
| 846 | @@ -6047,6 +6064,25 @@
|
---|
| 847 | }
|
---|
| 848 |
|
---|
| 849 | /*
|
---|
| 850 | + * Get list item "l[idx - 1]" as a string. Returns NULL for failure.
|
---|
| 851 | + */
|
---|
| 852 | + char_u *
|
---|
| 853 | +list_find_str(l, idx)
|
---|
| 854 | + list_T *l;
|
---|
| 855 | + long idx;
|
---|
| 856 | +{
|
---|
| 857 | + listitem_T *li;
|
---|
| 858 | +
|
---|
| 859 | + li = list_find(l, idx - 1);
|
---|
| 860 | + if (li == NULL)
|
---|
| 861 | + {
|
---|
| 862 | + EMSGN(_(e_listidx), idx);
|
---|
| 863 | + return NULL;
|
---|
| 864 | + }
|
---|
| 865 | + return get_tv_string(&li->li_tv);
|
---|
| 866 | +}
|
---|
| 867 | +
|
---|
| 868 | +/*
|
---|
| 869 | * Locate "item" list "l" and return its index.
|
---|
| 870 | * Returns -1 when "item" is not in the list.
|
---|
| 871 | */
|
---|
| 872 | @@ -6137,7 +6173,7 @@
|
---|
| 873 | * When "len" >= 0 use "str[len]".
|
---|
| 874 | * Returns FAIL when out of memory.
|
---|
| 875 | */
|
---|
| 876 | - static int
|
---|
| 877 | + int
|
---|
| 878 | list_append_string(l, str, len)
|
---|
| 879 | list_T *l;
|
---|
| 880 | char_u *str;
|
---|
| 881 | @@ -6497,6 +6533,9 @@
|
---|
| 882 | set_ref_in_ht(&fc->l_avars.dv_hashtab, copyID);
|
---|
| 883 | }
|
---|
| 884 |
|
---|
| 885 | + /* v: vars */
|
---|
| 886 | + set_ref_in_ht(&vimvarht, copyID);
|
---|
| 887 | +
|
---|
| 888 | /*
|
---|
| 889 | * 2. Go through the list of dicts and free items without the copyID.
|
---|
| 890 | */
|
---|
| 891 | @@ -6587,7 +6626,7 @@
|
---|
| 892 | {
|
---|
| 893 | case VAR_DICT:
|
---|
| 894 | dd = tv->vval.v_dict;
|
---|
| 895 | - if (dd->dv_copyID != copyID)
|
---|
| 896 | + if (dd != NULL && dd->dv_copyID != copyID)
|
---|
| 897 | {
|
---|
| 898 | /* Didn't see this dict yet. */
|
---|
| 899 | dd->dv_copyID = copyID;
|
---|
| 900 | @@ -6597,7 +6636,7 @@
|
---|
| 901 |
|
---|
| 902 | case VAR_LIST:
|
---|
| 903 | ll = tv->vval.v_list;
|
---|
| 904 | - if (ll->lv_copyID != copyID)
|
---|
| 905 | + if (ll != NULL && ll->lv_copyID != copyID)
|
---|
| 906 | {
|
---|
| 907 | /* Didn't see this list yet. */
|
---|
| 908 | ll->lv_copyID = copyID;
|
---|
| 909 | @@ -7525,8 +7564,8 @@
|
---|
| 910 | {"getwinposx", 0, 0, f_getwinposx},
|
---|
| 911 | {"getwinposy", 0, 0, f_getwinposy},
|
---|
| 912 | {"getwinvar", 2, 2, f_getwinvar},
|
---|
| 913 | - {"glob", 1, 1, f_glob},
|
---|
| 914 | - {"globpath", 2, 2, f_globpath},
|
---|
| 915 | + {"glob", 1, 2, f_glob},
|
---|
| 916 | + {"globpath", 2, 3, f_globpath},
|
---|
| 917 | {"has", 1, 1, f_has},
|
---|
| 918 | {"has_key", 2, 2, f_has_key},
|
---|
| 919 | {"haslocaldir", 0, 0, f_haslocaldir},
|
---|
| 920 | @@ -9518,7 +9557,7 @@
|
---|
| 921 | else
|
---|
| 922 | {
|
---|
| 923 | /* When the optional second argument is non-zero, don't remove matches
|
---|
| 924 | - * for 'suffixes' and 'wildignore' */
|
---|
| 925 | + * for 'wildignore' and don't put matches for 'suffixes' at the end. */
|
---|
| 926 | if (argvars[1].v_type != VAR_UNKNOWN
|
---|
| 927 | && get_tv_number_chk(&argvars[1], &error))
|
---|
| 928 | flags |= WILD_KEEP_ALL;
|
---|
| 929 | @@ -10300,7 +10339,8 @@
|
---|
| 930 | s = get_tv_string(&argvars[0]);
|
---|
| 931 | if (s == NULL || *s == NUL || VIM_ISDIGIT(*s))
|
---|
| 932 | EMSG2(_(e_invarg2), s);
|
---|
| 933 | - else if (!function_exists(s))
|
---|
| 934 | + /* Don't check an autoload name for existence here. */
|
---|
| 935 | + else if (vim_strchr(s, AUTOLOAD_CHAR) == NULL && !function_exists(s))
|
---|
| 936 | EMSG2(_("E700: Unknown function: %s"), s);
|
---|
| 937 | else
|
---|
| 938 | {
|
---|
| 939 | @@ -10602,7 +10642,7 @@
|
---|
| 940 | # ifdef FEAT_WINDOWS
|
---|
| 941 | win_T *wp;
|
---|
| 942 | # endif
|
---|
| 943 | - int n = 1;
|
---|
| 944 | + int winnr = 1;
|
---|
| 945 |
|
---|
| 946 | if (row >= 0 && col >= 0)
|
---|
| 947 | {
|
---|
| 948 | @@ -10612,9 +10652,9 @@
|
---|
| 949 | (void)mouse_comp_pos(win, &row, &col, &lnum);
|
---|
| 950 | # ifdef FEAT_WINDOWS
|
---|
| 951 | for (wp = firstwin; wp != win; wp = wp->w_next)
|
---|
| 952 | - ++n;
|
---|
| 953 | + ++winnr;
|
---|
| 954 | # endif
|
---|
| 955 | - vimvars[VV_MOUSE_WIN].vv_nr = n;
|
---|
| 956 | + vimvars[VV_MOUSE_WIN].vv_nr = winnr;
|
---|
| 957 | vimvars[VV_MOUSE_LNUM].vv_nr = lnum;
|
---|
| 958 | vimvars[VV_MOUSE_COL].vv_nr = col + 1;
|
---|
| 959 | }
|
---|
| 960 | @@ -11284,13 +11324,25 @@
|
---|
| 961 | typval_T *argvars;
|
---|
| 962 | typval_T *rettv;
|
---|
| 963 | {
|
---|
| 964 | + int flags = WILD_SILENT|WILD_USE_NL;
|
---|
| 965 | expand_T xpc;
|
---|
| 966 | + int error = FALSE;
|
---|
| 967 |
|
---|
| 968 | - ExpandInit(&xpc);
|
---|
| 969 | - xpc.xp_context = EXPAND_FILES;
|
---|
| 970 | + /* When the optional second argument is non-zero, don't remove matches
|
---|
| 971 | + * for 'wildignore' and don't put matches for 'suffixes' at the end. */
|
---|
| 972 | + if (argvars[1].v_type != VAR_UNKNOWN
|
---|
| 973 | + && get_tv_number_chk(&argvars[1], &error))
|
---|
| 974 | + flags |= WILD_KEEP_ALL;
|
---|
| 975 | rettv->v_type = VAR_STRING;
|
---|
| 976 | - rettv->vval.v_string = ExpandOne(&xpc, get_tv_string(&argvars[0]),
|
---|
| 977 | - NULL, WILD_USE_NL|WILD_SILENT, WILD_ALL);
|
---|
| 978 | + if (!error)
|
---|
| 979 | + {
|
---|
| 980 | + ExpandInit(&xpc);
|
---|
| 981 | + xpc.xp_context = EXPAND_FILES;
|
---|
| 982 | + rettv->vval.v_string = ExpandOne(&xpc, get_tv_string(&argvars[0]),
|
---|
| 983 | + NULL, flags, WILD_ALL);
|
---|
| 984 | + }
|
---|
| 985 | + else
|
---|
| 986 | + rettv->vval.v_string = NULL;
|
---|
| 987 | }
|
---|
| 988 |
|
---|
| 989 | /*
|
---|
| 990 | @@ -11301,14 +11353,22 @@
|
---|
| 991 | typval_T *argvars;
|
---|
| 992 | typval_T *rettv;
|
---|
| 993 | {
|
---|
| 994 | + int flags = 0;
|
---|
| 995 | char_u buf1[NUMBUFLEN];
|
---|
| 996 | char_u *file = get_tv_string_buf_chk(&argvars[1], buf1);
|
---|
| 997 | + int error = FALSE;
|
---|
| 998 |
|
---|
| 999 | + /* When the optional second argument is non-zero, don't remove matches
|
---|
| 1000 | + * for 'wildignore' and don't put matches for 'suffixes' at the end. */
|
---|
| 1001 | + if (argvars[2].v_type != VAR_UNKNOWN
|
---|
| 1002 | + && get_tv_number_chk(&argvars[2], &error))
|
---|
| 1003 | + flags |= WILD_KEEP_ALL;
|
---|
| 1004 | rettv->v_type = VAR_STRING;
|
---|
| 1005 | - if (file == NULL)
|
---|
| 1006 | + if (file == NULL || error)
|
---|
| 1007 | rettv->vval.v_string = NULL;
|
---|
| 1008 | else
|
---|
| 1009 | - rettv->vval.v_string = globpath(get_tv_string(&argvars[0]), file);
|
---|
| 1010 | + rettv->vval.v_string = globpath(get_tv_string(&argvars[0]), file,
|
---|
| 1011 | + flags);
|
---|
| 1012 | }
|
---|
| 1013 |
|
---|
| 1014 | /*
|
---|
| 1015 | @@ -11782,6 +11842,10 @@
|
---|
| 1016 | n = has_patch(atoi((char *)name + 5));
|
---|
| 1017 | else if (STRICMP(name, "vim_starting") == 0)
|
---|
| 1018 | n = (starting != 0);
|
---|
| 1019 | +#ifdef FEAT_MBYTE
|
---|
| 1020 | + else if (STRICMP(name, "multi_byte_encoding") == 0)
|
---|
| 1021 | + n = has_mbyte;
|
---|
| 1022 | +#endif
|
---|
| 1023 | #if defined(FEAT_BEVAL) && defined(FEAT_GUI_W32)
|
---|
| 1024 | else if (STRICMP(name, "balloon_multiline") == 0)
|
---|
| 1025 | n = multiline_balloon_available();
|
---|
| 1026 | @@ -15838,10 +15902,9 @@
|
---|
| 1027 | if (res == FAIL)
|
---|
| 1028 | res = ITEM_COMPARE_FAIL;
|
---|
| 1029 | else
|
---|
| 1030 | - /* return value has wrong type */
|
---|
| 1031 | res = get_tv_number_chk(&rettv, &item_compare_func_err);
|
---|
| 1032 | if (item_compare_func_err)
|
---|
| 1033 | - res = ITEM_COMPARE_FAIL;
|
---|
| 1034 | + res = ITEM_COMPARE_FAIL; /* return value has wrong type */
|
---|
| 1035 | clear_tv(&rettv);
|
---|
| 1036 | return res;
|
---|
| 1037 | }
|
---|
| 1038 | @@ -16590,8 +16653,11 @@
|
---|
| 1039 | p = highlight_has_attr(id, HL_INVERSE, modec);
|
---|
| 1040 | break;
|
---|
| 1041 |
|
---|
| 1042 | - case 's': /* standout */
|
---|
| 1043 | - p = highlight_has_attr(id, HL_STANDOUT, modec);
|
---|
| 1044 | + case 's':
|
---|
| 1045 | + if (TOLOWER_ASC(what[1]) == 'p') /* sp[#] */
|
---|
| 1046 | + p = highlight_color(id, what, modec);
|
---|
| 1047 | + else /* standout */
|
---|
| 1048 | + p = highlight_has_attr(id, HL_STANDOUT, modec);
|
---|
| 1049 | break;
|
---|
| 1050 |
|
---|
| 1051 | case 'u':
|
---|
| 1052 | @@ -16658,7 +16724,7 @@
|
---|
| 1053 | col = get_tv_number(&argvars[1]) - 1; /* -1 on type error */
|
---|
| 1054 |
|
---|
| 1055 | if (lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count
|
---|
| 1056 | - && col >= 0 && col < (long)STRLEN(ml_get(lnum))
|
---|
| 1057 | + && col >= 0 && (col == 0 || col < (long)STRLEN(ml_get(lnum)))
|
---|
| 1058 | && rettv_list_alloc(rettv) != FAIL)
|
---|
| 1059 | {
|
---|
| 1060 | (void)syn_get_id(curwin, lnum, (colnr_T)col, FALSE, NULL, TRUE);
|
---|
| 1061 | @@ -18097,14 +18163,28 @@
|
---|
| 1062 | }
|
---|
| 1063 |
|
---|
| 1064 | /*
|
---|
| 1065 | - * Set v:count, v:count1 and v:prevcount.
|
---|
| 1066 | + * Get List v: variable value. Caller must take care of reference count when
|
---|
| 1067 | + * needed.
|
---|
| 1068 | + */
|
---|
| 1069 | + list_T *
|
---|
| 1070 | +get_vim_var_list(idx)
|
---|
| 1071 | + int idx;
|
---|
| 1072 | +{
|
---|
| 1073 | + return vimvars[idx].vv_list;
|
---|
| 1074 | +}
|
---|
| 1075 | +
|
---|
| 1076 | +/*
|
---|
| 1077 | + * Set v:count to "count" and v:count1 to "count1".
|
---|
| 1078 | + * When "set_prevcount" is TRUE first set v:prevcount from v:count.
|
---|
| 1079 | */
|
---|
| 1080 | void
|
---|
| 1081 | -set_vcount(count, count1)
|
---|
| 1082 | +set_vcount(count, count1, set_prevcount)
|
---|
| 1083 | long count;
|
---|
| 1084 | long count1;
|
---|
| 1085 | + int set_prevcount;
|
---|
| 1086 | {
|
---|
| 1087 | - vimvars[VV_PREVCOUNT].vv_nr = vimvars[VV_COUNT].vv_nr;
|
---|
| 1088 | + if (set_prevcount)
|
---|
| 1089 | + vimvars[VV_PREVCOUNT].vv_nr = vimvars[VV_COUNT].vv_nr;
|
---|
| 1090 | vimvars[VV_COUNT].vv_nr = count;
|
---|
| 1091 | vimvars[VV_COUNT1].vv_nr = count1;
|
---|
| 1092 | }
|
---|
| 1093 | @@ -18132,6 +18212,20 @@
|
---|
| 1094 | }
|
---|
| 1095 |
|
---|
| 1096 | /*
|
---|
| 1097 | + * Set List v: variable to "val".
|
---|
| 1098 | + */
|
---|
| 1099 | + void
|
---|
| 1100 | +set_vim_var_list(idx, val)
|
---|
| 1101 | + int idx;
|
---|
| 1102 | + list_T *val;
|
---|
| 1103 | +{
|
---|
| 1104 | + list_unref(vimvars[idx].vv_list);
|
---|
| 1105 | + vimvars[idx].vv_list = val;
|
---|
| 1106 | + if (val != NULL)
|
---|
| 1107 | + ++val->lv_refcount;
|
---|
| 1108 | +}
|
---|
| 1109 | +
|
---|
| 1110 | +/*
|
---|
| 1111 | * Set v:register if needed.
|
---|
| 1112 | */
|
---|
| 1113 | void
|
---|
| 1114 | @@ -20590,6 +20684,9 @@
|
---|
| 1115 | int st_len = 0;
|
---|
| 1116 |
|
---|
| 1117 | todo = (int)func_hashtab.ht_used;
|
---|
| 1118 | + if (todo == 0)
|
---|
| 1119 | + return; /* nothing to dump */
|
---|
| 1120 | +
|
---|
| 1121 | sorttab = (ufunc_T **)alloc((unsigned)(sizeof(ufunc_T) * todo));
|
---|
| 1122 |
|
---|
| 1123 | for (hi = func_hashtab.ht_array; todo > 0; ++hi)
|
---|
| 1124 | @@ -20638,6 +20735,8 @@
|
---|
| 1125 | prof_self_cmp);
|
---|
| 1126 | prof_sort_list(fd, sorttab, st_len, "SELF", TRUE);
|
---|
| 1127 | }
|
---|
| 1128 | +
|
---|
| 1129 | + vim_free(sorttab);
|
---|
| 1130 | }
|
---|
| 1131 |
|
---|
| 1132 | static void
|
---|
| 1133 | @@ -21082,8 +21181,11 @@
|
---|
| 1134 | init_var_dict(&fc.l_avars, &fc.l_avars_var);
|
---|
| 1135 | add_nr_var(&fc.l_avars, &fc.fixvar[fixvar_idx++].var, "0",
|
---|
| 1136 | (varnumber_T)(argcount - fp->uf_args.ga_len));
|
---|
| 1137 | + /* Use "name" to avoid a warning from some compiler that checks the
|
---|
| 1138 | + * destination size. */
|
---|
| 1139 | v = &fc.fixvar[fixvar_idx++].var;
|
---|
| 1140 | - STRCPY(v->di_key, "000");
|
---|
| 1141 | + name = v->di_key;
|
---|
| 1142 | + STRCPY(name, "000");
|
---|
| 1143 | v->di_flags = DI_FLAGS_RO | DI_FLAGS_FIX;
|
---|
| 1144 | hash_add(&fc.l_avars.dv_hashtab, DI2HIKEY(v));
|
---|
| 1145 | v->di_tv.v_type = VAR_LIST;
|
---|
| 1146 | @@ -21204,7 +21306,7 @@
|
---|
| 1147 | if (!fp->uf_profiling && has_profiling(FALSE, fp->uf_name, NULL))
|
---|
| 1148 | func_do_profile(fp);
|
---|
| 1149 | if (fp->uf_profiling
|
---|
| 1150 | - || (fc.caller != NULL && &fc.caller->func->uf_profiling))
|
---|
| 1151 | + || (fc.caller != NULL && fc.caller->func->uf_profiling))
|
---|
| 1152 | {
|
---|
| 1153 | ++fp->uf_tm_count;
|
---|
| 1154 | profile_start(&call_start);
|
---|
| 1155 | @@ -21235,13 +21337,13 @@
|
---|
| 1156 |
|
---|
| 1157 | #ifdef FEAT_PROFILE
|
---|
| 1158 | if (do_profiling == PROF_YES && (fp->uf_profiling
|
---|
| 1159 | - || (fc.caller != NULL && &fc.caller->func->uf_profiling)))
|
---|
| 1160 | + || (fc.caller != NULL && fc.caller->func->uf_profiling)))
|
---|
| 1161 | {
|
---|
| 1162 | profile_end(&call_start);
|
---|
| 1163 | profile_sub_wait(&wait_start, &call_start);
|
---|
| 1164 | profile_add(&fp->uf_tm_total, &call_start);
|
---|
| 1165 | profile_self(&fp->uf_tm_self, &call_start, &fp->uf_tm_children);
|
---|
| 1166 | - if (fc.caller != NULL && &fc.caller->func->uf_profiling)
|
---|
| 1167 | + if (fc.caller != NULL && fc.caller->func->uf_profiling)
|
---|
| 1168 | {
|
---|
| 1169 | profile_add(&fc.caller->func->uf_tm_children, &call_start);
|
---|
| 1170 | profile_add(&fc.caller->func->uf_tml_children, &call_start);
|
---|
| 1171 | @@ -21886,6 +21988,62 @@
|
---|
| 1172 | }
|
---|
| 1173 | }
|
---|
| 1174 |
|
---|
| 1175 | +/*
|
---|
| 1176 | + * List v:oldfiles in a nice way.
|
---|
| 1177 | + */
|
---|
| 1178 | +/*ARGSUSED*/
|
---|
| 1179 | + void
|
---|
| 1180 | +ex_oldfiles(eap)
|
---|
| 1181 | + exarg_T *eap;
|
---|
| 1182 | +{
|
---|
| 1183 | + list_T *l = vimvars[VV_OLDFILES].vv_list;
|
---|
| 1184 | + listitem_T *li;
|
---|
| 1185 | + int nr = 0;
|
---|
| 1186 | +
|
---|
| 1187 | + if (l == NULL)
|
---|
| 1188 | + msg((char_u *)_("No old files"));
|
---|
| 1189 | + else
|
---|
| 1190 | + {
|
---|
| 1191 | + msg_start();
|
---|
| 1192 | + msg_scroll = TRUE;
|
---|
| 1193 | + for (li = l->lv_first; li != NULL && !got_int; li = li->li_next)
|
---|
| 1194 | + {
|
---|
| 1195 | + msg_outnum((long)++nr);
|
---|
| 1196 | + MSG_PUTS(": ");
|
---|
| 1197 | + msg_outtrans(get_tv_string(&li->li_tv));
|
---|
| 1198 | + msg_putchar('\n');
|
---|
| 1199 | + out_flush(); /* output one line at a time */
|
---|
| 1200 | + ui_breakcheck();
|
---|
| 1201 | + }
|
---|
| 1202 | + /* Assume "got_int" was set to truncate the listing. */
|
---|
| 1203 | + got_int = FALSE;
|
---|
| 1204 | +
|
---|
| 1205 | +#ifdef FEAT_BROWSE_CMD
|
---|
| 1206 | + if (cmdmod.browse)
|
---|
| 1207 | + {
|
---|
| 1208 | + quit_more = FALSE;
|
---|
| 1209 | + nr = prompt_for_number(FALSE);
|
---|
| 1210 | + msg_starthere();
|
---|
| 1211 | + if (nr > 0)
|
---|
| 1212 | + {
|
---|
| 1213 | + char_u *p = list_find_str(get_vim_var_list(VV_OLDFILES),
|
---|
| 1214 | + (long)nr);
|
---|
| 1215 | +
|
---|
| 1216 | + if (p != NULL)
|
---|
| 1217 | + {
|
---|
| 1218 | + p = expand_env_save(p);
|
---|
| 1219 | + eap->arg = p;
|
---|
| 1220 | + eap->cmdidx = CMD_edit;
|
---|
| 1221 | + cmdmod.browse = FALSE;
|
---|
| 1222 | + do_exedit(eap, NULL);
|
---|
| 1223 | + vim_free(p);
|
---|
| 1224 | + }
|
---|
| 1225 | + }
|
---|
| 1226 | + }
|
---|
| 1227 | +#endif
|
---|
| 1228 | + }
|
---|
| 1229 | +}
|
---|
| 1230 | +
|
---|
| 1231 | #endif /* FEAT_EVAL */
|
---|
| 1232 |
|
---|
| 1233 |
|
---|
| 1234 | diff -Naur vim72.orig/src/ex_cmds.c vim72/src/ex_cmds.c
|
---|
| 1235 | --- vim72.orig/src/ex_cmds.c 2008-08-04 12:15:00.000000000 -0700
|
---|
| 1236 | +++ vim72/src/ex_cmds.c 2008-12-20 15:02:13.000000000 -0800
|
---|
| 1237 | @@ -24,7 +24,7 @@
|
---|
| 1238 | static void do_filter __ARGS((linenr_T line1, linenr_T line2, exarg_T *eap, char_u *cmd, int do_in, int do_out));
|
---|
| 1239 | #ifdef FEAT_VIMINFO
|
---|
| 1240 | static char_u *viminfo_filename __ARGS((char_u *));
|
---|
| 1241 | -static void do_viminfo __ARGS((FILE *fp_in, FILE *fp_out, int want_info, int want_marks, int force_read));
|
---|
| 1242 | +static void do_viminfo __ARGS((FILE *fp_in, FILE *fp_out, int flags));
|
---|
| 1243 | static int viminfo_encoding __ARGS((vir_T *virp));
|
---|
| 1244 | static int read_viminfo_up_to_marks __ARGS((vir_T *virp, int forceit, int writing));
|
---|
| 1245 | #endif
|
---|
| 1246 | @@ -1676,14 +1676,12 @@
|
---|
| 1247 |
|
---|
| 1248 | /*
|
---|
| 1249 | * read_viminfo() -- Read the viminfo file. Registers etc. which are already
|
---|
| 1250 | - * set are not over-written unless force is TRUE. -- webb
|
---|
| 1251 | + * set are not over-written unless "flags" includes VIF_FORCEIT. -- webb
|
---|
| 1252 | */
|
---|
| 1253 | int
|
---|
| 1254 | -read_viminfo(file, want_info, want_marks, forceit)
|
---|
| 1255 | - char_u *file;
|
---|
| 1256 | - int want_info;
|
---|
| 1257 | - int want_marks;
|
---|
| 1258 | - int forceit;
|
---|
| 1259 | +read_viminfo(file, flags)
|
---|
| 1260 | + char_u *file; /* file name or NULL to use default name */
|
---|
| 1261 | + int flags; /* VIF_WANT_INFO et al. */
|
---|
| 1262 | {
|
---|
| 1263 | FILE *fp;
|
---|
| 1264 | char_u *fname;
|
---|
| 1265 | @@ -1691,7 +1689,7 @@
|
---|
| 1266 | if (no_viminfo())
|
---|
| 1267 | return FAIL;
|
---|
| 1268 |
|
---|
| 1269 | - fname = viminfo_filename(file); /* may set to default if NULL */
|
---|
| 1270 | + fname = viminfo_filename(file); /* get file name in allocated buffer */
|
---|
| 1271 | if (fname == NULL)
|
---|
| 1272 | return FAIL;
|
---|
| 1273 | fp = mch_fopen((char *)fname, READBIN);
|
---|
| 1274 | @@ -1701,8 +1699,9 @@
|
---|
| 1275 | verbose_enter();
|
---|
| 1276 | smsg((char_u *)_("Reading viminfo file \"%s\"%s%s%s"),
|
---|
| 1277 | fname,
|
---|
| 1278 | - want_info ? _(" info") : "",
|
---|
| 1279 | - want_marks ? _(" marks") : "",
|
---|
| 1280 | + (flags & VIF_WANT_INFO) ? _(" info") : "",
|
---|
| 1281 | + (flags & VIF_WANT_MARKS) ? _(" marks") : "",
|
---|
| 1282 | + (flags & VIF_GET_OLDFILES) ? _(" oldfiles") : "",
|
---|
| 1283 | fp == NULL ? _(" FAILED") : "");
|
---|
| 1284 | verbose_leave();
|
---|
| 1285 | }
|
---|
| 1286 | @@ -1712,10 +1711,9 @@
|
---|
| 1287 | return FAIL;
|
---|
| 1288 |
|
---|
| 1289 | viminfo_errcnt = 0;
|
---|
| 1290 | - do_viminfo(fp, NULL, want_info, want_marks, forceit);
|
---|
| 1291 | + do_viminfo(fp, NULL, flags);
|
---|
| 1292 |
|
---|
| 1293 | fclose(fp);
|
---|
| 1294 | -
|
---|
| 1295 | return OK;
|
---|
| 1296 | }
|
---|
| 1297 |
|
---|
| 1298 | @@ -1943,7 +1941,7 @@
|
---|
| 1299 | * root.
|
---|
| 1300 | */
|
---|
| 1301 | if (fp_out != NULL)
|
---|
| 1302 | - (void)fchown(fileno(fp_out), st_old.st_uid, st_old.st_gid);
|
---|
| 1303 | + ignored = fchown(fileno(fp_out), st_old.st_uid, st_old.st_gid);
|
---|
| 1304 | #endif
|
---|
| 1305 | }
|
---|
| 1306 | }
|
---|
| 1307 | @@ -1968,7 +1966,7 @@
|
---|
| 1308 | }
|
---|
| 1309 |
|
---|
| 1310 | viminfo_errcnt = 0;
|
---|
| 1311 | - do_viminfo(fp_in, fp_out, !forceit, !forceit, FALSE);
|
---|
| 1312 | + do_viminfo(fp_in, fp_out, forceit ? 0 : (VIF_WANT_INFO | VIF_WANT_MARKS));
|
---|
| 1313 |
|
---|
| 1314 | fclose(fp_out); /* errors are ignored !? */
|
---|
| 1315 | if (fp_in != NULL)
|
---|
| 1316 | @@ -2041,12 +2039,10 @@
|
---|
| 1317 | * do_viminfo() -- Should only be called from read_viminfo() & write_viminfo().
|
---|
| 1318 | */
|
---|
| 1319 | static void
|
---|
| 1320 | -do_viminfo(fp_in, fp_out, want_info, want_marks, force_read)
|
---|
| 1321 | +do_viminfo(fp_in, fp_out, flags)
|
---|
| 1322 | FILE *fp_in;
|
---|
| 1323 | FILE *fp_out;
|
---|
| 1324 | - int want_info;
|
---|
| 1325 | - int want_marks;
|
---|
| 1326 | - int force_read;
|
---|
| 1327 | + int flags;
|
---|
| 1328 | {
|
---|
| 1329 | int count = 0;
|
---|
| 1330 | int eof = FALSE;
|
---|
| 1331 | @@ -2061,8 +2057,9 @@
|
---|
| 1332 |
|
---|
| 1333 | if (fp_in != NULL)
|
---|
| 1334 | {
|
---|
| 1335 | - if (want_info)
|
---|
| 1336 | - eof = read_viminfo_up_to_marks(&vir, force_read, fp_out != NULL);
|
---|
| 1337 | + if (flags & VIF_WANT_INFO)
|
---|
| 1338 | + eof = read_viminfo_up_to_marks(&vir,
|
---|
| 1339 | + flags & VIF_FORCEIT, fp_out != NULL);
|
---|
| 1340 | else
|
---|
| 1341 | /* Skip info, find start of marks */
|
---|
| 1342 | while (!(eof = viminfo_readline(&vir))
|
---|
| 1343 | @@ -2092,8 +2089,9 @@
|
---|
| 1344 | write_viminfo_bufferlist(fp_out);
|
---|
| 1345 | count = write_viminfo_marks(fp_out);
|
---|
| 1346 | }
|
---|
| 1347 | - if (fp_in != NULL && want_marks)
|
---|
| 1348 | - copy_viminfo_marks(&vir, fp_out, count, eof);
|
---|
| 1349 | + if (fp_in != NULL
|
---|
| 1350 | + && (flags & (VIF_WANT_MARKS | VIF_GET_OLDFILES | VIF_FORCEIT)))
|
---|
| 1351 | + copy_viminfo_marks(&vir, fp_out, count, eof, flags);
|
---|
| 1352 |
|
---|
| 1353 | vim_free(vir.vir_line);
|
---|
| 1354 | #ifdef FEAT_MBYTE
|
---|
| 1355 | @@ -5059,6 +5057,7 @@
|
---|
| 1356 |
|
---|
| 1357 | if (did_sub)
|
---|
| 1358 | ++sub_nlines;
|
---|
| 1359 | + vim_free(new_start); /* for when substitute was cancelled */
|
---|
| 1360 | vim_free(sub_firstline); /* free the copy of the original line */
|
---|
| 1361 | sub_firstline = NULL;
|
---|
| 1362 | }
|
---|
| 1363 | diff -Naur vim72.orig/src/ex_cmds.h vim72/src/ex_cmds.h
|
---|
| 1364 | --- vim72.orig/src/ex_cmds.h 2008-06-21 11:47:57.000000000 -0700
|
---|
| 1365 | +++ vim72/src/ex_cmds.h 2008-12-20 15:01:04.000000000 -0800
|
---|
| 1366 | @@ -278,7 +278,7 @@
|
---|
| 1367 | EX(CMD_crewind, "crewind", ex_cc,
|
---|
| 1368 | RANGE|NOTADR|COUNT|TRLBAR|BANG),
|
---|
| 1369 | EX(CMD_cscope, "cscope", do_cscope,
|
---|
| 1370 | - EXTRA|NOTRLCOM|SBOXOK|XFILE),
|
---|
| 1371 | + EXTRA|NOTRLCOM|XFILE),
|
---|
| 1372 | EX(CMD_cstag, "cstag", do_cstag,
|
---|
| 1373 | BANG|TRLBAR|WORD1),
|
---|
| 1374 | EX(CMD_cunmap, "cunmap", ex_unmap,
|
---|
| 1375 | @@ -506,7 +506,7 @@
|
---|
| 1376 | EX(CMD_lclose, "lclose", ex_cclose,
|
---|
| 1377 | RANGE|NOTADR|COUNT|TRLBAR),
|
---|
| 1378 | EX(CMD_lcscope, "lcscope", do_cscope,
|
---|
| 1379 | - EXTRA|NOTRLCOM|SBOXOK|XFILE),
|
---|
| 1380 | + EXTRA|NOTRLCOM|XFILE),
|
---|
| 1381 | EX(CMD_left, "left", ex_align,
|
---|
| 1382 | TRLBAR|RANGE|WHOLEFOLD|EXTRA|CMDWIN|MODIFY),
|
---|
| 1383 | EX(CMD_leftabove, "leftabove", ex_wrongmodifier,
|
---|
| 1384 | @@ -635,6 +635,8 @@
|
---|
| 1385 | RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
|
---|
| 1386 | EX(CMD_noremap, "noremap", ex_map,
|
---|
| 1387 | BANG|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
|
---|
| 1388 | +EX(CMD_noautocmd, "noautocmd", ex_wrongmodifier,
|
---|
| 1389 | + NEEDARG|EXTRA|NOTRLCOM),
|
---|
| 1390 | EX(CMD_nohlsearch, "nohlsearch", ex_nohlsearch,
|
---|
| 1391 | TRLBAR|SBOXOK|CMDWIN),
|
---|
| 1392 | EX(CMD_noreabbrev, "noreabbrev", ex_abbreviate,
|
---|
| 1393 | @@ -651,6 +653,8 @@
|
---|
| 1394 | EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
|
---|
| 1395 | EX(CMD_open, "open", ex_open,
|
---|
| 1396 | RANGE|EXTRA),
|
---|
| 1397 | +EX(CMD_oldfiles, "oldfiles", ex_oldfiles,
|
---|
| 1398 | + BANG|TRLBAR|SBOXOK|CMDWIN),
|
---|
| 1399 | EX(CMD_omap, "omap", ex_map,
|
---|
| 1400 | EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN),
|
---|
| 1401 | EX(CMD_omapclear, "omapclear", ex_mapclear,
|
---|
| 1402 | @@ -802,7 +806,7 @@
|
---|
| 1403 | EX(CMD_scriptencoding, "scriptencoding", ex_scriptencoding,
|
---|
| 1404 | WORD1|TRLBAR|CMDWIN),
|
---|
| 1405 | EX(CMD_scscope, "scscope", do_scscope,
|
---|
| 1406 | - EXTRA|NOTRLCOM|SBOXOK),
|
---|
| 1407 | + EXTRA|NOTRLCOM),
|
---|
| 1408 | EX(CMD_set, "set", ex_set,
|
---|
| 1409 | TRLBAR|EXTRA|CMDWIN|SBOXOK),
|
---|
| 1410 | EX(CMD_setfiletype, "setfiletype", ex_setfiletype,
|
---|
| 1411 | diff -Naur vim72.orig/src/ex_cmds2.c vim72/src/ex_cmds2.c
|
---|
| 1412 | --- vim72.orig/src/ex_cmds2.c 2008-07-13 09:18:22.000000000 -0700
|
---|
| 1413 | +++ vim72/src/ex_cmds2.c 2008-12-20 15:00:13.000000000 -0800
|
---|
| 1414 | @@ -3145,8 +3145,8 @@
|
---|
| 1415 | verbose_leave();
|
---|
| 1416 | }
|
---|
| 1417 | #ifdef STARTUPTIME
|
---|
| 1418 | - vim_snprintf(IObuff, IOSIZE, "sourcing %s", fname);
|
---|
| 1419 | - time_msg(IObuff, &tv_start);
|
---|
| 1420 | + vim_snprintf((char *)IObuff, IOSIZE, "sourcing %s", fname);
|
---|
| 1421 | + time_msg((char *)IObuff, &tv_start);
|
---|
| 1422 | time_pop(&tv_rel);
|
---|
| 1423 | #endif
|
---|
| 1424 |
|
---|
| 1425 | diff -Naur vim72.orig/src/ex_docmd.c vim72/src/ex_docmd.c
|
---|
| 1426 | --- vim72.orig/src/ex_docmd.c 2008-07-26 04:51:05.000000000 -0700
|
---|
| 1427 | +++ vim72/src/ex_docmd.c 2008-12-20 15:02:47.000000000 -0800
|
---|
| 1428 | @@ -364,6 +364,7 @@
|
---|
| 1429 | # define ex_function ex_ni
|
---|
| 1430 | # define ex_delfunction ex_ni
|
---|
| 1431 | # define ex_return ex_ni
|
---|
| 1432 | +# define ex_oldfiles ex_ni
|
---|
| 1433 | #endif
|
---|
| 1434 | static char_u *arg_all __ARGS((void));
|
---|
| 1435 | #ifdef FEAT_SESSION
|
---|
| 1436 | @@ -1770,7 +1771,7 @@
|
---|
| 1437 | }
|
---|
| 1438 | if (checkforcmd(&ea.cmd, "browse", 3))
|
---|
| 1439 | {
|
---|
| 1440 | -#ifdef FEAT_BROWSE
|
---|
| 1441 | +#ifdef FEAT_BROWSE_CMD
|
---|
| 1442 | cmdmod.browse = TRUE;
|
---|
| 1443 | #endif
|
---|
| 1444 | continue;
|
---|
| 1445 | @@ -2978,6 +2979,7 @@
|
---|
| 1446 | {"keepmarks", 3, FALSE},
|
---|
| 1447 | {"leftabove", 5, FALSE},
|
---|
| 1448 | {"lockmarks", 3, FALSE},
|
---|
| 1449 | + {"noautocmd", 3, FALSE},
|
---|
| 1450 | {"rightbelow", 6, FALSE},
|
---|
| 1451 | {"sandbox", 3, FALSE},
|
---|
| 1452 | {"silent", 3, FALSE},
|
---|
| 1453 | @@ -3608,6 +3610,7 @@
|
---|
| 1454 | return set_context_in_autocmd(xp, arg, FALSE);
|
---|
| 1455 |
|
---|
| 1456 | case CMD_doautocmd:
|
---|
| 1457 | + case CMD_doautoall:
|
---|
| 1458 | return set_context_in_autocmd(xp, arg, TRUE);
|
---|
| 1459 | #endif
|
---|
| 1460 | case CMD_set:
|
---|
| 1461 | @@ -8749,8 +8752,8 @@
|
---|
| 1462 | else if (*dirnow != NUL
|
---|
| 1463 | && (ssop_flags & SSOP_CURDIR) && globaldir != NULL)
|
---|
| 1464 | {
|
---|
| 1465 | - (void)mch_chdir((char *)globaldir);
|
---|
| 1466 | - shorten_fnames(TRUE);
|
---|
| 1467 | + if (mch_chdir((char *)globaldir) == OK)
|
---|
| 1468 | + shorten_fnames(TRUE);
|
---|
| 1469 | }
|
---|
| 1470 |
|
---|
| 1471 | failed |= (makeopens(fd, dirnow) == FAIL);
|
---|
| 1472 | @@ -9506,24 +9509,50 @@
|
---|
| 1473 | break;
|
---|
| 1474 | }
|
---|
| 1475 | s = src + 1;
|
---|
| 1476 | + if (*s == '<') /* "#<99" uses v:oldfiles */
|
---|
| 1477 | + ++s;
|
---|
| 1478 | i = (int)getdigits(&s);
|
---|
| 1479 | *usedlen = (int)(s - src); /* length of what we expand */
|
---|
| 1480 |
|
---|
| 1481 | - buf = buflist_findnr(i);
|
---|
| 1482 | - if (buf == NULL)
|
---|
| 1483 | + if (src[1] == '<')
|
---|
| 1484 | {
|
---|
| 1485 | - *errormsg = (char_u *)_("E194: No alternate file name to substitute for '#'");
|
---|
| 1486 | + if (*usedlen < 2)
|
---|
| 1487 | + {
|
---|
| 1488 | + /* Should we give an error message for #<text? */
|
---|
| 1489 | + *usedlen = 1;
|
---|
| 1490 | + return NULL;
|
---|
| 1491 | + }
|
---|
| 1492 | +#ifdef FEAT_EVAL
|
---|
| 1493 | + result = list_find_str(get_vim_var_list(VV_OLDFILES),
|
---|
| 1494 | + (long)i);
|
---|
| 1495 | + if (result == NULL)
|
---|
| 1496 | + {
|
---|
| 1497 | + *errormsg = (char_u *)"";
|
---|
| 1498 | + return NULL;
|
---|
| 1499 | + }
|
---|
| 1500 | +#else
|
---|
| 1501 | + *errormsg = (char_u *)_("E809: #< is not available without the +eval feature");
|
---|
| 1502 | return NULL;
|
---|
| 1503 | +#endif
|
---|
| 1504 | }
|
---|
| 1505 | - if (lnump != NULL)
|
---|
| 1506 | - *lnump = ECMD_LAST;
|
---|
| 1507 | - if (buf->b_fname == NULL)
|
---|
| 1508 | + else
|
---|
| 1509 | {
|
---|
| 1510 | - result = (char_u *)"";
|
---|
| 1511 | - valid = 0; /* Must have ":p:h" to be valid */
|
---|
| 1512 | + buf = buflist_findnr(i);
|
---|
| 1513 | + if (buf == NULL)
|
---|
| 1514 | + {
|
---|
| 1515 | + *errormsg = (char_u *)_("E194: No alternate file name to substitute for '#'");
|
---|
| 1516 | + return NULL;
|
---|
| 1517 | + }
|
---|
| 1518 | + if (lnump != NULL)
|
---|
| 1519 | + *lnump = ECMD_LAST;
|
---|
| 1520 | + if (buf->b_fname == NULL)
|
---|
| 1521 | + {
|
---|
| 1522 | + result = (char_u *)"";
|
---|
| 1523 | + valid = 0; /* Must have ":p:h" to be valid */
|
---|
| 1524 | + }
|
---|
| 1525 | + else
|
---|
| 1526 | + result = buf->b_fname;
|
---|
| 1527 | }
|
---|
| 1528 | - else
|
---|
| 1529 | - result = buf->b_fname;
|
---|
| 1530 | break;
|
---|
| 1531 |
|
---|
| 1532 | #ifdef FEAT_SEARCHPATH
|
---|
| 1533 | @@ -9541,6 +9570,15 @@
|
---|
| 1534 | #ifdef FEAT_AUTOCMD
|
---|
| 1535 | case SPEC_AFILE: /* file name for autocommand */
|
---|
| 1536 | result = autocmd_fname;
|
---|
| 1537 | + if (result != NULL && !autocmd_fname_full)
|
---|
| 1538 | + {
|
---|
| 1539 | + /* Still need to turn the fname into a full path. It is
|
---|
| 1540 | + * postponed to avoid a delay when <afile> is not used. */
|
---|
| 1541 | + autocmd_fname_full = TRUE;
|
---|
| 1542 | + result = FullName_save(autocmd_fname, FALSE);
|
---|
| 1543 | + vim_free(autocmd_fname);
|
---|
| 1544 | + autocmd_fname = result;
|
---|
| 1545 | + }
|
---|
| 1546 | if (result == NULL)
|
---|
| 1547 | {
|
---|
| 1548 | *errormsg = (char_u *)_("E495: no autocommand file name to substitute for \"<afile>\"");
|
---|
| 1549 | @@ -10067,7 +10105,7 @@
|
---|
| 1550 | */
|
---|
| 1551 | if (put_line(fd, "let s:sx = expand(\"<sfile>:p:r\").\"x.vim\"") == FAIL
|
---|
| 1552 | || put_line(fd, "if file_readable(s:sx)") == FAIL
|
---|
| 1553 | - || put_line(fd, " exe \"source \" . s:sx") == FAIL
|
---|
| 1554 | + || put_line(fd, " exe \"source \" . fnameescape(s:sx)") == FAIL
|
---|
| 1555 | || put_line(fd, "endif") == FAIL)
|
---|
| 1556 | return FAIL;
|
---|
| 1557 |
|
---|
| 1558 | @@ -10689,7 +10727,8 @@
|
---|
| 1559 | p_viminfo = (char_u *)"'100";
|
---|
| 1560 | if (eap->cmdidx == CMD_rviminfo)
|
---|
| 1561 | {
|
---|
| 1562 | - if (read_viminfo(eap->arg, TRUE, TRUE, eap->forceit) == FAIL)
|
---|
| 1563 | + if (read_viminfo(eap->arg, VIF_WANT_INFO | VIF_WANT_MARKS
|
---|
| 1564 | + | (eap->forceit ? VIF_FORCEIT : 0)) == FAIL)
|
---|
| 1565 | EMSG(_("E195: Cannot open viminfo file for reading"));
|
---|
| 1566 | }
|
---|
| 1567 | else
|
---|
| 1568 | diff -Naur vim72.orig/src/ex_getln.c vim72/src/ex_getln.c
|
---|
| 1569 | --- vim72.orig/src/ex_getln.c 2008-08-08 02:31:33.000000000 -0700
|
---|
| 1570 | +++ vim72/src/ex_getln.c 2008-12-20 15:02:01.000000000 -0800
|
---|
| 1571 | @@ -31,6 +31,8 @@
|
---|
| 1572 | int cmdattr; /* attributes for prompt */
|
---|
| 1573 | int overstrike; /* Typing mode on the command line. Shared by
|
---|
| 1574 | getcmdline() and put_on_cmdline(). */
|
---|
| 1575 | + expand_T *xpc; /* struct being used for expansion, xp_pattern
|
---|
| 1576 | + may point into cmdbuff */
|
---|
| 1577 | int xp_context; /* type of expansion */
|
---|
| 1578 | # ifdef FEAT_EVAL
|
---|
| 1579 | char_u *xp_arg; /* user-defined expansion arg */
|
---|
| 1580 | @@ -38,7 +40,11 @@
|
---|
| 1581 | # endif
|
---|
| 1582 | };
|
---|
| 1583 |
|
---|
| 1584 | -static struct cmdline_info ccline; /* current cmdline_info */
|
---|
| 1585 | +/* The current cmdline_info. It is initialized in getcmdline() and after that
|
---|
| 1586 | + * used by other functions. When invoking getcmdline() recursively it needs
|
---|
| 1587 | + * to be saved with save_cmdline() and restored with restore_cmdline().
|
---|
| 1588 | + * TODO: make it local to getcmdline() and pass it around. */
|
---|
| 1589 | +static struct cmdline_info ccline;
|
---|
| 1590 |
|
---|
| 1591 | static int cmd_showtail; /* Only show path tail in lists ? */
|
---|
| 1592 |
|
---|
| 1593 | @@ -238,6 +244,7 @@
|
---|
| 1594 | }
|
---|
| 1595 |
|
---|
| 1596 | ExpandInit(&xpc);
|
---|
| 1597 | + ccline.xpc = &xpc;
|
---|
| 1598 |
|
---|
| 1599 | #ifdef FEAT_RIGHTLEFT
|
---|
| 1600 | if (curwin->w_p_rl && *curwin->w_p_rlc == 's'
|
---|
| 1601 | @@ -408,9 +415,10 @@
|
---|
| 1602 | #endif
|
---|
| 1603 |
|
---|
| 1604 | /*
|
---|
| 1605 | - * <S-Tab> works like CTRL-P (unless 'wc' is <S-Tab>).
|
---|
| 1606 | + * When there are matching completions to select <S-Tab> works like
|
---|
| 1607 | + * CTRL-P (unless 'wc' is <S-Tab>).
|
---|
| 1608 | */
|
---|
| 1609 | - if (c != p_wc && c == K_S_TAB && xpc.xp_numfiles != -1)
|
---|
| 1610 | + if (c != p_wc && c == K_S_TAB && xpc.xp_numfiles > 0)
|
---|
| 1611 | c = Ctrl_P;
|
---|
| 1612 |
|
---|
| 1613 | #ifdef FEAT_WILDMENU
|
---|
| 1614 | @@ -1513,6 +1521,7 @@
|
---|
| 1615 | int old_firstc;
|
---|
| 1616 |
|
---|
| 1617 | vim_free(ccline.cmdbuff);
|
---|
| 1618 | + xpc.xp_context = EXPAND_NOTHING;
|
---|
| 1619 | if (hiscnt == hislen)
|
---|
| 1620 | p = lookfor; /* back to the old one */
|
---|
| 1621 | else
|
---|
| 1622 | @@ -1839,6 +1848,7 @@
|
---|
| 1623 | #endif
|
---|
| 1624 |
|
---|
| 1625 | ExpandCleanup(&xpc);
|
---|
| 1626 | + ccline.xpc = NULL;
|
---|
| 1627 |
|
---|
| 1628 | #ifdef FEAT_SEARCH_EXTRA
|
---|
| 1629 | if (did_incsearch)
|
---|
| 1630 | @@ -2508,6 +2518,20 @@
|
---|
| 1631 | }
|
---|
| 1632 | mch_memmove(ccline.cmdbuff, p, (size_t)ccline.cmdlen + 1);
|
---|
| 1633 | vim_free(p);
|
---|
| 1634 | +
|
---|
| 1635 | + if (ccline.xpc != NULL
|
---|
| 1636 | + && ccline.xpc->xp_pattern != NULL
|
---|
| 1637 | + && ccline.xpc->xp_context != EXPAND_NOTHING
|
---|
| 1638 | + && ccline.xpc->xp_context != EXPAND_UNSUCCESSFUL)
|
---|
| 1639 | + {
|
---|
| 1640 | + int i = (int)(ccline.xpc->xp_pattern - p);
|
---|
| 1641 | +
|
---|
| 1642 | + /* If xp_pattern points inside the old cmdbuff it needs to be adjusted
|
---|
| 1643 | + * to point into the newly allocated memory. */
|
---|
| 1644 | + if (i >= 0 && i <= ccline.cmdlen)
|
---|
| 1645 | + ccline.xpc->xp_pattern = ccline.cmdbuff + i;
|
---|
| 1646 | + }
|
---|
| 1647 | +
|
---|
| 1648 | return OK;
|
---|
| 1649 | }
|
---|
| 1650 |
|
---|
| 1651 | @@ -2875,6 +2899,7 @@
|
---|
| 1652 | prev_ccline = ccline;
|
---|
| 1653 | ccline.cmdbuff = NULL;
|
---|
| 1654 | ccline.cmdprompt = NULL;
|
---|
| 1655 | + ccline.xpc = NULL;
|
---|
| 1656 | }
|
---|
| 1657 |
|
---|
| 1658 | /*
|
---|
| 1659 | @@ -3582,6 +3607,7 @@
|
---|
| 1660 | ExpandInit(xp)
|
---|
| 1661 | expand_T *xp;
|
---|
| 1662 | {
|
---|
| 1663 | + xp->xp_pattern = NULL;
|
---|
| 1664 | xp->xp_backslash = XP_BS_NONE;
|
---|
| 1665 | #ifndef BACKSLASH_IN_FILENAME
|
---|
| 1666 | xp->xp_shell = FALSE;
|
---|
| 1667 | @@ -4871,7 +4897,7 @@
|
---|
| 1668 | if (s == NULL)
|
---|
| 1669 | return FAIL;
|
---|
| 1670 | sprintf((char *)s, "%s/%s*.vim", dirname, pat);
|
---|
| 1671 | - all = globpath(p_rtp, s);
|
---|
| 1672 | + all = globpath(p_rtp, s, 0);
|
---|
| 1673 | vim_free(s);
|
---|
| 1674 | if (all == NULL)
|
---|
| 1675 | return FAIL;
|
---|
| 1676 | @@ -4912,9 +4938,10 @@
|
---|
| 1677 | * newlines. Returns NULL for an error or no matches.
|
---|
| 1678 | */
|
---|
| 1679 | char_u *
|
---|
| 1680 | -globpath(path, file)
|
---|
| 1681 | +globpath(path, file, expand_options)
|
---|
| 1682 | char_u *path;
|
---|
| 1683 | char_u *file;
|
---|
| 1684 | + int expand_options;
|
---|
| 1685 | {
|
---|
| 1686 | expand_T xpc;
|
---|
| 1687 | char_u *buf;
|
---|
| 1688 | @@ -4943,10 +4970,10 @@
|
---|
| 1689 | {
|
---|
| 1690 | add_pathsep(buf);
|
---|
| 1691 | STRCAT(buf, file);
|
---|
| 1692 | - if (ExpandFromContext(&xpc, buf, &num_p, &p, WILD_SILENT) != FAIL
|
---|
| 1693 | - && num_p > 0)
|
---|
| 1694 | + if (ExpandFromContext(&xpc, buf, &num_p, &p,
|
---|
| 1695 | + WILD_SILENT|expand_options) != FAIL && num_p > 0)
|
---|
| 1696 | {
|
---|
| 1697 | - ExpandEscape(&xpc, buf, num_p, p, WILD_SILENT);
|
---|
| 1698 | + ExpandEscape(&xpc, buf, num_p, p, WILD_SILENT|expand_options);
|
---|
| 1699 | for (len = 0, i = 0; i < num_p; ++i)
|
---|
| 1700 | len += (int)STRLEN(p[i]) + 1;
|
---|
| 1701 |
|
---|
| 1702 | diff -Naur vim72.orig/src/feature.h vim72/src/feature.h
|
---|
| 1703 | --- vim72.orig/src/feature.h 2008-08-06 04:00:39.000000000 -0700
|
---|
| 1704 | +++ vim72/src/feature.h 2008-12-20 15:01:04.000000000 -0800
|
---|
| 1705 | @@ -767,9 +767,13 @@
|
---|
| 1706 |
|
---|
| 1707 | /*
|
---|
| 1708 | * +browse ":browse" command.
|
---|
| 1709 | + * or just the ":browse" command modifier
|
---|
| 1710 | */
|
---|
| 1711 | -#if defined(FEAT_NORMAL) && (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC))
|
---|
| 1712 | -# define FEAT_BROWSE
|
---|
| 1713 | +#if defined(FEAT_NORMAL)
|
---|
| 1714 | +# define FEAT_BROWSE_CMD
|
---|
| 1715 | +# if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MAC)
|
---|
| 1716 | +# define FEAT_BROWSE
|
---|
| 1717 | +# endif
|
---|
| 1718 | #endif
|
---|
| 1719 |
|
---|
| 1720 | /*
|
---|
| 1721 | diff -Naur vim72.orig/src/fileio.c vim72/src/fileio.c
|
---|
| 1722 | --- vim72.orig/src/fileio.c 2008-08-06 04:01:03.000000000 -0700
|
---|
| 1723 | +++ vim72/src/fileio.c 2008-12-20 15:02:13.000000000 -0800
|
---|
| 1724 | @@ -932,7 +932,10 @@
|
---|
| 1725 | else
|
---|
| 1726 | {
|
---|
| 1727 | if (eap != NULL && eap->force_ff != 0)
|
---|
| 1728 | + {
|
---|
| 1729 | fileformat = get_fileformat_force(curbuf, eap);
|
---|
| 1730 | + try_unix = try_dos = try_mac = FALSE;
|
---|
| 1731 | + }
|
---|
| 1732 | else if (curbuf->b_p_bin)
|
---|
| 1733 | fileformat = EOL_UNIX; /* binary: use Unix format */
|
---|
| 1734 | else if (*p_ffs == NUL)
|
---|
| 1735 | @@ -2211,7 +2214,7 @@
|
---|
| 1736 | {
|
---|
| 1737 | /* Use stderr for stdin, makes shell commands work. */
|
---|
| 1738 | close(0);
|
---|
| 1739 | - dup(2);
|
---|
| 1740 | + ignored = dup(2);
|
---|
| 1741 | }
|
---|
| 1742 | #endif
|
---|
| 1743 |
|
---|
| 1744 | @@ -2341,11 +2344,6 @@
|
---|
| 1745 | STRCAT(IObuff, _("[CR missing]"));
|
---|
| 1746 | c = TRUE;
|
---|
| 1747 | }
|
---|
| 1748 | - if (ff_error == EOL_MAC)
|
---|
| 1749 | - {
|
---|
| 1750 | - STRCAT(IObuff, _("[NL found]"));
|
---|
| 1751 | - c = TRUE;
|
---|
| 1752 | - }
|
---|
| 1753 | if (split)
|
---|
| 1754 | {
|
---|
| 1755 | STRCAT(IObuff, _("[long lines split]"));
|
---|
| 1756 | @@ -2711,7 +2709,7 @@
|
---|
| 1757 | {
|
---|
| 1758 | if (!curbuf->b_marks_read && get_viminfo_parameter('\'') > 0
|
---|
| 1759 | && curbuf->b_ffname != NULL)
|
---|
| 1760 | - read_viminfo(NULL, FALSE, TRUE, FALSE);
|
---|
| 1761 | + read_viminfo(NULL, VIF_WANT_MARKS);
|
---|
| 1762 |
|
---|
| 1763 | /* Always set b_marks_read; needed when 'viminfo' is changed to include
|
---|
| 1764 | * the ' parameter after opening a buffer. */
|
---|
| 1765 | @@ -3451,7 +3449,7 @@
|
---|
| 1766 | {
|
---|
| 1767 | # ifdef UNIX
|
---|
| 1768 | # ifdef HAVE_FCHOWN
|
---|
| 1769 | - fchown(fd, st_old.st_uid, st_old.st_gid);
|
---|
| 1770 | + ignored = fchown(fd, st_old.st_uid, st_old.st_gid);
|
---|
| 1771 | # endif
|
---|
| 1772 | if (mch_stat((char *)IObuff, &st) < 0
|
---|
| 1773 | || st.st_uid != st_old.st_uid
|
---|
| 1774 | @@ -4367,7 +4365,7 @@
|
---|
| 1775 | || st.st_uid != st_old.st_uid
|
---|
| 1776 | || st.st_gid != st_old.st_gid)
|
---|
| 1777 | {
|
---|
| 1778 | - fchown(fd, st_old.st_uid, st_old.st_gid);
|
---|
| 1779 | + ignored = fchown(fd, st_old.st_uid, st_old.st_gid);
|
---|
| 1780 | if (perm >= 0) /* set permission again, may have changed */
|
---|
| 1781 | (void)mch_setperm(wfname, perm);
|
---|
| 1782 | }
|
---|
| 1783 | @@ -5550,9 +5548,10 @@
|
---|
| 1784 | name = "ucs-4le"; /* FF FE 00 00 */
|
---|
| 1785 | len = 4;
|
---|
| 1786 | }
|
---|
| 1787 | - else if (flags == FIO_ALL || flags == (FIO_UCS2 | FIO_ENDIAN_L))
|
---|
| 1788 | + else if (flags == (FIO_UCS2 | FIO_ENDIAN_L))
|
---|
| 1789 | name = "ucs-2le"; /* FF FE */
|
---|
| 1790 | - else if (flags == (FIO_UTF16 | FIO_ENDIAN_L))
|
---|
| 1791 | + else if (flags == FIO_ALL || flags == (FIO_UTF16 | FIO_ENDIAN_L))
|
---|
| 1792 | + /* utf-16le is preferred, it also works for ucs-2le text */
|
---|
| 1793 | name = "utf-16le"; /* FF FE */
|
---|
| 1794 | }
|
---|
| 1795 | else if (p[0] == 0xfe && p[1] == 0xff
|
---|
| 1796 | @@ -6031,9 +6030,9 @@
|
---|
| 1797 | {
|
---|
| 1798 | tbuf[FGETS_SIZE - 2] = NUL;
|
---|
| 1799 | #ifdef USE_CR
|
---|
| 1800 | - fgets_cr((char *)tbuf, FGETS_SIZE, fp);
|
---|
| 1801 | + ignoredp = fgets_cr((char *)tbuf, FGETS_SIZE, fp);
|
---|
| 1802 | #else
|
---|
| 1803 | - fgets((char *)tbuf, FGETS_SIZE, fp);
|
---|
| 1804 | + ignoredp = fgets((char *)tbuf, FGETS_SIZE, fp);
|
---|
| 1805 | #endif
|
---|
| 1806 | } while (tbuf[FGETS_SIZE - 2] != NUL && tbuf[FGETS_SIZE - 2] != '\n');
|
---|
| 1807 | }
|
---|
| 1808 | @@ -8523,6 +8522,7 @@
|
---|
| 1809 | char_u *save_sourcing_name;
|
---|
| 1810 | linenr_T save_sourcing_lnum;
|
---|
| 1811 | char_u *save_autocmd_fname;
|
---|
| 1812 | + int save_autocmd_fname_full;
|
---|
| 1813 | int save_autocmd_bufnr;
|
---|
| 1814 | char_u *save_autocmd_match;
|
---|
| 1815 | int save_autocmd_busy;
|
---|
| 1816 | @@ -8601,6 +8601,7 @@
|
---|
| 1817 | * Save the autocmd_* variables and info about the current buffer.
|
---|
| 1818 | */
|
---|
| 1819 | save_autocmd_fname = autocmd_fname;
|
---|
| 1820 | + save_autocmd_fname_full = autocmd_fname_full;
|
---|
| 1821 | save_autocmd_bufnr = autocmd_bufnr;
|
---|
| 1822 | save_autocmd_match = autocmd_match;
|
---|
| 1823 | save_autocmd_busy = autocmd_busy;
|
---|
| 1824 | @@ -8618,14 +8619,15 @@
|
---|
| 1825 | if (fname != NULL && *fname != NUL)
|
---|
| 1826 | autocmd_fname = fname;
|
---|
| 1827 | else if (buf != NULL)
|
---|
| 1828 | - autocmd_fname = buf->b_fname;
|
---|
| 1829 | + autocmd_fname = buf->b_ffname;
|
---|
| 1830 | else
|
---|
| 1831 | autocmd_fname = NULL;
|
---|
| 1832 | }
|
---|
| 1833 | else
|
---|
| 1834 | autocmd_fname = fname_io;
|
---|
| 1835 | if (autocmd_fname != NULL)
|
---|
| 1836 | - autocmd_fname = FullName_save(autocmd_fname, FALSE);
|
---|
| 1837 | + autocmd_fname = vim_strsave(autocmd_fname);
|
---|
| 1838 | + autocmd_fname_full = FALSE; /* call FullName_save() later */
|
---|
| 1839 |
|
---|
| 1840 | /*
|
---|
| 1841 | * Set the buffer number to be used for <abuf>.
|
---|
| 1842 | @@ -8810,6 +8812,7 @@
|
---|
| 1843 | sourcing_lnum = save_sourcing_lnum;
|
---|
| 1844 | vim_free(autocmd_fname);
|
---|
| 1845 | autocmd_fname = save_autocmd_fname;
|
---|
| 1846 | + autocmd_fname_full = save_autocmd_fname_full;
|
---|
| 1847 | autocmd_bufnr = save_autocmd_bufnr;
|
---|
| 1848 | autocmd_match = save_autocmd_match;
|
---|
| 1849 | #ifdef FEAT_EVAL
|
---|
| 1850 | @@ -8918,7 +8921,7 @@
|
---|
| 1851 | {
|
---|
| 1852 | apc->curpat = NULL;
|
---|
| 1853 |
|
---|
| 1854 | - /* only use a pattern when it has not been removed, has commands and
|
---|
| 1855 | + /* Only use a pattern when it has not been removed, has commands and
|
---|
| 1856 | * the group matches. For buffer-local autocommands only check the
|
---|
| 1857 | * buffer number. */
|
---|
| 1858 | if (ap->pat != NULL && ap->cmds != NULL
|
---|
| 1859 | @@ -9104,7 +9107,7 @@
|
---|
| 1860 | set_context_in_autocmd(xp, arg, doautocmd)
|
---|
| 1861 | expand_T *xp;
|
---|
| 1862 | char_u *arg;
|
---|
| 1863 | - int doautocmd; /* TRUE for :doautocmd, FALSE for :autocmd */
|
---|
| 1864 | + int doautocmd; /* TRUE for :doauto*, FALSE for :autocmd */
|
---|
| 1865 | {
|
---|
| 1866 | char_u *p;
|
---|
| 1867 | int group;
|
---|
| 1868 | diff -Naur vim72.orig/src/fold.c vim72/src/fold.c
|
---|
| 1869 | --- vim72.orig/src/fold.c 2008-08-06 04:01:12.000000000 -0700
|
---|
| 1870 | +++ vim72/src/fold.c 2008-12-20 15:02:13.000000000 -0800
|
---|
| 1871 | @@ -48,7 +48,7 @@
|
---|
| 1872 | static int foldFind __ARGS((garray_T *gap, linenr_T lnum, fold_T **fpp));
|
---|
| 1873 | static int foldLevelWin __ARGS((win_T *wp, linenr_T lnum));
|
---|
| 1874 | static void checkupdate __ARGS((win_T *wp));
|
---|
| 1875 | -static void setFoldRepeat __ARGS((linenr_T lnum, long count, int open));
|
---|
| 1876 | +static void setFoldRepeat __ARGS((linenr_T lnum, long count, int do_open));
|
---|
| 1877 | static linenr_T setManualFold __ARGS((linenr_T lnum, int opening, int recurse, int *donep));
|
---|
| 1878 | static linenr_T setManualFoldWin __ARGS((win_T *wp, linenr_T lnum, int opening, int recurse, int *donep));
|
---|
| 1879 | static void foldOpenNested __ARGS((fold_T *fpr));
|
---|
| 1880 | @@ -1241,10 +1241,10 @@
|
---|
| 1881 | * Repeat "count" times.
|
---|
| 1882 | */
|
---|
| 1883 | static void
|
---|
| 1884 | -setFoldRepeat(lnum, count, open)
|
---|
| 1885 | +setFoldRepeat(lnum, count, do_open)
|
---|
| 1886 | linenr_T lnum;
|
---|
| 1887 | long count;
|
---|
| 1888 | - int open;
|
---|
| 1889 | + int do_open;
|
---|
| 1890 | {
|
---|
| 1891 | int done;
|
---|
| 1892 | long n;
|
---|
| 1893 | @@ -1252,7 +1252,7 @@
|
---|
| 1894 | for (n = 0; n < count; ++n)
|
---|
| 1895 | {
|
---|
| 1896 | done = DONE_NOTHING;
|
---|
| 1897 | - (void)setManualFold(lnum, open, FALSE, &done);
|
---|
| 1898 | + (void)setManualFold(lnum, do_open, FALSE, &done);
|
---|
| 1899 | if (!(done & DONE_ACTION))
|
---|
| 1900 | {
|
---|
| 1901 | /* Only give an error message when no fold could be opened. */
|
---|
| 1902 | diff -Naur vim72.orig/src/getchar.c vim72/src/getchar.c
|
---|
| 1903 | --- vim72.orig/src/getchar.c 2008-07-22 09:57:48.000000000 -0700
|
---|
| 1904 | +++ vim72/src/getchar.c 2008-12-20 15:02:09.000000000 -0800
|
---|
| 1905 | @@ -4702,7 +4702,7 @@
|
---|
| 1906 | return FAIL;
|
---|
| 1907 | if (mp->m_noremap != REMAP_YES && fprintf(fd, "nore") < 0)
|
---|
| 1908 | return FAIL;
|
---|
| 1909 | - if (fprintf(fd, cmd) < 0)
|
---|
| 1910 | + if (fputs(cmd, fd) < 0)
|
---|
| 1911 | return FAIL;
|
---|
| 1912 | if (buf != NULL && fputs(" <buffer>", fd) < 0)
|
---|
| 1913 | return FAIL;
|
---|
| 1914 | @@ -4801,7 +4801,7 @@
|
---|
| 1915 | }
|
---|
| 1916 | if (IS_SPECIAL(c) || modifiers) /* special key */
|
---|
| 1917 | {
|
---|
| 1918 | - if (fprintf(fd, (char *)get_special_key_name(c, modifiers)) < 0)
|
---|
| 1919 | + if (fputs((char *)get_special_key_name(c, modifiers), fd) < 0)
|
---|
| 1920 | return FAIL;
|
---|
| 1921 | continue;
|
---|
| 1922 | }
|
---|
| 1923 | diff -Naur vim72.orig/src/globals.h vim72/src/globals.h
|
---|
| 1924 | --- vim72.orig/src/globals.h 2008-07-26 04:53:29.000000000 -0700
|
---|
| 1925 | +++ vim72/src/globals.h 2008-12-20 15:02:13.000000000 -0800
|
---|
| 1926 | @@ -1022,6 +1022,7 @@
|
---|
| 1927 | #endif
|
---|
| 1928 | #ifdef FEAT_AUTOCMD
|
---|
| 1929 | EXTERN char_u *autocmd_fname INIT(= NULL); /* fname for <afile> on cmdline */
|
---|
| 1930 | +EXTERN int autocmd_fname_full; /* autocmd_fname is full path */
|
---|
| 1931 | EXTERN int autocmd_bufnr INIT(= 0); /* fnum for <abuf> on cmdline */
|
---|
| 1932 | EXTERN char_u *autocmd_match INIT(= NULL); /* name for <amatch> on cmdline */
|
---|
| 1933 | EXTERN int did_cursorhold INIT(= FALSE); /* set when CursorHold t'gerd */
|
---|
| 1934 | @@ -1548,6 +1549,14 @@
|
---|
| 1935 | EXTERN time_t starttime;
|
---|
| 1936 |
|
---|
| 1937 | /*
|
---|
| 1938 | + * Some compilers warn for not using a return value, but in some situations we
|
---|
| 1939 | + * can't do anything useful with the value. Assign to this variable to avoid
|
---|
| 1940 | + * the warning.
|
---|
| 1941 | + */
|
---|
| 1942 | +EXTERN int ignored;
|
---|
| 1943 | +EXTERN char *ignoredp;
|
---|
| 1944 | +
|
---|
| 1945 | +/*
|
---|
| 1946 | * Optional Farsi support. Include it here, so EXTERN and INIT are defined.
|
---|
| 1947 | */
|
---|
| 1948 | #ifdef FEAT_FKMAP
|
---|
| 1949 | diff -Naur vim72.orig/src/gui.c vim72/src/gui.c
|
---|
| 1950 | --- vim72.orig/src/gui.c 2008-07-27 12:32:14.000000000 -0700
|
---|
| 1951 | +++ vim72/src/gui.c 2008-12-20 15:02:41.000000000 -0800
|
---|
| 1952 | @@ -139,7 +139,7 @@
|
---|
| 1953 | /* The read returns when the child closes the pipe (or when
|
---|
| 1954 | * the child dies for some reason). */
|
---|
| 1955 | close(pipefd[1]);
|
---|
| 1956 | - (void)read(pipefd[0], &dummy, (size_t)1);
|
---|
| 1957 | + ignored = (int)read(pipefd[0], &dummy, (size_t)1);
|
---|
| 1958 | close(pipefd[0]);
|
---|
| 1959 | }
|
---|
| 1960 |
|
---|
| 1961 | @@ -3241,7 +3241,7 @@
|
---|
| 1962 | i = Rows;
|
---|
| 1963 | gui_update_tabline();
|
---|
| 1964 | Rows = i;
|
---|
| 1965 | - need_set_size = RESIZE_VERT;
|
---|
| 1966 | + need_set_size |= RESIZE_VERT;
|
---|
| 1967 | if (using_tabline)
|
---|
| 1968 | fix_size = TRUE;
|
---|
| 1969 | if (!gui_use_tabline())
|
---|
| 1970 | @@ -3275,9 +3275,9 @@
|
---|
| 1971 | if (gui.which_scrollbars[i] != prev_which_scrollbars[i])
|
---|
| 1972 | {
|
---|
| 1973 | if (i == SBAR_BOTTOM)
|
---|
| 1974 | - need_set_size = RESIZE_VERT;
|
---|
| 1975 | + need_set_size |= RESIZE_VERT;
|
---|
| 1976 | else
|
---|
| 1977 | - need_set_size = RESIZE_HOR;
|
---|
| 1978 | + need_set_size |= RESIZE_HOR;
|
---|
| 1979 | if (gui.which_scrollbars[i])
|
---|
| 1980 | fix_size = TRUE;
|
---|
| 1981 | }
|
---|
| 1982 | @@ -3297,7 +3297,7 @@
|
---|
| 1983 | gui_mch_enable_menu(gui.menu_is_active);
|
---|
| 1984 | Rows = i;
|
---|
| 1985 | prev_menu_is_active = gui.menu_is_active;
|
---|
| 1986 | - need_set_size = RESIZE_VERT;
|
---|
| 1987 | + need_set_size |= RESIZE_VERT;
|
---|
| 1988 | if (gui.menu_is_active)
|
---|
| 1989 | fix_size = TRUE;
|
---|
| 1990 | }
|
---|
| 1991 | @@ -3308,7 +3308,7 @@
|
---|
| 1992 | {
|
---|
| 1993 | gui_mch_show_toolbar(using_toolbar);
|
---|
| 1994 | prev_toolbar = using_toolbar;
|
---|
| 1995 | - need_set_size = RESIZE_VERT;
|
---|
| 1996 | + need_set_size |= RESIZE_VERT;
|
---|
| 1997 | if (using_toolbar)
|
---|
| 1998 | fix_size = TRUE;
|
---|
| 1999 | }
|
---|
| 2000 | @@ -3318,7 +3318,7 @@
|
---|
| 2001 | {
|
---|
| 2002 | gui_mch_enable_footer(using_footer);
|
---|
| 2003 | prev_footer = using_footer;
|
---|
| 2004 | - need_set_size = RESIZE_VERT;
|
---|
| 2005 | + need_set_size |= RESIZE_VERT;
|
---|
| 2006 | if (using_footer)
|
---|
| 2007 | fix_size = TRUE;
|
---|
| 2008 | }
|
---|
| 2009 | @@ -3330,10 +3330,11 @@
|
---|
| 2010 | prev_tearoff = using_tearoff;
|
---|
| 2011 | }
|
---|
| 2012 | #endif
|
---|
| 2013 | - if (need_set_size)
|
---|
| 2014 | + if (need_set_size != 0)
|
---|
| 2015 | {
|
---|
| 2016 | #ifdef FEAT_GUI_GTK
|
---|
| 2017 | - long c = Columns;
|
---|
| 2018 | + long prev_Columns = Columns;
|
---|
| 2019 | + long prev_Rows = Rows;
|
---|
| 2020 | #endif
|
---|
| 2021 | /* Adjust the size of the window to make the text area keep the
|
---|
| 2022 | * same size and to avoid that part of our window is off-screen
|
---|
| 2023 | @@ -3349,11 +3350,14 @@
|
---|
| 2024 | * If you remove this, please test this command for resizing
|
---|
| 2025 | * effects (with optional left scrollbar): ":vsp|q|vsp|q|vsp|q".
|
---|
| 2026 | * Don't do this while starting up though.
|
---|
| 2027 | - * And don't change Rows, it may have be reduced intentionally
|
---|
| 2028 | - * when adding menu/toolbar/tabline. */
|
---|
| 2029 | - if (!gui.starting)
|
---|
| 2030 | + * Don't change Rows when adding menu/toolbar/tabline.
|
---|
| 2031 | + * Don't change Columns when adding vertical toolbar. */
|
---|
| 2032 | + if (!gui.starting && need_set_size != (RESIZE_VERT | RESIZE_HOR))
|
---|
| 2033 | (void)char_avail();
|
---|
| 2034 | - Columns = c;
|
---|
| 2035 | + if ((need_set_size & RESIZE_VERT) == 0)
|
---|
| 2036 | + Rows = prev_Rows;
|
---|
| 2037 | + if ((need_set_size & RESIZE_HOR) == 0)
|
---|
| 2038 | + Columns = prev_Columns;
|
---|
| 2039 | #endif
|
---|
| 2040 | }
|
---|
| 2041 | #ifdef FEAT_WINDOWS
|
---|
| 2042 | diff -Naur vim72.orig/src/gui_at_sb.c vim72/src/gui_at_sb.c
|
---|
| 2043 | --- vim72.orig/src/gui_at_sb.c 2004-06-07 07:32:25.000000000 -0700
|
---|
| 2044 | +++ vim72/src/gui_at_sb.c 2008-12-20 15:02:13.000000000 -0800
|
---|
| 2045 | @@ -1078,6 +1078,12 @@
|
---|
| 2046 | Cardinal *num_params; /* unused */
|
---|
| 2047 | {
|
---|
| 2048 | ScrollbarWidget sbw = (ScrollbarWidget)w;
|
---|
| 2049 | + /* Use a union to avoid a warning for the weird conversion from float to
|
---|
| 2050 | + * XtPointer. Comes from Xaw/Scrollbar.c. */
|
---|
| 2051 | + union {
|
---|
| 2052 | + XtPointer xtp;
|
---|
| 2053 | + float xtf;
|
---|
| 2054 | + } xtpf;
|
---|
| 2055 |
|
---|
| 2056 | if (LookAhead(w, event))
|
---|
| 2057 | return;
|
---|
| 2058 | @@ -1085,7 +1091,8 @@
|
---|
| 2059 | /* thumbProc is not pretty, but is necessary for backwards
|
---|
| 2060 | compatibility on those architectures for which it work{s,ed};
|
---|
| 2061 | the intent is to pass a (truncated) float by value. */
|
---|
| 2062 | - XtCallCallbacks(w, XtNthumbProc, *(XtPointer*)&sbw->scrollbar.top);
|
---|
| 2063 | + xtpf.xtf = sbw->scrollbar.top;
|
---|
| 2064 | + XtCallCallbacks(w, XtNthumbProc, xtpf.xtp);
|
---|
| 2065 | XtCallCallbacks(w, XtNjumpProc, (XtPointer)&sbw->scrollbar.top);
|
---|
| 2066 | }
|
---|
| 2067 |
|
---|
| 2068 | diff -Naur vim72.orig/src/gui_gtk_x11.c vim72/src/gui_gtk_x11.c
|
---|
| 2069 | --- vim72.orig/src/gui_gtk_x11.c 2008-07-04 03:46:24.000000000 -0700
|
---|
| 2070 | +++ vim72/src/gui_gtk_x11.c 2008-12-20 15:02:13.000000000 -0800
|
---|
| 2071 | @@ -4070,14 +4070,14 @@
|
---|
| 2072 |
|
---|
| 2073 | if (mask & (XValue | YValue))
|
---|
| 2074 | {
|
---|
| 2075 | - int w, h;
|
---|
| 2076 | - gui_mch_get_screen_dimensions(&w, &h);
|
---|
| 2077 | - h += p_ghr + get_menu_tool_height();
|
---|
| 2078 | - w += get_menu_tool_width();
|
---|
| 2079 | + int ww, hh;
|
---|
| 2080 | + gui_mch_get_screen_dimensions(&ww, &hh);
|
---|
| 2081 | + hh += p_ghr + get_menu_tool_height();
|
---|
| 2082 | + ww += get_menu_tool_width();
|
---|
| 2083 | if (mask & XNegative)
|
---|
| 2084 | - x += w - pixel_width;
|
---|
| 2085 | + x += ww - pixel_width;
|
---|
| 2086 | if (mask & YNegative)
|
---|
| 2087 | - y += h - pixel_height;
|
---|
| 2088 | + y += hh - pixel_height;
|
---|
| 2089 | #ifdef HAVE_GTK2
|
---|
| 2090 | gtk_window_move(GTK_WINDOW(gui.mainwin), x, y);
|
---|
| 2091 | #else
|
---|
| 2092 | diff -Naur vim72.orig/src/gui_x11.c vim72/src/gui_x11.c
|
---|
| 2093 | --- vim72.orig/src/gui_x11.c 2008-06-08 08:13:45.000000000 -0700
|
---|
| 2094 | +++ vim72/src/gui_x11.c 2008-12-20 15:01:15.000000000 -0800
|
---|
| 2095 | @@ -2450,7 +2450,7 @@
|
---|
| 2096 | *colorPtr = colortable[closest];
|
---|
| 2097 | }
|
---|
| 2098 |
|
---|
| 2099 | - free(colortable);
|
---|
| 2100 | + vim_free(colortable);
|
---|
| 2101 | return OK;
|
---|
| 2102 | }
|
---|
| 2103 |
|
---|
| 2104 | diff -Naur vim72.orig/src/gui_xmdlg.c vim72/src/gui_xmdlg.c
|
---|
| 2105 | --- vim72.orig/src/gui_xmdlg.c 2008-06-21 09:05:32.000000000 -0700
|
---|
| 2106 | +++ vim72/src/gui_xmdlg.c 2008-12-20 15:02:13.000000000 -0800
|
---|
| 2107 | @@ -369,10 +369,10 @@
|
---|
| 2108 | char buf[TEMP_BUF_SIZE];
|
---|
| 2109 | XmString items[MAX_ENTRIES_IN_LIST];
|
---|
| 2110 | int i;
|
---|
| 2111 | - int index;
|
---|
| 2112 | + int idx;
|
---|
| 2113 |
|
---|
| 2114 | - for (index = (int)ENCODING; index < (int)NONE; ++index)
|
---|
| 2115 | - count[index] = 0;
|
---|
| 2116 | + for (idx = (int)ENCODING; idx < (int)NONE; ++idx)
|
---|
| 2117 | + count[idx] = 0;
|
---|
| 2118 |
|
---|
| 2119 | /* First we insert the wild char into every single list. */
|
---|
| 2120 | if (fix != ENCODING)
|
---|
| 2121 | @@ -503,14 +503,14 @@
|
---|
| 2122 | /*
|
---|
| 2123 | * Now loop trough the remaining lists and set them up.
|
---|
| 2124 | */
|
---|
| 2125 | - for (index = (int)NAME; index < (int)NONE; ++index)
|
---|
| 2126 | + for (idx = (int)NAME; idx < (int)NONE; ++idx)
|
---|
| 2127 | {
|
---|
| 2128 | Widget w;
|
---|
| 2129 |
|
---|
| 2130 | - if (fix == (enum ListSpecifier)index)
|
---|
| 2131 | + if (fix == (enum ListSpecifier)idx)
|
---|
| 2132 | continue;
|
---|
| 2133 |
|
---|
| 2134 | - switch ((enum ListSpecifier)index)
|
---|
| 2135 | + switch ((enum ListSpecifier)idx)
|
---|
| 2136 | {
|
---|
| 2137 | case NAME:
|
---|
| 2138 | w = data->list[NAME];
|
---|
| 2139 | @@ -525,21 +525,21 @@
|
---|
| 2140 | w = (Widget)0; /* for lint */
|
---|
| 2141 | }
|
---|
| 2142 |
|
---|
| 2143 | - for (i = 0; i < count[index]; ++i)
|
---|
| 2144 | + for (i = 0; i < count[idx]; ++i)
|
---|
| 2145 | {
|
---|
| 2146 | - items[i] = XmStringCreateLocalized(list[index][i]);
|
---|
| 2147 | - XtFree(list[index][i]);
|
---|
| 2148 | + items[i] = XmStringCreateLocalized(list[idx][i]);
|
---|
| 2149 | + XtFree(list[idx][i]);
|
---|
| 2150 | }
|
---|
| 2151 | XmListDeleteAllItems(w);
|
---|
| 2152 | - XmListAddItems(w, items, count[index], 1);
|
---|
| 2153 | - if (data->sel[index])
|
---|
| 2154 | + XmListAddItems(w, items, count[idx], 1);
|
---|
| 2155 | + if (data->sel[idx])
|
---|
| 2156 | {
|
---|
| 2157 | XmStringFree(items[0]);
|
---|
| 2158 | - items[0] = XmStringCreateLocalized(data->sel[index]);
|
---|
| 2159 | + items[0] = XmStringCreateLocalized(data->sel[idx]);
|
---|
| 2160 | XmListSelectItem(w, items[0], False);
|
---|
| 2161 | XmListSetBottomItem(w, items[0]);
|
---|
| 2162 | }
|
---|
| 2163 | - for (i = 0; i < count[index]; ++i)
|
---|
| 2164 | + for (i = 0; i < count[idx]; ++i)
|
---|
| 2165 | XmStringFree(items[i]);
|
---|
| 2166 | }
|
---|
| 2167 | }
|
---|
| 2168 | @@ -695,14 +695,14 @@
|
---|
| 2169 | int n;
|
---|
| 2170 | XmString str;
|
---|
| 2171 | Arg args[4];
|
---|
| 2172 | - char *msg = _("no specific match");
|
---|
| 2173 | + char *nomatch_msg = _("no specific match");
|
---|
| 2174 |
|
---|
| 2175 | n = 0;
|
---|
| 2176 | - str = XmStringCreateLocalized(msg);
|
---|
| 2177 | + str = XmStringCreateLocalized(nomatch_msg);
|
---|
| 2178 | XtSetArg(args[n], XmNlabelString, str); ++n;
|
---|
| 2179 | XtSetValues(data->sample, args, n);
|
---|
| 2180 | apply_fontlist(data->sample);
|
---|
| 2181 | - XmTextSetString(data->name, msg);
|
---|
| 2182 | + XmTextSetString(data->name, nomatch_msg);
|
---|
| 2183 | XmStringFree(str);
|
---|
| 2184 |
|
---|
| 2185 | return False;
|
---|
| 2186 | @@ -886,21 +886,21 @@
|
---|
| 2187 | {
|
---|
| 2188 | int i;
|
---|
| 2189 | int max;
|
---|
| 2190 | - int index = 0;
|
---|
| 2191 | + int idx = 0;
|
---|
| 2192 | int size;
|
---|
| 2193 | - char str[128];
|
---|
| 2194 | + char buf[128];
|
---|
| 2195 |
|
---|
| 2196 | for (i = 0, max = 0; i < data->num; i++)
|
---|
| 2197 | {
|
---|
| 2198 | - get_part(fn(data, i), 7, str);
|
---|
| 2199 | - size = atoi(str);
|
---|
| 2200 | + get_part(fn(data, i), 7, buf);
|
---|
| 2201 | + size = atoi(buf);
|
---|
| 2202 | if ((size > max) && (size < MAX_DISPLAY_SIZE))
|
---|
| 2203 | {
|
---|
| 2204 | - index = i;
|
---|
| 2205 | + idx = i;
|
---|
| 2206 | max = size;
|
---|
| 2207 | }
|
---|
| 2208 | }
|
---|
| 2209 | - strcpy(big_font, fn(data, index));
|
---|
| 2210 | + strcpy(big_font, fn(data, idx));
|
---|
| 2211 | }
|
---|
| 2212 | data->old = XLoadQueryFont(XtDisplay(parent), big_font);
|
---|
| 2213 | data->old_list = gui_motif_create_fontlist(data->old);
|
---|
| 2214 | @@ -1217,28 +1217,28 @@
|
---|
| 2215 |
|
---|
| 2216 | if (i != 0)
|
---|
| 2217 | {
|
---|
| 2218 | - char name[TEMP_BUF_SIZE];
|
---|
| 2219 | - char style[TEMP_BUF_SIZE];
|
---|
| 2220 | - char size[TEMP_BUF_SIZE];
|
---|
| 2221 | - char encoding[TEMP_BUF_SIZE];
|
---|
| 2222 | + char namebuf[TEMP_BUF_SIZE];
|
---|
| 2223 | + char stylebuf[TEMP_BUF_SIZE];
|
---|
| 2224 | + char sizebuf[TEMP_BUF_SIZE];
|
---|
| 2225 | + char encodingbuf[TEMP_BUF_SIZE];
|
---|
| 2226 | char *found;
|
---|
| 2227 |
|
---|
| 2228 | found = names[0];
|
---|
| 2229 |
|
---|
| 2230 | - name_part(found, name);
|
---|
| 2231 | - style_part(found, style);
|
---|
| 2232 | - size_part(found, size, data->in_pixels);
|
---|
| 2233 | - encoding_part(found, encoding);
|
---|
| 2234 | -
|
---|
| 2235 | - if (strlen(name) > 0
|
---|
| 2236 | - && strlen(style) > 0
|
---|
| 2237 | - && strlen(size) > 0
|
---|
| 2238 | - && strlen(encoding) > 0)
|
---|
| 2239 | + name_part(found, namebuf);
|
---|
| 2240 | + style_part(found, stylebuf);
|
---|
| 2241 | + size_part(found, sizebuf, data->in_pixels);
|
---|
| 2242 | + encoding_part(found, encodingbuf);
|
---|
| 2243 | +
|
---|
| 2244 | + if (strlen(namebuf) > 0
|
---|
| 2245 | + && strlen(stylebuf) > 0
|
---|
| 2246 | + && strlen(sizebuf) > 0
|
---|
| 2247 | + && strlen(encodingbuf) > 0)
|
---|
| 2248 | {
|
---|
| 2249 | - data->sel[NAME] = XtNewString(name);
|
---|
| 2250 | - data->sel[STYLE] = XtNewString(style);
|
---|
| 2251 | - data->sel[SIZE] = XtNewString(size);
|
---|
| 2252 | - data->sel[ENCODING] = XtNewString(encoding);
|
---|
| 2253 | + data->sel[NAME] = XtNewString(namebuf);
|
---|
| 2254 | + data->sel[STYLE] = XtNewString(stylebuf);
|
---|
| 2255 | + data->sel[SIZE] = XtNewString(sizebuf);
|
---|
| 2256 | + data->sel[ENCODING] = XtNewString(encodingbuf);
|
---|
| 2257 | data->font_name = XtNewString(names[0]);
|
---|
| 2258 | display_sample(data);
|
---|
| 2259 | XmTextSetString(data->name, data->font_name);
|
---|
| 2260 | diff -Naur vim72.orig/src/gui_xmebw.c vim72/src/gui_xmebw.c
|
---|
| 2261 | --- vim72.orig/src/gui_xmebw.c 2007-09-06 03:57:51.000000000 -0700
|
---|
| 2262 | +++ vim72/src/gui_xmebw.c 2008-12-20 15:02:13.000000000 -0800
|
---|
| 2263 | @@ -1256,7 +1256,7 @@
|
---|
| 2264 | }
|
---|
| 2265 | else
|
---|
| 2266 | {
|
---|
| 2267 | - int adjust = 0;
|
---|
| 2268 | + adjust = 0;
|
---|
| 2269 |
|
---|
| 2270 | #if !defined(LESSTIF_VERSION) && (XmVersion > 1002)
|
---|
| 2271 | /*
|
---|
| 2272 | @@ -1268,12 +1268,11 @@
|
---|
| 2273 | {
|
---|
| 2274 | case XmEXTERNAL_HIGHLIGHT:
|
---|
| 2275 | adjust = (eb->primitive.highlight_thickness -
|
---|
| 2276 | - (eb->pushbutton.default_button_shadow_thickness ?
|
---|
| 2277 | - Xm3D_ENHANCE_PIXEL : 0));
|
---|
| 2278 | + (eb->pushbutton.default_button_shadow_thickness
|
---|
| 2279 | + ? Xm3D_ENHANCE_PIXEL : 0));
|
---|
| 2280 | break;
|
---|
| 2281 |
|
---|
| 2282 | case XmINTERNAL_HIGHLIGHT:
|
---|
| 2283 | - adjust = 0;
|
---|
| 2284 | break;
|
---|
| 2285 |
|
---|
| 2286 | default:
|
---|
| 2287 | diff -Naur vim72.orig/src/if_cscope.c vim72/src/if_cscope.c
|
---|
| 2288 | --- vim72.orig/src/if_cscope.c 2008-06-24 09:32:34.000000000 -0700
|
---|
| 2289 | +++ vim72/src/if_cscope.c 2008-12-20 14:59:49.000000000 -0800
|
---|
| 2290 | @@ -74,7 +74,7 @@
|
---|
| 2291 | { "add", cs_add,
|
---|
| 2292 | N_("Add a new database"), "add file|dir [pre-path] [flags]", 0 },
|
---|
| 2293 | { "find", cs_find,
|
---|
| 2294 | - N_("Query for a pattern"), FIND_USAGE, 1 },
|
---|
| 2295 | + N_("Query for a pattern"), "find c|d|e|f|g|i|s|t name", 1 },
|
---|
| 2296 | { "help", cs_help,
|
---|
| 2297 | N_("Show this message"), "help", 0 },
|
---|
| 2298 | { "kill", cs_kill,
|
---|
| 2299 | @@ -1180,7 +1180,16 @@
|
---|
| 2300 | (void)smsg((char_u *)_("%-5s: %-30s (Usage: %s)"),
|
---|
| 2301 | cmdp->name, _(cmdp->help), cmdp->usage);
|
---|
| 2302 | if (strcmp(cmdp->name, "find") == 0)
|
---|
| 2303 | - MSG_PUTS(FIND_HELP);
|
---|
| 2304 | + MSG_PUTS(_("\n"
|
---|
| 2305 | + " c: Find functions calling this function\n"
|
---|
| 2306 | + " d: Find functions called by this function\n"
|
---|
| 2307 | + " e: Find this egrep pattern\n"
|
---|
| 2308 | + " f: Find this file\n"
|
---|
| 2309 | + " g: Find this definition\n"
|
---|
| 2310 | + " i: Find files #including this file\n"
|
---|
| 2311 | + " s: Find this C symbol\n"
|
---|
| 2312 | + " t: Find assignments to\n"));
|
---|
| 2313 | +
|
---|
| 2314 | cmdp++;
|
---|
| 2315 | }
|
---|
| 2316 |
|
---|
| 2317 | diff -Naur vim72.orig/src/if_cscope.h vim72/src/if_cscope.h
|
---|
| 2318 | --- vim72.orig/src/if_cscope.h 2007-09-02 07:51:08.000000000 -0700
|
---|
| 2319 | +++ vim72/src/if_cscope.h 2008-12-20 14:59:49.000000000 -0800
|
---|
| 2320 | @@ -42,17 +42,6 @@
|
---|
| 2321 | * f 7name Find this file
|
---|
| 2322 | * i 8name Find files #including this file
|
---|
| 2323 | */
|
---|
| 2324 | -#define FIND_USAGE "find c|d|e|f|g|i|s|t name"
|
---|
| 2325 | -#define FIND_HELP "\n\
|
---|
| 2326 | - c: Find functions calling this function\n\
|
---|
| 2327 | - d: Find functions called by this function\n\
|
---|
| 2328 | - e: Find this egrep pattern\n\
|
---|
| 2329 | - f: Find this file\n\
|
---|
| 2330 | - g: Find this definition\n\
|
---|
| 2331 | - i: Find files #including this file\n\
|
---|
| 2332 | - s: Find this C symbol\n\
|
---|
| 2333 | - t: Find assignments to\n"
|
---|
| 2334 | -
|
---|
| 2335 |
|
---|
| 2336 | typedef struct {
|
---|
| 2337 | char * name;
|
---|
| 2338 | diff -Naur vim72.orig/src/if_perl.xs vim72/src/if_perl.xs
|
---|
| 2339 | --- vim72.orig/src/if_perl.xs 2008-07-17 13:55:09.000000000 -0700
|
---|
| 2340 | +++ vim72/src/if_perl.xs 2008-12-20 15:02:36.000000000 -0800
|
---|
| 2341 | @@ -136,6 +136,9 @@
|
---|
| 2342 | # define Perl_newXS_flags dll_Perl_newXS_flags
|
---|
| 2343 | #endif
|
---|
| 2344 | # define Perl_sv_free dll_Perl_sv_free
|
---|
| 2345 | +# if (PERL_REVISION == 5) && (PERL_VERSION >= 10)
|
---|
| 2346 | +# define Perl_sv_free2 dll_Perl_sv_free2
|
---|
| 2347 | +# endif
|
---|
| 2348 | # define Perl_sv_isa dll_Perl_sv_isa
|
---|
| 2349 | # define Perl_sv_magic dll_Perl_sv_magic
|
---|
| 2350 | # define Perl_sv_setiv dll_Perl_sv_setiv
|
---|
| 2351 | @@ -163,7 +166,7 @@
|
---|
| 2352 | # define Perl_Isv_yes_ptr dll_Perl_Isv_yes_ptr
|
---|
| 2353 | # define boot_DynaLoader dll_boot_DynaLoader
|
---|
| 2354 |
|
---|
| 2355 | -# define Perl_sys_init3 dll_Perl_sys_init3
|
---|
| 2356 | +# define Perl_sys_init dll_Perl_sys_init
|
---|
| 2357 | # define Perl_sys_term dll_Perl_sys_term
|
---|
| 2358 | # define Perl_ISv_ptr dll_Perl_ISv_ptr
|
---|
| 2359 | # define Perl_Istack_max_ptr dll_Perl_Istack_max_ptr
|
---|
| 2360 | @@ -268,7 +271,8 @@
|
---|
| 2361 | static void (*boot_DynaLoader)_((pTHX_ CV*));
|
---|
| 2362 |
|
---|
| 2363 | #if (PERL_REVISION == 5) && (PERL_VERSION >= 10)
|
---|
| 2364 | -static void (*Perl_sys_init3)(int* argc, char*** argv, char*** env);
|
---|
| 2365 | +static void (*Perl_sv_free2)(pTHX_ SV*);
|
---|
| 2366 | +static void (*Perl_sys_init)(int* argc, char*** argv);
|
---|
| 2367 | static void (*Perl_sys_term)(void);
|
---|
| 2368 | static SV** (*Perl_ISv_ptr)(register PerlInterpreter*);
|
---|
| 2369 | static SV*** (*Perl_Istack_max_ptr)(register PerlInterpreter*);
|
---|
| 2370 | @@ -367,7 +371,8 @@
|
---|
| 2371 | {"Perl_TXpv_ptr", (PERL_PROC*)&Perl_TXpv_ptr},
|
---|
| 2372 | {"Perl_Tna_ptr", (PERL_PROC*)&Perl_Tna_ptr},
|
---|
| 2373 | #else
|
---|
| 2374 | - {"Perl_sys_init3", (PERL_PROC*)&Perl_sys_init3},
|
---|
| 2375 | + {"Perl_sv_free2", (PERL_PROC*)&Perl_sv_free2},
|
---|
| 2376 | + {"Perl_sys_init", (PERL_PROC*)&Perl_sys_init},
|
---|
| 2377 | {"Perl_sys_term", (PERL_PROC*)&Perl_sys_term},
|
---|
| 2378 | {"Perl_ISv_ptr", (PERL_PROC*)&Perl_ISv_ptr},
|
---|
| 2379 | {"Perl_Istack_sp_ptr", (PERL_PROC*)&Perl_Istack_sp_ptr},
|
---|
| 2380 | @@ -455,7 +460,7 @@
|
---|
| 2381 | static char *argv[] = { "", "-e", "" };
|
---|
| 2382 |
|
---|
| 2383 | #if (PERL_REVISION == 5) && (PERL_VERSION >= 10)
|
---|
| 2384 | - Perl_sys_init3(&argc, (char***)&argv, NULL);
|
---|
| 2385 | + Perl_sys_init(&argc, (char***)&argv);
|
---|
| 2386 | #endif
|
---|
| 2387 | perl_interp = perl_alloc();
|
---|
| 2388 | perl_construct(perl_interp);
|
---|
| 2389 | diff -Naur vim72.orig/src/if_python.c vim72/src/if_python.c
|
---|
| 2390 | --- vim72.orig/src/if_python.c 2008-07-17 14:09:32.000000000 -0700
|
---|
| 2391 | +++ vim72/src/if_python.c 2008-12-20 15:01:43.000000000 -0800
|
---|
| 2392 | @@ -531,6 +531,12 @@
|
---|
| 2393 | if (PythonMod_Init())
|
---|
| 2394 | goto fail;
|
---|
| 2395 |
|
---|
| 2396 | + /* Remove the element from sys.path that was added because of our
|
---|
| 2397 | + * argv[0] value in PythonMod_Init(). Previously we used an empty
|
---|
| 2398 | + * string, but dependinding on the OS we then get an empty entry or
|
---|
| 2399 | + * the current directory in sys.path. */
|
---|
| 2400 | + PyRun_SimpleString("import sys; sys.path = filter(lambda x: x != '/must>not&exist', sys.path)");
|
---|
| 2401 | +
|
---|
| 2402 | /* the first python thread is vim's, release the lock */
|
---|
| 2403 | Python_SaveThread();
|
---|
| 2404 |
|
---|
| 2405 | @@ -2345,7 +2351,8 @@
|
---|
| 2406 | {
|
---|
| 2407 | PyObject *mod;
|
---|
| 2408 | PyObject *dict;
|
---|
| 2409 | - static char *(argv[2]) = {"", NULL};
|
---|
| 2410 | + /* The special value is removed from sys.path in Python_Init(). */
|
---|
| 2411 | + static char *(argv[2]) = {"/must>not&exist/foo", NULL};
|
---|
| 2412 |
|
---|
| 2413 | /* Fixups... */
|
---|
| 2414 | BufferType.ob_type = &PyType_Type;
|
---|
| 2415 | diff -Naur vim72.orig/src/if_xcmdsrv.c vim72/src/if_xcmdsrv.c
|
---|
| 2416 | --- vim72.orig/src/if_xcmdsrv.c 2008-07-18 06:05:03.000000000 -0700
|
---|
| 2417 | +++ vim72/src/if_xcmdsrv.c 2008-12-20 15:01:23.000000000 -0800
|
---|
| 2418 | @@ -736,7 +736,7 @@
|
---|
| 2419 | + serverReply.ga_len;
|
---|
| 2420 | e.id = w;
|
---|
| 2421 | ga_init2(&e.strings, 1, 100);
|
---|
| 2422 | - memcpy(p, &e, sizeof(e));
|
---|
| 2423 | + mch_memmove(p, &e, sizeof(e));
|
---|
| 2424 | serverReply.ga_len++;
|
---|
| 2425 | }
|
---|
| 2426 | }
|
---|
| 2427 | @@ -1018,7 +1018,7 @@
|
---|
| 2428 | p++;
|
---|
| 2429 | count = numItems - (p - regProp);
|
---|
| 2430 | if (count > 0)
|
---|
| 2431 | - memcpy(entry, p, count);
|
---|
| 2432 | + mch_memmove(entry, p, count);
|
---|
| 2433 | XChangeProperty(dpy, RootWindow(dpy, 0), registryProperty, XA_STRING,
|
---|
| 2434 | 8, PropModeReplace, regProp,
|
---|
| 2435 | (int)(numItems - (p - entry)));
|
---|
| 2436 | @@ -1072,7 +1072,7 @@
|
---|
| 2437 | p++;
|
---|
| 2438 | lastHalf = numItems - (p - regProp);
|
---|
| 2439 | if (lastHalf > 0)
|
---|
| 2440 | - memcpy(entry, p, lastHalf);
|
---|
| 2441 | + mch_memmove(entry, p, lastHalf);
|
---|
| 2442 | numItems = (entry - regProp) + lastHalf;
|
---|
| 2443 | p = entry;
|
---|
| 2444 | continue;
|
---|
| 2445 | diff -Naur vim72.orig/src/main.c vim72/src/main.c
|
---|
| 2446 | --- vim72.orig/src/main.c 2008-07-24 01:40:56.000000000 -0700
|
---|
| 2447 | +++ vim72/src/main.c 2008-12-20 15:02:13.000000000 -0800
|
---|
| 2448 | @@ -645,11 +645,12 @@
|
---|
| 2449 |
|
---|
| 2450 | #ifdef FEAT_VIMINFO
|
---|
| 2451 | /*
|
---|
| 2452 | - * Read in registers, history etc, but not marks, from the viminfo file
|
---|
| 2453 | + * Read in registers, history etc, but not marks, from the viminfo file.
|
---|
| 2454 | + * This is where v:oldfiles gets filled.
|
---|
| 2455 | */
|
---|
| 2456 | if (*p_viminfo != NUL)
|
---|
| 2457 | {
|
---|
| 2458 | - read_viminfo(NULL, TRUE, FALSE, FALSE);
|
---|
| 2459 | + read_viminfo(NULL, VIF_WANT_INFO | VIF_GET_OLDFILES);
|
---|
| 2460 | TIME_MSG("reading viminfo");
|
---|
| 2461 | }
|
---|
| 2462 | #endif
|
---|
| 2463 | @@ -1457,7 +1458,8 @@
|
---|
| 2464 | ++initstr;
|
---|
| 2465 | }
|
---|
| 2466 |
|
---|
| 2467 | - if (TOLOWER_ASC(initstr[0]) == 'g' || initstr[0] == 'k')
|
---|
| 2468 | + /* "gvim" starts the GUI. Also accept "Gvim" for MS-Windows. */
|
---|
| 2469 | + if (TOLOWER_ASC(initstr[0]) == 'g')
|
---|
| 2470 | {
|
---|
| 2471 | main_start_gui();
|
---|
| 2472 | #ifdef FEAT_GUI
|
---|
| 2473 | @@ -1508,7 +1510,8 @@
|
---|
| 2474 | early_arg_scan(parmp)
|
---|
| 2475 | mparm_T *parmp;
|
---|
| 2476 | {
|
---|
| 2477 | -#if defined(FEAT_XCLIPBOARD) || defined(FEAT_CLIENTSERVER)
|
---|
| 2478 | +#if defined(FEAT_XCLIPBOARD) || defined(FEAT_CLIENTSERVER) \
|
---|
| 2479 | + || !defined(FEAT_NETBEANS_INTG)
|
---|
| 2480 | int argc = parmp->argc;
|
---|
| 2481 | char **argv = parmp->argv;
|
---|
| 2482 | int i;
|
---|
| 2483 | @@ -1580,6 +1583,14 @@
|
---|
| 2484 | else if (STRICMP(argv[i], "--echo-wid") == 0)
|
---|
| 2485 | echo_wid_arg = TRUE;
|
---|
| 2486 | # endif
|
---|
| 2487 | +# ifndef FEAT_NETBEANS_INTG
|
---|
| 2488 | + else if (strncmp(argv[i], "-nb", (size_t)3) == 0)
|
---|
| 2489 | + {
|
---|
| 2490 | + mch_errmsg(_("'-nb' cannot be used: not enabled at compile time\n"));
|
---|
| 2491 | + mch_exit(2);
|
---|
| 2492 | + }
|
---|
| 2493 | +# endif
|
---|
| 2494 | +
|
---|
| 2495 | }
|
---|
| 2496 | #endif
|
---|
| 2497 | }
|
---|
| 2498 | @@ -2361,7 +2372,7 @@
|
---|
| 2499 | * Is there any other system that cannot do this?
|
---|
| 2500 | */
|
---|
| 2501 | close(0);
|
---|
| 2502 | - dup(2);
|
---|
| 2503 | + ignored = dup(2);
|
---|
| 2504 | #endif
|
---|
| 2505 | }
|
---|
| 2506 |
|
---|
| 2507 | diff -Naur vim72.orig/src/mark.c vim72/src/mark.c
|
---|
| 2508 | --- vim72.orig/src/mark.c 2008-08-08 15:06:49.000000000 -0700
|
---|
| 2509 | +++ vim72/src/mark.c 2008-12-20 15:01:04.000000000 -0800
|
---|
| 2510 | @@ -1627,15 +1627,17 @@
|
---|
| 2511 |
|
---|
| 2512 | /*
|
---|
| 2513 | * Handle marks in the viminfo file:
|
---|
| 2514 | - * fp_out == NULL read marks for current buffer only
|
---|
| 2515 | - * fp_out != NULL copy marks for buffers not in buffer list
|
---|
| 2516 | + * fp_out != NULL: copy marks for buffers not in buffer list
|
---|
| 2517 | + * fp_out == NULL && (flags & VIF_WANT_MARKS): read marks for curbuf only
|
---|
| 2518 | + * fp_out == NULL && (flags & VIF_GET_OLDFILES | VIF_FORCEIT): fill v:oldfiles
|
---|
| 2519 | */
|
---|
| 2520 | void
|
---|
| 2521 | -copy_viminfo_marks(virp, fp_out, count, eof)
|
---|
| 2522 | +copy_viminfo_marks(virp, fp_out, count, eof, flags)
|
---|
| 2523 | vir_T *virp;
|
---|
| 2524 | FILE *fp_out;
|
---|
| 2525 | int count;
|
---|
| 2526 | int eof;
|
---|
| 2527 | + int flags;
|
---|
| 2528 | {
|
---|
| 2529 | char_u *line = virp->vir_line;
|
---|
| 2530 | buf_T *buf;
|
---|
| 2531 | @@ -1647,10 +1649,23 @@
|
---|
| 2532 | char_u *p;
|
---|
| 2533 | char_u *name_buf;
|
---|
| 2534 | pos_T pos;
|
---|
| 2535 | +#ifdef FEAT_EVAL
|
---|
| 2536 | + list_T *list = NULL;
|
---|
| 2537 | +#endif
|
---|
| 2538 |
|
---|
| 2539 | if ((name_buf = alloc(LSIZE)) == NULL)
|
---|
| 2540 | return;
|
---|
| 2541 | *name_buf = NUL;
|
---|
| 2542 | +
|
---|
| 2543 | +#ifdef FEAT_EVAL
|
---|
| 2544 | + if (fp_out == NULL && (flags & (VIF_GET_OLDFILES | VIF_FORCEIT)))
|
---|
| 2545 | + {
|
---|
| 2546 | + list = list_alloc();
|
---|
| 2547 | + if (list != NULL)
|
---|
| 2548 | + set_vim_var_list(VV_OLDFILES, list);
|
---|
| 2549 | + }
|
---|
| 2550 | +#endif
|
---|
| 2551 | +
|
---|
| 2552 | num_marked_files = get_viminfo_parameter('\'');
|
---|
| 2553 | while (!eof && (count < num_marked_files || fp_out == NULL))
|
---|
| 2554 | {
|
---|
| 2555 | @@ -1681,6 +1696,11 @@
|
---|
| 2556 | p++;
|
---|
| 2557 | *p = NUL;
|
---|
| 2558 |
|
---|
| 2559 | +#ifdef FEAT_EVAL
|
---|
| 2560 | + if (list != NULL)
|
---|
| 2561 | + list_append_string(list, str, -1);
|
---|
| 2562 | +#endif
|
---|
| 2563 | +
|
---|
| 2564 | /*
|
---|
| 2565 | * If fp_out == NULL, load marks for current buffer.
|
---|
| 2566 | * If fp_out != NULL, copy marks for buffers not in buflist.
|
---|
| 2567 | @@ -1688,7 +1708,7 @@
|
---|
| 2568 | load_marks = copy_marks_out = FALSE;
|
---|
| 2569 | if (fp_out == NULL)
|
---|
| 2570 | {
|
---|
| 2571 | - if (curbuf->b_ffname != NULL)
|
---|
| 2572 | + if ((flags & VIF_WANT_MARKS) && curbuf->b_ffname != NULL)
|
---|
| 2573 | {
|
---|
| 2574 | if (*name_buf == NUL) /* only need to do this once */
|
---|
| 2575 | home_replace(NULL, curbuf->b_ffname, name_buf, LSIZE, TRUE);
|
---|
| 2576 | diff -Naur vim72.orig/src/mbyte.c vim72/src/mbyte.c
|
---|
| 2577 | --- vim72.orig/src/mbyte.c 2008-07-14 05:38:05.000000000 -0700
|
---|
| 2578 | +++ vim72/src/mbyte.c 2008-12-20 15:02:13.000000000 -0800
|
---|
| 2579 | @@ -717,7 +717,7 @@
|
---|
| 2580 | * where mblen() returns 0 for invalid character.
|
---|
| 2581 | * Therefore, following condition includes 0.
|
---|
| 2582 | */
|
---|
| 2583 | - (void)mblen(NULL, 0); /* First reset the state. */
|
---|
| 2584 | + ignored = mblen(NULL, 0); /* First reset the state. */
|
---|
| 2585 | if (mblen(buf, (size_t)1) <= 0)
|
---|
| 2586 | n = 2;
|
---|
| 2587 | else
|
---|
| 2588 | @@ -2540,7 +2540,6 @@
|
---|
| 2589 | return (int)(p - q);
|
---|
| 2590 | }
|
---|
| 2591 |
|
---|
| 2592 | -#if defined(FEAT_EVAL) || defined(PROTO)
|
---|
| 2593 | /*
|
---|
| 2594 | * Copy a character from "*fp" to "*tp" and advance the pointers.
|
---|
| 2595 | */
|
---|
| 2596 | @@ -2555,7 +2554,6 @@
|
---|
| 2597 | *tp += l;
|
---|
| 2598 | *fp += l;
|
---|
| 2599 | }
|
---|
| 2600 | -#endif
|
---|
| 2601 |
|
---|
| 2602 | /*
|
---|
| 2603 | * Return the offset from "p" to the first byte of a character. When "p" is
|
---|
| 2604 | @@ -3133,7 +3131,7 @@
|
---|
| 2605 | else
|
---|
| 2606 | s = p + 1;
|
---|
| 2607 | }
|
---|
| 2608 | - for (i = 0; s[i] != NUL && s + i < buf + sizeof(buf) - 1; ++i)
|
---|
| 2609 | + for (i = 0; s[i] != NUL && i < sizeof(buf) - 1; ++i)
|
---|
| 2610 | {
|
---|
| 2611 | if (s[i] == '_' || s[i] == '-')
|
---|
| 2612 | buf[i] = '-';
|
---|
| 2613 | @@ -5280,7 +5278,7 @@
|
---|
| 2614 |
|
---|
| 2615 | /*ARGSUSED*/
|
---|
| 2616 | static void
|
---|
| 2617 | -preedit_start_cbproc(XIC xic, XPointer client_data, XPointer call_data)
|
---|
| 2618 | +preedit_start_cbproc(XIC thexic, XPointer client_data, XPointer call_data)
|
---|
| 2619 | {
|
---|
| 2620 | #ifdef XIM_DEBUG
|
---|
| 2621 | xim_log("xim_decide_input_style()\n");
|
---|
| 2622 | @@ -5314,7 +5312,7 @@
|
---|
| 2623 |
|
---|
| 2624 | /*ARGSUSED*/
|
---|
| 2625 | static void
|
---|
| 2626 | -preedit_draw_cbproc(XIC xic, XPointer client_data, XPointer call_data)
|
---|
| 2627 | +preedit_draw_cbproc(XIC thexic, XPointer client_data, XPointer call_data)
|
---|
| 2628 | {
|
---|
| 2629 | XIMPreeditDrawCallbackStruct *draw_data;
|
---|
| 2630 | XIMText *text;
|
---|
| 2631 | @@ -5386,7 +5384,7 @@
|
---|
| 2632 | draw_feedback = (char *)alloc(draw_data->chg_first
|
---|
| 2633 | + text->length);
|
---|
| 2634 | else
|
---|
| 2635 | - draw_feedback = realloc(draw_feedback,
|
---|
| 2636 | + draw_feedback = vim_realloc(draw_feedback,
|
---|
| 2637 | draw_data->chg_first + text->length);
|
---|
| 2638 | if (draw_feedback != NULL)
|
---|
| 2639 | {
|
---|
| 2640 | @@ -5455,7 +5453,7 @@
|
---|
| 2641 |
|
---|
| 2642 | /*ARGSUSED*/
|
---|
| 2643 | static void
|
---|
| 2644 | -preedit_caret_cbproc(XIC xic, XPointer client_data, XPointer call_data)
|
---|
| 2645 | +preedit_caret_cbproc(XIC thexic, XPointer client_data, XPointer call_data)
|
---|
| 2646 | {
|
---|
| 2647 | #ifdef XIM_DEBUG
|
---|
| 2648 | xim_log("preedit_caret_cbproc()\n");
|
---|
| 2649 | @@ -5464,7 +5462,7 @@
|
---|
| 2650 |
|
---|
| 2651 | /*ARGSUSED*/
|
---|
| 2652 | static void
|
---|
| 2653 | -preedit_done_cbproc(XIC xic, XPointer client_data, XPointer call_data)
|
---|
| 2654 | +preedit_done_cbproc(XIC thexic, XPointer client_data, XPointer call_data)
|
---|
| 2655 | {
|
---|
| 2656 | #ifdef XIM_DEBUG
|
---|
| 2657 | xim_log("preedit_done_cbproc()\n");
|
---|
| 2658 | diff -Naur vim72.orig/src/menu.c vim72/src/menu.c
|
---|
| 2659 | --- vim72.orig/src/menu.c 2008-06-21 12:53:43.000000000 -0700
|
---|
| 2660 | +++ vim72/src/menu.c 2008-12-20 14:59:42.000000000 -0800
|
---|
| 2661 | @@ -1120,6 +1120,7 @@
|
---|
| 2662 | parent = menu;
|
---|
| 2663 | menu = menu->children;
|
---|
| 2664 | }
|
---|
| 2665 | + vim_free(path_name);
|
---|
| 2666 |
|
---|
| 2667 | /* Now we have found the matching menu, and we list the mappings */
|
---|
| 2668 | /* Highlight title */
|
---|
| 2669 | diff -Naur vim72.orig/src/message.c vim72/src/message.c
|
---|
| 2670 | --- vim72.orig/src/message.c 2008-07-09 11:24:55.000000000 -0700
|
---|
| 2671 | +++ vim72/src/message.c 2008-12-20 15:02:13.000000000 -0800
|
---|
| 2672 | @@ -4585,61 +4585,62 @@
|
---|
| 2673 | if (remove_trailing_zeroes)
|
---|
| 2674 | {
|
---|
| 2675 | int i;
|
---|
| 2676 | - char *p;
|
---|
| 2677 | + char *tp;
|
---|
| 2678 |
|
---|
| 2679 | /* Using %g or %G: remove superfluous zeroes. */
|
---|
| 2680 | if (fmt_spec == 'f')
|
---|
| 2681 | - p = tmp + str_arg_l - 1;
|
---|
| 2682 | + tp = tmp + str_arg_l - 1;
|
---|
| 2683 | else
|
---|
| 2684 | {
|
---|
| 2685 | - p = (char *)vim_strchr((char_u *)tmp,
|
---|
| 2686 | + tp = (char *)vim_strchr((char_u *)tmp,
|
---|
| 2687 | fmt_spec == 'e' ? 'e' : 'E');
|
---|
| 2688 | - if (p != NULL)
|
---|
| 2689 | + if (tp != NULL)
|
---|
| 2690 | {
|
---|
| 2691 | /* Remove superfluous '+' and leading
|
---|
| 2692 | * zeroes from the exponent. */
|
---|
| 2693 | - if (p[1] == '+')
|
---|
| 2694 | + if (tp[1] == '+')
|
---|
| 2695 | {
|
---|
| 2696 | /* Change "1.0e+07" to "1.0e07" */
|
---|
| 2697 | - STRMOVE(p + 1, p + 2);
|
---|
| 2698 | + STRMOVE(tp + 1, tp + 2);
|
---|
| 2699 | --str_arg_l;
|
---|
| 2700 | }
|
---|
| 2701 | - i = (p[1] == '-') ? 2 : 1;
|
---|
| 2702 | - while (p[i] == '0')
|
---|
| 2703 | + i = (tp[1] == '-') ? 2 : 1;
|
---|
| 2704 | + while (tp[i] == '0')
|
---|
| 2705 | {
|
---|
| 2706 | /* Change "1.0e07" to "1.0e7" */
|
---|
| 2707 | - STRMOVE(p + i, p + i + 1);
|
---|
| 2708 | + STRMOVE(tp + i, tp + i + 1);
|
---|
| 2709 | --str_arg_l;
|
---|
| 2710 | }
|
---|
| 2711 | - --p;
|
---|
| 2712 | + --tp;
|
---|
| 2713 | }
|
---|
| 2714 | }
|
---|
| 2715 |
|
---|
| 2716 | - if (p != NULL && !precision_specified)
|
---|
| 2717 | + if (tp != NULL && !precision_specified)
|
---|
| 2718 | /* Remove trailing zeroes, but keep the one
|
---|
| 2719 | * just after a dot. */
|
---|
| 2720 | - while (p > tmp + 2 && *p == '0' && p[-1] != '.')
|
---|
| 2721 | + while (tp > tmp + 2 && *tp == '0'
|
---|
| 2722 | + && tp[-1] != '.')
|
---|
| 2723 | {
|
---|
| 2724 | - STRMOVE(p, p + 1);
|
---|
| 2725 | - --p;
|
---|
| 2726 | + STRMOVE(tp, tp + 1);
|
---|
| 2727 | + --tp;
|
---|
| 2728 | --str_arg_l;
|
---|
| 2729 | }
|
---|
| 2730 | }
|
---|
| 2731 | else
|
---|
| 2732 | {
|
---|
| 2733 | - char *p;
|
---|
| 2734 | + char *tp;
|
---|
| 2735 |
|
---|
| 2736 | /* Be consistent: some printf("%e") use 1.0e+12
|
---|
| 2737 | * and some 1.0e+012. Remove one zero in the last
|
---|
| 2738 | * case. */
|
---|
| 2739 | - p = (char *)vim_strchr((char_u *)tmp,
|
---|
| 2740 | + tp = (char *)vim_strchr((char_u *)tmp,
|
---|
| 2741 | fmt_spec == 'e' ? 'e' : 'E');
|
---|
| 2742 | - if (p != NULL && (p[1] == '+' || p[1] == '-')
|
---|
| 2743 | - && p[2] == '0'
|
---|
| 2744 | - && vim_isdigit(p[3])
|
---|
| 2745 | - && vim_isdigit(p[4]))
|
---|
| 2746 | + if (tp != NULL && (tp[1] == '+' || tp[1] == '-')
|
---|
| 2747 | + && tp[2] == '0'
|
---|
| 2748 | + && vim_isdigit(tp[3])
|
---|
| 2749 | + && vim_isdigit(tp[4]))
|
---|
| 2750 | {
|
---|
| 2751 | - STRMOVE(p + 2, p + 3);
|
---|
| 2752 | + STRMOVE(tp + 2, tp + 3);
|
---|
| 2753 | --str_arg_l;
|
---|
| 2754 | }
|
---|
| 2755 | }
|
---|
| 2756 | diff -Naur vim72.orig/src/misc1.c vim72/src/misc1.c
|
---|
| 2757 | --- vim72.orig/src/misc1.c 2008-07-12 12:20:53.000000000 -0700
|
---|
| 2758 | +++ vim72/src/misc1.c 2008-12-20 15:01:04.000000000 -0800
|
---|
| 2759 | @@ -3245,9 +3245,9 @@
|
---|
| 2760 |
|
---|
| 2761 | /* When using ":silent" assume that <CR> was entered. */
|
---|
| 2762 | if (mouse_used != NULL)
|
---|
| 2763 | - MSG_PUTS(_("Type number or click with mouse (<Enter> cancels): "));
|
---|
| 2764 | + MSG_PUTS(_("Type number and <Enter> or click with mouse (empty cancels): "));
|
---|
| 2765 | else
|
---|
| 2766 | - MSG_PUTS(_("Choice number (<Enter> cancels): "));
|
---|
| 2767 | + MSG_PUTS(_("Type number and <Enter> (empty cancels): "));
|
---|
| 2768 |
|
---|
| 2769 | /* Set the state such that text can be selected/copied/pasted and we still
|
---|
| 2770 | * get mouse events. */
|
---|
| 2771 | diff -Naur vim72.orig/src/misc2.c vim72/src/misc2.c
|
---|
| 2772 | --- vim72.orig/src/misc2.c 2008-07-23 12:12:56.000000000 -0700
|
---|
| 2773 | +++ vim72/src/misc2.c 2008-12-20 15:01:15.000000000 -0800
|
---|
| 2774 | @@ -873,7 +873,7 @@
|
---|
| 2775 | /* 3. check for available memory: call mch_avail_mem() */
|
---|
| 2776 | if (mch_avail_mem(TRUE) < KEEP_ROOM && !releasing)
|
---|
| 2777 | {
|
---|
| 2778 | - vim_free((char *)p); /* System is low... no go! */
|
---|
| 2779 | + free((char *)p); /* System is low... no go! */
|
---|
| 2780 | p = NULL;
|
---|
| 2781 | }
|
---|
| 2782 | else
|
---|
| 2783 | @@ -1257,7 +1257,6 @@
|
---|
| 2784 | return escaped_string;
|
---|
| 2785 | }
|
---|
| 2786 |
|
---|
| 2787 | -#if !defined(BACKSLASH_IN_FILENAME) || defined(FEAT_EVAL) || defined(PROTO)
|
---|
| 2788 | /*
|
---|
| 2789 | * Return TRUE when 'shell' has "csh" in the tail.
|
---|
| 2790 | */
|
---|
| 2791 | @@ -1266,9 +1265,7 @@
|
---|
| 2792 | {
|
---|
| 2793 | return (strstr((char *)gettail(p_sh), "csh") != NULL);
|
---|
| 2794 | }
|
---|
| 2795 | -#endif
|
---|
| 2796 |
|
---|
| 2797 | -#if defined(FEAT_EVAL) || defined(PROTO)
|
---|
| 2798 | /*
|
---|
| 2799 | * Escape "string" for use as a shell argument with system().
|
---|
| 2800 | * This uses single quotes, except when we know we need to use double qoutes
|
---|
| 2801 | @@ -1391,7 +1388,6 @@
|
---|
| 2802 |
|
---|
| 2803 | return escaped_string;
|
---|
| 2804 | }
|
---|
| 2805 | -#endif
|
---|
| 2806 |
|
---|
| 2807 | /*
|
---|
| 2808 | * Like vim_strsave(), but make all characters uppercase.
|
---|
| 2809 | diff -Naur vim72.orig/src/move.c vim72/src/move.c
|
---|
| 2810 | --- vim72.orig/src/move.c 2008-07-12 09:26:47.000000000 -0700
|
---|
| 2811 | +++ vim72/src/move.c 2008-12-20 15:01:35.000000000 -0800
|
---|
| 2812 | @@ -280,18 +280,20 @@
|
---|
| 2813 |
|
---|
| 2814 | if (curwin->w_botline <= curbuf->b_ml.ml_line_count)
|
---|
| 2815 | {
|
---|
| 2816 | - if (curwin->w_cursor.lnum < curwin->w_botline
|
---|
| 2817 | - && ((long)curwin->w_cursor.lnum
|
---|
| 2818 | + if (curwin->w_cursor.lnum < curwin->w_botline)
|
---|
| 2819 | + {
|
---|
| 2820 | + if (((long)curwin->w_cursor.lnum
|
---|
| 2821 | >= (long)curwin->w_botline - p_so
|
---|
| 2822 | #ifdef FEAT_FOLDING
|
---|
| 2823 | || hasAnyFolding(curwin)
|
---|
| 2824 | #endif
|
---|
| 2825 | ))
|
---|
| 2826 | - {
|
---|
| 2827 | + {
|
---|
| 2828 | lineoff_T loff;
|
---|
| 2829 |
|
---|
| 2830 | - /* Cursor is above botline, check if there are 'scrolloff'
|
---|
| 2831 | - * window lines below the cursor. If not, need to scroll. */
|
---|
| 2832 | + /* Cursor is (a few lines) above botline, check if there are
|
---|
| 2833 | + * 'scrolloff' window lines below the cursor. If not, need to
|
---|
| 2834 | + * scroll. */
|
---|
| 2835 | n = curwin->w_empty_rows;
|
---|
| 2836 | loff.lnum = curwin->w_cursor.lnum;
|
---|
| 2837 | #ifdef FEAT_FOLDING
|
---|
| 2838 | @@ -317,6 +319,10 @@
|
---|
| 2839 | if (n >= p_so)
|
---|
| 2840 | /* sufficient context, no need to scroll */
|
---|
| 2841 | check_botline = FALSE;
|
---|
| 2842 | + }
|
---|
| 2843 | + else
|
---|
| 2844 | + /* sufficient context, no need to scroll */
|
---|
| 2845 | + check_botline = FALSE;
|
---|
| 2846 | }
|
---|
| 2847 | if (check_botline)
|
---|
| 2848 | {
|
---|
| 2849 | @@ -509,6 +515,9 @@
|
---|
| 2850 | /* Approximate the value of w_botline */
|
---|
| 2851 | wp->w_botline += lnum - wp->w_topline;
|
---|
| 2852 | wp->w_topline = lnum;
|
---|
| 2853 | +#ifdef FEAT_AUTOCMD
|
---|
| 2854 | + wp->w_topline_was_set = TRUE;
|
---|
| 2855 | +#endif
|
---|
| 2856 | #ifdef FEAT_DIFF
|
---|
| 2857 | wp->w_topfill = 0;
|
---|
| 2858 | #endif
|
---|
| 2859 | diff -Naur vim72.orig/src/netbeans.c vim72/src/netbeans.c
|
---|
| 2860 | --- vim72.orig/src/netbeans.c 2008-07-13 09:19:54.000000000 -0700
|
---|
| 2861 | +++ vim72/src/netbeans.c 2008-12-20 15:02:13.000000000 -0800
|
---|
| 2862 | @@ -1043,7 +1043,7 @@
|
---|
| 2863 | nbdebug(("EVT: %s", buf));
|
---|
| 2864 | /* nb_send(buf, "netbeans_end"); avoid "write failed" messages */
|
---|
| 2865 | if (sd >= 0)
|
---|
| 2866 | - sock_write(sd, buf, (int)STRLEN(buf)); /* ignore errors */
|
---|
| 2867 | + ignored = sock_write(sd, buf, (int)STRLEN(buf));
|
---|
| 2868 | }
|
---|
| 2869 | }
|
---|
| 2870 |
|
---|
| 2871 | @@ -2277,9 +2277,6 @@
|
---|
| 2872 | int serNum;
|
---|
| 2873 | int localTypeNum;
|
---|
| 2874 | int typeNum;
|
---|
| 2875 | -# ifdef NBDEBUG
|
---|
| 2876 | - int len;
|
---|
| 2877 | -# endif
|
---|
| 2878 | pos_T *pos;
|
---|
| 2879 |
|
---|
| 2880 | if (buf == NULL || buf->bufp == NULL)
|
---|
| 2881 | @@ -2303,13 +2300,10 @@
|
---|
| 2882 | pos = get_off_or_lnum(buf->bufp, &args);
|
---|
| 2883 |
|
---|
| 2884 | cp = (char *)args;
|
---|
| 2885 | -# ifdef NBDEBUG
|
---|
| 2886 | - len =
|
---|
| 2887 | -# endif
|
---|
| 2888 | - strtol(cp, &cp, 10);
|
---|
| 2889 | + ignored = (int)strtol(cp, &cp, 10);
|
---|
| 2890 | args = (char_u *)cp;
|
---|
| 2891 | # ifdef NBDEBUG
|
---|
| 2892 | - if (len != -1)
|
---|
| 2893 | + if (ignored != -1)
|
---|
| 2894 | {
|
---|
| 2895 | nbdebug((" partial line annotation -- Not Yet Implemented!\n"));
|
---|
| 2896 | }
|
---|
| 2897 | diff -Naur vim72.orig/src/normal.c vim72/src/normal.c
|
---|
| 2898 | --- vim72.orig/src/normal.c 2008-07-31 13:03:08.000000000 -0700
|
---|
| 2899 | +++ vim72/src/normal.c 2008-12-20 15:01:52.000000000 -0800
|
---|
| 2900 | @@ -183,6 +183,8 @@
|
---|
| 2901 | static void nv_cursorhold __ARGS((cmdarg_T *cap));
|
---|
| 2902 | #endif
|
---|
| 2903 |
|
---|
| 2904 | +static char *e_noident = N_("E349: No identifier under cursor");
|
---|
| 2905 | +
|
---|
| 2906 | /*
|
---|
| 2907 | * Function to be called for a Normal or Visual mode command.
|
---|
| 2908 | * The argument is a cmdarg_T.
|
---|
| 2909 | @@ -578,6 +580,9 @@
|
---|
| 2910 | static int old_mapped_len = 0;
|
---|
| 2911 | #endif
|
---|
| 2912 | int idx;
|
---|
| 2913 | +#ifdef FEAT_EVAL
|
---|
| 2914 | + int set_prevcount = FALSE;
|
---|
| 2915 | +#endif
|
---|
| 2916 |
|
---|
| 2917 | vim_memset(&ca, 0, sizeof(ca)); /* also resets ca.retval */
|
---|
| 2918 | ca.oap = oap;
|
---|
| 2919 | @@ -613,7 +618,12 @@
|
---|
| 2920 | /* When not finishing an operator and no register name typed, reset the
|
---|
| 2921 | * count. */
|
---|
| 2922 | if (!finish_op && !oap->regname)
|
---|
| 2923 | + {
|
---|
| 2924 | ca.opcount = 0;
|
---|
| 2925 | +#ifdef FEAT_EVAL
|
---|
| 2926 | + set_prevcount = TRUE;
|
---|
| 2927 | +#endif
|
---|
| 2928 | + }
|
---|
| 2929 |
|
---|
| 2930 | #ifdef FEAT_AUTOCMD
|
---|
| 2931 | /* Restore counts from before receiving K_CURSORHOLD. This means after
|
---|
| 2932 | @@ -717,7 +727,15 @@
|
---|
| 2933 | * command, so that v:count can be used in an expression mapping
|
---|
| 2934 | * right after the count. */
|
---|
| 2935 | if (toplevel && stuff_empty())
|
---|
| 2936 | - set_vcount(ca.count0, ca.count0 == 0 ? 1 : ca.count0);
|
---|
| 2937 | + {
|
---|
| 2938 | + long count = ca.count0;
|
---|
| 2939 | +
|
---|
| 2940 | + /* multiply with ca.opcount the same way as below */
|
---|
| 2941 | + if (ca.opcount != 0)
|
---|
| 2942 | + count = ca.opcount * (count == 0 ? 1 : count);
|
---|
| 2943 | + set_vcount(count, count == 0 ? 1 : count, set_prevcount);
|
---|
| 2944 | + set_prevcount = FALSE; /* only set v:prevcount once */
|
---|
| 2945 | + }
|
---|
| 2946 | #endif
|
---|
| 2947 | if (ctrl_w)
|
---|
| 2948 | {
|
---|
| 2949 | @@ -804,7 +822,7 @@
|
---|
| 2950 | * Only set v:count when called from main() and not a stuffed command.
|
---|
| 2951 | */
|
---|
| 2952 | if (toplevel && stuff_empty())
|
---|
| 2953 | - set_vcount(ca.count0, ca.count1);
|
---|
| 2954 | + set_vcount(ca.count0, ca.count1, set_prevcount);
|
---|
| 2955 | #endif
|
---|
| 2956 |
|
---|
| 2957 | /*
|
---|
| 2958 | @@ -1132,7 +1150,8 @@
|
---|
| 2959 | out_flush();
|
---|
| 2960 | #endif
|
---|
| 2961 | #ifdef FEAT_AUTOCMD
|
---|
| 2962 | - did_cursorhold = FALSE;
|
---|
| 2963 | + if (ca.cmdchar != K_IGNORE)
|
---|
| 2964 | + did_cursorhold = FALSE;
|
---|
| 2965 | #endif
|
---|
| 2966 |
|
---|
| 2967 | State = NORMAL;
|
---|
| 2968 | @@ -3509,7 +3528,7 @@
|
---|
| 2969 | if (find_type & FIND_STRING)
|
---|
| 2970 | EMSG(_("E348: No string under cursor"));
|
---|
| 2971 | else
|
---|
| 2972 | - EMSG(_("E349: No identifier under cursor"));
|
---|
| 2973 | + EMSG(_(e_noident));
|
---|
| 2974 | return 0;
|
---|
| 2975 | }
|
---|
| 2976 | ptr += col;
|
---|
| 2977 | @@ -5469,6 +5488,20 @@
|
---|
| 2978 | STRCPY(buf, "he! ");
|
---|
| 2979 | else
|
---|
| 2980 | {
|
---|
| 2981 | + /* An external command will probably use an argument starting
|
---|
| 2982 | + * with "-" as an option. To avoid trouble we skip the "-". */
|
---|
| 2983 | + while (*ptr == '-' && n > 0)
|
---|
| 2984 | + {
|
---|
| 2985 | + ++ptr;
|
---|
| 2986 | + --n;
|
---|
| 2987 | + }
|
---|
| 2988 | + if (n == 0)
|
---|
| 2989 | + {
|
---|
| 2990 | + EMSG(_(e_noident)); /* found dashes only */
|
---|
| 2991 | + vim_free(buf);
|
---|
| 2992 | + return;
|
---|
| 2993 | + }
|
---|
| 2994 | +
|
---|
| 2995 | /* When a count is given, turn it into a range. Is this
|
---|
| 2996 | * really what we want? */
|
---|
| 2997 | isman = (STRCMP(kp, "man") == 0);
|
---|
| 2998 | @@ -5511,37 +5544,59 @@
|
---|
| 2999 | /*
|
---|
| 3000 | * Now grab the chars in the identifier
|
---|
| 3001 | */
|
---|
| 3002 | - if (cmdchar == '*')
|
---|
| 3003 | - aux_ptr = (char_u *)(p_magic ? "/.*~[^$\\" : "/^$\\");
|
---|
| 3004 | - else if (cmdchar == '#')
|
---|
| 3005 | - aux_ptr = (char_u *)(p_magic ? "/?.*~[^$\\" : "/?^$\\");
|
---|
| 3006 | - else if (cmdchar == 'K' && !kp_help)
|
---|
| 3007 | - aux_ptr = (char_u *)" \t\\\"|!";
|
---|
| 3008 | - else
|
---|
| 3009 | - /* Don't escape spaces and Tabs in a tag with a backslash */
|
---|
| 3010 | - aux_ptr = (char_u *)"\\|\"";
|
---|
| 3011 | -
|
---|
| 3012 | - p = buf + STRLEN(buf);
|
---|
| 3013 | - while (n-- > 0)
|
---|
| 3014 | - {
|
---|
| 3015 | - /* put a backslash before \ and some others */
|
---|
| 3016 | - if (vim_strchr(aux_ptr, *ptr) != NULL)
|
---|
| 3017 | - *p++ = '\\';
|
---|
| 3018 | -#ifdef FEAT_MBYTE
|
---|
| 3019 | - /* When current byte is a part of multibyte character, copy all bytes
|
---|
| 3020 | - * of that character. */
|
---|
| 3021 | - if (has_mbyte)
|
---|
| 3022 | + if (cmdchar == 'K' && !kp_help)
|
---|
| 3023 | + {
|
---|
| 3024 | + /* Escape the argument properly for a shell command */
|
---|
| 3025 | + ptr = vim_strnsave(ptr, n);
|
---|
| 3026 | + p = vim_strsave_shellescape(ptr, TRUE);
|
---|
| 3027 | + vim_free(ptr);
|
---|
| 3028 | + if (p == NULL)
|
---|
| 3029 | {
|
---|
| 3030 | - int i;
|
---|
| 3031 | - int len = (*mb_ptr2len)(ptr) - 1;
|
---|
| 3032 | -
|
---|
| 3033 | - for (i = 0; i < len && n >= 1; ++i, --n)
|
---|
| 3034 | - *p++ = *ptr++;
|
---|
| 3035 | + vim_free(buf);
|
---|
| 3036 | + return;
|
---|
| 3037 | }
|
---|
| 3038 | + buf = (char_u *)vim_realloc(buf, STRLEN(buf) + STRLEN(p) + 1);
|
---|
| 3039 | + if (buf == NULL)
|
---|
| 3040 | + {
|
---|
| 3041 | + vim_free(buf);
|
---|
| 3042 | + vim_free(p);
|
---|
| 3043 | + return;
|
---|
| 3044 | + }
|
---|
| 3045 | + STRCAT(buf, p);
|
---|
| 3046 | + vim_free(p);
|
---|
| 3047 | + }
|
---|
| 3048 | + else
|
---|
| 3049 | + {
|
---|
| 3050 | + if (cmdchar == '*')
|
---|
| 3051 | + aux_ptr = (char_u *)(p_magic ? "/.*~[^$\\" : "/^$\\");
|
---|
| 3052 | + else if (cmdchar == '#')
|
---|
| 3053 | + aux_ptr = (char_u *)(p_magic ? "/?.*~[^$\\" : "/?^$\\");
|
---|
| 3054 | + else
|
---|
| 3055 | + /* Don't escape spaces and Tabs in a tag with a backslash */
|
---|
| 3056 | + aux_ptr = (char_u *)"\\|\"\n*?[";
|
---|
| 3057 | +
|
---|
| 3058 | + p = buf + STRLEN(buf);
|
---|
| 3059 | + while (n-- > 0)
|
---|
| 3060 | + {
|
---|
| 3061 | + /* put a backslash before \ and some others */
|
---|
| 3062 | + if (vim_strchr(aux_ptr, *ptr) != NULL)
|
---|
| 3063 | + *p++ = '\\';
|
---|
| 3064 | +#ifdef FEAT_MBYTE
|
---|
| 3065 | + /* When current byte is a part of multibyte character, copy all
|
---|
| 3066 | + * bytes of that character. */
|
---|
| 3067 | + if (has_mbyte)
|
---|
| 3068 | + {
|
---|
| 3069 | + int i;
|
---|
| 3070 | + int len = (*mb_ptr2len)(ptr) - 1;
|
---|
| 3071 | +
|
---|
| 3072 | + for (i = 0; i < len && n >= 1; ++i, --n)
|
---|
| 3073 | + *p++ = *ptr++;
|
---|
| 3074 | + }
|
---|
| 3075 | #endif
|
---|
| 3076 | - *p++ = *ptr++;
|
---|
| 3077 | + *p++ = *ptr++;
|
---|
| 3078 | + }
|
---|
| 3079 | + *p = NUL;
|
---|
| 3080 | }
|
---|
| 3081 | - *p = NUL;
|
---|
| 3082 |
|
---|
| 3083 | /*
|
---|
| 3084 | * Execute the command.
|
---|
| 3085 | diff -Naur vim72.orig/src/ops.c vim72/src/ops.c
|
---|
| 3086 | --- vim72.orig/src/ops.c 2008-06-21 13:08:59.000000000 -0700
|
---|
| 3087 | +++ vim72/src/ops.c 2008-12-20 15:02:38.000000000 -0800
|
---|
| 3088 | @@ -2209,12 +2209,15 @@
|
---|
| 3089 | {
|
---|
| 3090 | for (; pos.lnum <= oap->end.lnum; ++pos.lnum)
|
---|
| 3091 | {
|
---|
| 3092 | + int one_change;
|
---|
| 3093 | +
|
---|
| 3094 | block_prep(oap, &bd, pos.lnum, FALSE);
|
---|
| 3095 | pos.col = bd.textcol;
|
---|
| 3096 | - did_change = swapchars(oap->op_type, &pos, bd.textlen);
|
---|
| 3097 | + one_change = swapchars(oap->op_type, &pos, bd.textlen);
|
---|
| 3098 | + did_change |= one_change;
|
---|
| 3099 |
|
---|
| 3100 | # ifdef FEAT_NETBEANS_INTG
|
---|
| 3101 | - if (usingNetbeans && did_change)
|
---|
| 3102 | + if (usingNetbeans && one_change)
|
---|
| 3103 | {
|
---|
| 3104 | char_u *ptr = ml_get_buf(curbuf, pos.lnum, FALSE);
|
---|
| 3105 |
|
---|
| 3106 | diff -Naur vim72.orig/src/option.c vim72/src/option.c
|
---|
| 3107 | --- vim72.orig/src/option.c 2008-07-18 06:05:33.000000000 -0700
|
---|
| 3108 | +++ vim72/src/option.c 2008-12-20 15:02:13.000000000 -0800
|
---|
| 3109 | @@ -2593,13 +2593,13 @@
|
---|
| 3110 | #ifdef FEAT_VIMINFO
|
---|
| 3111 | (char_u *)&p_viminfo, PV_NONE,
|
---|
| 3112 | #if defined(MSDOS) || defined(MSWIN) || defined(OS2)
|
---|
| 3113 | - {(char_u *)"", (char_u *)"'20,<50,s10,h,rA:,rB:"}
|
---|
| 3114 | + {(char_u *)"", (char_u *)"'100,<50,s10,h,rA:,rB:"}
|
---|
| 3115 | #else
|
---|
| 3116 | # ifdef AMIGA
|
---|
| 3117 | {(char_u *)"",
|
---|
| 3118 | - (char_u *)"'20,<50,s10,h,rdf0:,rdf1:,rdf2:"}
|
---|
| 3119 | + (char_u *)"'100,<50,s10,h,rdf0:,rdf1:,rdf2:"}
|
---|
| 3120 | # else
|
---|
| 3121 | - {(char_u *)"", (char_u *)"'20,<50,s10,h"}
|
---|
| 3122 | + {(char_u *)"", (char_u *)"'100,<50,s10,h"}
|
---|
| 3123 | # endif
|
---|
| 3124 | #endif
|
---|
| 3125 | #else
|
---|
| 3126 | @@ -7974,6 +7974,11 @@
|
---|
| 3127 | else /* curwin->w_p_scr > curwin->w_height */
|
---|
| 3128 | curwin->w_p_scr = curwin->w_height;
|
---|
| 3129 | }
|
---|
| 3130 | + if (p_hi < 0)
|
---|
| 3131 | + {
|
---|
| 3132 | + errmsg = e_positive;
|
---|
| 3133 | + p_hi = 0;
|
---|
| 3134 | + }
|
---|
| 3135 | if (p_report < 0)
|
---|
| 3136 | {
|
---|
| 3137 | errmsg = e_positive;
|
---|
| 3138 | @@ -8227,13 +8232,13 @@
|
---|
| 3139 | {
|
---|
| 3140 | if (number == 0 && string != NULL)
|
---|
| 3141 | {
|
---|
| 3142 | - int index;
|
---|
| 3143 | + int idx;
|
---|
| 3144 |
|
---|
| 3145 | /* Either we are given a string or we are setting option
|
---|
| 3146 | * to zero. */
|
---|
| 3147 | - for (index = 0; string[index] == '0'; ++index)
|
---|
| 3148 | + for (idx = 0; string[idx] == '0'; ++idx)
|
---|
| 3149 | ;
|
---|
| 3150 | - if (string[index] != NUL || index == 0)
|
---|
| 3151 | + if (string[idx] != NUL || idx == 0)
|
---|
| 3152 | {
|
---|
| 3153 | /* There's another character after zeros or the string
|
---|
| 3154 | * is empty. In both cases, we are trying to set a
|
---|
| 3155 | diff -Naur vim72.orig/src/os_unix.c vim72/src/os_unix.c
|
---|
| 3156 | --- vim72.orig/src/os_unix.c 2008-08-06 04:01:40.000000000 -0700
|
---|
| 3157 | +++ vim72/src/os_unix.c 2008-12-20 15:02:13.000000000 -0800
|
---|
| 3158 | @@ -315,12 +315,15 @@
|
---|
| 3159 | {-1, "Unknown!", FALSE}
|
---|
| 3160 | };
|
---|
| 3161 |
|
---|
| 3162 | +/*
|
---|
| 3163 | + * Write s[len] to the screen.
|
---|
| 3164 | + */
|
---|
| 3165 | void
|
---|
| 3166 | mch_write(s, len)
|
---|
| 3167 | char_u *s;
|
---|
| 3168 | int len;
|
---|
| 3169 | {
|
---|
| 3170 | - write(1, (char *)s, len);
|
---|
| 3171 | + ignored = (int)write(1, (char *)s, len);
|
---|
| 3172 | if (p_wd) /* Unix is too fast, slow down a bit more */
|
---|
| 3173 | RealWaitForChar(read_cmd_fd, p_wd, NULL);
|
---|
| 3174 | }
|
---|
| 3175 | @@ -2905,7 +2908,7 @@
|
---|
| 3176 | * Ignore any errors.
|
---|
| 3177 | */
|
---|
| 3178 | #if defined(HAVE_SIGALTSTACK) || defined(HAVE_SIGSTACK)
|
---|
| 3179 | - signal_stack = malloc(SIGSTKSZ);
|
---|
| 3180 | + signal_stack = (char *)alloc(SIGSTKSZ);
|
---|
| 3181 | init_signal_stack();
|
---|
| 3182 | #endif
|
---|
| 3183 | }
|
---|
| 3184 | @@ -2936,7 +2939,8 @@
|
---|
| 3185 | }
|
---|
| 3186 | # endif
|
---|
| 3187 | # endif
|
---|
| 3188 | -# ifdef FEAT_X11
|
---|
| 3189 | + /* Don't close the display for GTK 1, it is done in exit(). */
|
---|
| 3190 | +# if defined(FEAT_X11) && (!defined(FEAT_GUI_GTK) || defined(HAVE_GTK2))
|
---|
| 3191 | if (x11_display != NULL
|
---|
| 3192 | # ifdef FEAT_XCLIPBOARD
|
---|
| 3193 | && x11_display != xterm_dpy
|
---|
| 3194 | @@ -3926,9 +3930,9 @@
|
---|
| 3195 | */
|
---|
| 3196 | if (fd >= 0)
|
---|
| 3197 | {
|
---|
| 3198 | - dup(fd); /* To replace stdin (file descriptor 0) */
|
---|
| 3199 | - dup(fd); /* To replace stdout (file descriptor 1) */
|
---|
| 3200 | - dup(fd); /* To replace stderr (file descriptor 2) */
|
---|
| 3201 | + ignored = dup(fd); /* To replace stdin (fd 0) */
|
---|
| 3202 | + ignored = dup(fd); /* To replace stdout (fd 1) */
|
---|
| 3203 | + ignored = dup(fd); /* To replace stderr (fd 2) */
|
---|
| 3204 |
|
---|
| 3205 | /* Don't need this now that we've duplicated it */
|
---|
| 3206 | close(fd);
|
---|
| 3207 | @@ -3996,13 +4000,13 @@
|
---|
| 3208 |
|
---|
| 3209 | /* set up stdin/stdout/stderr for the child */
|
---|
| 3210 | close(0);
|
---|
| 3211 | - dup(pty_slave_fd);
|
---|
| 3212 | + ignored = dup(pty_slave_fd);
|
---|
| 3213 | close(1);
|
---|
| 3214 | - dup(pty_slave_fd);
|
---|
| 3215 | + ignored = dup(pty_slave_fd);
|
---|
| 3216 | if (gui.in_use)
|
---|
| 3217 | {
|
---|
| 3218 | close(2);
|
---|
| 3219 | - dup(pty_slave_fd);
|
---|
| 3220 | + ignored = dup(pty_slave_fd);
|
---|
| 3221 | }
|
---|
| 3222 |
|
---|
| 3223 | close(pty_slave_fd); /* has been dupped, close it now */
|
---|
| 3224 | @@ -4013,13 +4017,13 @@
|
---|
| 3225 | /* set up stdin for the child */
|
---|
| 3226 | close(fd_toshell[1]);
|
---|
| 3227 | close(0);
|
---|
| 3228 | - dup(fd_toshell[0]);
|
---|
| 3229 | + ignored = dup(fd_toshell[0]);
|
---|
| 3230 | close(fd_toshell[0]);
|
---|
| 3231 |
|
---|
| 3232 | /* set up stdout for the child */
|
---|
| 3233 | close(fd_fromshell[0]);
|
---|
| 3234 | close(1);
|
---|
| 3235 | - dup(fd_fromshell[1]);
|
---|
| 3236 | + ignored = dup(fd_fromshell[1]);
|
---|
| 3237 | close(fd_fromshell[1]);
|
---|
| 3238 |
|
---|
| 3239 | # ifdef FEAT_GUI
|
---|
| 3240 | @@ -4027,7 +4031,7 @@
|
---|
| 3241 | {
|
---|
| 3242 | /* set up stderr for the child */
|
---|
| 3243 | close(2);
|
---|
| 3244 | - dup(1);
|
---|
| 3245 | + ignored = dup(1);
|
---|
| 3246 | }
|
---|
| 3247 | # endif
|
---|
| 3248 | }
|
---|
| 3249 | @@ -4158,7 +4162,8 @@
|
---|
| 3250 | && (lnum !=
|
---|
| 3251 | curbuf->b_ml.ml_line_count
|
---|
| 3252 | || curbuf->b_p_eol)))
|
---|
| 3253 | - write(toshell_fd, "\n", (size_t)1);
|
---|
| 3254 | + ignored = write(toshell_fd, "\n",
|
---|
| 3255 | + (size_t)1);
|
---|
| 3256 | ++lnum;
|
---|
| 3257 | if (lnum > curbuf->b_op_end.lnum)
|
---|
| 3258 | {
|
---|
| 3259 | @@ -6814,7 +6819,8 @@
|
---|
| 3260 | if (xsmp_icefd != -1)
|
---|
| 3261 | {
|
---|
| 3262 | SmcCloseConnection(xsmp.smcconn, 0, NULL);
|
---|
| 3263 | - vim_free(xsmp.clientid);
|
---|
| 3264 | + if (xsmp.clientid != NULL)
|
---|
| 3265 | + free(xsmp.clientid);
|
---|
| 3266 | xsmp.clientid = NULL;
|
---|
| 3267 | xsmp_icefd = -1;
|
---|
| 3268 | }
|
---|
| 3269 | diff -Naur vim72.orig/src/proto/eval.pro vim72/src/proto/eval.pro
|
---|
| 3270 | --- vim72.orig/src/proto/eval.pro 2008-08-09 07:31:25.000000000 -0700
|
---|
| 3271 | +++ vim72/src/proto/eval.pro 2008-12-20 15:01:52.000000000 -0800
|
---|
| 3272 | @@ -17,7 +17,7 @@
|
---|
| 3273 | int eval_to_bool __ARGS((char_u *arg, int *error, char_u **nextcmd, int skip));
|
---|
| 3274 | char_u *eval_to_string_skip __ARGS((char_u *arg, char_u **nextcmd, int skip));
|
---|
| 3275 | int skip_expr __ARGS((char_u **pp));
|
---|
| 3276 | -char_u *eval_to_string __ARGS((char_u *arg, char_u **nextcmd, int dolist));
|
---|
| 3277 | +char_u *eval_to_string __ARGS((char_u *arg, char_u **nextcmd, int convert));
|
---|
| 3278 | char_u *eval_to_string_safe __ARGS((char_u *arg, char_u **nextcmd, int use_sandbox));
|
---|
| 3279 | int eval_to_number __ARGS((char_u *expr));
|
---|
| 3280 | list_T *eval_spell_expr __ARGS((char_u *badword, char_u *expr));
|
---|
| 3281 | @@ -46,7 +46,9 @@
|
---|
| 3282 | void list_unref __ARGS((list_T *l));
|
---|
| 3283 | void list_free __ARGS((list_T *l, int recurse));
|
---|
| 3284 | dictitem_T *dict_lookup __ARGS((hashitem_T *hi));
|
---|
| 3285 | +char_u *list_find_str __ARGS((list_T *l, long idx));
|
---|
| 3286 | int list_append_dict __ARGS((list_T *list, dict_T *dict));
|
---|
| 3287 | +int list_append_string __ARGS((list_T *l, char_u *str, int len));
|
---|
| 3288 | int garbage_collect __ARGS((void));
|
---|
| 3289 | dict_T *dict_alloc __ARGS((void));
|
---|
| 3290 | int dict_add_nr_str __ARGS((dict_T *d, char *key, long nr, char_u *str));
|
---|
| 3291 | @@ -58,8 +60,10 @@
|
---|
| 3292 | void set_vim_var_nr __ARGS((int idx, long val));
|
---|
| 3293 | long get_vim_var_nr __ARGS((int idx));
|
---|
| 3294 | char_u *get_vim_var_str __ARGS((int idx));
|
---|
| 3295 | -void set_vcount __ARGS((long count, long count1));
|
---|
| 3296 | +list_T *get_vim_var_list __ARGS((int idx));
|
---|
| 3297 | +void set_vcount __ARGS((long count, long count1, int set_prevcount));
|
---|
| 3298 | void set_vim_var_string __ARGS((int idx, char_u *val, int len));
|
---|
| 3299 | +void set_vim_var_list __ARGS((int idx, list_T *val));
|
---|
| 3300 | void set_reg_var __ARGS((int c));
|
---|
| 3301 | char_u *v_exception __ARGS((char_u *oldval));
|
---|
| 3302 | char_u *v_throwpoint __ARGS((char_u *oldval));
|
---|
| 3303 | @@ -94,6 +98,7 @@
|
---|
| 3304 | void write_viminfo_varlist __ARGS((FILE *fp));
|
---|
| 3305 | int store_session_globals __ARGS((FILE *fd));
|
---|
| 3306 | void last_set_msg __ARGS((scid_T scriptID));
|
---|
| 3307 | +void ex_oldfiles __ARGS((exarg_T *eap));
|
---|
| 3308 | int modify_fname __ARGS((char_u *src, int *usedlen, char_u **fnamep, char_u **bufp, int *fnamelen));
|
---|
| 3309 | char_u *do_string_sub __ARGS((char_u *str, char_u *pat, char_u *sub, char_u *flags));
|
---|
| 3310 | /* vim: set ft=c : */
|
---|
| 3311 | diff -Naur vim72.orig/src/proto/ex_cmds.pro vim72/src/proto/ex_cmds.pro
|
---|
| 3312 | --- vim72.orig/src/proto/ex_cmds.pro 2008-08-09 07:31:25.000000000 -0700
|
---|
| 3313 | +++ vim72/src/proto/ex_cmds.pro 2008-12-20 15:01:04.000000000 -0800
|
---|
| 3314 | @@ -11,7 +11,7 @@
|
---|
| 3315 | char_u *make_filter_cmd __ARGS((char_u *cmd, char_u *itmp, char_u *otmp));
|
---|
| 3316 | void append_redir __ARGS((char_u *buf, char_u *opt, char_u *fname));
|
---|
| 3317 | int viminfo_error __ARGS((char *errnum, char *message, char_u *line));
|
---|
| 3318 | -int read_viminfo __ARGS((char_u *file, int want_info, int want_marks, int forceit));
|
---|
| 3319 | +int read_viminfo __ARGS((char_u *file, int flags));
|
---|
| 3320 | void write_viminfo __ARGS((char_u *file, int forceit));
|
---|
| 3321 | int viminfo_readline __ARGS((vir_T *virp));
|
---|
| 3322 | char_u *viminfo_readstring __ARGS((vir_T *virp, int off, int convert));
|
---|
| 3323 | diff -Naur vim72.orig/src/proto/ex_getln.pro vim72/src/proto/ex_getln.pro
|
---|
| 3324 | --- vim72.orig/src/proto/ex_getln.pro 2008-08-09 07:31:28.000000000 -0700
|
---|
| 3325 | +++ vim72/src/proto/ex_getln.pro 2008-12-20 15:02:01.000000000 -0800
|
---|
| 3326 | @@ -31,7 +31,7 @@
|
---|
| 3327 | void set_cmd_context __ARGS((expand_T *xp, char_u *str, int len, int col));
|
---|
| 3328 | int expand_cmdline __ARGS((expand_T *xp, char_u *str, int col, int *matchcount, char_u ***matches));
|
---|
| 3329 | int ExpandGeneric __ARGS((expand_T *xp, regmatch_T *regmatch, int *num_file, char_u ***file, char_u *((*func)(expand_T *, int))));
|
---|
| 3330 | -char_u *globpath __ARGS((char_u *path, char_u *file));
|
---|
| 3331 | +char_u *globpath __ARGS((char_u *path, char_u *file, int expand_options));
|
---|
| 3332 | void init_history __ARGS((void));
|
---|
| 3333 | int get_histtype __ARGS((char_u *name));
|
---|
| 3334 | void add_to_history __ARGS((int histype, char_u *new_entry, int in_map, int sep));
|
---|
| 3335 | diff -Naur vim72.orig/src/proto/mark.pro vim72/src/proto/mark.pro
|
---|
| 3336 | --- vim72.orig/src/proto/mark.pro 2008-08-09 07:31:36.000000000 -0700
|
---|
| 3337 | +++ vim72/src/proto/mark.pro 2008-12-20 15:01:04.000000000 -0800
|
---|
| 3338 | @@ -26,5 +26,5 @@
|
---|
| 3339 | void write_viminfo_filemarks __ARGS((FILE *fp));
|
---|
| 3340 | int removable __ARGS((char_u *name));
|
---|
| 3341 | int write_viminfo_marks __ARGS((FILE *fp_out));
|
---|
| 3342 | -void copy_viminfo_marks __ARGS((vir_T *virp, FILE *fp_out, int count, int eof));
|
---|
| 3343 | +void copy_viminfo_marks __ARGS((vir_T *virp, FILE *fp_out, int count, int eof, int flags));
|
---|
| 3344 | /* vim: set ft=c : */
|
---|
| 3345 | diff -Naur vim72.orig/src/pty.c vim72/src/pty.c
|
---|
| 3346 | --- vim72.orig/src/pty.c 2008-06-21 11:52:58.000000000 -0700
|
---|
| 3347 | +++ vim72/src/pty.c 2008-12-20 14:59:39.000000000 -0800
|
---|
| 3348 | @@ -270,9 +270,10 @@
|
---|
| 3349 | }
|
---|
| 3350 | #endif
|
---|
| 3351 |
|
---|
| 3352 | -#if defined(HAVE_SVR4_PTYS) && !defined(PTY_DONE) && !defined(hpux)
|
---|
| 3353 | +#if defined(HAVE_SVR4_PTYS) && !defined(PTY_DONE) && !defined(hpux) && !defined(MACOS_X)
|
---|
| 3354 |
|
---|
| 3355 | -/* NOTE: Even though HPUX can have /dev/ptmx, the code below doesn't work! */
|
---|
| 3356 | +/* NOTE: Even though HPUX can have /dev/ptmx, the code below doesn't work!
|
---|
| 3357 | + * Same for Mac OS X Leopard. */
|
---|
| 3358 | #define PTY_DONE
|
---|
| 3359 | int
|
---|
| 3360 | OpenPTY(ttyn)
|
---|
| 3361 | diff -Naur vim72.orig/src/screen.c vim72/src/screen.c
|
---|
| 3362 | --- vim72.orig/src/screen.c 2008-07-24 07:45:07.000000000 -0700
|
---|
| 3363 | +++ vim72/src/screen.c 2008-12-20 15:00:42.000000000 -0800
|
---|
| 3364 | @@ -2439,9 +2439,17 @@
|
---|
| 3365 |
|
---|
| 3366 | #ifdef FEAT_SYN_HL
|
---|
| 3367 | /* Show 'cursorcolumn' in the fold line. */
|
---|
| 3368 | - if (wp->w_p_cuc && (int)wp->w_virtcol + txtcol < W_WIDTH(wp))
|
---|
| 3369 | - ScreenAttrs[off + wp->w_virtcol + txtcol] = hl_combine_attr(
|
---|
| 3370 | - ScreenAttrs[off + wp->w_virtcol + txtcol], hl_attr(HLF_CUC));
|
---|
| 3371 | + if (wp->w_p_cuc)
|
---|
| 3372 | + {
|
---|
| 3373 | + txtcol += wp->w_virtcol;
|
---|
| 3374 | + if (wp->w_p_wrap)
|
---|
| 3375 | + txtcol -= wp->w_skipcol;
|
---|
| 3376 | + else
|
---|
| 3377 | + txtcol -= wp->w_leftcol;
|
---|
| 3378 | + if (txtcol >= 0 && txtcol < W_WIDTH(wp))
|
---|
| 3379 | + ScreenAttrs[off + txtcol] = hl_combine_attr(
|
---|
| 3380 | + ScreenAttrs[off + txtcol], hl_attr(HLF_CUC));
|
---|
| 3381 | + }
|
---|
| 3382 | #endif
|
---|
| 3383 |
|
---|
| 3384 | SCREEN_LINE(row + W_WINROW(wp), W_WINCOL(wp), (int)W_WIDTH(wp),
|
---|
| 3385 | diff -Naur vim72.orig/src/spell.c vim72/src/spell.c
|
---|
| 3386 | --- vim72.orig/src/spell.c 2008-07-12 12:20:55.000000000 -0700
|
---|
| 3387 | +++ vim72/src/spell.c 2008-12-20 15:02:52.000000000 -0800
|
---|
| 3388 | @@ -77,7 +77,7 @@
|
---|
| 3389 |
|
---|
| 3390 | /*
|
---|
| 3391 | * Do the opposite: based on a maximum end score and a known sound score,
|
---|
| 3392 | - * compute the the maximum word score that can be used.
|
---|
| 3393 | + * compute the maximum word score that can be used.
|
---|
| 3394 | */
|
---|
| 3395 | #define MAXSCORE(word_score, sound_score) ((4 * word_score - sound_score) / 3)
|
---|
| 3396 |
|
---|
| 3397 | @@ -469,6 +469,7 @@
|
---|
| 3398 | garray_T sl_comppat; /* CHECKCOMPOUNDPATTERN items */
|
---|
| 3399 | regprog_T *sl_compprog; /* COMPOUNDRULE turned into a regexp progrm
|
---|
| 3400 | * (NULL when no compounding) */
|
---|
| 3401 | + char_u *sl_comprules; /* all COMPOUNDRULE concatenated (or NULL) */
|
---|
| 3402 | char_u *sl_compstartflags; /* flags for first compound word */
|
---|
| 3403 | char_u *sl_compallflags; /* all flags for compound words */
|
---|
| 3404 | char_u sl_nobreak; /* When TRUE: no spaces between words */
|
---|
| 3405 | @@ -625,7 +626,7 @@
|
---|
| 3406 | /* TRUE if a word appears in the list of banned words. */
|
---|
| 3407 | #define WAS_BANNED(su, word) (!HASHITEM_EMPTY(hash_find(&su->su_banned, word)))
|
---|
| 3408 |
|
---|
| 3409 | -/* Number of suggestions kept when cleaning up. we need to keep more than
|
---|
| 3410 | +/* Number of suggestions kept when cleaning up. We need to keep more than
|
---|
| 3411 | * what is displayed, because when rescore_suggestions() is called the score
|
---|
| 3412 | * may change and wrong suggestions may be removed later. */
|
---|
| 3413 | #define SUG_CLEAN_COUNT(su) ((su)->su_maxcount < 130 ? 150 : (su)->su_maxcount + 20)
|
---|
| 3414 | @@ -839,7 +840,10 @@
|
---|
| 3415 | static void slang_clear __ARGS((slang_T *lp));
|
---|
| 3416 | static void slang_clear_sug __ARGS((slang_T *lp));
|
---|
| 3417 | static void find_word __ARGS((matchinf_T *mip, int mode));
|
---|
| 3418 | +static int match_checkcompoundpattern __ARGS((char_u *ptr, int wlen, garray_T *gap));
|
---|
| 3419 | static int can_compound __ARGS((slang_T *slang, char_u *word, char_u *flags));
|
---|
| 3420 | +static int can_be_compound __ARGS((trystate_T *sp, slang_T *slang, char_u *compflags, int flag));
|
---|
| 3421 | +static int match_compoundrule __ARGS((slang_T *slang, char_u *compflags));
|
---|
| 3422 | static int valid_word_prefix __ARGS((int totprefcnt, int arridx, int flags, char_u *word, slang_T *slang, int cond_req));
|
---|
| 3423 | static void find_prefix __ARGS((matchinf_T *mip, int mode));
|
---|
| 3424 | static int fold_more __ARGS((matchinf_T *mip));
|
---|
| 3425 | @@ -1519,6 +1523,11 @@
|
---|
| 3426 | ((unsigned)flags >> 24)))
|
---|
| 3427 | continue;
|
---|
| 3428 |
|
---|
| 3429 | + /* If there is a match with a CHECKCOMPOUNDPATTERN rule
|
---|
| 3430 | + * discard the compound word. */
|
---|
| 3431 | + if (match_checkcompoundpattern(ptr, wlen, &slang->sl_comppat))
|
---|
| 3432 | + continue;
|
---|
| 3433 | +
|
---|
| 3434 | if (mode == FIND_COMPOUND)
|
---|
| 3435 | {
|
---|
| 3436 | int capflags;
|
---|
| 3437 | @@ -1577,6 +1586,11 @@
|
---|
| 3438 | if (!can_compound(slang, fword, mip->mi_compflags))
|
---|
| 3439 | continue;
|
---|
| 3440 | }
|
---|
| 3441 | + else if (slang->sl_comprules != NULL
|
---|
| 3442 | + && !match_compoundrule(slang, mip->mi_compflags))
|
---|
| 3443 | + /* The compound flags collected so far do not match any
|
---|
| 3444 | + * COMPOUNDRULE, discard the compounded word. */
|
---|
| 3445 | + continue;
|
---|
| 3446 | }
|
---|
| 3447 |
|
---|
| 3448 | /* Check NEEDCOMPOUND: can't use word without compounding. */
|
---|
| 3449 | @@ -1727,6 +1741,39 @@
|
---|
| 3450 | }
|
---|
| 3451 |
|
---|
| 3452 | /*
|
---|
| 3453 | + * Return TRUE if there is a match between the word ptr[wlen] and
|
---|
| 3454 | + * CHECKCOMPOUNDPATTERN rules, assuming that we will concatenate with another
|
---|
| 3455 | + * word.
|
---|
| 3456 | + * A match means that the first part of CHECKCOMPOUNDPATTERN matches at the
|
---|
| 3457 | + * end of ptr[wlen] and the second part matches after it.
|
---|
| 3458 | + */
|
---|
| 3459 | + static int
|
---|
| 3460 | +match_checkcompoundpattern(ptr, wlen, gap)
|
---|
| 3461 | + char_u *ptr;
|
---|
| 3462 | + int wlen;
|
---|
| 3463 | + garray_T *gap; /* &sl_comppat */
|
---|
| 3464 | +{
|
---|
| 3465 | + int i;
|
---|
| 3466 | + char_u *p;
|
---|
| 3467 | + int len;
|
---|
| 3468 | +
|
---|
| 3469 | + for (i = 0; i + 1 < gap->ga_len; i += 2)
|
---|
| 3470 | + {
|
---|
| 3471 | + p = ((char_u **)gap->ga_data)[i + 1];
|
---|
| 3472 | + if (STRNCMP(ptr + wlen, p, STRLEN(p)) == 0)
|
---|
| 3473 | + {
|
---|
| 3474 | + /* Second part matches at start of following compound word, now
|
---|
| 3475 | + * check if first part matches at end of previous word. */
|
---|
| 3476 | + p = ((char_u **)gap->ga_data)[i];
|
---|
| 3477 | + len = (int)STRLEN(p);
|
---|
| 3478 | + if (len <= wlen && STRNCMP(ptr + wlen - len, p, len) == 0)
|
---|
| 3479 | + return TRUE;
|
---|
| 3480 | + }
|
---|
| 3481 | + }
|
---|
| 3482 | + return FALSE;
|
---|
| 3483 | +}
|
---|
| 3484 | +
|
---|
| 3485 | +/*
|
---|
| 3486 | * Return TRUE if "flags" is a valid sequence of compound flags and "word"
|
---|
| 3487 | * does not have too many syllables.
|
---|
| 3488 | */
|
---|
| 3489 | @@ -1773,6 +1820,98 @@
|
---|
| 3490 | }
|
---|
| 3491 |
|
---|
| 3492 | /*
|
---|
| 3493 | + * Return TRUE when the sequence of flags in "compflags" plus "flag" can
|
---|
| 3494 | + * possibly form a valid compounded word. This also checks the COMPOUNDRULE
|
---|
| 3495 | + * lines if they don't contain wildcards.
|
---|
| 3496 | + */
|
---|
| 3497 | + static int
|
---|
| 3498 | +can_be_compound(sp, slang, compflags, flag)
|
---|
| 3499 | + trystate_T *sp;
|
---|
| 3500 | + slang_T *slang;
|
---|
| 3501 | + char_u *compflags;
|
---|
| 3502 | + int flag;
|
---|
| 3503 | +{
|
---|
| 3504 | + /* If the flag doesn't appear in sl_compstartflags or sl_compallflags
|
---|
| 3505 | + * then it can't possibly compound. */
|
---|
| 3506 | + if (!byte_in_str(sp->ts_complen == sp->ts_compsplit
|
---|
| 3507 | + ? slang->sl_compstartflags : slang->sl_compallflags, flag))
|
---|
| 3508 | + return FALSE;
|
---|
| 3509 | +
|
---|
| 3510 | + /* If there are no wildcards, we can check if the flags collected so far
|
---|
| 3511 | + * possibly can form a match with COMPOUNDRULE patterns. This only
|
---|
| 3512 | + * makes sense when we have two or more words. */
|
---|
| 3513 | + if (slang->sl_comprules != NULL && sp->ts_complen > sp->ts_compsplit)
|
---|
| 3514 | + {
|
---|
| 3515 | + int v;
|
---|
| 3516 | +
|
---|
| 3517 | + compflags[sp->ts_complen] = flag;
|
---|
| 3518 | + compflags[sp->ts_complen + 1] = NUL;
|
---|
| 3519 | + v = match_compoundrule(slang, compflags + sp->ts_compsplit);
|
---|
| 3520 | + compflags[sp->ts_complen] = NUL;
|
---|
| 3521 | + return v;
|
---|
| 3522 | + }
|
---|
| 3523 | +
|
---|
| 3524 | + return TRUE;
|
---|
| 3525 | +}
|
---|
| 3526 | +
|
---|
| 3527 | +
|
---|
| 3528 | +/*
|
---|
| 3529 | + * Return TRUE if the compound flags in compflags[] match the start of any
|
---|
| 3530 | + * compound rule. This is used to stop trying a compound if the flags
|
---|
| 3531 | + * collected so far can't possibly match any compound rule.
|
---|
| 3532 | + * Caller must check that slang->sl_comprules is not NULL.
|
---|
| 3533 | + */
|
---|
| 3534 | + static int
|
---|
| 3535 | +match_compoundrule(slang, compflags)
|
---|
| 3536 | + slang_T *slang;
|
---|
| 3537 | + char_u *compflags;
|
---|
| 3538 | +{
|
---|
| 3539 | + char_u *p;
|
---|
| 3540 | + int i;
|
---|
| 3541 | + int c;
|
---|
| 3542 | +
|
---|
| 3543 | + /* loop over all the COMPOUNDRULE entries */
|
---|
| 3544 | + for (p = slang->sl_comprules; *p != NUL; ++p)
|
---|
| 3545 | + {
|
---|
| 3546 | + /* loop over the flags in the compound word we have made, match
|
---|
| 3547 | + * them against the current rule entry */
|
---|
| 3548 | + for (i = 0; ; ++i)
|
---|
| 3549 | + {
|
---|
| 3550 | + c = compflags[i];
|
---|
| 3551 | + if (c == NUL)
|
---|
| 3552 | + /* found a rule that matches for the flags we have so far */
|
---|
| 3553 | + return TRUE;
|
---|
| 3554 | + if (*p == '/' || *p == NUL)
|
---|
| 3555 | + break; /* end of rule, it's too short */
|
---|
| 3556 | + if (*p == '[')
|
---|
| 3557 | + {
|
---|
| 3558 | + int match = FALSE;
|
---|
| 3559 | +
|
---|
| 3560 | + /* compare against all the flags in [] */
|
---|
| 3561 | + ++p;
|
---|
| 3562 | + while (*p != ']' && *p != NUL)
|
---|
| 3563 | + if (*p++ == c)
|
---|
| 3564 | + match = TRUE;
|
---|
| 3565 | + if (!match)
|
---|
| 3566 | + break; /* none matches */
|
---|
| 3567 | + }
|
---|
| 3568 | + else if (*p != c)
|
---|
| 3569 | + break; /* flag of word doesn't match flag in pattern */
|
---|
| 3570 | + ++p;
|
---|
| 3571 | + }
|
---|
| 3572 | +
|
---|
| 3573 | + /* Skip to the next "/", where the next pattern starts. */
|
---|
| 3574 | + p = vim_strchr(p, '/');
|
---|
| 3575 | + if (p == NULL)
|
---|
| 3576 | + break;
|
---|
| 3577 | + }
|
---|
| 3578 | +
|
---|
| 3579 | + /* Checked all the rules and none of them match the flags, so there
|
---|
| 3580 | + * can't possibly be a compound starting with these flags. */
|
---|
| 3581 | + return FALSE;
|
---|
| 3582 | +}
|
---|
| 3583 | +
|
---|
| 3584 | +/*
|
---|
| 3585 | * Return non-zero if the prefix indicated by "arridx" matches with the prefix
|
---|
| 3586 | * ID in "flags" for the word "word".
|
---|
| 3587 | * The WF_RAREPFX flag is included in the return value for a rare prefix.
|
---|
| 3588 | @@ -2513,9 +2652,11 @@
|
---|
| 3589 | lp->sl_midword = NULL;
|
---|
| 3590 |
|
---|
| 3591 | vim_free(lp->sl_compprog);
|
---|
| 3592 | + vim_free(lp->sl_comprules);
|
---|
| 3593 | vim_free(lp->sl_compstartflags);
|
---|
| 3594 | vim_free(lp->sl_compallflags);
|
---|
| 3595 | lp->sl_compprog = NULL;
|
---|
| 3596 | + lp->sl_comprules = NULL;
|
---|
| 3597 | lp->sl_compstartflags = NULL;
|
---|
| 3598 | lp->sl_compallflags = NULL;
|
---|
| 3599 |
|
---|
| 3600 | @@ -3460,6 +3601,7 @@
|
---|
| 3601 | char_u *pp;
|
---|
| 3602 | char_u *cp;
|
---|
| 3603 | char_u *ap;
|
---|
| 3604 | + char_u *crp;
|
---|
| 3605 | int cnt;
|
---|
| 3606 | garray_T *gap;
|
---|
| 3607 |
|
---|
| 3608 | @@ -3545,6 +3687,12 @@
|
---|
| 3609 | slang->sl_compallflags = ap;
|
---|
| 3610 | *ap = NUL;
|
---|
| 3611 |
|
---|
| 3612 | + /* And a list of all patterns in their original form, for checking whether
|
---|
| 3613 | + * compounding may work in match_compoundrule(). This is freed when we
|
---|
| 3614 | + * encounter a wildcard, the check doesn't work then. */
|
---|
| 3615 | + crp = alloc(todo + 1);
|
---|
| 3616 | + slang->sl_comprules = crp;
|
---|
| 3617 | +
|
---|
| 3618 | pp = pat;
|
---|
| 3619 | *pp++ = '^';
|
---|
| 3620 | *pp++ = '\\';
|
---|
| 3621 | @@ -3587,6 +3735,20 @@
|
---|
| 3622 | atstart = 0;
|
---|
| 3623 | }
|
---|
| 3624 | }
|
---|
| 3625 | +
|
---|
| 3626 | + /* Copy flag to "sl_comprules", unless we run into a wildcard. */
|
---|
| 3627 | + if (crp != NULL)
|
---|
| 3628 | + {
|
---|
| 3629 | + if (c == '+' || c == '*')
|
---|
| 3630 | + {
|
---|
| 3631 | + vim_free(slang->sl_comprules);
|
---|
| 3632 | + slang->sl_comprules = NULL;
|
---|
| 3633 | + crp = NULL;
|
---|
| 3634 | + }
|
---|
| 3635 | + else
|
---|
| 3636 | + *crp++ = c;
|
---|
| 3637 | + }
|
---|
| 3638 | +
|
---|
| 3639 | if (c == '/') /* slash separates two items */
|
---|
| 3640 | {
|
---|
| 3641 | *pp++ = '\\';
|
---|
| 3642 | @@ -3611,6 +3773,9 @@
|
---|
| 3643 | *pp++ = '$';
|
---|
| 3644 | *pp = NUL;
|
---|
| 3645 |
|
---|
| 3646 | + if (crp != NULL)
|
---|
| 3647 | + *crp = NUL;
|
---|
| 3648 | +
|
---|
| 3649 | slang->sl_compprog = vim_regcomp(pat, RE_MAGIC + RE_STRING + RE_STRICT);
|
---|
| 3650 | vim_free(pat);
|
---|
| 3651 | if (slang->sl_compprog == NULL)
|
---|
| 3652 | @@ -4915,6 +5080,7 @@
|
---|
| 3653 | } spellinfo_T;
|
---|
| 3654 |
|
---|
| 3655 | static afffile_T *spell_read_aff __ARGS((spellinfo_T *spin, char_u *fname));
|
---|
| 3656 | +static int is_aff_rule __ARGS((char_u **items, int itemcnt, char *rulename, int mincount));
|
---|
| 3657 | static void aff_process_flags __ARGS((afffile_T *affile, affentry_T *entry));
|
---|
| 3658 | static int spell_info_item __ARGS((char_u *s));
|
---|
| 3659 | static unsigned affitem2flag __ARGS((int flagtype, char_u *item, char_u *fname, int lnum));
|
---|
| 3660 | @@ -4950,7 +5116,7 @@
|
---|
| 3661 | static void put_sugtime __ARGS((spellinfo_T *spin, FILE *fd));
|
---|
| 3662 | static int write_vim_spell __ARGS((spellinfo_T *spin, char_u *fname));
|
---|
| 3663 | static void clear_node __ARGS((wordnode_T *node));
|
---|
| 3664 | -static int put_node __ARGS((FILE *fd, wordnode_T *node, int index, int regionmask, int prefixtree));
|
---|
| 3665 | +static int put_node __ARGS((FILE *fd, wordnode_T *node, int idx, int regionmask, int prefixtree));
|
---|
| 3666 | static void spell_make_sugfile __ARGS((spellinfo_T *spin, char_u *wfname));
|
---|
| 3667 | static int sug_filltree __ARGS((spellinfo_T *spin, slang_T *slang));
|
---|
| 3668 | static int sug_maketable __ARGS((spellinfo_T *spin));
|
---|
| 3669 | @@ -5223,8 +5389,7 @@
|
---|
| 3670 | /* Handle non-empty lines. */
|
---|
| 3671 | if (itemcnt > 0)
|
---|
| 3672 | {
|
---|
| 3673 | - if (STRCMP(items[0], "SET") == 0 && itemcnt == 2
|
---|
| 3674 | - && aff->af_enc == NULL)
|
---|
| 3675 | + if (is_aff_rule(items, itemcnt, "SET", 2) && aff->af_enc == NULL)
|
---|
| 3676 | {
|
---|
| 3677 | #ifdef FEAT_MBYTE
|
---|
| 3678 | /* Setup for conversion from "ENC" to 'encoding'. */
|
---|
| 3679 | @@ -5239,7 +5404,7 @@
|
---|
| 3680 | smsg((char_u *)_("Conversion in %s not supported"), fname);
|
---|
| 3681 | #endif
|
---|
| 3682 | }
|
---|
| 3683 | - else if (STRCMP(items[0], "FLAG") == 0 && itemcnt == 2
|
---|
| 3684 | + else if (is_aff_rule(items, itemcnt, "FLAG", 2)
|
---|
| 3685 | && aff->af_flagtype == AFT_CHAR)
|
---|
| 3686 | {
|
---|
| 3687 | if (STRCMP(items[1], "long") == 0)
|
---|
| 3688 | @@ -5284,69 +5449,71 @@
|
---|
| 3689 | spin->si_info = p;
|
---|
| 3690 | }
|
---|
| 3691 | }
|
---|
| 3692 | - else if (STRCMP(items[0], "MIDWORD") == 0 && itemcnt == 2
|
---|
| 3693 | + else if (is_aff_rule(items, itemcnt, "MIDWORD", 2)
|
---|
| 3694 | && midword == NULL)
|
---|
| 3695 | {
|
---|
| 3696 | midword = getroom_save(spin, items[1]);
|
---|
| 3697 | }
|
---|
| 3698 | - else if (STRCMP(items[0], "TRY") == 0 && itemcnt == 2)
|
---|
| 3699 | + else if (is_aff_rule(items, itemcnt, "TRY", 2))
|
---|
| 3700 | {
|
---|
| 3701 | /* ignored, we look in the tree for what chars may appear */
|
---|
| 3702 | }
|
---|
| 3703 | /* TODO: remove "RAR" later */
|
---|
| 3704 | - else if ((STRCMP(items[0], "RAR") == 0
|
---|
| 3705 | - || STRCMP(items[0], "RARE") == 0) && itemcnt == 2
|
---|
| 3706 | - && aff->af_rare == 0)
|
---|
| 3707 | + else if ((is_aff_rule(items, itemcnt, "RAR", 2)
|
---|
| 3708 | + || is_aff_rule(items, itemcnt, "RARE", 2))
|
---|
| 3709 | + && aff->af_rare == 0)
|
---|
| 3710 | {
|
---|
| 3711 | aff->af_rare = affitem2flag(aff->af_flagtype, items[1],
|
---|
| 3712 | fname, lnum);
|
---|
| 3713 | }
|
---|
| 3714 | /* TODO: remove "KEP" later */
|
---|
| 3715 | - else if ((STRCMP(items[0], "KEP") == 0
|
---|
| 3716 | - || STRCMP(items[0], "KEEPCASE") == 0) && itemcnt == 2
|
---|
| 3717 | + else if ((is_aff_rule(items, itemcnt, "KEP", 2)
|
---|
| 3718 | + || is_aff_rule(items, itemcnt, "KEEPCASE", 2))
|
---|
| 3719 | && aff->af_keepcase == 0)
|
---|
| 3720 | {
|
---|
| 3721 | aff->af_keepcase = affitem2flag(aff->af_flagtype, items[1],
|
---|
| 3722 | fname, lnum);
|
---|
| 3723 | }
|
---|
| 3724 | - else if (STRCMP(items[0], "BAD") == 0 && itemcnt == 2
|
---|
| 3725 | - && aff->af_bad == 0)
|
---|
| 3726 | + else if ((is_aff_rule(items, itemcnt, "BAD", 2)
|
---|
| 3727 | + || is_aff_rule(items, itemcnt, "FORBIDDENWORD", 2))
|
---|
| 3728 | + && aff->af_bad == 0)
|
---|
| 3729 | {
|
---|
| 3730 | aff->af_bad = affitem2flag(aff->af_flagtype, items[1],
|
---|
| 3731 | fname, lnum);
|
---|
| 3732 | }
|
---|
| 3733 | - else if (STRCMP(items[0], "NEEDAFFIX") == 0 && itemcnt == 2
|
---|
| 3734 | + else if (is_aff_rule(items, itemcnt, "NEEDAFFIX", 2)
|
---|
| 3735 | && aff->af_needaffix == 0)
|
---|
| 3736 | {
|
---|
| 3737 | aff->af_needaffix = affitem2flag(aff->af_flagtype, items[1],
|
---|
| 3738 | fname, lnum);
|
---|
| 3739 | }
|
---|
| 3740 | - else if (STRCMP(items[0], "CIRCUMFIX") == 0 && itemcnt == 2
|
---|
| 3741 | + else if (is_aff_rule(items, itemcnt, "CIRCUMFIX", 2)
|
---|
| 3742 | && aff->af_circumfix == 0)
|
---|
| 3743 | {
|
---|
| 3744 | aff->af_circumfix = affitem2flag(aff->af_flagtype, items[1],
|
---|
| 3745 | fname, lnum);
|
---|
| 3746 | }
|
---|
| 3747 | - else if (STRCMP(items[0], "NOSUGGEST") == 0 && itemcnt == 2
|
---|
| 3748 | + else if (is_aff_rule(items, itemcnt, "NOSUGGEST", 2)
|
---|
| 3749 | && aff->af_nosuggest == 0)
|
---|
| 3750 | {
|
---|
| 3751 | aff->af_nosuggest = affitem2flag(aff->af_flagtype, items[1],
|
---|
| 3752 | fname, lnum);
|
---|
| 3753 | }
|
---|
| 3754 | - else if (STRCMP(items[0], "NEEDCOMPOUND") == 0 && itemcnt == 2
|
---|
| 3755 | + else if ((is_aff_rule(items, itemcnt, "NEEDCOMPOUND", 2)
|
---|
| 3756 | + || is_aff_rule(items, itemcnt, "ONLYINCOMPOUND", 2))
|
---|
| 3757 | && aff->af_needcomp == 0)
|
---|
| 3758 | {
|
---|
| 3759 | aff->af_needcomp = affitem2flag(aff->af_flagtype, items[1],
|
---|
| 3760 | fname, lnum);
|
---|
| 3761 | }
|
---|
| 3762 | - else if (STRCMP(items[0], "COMPOUNDROOT") == 0 && itemcnt == 2
|
---|
| 3763 | + else if (is_aff_rule(items, itemcnt, "COMPOUNDROOT", 2)
|
---|
| 3764 | && aff->af_comproot == 0)
|
---|
| 3765 | {
|
---|
| 3766 | aff->af_comproot = affitem2flag(aff->af_flagtype, items[1],
|
---|
| 3767 | fname, lnum);
|
---|
| 3768 | }
|
---|
| 3769 | - else if (STRCMP(items[0], "COMPOUNDFORBIDFLAG") == 0
|
---|
| 3770 | - && itemcnt == 2 && aff->af_compforbid == 0)
|
---|
| 3771 | + else if (is_aff_rule(items, itemcnt, "COMPOUNDFORBIDFLAG", 2)
|
---|
| 3772 | + && aff->af_compforbid == 0)
|
---|
| 3773 | {
|
---|
| 3774 | aff->af_compforbid = affitem2flag(aff->af_flagtype, items[1],
|
---|
| 3775 | fname, lnum);
|
---|
| 3776 | @@ -5354,8 +5521,8 @@
|
---|
| 3777 | smsg((char_u *)_("Defining COMPOUNDFORBIDFLAG after PFX item may give wrong results in %s line %d"),
|
---|
| 3778 | fname, lnum);
|
---|
| 3779 | }
|
---|
| 3780 | - else if (STRCMP(items[0], "COMPOUNDPERMITFLAG") == 0
|
---|
| 3781 | - && itemcnt == 2 && aff->af_comppermit == 0)
|
---|
| 3782 | + else if (is_aff_rule(items, itemcnt, "COMPOUNDPERMITFLAG", 2)
|
---|
| 3783 | + && aff->af_comppermit == 0)
|
---|
| 3784 | {
|
---|
| 3785 | aff->af_comppermit = affitem2flag(aff->af_flagtype, items[1],
|
---|
| 3786 | fname, lnum);
|
---|
| 3787 | @@ -5363,7 +5530,7 @@
|
---|
| 3788 | smsg((char_u *)_("Defining COMPOUNDPERMITFLAG after PFX item may give wrong results in %s line %d"),
|
---|
| 3789 | fname, lnum);
|
---|
| 3790 | }
|
---|
| 3791 | - else if (STRCMP(items[0], "COMPOUNDFLAG") == 0 && itemcnt == 2
|
---|
| 3792 | + else if (is_aff_rule(items, itemcnt, "COMPOUNDFLAG", 2)
|
---|
| 3793 | && compflags == NULL)
|
---|
| 3794 | {
|
---|
| 3795 | /* Turn flag "c" into COMPOUNDRULE compatible string "c+",
|
---|
| 3796 | @@ -5376,7 +5543,15 @@
|
---|
| 3797 | compflags = p;
|
---|
| 3798 | }
|
---|
| 3799 | }
|
---|
| 3800 | - else if (STRCMP(items[0], "COMPOUNDRULE") == 0 && itemcnt == 2)
|
---|
| 3801 | + else if (is_aff_rule(items, itemcnt, "COMPOUNDRULES", 2))
|
---|
| 3802 | + {
|
---|
| 3803 | + /* We don't use the count, but do check that it's a number and
|
---|
| 3804 | + * not COMPOUNDRULE mistyped. */
|
---|
| 3805 | + if (atoi((char *)items[1]) == 0)
|
---|
| 3806 | + smsg((char_u *)_("Wrong COMPOUNDRULES value in %s line %d: %s"),
|
---|
| 3807 | + fname, lnum, items[1]);
|
---|
| 3808 | + }
|
---|
| 3809 | + else if (is_aff_rule(items, itemcnt, "COMPOUNDRULE", 2))
|
---|
| 3810 | {
|
---|
| 3811 | /* Concatenate this string to previously defined ones, using a
|
---|
| 3812 | * slash to separate them. */
|
---|
| 3813 | @@ -5395,7 +5570,7 @@
|
---|
| 3814 | compflags = p;
|
---|
| 3815 | }
|
---|
| 3816 | }
|
---|
| 3817 | - else if (STRCMP(items[0], "COMPOUNDWORDMAX") == 0 && itemcnt == 2
|
---|
| 3818 | + else if (is_aff_rule(items, itemcnt, "COMPOUNDWORDMAX", 2)
|
---|
| 3819 | && compmax == 0)
|
---|
| 3820 | {
|
---|
| 3821 | compmax = atoi((char *)items[1]);
|
---|
| 3822 | @@ -5403,7 +5578,7 @@
|
---|
| 3823 | smsg((char_u *)_("Wrong COMPOUNDWORDMAX value in %s line %d: %s"),
|
---|
| 3824 | fname, lnum, items[1]);
|
---|
| 3825 | }
|
---|
| 3826 | - else if (STRCMP(items[0], "COMPOUNDMIN") == 0 && itemcnt == 2
|
---|
| 3827 | + else if (is_aff_rule(items, itemcnt, "COMPOUNDMIN", 2)
|
---|
| 3828 | && compminlen == 0)
|
---|
| 3829 | {
|
---|
| 3830 | compminlen = atoi((char *)items[1]);
|
---|
| 3831 | @@ -5411,7 +5586,7 @@
|
---|
| 3832 | smsg((char_u *)_("Wrong COMPOUNDMIN value in %s line %d: %s"),
|
---|
| 3833 | fname, lnum, items[1]);
|
---|
| 3834 | }
|
---|
| 3835 | - else if (STRCMP(items[0], "COMPOUNDSYLMAX") == 0 && itemcnt == 2
|
---|
| 3836 | + else if (is_aff_rule(items, itemcnt, "COMPOUNDSYLMAX", 2)
|
---|
| 3837 | && compsylmax == 0)
|
---|
| 3838 | {
|
---|
| 3839 | compsylmax = atoi((char *)items[1]);
|
---|
| 3840 | @@ -5419,32 +5594,29 @@
|
---|
| 3841 | smsg((char_u *)_("Wrong COMPOUNDSYLMAX value in %s line %d: %s"),
|
---|
| 3842 | fname, lnum, items[1]);
|
---|
| 3843 | }
|
---|
| 3844 | - else if (STRCMP(items[0], "CHECKCOMPOUNDDUP") == 0 && itemcnt == 1)
|
---|
| 3845 | + else if (is_aff_rule(items, itemcnt, "CHECKCOMPOUNDDUP", 1))
|
---|
| 3846 | {
|
---|
| 3847 | compoptions |= COMP_CHECKDUP;
|
---|
| 3848 | }
|
---|
| 3849 | - else if (STRCMP(items[0], "CHECKCOMPOUNDREP") == 0 && itemcnt == 1)
|
---|
| 3850 | + else if (is_aff_rule(items, itemcnt, "CHECKCOMPOUNDREP", 1))
|
---|
| 3851 | {
|
---|
| 3852 | compoptions |= COMP_CHECKREP;
|
---|
| 3853 | }
|
---|
| 3854 | - else if (STRCMP(items[0], "CHECKCOMPOUNDCASE") == 0 && itemcnt == 1)
|
---|
| 3855 | + else if (is_aff_rule(items, itemcnt, "CHECKCOMPOUNDCASE", 1))
|
---|
| 3856 | {
|
---|
| 3857 | compoptions |= COMP_CHECKCASE;
|
---|
| 3858 | }
|
---|
| 3859 | - else if (STRCMP(items[0], "CHECKCOMPOUNDTRIPLE") == 0
|
---|
| 3860 | - && itemcnt == 1)
|
---|
| 3861 | + else if (is_aff_rule(items, itemcnt, "CHECKCOMPOUNDTRIPLE", 1))
|
---|
| 3862 | {
|
---|
| 3863 | compoptions |= COMP_CHECKTRIPLE;
|
---|
| 3864 | }
|
---|
| 3865 | - else if (STRCMP(items[0], "CHECKCOMPOUNDPATTERN") == 0
|
---|
| 3866 | - && itemcnt == 2)
|
---|
| 3867 | + else if (is_aff_rule(items, itemcnt, "CHECKCOMPOUNDPATTERN", 2))
|
---|
| 3868 | {
|
---|
| 3869 | if (atoi((char *)items[1]) == 0)
|
---|
| 3870 | smsg((char_u *)_("Wrong CHECKCOMPOUNDPATTERN value in %s line %d: %s"),
|
---|
| 3871 | fname, lnum, items[1]);
|
---|
| 3872 | }
|
---|
| 3873 | - else if (STRCMP(items[0], "CHECKCOMPOUNDPATTERN") == 0
|
---|
| 3874 | - && itemcnt == 3)
|
---|
| 3875 | + else if (is_aff_rule(items, itemcnt, "CHECKCOMPOUNDPATTERN", 3))
|
---|
| 3876 | {
|
---|
| 3877 | garray_T *gap = &spin->si_comppat;
|
---|
| 3878 | int i;
|
---|
| 3879 | @@ -5463,24 +5635,24 @@
|
---|
| 3880 | = getroom_save(spin, items[2]);
|
---|
| 3881 | }
|
---|
| 3882 | }
|
---|
| 3883 | - else if (STRCMP(items[0], "SYLLABLE") == 0 && itemcnt == 2
|
---|
| 3884 | + else if (is_aff_rule(items, itemcnt, "SYLLABLE", 2)
|
---|
| 3885 | && syllable == NULL)
|
---|
| 3886 | {
|
---|
| 3887 | syllable = getroom_save(spin, items[1]);
|
---|
| 3888 | }
|
---|
| 3889 | - else if (STRCMP(items[0], "NOBREAK") == 0 && itemcnt == 1)
|
---|
| 3890 | + else if (is_aff_rule(items, itemcnt, "NOBREAK", 1))
|
---|
| 3891 | {
|
---|
| 3892 | spin->si_nobreak = TRUE;
|
---|
| 3893 | }
|
---|
| 3894 | - else if (STRCMP(items[0], "NOSPLITSUGS") == 0 && itemcnt == 1)
|
---|
| 3895 | + else if (is_aff_rule(items, itemcnt, "NOSPLITSUGS", 1))
|
---|
| 3896 | {
|
---|
| 3897 | spin->si_nosplitsugs = TRUE;
|
---|
| 3898 | }
|
---|
| 3899 | - else if (STRCMP(items[0], "NOSUGFILE") == 0 && itemcnt == 1)
|
---|
| 3900 | + else if (is_aff_rule(items, itemcnt, "NOSUGFILE", 1))
|
---|
| 3901 | {
|
---|
| 3902 | spin->si_nosugfile = TRUE;
|
---|
| 3903 | }
|
---|
| 3904 | - else if (STRCMP(items[0], "PFXPOSTPONE") == 0 && itemcnt == 1)
|
---|
| 3905 | + else if (is_aff_rule(items, itemcnt, "PFXPOSTPONE", 1))
|
---|
| 3906 | {
|
---|
| 3907 | aff->af_pfxpostpone = TRUE;
|
---|
| 3908 | }
|
---|
| 3909 | @@ -5771,24 +5943,20 @@
|
---|
| 3910 | }
|
---|
| 3911 | }
|
---|
| 3912 | }
|
---|
| 3913 | - else if (STRCMP(items[0], "FOL") == 0 && itemcnt == 2
|
---|
| 3914 | - && fol == NULL)
|
---|
| 3915 | + else if (is_aff_rule(items, itemcnt, "FOL", 2) && fol == NULL)
|
---|
| 3916 | {
|
---|
| 3917 | fol = vim_strsave(items[1]);
|
---|
| 3918 | }
|
---|
| 3919 | - else if (STRCMP(items[0], "LOW") == 0 && itemcnt == 2
|
---|
| 3920 | - && low == NULL)
|
---|
| 3921 | + else if (is_aff_rule(items, itemcnt, "LOW", 2) && low == NULL)
|
---|
| 3922 | {
|
---|
| 3923 | low = vim_strsave(items[1]);
|
---|
| 3924 | }
|
---|
| 3925 | - else if (STRCMP(items[0], "UPP") == 0 && itemcnt == 2
|
---|
| 3926 | - && upp == NULL)
|
---|
| 3927 | + else if (is_aff_rule(items, itemcnt, "UPP", 2) && upp == NULL)
|
---|
| 3928 | {
|
---|
| 3929 | upp = vim_strsave(items[1]);
|
---|
| 3930 | }
|
---|
| 3931 | - else if ((STRCMP(items[0], "REP") == 0
|
---|
| 3932 | - || STRCMP(items[0], "REPSAL") == 0)
|
---|
| 3933 | - && itemcnt == 2)
|
---|
| 3934 | + else if (is_aff_rule(items, itemcnt, "REP", 2)
|
---|
| 3935 | + || is_aff_rule(items, itemcnt, "REPSAL", 2))
|
---|
| 3936 | {
|
---|
| 3937 | /* Ignore REP/REPSAL count */;
|
---|
| 3938 | if (!isdigit(*items[1]))
|
---|
| 3939 | @@ -5819,7 +5987,7 @@
|
---|
| 3940 | : &spin->si_rep, items[1], items[2]);
|
---|
| 3941 | }
|
---|
| 3942 | }
|
---|
| 3943 | - else if (STRCMP(items[0], "MAP") == 0 && itemcnt == 2)
|
---|
| 3944 | + else if (is_aff_rule(items, itemcnt, "MAP", 2))
|
---|
| 3945 | {
|
---|
| 3946 | /* MAP item or count */
|
---|
| 3947 | if (!found_map)
|
---|
| 3948 | @@ -5856,9 +6024,8 @@
|
---|
| 3949 | ga_append(&spin->si_map, '/');
|
---|
| 3950 | }
|
---|
| 3951 | }
|
---|
| 3952 | - /* Accept "SAL from to" and "SAL from to # comment". */
|
---|
| 3953 | - else if (STRCMP(items[0], "SAL") == 0
|
---|
| 3954 | - && (itemcnt == 3 || (itemcnt > 3 && items[3][0] == '#')))
|
---|
| 3955 | + /* Accept "SAL from to" and "SAL from to #comment". */
|
---|
| 3956 | + else if (is_aff_rule(items, itemcnt, "SAL", 3))
|
---|
| 3957 | {
|
---|
| 3958 | if (do_sal)
|
---|
| 3959 | {
|
---|
| 3960 | @@ -5877,12 +6044,12 @@
|
---|
| 3961 | : items[2]);
|
---|
| 3962 | }
|
---|
| 3963 | }
|
---|
| 3964 | - else if (STRCMP(items[0], "SOFOFROM") == 0 && itemcnt == 2
|
---|
| 3965 | + else if (is_aff_rule(items, itemcnt, "SOFOFROM", 2)
|
---|
| 3966 | && sofofrom == NULL)
|
---|
| 3967 | {
|
---|
| 3968 | sofofrom = getroom_save(spin, items[1]);
|
---|
| 3969 | }
|
---|
| 3970 | - else if (STRCMP(items[0], "SOFOTO") == 0 && itemcnt == 2
|
---|
| 3971 | + else if (is_aff_rule(items, itemcnt, "SOFOTO", 2)
|
---|
| 3972 | && sofoto == NULL)
|
---|
| 3973 | {
|
---|
| 3974 | sofoto = getroom_save(spin, items[1]);
|
---|
| 3975 | @@ -5980,7 +6147,7 @@
|
---|
| 3976 | else if (spin->si_newprefID == 0 || spin->si_newprefID == 127)
|
---|
| 3977 | MSG(_("Too many compound flags"));
|
---|
| 3978 | else
|
---|
| 3979 | - MSG(_("Too many posponed prefixes and/or compound flags"));
|
---|
| 3980 | + MSG(_("Too many postponed prefixes and/or compound flags"));
|
---|
| 3981 | }
|
---|
| 3982 |
|
---|
| 3983 | if (syllable != NULL)
|
---|
| 3984 | @@ -6017,6 +6184,22 @@
|
---|
| 3985 | }
|
---|
| 3986 |
|
---|
| 3987 | /*
|
---|
| 3988 | + * Return TRUE when items[0] equals "rulename", there are "mincount" items or
|
---|
| 3989 | + * a comment is following after item "mincount".
|
---|
| 3990 | + */
|
---|
| 3991 | + static int
|
---|
| 3992 | +is_aff_rule(items, itemcnt, rulename, mincount)
|
---|
| 3993 | + char_u **items;
|
---|
| 3994 | + int itemcnt;
|
---|
| 3995 | + char *rulename;
|
---|
| 3996 | + int mincount;
|
---|
| 3997 | +{
|
---|
| 3998 | + return (STRCMP(items[0], rulename) == 0
|
---|
| 3999 | + && (itemcnt == mincount
|
---|
| 4000 | + || (itemcnt > mincount && items[mincount][0] == '#')));
|
---|
| 4001 | +}
|
---|
| 4002 | +
|
---|
| 4003 | +/*
|
---|
| 4004 | * For affix "entry" move COMPOUNDFORBIDFLAG and COMPOUNDPERMITFLAG from
|
---|
| 4005 | * ae_flags to ae_comppermit and ae_compforbid.
|
---|
| 4006 | */
|
---|
| 4007 | @@ -7926,6 +8109,8 @@
|
---|
| 4008 | char_u *p;
|
---|
| 4009 | int rr;
|
---|
| 4010 | int retval = OK;
|
---|
| 4011 | + size_t fwv = 1; /* collect return value of fwrite() to avoid
|
---|
| 4012 | + warnings from picky compiler */
|
---|
| 4013 |
|
---|
| 4014 | fd = mch_fopen((char *)fname, "w");
|
---|
| 4015 | if (fd == NULL)
|
---|
| 4016 | @@ -7936,11 +8121,11 @@
|
---|
| 4017 |
|
---|
| 4018 | /* <HEADER>: <fileID> <versionnr> */
|
---|
| 4019 | /* <fileID> */
|
---|
| 4020 | - if (fwrite(VIMSPELLMAGIC, VIMSPELLMAGICL, (size_t)1, fd) != 1)
|
---|
| 4021 | - {
|
---|
| 4022 | - EMSG(_(e_write));
|
---|
| 4023 | - retval = FAIL;
|
---|
| 4024 | - }
|
---|
| 4025 | + fwv &= fwrite(VIMSPELLMAGIC, VIMSPELLMAGICL, (size_t)1, fd);
|
---|
| 4026 | + if (fwv != (size_t)1)
|
---|
| 4027 | + /* Catch first write error, don't try writing more. */
|
---|
| 4028 | + goto theend;
|
---|
| 4029 | +
|
---|
| 4030 | putc(VIMSPELLVERSION, fd); /* <versionnr> */
|
---|
| 4031 |
|
---|
| 4032 | /*
|
---|
| 4033 | @@ -7955,7 +8140,7 @@
|
---|
| 4034 |
|
---|
| 4035 | i = (int)STRLEN(spin->si_info);
|
---|
| 4036 | put_bytes(fd, (long_u)i, 4); /* <sectionlen> */
|
---|
| 4037 | - fwrite(spin->si_info, (size_t)i, (size_t)1, fd); /* <infotext> */
|
---|
| 4038 | + fwv &= fwrite(spin->si_info, (size_t)i, (size_t)1, fd); /* <infotext> */
|
---|
| 4039 | }
|
---|
| 4040 |
|
---|
| 4041 | /* SN_REGION: <regionname> ...
|
---|
| 4042 | @@ -7966,7 +8151,7 @@
|
---|
| 4043 | putc(SNF_REQUIRED, fd); /* <sectionflags> */
|
---|
| 4044 | l = spin->si_region_count * 2;
|
---|
| 4045 | put_bytes(fd, (long_u)l, 4); /* <sectionlen> */
|
---|
| 4046 | - fwrite(spin->si_region_name, (size_t)l, (size_t)1, fd);
|
---|
| 4047 | + fwv &= fwrite(spin->si_region_name, (size_t)l, (size_t)1, fd);
|
---|
| 4048 | /* <regionname> ... */
|
---|
| 4049 | regionmask = (1 << spin->si_region_count) - 1;
|
---|
| 4050 | }
|
---|
| 4051 | @@ -8016,7 +8201,7 @@
|
---|
| 4052 | }
|
---|
| 4053 |
|
---|
| 4054 | put_bytes(fd, (long_u)l, 2); /* <folcharslen> */
|
---|
| 4055 | - fwrite(folchars, (size_t)l, (size_t)1, fd); /* <folchars> */
|
---|
| 4056 | + fwv &= fwrite(folchars, (size_t)l, (size_t)1, fd); /* <folchars> */
|
---|
| 4057 | }
|
---|
| 4058 |
|
---|
| 4059 | /* SN_MIDWORD: <midword> */
|
---|
| 4060 | @@ -8027,7 +8212,8 @@
|
---|
| 4061 |
|
---|
| 4062 | i = (int)STRLEN(spin->si_midword);
|
---|
| 4063 | put_bytes(fd, (long_u)i, 4); /* <sectionlen> */
|
---|
| 4064 | - fwrite(spin->si_midword, (size_t)i, (size_t)1, fd); /* <midword> */
|
---|
| 4065 | + fwv &= fwrite(spin->si_midword, (size_t)i, (size_t)1, fd);
|
---|
| 4066 | + /* <midword> */
|
---|
| 4067 | }
|
---|
| 4068 |
|
---|
| 4069 | /* SN_PREFCOND: <prefcondcnt> <prefcond> ... */
|
---|
| 4070 | @@ -8113,7 +8299,8 @@
|
---|
| 4071 | p = rr == 1 ? ftp->ft_from : ftp->ft_to;
|
---|
| 4072 | l = (int)STRLEN(p);
|
---|
| 4073 | putc(l, fd);
|
---|
| 4074 | - fwrite(p, l, (size_t)1, fd);
|
---|
| 4075 | + if (l > 0)
|
---|
| 4076 | + fwv &= fwrite(p, l, (size_t)1, fd);
|
---|
| 4077 | }
|
---|
| 4078 | }
|
---|
| 4079 |
|
---|
| 4080 | @@ -8131,11 +8318,11 @@
|
---|
| 4081 | /* <sectionlen> */
|
---|
| 4082 |
|
---|
| 4083 | put_bytes(fd, (long_u)l, 2); /* <sofofromlen> */
|
---|
| 4084 | - fwrite(spin->si_sofofr, l, (size_t)1, fd); /* <sofofrom> */
|
---|
| 4085 | + fwv &= fwrite(spin->si_sofofr, l, (size_t)1, fd); /* <sofofrom> */
|
---|
| 4086 |
|
---|
| 4087 | l = (int)STRLEN(spin->si_sofoto);
|
---|
| 4088 | put_bytes(fd, (long_u)l, 2); /* <sofotolen> */
|
---|
| 4089 | - fwrite(spin->si_sofoto, l, (size_t)1, fd); /* <sofoto> */
|
---|
| 4090 | + fwv &= fwrite(spin->si_sofoto, l, (size_t)1, fd); /* <sofoto> */
|
---|
| 4091 | }
|
---|
| 4092 |
|
---|
| 4093 | /* SN_WORDS: <word> ...
|
---|
| 4094 | @@ -8160,7 +8347,7 @@
|
---|
| 4095 | l = (int)STRLEN(hi->hi_key) + 1;
|
---|
| 4096 | len += l;
|
---|
| 4097 | if (round == 2) /* <word> */
|
---|
| 4098 | - fwrite(hi->hi_key, (size_t)l, (size_t)1, fd);
|
---|
| 4099 | + fwv &= fwrite(hi->hi_key, (size_t)l, (size_t)1, fd);
|
---|
| 4100 | --todo;
|
---|
| 4101 | }
|
---|
| 4102 | if (round == 1)
|
---|
| 4103 | @@ -8176,7 +8363,7 @@
|
---|
| 4104 | putc(0, fd); /* <sectionflags> */
|
---|
| 4105 | l = spin->si_map.ga_len;
|
---|
| 4106 | put_bytes(fd, (long_u)l, 4); /* <sectionlen> */
|
---|
| 4107 | - fwrite(spin->si_map.ga_data, (size_t)l, (size_t)1, fd);
|
---|
| 4108 | + fwv &= fwrite(spin->si_map.ga_data, (size_t)l, (size_t)1, fd);
|
---|
| 4109 | /* <mapstr> */
|
---|
| 4110 | }
|
---|
| 4111 |
|
---|
| 4112 | @@ -8232,10 +8419,11 @@
|
---|
| 4113 | {
|
---|
| 4114 | p = ((char_u **)(spin->si_comppat.ga_data))[i];
|
---|
| 4115 | putc((int)STRLEN(p), fd); /* <comppatlen> */
|
---|
| 4116 | - fwrite(p, (size_t)STRLEN(p), (size_t)1, fd);/* <comppattext> */
|
---|
| 4117 | + fwv &= fwrite(p, (size_t)STRLEN(p), (size_t)1, fd);
|
---|
| 4118 | + /* <comppattext> */
|
---|
| 4119 | }
|
---|
| 4120 | /* <compflags> */
|
---|
| 4121 | - fwrite(spin->si_compflags, (size_t)STRLEN(spin->si_compflags),
|
---|
| 4122 | + fwv &= fwrite(spin->si_compflags, (size_t)STRLEN(spin->si_compflags),
|
---|
| 4123 | (size_t)1, fd);
|
---|
| 4124 | }
|
---|
| 4125 |
|
---|
| 4126 | @@ -8259,7 +8447,8 @@
|
---|
| 4127 |
|
---|
| 4128 | l = (int)STRLEN(spin->si_syllable);
|
---|
| 4129 | put_bytes(fd, (long_u)l, 4); /* <sectionlen> */
|
---|
| 4130 | - fwrite(spin->si_syllable, (size_t)l, (size_t)1, fd); /* <syllable> */
|
---|
| 4131 | + fwv &= fwrite(spin->si_syllable, (size_t)l, (size_t)1, fd);
|
---|
| 4132 | + /* <syllable> */
|
---|
| 4133 | }
|
---|
| 4134 |
|
---|
| 4135 | /* end of <SECTIONS> */
|
---|
| 4136 | @@ -8295,13 +8484,18 @@
|
---|
| 4137 | (void)put_node(fd, tree, 0, regionmask, round == 3);
|
---|
| 4138 | }
|
---|
| 4139 |
|
---|
| 4140 | - /* Write another byte to check for errors. */
|
---|
| 4141 | + /* Write another byte to check for errors (file system full). */
|
---|
| 4142 | if (putc(0, fd) == EOF)
|
---|
| 4143 | retval = FAIL;
|
---|
| 4144 | -
|
---|
| 4145 | +theend:
|
---|
| 4146 | if (fclose(fd) == EOF)
|
---|
| 4147 | retval = FAIL;
|
---|
| 4148 |
|
---|
| 4149 | + if (fwv != (size_t)1)
|
---|
| 4150 | + retval = FAIL;
|
---|
| 4151 | + if (retval == FAIL)
|
---|
| 4152 | + EMSG(_(e_write));
|
---|
| 4153 | +
|
---|
| 4154 | return retval;
|
---|
| 4155 | }
|
---|
| 4156 |
|
---|
| 4157 | @@ -9890,6 +10084,7 @@
|
---|
| 4158 | char_u *p;
|
---|
| 4159 | int len;
|
---|
| 4160 | int totlen;
|
---|
| 4161 | + size_t x = 1; /* collect return value of fwrite() */
|
---|
| 4162 |
|
---|
| 4163 | if (fd != NULL)
|
---|
| 4164 | put_bytes(fd, (long_u)gap->ga_len, 2); /* <prefcondcnt> */
|
---|
| 4165 | @@ -9906,7 +10101,7 @@
|
---|
| 4166 | if (fd != NULL)
|
---|
| 4167 | {
|
---|
| 4168 | fputc(len, fd);
|
---|
| 4169 | - fwrite(p, (size_t)len, (size_t)1, fd);
|
---|
| 4170 | + x &= fwrite(p, (size_t)len, (size_t)1, fd);
|
---|
| 4171 | }
|
---|
| 4172 | totlen += len;
|
---|
| 4173 | }
|
---|
| 4174 | @@ -11480,15 +11675,24 @@
|
---|
| 4175 | vim_strncpy(preword + sp->ts_prewordlen,
|
---|
| 4176 | tword + sp->ts_splitoff,
|
---|
| 4177 | sp->ts_twordlen - sp->ts_splitoff);
|
---|
| 4178 | - p = preword;
|
---|
| 4179 | - while (*skiptowhite(p) != NUL)
|
---|
| 4180 | - p = skipwhite(skiptowhite(p));
|
---|
| 4181 | - if (fword_ends && !can_compound(slang, p,
|
---|
| 4182 | - compflags + sp->ts_compsplit))
|
---|
| 4183 | - /* Compound is not allowed. But it may still be
|
---|
| 4184 | - * possible if we add another (short) word. */
|
---|
| 4185 | +
|
---|
| 4186 | + /* Verify CHECKCOMPOUNDPATTERN rules. */
|
---|
| 4187 | + if (match_checkcompoundpattern(preword, sp->ts_prewordlen,
|
---|
| 4188 | + &slang->sl_comppat))
|
---|
| 4189 | compound_ok = FALSE;
|
---|
| 4190 |
|
---|
| 4191 | + if (compound_ok)
|
---|
| 4192 | + {
|
---|
| 4193 | + p = preword;
|
---|
| 4194 | + while (*skiptowhite(p) != NUL)
|
---|
| 4195 | + p = skipwhite(skiptowhite(p));
|
---|
| 4196 | + if (fword_ends && !can_compound(slang, p,
|
---|
| 4197 | + compflags + sp->ts_compsplit))
|
---|
| 4198 | + /* Compound is not allowed. But it may still be
|
---|
| 4199 | + * possible if we add another (short) word. */
|
---|
| 4200 | + compound_ok = FALSE;
|
---|
| 4201 | + }
|
---|
| 4202 | +
|
---|
| 4203 | /* Get pointer to last char of previous word. */
|
---|
| 4204 | p = preword + sp->ts_prewordlen;
|
---|
| 4205 | mb_ptr_back(preword, p);
|
---|
| 4206 | @@ -11685,10 +11889,9 @@
|
---|
| 4207 | && (slang->sl_compsylmax < MAXWLEN
|
---|
| 4208 | || sp->ts_complen + 1 - sp->ts_compsplit
|
---|
| 4209 | < slang->sl_compmax)
|
---|
| 4210 | - && (byte_in_str(sp->ts_complen == sp->ts_compsplit
|
---|
| 4211 | - ? slang->sl_compstartflags
|
---|
| 4212 | - : slang->sl_compallflags,
|
---|
| 4213 | - ((unsigned)flags >> 24))))
|
---|
| 4214 | + && (can_be_compound(sp, slang,
|
---|
| 4215 | + compflags, ((unsigned)flags >> 24))))
|
---|
| 4216 | +
|
---|
| 4217 | {
|
---|
| 4218 | try_compound = TRUE;
|
---|
| 4219 | compflags[sp->ts_complen] = ((unsigned)flags >> 24);
|
---|
| 4220 | diff -Naur vim72.orig/src/structs.h vim72/src/structs.h
|
---|
| 4221 | --- vim72.orig/src/structs.h 2008-07-30 13:02:50.000000000 -0700
|
---|
| 4222 | +++ vim72/src/structs.h 2008-12-20 15:01:35.000000000 -0800
|
---|
| 4223 | @@ -459,7 +459,7 @@
|
---|
| 4224 | typedef struct
|
---|
| 4225 | {
|
---|
| 4226 | int hide; /* TRUE when ":hide" was used */
|
---|
| 4227 | -# ifdef FEAT_BROWSE
|
---|
| 4228 | +# ifdef FEAT_BROWSE_CMD
|
---|
| 4229 | int browse; /* TRUE to invoke file dialog */
|
---|
| 4230 | # endif
|
---|
| 4231 | # ifdef FEAT_WINDOWS
|
---|
| 4232 | @@ -1784,10 +1784,15 @@
|
---|
| 4233 | #endif
|
---|
| 4234 |
|
---|
| 4235 | /*
|
---|
| 4236 | - * The next three specify the offsets for displaying the buffer:
|
---|
| 4237 | + * "w_topline", "w_leftcol" and "w_skipcol" specify the offsets for
|
---|
| 4238 | + * displaying the buffer.
|
---|
| 4239 | */
|
---|
| 4240 | linenr_T w_topline; /* buffer line number of the line at the
|
---|
| 4241 | top of the window */
|
---|
| 4242 | +#ifdef FEAT_AUTOCMD
|
---|
| 4243 | + char w_topline_was_set; /* flag set to TRUE when topline is set,
|
---|
| 4244 | + e.g. by winrestview() */
|
---|
| 4245 | +#endif
|
---|
| 4246 | #ifdef FEAT_DIFF
|
---|
| 4247 | int w_topfill; /* number of filler lines above w_topline */
|
---|
| 4248 | int w_old_topfill; /* w_topfill at last redraw */
|
---|
| 4249 | diff -Naur vim72.orig/src/tag.c vim72/src/tag.c
|
---|
| 4250 | --- vim72.orig/src/tag.c 2008-07-16 14:31:30.000000000 -0700
|
---|
| 4251 | +++ vim72/src/tag.c 2008-12-20 15:02:50.000000000 -0800
|
---|
| 4252 | @@ -2725,7 +2725,24 @@
|
---|
| 4253 | */
|
---|
| 4254 | p_7f = vim_strchr(lbuf, 0x7f);
|
---|
| 4255 | if (p_7f == NULL)
|
---|
| 4256 | + {
|
---|
| 4257 | +etag_fail:
|
---|
| 4258 | + if (vim_strchr(lbuf, '\n') == NULL)
|
---|
| 4259 | + {
|
---|
| 4260 | + /* Truncated line. Ignore it. */
|
---|
| 4261 | + if (p_verbose >= 5)
|
---|
| 4262 | + {
|
---|
| 4263 | + verbose_enter();
|
---|
| 4264 | + MSG(_("Ignoring long line in tags file"));
|
---|
| 4265 | + verbose_leave();
|
---|
| 4266 | + }
|
---|
| 4267 | + tagp->command = lbuf;
|
---|
| 4268 | + tagp->tagname = lbuf;
|
---|
| 4269 | + tagp->tagname_end = lbuf;
|
---|
| 4270 | + return OK;
|
---|
| 4271 | + }
|
---|
| 4272 | return FAIL;
|
---|
| 4273 | + }
|
---|
| 4274 |
|
---|
| 4275 | /* Find ^A. If not found the line number is after the 0x7f */
|
---|
| 4276 | p = vim_strchr(p_7f, Ctrl_A);
|
---|
| 4277 | @@ -2735,7 +2752,7 @@
|
---|
| 4278 | ++p;
|
---|
| 4279 |
|
---|
| 4280 | if (!VIM_ISDIGIT(*p)) /* check for start of line number */
|
---|
| 4281 | - return FAIL;
|
---|
| 4282 | + goto etag_fail;
|
---|
| 4283 | tagp->command = p;
|
---|
| 4284 |
|
---|
| 4285 |
|
---|
| 4286 | @@ -2749,7 +2766,7 @@
|
---|
| 4287 | /* find end of tagname */
|
---|
| 4288 | for (p = p_7f - 1; !vim_iswordc(*p); --p)
|
---|
| 4289 | if (p == lbuf)
|
---|
| 4290 | - return FAIL;
|
---|
| 4291 | + goto etag_fail;
|
---|
| 4292 | tagp->tagname_end = p + 1;
|
---|
| 4293 | while (p >= lbuf && vim_iswordc(*p))
|
---|
| 4294 | --p;
|
---|
| 4295 | diff -Naur vim72.orig/src/testdir/Make_ming.mak vim72/src/testdir/Make_ming.mak
|
---|
| 4296 | --- vim72.orig/src/testdir/Make_ming.mak 1969-12-31 16:00:00.000000000 -0800
|
---|
| 4297 | +++ vim72/src/testdir/Make_ming.mak 2008-12-20 15:00:39.000000000 -0800
|
---|
| 4298 | @@ -0,0 +1,91 @@
|
---|
| 4299 | +# Makefile to run tests for Vim, on Dos-like machines
|
---|
| 4300 | +# with sh.exe or zsh.exe in the path or not.
|
---|
| 4301 | +#
|
---|
| 4302 | +# Author: Bill McCarthy
|
---|
| 4303 | +#
|
---|
| 4304 | +# Note that test54 has been removed until it is fixed.
|
---|
| 4305 | +#
|
---|
| 4306 | +# Requires a set of Unix tools: echo, diff, etc.
|
---|
| 4307 | +
|
---|
| 4308 | +ifneq (sh.exe, $(SHELL))
|
---|
| 4309 | +DEL = rm -f
|
---|
| 4310 | +MV = mv
|
---|
| 4311 | +CP = cp
|
---|
| 4312 | +DIRSLASH = /
|
---|
| 4313 | +else
|
---|
| 4314 | +DEL = del
|
---|
| 4315 | +MV = rename
|
---|
| 4316 | +CP = copy
|
---|
| 4317 | +DIRSLASH = \\
|
---|
| 4318 | +endif
|
---|
| 4319 | +
|
---|
| 4320 | +VIMPROG = ..$(DIRSLASH)vim
|
---|
| 4321 | +
|
---|
| 4322 | +# Omitted:
|
---|
| 4323 | +# test2 "\\tmp" doesn't work.
|
---|
| 4324 | +# test10 'errorformat' is different
|
---|
| 4325 | +# test12 can't unlink a swap file
|
---|
| 4326 | +# test25 uses symbolic link
|
---|
| 4327 | +# test27 can't edit file with "*" in file name
|
---|
| 4328 | +# test31 16 bit version runs out of memory...
|
---|
| 4329 | +
|
---|
| 4330 | +SCRIPTS16 = test1.out test19.out test20.out test22.out \
|
---|
| 4331 | + test23.out test24.out test28.out test29.out \
|
---|
| 4332 | + test35.out test36.out test43.out \
|
---|
| 4333 | + test44.out test45.out test46.out test47.out \
|
---|
| 4334 | + test48.out test51.out test53.out \
|
---|
| 4335 | + test55.out test56.out test57.out test58.out test59.out \
|
---|
| 4336 | + test60.out test61.out test62.out test63.out test64.out
|
---|
| 4337 | +
|
---|
| 4338 | +# Had to remove test54 which doesn't work yet.
|
---|
| 4339 | +# test54.out
|
---|
| 4340 | +
|
---|
| 4341 | +SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
|
---|
| 4342 | + test8.out test9.out test11.out test13.out test14.out \
|
---|
| 4343 | + test15.out test17.out test18.out test21.out test26.out \
|
---|
| 4344 | + test30.out test31.out test32.out test33.out test34.out \
|
---|
| 4345 | + test37.out test38.out test39.out test40.out test41.out \
|
---|
| 4346 | + test42.out test52.out test65.out
|
---|
| 4347 | +
|
---|
| 4348 | +SCRIPTS32 = test50.out
|
---|
| 4349 | +
|
---|
| 4350 | +SCRIPTS_GUI = test16.out
|
---|
| 4351 | +
|
---|
| 4352 | +.SUFFIXES: .in .out
|
---|
| 4353 | +
|
---|
| 4354 | +vimall: fixff $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS_GUI) $(SCRIPTS32)
|
---|
| 4355 | + echo ALL DONE
|
---|
| 4356 | +
|
---|
| 4357 | +nongui: fixff $(SCRIPTS16) $(SCRIPTS)
|
---|
| 4358 | + echo ALL DONE
|
---|
| 4359 | +
|
---|
| 4360 | +small:
|
---|
| 4361 | + echo ALL DONE
|
---|
| 4362 | +
|
---|
| 4363 | +gui: fixff $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS_GUI)
|
---|
| 4364 | + echo ALL DONE
|
---|
| 4365 | +
|
---|
| 4366 | +win32: fixff $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS32)
|
---|
| 4367 | + echo ALL DONE
|
---|
| 4368 | +
|
---|
| 4369 | +fixff:
|
---|
| 4370 | + -$(VIMPROG) -u dos.vim --noplugin "+argdo set ff=dos|upd" +q *.in *.ok
|
---|
| 4371 | +
|
---|
| 4372 | +clean:
|
---|
| 4373 | + -$(DEL) *.out
|
---|
| 4374 | + -$(DEL) test.ok
|
---|
| 4375 | + -$(DEL) small.vim
|
---|
| 4376 | + -$(DEL) tiny.vim
|
---|
| 4377 | + -$(DEL) mbyte.vim
|
---|
| 4378 | + -$(DEL) X*
|
---|
| 4379 | + -$(DEL) viminfo
|
---|
| 4380 | +
|
---|
| 4381 | +.in.out:
|
---|
| 4382 | + $(CP) $*.ok test.ok
|
---|
| 4383 | + $(VIMPROG) -u dos.vim -U NONE --noplugin -s dotest.in $*.in
|
---|
| 4384 | + diff test.out $*.ok
|
---|
| 4385 | + -$(DEL) $*.out
|
---|
| 4386 | + $(MV) test.out $*.out
|
---|
| 4387 | + -$(DEL) X*
|
---|
| 4388 | + -$(DEL) test.ok
|
---|
| 4389 | + -$(DEL) viminfo
|
---|
| 4390 | diff -Naur vim72.orig/src/testdir/Makefile vim72/src/testdir/Makefile
|
---|
| 4391 | --- vim72.orig/src/testdir/Makefile 2008-06-19 13:29:46.000000000 -0700
|
---|
| 4392 | +++ vim72/src/testdir/Makefile 2008-12-20 15:00:21.000000000 -0800
|
---|
| 4393 | @@ -26,15 +26,17 @@
|
---|
| 4394 |
|
---|
| 4395 | .SUFFIXES: .in .out
|
---|
| 4396 |
|
---|
| 4397 | -nongui: nolog $(SCRIPTS)
|
---|
| 4398 | - @echo
|
---|
| 4399 | - @cat test.log
|
---|
| 4400 | - @echo ALL DONE
|
---|
| 4401 | +nongui: nolog $(SCRIPTS) report
|
---|
| 4402 | +
|
---|
| 4403 | +gui: nolog $(SCRIPTS) $(SCRIPTS_GUI) report
|
---|
| 4404 |
|
---|
| 4405 | -gui: nolog $(SCRIPTS) $(SCRIPTS_GUI)
|
---|
| 4406 | +report:
|
---|
| 4407 | @echo
|
---|
| 4408 | - @cat test.log
|
---|
| 4409 | - @echo ALL DONE
|
---|
| 4410 | + @echo 'Test results:'
|
---|
| 4411 | + @/bin/sh -c "if test -f test.log; \
|
---|
| 4412 | + then cat test.log; echo TEST FAILURE; exit 1; \
|
---|
| 4413 | + else echo ALL DONE; \
|
---|
| 4414 | + fi"
|
---|
| 4415 |
|
---|
| 4416 | $(SCRIPTS) $(SCRIPTS_GUI): $(VIMPROG)
|
---|
| 4417 |
|
---|
| 4418 | @@ -71,4 +73,4 @@
|
---|
| 4419 | test60.out: test60.vim
|
---|
| 4420 |
|
---|
| 4421 | nolog:
|
---|
| 4422 | - -echo Test results: >test.log
|
---|
| 4423 | + -rm -f test.log
|
---|
| 4424 | diff -Naur vim72.orig/src/testdir/test42.ok vim72/src/testdir/test42.ok
|
---|
| 4425 | --- vim72.orig/src/testdir/test42.ok 2008-02-20 04:27:37.000000000 -0800
|
---|
| 4426 | +++ vim72/src/testdir/test42.ok 2008-12-20 15:01:10.000000000 -0800
|
---|
| 4427 | @@ -20,7 +20,7 @@
|
---|
| 4428 | ucs-2
|
---|
| 4429 |
|
---|
| 4430 |
|
---|
| 4431 | - fileencoding=ucs-2le
|
---|
| 4432 | + fileencoding=utf-16le
|
---|
| 4433 | bomb
|
---|
| 4434 | ucs-2le
|
---|
| 4435 |
|
---|
| 4436 | diff -Naur vim72.orig/src/ui.c vim72/src/ui.c
|
---|
| 4437 | --- vim72.orig/src/ui.c 2008-07-14 11:14:56.000000000 -0700
|
---|
| 4438 | +++ vim72/src/ui.c 2008-12-20 15:02:13.000000000 -0800
|
---|
| 4439 | @@ -1820,7 +1820,7 @@
|
---|
| 4440 | #ifdef HAVE_DUP
|
---|
| 4441 | /* Use stderr for stdin, also works for shell commands. */
|
---|
| 4442 | close(0);
|
---|
| 4443 | - dup(2);
|
---|
| 4444 | + ignored = dup(2);
|
---|
| 4445 | #else
|
---|
| 4446 | read_cmd_fd = 2; /* read from stderr instead of stdin */
|
---|
| 4447 | #endif
|
---|
| 4448 | @@ -2020,7 +2020,7 @@
|
---|
| 4449 |
|
---|
| 4450 | if (value == NULL || *length == 0)
|
---|
| 4451 | {
|
---|
| 4452 | - clip_free_selection(cbd); /* ??? [what's the query?] */
|
---|
| 4453 | + clip_free_selection(cbd); /* nothing received, clear register */
|
---|
| 4454 | *(int *)success = FALSE;
|
---|
| 4455 | return;
|
---|
| 4456 | }
|
---|
| 4457 | @@ -2076,7 +2076,7 @@
|
---|
| 4458 | text_prop.value = (unsigned char *)value;
|
---|
| 4459 | text_prop.encoding = *type;
|
---|
| 4460 | text_prop.format = *format;
|
---|
| 4461 | - text_prop.nitems = STRLEN(value);
|
---|
| 4462 | + text_prop.nitems = len;
|
---|
| 4463 | status = XmbTextPropertyToTextList(X_DISPLAY, &text_prop,
|
---|
| 4464 | &text_list, &n_text);
|
---|
| 4465 | if (status != Success || n_text < 1)
|
---|
| 4466 | @@ -2110,6 +2110,8 @@
|
---|
| 4467 | int i;
|
---|
| 4468 | int nbytes = 0;
|
---|
| 4469 | char_u *buffer;
|
---|
| 4470 | + time_t start_time;
|
---|
| 4471 | + int timed_out = FALSE;
|
---|
| 4472 |
|
---|
| 4473 | for (i =
|
---|
| 4474 | #ifdef FEAT_MBYTE
|
---|
| 4475 | @@ -2129,6 +2131,7 @@
|
---|
| 4476 | case 3: type = text_atom; break;
|
---|
| 4477 | default: type = XA_STRING;
|
---|
| 4478 | }
|
---|
| 4479 | + success = MAYBE;
|
---|
| 4480 | XtGetSelectionValue(myShell, cbd->sel_atom, type,
|
---|
| 4481 | clip_x11_request_selection_cb, (XtPointer)&success, CurrentTime);
|
---|
| 4482 |
|
---|
| 4483 | @@ -2141,27 +2144,48 @@
|
---|
| 4484 | * characters, then they will appear before the one that requested the
|
---|
| 4485 | * paste! Don't worry, we will catch up with any other events later.
|
---|
| 4486 | */
|
---|
| 4487 | - for (;;)
|
---|
| 4488 | + start_time = time(NULL);
|
---|
| 4489 | + while (success == MAYBE)
|
---|
| 4490 | {
|
---|
| 4491 | - if (XCheckTypedEvent(dpy, SelectionNotify, &event))
|
---|
| 4492 | - break;
|
---|
| 4493 | - if (XCheckTypedEvent(dpy, SelectionRequest, &event))
|
---|
| 4494 | - /* We may get a SelectionRequest here and if we don't handle
|
---|
| 4495 | - * it we hang. KDE klipper does this, for example. */
|
---|
| 4496 | + if (XCheckTypedEvent(dpy, SelectionNotify, &event)
|
---|
| 4497 | + || XCheckTypedEvent(dpy, SelectionRequest, &event)
|
---|
| 4498 | + || XCheckTypedEvent(dpy, PropertyNotify, &event))
|
---|
| 4499 | + {
|
---|
| 4500 | + /* This is where clip_x11_request_selection_cb() should be
|
---|
| 4501 | + * called. It may actually happen a bit later, so we loop
|
---|
| 4502 | + * until "success" changes.
|
---|
| 4503 | + * We may get a SelectionRequest here and if we don't handle
|
---|
| 4504 | + * it we hang. KDE klipper does this, for example.
|
---|
| 4505 | + * We need to handle a PropertyNotify for large selections. */
|
---|
| 4506 | XtDispatchEvent(&event);
|
---|
| 4507 | + continue;
|
---|
| 4508 | + }
|
---|
| 4509 | +
|
---|
| 4510 | + /* Time out after 2 to 3 seconds to avoid that we hang when the
|
---|
| 4511 | + * other process doesn't respond. Note that the SelectionNotify
|
---|
| 4512 | + * event may still come later when the selection owner comes back
|
---|
| 4513 | + * to life and the text gets inserted unexpectedly. Don't know
|
---|
| 4514 | + * why that happens or how to avoid that :-(. */
|
---|
| 4515 | + if (time(NULL) > start_time + 2)
|
---|
| 4516 | + {
|
---|
| 4517 | + timed_out = TRUE;
|
---|
| 4518 | + break;
|
---|
| 4519 | + }
|
---|
| 4520 |
|
---|
| 4521 | /* Do we need this? Probably not. */
|
---|
| 4522 | XSync(dpy, False);
|
---|
| 4523 |
|
---|
| 4524 | - /* Bernhard Walle solved a slow paste response in an X terminal by
|
---|
| 4525 | - * adding: usleep(10000); here. */
|
---|
| 4526 | + /* Wait for 1 msec to avoid that we eat up all CPU time. */
|
---|
| 4527 | + ui_delay(1L, TRUE);
|
---|
| 4528 | }
|
---|
| 4529 |
|
---|
| 4530 | - /* this is where clip_x11_request_selection_cb() is actually called */
|
---|
| 4531 | - XtDispatchEvent(&event);
|
---|
| 4532 | -
|
---|
| 4533 | - if (success)
|
---|
| 4534 | + if (success == TRUE)
|
---|
| 4535 | return;
|
---|
| 4536 | +
|
---|
| 4537 | + /* don't do a retry with another type after timing out, otherwise we
|
---|
| 4538 | + * hang for 15 seconds. */
|
---|
| 4539 | + if (timed_out)
|
---|
| 4540 | + break;
|
---|
| 4541 | }
|
---|
| 4542 |
|
---|
| 4543 | /* Final fallback position - use the X CUT_BUFFER0 store */
|
---|
| 4544 | diff -Naur vim72.orig/src/version.c vim72/src/version.c
|
---|
| 4545 | --- vim72.orig/src/version.c 2008-08-09 07:24:52.000000000 -0700
|
---|
| 4546 | +++ vim72/src/version.c 2008-12-20 15:02:52.000000000 -0800
|
---|
| 4547 | @@ -677,9 +677,152 @@
|
---|
| 4548 | static int included_patches[] =
|
---|
| 4549 | { /* Add new patch number below this line */
|
---|
| 4550 | /**/
|
---|
| 4551 | + 69,
|
---|
| 4552 | +/**/
|
---|
| 4553 | + 68,
|
---|
| 4554 | +/**/
|
---|
| 4555 | + 67,
|
---|
| 4556 | +/**/
|
---|
| 4557 | + 66,
|
---|
| 4558 | +/**/
|
---|
| 4559 | + 65,
|
---|
| 4560 | +/**/
|
---|
| 4561 | + 64,
|
---|
| 4562 | +/**/
|
---|
| 4563 | + 63,
|
---|
| 4564 | +/**/
|
---|
| 4565 | + 62,
|
---|
| 4566 | +/**/
|
---|
| 4567 | + 61,
|
---|
| 4568 | +/**/
|
---|
| 4569 | + 60,
|
---|
| 4570 | +/**/
|
---|
| 4571 | + 59,
|
---|
| 4572 | +/**/
|
---|
| 4573 | + 58,
|
---|
| 4574 | +/**/
|
---|
| 4575 | + 57,
|
---|
| 4576 | +/**/
|
---|
| 4577 | + 56,
|
---|
| 4578 | +/**/
|
---|
| 4579 | + 55,
|
---|
| 4580 | +/**/
|
---|
| 4581 | + 54,
|
---|
| 4582 | +/**/
|
---|
| 4583 | + 53,
|
---|
| 4584 | +/**/
|
---|
| 4585 | + 52,
|
---|
| 4586 | +/**/
|
---|
| 4587 | + 51,
|
---|
| 4588 | +/**/
|
---|
| 4589 | + 50,
|
---|
| 4590 | +/**/
|
---|
| 4591 | + 48,
|
---|
| 4592 | +/**/
|
---|
| 4593 | + 47,
|
---|
| 4594 | +/**/
|
---|
| 4595 | + 46,
|
---|
| 4596 | +/**/
|
---|
| 4597 | + 45,
|
---|
| 4598 | +/**/
|
---|
| 4599 | + 44,
|
---|
| 4600 | +/**/
|
---|
| 4601 | + 43,
|
---|
| 4602 | +/**/
|
---|
| 4603 | + 42,
|
---|
| 4604 | +/**/
|
---|
| 4605 | + 40,
|
---|
| 4606 | +/**/
|
---|
| 4607 | + 39,
|
---|
| 4608 | +/**/
|
---|
| 4609 | + 38,
|
---|
| 4610 | +/**/
|
---|
| 4611 | + 37,
|
---|
| 4612 | +/**/
|
---|
| 4613 | + 35,
|
---|
| 4614 | +/**/
|
---|
| 4615 | + 34,
|
---|
| 4616 | +/**/
|
---|
| 4617 | + 33,
|
---|
| 4618 | +/**/
|
---|
| 4619 | + 32,
|
---|
| 4620 | +/**/
|
---|
| 4621 | + 31,
|
---|
| 4622 | +/**/
|
---|
| 4623 | + 30,
|
---|
| 4624 | +/**/
|
---|
| 4625 | + 29,
|
---|
| 4626 | +/**/
|
---|
| 4627 | + 28,
|
---|
| 4628 | +/**/
|
---|
| 4629 | + 27,
|
---|
| 4630 | +/**/
|
---|
| 4631 | + 26,
|
---|
| 4632 | +/**/
|
---|
| 4633 | + 25,
|
---|
| 4634 | +/**/
|
---|
| 4635 | + 24,
|
---|
| 4636 | +/**/
|
---|
| 4637 | + 23,
|
---|
| 4638 | +/**/
|
---|
| 4639 | + 22,
|
---|
| 4640 | +/**/
|
---|
| 4641 | + 21,
|
---|
| 4642 | +/**/
|
---|
| 4643 | + 20,
|
---|
| 4644 | +/**/
|
---|
| 4645 | + 19,
|
---|
| 4646 | +/**/
|
---|
| 4647 | + 18,
|
---|
| 4648 | +/**/
|
---|
| 4649 | + 17,
|
---|
| 4650 | +/**/
|
---|
| 4651 | + 16,
|
---|
| 4652 | +/**/
|
---|
| 4653 | + 15,
|
---|
| 4654 | +/**/
|
---|
| 4655 | + 14,
|
---|
| 4656 | +/**/
|
---|
| 4657 | + 13,
|
---|
| 4658 | +/**/
|
---|
| 4659 | + 12,
|
---|
| 4660 | +/**/
|
---|
| 4661 | + 11,
|
---|
| 4662 | +/**/
|
---|
| 4663 | + 10,
|
---|
| 4664 | +/**/
|
---|
| 4665 | + 9,
|
---|
| 4666 | +/**/
|
---|
| 4667 | + 8,
|
---|
| 4668 | +/**/
|
---|
| 4669 | + 6,
|
---|
| 4670 | +/**/
|
---|
| 4671 | + 5,
|
---|
| 4672 | +/**/
|
---|
| 4673 | + 4,
|
---|
| 4674 | +/**/
|
---|
| 4675 | + 3,
|
---|
| 4676 | +/**/
|
---|
| 4677 | + 2,
|
---|
| 4678 | +/**/
|
---|
| 4679 | + 1,
|
---|
| 4680 | +/**/
|
---|
| 4681 | 0
|
---|
| 4682 | };
|
---|
| 4683 |
|
---|
| 4684 | +/*
|
---|
| 4685 | + * Place to put a short description when adding a feature with a patch.
|
---|
| 4686 | + * Keep it short, e.g.,: "relative numbers", "persistent undo".
|
---|
| 4687 | + * Also add a comment marker to separate the lines.
|
---|
| 4688 | + * See the official Vim patches for the diff format: It must use a context of
|
---|
| 4689 | + * one line only. Use "diff -C2".
|
---|
| 4690 | + */
|
---|
| 4691 | +static char *(extra_patches[]) =
|
---|
| 4692 | +{ /* Add your patch description below this line */
|
---|
| 4693 | +/**/
|
---|
| 4694 | + NULL
|
---|
| 4695 | +};
|
---|
| 4696 | +
|
---|
| 4697 | int
|
---|
| 4698 | highest_patch()
|
---|
| 4699 | {
|
---|
| 4700 | @@ -786,7 +929,7 @@
|
---|
| 4701 | MSG_PUTS(_("\nRISC OS version"));
|
---|
| 4702 | #endif
|
---|
| 4703 | #ifdef VMS
|
---|
| 4704 | - MSG_PUTS("\nOpenVMS version");
|
---|
| 4705 | + MSG_PUTS(_("\nOpenVMS version"));
|
---|
| 4706 | # ifdef HAVE_PATHDEF
|
---|
| 4707 | if (*compiled_arch != NUL)
|
---|
| 4708 | {
|
---|
| 4709 | @@ -825,6 +968,19 @@
|
---|
| 4710 | }
|
---|
| 4711 | }
|
---|
| 4712 |
|
---|
| 4713 | + /* Print the list of extra patch descriptions if there is at least one. */
|
---|
| 4714 | + if (extra_patches[0] != NULL)
|
---|
| 4715 | + {
|
---|
| 4716 | + MSG_PUTS(_("\nExtra patches: "));
|
---|
| 4717 | + s = "";
|
---|
| 4718 | + for (i = 0; extra_patches[i] != NULL; ++i)
|
---|
| 4719 | + {
|
---|
| 4720 | + MSG_PUTS(s);
|
---|
| 4721 | + s = ", ";
|
---|
| 4722 | + MSG_PUTS(extra_patches[i]);
|
---|
| 4723 | + }
|
---|
| 4724 | + }
|
---|
| 4725 | +
|
---|
| 4726 | #ifdef MODIFIED_BY
|
---|
| 4727 | MSG_PUTS("\n");
|
---|
| 4728 | MSG_PUTS(_("Modified by "));
|
---|
| 4729 | diff -Naur vim72.orig/src/vim.h vim72/src/vim.h
|
---|
| 4730 | --- vim72.orig/src/vim.h 2008-08-09 09:03:38.000000000 -0700
|
---|
| 4731 | +++ vim72/src/vim.h 2008-12-20 15:01:49.000000000 -0800
|
---|
| 4732 | @@ -341,8 +341,14 @@
|
---|
| 4733 | #ifdef BACKSLASH_IN_FILENAME
|
---|
| 4734 | # define PATH_ESC_CHARS ((char_u *)" \t\n*?[{`%#'\"|!<")
|
---|
| 4735 | #else
|
---|
| 4736 | -# define PATH_ESC_CHARS ((char_u *)" \t\n*?[{`$\\%#'\"|!<")
|
---|
| 4737 | -# define SHELL_ESC_CHARS ((char_u *)" \t\n*?[{`$\\%#'\"|!<>();&")
|
---|
| 4738 | +# ifdef VMS
|
---|
| 4739 | + /* VMS allows a lot of characters in the file name */
|
---|
| 4740 | +# define PATH_ESC_CHARS ((char_u *)" \t\n*?{`\\%#'\"|!")
|
---|
| 4741 | +# define SHELL_ESC_CHARS ((char_u *)" \t\n*?{`\\%#'|!()&")
|
---|
| 4742 | +# else
|
---|
| 4743 | +# define PATH_ESC_CHARS ((char_u *)" \t\n*?[{`$\\%#'\"|!<")
|
---|
| 4744 | +# define SHELL_ESC_CHARS ((char_u *)" \t\n*?[{`$\\%#'\"|!<>();&")
|
---|
| 4745 | +# endif
|
---|
| 4746 | #endif
|
---|
| 4747 |
|
---|
| 4748 | #define NUMBUFLEN 30 /* length of a buffer to store a number in ASCII */
|
---|
| 4749 | @@ -370,7 +376,7 @@
|
---|
| 4750 | * Define __w64 as an empty token for everything but MSVC 7.x or later.
|
---|
| 4751 | */
|
---|
| 4752 | # if !defined(_MSC_VER) || (_MSC_VER < 1300)
|
---|
| 4753 | -# define __w64
|
---|
| 4754 | +# define __w64
|
---|
| 4755 | # endif
|
---|
| 4756 | typedef unsigned long __w64 long_u;
|
---|
| 4757 | typedef long __w64 long_i;
|
---|
| 4758 | @@ -1728,7 +1734,8 @@
|
---|
| 4759 | #define VV_MOUSE_COL 51
|
---|
| 4760 | #define VV_OP 52
|
---|
| 4761 | #define VV_SEARCHFORWARD 53
|
---|
| 4762 | -#define VV_LEN 54 /* number of v: vars */
|
---|
| 4763 | +#define VV_OLDFILES 54
|
---|
| 4764 | +#define VV_LEN 55 /* number of v: vars */
|
---|
| 4765 |
|
---|
| 4766 | #ifdef FEAT_CLIPBOARD
|
---|
| 4767 |
|
---|
| 4768 | @@ -1979,6 +1986,9 @@
|
---|
| 4769 | # endif
|
---|
| 4770 | #endif
|
---|
| 4771 |
|
---|
| 4772 | +#ifndef FEAT_NETBEANS_INTG
|
---|
| 4773 | +# undef NBDEBUG
|
---|
| 4774 | +#endif
|
---|
| 4775 | #ifdef NBDEBUG /* Netbeans debugging. */
|
---|
| 4776 | # include "nbdebug.h"
|
---|
| 4777 | #else
|
---|
| 4778 | @@ -2054,4 +2064,10 @@
|
---|
| 4779 | #define DOSO_VIMRC 1 /* loading vimrc file */
|
---|
| 4780 | #define DOSO_GVIMRC 2 /* loading gvimrc file */
|
---|
| 4781 |
|
---|
| 4782 | +/* flags for read_viminfo() and children */
|
---|
| 4783 | +#define VIF_WANT_INFO 1 /* load non-mark info */
|
---|
| 4784 | +#define VIF_WANT_MARKS 2 /* load file marks */
|
---|
| 4785 | +#define VIF_FORCEIT 4 /* overwrite info already read */
|
---|
| 4786 | +#define VIF_GET_OLDFILES 8 /* load v:oldfiles */
|
---|
| 4787 | +
|
---|
| 4788 | #endif /* VIM__H */
|
---|
| 4789 | diff -Naur vim72.orig/src/window.c vim72/src/window.c
|
---|
| 4790 | --- vim72.orig/src/window.c 2008-08-06 04:00:30.000000000 -0700
|
---|
| 4791 | +++ vim72/src/window.c 2008-12-20 15:02:13.000000000 -0800
|
---|
| 4792 | @@ -4028,14 +4028,14 @@
|
---|
| 4793 | if (mch_dirname(cwd, MAXPATHL) == OK)
|
---|
| 4794 | globaldir = vim_strsave(cwd);
|
---|
| 4795 | }
|
---|
| 4796 | - mch_chdir((char *)curwin->w_localdir);
|
---|
| 4797 | - shorten_fnames(TRUE);
|
---|
| 4798 | + if (mch_chdir((char *)curwin->w_localdir) == 0)
|
---|
| 4799 | + shorten_fnames(TRUE);
|
---|
| 4800 | }
|
---|
| 4801 | else if (globaldir != NULL)
|
---|
| 4802 | {
|
---|
| 4803 | /* Window doesn't have a local directory and we are not in the global
|
---|
| 4804 | * directory: Change to the global directory. */
|
---|
| 4805 | - mch_chdir((char *)globaldir);
|
---|
| 4806 | + ignored = mch_chdir((char *)globaldir);
|
---|
| 4807 | vim_free(globaldir);
|
---|
| 4808 | globaldir = NULL;
|
---|
| 4809 | shorten_fnames(TRUE);
|
---|
| 4810 | diff -Naur vim72.orig/src/workshop.c vim72/src/workshop.c
|
---|
| 4811 | --- vim72.orig/src/workshop.c 2008-06-21 11:53:26.000000000 -0700
|
---|
| 4812 | +++ vim72/src/workshop.c 2008-12-20 15:02:07.000000000 -0800
|
---|
| 4813 | @@ -1121,8 +1121,12 @@
|
---|
| 4814 | ? (char *)curbuf->b_sfname : "<None>");
|
---|
| 4815 | #endif
|
---|
| 4816 |
|
---|
| 4817 | - strcpy(ffname, (char *) curbuf->b_ffname);
|
---|
| 4818 | - *filename = ffname; /* copy so nobody can change b_ffname */
|
---|
| 4819 | + if (curbuf->b_ffname == NULL)
|
---|
| 4820 | + ffname[0] = NUL;
|
---|
| 4821 | + else
|
---|
| 4822 | + /* copy so nobody can change b_ffname */
|
---|
| 4823 | + strcpy(ffname, (char *) curbuf->b_ffname);
|
---|
| 4824 | + *filename = ffname;
|
---|
| 4825 | *curLine = curwin->w_cursor.lnum;
|
---|
| 4826 | *curCol = curwin->w_cursor.col;
|
---|
| 4827 |
|
---|