mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
Merge branch 'vim'
This commit is contained in:
@@ -2588,3 +2588,50 @@ f451d60ab8ec56d02a7b5f2d5c16187566279886 v7-3-1247
|
||||
b614332f7df2f6f471bb4bd93767becd7844b90c v7-3-1249
|
||||
6aecf486bb347ac6885afe36d62ddbbf2457f898 v7-3-1250
|
||||
788f4802967766b7f3d6dce83cc027baef422f4a v7-3-1251
|
||||
875a0aeb301c3fb2be8a79f2d82e324d80caf4f3 v7-3-1252
|
||||
d6a7dea44a8667d834e463b8658cf85ea938112d v7-3-1253
|
||||
5eff37e92f03771aee77a3688d79a73e5b6107e9 v7-3-1254
|
||||
f8d307ebd74a4097f7083ea8117be0433f00c7ce v7-3-1255
|
||||
322441058afca6a8aa52d34eda9fa307608354d3 v7-3-1256
|
||||
5751284311f37399cb7a66d99fe317de4ae86ea9 v7-3-1257
|
||||
c9e2ccc53f2e119e247da7fc9111b6b9c9385d93 v7-3-1258
|
||||
7ab94cb688bebd694109442be4dd6edb6ebe3c85 v7-3-1259
|
||||
7aa4e0822dec0840770d9f41052a772a887cd213 v7-3-1260
|
||||
1cf89d38aa7628b55f1a45a5325adc83abe85dc2 v7-3-1261
|
||||
5e0b6a9282df8b9435da372cad77482f1f5b20aa v7-3-1262
|
||||
a02575cd564ade1019ea89db07c1c1d0c4b5418c v7-3-1263
|
||||
558c815e1a38d7ac2fc61c4155aabf8e81a14034 v7-3-1264
|
||||
53c1b30632df47993bc00947078dd31a226c9a97 v7-3-1265
|
||||
bbe4bd64c68c64afaa6636e8c3e9a9a6241e91cb v7-3-1266
|
||||
cabdcfe72dc398fd67bbbe02cff5e11e4dc2506e v7-3-1267
|
||||
72fcf674e545eb87bb4ea996df56e4eb7c04f6cc v7-3-1268
|
||||
350239b0e9eb063d9f84dfa4bc7a2b47d78e9afb v7-3-1269
|
||||
35b6fc57a2868b235284d914820da0815e62d54b v7-3-1270
|
||||
034abed357a1a2fabe624ed59ea49ebdec09d790 v7-3-1271
|
||||
a00cd1839ac4f3467e1e51e619b4c65ce4e0ee81 v7-3-1272
|
||||
30910831e5b0f0eb28a8eea7412f5ec9f3533ab2 v7-3-1273
|
||||
761cef8f5d1d42e315fb85765ee90857981fec06 v7-3-1274
|
||||
8875401008da99a39878478a293f833f68481ffc v7-3-1275
|
||||
d2f9f67924e77ec3d90164dd6ff2e50c5107faf0 v7-3-1276
|
||||
6a7ae677d6a1f116b685fa0f892052e20003eaad v7-3-1277
|
||||
cf52d2a8c05cd037c049abef0f58fd918146f3bb v7-3-1278
|
||||
cca600e6092839efeb3795db863916959921bb0e v7-3-1279
|
||||
1cacf785299e771ca463c493c8c870e395c09cd0 v7-3-1280
|
||||
19ed30f7cef76224ef39ceadefb64387eb986342 v7-3-1281
|
||||
22ac43fb6d30ad1097d0c7e8937b28efcb162137 v7-3-1282
|
||||
d6ceddc0be86e46a5a9a696e36c54b9d133f2203 v7-3-1283
|
||||
7b20dc8041645778eeb2f7823a4c1c647f735d24 v7-3-1284
|
||||
14e7a115d54d2c095f31ccda2d04fbcf775dacde v7-3-1285
|
||||
6ddc1785c4ff3779c18f5c313da591a052388b2d v7-3-1286
|
||||
34c629c3b4bab5fc755e83869d929f8cb322bfcd v7-3-1287
|
||||
8b7baf39a345aecf00a6116b5da211b51c6e3457 v7-3-1288
|
||||
1ed945570d47e9a60694ed1ef3a5b208243657e9 v7-3-1289
|
||||
08d4c11cdaed2c5d95e2c0be3b0df91d01f52b84 v7-3-1290
|
||||
a6ddcab6a240d22f965c4961bb93ddfea6a74c73 v7-3-1291
|
||||
cad8d29b0bc0356a49a455296e5e79eb6f38139d v7-3-1292
|
||||
18b43970fb7a796ab740e65baa4ff2ba46f929a8 v7-3-1293
|
||||
11d0c6df1d7bdc399b34a8cc70f354d6ee908661 v7-3-1294
|
||||
93cccad6a26b439728bf3c155ed5532001a2f2ab v7-3-1295
|
||||
c3a82208e143e4cd4a3b9d9b1716eb9d876bf462 v7-3-1296
|
||||
cb0a5c9c0f9bcc6c5a18ed97762206309d3e334c v7-3-1297
|
||||
dafd77a15d44cced4e405a9fcfe67fc48a02004a v7-3-1298
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim completion script
|
||||
" Language: XML
|
||||
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
|
||||
" Last Change: 2006 Aug 15
|
||||
" Last Change: 2013 Jun 29
|
||||
" Version: 1.9
|
||||
"
|
||||
" Changelog:
|
||||
@@ -475,12 +475,12 @@ function! s:InCommentAt(line, col)
|
||||
endfunction
|
||||
|
||||
function! s:SetKeywords()
|
||||
let g:IsKeywordBak=&iskeyword
|
||||
let &iskeyword='33-255'
|
||||
let s:IsKeywordBak=&l:iskeyword
|
||||
let &l:iskeyword='33-255'
|
||||
endfunction
|
||||
|
||||
function! s:RestoreKeywords()
|
||||
let &iskeyword=g:IsKeywordBak
|
||||
let &l:iskeyword=s:IsKeywordBak
|
||||
endfunction
|
||||
|
||||
function! s:Push(el, sname)
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
" Vim Compiler File
|
||||
" Compiler: ocaml
|
||||
" Maintainer: See ftplugin/ocaml.vim (?)
|
||||
" Last Change: June 2013 by Marc Weber
|
||||
"
|
||||
" Marc Weber's comments:
|
||||
" Setting makeprg doesn't make sense, because there is ocamlc, ocamlopt,
|
||||
" ocamake and whatnot. So which one to use?
|
||||
"
|
||||
" This error format was moved from ftplugin/ocaml.vim to this file,
|
||||
" because ftplugin is the wrong file to set an error format
|
||||
" and the error format itself is annoying because it joins many lines in this
|
||||
" error case:
|
||||
"
|
||||
" Error: The implementation foo.ml does not match the interface foo.cmi:
|
||||
" Modules do not match case.
|
||||
"
|
||||
" So having it here makes people opt-in
|
||||
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "ocaml"
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
CompilerSet errorformat =
|
||||
\%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%*\\d:,
|
||||
\%EFile\ \"%f\"\\,\ line\ %l\\,\ character\ %c:%m,
|
||||
\%+EReference\ to\ unbound\ regexp\ name\ %m,
|
||||
\%Eocamlyacc:\ e\ -\ line\ %l\ of\ \"%f\"\\,\ %m,
|
||||
\%Wocamlyacc:\ w\ -\ %m,
|
||||
\%-Zmake%.%#,
|
||||
\%C%m,
|
||||
\%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
|
||||
\%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
|
||||
\%D%*\\a:\ Entering\ directory\ `%f',
|
||||
\%X%*\\a:\ Leaving\ directory\ `%f',
|
||||
\%DMaking\ %*\\a\ in\ %f
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -1,4 +1,4 @@
|
||||
*if_pyth.txt* For Vim version 7.3. Last change: 2013 Jun 02
|
||||
*if_pyth.txt* For Vim version 7.3. Last change: 2013 Jun 28
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Paul Moore
|
||||
@@ -740,6 +740,11 @@ To work around such problems there are these options:
|
||||
3. You undefine PY_NO_RTLD_GLOBAL in auto/config.h after configuration. This
|
||||
may crash Vim though.
|
||||
|
||||
*E880*
|
||||
Raising SystemExit exception in python isn't endorsed way to quit vim, use: >
|
||||
:py vim.command("qall!")
|
||||
<
|
||||
|
||||
*has-python*
|
||||
You can test what Python version is available with: >
|
||||
if has('python')
|
||||
|
||||
+21
-12
@@ -1,4 +1,4 @@
|
||||
*map.txt* For Vim version 7.3. Last change: 2013 Jun 12
|
||||
*map.txt* For Vim version 7.3. Last change: 2013 Jun 29
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -159,9 +159,9 @@ type "a", then "bar" will get inserted.
|
||||
|
||||
1.2 SPECIAL ARGUMENTS *:map-arguments*
|
||||
|
||||
"<buffer>", "<silent>", "<special>", "<script>", "<expr>" and "<unique>" can
|
||||
be used in any order. They must appear right after the command, before any
|
||||
other arguments.
|
||||
"<buffer>", "<nowait>", "<silent>", "<special>", "<script>", "<expr>" and
|
||||
"<unique>" can be used in any order. They must appear right after the
|
||||
command, before any other arguments.
|
||||
|
||||
*:map-local* *:map-<buffer>* *E224* *E225*
|
||||
If the first argument to one of these commands is "<buffer>" the mapping will
|
||||
@@ -169,7 +169,9 @@ be effective in the current buffer only. Example: >
|
||||
:map <buffer> ,w /[.,;]<CR>
|
||||
Then you can map ",w" to something else in another buffer: >
|
||||
:map <buffer> ,w /[#&!]<CR>
|
||||
The local buffer mappings are used before the global ones.
|
||||
The local buffer mappings are used before the global ones. See <nowait> below
|
||||
to make a short local mapping not taking effect when a longer global one
|
||||
exists.
|
||||
The "<buffer>" argument can also be used to clear mappings: >
|
||||
:unmap <buffer> ,w
|
||||
:mapclear <buffer>
|
||||
@@ -177,6 +179,14 @@ Local mappings are also cleared when a buffer is deleted, but not when it is
|
||||
unloaded. Just like local option values.
|
||||
Also see |map-precedence|.
|
||||
|
||||
*:map-<nowait>* *:map-nowait*
|
||||
When defining a buffer-local mapping for "," there may be a global mapping
|
||||
that starts with ",". Then you need to type another character for Vim to know
|
||||
whether to use the "," mapping or the longer one. To avoid this add the
|
||||
<nowait> argument. Then the mapping will be used when it matches, Vim does
|
||||
not wait for more characters to be typed. However, if the characters were
|
||||
already type they are used.
|
||||
|
||||
*:map-<silent>* *:map-silent*
|
||||
To define a mapping which will not be echoed on the command line, add
|
||||
"<silent>" as the first argument. Example: >
|
||||
@@ -659,13 +669,12 @@ might want to set the 'ttimeout' option.
|
||||
Buffer-local mappings (defined using |:map-<buffer>|) take precedence over
|
||||
global mappings. When a buffer-local mapping is the same as a global mapping,
|
||||
Vim will use the buffer-local mapping. In addition, Vim will use a complete
|
||||
buffer-local mapping immediately, even if a longer global mapping has the
|
||||
buffer-local mapping as a prefix. For example, given the following two
|
||||
mappings: >
|
||||
:map <buffer> \a :echo "Local \a"<CR>
|
||||
:map \abc :echo "Global \abc"<CR>
|
||||
The buffer-local mapping \a will be used immediately. Vim will not wait for
|
||||
more characters to see if the user might be typing \abc.
|
||||
mapping immediately if it was defined with <nowait>, even if a longer mapping
|
||||
has the same prefix. For example, given the following two mappings: >
|
||||
:map <buffer> <nowait> \a :echo "Local \a"<CR>
|
||||
:map \abc :echo "Global \abc"<CR>
|
||||
When typing \a the buffer-local mapping will be used immediately. Vim will
|
||||
not wait for more characters to see if the user might be typing \abc.
|
||||
|
||||
*map-keys-fails*
|
||||
There are situations where key codes might not be recognized:
|
||||
|
||||
+31
-27
@@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 7.3. Last change: 2013 Jun 12
|
||||
*options.txt* For Vim version 7.3. Last change: 2013 Jun 29
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -482,39 +482,42 @@ to set options automatically for one or more files:
|
||||
There are two forms of modelines. The first form:
|
||||
[text]{white}{vi:|vim:|ex:}[white]{options}
|
||||
|
||||
[text] any text or empty
|
||||
{white} at least one blank character (<Space> or <Tab>)
|
||||
{vi:|vim:|ex:} the string "vi:", "vim:" or "ex:"
|
||||
[white] optional white space
|
||||
{options} a list of option settings, separated with white space or ':',
|
||||
where each part between ':' is the argument for a ":set"
|
||||
command (can be empty)
|
||||
[text] any text or empty
|
||||
{white} at least one blank character (<Space> or <Tab>)
|
||||
{vi:|vim:|ex:} the string "vi:", "vim:" or "ex:"
|
||||
[white] optional white space
|
||||
{options} a list of option settings, separated with white space
|
||||
or ':', where each part between ':' is the argument
|
||||
for a ":set" command (can be empty)
|
||||
|
||||
Example:
|
||||
Examples:
|
||||
vi:noai:sw=3 ts=6 ~
|
||||
vim: tw=77 ~
|
||||
|
||||
The second form (this is compatible with some versions of Vi):
|
||||
|
||||
[text]{white}{vi:|vim:|ex:}[white]se[t] {options}:[text]
|
||||
[text]{white}{vi:|vim:|Vim:|ex:}[white]se[t] {options}:[text]
|
||||
|
||||
[text] any text or empty
|
||||
{white} at least one blank character (<Space> or <Tab>)
|
||||
{vi:|vim:|ex:} the string "vi:", "vim:" or "ex:"
|
||||
[white] optional white space
|
||||
se[t] the string "set " or "se " (note the space)
|
||||
{options} a list of options, separated with white space, which is the
|
||||
argument for a ":set" command
|
||||
: a colon
|
||||
[text] any text or empty
|
||||
[text] any text or empty
|
||||
{white} at least one blank character (<Space> or <Tab>)
|
||||
{vi:|vim:|Vim:|ex:} the string "vi:", "vim:", "Vim:" or "ex:"
|
||||
[white] optional white space
|
||||
se[t] the string "set " or "se " (note the space); When
|
||||
"Vim" is used it must be "set".
|
||||
{options} a list of options, separated with white space, which
|
||||
is the argument for a ":set" command
|
||||
: a colon
|
||||
[text] any text or empty
|
||||
|
||||
Example:
|
||||
Examples:
|
||||
/* vim: set ai tw=75: */ ~
|
||||
/* Vim: set ai tw=75: */ ~
|
||||
|
||||
The white space before {vi:|vim:|ex:} is required. This minimizes the chance
|
||||
that a normal word like "lex:" is caught. There is one exception: "vi:" and
|
||||
"vim:" can also be at the start of the line (for compatibility with version
|
||||
3.0). Using "ex:" at the start of the line will be ignored (this could be
|
||||
short for "example:").
|
||||
The white space before {vi:|vim:|Vim:|ex:} is required. This minimizes the
|
||||
chance that a normal word like "lex:" is caught. There is one exception:
|
||||
"vi:" and "vim:" can also be at the start of the line (for compatibility with
|
||||
version 3.0). Using "ex:" at the start of the line will be ignored (this
|
||||
could be short for "example:").
|
||||
|
||||
*modeline-local*
|
||||
The options are set like with ":setlocal": The new value only applies to the
|
||||
@@ -530,7 +533,7 @@ in another window. But window-local options will be set.
|
||||
|
||||
*modeline-version*
|
||||
If the modeline is only to be used for some versions of Vim, the version
|
||||
number can be specified where "vim:" is used:
|
||||
number can be specified where "vim:" or "Vim:" is used:
|
||||
vim{vers}: version {vers} or later
|
||||
vim<{vers}: version before {vers}
|
||||
vim={vers}: version {vers}
|
||||
@@ -6866,7 +6869,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
V N Virtual column number as -{num}. Not displayed if equal to 'c'.
|
||||
p N Percentage through file in lines as in |CTRL-G|.
|
||||
P S Percentage through file of displayed window. This is like the
|
||||
percentage described for 'ruler'. Always 3 in length.
|
||||
percentage described for 'ruler'. Always 3 in length, unless
|
||||
translated.
|
||||
a S Argument list status as in default title. ({current} of {max})
|
||||
Empty if the argument file count is zero or one.
|
||||
{ NF Evaluate expression between '%{' and '}' and substitute result.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*quickref.txt* For Vim version 7.3. Last change: 2013 May 20
|
||||
*quickref.txt* For Vim version 7.3. Last change: 2013 Jun 29
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -740,10 +740,12 @@ Short explanation of each option: *option-list*
|
||||
'iconstring' string to use for the Vim icon text
|
||||
'ignorecase' 'ic' ignore case in search patterns
|
||||
'imactivatekey' 'imak' key that activates the X input method
|
||||
'imactivatefunc' 'imaf' function to enable/disable the X input method
|
||||
'imcmdline' 'imc' use IM when starting to edit a command line
|
||||
'imdisable' 'imd' do not use the IM in any mode
|
||||
'iminsert' 'imi' use :lmap or IM in Insert mode
|
||||
'imsearch' 'ims' use :lmap or IM when typing a search pattern
|
||||
'imstatusfunc' 'imsf' function to obtain X input method status
|
||||
'include' 'inc' pattern to be used to find an include file
|
||||
'includeexpr' 'inex' expression used to process an include line
|
||||
'incsearch' 'is' highlight match while typing search pattern
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*spell.txt* For Vim version 7.3. Last change: 2011 May 25
|
||||
*spell.txt* For Vim version 7.3. Last change: 2013 Jun 26
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -928,9 +928,13 @@ When the encoding is UTF-8 no word characters need to be specified.
|
||||
Vim allows you to use spell checking for several languages in the same file.
|
||||
You can list them in the 'spelllang' option. As a consequence all spell files
|
||||
for the same encoding must use the same word characters, otherwise they can't
|
||||
be combined without errors. If you get a warning that the word tables differ
|
||||
you may need to generate the .spl file again with |:mkspell|. Check the FOL,
|
||||
LOW and UPP lines in the used .aff file.
|
||||
be combined without errors.
|
||||
|
||||
If you get an E763 warning that the word tables differ you need to update your
|
||||
".spl" spell files. If you downloaded the files, get the latest version of
|
||||
all spell files you use. Otherwise generate the .spl file again with
|
||||
|:mkspell|. If you still get errors check the FOL, LOW and UPP lines in the
|
||||
used .aff files.
|
||||
|
||||
The XX.ascii.spl spell file generated with the "-ascii" argument will not
|
||||
contain the table with characters, so that it can be combine with spell files
|
||||
|
||||
+9
-55
@@ -1,4 +1,4 @@
|
||||
*syntax.txt* For Vim version 7.3. Last change: 2013 Jun 26
|
||||
*syntax.txt* For Vim version 7.3. Last change: 2013 Jun 28
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -2996,38 +2996,6 @@ If you have a slow computer, you may wish to reduce the values for >
|
||||
increase them. This primarily affects synchronizing (i.e. just what group,
|
||||
if any, is the text at the top of the screen supposed to be in?).
|
||||
|
||||
Another cause of slow highlighting is due to syntax-driven folding; see
|
||||
|tex-folding| for a way around this.
|
||||
|
||||
*g:tex_fast*
|
||||
|
||||
Finally, if syntax highlighting is still too slow, you may set >
|
||||
|
||||
:let g:tex_fast= ""
|
||||
|
||||
in your .vimrc. Used this way, the g:tex_fast variable causes the syntax
|
||||
highlighting script to avoid defining any regions and associated
|
||||
synchronization. The result will be much faster syntax highlighting; the
|
||||
price: you will no longer have as much highlighting or any syntax-based
|
||||
folding, and you will be missing syntax-based error checking.
|
||||
|
||||
You may decide that some syntax is acceptable; you may use the following table
|
||||
selectively to enable just some syntax highlighting: >
|
||||
|
||||
b : allow bold and italic syntax
|
||||
c : allow texComment syntax
|
||||
m : allow texMatcher syntax (ie. {...} and [...])
|
||||
M : allow texMath syntax
|
||||
p : allow parts, chapter, section, etc syntax
|
||||
r : allow texRefZone syntax (nocite, bibliography, label, pageref, eqref)
|
||||
s : allow superscript/subscript regions
|
||||
S : allow texStyle syntax
|
||||
v : allow verbatim syntax
|
||||
V : allow texNewEnv and texNewCmd syntax
|
||||
<
|
||||
As an example, let g:tex_fast= "M" will allow math-associated highlighting
|
||||
but suppress all the other region-based syntax highlighting.
|
||||
|
||||
Another cause of slow highlighting is due to syntax-driven folding; see
|
||||
|tex-folding| for a way around this.
|
||||
|
||||
@@ -3141,28 +3109,6 @@ for the following sets of characters: >
|
||||
By leaving one or more of these out, the associated conceal-character
|
||||
substitution will not be made.
|
||||
|
||||
*g:tex_isk*
|
||||
Tex: Controlling What's In A Keyword~
|
||||
|
||||
(La)Tex keywords normally use the characters 0-9,a-z,A-Z,192-255 only
|
||||
but the "_" is the only one that causes problems. So, by default,
|
||||
syntax/tex.vim overrides the usual |'iskeyword'| setting (using |:setlocal|)
|
||||
with one that works for LaTeX.
|
||||
|
||||
However, one may override this iskeyword re-setting by setting the
|
||||
variable, g:tex_isk, in one's .vimrc to whatever one wishes and
|
||||
it will be used instead.
|
||||
|
||||
|
||||
TF *tf.vim* *ft-tf-syntax*
|
||||
|
||||
There is one option for the tf syntax highlighting.
|
||||
|
||||
For syncing, minlines defaults to 100. If you prefer another value, you can
|
||||
set "tf_minlines" to the value you desire. Example: >
|
||||
|
||||
:let tf_minlines = your choice
|
||||
|
||||
*g:tex_isk* *g:tex_stylish*
|
||||
Tex: Controlling iskeyword~
|
||||
|
||||
@@ -3183,7 +3129,15 @@ syntax highlighting script handles this with the following logic:
|
||||
* Else the local 'iskeyword' will be set to 48-57,a-z,A-Z,192-255
|
||||
|
||||
|
||||
TF *tf.vim* *ft-tf-syntax*
|
||||
|
||||
There is one option for the tf syntax highlighting.
|
||||
|
||||
For syncing, minlines defaults to 100. If you prefer another value, you can
|
||||
set "tf_minlines" to the value you desire. Example: >
|
||||
|
||||
:let tf_minlines = your choice
|
||||
<
|
||||
VIM *vim.vim* *ft-vim-syntax*
|
||||
*g:vimsyn_minlines* *g:vimsyn_maxlines*
|
||||
There is a trade-off between more accurate syntax highlighting versus screen
|
||||
|
||||
+6
-2
@@ -345,7 +345,9 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
|
||||
'iconstring' options.txt /*'iconstring'*
|
||||
'ignorecase' options.txt /*'ignorecase'*
|
||||
'im' options.txt /*'im'*
|
||||
'imactivatefunc' options.txt /*'imactivatefunc'*
|
||||
'imactivatekey' options.txt /*'imactivatekey'*
|
||||
'imaf' options.txt /*'imaf'*
|
||||
'imak' options.txt /*'imak'*
|
||||
'imc' options.txt /*'imc'*
|
||||
'imcmdline' options.txt /*'imcmdline'*
|
||||
@@ -355,6 +357,8 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
|
||||
'iminsert' options.txt /*'iminsert'*
|
||||
'ims' options.txt /*'ims'*
|
||||
'imsearch' options.txt /*'imsearch'*
|
||||
'imsf' options.txt /*'imsf'*
|
||||
'imstatusfunc' options.txt /*'imstatusfunc'*
|
||||
'inc' options.txt /*'inc'*
|
||||
'include' options.txt /*'include'*
|
||||
'includeexpr' options.txt /*'includeexpr'*
|
||||
@@ -2437,6 +2441,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
|
||||
:map! map.txt /*:map!*
|
||||
:map-<buffer> map.txt /*:map-<buffer>*
|
||||
:map-<expr> map.txt /*:map-<expr>*
|
||||
:map-<nowait> map.txt /*:map-<nowait>*
|
||||
:map-<script> map.txt /*:map-<script>*
|
||||
:map-<silent> map.txt /*:map-<silent>*
|
||||
:map-<special> map.txt /*:map-<special>*
|
||||
@@ -2447,6 +2452,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
|
||||
:map-expression map.txt /*:map-expression*
|
||||
:map-local map.txt /*:map-local*
|
||||
:map-modes map.txt /*:map-modes*
|
||||
:map-nowait map.txt /*:map-nowait*
|
||||
:map-operator map.txt /*:map-operator*
|
||||
:map-script map.txt /*:map-script*
|
||||
:map-silent map.txt /*:map-silent*
|
||||
@@ -6058,11 +6064,9 @@ g:tar_writeoptions pi_tar.txt /*g:tar_writeoptions*
|
||||
g:tex_comment_nospell syntax.txt /*g:tex_comment_nospell*
|
||||
g:tex_conceal syntax.txt /*g:tex_conceal*
|
||||
g:tex_fast syntax.txt /*g:tex_fast*
|
||||
g:tex_fast syntax.txt /*g:tex_fast*
|
||||
g:tex_flavor filetype.txt /*g:tex_flavor*
|
||||
g:tex_fold_enabled syntax.txt /*g:tex_fold_enabled*
|
||||
g:tex_isk syntax.txt /*g:tex_isk*
|
||||
g:tex_isk syntax.txt /*g:tex_isk*
|
||||
g:tex_no_error syntax.txt /*g:tex_no_error*
|
||||
g:tex_nospell syntax.txt /*g:tex_nospell*
|
||||
g:tex_stylish syntax.txt /*g:tex_stylish*
|
||||
|
||||
+25
-64
@@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 7.3. Last change: 2013 Jun 26
|
||||
*todo.txt* For Vim version 7.3. Last change: 2013 Jun 29
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -34,84 +34,42 @@ not be repeated below, unless there is extra information.
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
--- Python interface
|
||||
--- Python interface ---
|
||||
|
||||
Test 86 fails on MS-Windows, using backslashes instead of forward slashes.
|
||||
(Taro Muraoka, 2013 Jun 24)
|
||||
Can we fix this in code instead of in the test?
|
||||
Breaks the tests
|
||||
Problem: Python SystemExit exception is not handled properly.
|
||||
Solution: Catch the exception and give an error. (Yasuhiro Matsumoto)
|
||||
Files: runtime/doc/if_pyth.txt, src/if_py_both.h, src/if_python.c,
|
||||
src/if_python3.c
|
||||
|
||||
Python: ":py raw_input('prompt')" doesn't work. (Manu Hack)
|
||||
|
||||
Win32: The Python interface only works with one version of Python, selected at
|
||||
compile time. Can this be made to work with version 2.1 and 2.2 dynamically?
|
||||
--- bug fixes ---
|
||||
|
||||
Python: Be able to define a Python function that can be called directly from
|
||||
Vim script. Requires converting the arguments and return value, like with
|
||||
vim.bindeval().
|
||||
9. Patch to fix "gn" on single character matches. (Christian Brabandt, 2013
|
||||
Jun 2)
|
||||
|
||||
Python SystemExit exception is not handled properly. Patch to catch the
|
||||
exception and give an error. (Yasuhiro Matsumoto)
|
||||
Does not work, tests fail.
|
||||
8. Patch for cscope connection (Narendran, 2013 Jun 10)
|
||||
|
||||
--- bug fixes
|
||||
|
||||
Problem with winfixheight and resizing. (Yukihiro Nakadaira, 2011 Sep 17)
|
||||
Patch Sep 18.
|
||||
|
||||
Patch for IME problems. Remove hacking code for old IM. (Yukihiro Nakadaira,
|
||||
2012 Jul 20)
|
||||
|
||||
Modeline is not triggered when using Vim: instead of vim:. It's very hard to
|
||||
see why it doesn't work.
|
||||
|
||||
Patch to fix finding toolbar bitmaps. Issue 129.
|
||||
|
||||
Patch 7.3.1200 doesn't fix the problem in all cases. (Hirohito Higashi, 2013
|
||||
Jun 24)
|
||||
|
||||
Patch to avoid clang warnings when building with Athena.
|
||||
(Dominique Pelle, 2013 Jun 22)
|
||||
|
||||
Suggestion to remove __QNXNTO__ in gui.c. (Sean Boudreau, 2013 Jun 7)
|
||||
|
||||
Combining characters are not used when executing a register with :@w.
|
||||
(William Fugh, 2013 Apr 5, more info from Ben Fritz)
|
||||
Patch by Christian Brabandt, 2013 Apr 6. Second one.
|
||||
|
||||
MS-Windows ACL support doesn't work well. Patch from Ken Takata, 2012 Aug 29.
|
||||
Update Aug 31.
|
||||
Another patch for MingW, 2012 Dec 29.
|
||||
|
||||
Bug in completion menu. (Olivier Teuliere, 2013 Feb 15)
|
||||
Patch by Christian Brabandt, Feb 16.
|
||||
|
||||
Issue 134: pasting in visual selection in empty buffer.
|
||||
Patch by Christian Brabandt, 2013 May 22.
|
||||
|
||||
Patch to fix "gn" on single character matches. (Christian Brabandt, 2013 Jun
|
||||
2)
|
||||
|
||||
Patch for cscope connection (Narendran, 2013 Jun 10)
|
||||
|
||||
'cursorline' is drawn incorrectly in diff mode. Patch by Christian Brabandt,
|
||||
7. 'cursorline' is drawn incorrectly in diff mode. Patch by Christian Brabandt,
|
||||
2012 Apr 2.
|
||||
|
||||
When someone does a silly thing such as setting rows and columns to 65535,
|
||||
6. When someone does a silly thing such as setting rows and columns to 65535,
|
||||
handle the out-of-memory and set them to sane values? (jimmywang, 2013 May 17)
|
||||
|
||||
InsertEnter doesn't prevent the cursor from moving when it goes to another
|
||||
5. InsertEnter doesn't prevent the cursor from moving when it goes to another
|
||||
line.
|
||||
|
||||
":diffoff" does not restore options from before starting diff mode.
|
||||
4. ":diffoff" does not restore options from before starting diff mode.
|
||||
Patch by Christian Brabandt, 2013 May 26.
|
||||
|
||||
Can't use multi-byte fill character in custom status line.
|
||||
3. Can't use multi-byte fill character in custom status line.
|
||||
Patch by Christian Wellenbrock, 2013 Jun 2. Update Jun 3 (second one).
|
||||
|
||||
Patch to fix glob() and globpath() with escaped special characters.
|
||||
2. Patch to fix glob() and globpath() with escaped special characters.
|
||||
(Adnan Zafar, 2013 Jun 2, tests Jun 3)
|
||||
|
||||
Bug in findfile() directory matching. (Markus Braun Ben Fritz, 2013 Jun 20)
|
||||
1. Bug in findfile() directory matching. (Markus Braun Ben Fritz, 2013 Jun 20)
|
||||
Patch by Christian Brabandt (2013 Jun 22)
|
||||
|
||||
---- Fixes to be included before 7.4 above, less important stuff below ----
|
||||
@@ -187,10 +145,6 @@ Second one. Update May 22.
|
||||
|
||||
Patch to make fold updates much faster. (Christian Brabandt, 2012 Dec)
|
||||
|
||||
Patch for IME handling, adds 'imactivatefunc' and 'imstatusfunc' option.
|
||||
(Yukihiro Nakadaira, 2012 Aug 16)
|
||||
Patch to improve IME handling. (Yasuhiro Matsumoto, 2012 Jul 18)
|
||||
|
||||
Issue 54: document behavior of -complete, also expands arg.
|
||||
|
||||
- Add regex for 'paragraphs' and 'sections': 'parare' and 'sectre'. Combine
|
||||
@@ -245,6 +199,13 @@ Problem with refresh:always in completion. (Tyler Wade, 2013 Mar 17)
|
||||
b:undo_ftplugin cannot call a script-local function. (Boris Danilov, 2013 Jan
|
||||
7)
|
||||
|
||||
Win32: The Python interface only works with one version of Python, selected at
|
||||
compile time. Can this be made to work with version 2.1 and 2.2 dynamically?
|
||||
|
||||
Python: Be able to define a Python function that can be called directly from
|
||||
Vim script. Requires converting the arguments and return value, like with
|
||||
vim.bindeval().
|
||||
|
||||
Patch for :tabcloseleft, after closing a tab go to left tab. (William Bowers,
|
||||
2012 Aug 4)
|
||||
|
||||
|
||||
@@ -13,6 +13,11 @@
|
||||
" (Pierre Vittet)
|
||||
" 2010 Jul 10 - Bugfix, thanks to Pat Rondon
|
||||
" 2008 Jul 17 - Bugfix related to fnameescape (VA)
|
||||
" 2013 Jul - moving errorformat into compiler/ocaml.vim Marc Weber
|
||||
"
|
||||
" Marc Weber's comment: This file may contain a lot of (very custom) stuff
|
||||
" which eventually should be moved somewhere else ..
|
||||
"
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
@@ -33,19 +38,6 @@ endif
|
||||
" Error handling -- helps moving where the compiler wants you to go
|
||||
let s:cposet=&cpoptions
|
||||
set cpo&vim
|
||||
setlocal efm=
|
||||
\%EFile\ \"%f\"\\,\ line\ %l\\,\ characters\ %c-%*\\d:,
|
||||
\%EFile\ \"%f\"\\,\ line\ %l\\,\ character\ %c:%m,
|
||||
\%+EReference\ to\ unbound\ regexp\ name\ %m,
|
||||
\%Eocamlyacc:\ e\ -\ line\ %l\ of\ \"%f\"\\,\ %m,
|
||||
\%Wocamlyacc:\ w\ -\ %m,
|
||||
\%-Zmake%.%#,
|
||||
\%C%m,
|
||||
\%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
|
||||
\%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
|
||||
\%D%*\\a:\ Entering\ directory\ `%f',
|
||||
\%X%*\\a:\ Leaving\ directory\ `%f',
|
||||
\%DMaking\ %*\\a\ in\ %f
|
||||
|
||||
" Add mappings, unless the user didn't want this.
|
||||
if !exists("no_plugin_maps") && !exists("no_ocaml_maps")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin
|
||||
" Language: Vim
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2012 Mar 21
|
||||
" Last Change: 2013 Jun 26
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
@@ -21,10 +21,6 @@ let b:undo_ftplugin = "setl fo< isk< com< tw< commentstring<"
|
||||
" and insert the comment leader when hitting <CR> or using "o".
|
||||
setlocal fo-=t fo+=croql
|
||||
|
||||
" To make syntax highlighting of 'vimVar's work correctly we need the colon to
|
||||
" be part of keywords. This needs to be done prior to the 'isk+=#' below.
|
||||
setlocal isk+=:
|
||||
|
||||
" To allow tag lookup via CTRL-] for autoload functions, '#' must be a
|
||||
" keyword character. E.g., for netrw#Nread().
|
||||
setlocal isk+=#
|
||||
|
||||
@@ -4,9 +4,13 @@
|
||||
" Mike Leary <leary@nwlink.com>
|
||||
" Markus Mottl <markus.mottl@gmail.com>
|
||||
" URL: http://www.ocaml.info/vim/indent/ocaml.vim
|
||||
" Last Change: 2010 Sep 04 - Added an indentation improvement by Mark Weber
|
||||
" Last Change: 2013 Jun 29
|
||||
" 2005 Jun 25 - Fixed multiple bugs due to 'else\nreturn ind' working
|
||||
" 2005 May 09 - Added an option to not indent OCaml-indents specially (MM)
|
||||
" 2013 June - commented textwidth (Marc Weber)
|
||||
"
|
||||
" Marc Weber's comment: This file may contain a lot of (very custom) stuff
|
||||
" which eventually should be moved somewhere else ..
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
@@ -19,7 +23,9 @@ setlocal indentexpr=GetOCamlIndent()
|
||||
setlocal indentkeys+=0=and,0=class,0=constraint,0=done,0=else,0=end,0=exception,0=external,0=if,0=in,0=include,0=inherit,0=initializer,0=let,0=method,0=open,0=then,0=type,0=val,0=with,0;;,0>\],0\|\],0>},0\|,0},0\],0)
|
||||
setlocal nolisp
|
||||
setlocal nosmartindent
|
||||
setlocal textwidth=80
|
||||
|
||||
" At least Marc Weber and Markus Mottl do not like this:
|
||||
" setlocal textwidth=80
|
||||
|
||||
" Comment formatting
|
||||
if !exists("no_ocaml_comments")
|
||||
|
||||
+5
-1
@@ -1,7 +1,7 @@
|
||||
" These commands create the option window.
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2013 May 20
|
||||
" Last Change: 2013 Jun 29
|
||||
|
||||
" If there already is an option window, jump to that one.
|
||||
if bufwinnr("option-window") > 0
|
||||
@@ -1209,6 +1209,10 @@ call <SID>OptionL("ims")
|
||||
if has("xim")
|
||||
call append("$", "imcmdline\twhen set always use IM when starting to edit a command line")
|
||||
call <SID>BinOptionG("imc", &imc)
|
||||
call append("$", "imstatusfunc\tfunction to obtain IME status")
|
||||
call <SID>OptionG("imsf", &imsf)
|
||||
call append("$", "imactivatefunc\tfunction to enable/disable IME")
|
||||
call <SID>OptionG("imaf", &imaf)
|
||||
endif
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
" Vim plugin for converting a syntax highlighted file to HTML.
|
||||
" Maintainer: Ben Fritz <fritzophrenic@gmail.com>
|
||||
" Last Change: 2013 Jun 12
|
||||
" Last Change: 2013 Jun 26
|
||||
"
|
||||
" The core of the code is in $VIMRUNTIME/autoload/tohtml.vim and
|
||||
" $VIMRUNTIME/syntax/2html.vim
|
||||
@@ -72,12 +72,11 @@ let g:loaded_2html_plugin = 'vim7.3_v14'
|
||||
"
|
||||
" Changelog: {{{
|
||||
"
|
||||
" 7.3_v14 (this version): Allow suppressing empty <span> created for line
|
||||
" number anchors when line numbers are not included,
|
||||
" using g:html_empty_anchors=0. Allow customizing
|
||||
" important IDs (like line IDs and fold IDs) using
|
||||
" g:html_id_expr evalutated when the buffer conversion
|
||||
" is started.
|
||||
" 7.3_v14 (this version): Allow suppressing line number anchors using
|
||||
" g:html_line_ids=0. Allow customizing
|
||||
" important IDs (like line IDs and fold IDs) using
|
||||
" g:html_id_expr evalutated when the buffer conversion
|
||||
" is started.
|
||||
" 7.3_v13 (2eb30f341e8d): Keep foldmethod at manual in the generated file and
|
||||
" insert modeline to set it to manual.
|
||||
" Fix bug: diff mode with 2 unsaved buffers creates a
|
||||
|
||||
@@ -5115,6 +5115,8 @@ chk_modeline(lnum, flags)
|
||||
e = s + 3;
|
||||
vers = getdigits(&e);
|
||||
if (*e == ':'
|
||||
&& (s[0] != 'V'
|
||||
|| STRNCMP(skipwhite(e + 1), "set", 3) == 0)
|
||||
&& (s[3] == ':'
|
||||
|| (VIM_VERSION_100 >= vers && isdigit(s[3]))
|
||||
|| (VIM_VERSION_100 < vers && s[3] == '<')
|
||||
|
||||
+47
-7
@@ -1138,21 +1138,36 @@ diff_win_options(wp, addbuf)
|
||||
# endif
|
||||
|
||||
wp->w_p_diff = TRUE;
|
||||
|
||||
/* Use 'scrollbind' and 'cursorbind' when available */
|
||||
#ifdef FEAT_SCROLLBIND
|
||||
if (!wp->w_p_diff_saved)
|
||||
wp->w_p_scb_save = wp->w_p_scb;
|
||||
wp->w_p_scb = TRUE;
|
||||
#endif
|
||||
#ifdef FEAT_CURSORBIND
|
||||
if (!wp->w_p_diff_saved)
|
||||
wp->w_p_crb_save = wp->w_p_crb;
|
||||
wp->w_p_crb = TRUE;
|
||||
#endif
|
||||
if (!wp->w_p_diff_saved)
|
||||
wp->w_p_wrap_save = wp->w_p_wrap;
|
||||
wp->w_p_wrap = FALSE;
|
||||
# ifdef FEAT_FOLDING
|
||||
curwin = wp;
|
||||
curbuf = curwin->w_buffer;
|
||||
if (!wp->w_p_diff_saved)
|
||||
wp->w_p_fdm_save = vim_strsave(wp->w_p_fdm);
|
||||
set_string_option_direct((char_u *)"fdm", -1, (char_u *)"diff",
|
||||
OPT_LOCAL|OPT_FREE, 0);
|
||||
curwin = old_curwin;
|
||||
curbuf = curwin->w_buffer;
|
||||
if (!wp->w_p_diff_saved)
|
||||
{
|
||||
wp->w_p_fdc_save = wp->w_p_fdc;
|
||||
wp->w_p_fen_save = wp->w_p_fen;
|
||||
wp->w_p_fdl_save = wp->w_p_fdl;
|
||||
}
|
||||
wp->w_p_fdc = diff_foldcolumn;
|
||||
wp->w_p_fen = TRUE;
|
||||
wp->w_p_fdl = 0;
|
||||
@@ -1164,6 +1179,8 @@ diff_win_options(wp, addbuf)
|
||||
if (vim_strchr(p_sbo, 'h') == NULL)
|
||||
do_cmdline_cmd((char_u *)"set sbo+=hor");
|
||||
#endif
|
||||
/* Saved the current values, to be restored in ex_diffoff(). */
|
||||
wp->w_p_diff_saved = TRUE;
|
||||
|
||||
if (addbuf)
|
||||
diff_buf_add(wp->w_buffer);
|
||||
@@ -1188,25 +1205,48 @@ ex_diffoff(eap)
|
||||
{
|
||||
if (wp == curwin || (eap->forceit && wp->w_p_diff))
|
||||
{
|
||||
/* Set 'diff', 'scrollbind' off and 'wrap' on. */
|
||||
/* Set 'diff', 'scrollbind' off and 'wrap' on. If option values
|
||||
* were saved in diff_win_options() restore them. */
|
||||
wp->w_p_diff = FALSE;
|
||||
RESET_BINDING(wp);
|
||||
wp->w_p_wrap = TRUE;
|
||||
|
||||
#ifdef FEAT_SCROLLBIND
|
||||
if (wp->w_p_scb)
|
||||
wp->w_p_scb = wp->w_p_diff_saved ? wp->w_p_scb_save : FALSE;
|
||||
#endif
|
||||
#ifdef FEAT_CURSORBIND
|
||||
if (wp->w_p_crb)
|
||||
wp->w_p_crb = wp->w_p_diff_saved ? wp->w_p_crb_save : FALSE;
|
||||
#endif
|
||||
if (!wp->w_p_wrap)
|
||||
wp->w_p_wrap = wp->w_p_diff_saved ? wp->w_p_wrap_save : TRUE;
|
||||
#ifdef FEAT_FOLDING
|
||||
curwin = wp;
|
||||
curbuf = curwin->w_buffer;
|
||||
set_string_option_direct((char_u *)"fdm", -1,
|
||||
if (wp->w_p_diff_saved)
|
||||
{
|
||||
free_string_option(wp->w_p_fdm);
|
||||
wp->w_p_fdm = wp->w_p_fdm_save;
|
||||
wp->w_p_fdm_save = empty_option;
|
||||
}
|
||||
else
|
||||
set_string_option_direct((char_u *)"fdm", -1,
|
||||
(char_u *)"manual", OPT_LOCAL|OPT_FREE, 0);
|
||||
curwin = old_curwin;
|
||||
curbuf = curwin->w_buffer;
|
||||
wp->w_p_fdc = 0;
|
||||
wp->w_p_fen = FALSE;
|
||||
wp->w_p_fdl = 0;
|
||||
if (wp->w_p_fdc == diff_foldcolumn)
|
||||
wp->w_p_fdc = wp->w_p_diff_saved ? wp->w_p_fdc_save : 0;
|
||||
if (wp->w_p_fen)
|
||||
wp->w_p_fen = wp->w_p_diff_saved ? wp->w_p_fen_save : FALSE;
|
||||
if (wp->w_p_fdl == 0 && wp->w_p_diff_saved)
|
||||
wp->w_p_fdl = wp->w_p_fdl_save;
|
||||
foldUpdateAll(wp);
|
||||
/* make sure topline is not halfway a fold */
|
||||
changed_window_setting_win(wp);
|
||||
#endif
|
||||
/* Note: 'sbo' is not restored, it's a global option. */
|
||||
diff_buf_adjust(wp);
|
||||
|
||||
wp->w_p_diff_saved = FALSE;
|
||||
}
|
||||
#ifdef FEAT_SCROLLBIND
|
||||
diffwin |= wp->w_p_diff;
|
||||
|
||||
+5
-3
@@ -3477,6 +3477,7 @@ ins_compl_new_leader()
|
||||
}
|
||||
|
||||
compl_enter_selects = !compl_used_match;
|
||||
compl_shown_match = compl_curr_match = compl_first_match;
|
||||
|
||||
/* Show the popup menu with a different set of matches. */
|
||||
ins_compl_show_pum();
|
||||
@@ -8149,15 +8150,16 @@ ins_reg()
|
||||
# ifdef USE_IM_CONTROL
|
||||
int im_on = im_get_status();
|
||||
# endif
|
||||
/* Sync undo, so the effect of e.g., setline() can be undone. */
|
||||
u_sync(TRUE);
|
||||
ins_need_undo = TRUE;
|
||||
|
||||
regname = get_expr_register();
|
||||
# ifdef USE_IM_CONTROL
|
||||
/* Restore the Input Method. */
|
||||
if (im_on)
|
||||
im_set_active(TRUE);
|
||||
# endif
|
||||
if (regname == '=')
|
||||
/* sync undo, so the effect of e.g., setline() can be undone */
|
||||
u_sync(TRUE);
|
||||
}
|
||||
if (regname == NUL || !valid_yank_reg(regname, FALSE))
|
||||
{
|
||||
|
||||
@@ -13755,6 +13755,7 @@ get_maparg(argvars, rettv, exact)
|
||||
dict_add_nr_str(dict, "silent", mp->m_silent ? 1L : 0L, NULL);
|
||||
dict_add_nr_str(dict, "sid", (long)mp->m_script_ID, NULL);
|
||||
dict_add_nr_str(dict, "buffer", (long)buffer_local, NULL);
|
||||
dict_add_nr_str(dict, "nowait", mp->m_nowait ? 1L : 0L, NULL);
|
||||
dict_add_nr_str(dict, "mode", 0L, mapmode);
|
||||
|
||||
vim_free(lhs);
|
||||
|
||||
@@ -4334,6 +4334,9 @@ ex_language(eap)
|
||||
if (what == LC_ALL)
|
||||
{
|
||||
vim_setenv((char_u *)"LANG", name);
|
||||
|
||||
/* Clear $LANGUAGE because GNU gettext uses it. */
|
||||
vim_setenv((char_u *)"LANGUAGE", (char_u *)"");
|
||||
# ifdef WIN32
|
||||
/* Apparently MS-Windows printf() may cause a crash when
|
||||
* we give it 8-bit text while it's expecting text in the
|
||||
|
||||
+12
-13
@@ -3740,6 +3740,7 @@ ExpandInit(xp)
|
||||
#if defined(FEAT_USR_CMDS) && defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
|
||||
xp->xp_arg = NULL;
|
||||
#endif
|
||||
xp->xp_line = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -4419,6 +4420,11 @@ set_cmd_context(xp, str, len, col)
|
||||
while (nextcomm != NULL)
|
||||
nextcomm = set_one_cmd_context(xp, nextcomm);
|
||||
|
||||
/* Store the string here so that call_user_expand_func() can get to them
|
||||
* easily. */
|
||||
xp->xp_line = str;
|
||||
xp->xp_col = col;
|
||||
|
||||
str[col] = old_char;
|
||||
}
|
||||
|
||||
@@ -4959,34 +4965,27 @@ call_user_expand_func(user_expand_func, xp, num_file, file)
|
||||
int *num_file;
|
||||
char_u ***file;
|
||||
{
|
||||
char_u keep;
|
||||
int keep = 0;
|
||||
char_u num[50];
|
||||
char_u *args[3];
|
||||
int save_current_SID = current_SID;
|
||||
void *ret;
|
||||
struct cmdline_info save_ccline;
|
||||
|
||||
if (xp->xp_arg == NULL || xp->xp_arg[0] == '\0')
|
||||
if (xp->xp_arg == NULL || xp->xp_arg[0] == '\0' || xp->xp_line == NULL)
|
||||
return NULL;
|
||||
*num_file = 0;
|
||||
*file = NULL;
|
||||
|
||||
if (ccline.cmdbuff == NULL)
|
||||
if (ccline.cmdbuff != NULL)
|
||||
{
|
||||
/* Completion from Insert mode, pass fake arguments. */
|
||||
keep = 0;
|
||||
sprintf((char *)num, "%d", (int)STRLEN(xp->xp_pattern));
|
||||
args[1] = xp->xp_pattern;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Completion on the command line, pass real arguments. */
|
||||
keep = ccline.cmdbuff[ccline.cmdlen];
|
||||
ccline.cmdbuff[ccline.cmdlen] = 0;
|
||||
sprintf((char *)num, "%d", ccline.cmdpos);
|
||||
args[1] = ccline.cmdbuff;
|
||||
}
|
||||
|
||||
args[0] = vim_strnsave(xp->xp_pattern, xp->xp_pattern_len);
|
||||
args[1] = xp->xp_line;
|
||||
sprintf((char *)num, "%d", xp->xp_col);
|
||||
args[2] = num;
|
||||
|
||||
/* Save the cmdline, we don't know what the function may do. */
|
||||
|
||||
+6
-2
@@ -10339,7 +10339,10 @@ file_pat_to_reg_pat(pat, pat_end, allow_dirs, no_bslash)
|
||||
* foo\,bar -> foo,bar
|
||||
* foo\ bar -> foo bar
|
||||
* Don't unescape \, * and others that are also special in a
|
||||
* regexp. */
|
||||
* regexp.
|
||||
* An escaped { must be unescaped since we use magic not
|
||||
* verymagic.
|
||||
*/
|
||||
if (*++p == '?'
|
||||
#ifdef BACKSLASH_IN_FILENAME
|
||||
&& no_bslash
|
||||
@@ -10347,7 +10350,8 @@ file_pat_to_reg_pat(pat, pat_end, allow_dirs, no_bslash)
|
||||
)
|
||||
reg_pat[i++] = '?';
|
||||
else
|
||||
if (*p == ',' || *p == '%' || *p == '#' || *p == ' ')
|
||||
if (*p == ',' || *p == '%' || *p == '#'
|
||||
|| *p == ' ' || *p == '{')
|
||||
reg_pat[i++] = *p;
|
||||
else
|
||||
{
|
||||
|
||||
+28
-15
@@ -1924,7 +1924,6 @@ vgetorpeek(advance)
|
||||
mapblock_T *mp;
|
||||
#ifdef FEAT_LOCALMAP
|
||||
mapblock_T *mp2;
|
||||
int expecting_global_mappings;
|
||||
#endif
|
||||
mapblock_T *mp_match;
|
||||
int mp_match_len = 0;
|
||||
@@ -2106,9 +2105,9 @@ vgetorpeek(advance)
|
||||
/* First try buffer-local mappings. */
|
||||
mp = curbuf->b_maphash[MAP_HASH(local_State, c1)];
|
||||
mp2 = maphash[MAP_HASH(local_State, c1)];
|
||||
expecting_global_mappings = (mp && mp2);
|
||||
if (mp == NULL)
|
||||
{
|
||||
/* There are no buffer-local mappings. */
|
||||
mp = mp2;
|
||||
mp2 = NULL;
|
||||
}
|
||||
@@ -2130,16 +2129,6 @@ vgetorpeek(advance)
|
||||
#endif
|
||||
(mp = mp->m_next))
|
||||
{
|
||||
#ifdef FEAT_LOCALMAP
|
||||
if (expecting_global_mappings && mp2 == NULL)
|
||||
{
|
||||
/* This is the first global mapping. If we've
|
||||
* got a complete buffer-local match, use it. */
|
||||
if (mp_match)
|
||||
break;
|
||||
expecting_global_mappings = FALSE;
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* Only consider an entry if the first character
|
||||
* matches and it is for the current state.
|
||||
@@ -2215,7 +2204,8 @@ vgetorpeek(advance)
|
||||
|
||||
if (keylen > typebuf.tb_len)
|
||||
{
|
||||
if (!timedout)
|
||||
if (!timedout && !(mp_match != NULL
|
||||
&& mp_match->m_nowait))
|
||||
{
|
||||
/* break at a partly match */
|
||||
keylen = KEYLEN_PART_MAP;
|
||||
@@ -3207,6 +3197,7 @@ do_map(maptype, arg, mode, abbrev)
|
||||
mapblock_T **abbr_table;
|
||||
mapblock_T **map_table;
|
||||
int unique = FALSE;
|
||||
int nowait = FALSE;
|
||||
int silent = FALSE;
|
||||
int special = FALSE;
|
||||
#ifdef FEAT_EVAL
|
||||
@@ -3225,7 +3216,8 @@ do_map(maptype, arg, mode, abbrev)
|
||||
else
|
||||
noremap = REMAP_YES;
|
||||
|
||||
/* Accept <buffer>, <silent>, <expr> <script> and <unique> in any order. */
|
||||
/* Accept <buffer>, <nowait>, <silent>, <expr> <script> and <unique> in
|
||||
* any order. */
|
||||
for (;;)
|
||||
{
|
||||
#ifdef FEAT_LOCALMAP
|
||||
@@ -3241,6 +3233,16 @@ do_map(maptype, arg, mode, abbrev)
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Check for "<nowait>": don't wait for more characters.
|
||||
*/
|
||||
if (STRNCMP(keys, "<nowait>", 8) == 0)
|
||||
{
|
||||
keys = skipwhite(keys + 8);
|
||||
nowait = TRUE;
|
||||
continue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check for "<silent>": don't echo commands.
|
||||
*/
|
||||
@@ -3607,6 +3609,7 @@ do_map(maptype, arg, mode, abbrev)
|
||||
vim_free(mp->m_orig_str);
|
||||
mp->m_orig_str = vim_strsave(orig_rhs);
|
||||
mp->m_noremap = noremap;
|
||||
mp->m_nowait = nowait;
|
||||
mp->m_silent = silent;
|
||||
mp->m_mode = mode;
|
||||
#ifdef FEAT_EVAL
|
||||
@@ -3695,6 +3698,7 @@ do_map(maptype, arg, mode, abbrev)
|
||||
}
|
||||
mp->m_keylen = (int)STRLEN(mp->m_keys);
|
||||
mp->m_noremap = noremap;
|
||||
mp->m_nowait = nowait;
|
||||
mp->m_silent = silent;
|
||||
mp->m_mode = mode;
|
||||
#ifdef FEAT_EVAL
|
||||
@@ -4173,6 +4177,11 @@ set_context_in_map_cmd(xp, cmd, arg, forceit, isabbrev, isunmap, cmdidx)
|
||||
arg = skipwhite(arg + 8);
|
||||
continue;
|
||||
}
|
||||
if (STRNCMP(arg, "<nowait>", 8) == 0)
|
||||
{
|
||||
arg = skipwhite(arg + 8);
|
||||
continue;
|
||||
}
|
||||
if (STRNCMP(arg, "<silent>", 8) == 0)
|
||||
{
|
||||
arg = skipwhite(arg + 8);
|
||||
@@ -4229,7 +4238,7 @@ ExpandMappings(regmatch, num_file, file)
|
||||
{
|
||||
count = 0;
|
||||
|
||||
for (i = 0; i < 5; ++i)
|
||||
for (i = 0; i < 6; ++i)
|
||||
{
|
||||
if (i == 0)
|
||||
p = (char_u *)"<silent>";
|
||||
@@ -4245,6 +4254,8 @@ ExpandMappings(regmatch, num_file, file)
|
||||
else if (i == 4 && !expand_buffer)
|
||||
p = (char_u *)"<buffer>";
|
||||
#endif
|
||||
else if (i == 5)
|
||||
p = (char_u *)"<nowait>";
|
||||
else
|
||||
continue;
|
||||
|
||||
@@ -4857,6 +4868,8 @@ makemap(fd, buf)
|
||||
return FAIL;
|
||||
if (buf != NULL && fputs(" <buffer>", fd) < 0)
|
||||
return FAIL;
|
||||
if (mp->m_nowait && fputs(" <nowait>", fd) < 0)
|
||||
return FAIL;
|
||||
if (mp->m_silent && fputs(" <silent>", fd) < 0)
|
||||
return FAIL;
|
||||
#ifdef FEAT_EVAL
|
||||
|
||||
@@ -206,12 +206,6 @@ gui_attempt_start()
|
||||
static void
|
||||
gui_do_fork()
|
||||
{
|
||||
#ifdef __QNXNTO__
|
||||
procmgr_daemon(0, PROCMGR_DAEMON_KEEPUMASK | PROCMGR_DAEMON_NOCHDIR |
|
||||
PROCMGR_DAEMON_NOCLOSE | PROCMGR_DAEMON_NODEVNULL);
|
||||
gui_attempt_start();
|
||||
return;
|
||||
#else
|
||||
int pipefd[2]; /* pipe between parent and child */
|
||||
int pipe_error;
|
||||
int status;
|
||||
@@ -316,7 +310,6 @@ gui_do_fork()
|
||||
/* If we failed to start the GUI, exit now. */
|
||||
if (!gui.in_use)
|
||||
exit(1);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1644,6 +1637,7 @@ gui_set_shellsize(mustset, fit_to_display, direction)
|
||||
un_maximize = FALSE;
|
||||
#endif
|
||||
}
|
||||
limit_screen_size();
|
||||
gui.num_cols = Columns;
|
||||
gui.num_rows = Rows;
|
||||
|
||||
|
||||
+2
-2
@@ -2591,7 +2591,7 @@ SFcreateWidgets(toplevel, prompt, ok, cancel)
|
||||
(XtCallbackProc)SFvFloatSliderMovedCallback,
|
||||
(XtPointer)(long_u)n);
|
||||
XtAddCallback(selFileVScrolls[n], XtNscrollProc,
|
||||
(XtCallbackProc)SFvAreaSelectedCallback, (XtPointer)n);
|
||||
(XtCallbackProc)SFvAreaSelectedCallback, (XtPointer)(long_u)n);
|
||||
|
||||
selFileHScrolls[n] = XtVaCreateManagedWidget("selFileHScroll",
|
||||
#ifdef FEAT_GUI_NEXTAW
|
||||
@@ -2616,7 +2616,7 @@ SFcreateWidgets(toplevel, prompt, ok, cancel)
|
||||
(XtCallbackProc)SFhSliderMovedCallback,
|
||||
(XtPointer)(long_u)n);
|
||||
XtAddCallback(selFileHScrolls[n], XtNscrollProc,
|
||||
(XtCallbackProc)SFhAreaSelectedCallback, (XtPointer)n);
|
||||
(XtCallbackProc)SFhAreaSelectedCallback, (XtPointer)(long_u)n);
|
||||
}
|
||||
|
||||
selFileOK = XtVaCreateManagedWidget("selFileOK",
|
||||
|
||||
@@ -613,6 +613,17 @@ gui_mch_menu_set_tip(vimmenu_T *menu)
|
||||
void
|
||||
gui_mch_destroy_menu(vimmenu_T *menu)
|
||||
{
|
||||
/* Don't let gtk_container_remove automatically destroy menu->id. */
|
||||
if (menu->id != NULL)
|
||||
g_object_ref(menu->id);
|
||||
|
||||
/* Workaround for a spurious gtk warning in Ubuntu: "Trying to remove
|
||||
* a child that doesn't believe we're it's parent."
|
||||
* Remove widget from gui.menubar before destroying it. */
|
||||
if (menu->id != NULL && gui.menubar != NULL
|
||||
&& gtk_widget_get_parent(menu->id) == gui.menubar)
|
||||
gtk_container_remove(GTK_CONTAINER(gui.menubar), menu->id);
|
||||
|
||||
# ifdef FEAT_TOOLBAR
|
||||
if (menu->parent != NULL && menu_is_toolbar(menu->parent->name))
|
||||
{
|
||||
@@ -632,6 +643,8 @@ gui_mch_destroy_menu(vimmenu_T *menu)
|
||||
gtk_widget_destroy(menu->id);
|
||||
}
|
||||
|
||||
if (menu->id != NULL)
|
||||
g_object_unref(menu->id);
|
||||
menu->submenu_id = NULL;
|
||||
menu->id = NULL;
|
||||
}
|
||||
|
||||
@@ -3698,6 +3698,7 @@ gui_mch_open(void)
|
||||
p_window = h - 1;
|
||||
Rows = h;
|
||||
}
|
||||
limit_screen_size();
|
||||
|
||||
pixel_width = (guint)(gui_get_base_width() + Columns * gui.char_width);
|
||||
pixel_height = (guint)(gui_get_base_height() + Rows * gui.char_height);
|
||||
|
||||
+5
-1
@@ -4163,7 +4163,11 @@ get_toolbar_bitmap(vimmenu_T *menu)
|
||||
* didn't exist or wasn't specified, try the menu name
|
||||
*/
|
||||
if (hbitmap == NULL
|
||||
&& (gui_find_bitmap(menu->name, fname, "bmp") == OK))
|
||||
&& (gui_find_bitmap(
|
||||
#ifdef FEAT_MULTI_LANG
|
||||
menu->en_dname != NULL ? menu->en_dname :
|
||||
#endif
|
||||
menu->dname, fname, "bmp") == OK))
|
||||
hbitmap = LoadImage(
|
||||
NULL,
|
||||
fname,
|
||||
|
||||
@@ -1431,6 +1431,7 @@ gui_mch_init()
|
||||
p_window = h - 1;
|
||||
Rows = h;
|
||||
}
|
||||
limit_screen_size();
|
||||
/*
|
||||
* Set the (x,y) position of the main window only if specified in the
|
||||
* users geometry, so we get good defaults when they don't. This needs
|
||||
|
||||
@@ -997,6 +997,15 @@ err_closing:
|
||||
vim_free(ppath);
|
||||
|
||||
#if defined(UNIX)
|
||||
# if defined(HAVE_SETSID) || defined(HAVE_SETPGID)
|
||||
/* Change our process group to avoid cscope receiving SIGWINCH. */
|
||||
# if defined(HAVE_SETSID)
|
||||
(void)setsid();
|
||||
# else
|
||||
if (setpgid(0, 0) == -1)
|
||||
PERROR(_("cs_create_connection setpgid failed"));
|
||||
# endif
|
||||
# endif
|
||||
if (execl("/bin/sh", "sh", "-c", cmd, (char *)NULL) == -1)
|
||||
PERROR(_("cs_create_connection exec failed"));
|
||||
|
||||
|
||||
+54
-17
@@ -13,6 +13,8 @@
|
||||
* Common code for if_python.c and if_python3.c.
|
||||
*/
|
||||
|
||||
static char_u e_py_systemexit[] = "E880: Can't handle SystemExit of %s exception in vim";
|
||||
|
||||
#if PY_VERSION_HEX < 0x02050000
|
||||
typedef int Py_ssize_t; /* Python 2.4 and earlier don't have this type. */
|
||||
#endif
|
||||
@@ -275,7 +277,7 @@ ObjectDir(PyObject *self, char **attributes)
|
||||
|
||||
if (self)
|
||||
for (method = self->ob_type->tp_methods ; method->ml_name != NULL ; ++method)
|
||||
if (add_string(ret, (char *) method->ml_name))
|
||||
if (add_string(ret, (char *)method->ml_name))
|
||||
{
|
||||
Py_DECREF(ret);
|
||||
return NULL;
|
||||
@@ -549,8 +551,9 @@ VimTryStart(void)
|
||||
VimTryEnd(void)
|
||||
{
|
||||
--trylevel;
|
||||
/* Without this it stops processing all subsequent VimL commands and
|
||||
* generates strange error messages if I e.g. try calling Test() in a cycle */
|
||||
/* Without this it stops processing all subsequent VimL commands and
|
||||
* generates strange error messages if I e.g. try calling Test() in a
|
||||
* cycle */
|
||||
did_emsg = FALSE;
|
||||
/* Keyboard interrupt should be preferred over anything else */
|
||||
if (got_int)
|
||||
@@ -570,7 +573,7 @@ VimTryEnd(void)
|
||||
/* Finally transform VimL exception to python one */
|
||||
else
|
||||
{
|
||||
PyErr_SetVim((char *) current_exception->value);
|
||||
PyErr_SetVim((char *)current_exception->value);
|
||||
discard_current_exception();
|
||||
return -1;
|
||||
}
|
||||
@@ -667,7 +670,7 @@ VimToPython(typval_T *our_tv, int depth, PyObject *lookup_dict)
|
||||
|
||||
/* For backwards compatibility numbers are stored as strings. */
|
||||
sprintf(buf, "%ld", (long)our_tv->vval.v_number);
|
||||
ret = PyString_FromString((char *) buf);
|
||||
ret = PyString_FromString((char *)buf);
|
||||
}
|
||||
# ifdef FEAT_FLOAT
|
||||
else if (our_tv->v_type == VAR_FLOAT)
|
||||
@@ -675,7 +678,7 @@ VimToPython(typval_T *our_tv, int depth, PyObject *lookup_dict)
|
||||
char buf[NUMBUFLEN];
|
||||
|
||||
sprintf(buf, "%f", our_tv->vval.v_float);
|
||||
ret = PyString_FromString((char *) buf);
|
||||
ret = PyString_FromString((char *)buf);
|
||||
}
|
||||
# endif
|
||||
else if (our_tv->v_type == VAR_LIST)
|
||||
@@ -955,7 +958,7 @@ map_rtp_callback(char_u *path, void *_data)
|
||||
PyObject *pathObject;
|
||||
map_rtp_data *mr_data = *((map_rtp_data **) data);
|
||||
|
||||
if (!(pathObject = PyString_FromString((char *) path)))
|
||||
if (!(pathObject = PyString_FromString((char *)path)))
|
||||
{
|
||||
*data = NULL;
|
||||
return;
|
||||
@@ -1124,7 +1127,7 @@ find_module(char *fullname, char *tail, PyObject *new_path)
|
||||
PyObject *module;
|
||||
char *dot;
|
||||
|
||||
if ((dot = (char *) vim_strchr((char_u *) tail, '.')))
|
||||
if ((dot = (char *)vim_strchr((char_u *) tail, '.')))
|
||||
{
|
||||
/*
|
||||
* There is a dot in the name: call find_module recursively without the
|
||||
@@ -1658,7 +1661,7 @@ DictionaryIterNext(dictiterinfo_T **dii)
|
||||
|
||||
--((*dii)->todo);
|
||||
|
||||
if (!(ret = PyBytes_FromString((char *) (*dii)->hi->hi_key)))
|
||||
if (!(ret = PyBytes_FromString((char *)(*dii)->hi->hi_key)))
|
||||
return NULL;
|
||||
|
||||
return ret;
|
||||
@@ -2680,12 +2683,12 @@ FunctionCall(FunctionObject *self, PyObject *argsObject, PyObject *kwargs)
|
||||
FunctionRepr(FunctionObject *self)
|
||||
{
|
||||
#ifdef Py_TRACE_REFS
|
||||
/* For unknown reason self->name may be NULL after calling
|
||||
/* For unknown reason self->name may be NULL after calling
|
||||
* Finalize */
|
||||
return PyString_FromFormat("<vim.Function '%s'>",
|
||||
(self->name == NULL ? "<NULL>" : (char *) self->name));
|
||||
(self->name == NULL ? "<NULL>" : (char *)self->name));
|
||||
#else
|
||||
return PyString_FromFormat("<vim.Function '%s'>", (char *) self->name);
|
||||
return PyString_FromFormat("<vim.Function '%s'>", (char *)self->name);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -2809,7 +2812,7 @@ OptionsItem(OptionsObject *self, PyObject *keyObject)
|
||||
{
|
||||
if (stringval)
|
||||
{
|
||||
PyObject *ret = PyBytes_FromString((char *) stringval);
|
||||
PyObject *ret = PyBytes_FromString((char *)stringval);
|
||||
vim_free(stringval);
|
||||
return ret;
|
||||
}
|
||||
@@ -4525,7 +4528,7 @@ BufferAttr(BufferObject *self, char *name)
|
||||
{
|
||||
if (strcmp(name, "name") == 0)
|
||||
return PyString_FromString((self->buf->b_ffname == NULL
|
||||
? "" : (char *) self->buf->b_ffname));
|
||||
? "" : (char *)self->buf->b_ffname));
|
||||
else if (strcmp(name, "number") == 0)
|
||||
return Py_BuildValue(Py_ssize_t_fmt, self->buf->b_fnum);
|
||||
else if (strcmp(name, "vars") == 0)
|
||||
@@ -4961,7 +4964,19 @@ run_cmd(const char *cmd, void *arg UNUSED
|
||||
#endif
|
||||
)
|
||||
{
|
||||
PyRun_SimpleString((char *) cmd);
|
||||
PyObject *run_ret;
|
||||
run_ret = PyRun_String((char *)cmd, Py_file_input, globals, globals);
|
||||
if (run_ret != NULL)
|
||||
{
|
||||
Py_DECREF(run_ret);
|
||||
}
|
||||
else if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_SystemExit))
|
||||
{
|
||||
EMSG2(_(e_py_systemexit), "python");
|
||||
PyErr_Clear();
|
||||
}
|
||||
else
|
||||
PyErr_PrintEx(1);
|
||||
}
|
||||
|
||||
static const char *code_hdr = "def " DOPY_FUNC "(line, linenr):\n ";
|
||||
@@ -4979,6 +4994,7 @@ run_do(const char *cmd, void *arg UNUSED
|
||||
char *code;
|
||||
int status;
|
||||
PyObject *pyfunc, *pymain;
|
||||
PyObject *run_ret;
|
||||
|
||||
if (u_save((linenr_T)RangeStart - 1, (linenr_T)RangeEnd + 1) != OK)
|
||||
{
|
||||
@@ -4990,7 +5006,23 @@ run_do(const char *cmd, void *arg UNUSED
|
||||
code = PyMem_New(char, len + 1);
|
||||
memcpy(code, code_hdr, code_hdr_len);
|
||||
STRCPY(code + code_hdr_len, cmd);
|
||||
status = PyRun_SimpleString(code);
|
||||
run_ret = PyRun_String(code, Py_file_input, globals, globals);
|
||||
status = -1;
|
||||
if (run_ret != NULL)
|
||||
{
|
||||
status = 0;
|
||||
Py_DECREF(run_ret);
|
||||
}
|
||||
else if (PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_SystemExit))
|
||||
{
|
||||
PyMem_Free(code);
|
||||
EMSG2(_(e_py_systemexit), "python");
|
||||
PyErr_Clear();
|
||||
return;
|
||||
}
|
||||
else
|
||||
PyErr_PrintEx(1);
|
||||
|
||||
PyMem_Free(code);
|
||||
|
||||
if (status)
|
||||
@@ -5068,9 +5100,14 @@ run_eval(const char *cmd, typval_T *rettv
|
||||
{
|
||||
PyObject *run_ret;
|
||||
|
||||
run_ret = PyRun_String((char *) cmd, Py_eval_input, globals, globals);
|
||||
run_ret = PyRun_String((char *)cmd, Py_eval_input, globals, globals);
|
||||
if (run_ret == NULL)
|
||||
{
|
||||
if (PyErr_ExceptionMatches(PyExc_SystemExit))
|
||||
{
|
||||
EMSG2(_(e_py_systemexit), "python");
|
||||
PyErr_Clear();
|
||||
}
|
||||
if (PyErr_Occurred() && !msg_silent)
|
||||
PyErr_PrintEx(0);
|
||||
EMSG(_("E858: Eval did not return a valid python object"));
|
||||
|
||||
@@ -448,6 +448,7 @@ static PyObject *imp_PyExc_KeyError;
|
||||
static PyObject *imp_PyExc_KeyboardInterrupt;
|
||||
static PyObject *imp_PyExc_TypeError;
|
||||
static PyObject *imp_PyExc_ValueError;
|
||||
static PyObject *imp_PyExc_SystemExit;
|
||||
static PyObject *imp_PyExc_RuntimeError;
|
||||
static PyObject *imp_PyExc_ImportError;
|
||||
static PyObject *imp_PyExc_OverflowError;
|
||||
@@ -458,6 +459,7 @@ static PyObject *imp_PyExc_OverflowError;
|
||||
# define PyExc_KeyboardInterrupt imp_PyExc_KeyboardInterrupt
|
||||
# define PyExc_TypeError imp_PyExc_TypeError
|
||||
# define PyExc_ValueError imp_PyExc_ValueError
|
||||
# define PyExc_SystemExit imp_PyExc_SystemExit
|
||||
# define PyExc_RuntimeError imp_PyExc_RuntimeError
|
||||
# define PyExc_ImportError imp_PyExc_ImportError
|
||||
# define PyExc_OverflowError imp_PyExc_OverflowError
|
||||
@@ -735,6 +737,7 @@ get_exceptions(void)
|
||||
imp_PyExc_KeyboardInterrupt = PyDict_GetItemString(exdict, "KeyboardInterrupt");
|
||||
imp_PyExc_TypeError = PyDict_GetItemString(exdict, "TypeError");
|
||||
imp_PyExc_ValueError = PyDict_GetItemString(exdict, "ValueError");
|
||||
imp_PyExc_SystemExit = PyDict_GetItemString(exdict, "SystemExit");
|
||||
imp_PyExc_RuntimeError = PyDict_GetItemString(exdict, "RuntimeError");
|
||||
imp_PyExc_ImportError = PyDict_GetItemString(exdict, "ImportError");
|
||||
imp_PyExc_OverflowError = PyDict_GetItemString(exdict, "OverflowError");
|
||||
@@ -744,6 +747,7 @@ get_exceptions(void)
|
||||
Py_XINCREF(imp_PyExc_KeyboardInterrupt);
|
||||
Py_XINCREF(imp_PyExc_TypeError);
|
||||
Py_XINCREF(imp_PyExc_ValueError);
|
||||
Py_XINCREF(imp_PyExc_SystemExit);
|
||||
Py_XINCREF(imp_PyExc_RuntimeError);
|
||||
Py_XINCREF(imp_PyExc_ImportError);
|
||||
Py_XINCREF(imp_PyExc_OverflowError);
|
||||
|
||||
+4
-1
@@ -126,7 +126,6 @@
|
||||
# define PyErr_PrintEx py3_PyErr_PrintEx
|
||||
# define PyErr_NoMemory py3_PyErr_NoMemory
|
||||
# define PyErr_Occurred py3_PyErr_Occurred
|
||||
# define PyErr_PrintEx py3_PyErr_PrintEx
|
||||
# define PyErr_SetNone py3_PyErr_SetNone
|
||||
# define PyErr_SetString py3_PyErr_SetString
|
||||
# define PyErr_SetObject py3_PyErr_SetObject
|
||||
@@ -403,6 +402,7 @@ static PyObject *p3imp_PyExc_KeyError;
|
||||
static PyObject *p3imp_PyExc_KeyboardInterrupt;
|
||||
static PyObject *p3imp_PyExc_TypeError;
|
||||
static PyObject *p3imp_PyExc_ValueError;
|
||||
static PyObject *p3imp_PyExc_SystemExit;
|
||||
static PyObject *p3imp_PyExc_RuntimeError;
|
||||
static PyObject *p3imp_PyExc_ImportError;
|
||||
static PyObject *p3imp_PyExc_OverflowError;
|
||||
@@ -413,6 +413,7 @@ static PyObject *p3imp_PyExc_OverflowError;
|
||||
# define PyExc_KeyboardInterrupt p3imp_PyExc_KeyboardInterrupt
|
||||
# define PyExc_TypeError p3imp_PyExc_TypeError
|
||||
# define PyExc_ValueError p3imp_PyExc_ValueError
|
||||
# define PyExc_SystemExit p3imp_PyExc_SystemExit
|
||||
# define PyExc_RuntimeError p3imp_PyExc_RuntimeError
|
||||
# define PyExc_ImportError p3imp_PyExc_ImportError
|
||||
# define PyExc_OverflowError p3imp_PyExc_OverflowError
|
||||
@@ -681,6 +682,7 @@ get_py3_exceptions()
|
||||
p3imp_PyExc_KeyboardInterrupt = PyDict_GetItemString(exdict, "KeyboardInterrupt");
|
||||
p3imp_PyExc_TypeError = PyDict_GetItemString(exdict, "TypeError");
|
||||
p3imp_PyExc_ValueError = PyDict_GetItemString(exdict, "ValueError");
|
||||
p3imp_PyExc_SystemExit = PyDict_GetItemString(exdict, "SystemExit");
|
||||
p3imp_PyExc_RuntimeError = PyDict_GetItemString(exdict, "RuntimeError");
|
||||
p3imp_PyExc_ImportError = PyDict_GetItemString(exdict, "ImportError");
|
||||
p3imp_PyExc_OverflowError = PyDict_GetItemString(exdict, "OverflowError");
|
||||
@@ -690,6 +692,7 @@ get_py3_exceptions()
|
||||
Py_XINCREF(p3imp_PyExc_KeyboardInterrupt);
|
||||
Py_XINCREF(p3imp_PyExc_TypeError);
|
||||
Py_XINCREF(p3imp_PyExc_ValueError);
|
||||
Py_XINCREF(p3imp_PyExc_SystemExit);
|
||||
Py_XINCREF(p3imp_PyExc_RuntimeError);
|
||||
Py_XINCREF(p3imp_PyExc_ImportError);
|
||||
Py_XINCREF(p3imp_PyExc_OverflowError);
|
||||
|
||||
+2
-2
@@ -2497,7 +2497,7 @@ scripterror:
|
||||
* Look for evidence of non-Cygwin paths before we bother.
|
||||
* This is only for when using the Unix files.
|
||||
*/
|
||||
if (strpbrk(p, "\\:") != NULL && !path_with_url(p))
|
||||
if (vim_strpbrk(p, "\\:") != NULL && !path_with_url(p))
|
||||
{
|
||||
char posix_path[PATH_MAX];
|
||||
|
||||
@@ -2507,7 +2507,7 @@ scripterror:
|
||||
cygwin_conv_to_posix_path(p, posix_path);
|
||||
# endif
|
||||
vim_free(p);
|
||||
p = vim_strsave(posix_path);
|
||||
p = vim_strsave((char_u *)posix_path);
|
||||
if (p == NULL)
|
||||
mch_exit(2);
|
||||
}
|
||||
|
||||
+11
-2
@@ -5146,6 +5146,7 @@ xim_reset(void)
|
||||
{
|
||||
xim_set_focus(gui.in_focus);
|
||||
|
||||
# ifdef FEAT_EVAL
|
||||
if (p_imaf[0] != NUL)
|
||||
{
|
||||
char_u *argv[1];
|
||||
@@ -5156,7 +5157,9 @@ xim_reset(void)
|
||||
argv[0] = (char_u *)"0";
|
||||
(void)call_func_retnr(p_imaf, 1, argv, FALSE);
|
||||
}
|
||||
else if (im_activatekey_keyval != GDK_VoidSymbol)
|
||||
else
|
||||
# endif
|
||||
if (im_activatekey_keyval != GDK_VoidSymbol)
|
||||
{
|
||||
if (im_is_active)
|
||||
{
|
||||
@@ -5320,12 +5323,17 @@ xim_queue_key_press_event(GdkEventKey *event, int down)
|
||||
int
|
||||
im_get_status(void)
|
||||
{
|
||||
# ifdef FEAT_EVAL
|
||||
if (p_imsf[0] != NUL)
|
||||
{
|
||||
int is_active;
|
||||
|
||||
/* FIXME: Don't execute user function in unsafe situation. */
|
||||
if (exiting || is_autocmd_blocked())
|
||||
if (exiting
|
||||
# ifdef FEAT_AUTOCMD
|
||||
|| is_autocmd_blocked()
|
||||
# endif
|
||||
)
|
||||
return FALSE;
|
||||
/* FIXME: :py print 'xxx' is shown duplicate result.
|
||||
* Use silent to avoid it. */
|
||||
@@ -5334,6 +5342,7 @@ im_get_status(void)
|
||||
--msg_silent;
|
||||
return (is_active > 0);
|
||||
}
|
||||
# endif
|
||||
return im_is_active;
|
||||
}
|
||||
# endif
|
||||
|
||||
+51
-3
@@ -10463,6 +10463,54 @@ remove_duplicates(gap)
|
||||
}
|
||||
#endif
|
||||
|
||||
static int has_env_var __ARGS((char_u *p));
|
||||
|
||||
/*
|
||||
* Return TRUE if "p" contains what looks like an environment variable.
|
||||
* Allowing for escaping.
|
||||
*/
|
||||
static int
|
||||
has_env_var(p)
|
||||
char_u *p;
|
||||
{
|
||||
for ( ; *p; mb_ptr_adv(p))
|
||||
{
|
||||
if (*p == '\\' && p[1] != NUL)
|
||||
++p;
|
||||
else if (vim_strchr((char_u *)
|
||||
#if defined(MSDOS) || defined(MSWIN) || defined(OS2)
|
||||
"$%"
|
||||
#else
|
||||
"$"
|
||||
#endif
|
||||
, *p) != NULL)
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#ifdef SPECIAL_WILDCHAR
|
||||
static int has_special_wildchar __ARGS((char_u *p));
|
||||
|
||||
/*
|
||||
* Return TRUE if "p" contains a special wildcard character.
|
||||
* Allowing for escaping.
|
||||
*/
|
||||
static int
|
||||
has_special_wildchar(p)
|
||||
char_u *p;
|
||||
{
|
||||
for ( ; *p; mb_ptr_adv(p))
|
||||
{
|
||||
if (*p == '\\' && p[1] != NUL)
|
||||
++p;
|
||||
else if (vim_strchr((char_u *)SPECIAL_WILDCHAR, *p) != NULL)
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Generic wildcard expansion code.
|
||||
*
|
||||
@@ -10513,7 +10561,7 @@ gen_expand_wildcards(num_pat, pat, num_file, file, flags)
|
||||
*/
|
||||
for (i = 0; i < num_pat; i++)
|
||||
{
|
||||
if (vim_strpbrk(pat[i], (char_u *)SPECIAL_WILDCHAR) != NULL
|
||||
if (has_special_wildchar(pat[i])
|
||||
# ifdef VIM_BACKTICK
|
||||
&& !(vim_backtick(pat[i]) && pat[i][1] == '=')
|
||||
# endif
|
||||
@@ -10543,7 +10591,7 @@ gen_expand_wildcards(num_pat, pat, num_file, file, flags)
|
||||
/*
|
||||
* First expand environment variables, "~/" and "~user/".
|
||||
*/
|
||||
if (vim_strchr(p, '$') != NULL || *p == '~')
|
||||
if (has_env_var(p) || *p == '~')
|
||||
{
|
||||
p = expand_env_save_opt(p, TRUE);
|
||||
if (p == NULL)
|
||||
@@ -10554,7 +10602,7 @@ gen_expand_wildcards(num_pat, pat, num_file, file, flags)
|
||||
* variable, use the shell to do that. Discard previously
|
||||
* found file names and start all over again.
|
||||
*/
|
||||
else if (vim_strchr(p, '$') != NULL || *p == '~')
|
||||
else if (has_env_var(p) || *p == '~')
|
||||
{
|
||||
vim_free(p);
|
||||
ga_clear_strings(&ga);
|
||||
|
||||
+52
-2
@@ -4685,8 +4685,58 @@ vim_findfile_init(path, filename, stopdirs, level, free_visited, find_what,
|
||||
}
|
||||
STRCPY(ff_expand_buffer, search_ctx->ffsc_start_dir);
|
||||
add_pathsep(ff_expand_buffer);
|
||||
STRCAT(ff_expand_buffer, search_ctx->ffsc_fix_path);
|
||||
add_pathsep(ff_expand_buffer);
|
||||
{
|
||||
int eb_len = STRLEN(ff_expand_buffer);
|
||||
char_u *buf = alloc(eb_len + STRLEN(search_ctx->ffsc_fix_path) + 1);
|
||||
|
||||
STRCPY(buf, ff_expand_buffer);
|
||||
STRCPY(buf + eb_len, search_ctx->ffsc_fix_path);
|
||||
if (mch_isdir(buf))
|
||||
{
|
||||
STRCAT(ff_expand_buffer, search_ctx->ffsc_fix_path);
|
||||
add_pathsep(ff_expand_buffer);
|
||||
}
|
||||
#ifdef FEAT_PATH_EXTRA
|
||||
else
|
||||
{
|
||||
char_u *p = vim_strrchr(search_ctx->ffsc_fix_path, PATHSEP);
|
||||
char_u *wc_path = NUL;
|
||||
char_u *temp = NUL;
|
||||
int len = 0;
|
||||
|
||||
if (p != NULL)
|
||||
{
|
||||
len = p - search_ctx->ffsc_fix_path;
|
||||
STRNCAT(ff_expand_buffer, search_ctx->ffsc_fix_path, len);
|
||||
add_pathsep(ff_expand_buffer);
|
||||
}
|
||||
else
|
||||
len = STRLEN(search_ctx->ffsc_fix_path);
|
||||
|
||||
if (search_ctx->ffsc_wc_path != NULL)
|
||||
{
|
||||
wc_path = vim_strsave(search_ctx->ffsc_wc_path);
|
||||
temp = alloc(STRLEN(search_ctx->ffsc_wc_path)
|
||||
+ (STRLEN(search_ctx->ffsc_fix_path) - len));
|
||||
}
|
||||
|
||||
if (temp == NULL || wc_path == NULL)
|
||||
{
|
||||
vim_free(buf);
|
||||
vim_free(temp);
|
||||
vim_free(wc_path);
|
||||
goto error_return;
|
||||
}
|
||||
|
||||
STRCPY(temp, search_ctx->ffsc_fix_path + len);
|
||||
STRCAT(temp, search_ctx->ffsc_wc_path);
|
||||
vim_free(search_ctx->ffsc_wc_path);
|
||||
vim_free(wc_path);
|
||||
search_ctx->ffsc_wc_path = temp;
|
||||
}
|
||||
#endif
|
||||
vim_free(buf);
|
||||
}
|
||||
|
||||
sptr = ff_create_stack_element(ff_expand_buffer,
|
||||
#ifdef FEAT_PATH_EXTRA
|
||||
|
||||
@@ -3497,7 +3497,9 @@ do_put(regname, dir, count, flags)
|
||||
#endif
|
||||
if (dir == FORWARD)
|
||||
++lnum;
|
||||
if (u_save(lnum - 1, lnum) == FAIL)
|
||||
/* In an empty buffer the empty line is going to be replaced, include
|
||||
* it in the saved lines. */
|
||||
if ((bufempty() ? u_save(0, 2) : u_save(lnum - 1, lnum)) == FAIL)
|
||||
goto end;
|
||||
#ifdef FEAT_FOLDING
|
||||
if (dir == FORWARD)
|
||||
|
||||
+15
-6
@@ -1509,7 +1509,7 @@ static struct vimoption
|
||||
{(char_u *)B_IMODE_NONE, (char_u *)0L}
|
||||
#endif
|
||||
SCRIPTID_INIT},
|
||||
{"imstatusfunc","imse",P_STRING|P_VI_DEF|P_SECURE,
|
||||
{"imstatusfunc","imsf",P_STRING|P_VI_DEF|P_SECURE,
|
||||
# if defined(FEAT_EVAL) && defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
|
||||
(char_u *)&p_imsf, PV_NONE,
|
||||
{(char_u *)"", (char_u *)NULL}
|
||||
@@ -8666,11 +8666,7 @@ set_num_option(opt_idx, varp, value, errbuf, errbuflen, opt_flags)
|
||||
}
|
||||
Columns = MIN_COLUMNS;
|
||||
}
|
||||
/* Limit the values to avoid an overflow in Rows * Columns. */
|
||||
if (Columns > 10000)
|
||||
Columns = 10000;
|
||||
if (Rows > 1000)
|
||||
Rows = 1000;
|
||||
limit_screen_size();
|
||||
|
||||
#ifdef DJGPP
|
||||
/* avoid a crash by checking for a too large value of 'columns' */
|
||||
@@ -10263,14 +10259,19 @@ copy_winopt(from, to)
|
||||
to->wo_stl = vim_strsave(from->wo_stl);
|
||||
#endif
|
||||
to->wo_wrap = from->wo_wrap;
|
||||
#ifdef FEAT_DIFF
|
||||
to->wo_wrap_save = from->wo_wrap_save;
|
||||
#endif
|
||||
#ifdef FEAT_LINEBREAK
|
||||
to->wo_lbr = from->wo_lbr;
|
||||
#endif
|
||||
#ifdef FEAT_SCROLLBIND
|
||||
to->wo_scb = from->wo_scb;
|
||||
to->wo_scb_save = from->wo_scb_save;
|
||||
#endif
|
||||
#ifdef FEAT_CURSORBIND
|
||||
to->wo_crb = from->wo_crb;
|
||||
to->wo_crb_save = from->wo_crb_save;
|
||||
#endif
|
||||
#ifdef FEAT_SPELL
|
||||
to->wo_spell = from->wo_spell;
|
||||
@@ -10282,6 +10283,7 @@ copy_winopt(from, to)
|
||||
#endif
|
||||
#ifdef FEAT_DIFF
|
||||
to->wo_diff = from->wo_diff;
|
||||
to->wo_diff_saved = from->wo_diff_saved;
|
||||
#endif
|
||||
#ifdef FEAT_CONCEAL
|
||||
to->wo_cocu = vim_strsave(from->wo_cocu);
|
||||
@@ -10289,11 +10291,16 @@ copy_winopt(from, to)
|
||||
#endif
|
||||
#ifdef FEAT_FOLDING
|
||||
to->wo_fdc = from->wo_fdc;
|
||||
to->wo_fdc_save = from->wo_fdc_save;
|
||||
to->wo_fen = from->wo_fen;
|
||||
to->wo_fen_save = from->wo_fen_save;
|
||||
to->wo_fdi = vim_strsave(from->wo_fdi);
|
||||
to->wo_fml = from->wo_fml;
|
||||
to->wo_fdl = from->wo_fdl;
|
||||
to->wo_fdl_save = from->wo_fdl_save;
|
||||
to->wo_fdm = vim_strsave(from->wo_fdm);
|
||||
to->wo_fdm_save = from->wo_diff_saved
|
||||
? vim_strsave(from->wo_fdm_save) : empty_option;
|
||||
to->wo_fdn = from->wo_fdn;
|
||||
# ifdef FEAT_EVAL
|
||||
to->wo_fde = vim_strsave(from->wo_fde);
|
||||
@@ -10325,6 +10332,7 @@ check_winopt(wop)
|
||||
#ifdef FEAT_FOLDING
|
||||
check_string_option(&wop->wo_fdi);
|
||||
check_string_option(&wop->wo_fdm);
|
||||
check_string_option(&wop->wo_fdm_save);
|
||||
# ifdef FEAT_EVAL
|
||||
check_string_option(&wop->wo_fde);
|
||||
check_string_option(&wop->wo_fdt);
|
||||
@@ -10355,6 +10363,7 @@ clear_winopt(wop)
|
||||
#ifdef FEAT_FOLDING
|
||||
clear_string_option(&wop->wo_fdi);
|
||||
clear_string_option(&wop->wo_fdm);
|
||||
clear_string_option(&wop->wo_fdm_save);
|
||||
# ifdef FEAT_EVAL
|
||||
clear_string_option(&wop->wo_fde);
|
||||
clear_string_option(&wop->wo_fdt);
|
||||
|
||||
+4
-3
@@ -1559,7 +1559,7 @@ x_IOerror_check(dpy)
|
||||
{
|
||||
/* This function should not return, it causes exit(). Longjump instead. */
|
||||
LONGJMP(lc_jump_env, 1);
|
||||
# ifdef VMS
|
||||
# if defined(VMS) || defined(__CYGWIN__) || defined(__CYGWIN32__)
|
||||
return 0; /* avoid the compiler complains about missing return value */
|
||||
# endif
|
||||
}
|
||||
@@ -1581,7 +1581,7 @@ x_IOerror_handler(dpy)
|
||||
|
||||
/* This function should not return, it causes exit(). Longjump instead. */
|
||||
LONGJMP(x_jump_env, 1);
|
||||
# ifdef VMS
|
||||
# if defined(VMS) || defined(__CYGWIN__) || defined(__CYGWIN32__)
|
||||
return 0; /* avoid the compiler complains about missing return value */
|
||||
# endif
|
||||
}
|
||||
@@ -3783,6 +3783,7 @@ mch_get_shellsize()
|
||||
|
||||
Rows = rows;
|
||||
Columns = columns;
|
||||
limit_screen_size();
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -5951,7 +5952,7 @@ mch_expand_wildcards(num_pat, pat, num_file, file, flags)
|
||||
# if defined(__CYGWIN__) || defined(__CYGWIN32__)
|
||||
/* Translate <CR><NL> into <NL>. Caution, buffer may contain NUL. */
|
||||
p = buffer;
|
||||
for (i = 0; i < len; ++i)
|
||||
for (i = 0; i < (int)len; ++i)
|
||||
if (!(buffer[i] == CAR && buffer[i + 1] == NL))
|
||||
*p++ = buffer[i];
|
||||
len = p - buffer;
|
||||
|
||||
+218
-32
@@ -481,20 +481,34 @@ DWORD g_PlatformId;
|
||||
# ifndef PROTO
|
||||
# include <aclapi.h>
|
||||
# endif
|
||||
# ifndef PROTECTED_DACL_SECURITY_INFORMATION
|
||||
# define PROTECTED_DACL_SECURITY_INFORMATION 0x80000000L
|
||||
# endif
|
||||
|
||||
/*
|
||||
* These are needed to dynamically load the ADVAPI DLL, which is not
|
||||
* implemented under Windows 95 (and causes VIM to crash)
|
||||
*/
|
||||
typedef DWORD (WINAPI *PSNSECINFO) (LPTSTR, enum SE_OBJECT_TYPE,
|
||||
typedef DWORD (WINAPI *PSNSECINFO) (LPSTR, SE_OBJECT_TYPE,
|
||||
SECURITY_INFORMATION, PSID, PSID, PACL, PACL);
|
||||
typedef DWORD (WINAPI *PGNSECINFO) (LPSTR, enum SE_OBJECT_TYPE,
|
||||
typedef DWORD (WINAPI *PGNSECINFO) (LPSTR, SE_OBJECT_TYPE,
|
||||
SECURITY_INFORMATION, PSID *, PSID *, PACL *, PACL *,
|
||||
PSECURITY_DESCRIPTOR *);
|
||||
# ifdef FEAT_MBYTE
|
||||
typedef DWORD (WINAPI *PSNSECINFOW) (LPWSTR, SE_OBJECT_TYPE,
|
||||
SECURITY_INFORMATION, PSID, PSID, PACL, PACL);
|
||||
typedef DWORD (WINAPI *PGNSECINFOW) (LPWSTR, SE_OBJECT_TYPE,
|
||||
SECURITY_INFORMATION, PSID *, PSID *, PACL *, PACL *,
|
||||
PSECURITY_DESCRIPTOR *);
|
||||
# endif
|
||||
|
||||
static HANDLE advapi_lib = NULL; /* Handle for ADVAPI library */
|
||||
static PSNSECINFO pSetNamedSecurityInfo;
|
||||
static PGNSECINFO pGetNamedSecurityInfo;
|
||||
# ifdef FEAT_MBYTE
|
||||
static PSNSECINFOW pSetNamedSecurityInfoW;
|
||||
static PGNSECINFOW pGetNamedSecurityInfoW;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
typedef BOOL (WINAPI *PSETHANDLEINFORMATION)(HANDLE, DWORD, DWORD);
|
||||
@@ -502,6 +516,42 @@ typedef BOOL (WINAPI *PSETHANDLEINFORMATION)(HANDLE, DWORD, DWORD);
|
||||
static BOOL allowPiping = FALSE;
|
||||
static PSETHANDLEINFORMATION pSetHandleInformation;
|
||||
|
||||
#ifdef HAVE_ACL
|
||||
/*
|
||||
* Enables or disables the specified privilege.
|
||||
*/
|
||||
static BOOL
|
||||
win32_enable_privilege(LPTSTR lpszPrivilege, BOOL bEnable)
|
||||
{
|
||||
BOOL bResult;
|
||||
LUID luid;
|
||||
HANDLE hToken;
|
||||
TOKEN_PRIVILEGES tokenPrivileges;
|
||||
|
||||
if (!OpenProcessToken(GetCurrentProcess(),
|
||||
TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken))
|
||||
return FALSE;
|
||||
|
||||
if (!LookupPrivilegeValue(NULL, lpszPrivilege, &luid))
|
||||
{
|
||||
CloseHandle(hToken);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
tokenPrivileges.PrivilegeCount = 1;
|
||||
tokenPrivileges.Privileges[0].Luid = luid;
|
||||
tokenPrivileges.Privileges[0].Attributes = bEnable ?
|
||||
SE_PRIVILEGE_ENABLED : 0;
|
||||
|
||||
bResult = AdjustTokenPrivileges(hToken, FALSE, &tokenPrivileges,
|
||||
sizeof(TOKEN_PRIVILEGES), NULL, NULL);
|
||||
|
||||
CloseHandle(hToken);
|
||||
|
||||
return bResult && GetLastError() == ERROR_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Set g_PlatformId to VER_PLATFORM_WIN32_NT (NT) or
|
||||
* VER_PLATFORM_WIN32_WINDOWS (Win95).
|
||||
@@ -541,14 +591,27 @@ PlatformId(void)
|
||||
"SetNamedSecurityInfoA");
|
||||
pGetNamedSecurityInfo = (PGNSECINFO)GetProcAddress(advapi_lib,
|
||||
"GetNamedSecurityInfoA");
|
||||
# ifdef FEAT_MBYTE
|
||||
pSetNamedSecurityInfoW = (PSNSECINFOW)GetProcAddress(advapi_lib,
|
||||
"SetNamedSecurityInfoW");
|
||||
pGetNamedSecurityInfoW = (PGNSECINFOW)GetProcAddress(advapi_lib,
|
||||
"GetNamedSecurityInfoW");
|
||||
# endif
|
||||
if (pSetNamedSecurityInfo == NULL
|
||||
|| pGetNamedSecurityInfo == NULL)
|
||||
|| pGetNamedSecurityInfo == NULL
|
||||
# ifdef FEAT_MBYTE
|
||||
|| pSetNamedSecurityInfoW == NULL
|
||||
|| pGetNamedSecurityInfoW == NULL
|
||||
# endif
|
||||
)
|
||||
{
|
||||
/* If we can't get the function addresses, set advapi_lib
|
||||
* to NULL so that we don't use them. */
|
||||
FreeLibrary(advapi_lib);
|
||||
advapi_lib = NULL;
|
||||
}
|
||||
/* Enable privilege for getting or setting SACLs. */
|
||||
win32_enable_privilege(SE_SECURITY_NAME, TRUE);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -3091,6 +3154,7 @@ mch_get_acl(char_u *fname)
|
||||
return (vim_acl_T)NULL;
|
||||
#else
|
||||
struct my_acl *p = NULL;
|
||||
DWORD err;
|
||||
|
||||
/* This only works on Windows NT and 2000. */
|
||||
if (g_PlatformId == VER_PLATFORM_WIN32_NT && advapi_lib != NULL)
|
||||
@@ -3098,23 +3162,82 @@ mch_get_acl(char_u *fname)
|
||||
p = (struct my_acl *)alloc_clear((unsigned)sizeof(struct my_acl));
|
||||
if (p != NULL)
|
||||
{
|
||||
if (pGetNamedSecurityInfo(
|
||||
(LPTSTR)fname, // Abstract filename
|
||||
SE_FILE_OBJECT, // File Object
|
||||
// Retrieve the entire security descriptor.
|
||||
OWNER_SECURITY_INFORMATION |
|
||||
GROUP_SECURITY_INFORMATION |
|
||||
DACL_SECURITY_INFORMATION |
|
||||
SACL_SECURITY_INFORMATION,
|
||||
&p->pSidOwner, // Ownership information.
|
||||
&p->pSidGroup, // Group membership.
|
||||
&p->pDacl, // Discretionary information.
|
||||
&p->pSacl, // For auditing purposes.
|
||||
&p->pSecurityDescriptor
|
||||
) != ERROR_SUCCESS)
|
||||
# ifdef FEAT_MBYTE
|
||||
WCHAR *wn = NULL;
|
||||
|
||||
if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
|
||||
wn = enc_to_utf16(fname, NULL);
|
||||
if (wn != NULL)
|
||||
{
|
||||
mch_free_acl((vim_acl_T)p);
|
||||
p = NULL;
|
||||
/* Try to retrieve the entire security descriptor. */
|
||||
err = pGetNamedSecurityInfoW(
|
||||
wn, // Abstract filename
|
||||
SE_FILE_OBJECT, // File Object
|
||||
OWNER_SECURITY_INFORMATION |
|
||||
GROUP_SECURITY_INFORMATION |
|
||||
DACL_SECURITY_INFORMATION |
|
||||
SACL_SECURITY_INFORMATION,
|
||||
&p->pSidOwner, // Ownership information.
|
||||
&p->pSidGroup, // Group membership.
|
||||
&p->pDacl, // Discretionary information.
|
||||
&p->pSacl, // For auditing purposes.
|
||||
&p->pSecurityDescriptor);
|
||||
if (err == ERROR_ACCESS_DENIED ||
|
||||
err == ERROR_PRIVILEGE_NOT_HELD)
|
||||
{
|
||||
/* Retrieve only DACL. */
|
||||
(void)pGetNamedSecurityInfoW(
|
||||
wn,
|
||||
SE_FILE_OBJECT,
|
||||
DACL_SECURITY_INFORMATION,
|
||||
NULL,
|
||||
NULL,
|
||||
&p->pDacl,
|
||||
NULL,
|
||||
&p->pSecurityDescriptor);
|
||||
}
|
||||
if (p->pSecurityDescriptor == NULL)
|
||||
{
|
||||
mch_free_acl((vim_acl_T)p);
|
||||
p = NULL;
|
||||
}
|
||||
vim_free(wn);
|
||||
}
|
||||
else
|
||||
# endif
|
||||
{
|
||||
/* Try to retrieve the entire security descriptor. */
|
||||
err = pGetNamedSecurityInfo(
|
||||
(LPSTR)fname, // Abstract filename
|
||||
SE_FILE_OBJECT, // File Object
|
||||
OWNER_SECURITY_INFORMATION |
|
||||
GROUP_SECURITY_INFORMATION |
|
||||
DACL_SECURITY_INFORMATION |
|
||||
SACL_SECURITY_INFORMATION,
|
||||
&p->pSidOwner, // Ownership information.
|
||||
&p->pSidGroup, // Group membership.
|
||||
&p->pDacl, // Discretionary information.
|
||||
&p->pSacl, // For auditing purposes.
|
||||
&p->pSecurityDescriptor);
|
||||
if (err == ERROR_ACCESS_DENIED ||
|
||||
err == ERROR_PRIVILEGE_NOT_HELD)
|
||||
{
|
||||
/* Retrieve only DACL. */
|
||||
(void)pGetNamedSecurityInfo(
|
||||
(LPSTR)fname,
|
||||
SE_FILE_OBJECT,
|
||||
DACL_SECURITY_INFORMATION,
|
||||
NULL,
|
||||
NULL,
|
||||
&p->pDacl,
|
||||
NULL,
|
||||
&p->pSecurityDescriptor);
|
||||
}
|
||||
if (p->pSecurityDescriptor == NULL)
|
||||
{
|
||||
mch_free_acl((vim_acl_T)p);
|
||||
p = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3123,6 +3246,29 @@ mch_get_acl(char_u *fname)
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef HAVE_ACL
|
||||
/*
|
||||
* Check if "acl" contains inherited ACE.
|
||||
*/
|
||||
static BOOL
|
||||
is_acl_inherited(PACL acl)
|
||||
{
|
||||
DWORD i;
|
||||
ACL_SIZE_INFORMATION acl_info;
|
||||
PACCESS_ALLOWED_ACE ace;
|
||||
|
||||
acl_info.AceCount = 0;
|
||||
GetAclInformation(acl, &acl_info, sizeof(acl_info), AclSizeInformation);
|
||||
for (i = 0; i < acl_info.AceCount; i++)
|
||||
{
|
||||
GetAce(acl, i, (LPVOID *)&ace);
|
||||
if (ace->Header.AceFlags & INHERITED_ACE)
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Set the ACL of file "fname" to "acl" (unless it's NULL).
|
||||
* Errors are ignored.
|
||||
@@ -3133,21 +3279,61 @@ mch_set_acl(char_u *fname, vim_acl_T acl)
|
||||
{
|
||||
#ifdef HAVE_ACL
|
||||
struct my_acl *p = (struct my_acl *)acl;
|
||||
SECURITY_INFORMATION sec_info = 0;
|
||||
|
||||
if (p != NULL && advapi_lib != NULL)
|
||||
(void)pSetNamedSecurityInfo(
|
||||
(LPTSTR)fname, // Abstract filename
|
||||
SE_FILE_OBJECT, // File Object
|
||||
// Retrieve the entire security descriptor.
|
||||
OWNER_SECURITY_INFORMATION |
|
||||
GROUP_SECURITY_INFORMATION |
|
||||
DACL_SECURITY_INFORMATION |
|
||||
SACL_SECURITY_INFORMATION,
|
||||
p->pSidOwner, // Ownership information.
|
||||
p->pSidGroup, // Group membership.
|
||||
p->pDacl, // Discretionary information.
|
||||
p->pSacl // For auditing purposes.
|
||||
);
|
||||
{
|
||||
# ifdef FEAT_MBYTE
|
||||
WCHAR *wn = NULL;
|
||||
# endif
|
||||
|
||||
/* Set security flags */
|
||||
if (p->pSidOwner)
|
||||
sec_info |= OWNER_SECURITY_INFORMATION;
|
||||
if (p->pSidGroup)
|
||||
sec_info |= GROUP_SECURITY_INFORMATION;
|
||||
if (p->pDacl)
|
||||
{
|
||||
sec_info |= DACL_SECURITY_INFORMATION;
|
||||
/* Do not inherit its parent's DACL.
|
||||
* If the DACL is inherited, Cygwin permissions would be changed.
|
||||
*/
|
||||
if (!is_acl_inherited(p->pDacl))
|
||||
sec_info |= PROTECTED_DACL_SECURITY_INFORMATION;
|
||||
}
|
||||
if (p->pSacl)
|
||||
sec_info |= SACL_SECURITY_INFORMATION;
|
||||
|
||||
# ifdef FEAT_MBYTE
|
||||
if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
|
||||
wn = enc_to_utf16(fname, NULL);
|
||||
if (wn != NULL)
|
||||
{
|
||||
(void)pSetNamedSecurityInfoW(
|
||||
wn, // Abstract filename
|
||||
SE_FILE_OBJECT, // File Object
|
||||
sec_info,
|
||||
p->pSidOwner, // Ownership information.
|
||||
p->pSidGroup, // Group membership.
|
||||
p->pDacl, // Discretionary information.
|
||||
p->pSacl // For auditing purposes.
|
||||
);
|
||||
vim_free(wn);
|
||||
}
|
||||
else
|
||||
# endif
|
||||
{
|
||||
(void)pSetNamedSecurityInfo(
|
||||
(LPSTR)fname, // Abstract filename
|
||||
SE_FILE_OBJECT, // File Object
|
||||
sec_info,
|
||||
p->pSidOwner, // Ownership information.
|
||||
p->pSidGroup, // Group membership.
|
||||
p->pDacl, // Discretionary information.
|
||||
p->pSacl // For auditing purposes.
|
||||
);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
+2
-5
@@ -57,14 +57,11 @@
|
||||
|
||||
#define FEAT_SHORTCUT /* resolve shortcuts */
|
||||
|
||||
#if !defined(__MINGW32__) \
|
||||
&& !defined(__CYGWIN__) \
|
||||
&& (!defined(__BORLANDC__) || __BORLANDC__ >= 0x550) \
|
||||
#if (!defined(__BORLANDC__) || __BORLANDC__ >= 0x550) \
|
||||
&& (!defined(_MSC_VER) || _MSC_VER > 1020)
|
||||
/*
|
||||
* Access Control List (actually security info).
|
||||
* Mingw and Cygwin don't have the acl stuff.
|
||||
* Borland only in version 5.5 and later.
|
||||
* Borland has the acl stuff only in version 5.5 and later.
|
||||
* MSVC in 5.0, not in 4.2, don't know about 4.3.
|
||||
*/
|
||||
# define HAVE_ACL
|
||||
|
||||
@@ -5,6 +5,7 @@ void redraw_later_clear __ARGS((void));
|
||||
void redraw_all_later __ARGS((int type));
|
||||
void redraw_curbuf_later __ARGS((int type));
|
||||
void redraw_buf_later __ARGS((buf_T *buf, int type));
|
||||
int redraw_asap __ARGS((int type));
|
||||
void redrawWinline __ARGS((linenr_T lnum, int invalid));
|
||||
void update_curbuf __ARGS((int type));
|
||||
void update_screen __ARGS((int type));
|
||||
|
||||
@@ -26,6 +26,7 @@ void term_settitle __ARGS((char_u *title));
|
||||
void ttest __ARGS((int pairs));
|
||||
void add_long_to_buf __ARGS((long_u val, char_u *dst));
|
||||
void check_shellsize __ARGS((void));
|
||||
void limit_screen_size __ARGS((void));
|
||||
void win_new_shellsize __ARGS((void));
|
||||
void shell_resized __ARGS((void));
|
||||
void shell_resized_check __ARGS((void));
|
||||
|
||||
+31
-15
@@ -1180,7 +1180,10 @@ copy_loclist(from, to)
|
||||
/* When no valid entries are present in the list, qf_ptr points to
|
||||
* the first item in the list */
|
||||
if (to_qfl->qf_nonevalid)
|
||||
{
|
||||
to_qfl->qf_ptr = to_qfl->qf_start;
|
||||
to_qfl->qf_index = 1;
|
||||
}
|
||||
}
|
||||
|
||||
to->w_llist->qf_curlist = qi->qf_curlist; /* current list */
|
||||
@@ -1613,6 +1616,8 @@ qf_jump(qi, dir, errornr, forceit)
|
||||
*/
|
||||
if (bt_quickfix(curbuf) && !opened_window)
|
||||
{
|
||||
win_T *usable_win_ptr = NULL;
|
||||
|
||||
/*
|
||||
* If there is no file specified, we don't know where to go.
|
||||
* But do advance, otherwise ":cn" gets stuck.
|
||||
@@ -1620,14 +1625,32 @@ qf_jump(qi, dir, errornr, forceit)
|
||||
if (qf_ptr->qf_fnum == 0)
|
||||
goto theend;
|
||||
|
||||
/* Locate a window showing a normal buffer */
|
||||
usable_win = 0;
|
||||
FOR_ALL_WINDOWS(win)
|
||||
if (win->w_buffer->b_p_bt[0] == NUL)
|
||||
{
|
||||
usable_win = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
ll_ref = curwin->w_llist_ref;
|
||||
if (ll_ref != NULL)
|
||||
{
|
||||
/* Find a window using the same location list that is not a
|
||||
* quickfix window. */
|
||||
FOR_ALL_WINDOWS(usable_win_ptr)
|
||||
if (usable_win_ptr->w_llist == ll_ref
|
||||
&& usable_win_ptr->w_buffer->b_p_bt[0] != 'q')
|
||||
{
|
||||
usable_win = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!usable_win)
|
||||
{
|
||||
/* Locate a window showing a normal buffer */
|
||||
FOR_ALL_WINDOWS(win)
|
||||
if (win->w_buffer->b_p_bt[0] == NUL)
|
||||
{
|
||||
usable_win = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If no usable window is found and 'switchbuf' contains "usetab"
|
||||
@@ -1656,8 +1679,6 @@ win_found:
|
||||
*/
|
||||
if (((firstwin == lastwin) && bt_quickfix(curbuf)) || !usable_win)
|
||||
{
|
||||
ll_ref = curwin->w_llist_ref;
|
||||
|
||||
flags = WSP_ABOVE;
|
||||
if (ll_ref != NULL)
|
||||
flags |= WSP_NEWLOC;
|
||||
@@ -1680,12 +1701,7 @@ win_found:
|
||||
if (curwin->w_llist_ref != NULL)
|
||||
{
|
||||
/* In a location window */
|
||||
ll_ref = curwin->w_llist_ref;
|
||||
|
||||
/* Find the window with the same location list */
|
||||
FOR_ALL_WINDOWS(win)
|
||||
if (win->w_llist == ll_ref)
|
||||
break;
|
||||
win = usable_win_ptr;
|
||||
if (win == NULL)
|
||||
{
|
||||
/* Find the window showing the selected file */
|
||||
|
||||
+71
-23
@@ -3538,7 +3538,7 @@ static int sub_equal __ARGS((regsub_T *sub1, regsub_T *sub2));
|
||||
static int match_backref __ARGS((regsub_T *sub, int subidx, int *bytelen));
|
||||
static int has_state_with_pos __ARGS((nfa_list_T *l, nfa_state_T *state, regsubs_T *subs));
|
||||
static int state_in_list __ARGS((nfa_list_T *l, nfa_state_T *state, regsubs_T *subs));
|
||||
static void addstate __ARGS((nfa_list_T *l, nfa_state_T *state, regsubs_T *subs, nfa_pim_T *pim, int off));
|
||||
static regsubs_T *addstate __ARGS((nfa_list_T *l, nfa_state_T *state, regsubs_T *subs_arg, nfa_pim_T *pim, int off));
|
||||
static void addstate_here __ARGS((nfa_list_T *l, nfa_state_T *state, regsubs_T *subs, nfa_pim_T *pim, int *ip));
|
||||
|
||||
/*
|
||||
@@ -3832,13 +3832,18 @@ state_in_list(l, state, subs)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
addstate(l, state, subs, pim, off)
|
||||
nfa_list_T *l; /* runtime state list */
|
||||
nfa_state_T *state; /* state to update */
|
||||
regsubs_T *subs; /* pointers to subexpressions */
|
||||
nfa_pim_T *pim; /* postponed look-behind match */
|
||||
int off; /* byte offset, when -1 go to next line */
|
||||
/*
|
||||
* Add "state" and possibly what follows to state list ".".
|
||||
* Returns "subs_arg", possibly copied into temp_subs.
|
||||
*/
|
||||
|
||||
static regsubs_T *
|
||||
addstate(l, state, subs_arg, pim, off)
|
||||
nfa_list_T *l; /* runtime state list */
|
||||
nfa_state_T *state; /* state to update */
|
||||
regsubs_T *subs_arg; /* pointers to subexpressions */
|
||||
nfa_pim_T *pim; /* postponed look-behind match */
|
||||
int off; /* byte offset, when -1 go to next line */
|
||||
{
|
||||
int subidx;
|
||||
nfa_thread_T *thread;
|
||||
@@ -3847,6 +3852,8 @@ addstate(l, state, subs, pim, off)
|
||||
char_u *save_ptr;
|
||||
int i;
|
||||
regsub_T *sub;
|
||||
regsubs_T *subs = subs_arg;
|
||||
static regsubs_T temp_subs;
|
||||
#ifdef ENABLE_LOG
|
||||
int did_print = FALSE;
|
||||
#endif
|
||||
@@ -3941,7 +3948,7 @@ skip_add:
|
||||
fprintf(log_fd, "> Not adding state %d to list %d. char %d: %s\n",
|
||||
abs(state->id), l->id, state->c, code);
|
||||
#endif
|
||||
return;
|
||||
return subs;
|
||||
}
|
||||
|
||||
/* Do not add the state again when it exists with the same
|
||||
@@ -3956,6 +3963,18 @@ skip_add:
|
||||
{
|
||||
int newlen = l->len * 3 / 2 + 50;
|
||||
|
||||
if (subs != &temp_subs)
|
||||
{
|
||||
/* "subs" may point into the current array, need to make a
|
||||
* copy before it becomes invalid. */
|
||||
copy_sub(&temp_subs.norm, &subs->norm);
|
||||
#ifdef FEAT_SYN_HL
|
||||
if (nfa_has_zsubexpr)
|
||||
copy_sub(&temp_subs.synt, &subs->synt);
|
||||
#endif
|
||||
subs = &temp_subs;
|
||||
}
|
||||
|
||||
l->t = vim_realloc(l->t, newlen * sizeof(nfa_thread_T));
|
||||
l->len = newlen;
|
||||
}
|
||||
@@ -3991,14 +4010,14 @@ skip_add:
|
||||
|
||||
case NFA_SPLIT:
|
||||
/* order matters here */
|
||||
addstate(l, state->out, subs, pim, off);
|
||||
addstate(l, state->out1, subs, pim, off);
|
||||
subs = addstate(l, state->out, subs, pim, off);
|
||||
subs = addstate(l, state->out1, subs, pim, off);
|
||||
break;
|
||||
|
||||
case NFA_SKIP_CHAR:
|
||||
case NFA_NOPEN:
|
||||
case NFA_NCLOSE:
|
||||
addstate(l, state->out, subs, pim, off);
|
||||
subs = addstate(l, state->out, subs, pim, off);
|
||||
break;
|
||||
|
||||
case NFA_MOPEN:
|
||||
@@ -4094,7 +4113,7 @@ skip_add:
|
||||
sub->list.line[subidx].start = reginput + off;
|
||||
}
|
||||
|
||||
addstate(l, state->out, subs, pim, off);
|
||||
subs = addstate(l, state->out, subs, pim, off);
|
||||
|
||||
if (save_in_use == -1)
|
||||
{
|
||||
@@ -4112,7 +4131,7 @@ skip_add:
|
||||
{
|
||||
/* Do not overwrite the position set by \ze. If no \ze
|
||||
* encountered end will be set in nfa_regtry(). */
|
||||
addstate(l, state->out, subs, pim, off);
|
||||
subs = addstate(l, state->out, subs, pim, off);
|
||||
break;
|
||||
}
|
||||
case NFA_MCLOSE1:
|
||||
@@ -4181,7 +4200,7 @@ skip_add:
|
||||
sub->list.line[subidx].end = reginput + off;
|
||||
}
|
||||
|
||||
addstate(l, state->out, subs, pim, off);
|
||||
subs = addstate(l, state->out, subs, pim, off);
|
||||
|
||||
if (REG_MULTI)
|
||||
sub->list.multi[subidx].end = save_lpos;
|
||||
@@ -4190,6 +4209,7 @@ skip_add:
|
||||
sub->in_use = save_in_use;
|
||||
break;
|
||||
}
|
||||
return subs;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -4228,14 +4248,39 @@ addstate_here(l, state, subs, pim, ip)
|
||||
}
|
||||
else if (count > 1)
|
||||
{
|
||||
/* make space for new states, then move them from the
|
||||
* end to the current position */
|
||||
mch_memmove(&(l->t[listidx + count]),
|
||||
&(l->t[listidx + 1]),
|
||||
sizeof(nfa_thread_T) * (l->n - listidx - 1));
|
||||
mch_memmove(&(l->t[listidx]),
|
||||
&(l->t[l->n - 1]),
|
||||
sizeof(nfa_thread_T) * count);
|
||||
if (l->n + count - 1 >= l->len)
|
||||
{
|
||||
/* not enough space to move the new states, reallocate the list
|
||||
* and move the states to the right position */
|
||||
nfa_thread_T *newl;
|
||||
|
||||
l->len = l->len * 3 / 2 + 50;
|
||||
newl = (nfa_thread_T *)alloc(l->len * sizeof(nfa_thread_T));
|
||||
if (newl == NULL)
|
||||
return;
|
||||
mch_memmove(&(newl[0]),
|
||||
&(l->t[0]),
|
||||
sizeof(nfa_thread_T) * listidx);
|
||||
mch_memmove(&(newl[listidx]),
|
||||
&(l->t[l->n - count]),
|
||||
sizeof(nfa_thread_T) * count);
|
||||
mch_memmove(&(newl[listidx + count]),
|
||||
&(l->t[listidx + 1]),
|
||||
sizeof(nfa_thread_T) * (l->n - count - listidx - 1));
|
||||
vim_free(l->t);
|
||||
l->t = newl;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* make space for new states, then move them from the
|
||||
* end to the current position */
|
||||
mch_memmove(&(l->t[listidx + count]),
|
||||
&(l->t[listidx + 1]),
|
||||
sizeof(nfa_thread_T) * (l->n - listidx - 1));
|
||||
mch_memmove(&(l->t[listidx]),
|
||||
&(l->t[l->n - 1]),
|
||||
sizeof(nfa_thread_T) * count);
|
||||
}
|
||||
}
|
||||
--l->n;
|
||||
*ip = listidx - 1;
|
||||
@@ -5198,6 +5243,8 @@ nfa_regmatch(prog, start, submatch, m)
|
||||
|| t->state->c == NFA_START_INVISIBLE_BEFORE_FIRST
|
||||
|| t->state->c == NFA_START_INVISIBLE_BEFORE_NEG_FIRST)
|
||||
{
|
||||
int in_use = m->norm.in_use;
|
||||
|
||||
/* Copy submatch info for the recursive call, so that
|
||||
* \1 can be matched. */
|
||||
copy_sub_off(&m->norm, &t->subs.norm);
|
||||
@@ -5231,6 +5278,7 @@ nfa_regmatch(prog, start, submatch, m)
|
||||
add_here = TRUE;
|
||||
add_state = t->state->out1->out;
|
||||
}
|
||||
m->norm.in_use = in_use;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+151
-3
@@ -267,6 +267,147 @@ redraw_buf_later(buf, type)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Redraw as soon as possible. When the command line is not scrolled redraw
|
||||
* right away and restore what was on the command line.
|
||||
* Return a code indicating what happened.
|
||||
*/
|
||||
int
|
||||
redraw_asap(type)
|
||||
int type;
|
||||
{
|
||||
int rows;
|
||||
int r;
|
||||
int ret = 0;
|
||||
schar_T *screenline; /* copy from ScreenLines[] */
|
||||
sattr_T *screenattr; /* copy from ScreenAttrs[] */
|
||||
#ifdef FEAT_MBYTE
|
||||
int i;
|
||||
u8char_T *screenlineUC = NULL; /* copy from ScreenLinesUC[] */
|
||||
u8char_T *screenlineC[MAX_MCO]; /* copy from ScreenLinesC[][] */
|
||||
schar_T *screenline2 = NULL; /* copy from ScreenLines2[] */
|
||||
#endif
|
||||
|
||||
redraw_later(type);
|
||||
if (msg_scrolled || (State != NORMAL && State != NORMAL_BUSY))
|
||||
return ret;
|
||||
|
||||
/* Allocate space to save the text displayed in the command line area. */
|
||||
rows = Rows - cmdline_row;
|
||||
screenline = (schar_T *)lalloc(
|
||||
(long_u)(rows * Columns * sizeof(schar_T)), FALSE);
|
||||
screenattr = (sattr_T *)lalloc(
|
||||
(long_u)(rows * Columns * sizeof(sattr_T)), FALSE);
|
||||
if (screenline == NULL || screenattr == NULL)
|
||||
ret = 2;
|
||||
#ifdef FEAT_MBYTE
|
||||
if (enc_utf8)
|
||||
{
|
||||
screenlineUC = (u8char_T *)lalloc(
|
||||
(long_u)(rows * Columns * sizeof(u8char_T)), FALSE);
|
||||
if (screenlineUC == NULL)
|
||||
ret = 2;
|
||||
for (i = 0; i < p_mco; ++i)
|
||||
{
|
||||
screenlineC[i] = (u8char_T *)lalloc(
|
||||
(long_u)(rows * Columns * sizeof(u8char_T)), FALSE);
|
||||
if (screenlineC[i] == NULL)
|
||||
ret = 2;
|
||||
}
|
||||
}
|
||||
if (enc_dbcs == DBCS_JPNU)
|
||||
{
|
||||
screenline2 = (schar_T *)lalloc(
|
||||
(long_u)(rows * Columns * sizeof(schar_T)), FALSE);
|
||||
if (screenline2 == NULL)
|
||||
ret = 2;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (ret != 2)
|
||||
{
|
||||
/* Save the text displayed in the command line area. */
|
||||
for (r = 0; r < rows; ++r)
|
||||
{
|
||||
mch_memmove(screenline + r * Columns,
|
||||
ScreenLines + LineOffset[cmdline_row + r],
|
||||
(size_t)Columns * sizeof(schar_T));
|
||||
mch_memmove(screenattr + r * Columns,
|
||||
ScreenAttrs + LineOffset[cmdline_row + r],
|
||||
(size_t)Columns * sizeof(sattr_T));
|
||||
#ifdef FEAT_MBYTE
|
||||
if (enc_utf8)
|
||||
{
|
||||
mch_memmove(screenlineUC + r * Columns,
|
||||
ScreenLinesUC + LineOffset[cmdline_row + r],
|
||||
(size_t)Columns * sizeof(u8char_T));
|
||||
for (i = 0; i < p_mco; ++i)
|
||||
mch_memmove(screenlineC[i] + r * Columns,
|
||||
ScreenLinesC[r] + LineOffset[cmdline_row + r],
|
||||
(size_t)Columns * sizeof(u8char_T));
|
||||
}
|
||||
if (enc_dbcs == DBCS_JPNU)
|
||||
mch_memmove(screenline2 + r * Columns,
|
||||
ScreenLines2 + LineOffset[cmdline_row + r],
|
||||
(size_t)Columns * sizeof(schar_T));
|
||||
#endif
|
||||
}
|
||||
|
||||
update_screen(0);
|
||||
ret = 3;
|
||||
|
||||
if (must_redraw == 0)
|
||||
{
|
||||
int off = (int)(current_ScreenLine - ScreenLines);
|
||||
|
||||
/* Restore the text displayed in the command line area. */
|
||||
for (r = 0; r < rows; ++r)
|
||||
{
|
||||
mch_memmove(current_ScreenLine,
|
||||
screenline + r * Columns,
|
||||
(size_t)Columns * sizeof(schar_T));
|
||||
mch_memmove(ScreenAttrs + off,
|
||||
screenattr + r * Columns,
|
||||
(size_t)Columns * sizeof(sattr_T));
|
||||
#ifdef FEAT_MBYTE
|
||||
if (enc_utf8)
|
||||
{
|
||||
mch_memmove(ScreenLinesUC + off,
|
||||
screenlineUC + r * Columns,
|
||||
(size_t)Columns * sizeof(u8char_T));
|
||||
for (i = 0; i < p_mco; ++i)
|
||||
mch_memmove(ScreenLinesC[i] + off,
|
||||
screenlineC[i] + r * Columns,
|
||||
(size_t)Columns * sizeof(u8char_T));
|
||||
}
|
||||
if (enc_dbcs == DBCS_JPNU)
|
||||
mch_memmove(ScreenLines2 + off,
|
||||
screenline2 + r * Columns,
|
||||
(size_t)Columns * sizeof(schar_T));
|
||||
#endif
|
||||
SCREEN_LINE(cmdline_row + r, 0, Columns, Columns, FALSE);
|
||||
}
|
||||
ret = 4;
|
||||
}
|
||||
setcursor();
|
||||
}
|
||||
|
||||
vim_free(screenline);
|
||||
vim_free(screenattr);
|
||||
#ifdef FEAT_MBYTE
|
||||
if (enc_utf8)
|
||||
{
|
||||
vim_free(screenlineUC);
|
||||
for (i = 0; i < p_mco; ++i)
|
||||
vim_free(screenlineC[i]);
|
||||
}
|
||||
if (enc_dbcs == DBCS_JPNU)
|
||||
vim_free(screenline2);
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Changed something in the current window, at buffer line "lnum", that
|
||||
* requires that line and possibly other lines to be redrawn.
|
||||
@@ -3366,9 +3507,11 @@ win_line(wp, lnum, startrow, endrow, nochange)
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_SYN_HL
|
||||
/* Cursor line highlighting for 'cursorline'. Not when Visual mode is
|
||||
* active, because it's not clear what is selected then. */
|
||||
if (wp->w_p_cul && lnum == wp->w_cursor.lnum && !VIsual_active)
|
||||
/* Cursor line highlighting for 'cursorline' in the current window. Not
|
||||
* when Visual mode is active, because it's not clear what is selected
|
||||
* then. */
|
||||
if (wp->w_p_cul && lnum == wp->w_cursor.lnum
|
||||
&& !(wp == curwin && VIsual_active))
|
||||
{
|
||||
line_attr = hl_attr(HLF_CUL);
|
||||
area_highlighting = TRUE;
|
||||
@@ -3582,6 +3725,11 @@ win_line(wp, lnum, startrow, endrow, nochange)
|
||||
* required when 'linebreak' is also set. */
|
||||
if (tocol == vcol)
|
||||
tocol += n_extra;
|
||||
#ifdef FEAT_SYN_HL
|
||||
/* combine 'showbreak' with 'cursorline' */
|
||||
if (wp->w_p_cul && lnum == wp->w_cursor.lnum)
|
||||
char_attr = hl_combine_attr(char_attr, HLF_CLN);
|
||||
#endif
|
||||
}
|
||||
# endif
|
||||
}
|
||||
|
||||
+12
-9
@@ -4498,7 +4498,7 @@ current_quote(oap, count, include, quotechar)
|
||||
#endif /* FEAT_TEXTOBJ */
|
||||
|
||||
#if defined(FEAT_VISUAL) || defined(PROTO)
|
||||
static int is_zerowidth __ARGS((char_u *pattern));
|
||||
static int is_one_char __ARGS((char_u *pattern));
|
||||
|
||||
/*
|
||||
* Find next search match under cursor, cursor at end.
|
||||
@@ -4519,7 +4519,7 @@ current_search(count, forward)
|
||||
char_u old_p_ws = p_ws;
|
||||
int flags = 0;
|
||||
pos_T save_VIsual;
|
||||
int zerowidth = FALSE;
|
||||
int one_char;
|
||||
|
||||
/* wrapping should not occur */
|
||||
p_ws = FALSE;
|
||||
@@ -4549,9 +4549,9 @@ current_search(count, forward)
|
||||
orig_pos = pos = start_pos = curwin->w_cursor;
|
||||
|
||||
/* Is the pattern is zero-width? */
|
||||
zerowidth = is_zerowidth(spats[last_idx].pat);
|
||||
if (zerowidth == -1)
|
||||
return FAIL;
|
||||
one_char = is_one_char(spats[last_idx].pat);
|
||||
if (one_char == -1)
|
||||
return FAIL; /* invalid pattern */
|
||||
|
||||
/*
|
||||
* The trick is to first search backwards and then search forward again,
|
||||
@@ -4566,7 +4566,7 @@ current_search(count, forward)
|
||||
dir = !i;
|
||||
|
||||
flags = 0;
|
||||
if (!dir && !zerowidth)
|
||||
if (!dir && !one_char)
|
||||
flags = SEARCH_END;
|
||||
|
||||
result = searchit(curwin, curbuf, &pos, (dir ? FORWARD : BACKWARD),
|
||||
@@ -4607,7 +4607,7 @@ current_search(count, forward)
|
||||
|
||||
/* move to match, except for zero-width matches, in which case, we are
|
||||
* already on the next match */
|
||||
if (!zerowidth)
|
||||
if (!one_char)
|
||||
result = searchit(curwin, curbuf, &pos, (forward ? FORWARD : BACKWARD),
|
||||
spats[last_idx].pat, 0L, flags | SEARCH_KEEP, RE_SEARCH, 0, NULL);
|
||||
|
||||
@@ -4654,11 +4654,11 @@ current_search(count, forward)
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if the pattern is zero-width.
|
||||
* Check if the pattern is one character or zero-width.
|
||||
* Returns TRUE, FALSE or -1 for failure.
|
||||
*/
|
||||
static int
|
||||
is_zerowidth(pattern)
|
||||
is_one_char(pattern)
|
||||
char_u *pattern;
|
||||
{
|
||||
regmmatch_T regmatch;
|
||||
@@ -4686,6 +4686,9 @@ is_zerowidth(pattern)
|
||||
result = (nmatched != 0
|
||||
&& regmatch.startpos[0].lnum == regmatch.endpos[0].lnum
|
||||
&& regmatch.startpos[0].col == regmatch.endpos[0].col);
|
||||
|
||||
if (!result && incl(&pos) == 0 && pos.col == regmatch.endpos[0].col)
|
||||
result = TRUE;
|
||||
}
|
||||
|
||||
called_emsg |= save_called_emsg;
|
||||
|
||||
+22
-1
@@ -141,14 +141,22 @@ typedef struct
|
||||
#ifdef FEAT_FOLDING
|
||||
long wo_fdc;
|
||||
# define w_p_fdc w_onebuf_opt.wo_fdc /* 'foldcolumn' */
|
||||
int wo_fdc_save;
|
||||
# define w_p_fdc_save w_onebuf_opt.wo_fdc_save /* 'foldenable' saved for diff mode */
|
||||
int wo_fen;
|
||||
# define w_p_fen w_onebuf_opt.wo_fen /* 'foldenable' */
|
||||
int wo_fen_save;
|
||||
# define w_p_fen_save w_onebuf_opt.wo_fen_save /* 'foldenable' saved for diff mode */
|
||||
char_u *wo_fdi;
|
||||
# define w_p_fdi w_onebuf_opt.wo_fdi /* 'foldignore' */
|
||||
long wo_fdl;
|
||||
# define w_p_fdl w_onebuf_opt.wo_fdl /* 'foldlevel' */
|
||||
int wo_fdl_save;
|
||||
# define w_p_fdl_save w_onebuf_opt.wo_fdl_save /* 'foldlevel' state saved for diff mode */
|
||||
char_u *wo_fdm;
|
||||
# define w_p_fdm w_onebuf_opt.wo_fdm /* 'foldmethod' */
|
||||
char_u *wo_fdm_save;
|
||||
# define w_p_fdm_save w_onebuf_opt.wo_fdm_save /* 'fdm' saved for diff mode */
|
||||
long wo_fml;
|
||||
# define w_p_fml w_onebuf_opt.wo_fml /* 'foldminlines' */
|
||||
long wo_fdn;
|
||||
@@ -213,9 +221,17 @@ typedef struct
|
||||
#ifdef FEAT_SCROLLBIND
|
||||
int wo_scb;
|
||||
# define w_p_scb w_onebuf_opt.wo_scb /* 'scrollbind' */
|
||||
int wo_diff_saved; /* options were saved for starting diff mode */
|
||||
# define w_p_diff_saved w_onebuf_opt.wo_diff_saved
|
||||
int wo_scb_save; /* 'scrollbind' saved for diff mode*/
|
||||
# define w_p_scb_save w_onebuf_opt.wo_scb_save
|
||||
#endif
|
||||
int wo_wrap;
|
||||
#define w_p_wrap w_onebuf_opt.wo_wrap /* 'wrap' */
|
||||
#ifdef FEAT_DIFF
|
||||
int wo_wrap_save; /* 'wrap' state saved for diff mode*/
|
||||
# define w_p_wrap_save w_onebuf_opt.wo_wrap_save
|
||||
#endif
|
||||
#ifdef FEAT_CONCEAL
|
||||
char_u *wo_cocu; /* 'concealcursor' */
|
||||
# define w_p_cocu w_onebuf_opt.wo_cocu
|
||||
@@ -225,6 +241,8 @@ typedef struct
|
||||
#ifdef FEAT_CURSORBIND
|
||||
int wo_crb;
|
||||
# define w_p_crb w_onebuf_opt.wo_crb /* 'cursorbind' */
|
||||
int wo_crb_save; /* 'cursorbind' state saved for diff mode*/
|
||||
# define w_p_crb_save w_onebuf_opt.wo_crb_save
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_EVAL
|
||||
@@ -493,6 +511,8 @@ typedef struct expand
|
||||
int xp_numfiles; /* number of files found by
|
||||
file name completion */
|
||||
char_u **xp_files; /* list of files */
|
||||
char_u *xp_line; /* text being completed */
|
||||
int xp_col; /* cursor position in line */
|
||||
} expand_T;
|
||||
|
||||
/* values for xp_backslash */
|
||||
@@ -1002,12 +1022,13 @@ struct mapblock
|
||||
{
|
||||
mapblock_T *m_next; /* next mapblock in list */
|
||||
char_u *m_keys; /* mapped from, lhs */
|
||||
int m_keylen; /* strlen(m_keys) */
|
||||
char_u *m_str; /* mapped to, rhs */
|
||||
char_u *m_orig_str; /* rhs as entered by the user */
|
||||
int m_keylen; /* strlen(m_keys) */
|
||||
int m_mode; /* valid mode */
|
||||
int m_noremap; /* if non-zero no re-mapping for m_str */
|
||||
char m_silent; /* <silent> used, don't echo commands */
|
||||
char m_nowait; /* <nowait> used */
|
||||
#ifdef FEAT_EVAL
|
||||
char m_expr; /* <expr> used, m_str is an expression */
|
||||
scid_T m_script_ID; /* ID of script where map was defined */
|
||||
|
||||
+123
-14
@@ -106,6 +106,14 @@ static char_u *tgetent_error __ARGS((char_u *, char_u *));
|
||||
char *tgetstr __ARGS((char *, char **));
|
||||
|
||||
# ifdef FEAT_TERMRESPONSE
|
||||
/* Change this to "if 1" to debug what happens with termresponse. */
|
||||
# if 0
|
||||
# define DEBUG_TERMRESPONSE
|
||||
static void log_tr(char *msg);
|
||||
# define LOG_TR(msg) log_tr(msg)
|
||||
# else
|
||||
# define LOG_TR(msg)
|
||||
# endif
|
||||
/* Request Terminal Version status: */
|
||||
# define CRV_GET 1 /* send T_CRV when switched to RAW mode */
|
||||
# define CRV_SENT 2 /* did send T_CRV, waiting for answer */
|
||||
@@ -1936,6 +1944,7 @@ set_termname(term)
|
||||
full_screen = TRUE; /* we can use termcap codes from now on */
|
||||
set_term_defaults(); /* use current values as defaults */
|
||||
#ifdef FEAT_TERMRESPONSE
|
||||
LOG_TR("setting crv_status to CRV_GET");
|
||||
crv_status = CRV_GET; /* Get terminal version later */
|
||||
#endif
|
||||
|
||||
@@ -2947,8 +2956,10 @@ get_bytes_from_buf(buf, bytes, num_bytes)
|
||||
return -1;
|
||||
if (buf[len++] == (int)KS_ZERO)
|
||||
c = NUL;
|
||||
++len; /* skip KE_FILLER */
|
||||
/* else it should be KS_SPECIAL, and c already equals K_SPECIAL */
|
||||
/* else it should be KS_SPECIAL; when followed by KE_FILLER c is
|
||||
* K_SPECIAL, or followed by KE_CSI and c must be CSI. */
|
||||
if (buf[len++] == (int)KE_CSI)
|
||||
c = CSI;
|
||||
}
|
||||
else if (c == CSI && buf[len] == KS_EXTRA
|
||||
&& buf[len + 1] == (int)KE_CSI)
|
||||
@@ -2962,15 +2973,29 @@ get_bytes_from_buf(buf, bytes, num_bytes)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Check if the new shell size is valid, correct it if it's too small.
|
||||
* Check if the new shell size is valid, correct it if it's too small or way
|
||||
* too big.
|
||||
*/
|
||||
void
|
||||
check_shellsize()
|
||||
{
|
||||
if (Columns < MIN_COLUMNS)
|
||||
Columns = MIN_COLUMNS;
|
||||
if (Rows < min_rows()) /* need room for one window and command line */
|
||||
Rows = min_rows();
|
||||
limit_screen_size();
|
||||
}
|
||||
|
||||
/*
|
||||
* Limit Rows and Columns to avoid an overflow in Rows * Columns.
|
||||
*/
|
||||
void
|
||||
limit_screen_size()
|
||||
{
|
||||
if (Columns < MIN_COLUMNS)
|
||||
Columns = MIN_COLUMNS;
|
||||
else if (Columns > 10000)
|
||||
Columns = 10000;
|
||||
if (Rows > 1000)
|
||||
Rows = 1000;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -3310,6 +3335,7 @@ may_req_termresponse()
|
||||
# endif
|
||||
&& *T_CRV != NUL)
|
||||
{
|
||||
LOG_TR("Sending CRV");
|
||||
out_str(T_CRV);
|
||||
crv_status = CRV_SENT;
|
||||
/* check for the characters now, otherwise they might be eaten by
|
||||
@@ -3322,10 +3348,10 @@ may_req_termresponse()
|
||||
# if defined(FEAT_MBYTE) || defined(PROTO)
|
||||
/*
|
||||
* Check how the terminal treats ambiguous character width (UAX #11).
|
||||
* First, we move the cursor to (0, 0) and print a test ambiguous character
|
||||
* First, we move the cursor to (1, 0) and print a test ambiguous character
|
||||
* \u25bd (WHITE DOWN-POINTING TRIANGLE) and query current cursor position.
|
||||
* If the terminal treats \u25bd as single width, the position is (0, 1),
|
||||
* or if it is treated as double width, that will be (0, 2).
|
||||
* If the terminal treats \u25bd as single width, the position is (1, 1),
|
||||
* or if it is treated as double width, that will be (1, 2).
|
||||
* This function has the side effect that changes cursor position, so
|
||||
* it must be called immediately after entering termcap mode.
|
||||
*/
|
||||
@@ -3345,7 +3371,10 @@ may_req_ambiguous_character_width()
|
||||
{
|
||||
char_u buf[16];
|
||||
|
||||
term_windgoto(0, 0);
|
||||
LOG_TR("Sending U7 request");
|
||||
/* Do this in the second row. In the first row the returned sequence
|
||||
* may be CSI 1;2R, which is the same as <S-F3>. */
|
||||
term_windgoto(1, 0);
|
||||
buf[mb_char2bytes(0x25bd, buf)] = 0;
|
||||
out_str(buf);
|
||||
out_str(T_U7);
|
||||
@@ -3360,6 +3389,29 @@ may_req_ambiguous_character_width()
|
||||
}
|
||||
}
|
||||
# endif
|
||||
|
||||
# ifdef DEBUG_TERMRESPONSE
|
||||
static void
|
||||
log_tr(char *msg)
|
||||
{
|
||||
static FILE *fd_tr = NULL;
|
||||
static proftime_T start;
|
||||
proftime_T now;
|
||||
|
||||
if (fd_tr == NULL)
|
||||
{
|
||||
fd_tr = fopen("termresponse.log", "w");
|
||||
profile_start(&start);
|
||||
}
|
||||
now = start;
|
||||
profile_end(&now);
|
||||
fprintf(fd_tr, "%s: %s %s\n",
|
||||
profile_msg(&now),
|
||||
must_redraw == NOT_VALID ? "NV"
|
||||
: must_redraw == CLEAR ? "CL" : " ",
|
||||
msg);
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -3831,6 +3883,7 @@ switch_to_8bit()
|
||||
need_gather = TRUE; /* need to fill termleader[] */
|
||||
}
|
||||
detected_8bit = TRUE;
|
||||
LOG_TR("Switching to 8 bit");
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -4140,14 +4193,20 @@ check_termcode(max_offset, buf, bufsize, buflen)
|
||||
if (tp[i] == ';' && ++j == 1)
|
||||
extra = i + 1;
|
||||
if (i == len)
|
||||
return -1; /* not enough characters */
|
||||
{
|
||||
LOG_TR("Not enough characters for CRV");
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
/* eat it when it has 2 arguments and ends in 'R' */
|
||||
if (j == 1 && tp[i] == 'R')
|
||||
/* Eat it when it has 2 arguments and ends in 'R'. Ignore it
|
||||
* when u7_status is not "sent", <S-F3> sends something
|
||||
* similar. */
|
||||
if (j == 1 && tp[i] == 'R' && u7_status == U7_SENT)
|
||||
{
|
||||
char *aw = NULL;
|
||||
|
||||
LOG_TR("Received U7 status");
|
||||
u7_status = U7_GOT;
|
||||
# ifdef FEAT_AUTOCMD
|
||||
did_cursorhold = TRUE;
|
||||
@@ -4158,8 +4217,24 @@ check_termcode(max_offset, buf, bufsize, buflen)
|
||||
aw = "single";
|
||||
else if (extra == 3)
|
||||
aw = "double";
|
||||
if (aw != NULL)
|
||||
if (aw != NULL && STRCMP(aw, p_ambw) != 0)
|
||||
{
|
||||
/* Setting the option causes a screen redraw. Do that
|
||||
* right away if possible, keeping any messages. */
|
||||
set_option_value((char_u *)"ambw", 0L, (char_u *)aw, 0);
|
||||
#ifdef DEBUG_TERMRESPONSE
|
||||
{
|
||||
char buf[100];
|
||||
int r = redraw_asap(CLEAR);
|
||||
|
||||
sprintf(buf, "set 'ambiwidth', redraw_asap(): %d",
|
||||
r);
|
||||
log_tr(buf);
|
||||
}
|
||||
#else
|
||||
redraw_asap(CLEAR);
|
||||
#endif
|
||||
}
|
||||
key_name[0] = (int)KS_EXTRA;
|
||||
key_name[1] = (int)KE_IGNORE;
|
||||
slen = i + 1;
|
||||
@@ -4169,6 +4244,7 @@ check_termcode(max_offset, buf, bufsize, buflen)
|
||||
/* eat it when at least one digit and ending in 'c' */
|
||||
if (*T_CRV != NUL && i > 2 + (tp[0] != CSI) && tp[i] == 'c')
|
||||
{
|
||||
LOG_TR("Received CRV");
|
||||
crv_status = CRV_GOT;
|
||||
# ifdef FEAT_AUTOCMD
|
||||
did_cursorhold = TRUE;
|
||||
@@ -4208,6 +4284,7 @@ check_termcode(max_offset, buf, bufsize, buflen)
|
||||
/* if xterm version >= 141 try to get termcap codes */
|
||||
if (extra >= 141)
|
||||
{
|
||||
LOG_TR("Enable checking for XT codes");
|
||||
check_for_codes = TRUE;
|
||||
need_gather = TRUE;
|
||||
req_codes_from_term();
|
||||
@@ -4246,7 +4323,10 @@ check_termcode(max_offset, buf, bufsize, buflen)
|
||||
}
|
||||
|
||||
if (i == len)
|
||||
{
|
||||
LOG_TR("not enough characters for XT");
|
||||
return -1; /* not enough characters */
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -5191,6 +5271,10 @@ check_termcode(max_offset, buf, bufsize, buflen)
|
||||
return retval == 0 ? (len + extra + offset) : retval;
|
||||
}
|
||||
|
||||
#ifdef FEAT_TERMRESPONSE
|
||||
LOG_TR("normal character");
|
||||
#endif
|
||||
|
||||
return 0; /* no match found */
|
||||
}
|
||||
|
||||
@@ -5645,6 +5729,13 @@ req_more_codes_from_term()
|
||||
* many, there can be a buffer overflow somewhere. */
|
||||
while (xt_index_out < xt_index_in + 10 && key_names[xt_index_out] != NULL)
|
||||
{
|
||||
# ifdef DEBUG_TERMRESPONSE
|
||||
char dbuf[100];
|
||||
|
||||
sprintf(dbuf, "Requesting XT %d: %s",
|
||||
xt_index_out, key_names[xt_index_out]);
|
||||
log_tr(dbuf);
|
||||
# endif
|
||||
sprintf(buf, "\033P+q%02x%02x\033\\",
|
||||
key_names[xt_index_out][0], key_names[xt_index_out][1]);
|
||||
out_str_nf((char_u *)buf);
|
||||
@@ -5691,6 +5782,14 @@ got_code_from_term(code, len)
|
||||
break;
|
||||
}
|
||||
}
|
||||
# ifdef DEBUG_TERMRESPONSE
|
||||
{
|
||||
char buf[100];
|
||||
|
||||
sprintf(buf, "Received XT %d: %s", xt_index_in, (char *)name);
|
||||
log_tr(buf);
|
||||
}
|
||||
# endif
|
||||
if (key_names[i] != NULL)
|
||||
{
|
||||
for (i = 8; (c = hexhex2nr(code + i)) >= 0; i += 2)
|
||||
@@ -5709,7 +5808,17 @@ got_code_from_term(code, len)
|
||||
set_keep_msg_from_hist();
|
||||
set_color_count(i);
|
||||
init_highlight(TRUE, FALSE);
|
||||
redraw_later(CLEAR);
|
||||
#ifdef DEBUG_TERMRESPONSE
|
||||
{
|
||||
char buf[100];
|
||||
int r = redraw_asap(CLEAR);
|
||||
|
||||
sprintf(buf, "Received t_Co, redraw_asap(): %d", r);
|
||||
log_tr(buf);
|
||||
}
|
||||
#else
|
||||
redraw_asap(CLEAR);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -33,7 +33,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
|
||||
test76.out test77.out test78.out test79.out test80.out \
|
||||
test81.out test82.out test83.out test84.out test88.out \
|
||||
test89.out test90.out test91.out test92.out test93.out \
|
||||
test94.out test95.out
|
||||
test94.out test95.out test96.out test97.out
|
||||
|
||||
.SUFFIXES: .in .out
|
||||
|
||||
@@ -145,3 +145,5 @@ test92.out: test92.in
|
||||
test93.out: test93.in
|
||||
test94.out: test94.in
|
||||
test95.out: test95.in
|
||||
test96.out: test96.in
|
||||
test97.out: test97.in
|
||||
|
||||
@@ -32,7 +32,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
|
||||
test79.out test80.out test81.out test82.out test83.out \
|
||||
test84.out test85.out test86.out test87.out test88.out \
|
||||
test89.out test90.out test91.out test92.out test93.out \
|
||||
test94.out test95.out
|
||||
test94.out test95.out test96.out test97.out
|
||||
|
||||
SCRIPTS32 = test50.out test70.out
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
|
||||
test79.out test80.out test81.out test82.out test83.out \
|
||||
test84.out test85.out test86.out test87.out test88.out \
|
||||
test89.out test90.out test91.out test92.out test93.out \
|
||||
test94.out test95.out
|
||||
test94.out test95.out test96.out test97.out
|
||||
|
||||
SCRIPTS32 = test50.out test70.out
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
|
||||
test76.out test77.out test78.out test79.out test80.out \
|
||||
test81.out test82.out test83.out test84.out test88.out \
|
||||
test89.out test90.out test91.out test92.out test93.out \
|
||||
test94.out test95.out
|
||||
test94.out test95.out test96.out test97.out
|
||||
|
||||
.SUFFIXES: .in .out
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# Authors: Zoltan Arpadffy, <arpadffy@polarhome.com>
|
||||
# Sandor Kopanyi, <sandor.kopanyi@mailbox.hu>
|
||||
#
|
||||
# Last change: 2013 May 18
|
||||
# Last change: 2013 Jul 03
|
||||
#
|
||||
# This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
|
||||
# Edit the lines in the Configuration section below to select.
|
||||
@@ -78,7 +78,7 @@ SCRIPT = test1.out test2.out test3.out test4.out test5.out \
|
||||
test77.out test78.out test79.out test80.out test81.out \
|
||||
test82.out test83.out test84.out test88.out test89.out \
|
||||
test90.out test91.out test92.out test93.out test94.out \
|
||||
test95.out
|
||||
test95.out test96.out test97.out
|
||||
|
||||
# Known problems:
|
||||
# Test 30: a problem around mac format - unknown reason
|
||||
|
||||
@@ -29,7 +29,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
|
||||
test79.out test80.out test81.out test82.out test83.out \
|
||||
test84.out test85.out test86.out test87.out test88.out \
|
||||
test89.out test90.out test91.out test92.out test93.out \
|
||||
test94.out test95.out
|
||||
test94.out test95.out test96.out test97.out
|
||||
|
||||
SCRIPTS_GUI = test16.out
|
||||
|
||||
|
||||
@@ -44,7 +44,8 @@ gnd/[u]niquepattern/s
|
||||
vlgnd
|
||||
/mother
|
||||
:set selection=exclusive
|
||||
$cgNmongoose
|
||||
$cgNmongoose/i
|
||||
cgnj
|
||||
:/^start:/,/^end:/wq! test.out
|
||||
ENDTEST
|
||||
|
||||
@@ -73,4 +74,5 @@ zero width pattern
|
||||
delete first and last chars
|
||||
uniquepattern uniquepattern
|
||||
my very excellent mother just served us nachos
|
||||
for (i=0; i<=10; i++)
|
||||
end:
|
||||
|
||||
@@ -26,4 +26,5 @@ zerowidth pattern
|
||||
elete first and last char
|
||||
uniquepattern
|
||||
my very excellent mongoose just served us nachos
|
||||
for (j=0; i<=10; i++)
|
||||
end:
|
||||
|
||||
@@ -384,6 +384,7 @@ STARTTEST
|
||||
:call add(tl, [2, '^.*\.\(.*\)/.\+\(\1\)\@<!$', 'foo.bat/foo.com', 'foo.bat/foo.com', 'bat'])
|
||||
:call add(tl, [2, '^.*\.\(.*\)/.\+\(\1\)\@<!$', 'foo.bat/foo.bat'])
|
||||
:call add(tl, [2, '^.*\.\(.*\)/.\+\(\1\)\@<=$', 'foo.bat/foo.bat', 'foo.bat/foo.bat', 'bat', 'bat'])
|
||||
:call add(tl, [2, '\\\@<!\${\(\d\+\%(:.\{-}\)\?\\\@<!\)}', '2013-06-27${0}', '${0}', '0'])
|
||||
:"
|
||||
:"""" Look-behind with limit
|
||||
:call add(tl, [2, '<\@<=span.', 'xxspanxx<spanyyy', 'spany'])
|
||||
@@ -462,7 +463,7 @@ STARTTEST
|
||||
:endfor
|
||||
:unlet t tl e l
|
||||
:"
|
||||
:"""""" multi-line tests
|
||||
:"""""" multi-line tests """"""""""""""""""""
|
||||
:let tl = []
|
||||
:"
|
||||
:"""" back references
|
||||
@@ -572,6 +573,7 @@ yeGopA END:"
|
||||
"ayb20gg/..\%$
|
||||
"bybGo"apo"bp:"
|
||||
:"
|
||||
:""""" Write the results """""""""""""
|
||||
:/\%#=1^Results/,$wq! test.out
|
||||
ENDTEST
|
||||
|
||||
|
||||
@@ -878,6 +878,9 @@ OK 2 - ^.*\.\(.*\)/.\+\(\1\)\@<!$
|
||||
OK 0 - ^.*\.\(.*\)/.\+\(\1\)\@<=$
|
||||
OK 1 - ^.*\.\(.*\)/.\+\(\1\)\@<=$
|
||||
OK 2 - ^.*\.\(.*\)/.\+\(\1\)\@<=$
|
||||
OK 0 - \\\@<!\${\(\d\+\%(:.\{-}\)\?\\\@<!\)}
|
||||
OK 1 - \\\@<!\${\(\d\+\%(:.\{-}\)\?\\\@<!\)}
|
||||
OK 2 - \\\@<!\${\(\d\+\%(:.\{-}\)\?\\\@<!\)}
|
||||
OK 0 - <\@<=span.
|
||||
OK 1 - <\@<=span.
|
||||
OK 2 - <\@<=span.
|
||||
|
||||
+5
-13
@@ -1,7 +1,12 @@
|
||||
Test for encryption.
|
||||
The test data is in another file to avoid problems with 'encoding', especially
|
||||
cp932.
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:set enc=latin1
|
||||
:bwipe!
|
||||
:r test71a.in
|
||||
:/^start of text/+1
|
||||
:let text_lines = getline('.', line('.') + 2)
|
||||
:/^start of cm=zip bytes/+1
|
||||
@@ -60,16 +65,3 @@ barbar
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
start of text
|
||||
01234567890123456789012345678901234567
|
||||
line 2 foo bar blah
|
||||
line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
end of text
|
||||
|
||||
start of cm=zip bytes
|
||||
VimCrypt~01!lV'Þ}Mg ê£V©çE#3Ž2Ué—
|
||||
end of cm=zip bytes
|
||||
|
||||
start of cm=blowfish bytes
|
||||
VimCrypt~02!k)¾—#ÝSœõ=ºàÈ#¥M´†JÃAÍ¥M´†!€›õáÒ‚˜÷
Ú
|
||||
end of cm=blowfish bytes
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
|
||||
start of text
|
||||
01234567890123456789012345678901234567
|
||||
line 2 foo bar blah
|
||||
line 3 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
end of text
|
||||
|
||||
start of cm=zip bytes
|
||||
VimCrypt~01!lV'Þ}Mg ê£V©çE#3Ž2Ué—
|
||||
end of cm=zip bytes
|
||||
|
||||
start of cm=blowfish bytes
|
||||
VimCrypt~02!k)¾—#ÝSœõ=ºàÈ#¥M´†JÃAÍ¥M´†!€›õáÒ‚˜÷
Ú
|
||||
end of cm=blowfish bytes
|
||||
@@ -9,6 +9,8 @@ STARTTEST
|
||||
:call append('$', maparg('foo<C-V>'))
|
||||
:call append('$', string(maparg('foo<C-V>', '', 0, 1)))
|
||||
:call append('$', string(maparg('bar', '', 0, 1)))
|
||||
:map <buffer> <nowait> foo bar
|
||||
:call append('$', string(maparg('foo', '', 0, 1)))
|
||||
:"
|
||||
:map abc x<char-114>x
|
||||
:call append('$', maparg('abc'))
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
is<F4>foo
|
||||
{'silent': 0, 'noremap': 0, 'lhs': 'foo<C-V>', 'mode': ' ', 'expr': 0, 'sid': 0, 'rhs': 'is<F4>foo', 'buffer': 0}
|
||||
{'silent': 1, 'noremap': 1, 'lhs': 'bar', 'mode': 'v', 'expr': 1, 'sid': 0, 'rhs': 'isbar', 'buffer': 1}
|
||||
{'silent': 0, 'noremap': 0, 'lhs': 'foo<C-V>', 'mode': ' ', 'nowait': 0, 'expr': 0, 'sid': 0, 'rhs': 'is<F4>foo', 'buffer': 0}
|
||||
{'silent': 1, 'noremap': 1, 'lhs': 'bar', 'mode': 'v', 'nowait': 0, 'expr': 1, 'sid': 0, 'rhs': 'isbar', 'buffer': 1}
|
||||
{'silent': 0, 'noremap': 0, 'lhs': 'foo', 'mode': ' ', 'nowait': 1, 'expr': 0, 'sid': 0, 'rhs': 'bar', 'buffer': 1}
|
||||
xrx
|
||||
yRy
|
||||
|
||||
+15
-3
@@ -1,6 +1,7 @@
|
||||
Some tests for setting 'number' and 'relativenumber'
|
||||
This is not all that useful now that the options are no longer reset when
|
||||
setting the other.
|
||||
- Some tests for setting 'number' and 'relativenumber'
|
||||
This is not all that useful now that the options are no longer reset when
|
||||
setting the other.
|
||||
- Some tests for findfile() function
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
@@ -49,6 +50,17 @@ STARTTEST
|
||||
:$put g
|
||||
:$put h
|
||||
:"
|
||||
:let cwd=getcwd()
|
||||
:cd ../..
|
||||
:$put =''
|
||||
:$put ='Testing findfile'
|
||||
:$put =''
|
||||
:$put =findfile('test19.in','src/test*')
|
||||
:exe "cd" cwd
|
||||
:cd ..
|
||||
:$put =findfile('test19.in','test*')
|
||||
:$put =findfile('test19.in','testdir')
|
||||
:exe "cd" cwd
|
||||
:/^results/,$w! test.out
|
||||
:q!
|
||||
ENDTEST
|
||||
|
||||
@@ -20,3 +20,9 @@ results:
|
||||
number
|
||||
|
||||
relativenumber
|
||||
|
||||
Testing findfile
|
||||
|
||||
src/testdir/test19.in
|
||||
testdir/test19.in
|
||||
testdir/test19.in
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
This will test for problems in quickfix:
|
||||
A. incorrectly copying location lists which caused the location list to show a
|
||||
different name than the file that was actually being displayed.
|
||||
B. not reusing the window for which the location list window is opened but
|
||||
instead creating new windows.
|
||||
C. make sure that the location list window is not reused instead of the window
|
||||
it belongs to.
|
||||
|
||||
Note: to debug a problem comment out the last ":b 1" in a test and testing will
|
||||
stop at this point.
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
: enew
|
||||
: w! test.out
|
||||
: b 1
|
||||
: " Set up the test environment:
|
||||
: function! ReadTestProtocol(name)
|
||||
: let base = substitute(a:name, '\v^test://(.*)%(\.[^.]+)?', '\1', '')
|
||||
: let word = substitute(base, '\v(.*)\..*', '\1', '')
|
||||
:
|
||||
: setl modifiable
|
||||
: setl noreadonly
|
||||
: setl noswapfile
|
||||
: setl bufhidden=delete
|
||||
: %del _
|
||||
: " For problem 2:
|
||||
: " 'buftype' has to be set to reproduce the constant opening of new windows
|
||||
: setl buftype=nofile
|
||||
:
|
||||
: call setline(1, word)
|
||||
:
|
||||
: setl nomodified
|
||||
: setl nomodifiable
|
||||
: setl readonly
|
||||
: exe 'doautocmd BufRead ' . substitute(a:name, '\v^test://(.*)', '\1', '')
|
||||
: endfunction
|
||||
: augroup testgroup
|
||||
: au!
|
||||
: autocmd BufReadCmd test://* call ReadTestProtocol(expand("<amatch>"))
|
||||
: augroup END
|
||||
: let words = [ "foo", "bar", "baz", "quux", "shmoo", "spam", "eggs" ]
|
||||
:
|
||||
: let qflist = []
|
||||
: for word in words
|
||||
: call add(qflist, {'filename': 'test://' . word . '.txt', 'text': 'file ' . word . '.txt', })
|
||||
: " NOTE: problem 1:
|
||||
: " intentionally not setting 'lnum' so that the quickfix entries are not
|
||||
: " valid
|
||||
: call setloclist(0, qflist, ' ')
|
||||
: endfor
|
||||
ENDTEST
|
||||
|
||||
Test A:
|
||||
STARTTEST
|
||||
:lrewind
|
||||
:enew
|
||||
:lopen
|
||||
:lnext
|
||||
:lnext
|
||||
:lnext
|
||||
:lnext
|
||||
:vert split
|
||||
:wincmd L
|
||||
:lopen
|
||||
:wincmd p
|
||||
:lnext
|
||||
:"b 1
|
||||
:let fileName = expand("%")
|
||||
:wincmd p
|
||||
:let locationListFileName = substitute(getline(line('.')), '\([^|]*\)|.*', '\1', '')
|
||||
:wincmd n
|
||||
:wincmd K
|
||||
:b test.out
|
||||
:call append(line('$'), "Test A:")
|
||||
:call append(line('$'), " - file name displayed: " . fileName)
|
||||
:call append(line('$'), " - quickfix claims that the file name displayed is: " . locationListFileName)
|
||||
:w
|
||||
:wincmd o
|
||||
:b 1
|
||||
ENDTEST
|
||||
|
||||
Test B:
|
||||
STARTTEST
|
||||
:lrewind
|
||||
:lopen
|
||||
:2
|
||||
:exe "normal \<CR>"
|
||||
:wincmd p
|
||||
:3
|
||||
:exe "normal \<CR>"
|
||||
:wincmd p
|
||||
:4
|
||||
:exe "normal \<CR>"
|
||||
:let numberOfWindowsOpen = winnr('$')
|
||||
:wincmd n
|
||||
:wincmd K
|
||||
:b test.out
|
||||
:call append(line('$'), "Test B:")
|
||||
:call append(line('$'), " - number of window open: " . numberOfWindowsOpen)
|
||||
:w
|
||||
:wincmd o
|
||||
:b 1
|
||||
ENDTEST
|
||||
|
||||
Test C:
|
||||
STARTTEST
|
||||
:lrewind
|
||||
:lopen
|
||||
:" Let's move the location list window to the top to check whether it (the first
|
||||
:" window found) will be reused when we try to open new windows:
|
||||
:wincmd K
|
||||
:2
|
||||
:exe "normal \<CR>"
|
||||
:wincmd p
|
||||
:3
|
||||
:exe "normal \<CR>"
|
||||
:wincmd p
|
||||
:4
|
||||
:exe "normal \<CR>"
|
||||
:1wincmd w
|
||||
:let locationListWindowBufType = &buftype
|
||||
:2wincmd w
|
||||
:let bufferName = expand("%")
|
||||
:wincmd n
|
||||
:wincmd K
|
||||
:b test.out
|
||||
:call append(line('$'), "Test C:")
|
||||
:call append(line('$'), " - 'buftype' of the location list window: " . locationListWindowBufType)
|
||||
:call append(line('$'), " - buffer displayed in the 2nd window: " . bufferName)
|
||||
:w
|
||||
:wincmd o
|
||||
:b 1
|
||||
ENDTEST
|
||||
|
||||
STARTTEST
|
||||
:qa
|
||||
ENDTEST
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
|
||||
Test A:
|
||||
- file name displayed: test://bar.txt
|
||||
- quickfix claims that the file name displayed is: test://bar.txt
|
||||
Test B:
|
||||
- number of window open: 2
|
||||
Test C:
|
||||
- 'buftype' of the location list window: quickfix
|
||||
- buffer displayed in the 2nd window: test://quux.txt
|
||||
@@ -0,0 +1,17 @@
|
||||
Test whether glob()/globpath() return correct results with certain escaped
|
||||
characters.
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:set shell=doesnotexist
|
||||
:e test.out
|
||||
:put =glob('Xxx\{')
|
||||
:put =glob('Xxx\$')
|
||||
:w! Xxx{
|
||||
:w! Xxx\$
|
||||
:put =glob('Xxx\{')
|
||||
:put =glob('Xxx\$')
|
||||
:w
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
|
||||
|
||||
|
||||
Xxx{
|
||||
Xxx$
|
||||
@@ -342,13 +342,7 @@ ui_set_shellsize(mustset)
|
||||
{
|
||||
#ifdef FEAT_GUI
|
||||
if (gui.in_use)
|
||||
gui_set_shellsize(mustset,
|
||||
# ifdef WIN3264
|
||||
TRUE
|
||||
# else
|
||||
FALSE
|
||||
# endif
|
||||
, RESIZE_BOTH);
|
||||
gui_set_shellsize(mustset, TRUE, RESIZE_BOTH);
|
||||
else
|
||||
#endif
|
||||
mch_set_shellsize();
|
||||
@@ -2386,14 +2380,20 @@ clip_x11_convert_selection_cb(w, sel_atom, target, type, value, length, format)
|
||||
{
|
||||
XTextProperty text_prop;
|
||||
char *string_nt = (char *)alloc((unsigned)*length + 1);
|
||||
int conv_result;
|
||||
|
||||
/* create NUL terminated string which XmbTextListToTextProperty wants */
|
||||
mch_memmove(string_nt, string, (size_t)*length);
|
||||
string_nt[*length] = NUL;
|
||||
XmbTextListToTextProperty(X_DISPLAY, (char **)&string_nt, 1,
|
||||
XCompoundTextStyle, &text_prop);
|
||||
conv_result = XmbTextListToTextProperty(X_DISPLAY, (char **)&string_nt,
|
||||
1, XCompoundTextStyle, &text_prop);
|
||||
vim_free(string_nt);
|
||||
XtFree(*value); /* replace with COMPOUND text */
|
||||
if (conv_result != Success)
|
||||
{
|
||||
vim_free(string);
|
||||
return False;
|
||||
}
|
||||
*value = (XtPointer)(text_prop.value); /* from plain text */
|
||||
*length = text_prop.nitems;
|
||||
*type = compound_text_atom;
|
||||
|
||||
@@ -743,6 +743,100 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1298,
|
||||
/**/
|
||||
1297,
|
||||
/**/
|
||||
1296,
|
||||
/**/
|
||||
1295,
|
||||
/**/
|
||||
1294,
|
||||
/**/
|
||||
1293,
|
||||
/**/
|
||||
1292,
|
||||
/**/
|
||||
1291,
|
||||
/**/
|
||||
1290,
|
||||
/**/
|
||||
1289,
|
||||
/**/
|
||||
1288,
|
||||
/**/
|
||||
1287,
|
||||
/**/
|
||||
1286,
|
||||
/**/
|
||||
1285,
|
||||
/**/
|
||||
1284,
|
||||
/**/
|
||||
1283,
|
||||
/**/
|
||||
1282,
|
||||
/**/
|
||||
1281,
|
||||
/**/
|
||||
1280,
|
||||
/**/
|
||||
1279,
|
||||
/**/
|
||||
1278,
|
||||
/**/
|
||||
1277,
|
||||
/**/
|
||||
1276,
|
||||
/**/
|
||||
1275,
|
||||
/**/
|
||||
1274,
|
||||
/**/
|
||||
1273,
|
||||
/**/
|
||||
1272,
|
||||
/**/
|
||||
1271,
|
||||
/**/
|
||||
1270,
|
||||
/**/
|
||||
1269,
|
||||
/**/
|
||||
1268,
|
||||
/**/
|
||||
1267,
|
||||
/**/
|
||||
1266,
|
||||
/**/
|
||||
1265,
|
||||
/**/
|
||||
1264,
|
||||
/**/
|
||||
1263,
|
||||
/**/
|
||||
1262,
|
||||
/**/
|
||||
1261,
|
||||
/**/
|
||||
1260,
|
||||
/**/
|
||||
1259,
|
||||
/**/
|
||||
1258,
|
||||
/**/
|
||||
1257,
|
||||
/**/
|
||||
1256,
|
||||
/**/
|
||||
1255,
|
||||
/**/
|
||||
1254,
|
||||
/**/
|
||||
1253,
|
||||
/**/
|
||||
1252,
|
||||
/**/
|
||||
1251,
|
||||
/**/
|
||||
|
||||
+7
-5
@@ -180,7 +180,7 @@ WideCharToMultiByte_alloc(UINT cp, DWORD flags,
|
||||
{
|
||||
*outlen = WideCharToMultiByte(cp, flags, in, inlen, NULL, 0, def, useddef);
|
||||
/* Add one one byte to avoid a zero-length alloc(). */
|
||||
*out = alloc((unsigned)*outlen + 1);
|
||||
*out = (LPSTR)alloc((unsigned)*outlen + 1);
|
||||
if (*out != NULL)
|
||||
{
|
||||
WideCharToMultiByte(cp, flags, in, inlen, *out, *outlen, def, useddef);
|
||||
@@ -557,7 +557,7 @@ clip_mch_set_selection(VimClipboard *cbd)
|
||||
return; /* out of memory */
|
||||
}
|
||||
WideCharToMultiByte(GetACP(), 0, out, len,
|
||||
str, metadata.txtlen, 0, 0);
|
||||
(LPSTR)str, metadata.txtlen, 0, 0);
|
||||
|
||||
/* Allocate memory for the UTF-16 text, add one NUL word to
|
||||
* terminate the string. */
|
||||
@@ -584,7 +584,7 @@ clip_mch_set_selection(VimClipboard *cbd)
|
||||
|
||||
if (lpszMem)
|
||||
{
|
||||
vim_strncpy(lpszMem, str, metadata.txtlen);
|
||||
vim_strncpy((char_u *)lpszMem, str, metadata.txtlen);
|
||||
GlobalUnlock(hMem);
|
||||
}
|
||||
}
|
||||
@@ -677,7 +677,8 @@ enc_to_utf16(char_u *str, int *lenp)
|
||||
{
|
||||
/* We can do any CP### -> UTF-16 in one pass, and we can do it
|
||||
* without iconv() (convert_* may need iconv). */
|
||||
MultiByteToWideChar_alloc(enc_codepage, 0, str, *lenp, &ret, &length);
|
||||
MultiByteToWideChar_alloc(enc_codepage, 0, (LPCSTR)str, *lenp,
|
||||
&ret, &length);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -787,7 +788,8 @@ acp_to_enc(str, str_size, out, outlen)
|
||||
{
|
||||
LPWSTR widestr;
|
||||
|
||||
MultiByteToWideChar_alloc(GetACP(), 0, str, str_size, &widestr, outlen);
|
||||
MultiByteToWideChar_alloc(GetACP(), 0, (LPCSTR)str, str_size,
|
||||
&widestr, outlen);
|
||||
if (widestr != NULL)
|
||||
{
|
||||
++*outlen; /* Include the 0 after the string */
|
||||
|
||||
+6
-3
@@ -53,10 +53,10 @@ static void win_free __ARGS((win_T *wp, tabpage_T *tp));
|
||||
static void frame_append __ARGS((frame_T *after, frame_T *frp));
|
||||
static void frame_insert __ARGS((frame_T *before, frame_T *frp));
|
||||
static void frame_remove __ARGS((frame_T *frp));
|
||||
#ifdef FEAT_VERTSPLIT
|
||||
# ifdef FEAT_VERTSPLIT
|
||||
static void win_goto_ver __ARGS((int up, long count));
|
||||
static void win_goto_hor __ARGS((int left, long count));
|
||||
#endif
|
||||
# endif
|
||||
static void frame_add_height __ARGS((frame_T *frp, int n));
|
||||
static void last_status_rec __ARGS((frame_T *fr, int statusline));
|
||||
|
||||
@@ -4082,7 +4082,8 @@ win_find_tabpage(win)
|
||||
tabpage_T *tp;
|
||||
|
||||
for (tp = first_tabpage; tp != NULL; tp = tp->tp_next)
|
||||
for (wp = tp->tp_firstwin; wp != NULL; wp = wp->w_next)
|
||||
for (wp = (tp == curtab ? firstwin : tp->tp_firstwin);
|
||||
wp != NULL; wp = wp->w_next)
|
||||
if (wp == win)
|
||||
return tp;
|
||||
return NULL;
|
||||
@@ -6938,6 +6939,7 @@ get_tab_number(tabpage_T *tp UNUSED)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_WINDOWS
|
||||
/*
|
||||
* Return TRUE if "topfrp" and its children are at the right height.
|
||||
*/
|
||||
@@ -6958,6 +6960,7 @@ frame_check_height(topfrp, height)
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_VERTSPLIT
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user