mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-02 11:19:22 +02:00
Compare commits
53 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b7e748dc19 | |||
| 4a938ac428 | |||
| 4df3f684d5 | |||
| b1b964a625 | |||
| 3c09722600 | |||
| b73fa629d6 | |||
| 2fdcfad169 | |||
| ae6f865125 | |||
| 1bd999f982 | |||
| 8ada6aa929 | |||
| 4ce46c2a6b | |||
| 14a4deb064 | |||
| aaf6e43b7a | |||
| 1223744849 | |||
| 2efb323e87 | |||
| 338e47fdfd | |||
| 132f75255e | |||
| a0ca7d002d | |||
| 4af031dbc8 | |||
| b254af312d | |||
| c9e649ae81 | |||
| 606d45ccd8 | |||
| 4fb921e388 | |||
| 9bca805ec4 | |||
| cb89c98c26 | |||
| f0b03c4e98 | |||
| 8ee2d36e21 | |||
| ee219b0e9f | |||
| 9e1d399e63 | |||
| a5e03556fd | |||
| 890dd05492 | |||
| a1d5c154db | |||
| 200d0e36bc | |||
| 7e1652c63c | |||
| 6621605eb9 | |||
| 8b42328cef | |||
| 492ea888e8 | |||
| b29d328eb4 | |||
| 4697399e8c | |||
| 7f88b65f6c | |||
| a6d4849c71 | |||
| fae8ed1fc8 | |||
| a703aaee4d | |||
| 8e6a31df81 | |||
| 59eb016dff | |||
| 74240d3feb | |||
| 35c5e8155d | |||
| f405c8fe85 | |||
| 620ca2da37 | |||
| 05684310a5 | |||
| e4b78e2a42 | |||
| 3388d33457 | |||
| 6e65d594aa |
@@ -666,6 +666,7 @@ RT_SCRIPTS = \
|
||||
runtime/autoload/xml/*.vim \
|
||||
runtime/colors/*.vim \
|
||||
runtime/colors/README.txt \
|
||||
runtime/colors/tools/*.vim \
|
||||
runtime/compiler/*.vim \
|
||||
runtime/compiler/README.txt \
|
||||
runtime/indent/*.vim \
|
||||
|
||||
Vendored
+6
-2
@@ -1,7 +1,7 @@
|
||||
" Vim functions for file type detection
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2017 Nov 11
|
||||
" Last Change: 2017 Dec 05
|
||||
|
||||
" These functions are moved here from runtime/filetype.vim to make startup
|
||||
" faster.
|
||||
@@ -618,7 +618,11 @@ func dist#ft#FTperl()
|
||||
setf perl
|
||||
return 1
|
||||
endif
|
||||
if search('^use\s\s*\k', 'nc', 30)
|
||||
let save_cursor = getpos('.')
|
||||
call cursor(1,1)
|
||||
let has_use = search('^use\s\s*\k', 'c', 30)
|
||||
call setpos('.', save_cursor)
|
||||
if has_use
|
||||
setf perl
|
||||
return 1
|
||||
endif
|
||||
|
||||
+541
-825
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
" netrwSettings.vim: makes netrw settings simpler
|
||||
" Date: Nov 09, 2016
|
||||
" Date: Dec 30, 2014
|
||||
" Maintainer: Charles E Campbell <drchipNOSPAM at campbellfamily dot biz>
|
||||
" Version: 16
|
||||
" Version: 15
|
||||
" Copyright: Copyright (C) 1999-2007 Charles E. Campbell {{{1
|
||||
" Permission is hereby granted to use and distribute this code,
|
||||
" with or without modifications, provided that this copyright
|
||||
@@ -19,7 +19,7 @@
|
||||
if exists("g:loaded_netrwSettings") || &cp
|
||||
finish
|
||||
endif
|
||||
let g:loaded_netrwSettings = "v16"
|
||||
let g:loaded_netrwSettings = "v15"
|
||||
if v:version < 700
|
||||
echohl WarningMsg
|
||||
echo "***warning*** this version of netrwSettings needs vim 7.0"
|
||||
@@ -154,13 +154,9 @@ fun! netrwSettings#NetrwSettings()
|
||||
put = 'let g:netrw_list_hide = '.g:netrw_list_hide
|
||||
put = 'let g:netrw_liststyle = '.g:netrw_liststyle
|
||||
put = 'let g:netrw_localcopycmd = '.g:netrw_localcopycmd
|
||||
put = 'let g:netrw_localcopycmdopt = '.g:netrw_localcopycmdopt
|
||||
put = 'let g:netrw_localmkdir = '.g:netrw_localmkdir
|
||||
put = 'let g:netrw_localmkdiropt = '.g:netrw_localmkdiropt
|
||||
put = 'let g:netrw_localmovecmd = '.g:netrw_localmovecmd
|
||||
put = 'let g:netrw_localmovecmdopt = '.g:netrw_localmovecmdopt
|
||||
put = 'let g:netrw_localrmdir = '.g:netrw_localrmdir
|
||||
put = 'let g:netrw_localrmdiropt = '.g:netrw_localrmdiropt
|
||||
put = 'let g:netrw_maxfilenamelen = '.g:netrw_maxfilenamelen
|
||||
put = 'let g:netrw_menu = '.g:netrw_menu
|
||||
put = 'let g:netrw_mousemaps = '.g:netrw_mousemaps
|
||||
|
||||
@@ -64,6 +64,7 @@ Search for "highlight_init".
|
||||
If you think you have a color scheme that is good enough to be used by others,
|
||||
please check the following items:
|
||||
|
||||
- Source the tools/check_colors.vim script to check for common mistakes.
|
||||
- Does it work in a color terminal as well as in the GUI?
|
||||
- Is "g:colors_name" set to a meaningful value? In case of doubt you can do
|
||||
it this way:
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
" This script tests a color scheme for some errors. Load the scheme and source
|
||||
" this script. e.g. :e colors/desert.vim | :so test_colors.vim
|
||||
" Will output possible errors.
|
||||
|
||||
let s:save_cpo= &cpo
|
||||
set cpo&vim
|
||||
|
||||
func! Test_check_colors()
|
||||
call cursor(1,1)
|
||||
let err={}
|
||||
|
||||
" 1) Check g:colors_name is existing
|
||||
if !search('\<\%(g:\)\?colors_name\>', 'cnW')
|
||||
let err['colors_name'] = 'g:colors_name not set'
|
||||
else
|
||||
let err['colors_name'] = 'OK'
|
||||
endif
|
||||
|
||||
" 2) Check for some well-defined highlighting groups
|
||||
" Some items, check several groups, e.g. Diff, Spell
|
||||
let hi_groups = ['ColorColumn', 'Diff', 'ErrorMsg', 'Folded',
|
||||
\ 'FoldColumn', 'IncSearch', 'LineNr', 'ModeMsg', 'MoreMsg', 'NonText',
|
||||
\ 'Normal', 'Pmenu', 'Todo', 'Search', 'Spell', 'StatusLine', 'TabLine',
|
||||
\ 'Title', 'Visual', 'WarningMsg', 'WildMenu']
|
||||
let groups={}
|
||||
for group in hi_groups
|
||||
if search('\c@suppress\s\+'.group, 'cnW')
|
||||
" skip check, if the script contains a line like
|
||||
" @suppress Visual:
|
||||
let groups[group] = 'Ignoring '.group
|
||||
continue
|
||||
endif
|
||||
if !search('hi\%[ghlight] \+'.group, 'cnW')
|
||||
let groups[group] = 'No highlight definition for '.group
|
||||
continue
|
||||
endif
|
||||
if !search('hi\%[ghlight] \+'.group. '.*fg=', 'cnW')
|
||||
let groups[group] = 'Missing foreground color for '.group
|
||||
continue
|
||||
endif
|
||||
if search('hi\%[ghlight] \+'.group. '.*guibg=', 'cnW') &&
|
||||
\ !search('hi\%[ghlight] \+'.group. '.*ctermbg=', 'cnW')
|
||||
let groups[group] = 'Missing bg terminal color for '.group
|
||||
continue
|
||||
endif
|
||||
call search('hi\%[ghlight] \+'.group, 'cW')
|
||||
" only check in the current line
|
||||
if !search('guifg', 'cnW', line('.')) || !search('ctermfg', 'cnW', line('.'))
|
||||
" do not check for background colors, they could be intentionally left out
|
||||
let groups[group] = 'Missing fg definition for '.group
|
||||
endif
|
||||
call cursor(1,1)
|
||||
endfor
|
||||
let err['highlight'] = groups
|
||||
|
||||
" 3) Check, that it does not set background highlighting
|
||||
" Doesn't ':hi Normal ctermfg=253 ctermfg=233' also set the background sometimes?
|
||||
let bg_set='\(set\?\|setl\(ocal\)\?\) .*\(background\|bg\)=\(dark\|light\)'
|
||||
let bg_let='let \%([&]\%([lg]:\)\?\)\%(background\|bg\)\s*=\s*\([''"]\?\)\w\+\1'
|
||||
let bg_pat='\%('.bg_set. '\|'.bg_let.'\)'
|
||||
let line=search(bg_pat, 'cnW')
|
||||
if search(bg_pat, 'cnW')
|
||||
exe line
|
||||
if search('hi \U\w\+\s\+\S', 'cbnW')
|
||||
let err['background'] = 'Should not set background option after :hi statement'
|
||||
endif
|
||||
else
|
||||
let err['background'] = 'OK'
|
||||
endif
|
||||
call cursor(1,1)
|
||||
|
||||
" 4) Check, that t_Co is checked
|
||||
let pat = '[&]t_Co\s*[<>=]=\?\s*\d\+'
|
||||
if !search(pat, 'ncW')
|
||||
let err['t_Co'] = 'Does not check terminal for capable colors'
|
||||
endif
|
||||
|
||||
" 5) Initializes correctly, e.g. should have a section like
|
||||
" hi clear
|
||||
" if exists("syntax_on")
|
||||
" syntax reset
|
||||
" endif
|
||||
let pat='hi\%[ghlight]\s*clear\n\s*if\s*exists(\([''"]\)syntax_on\1)\n\s*syn\%[tax]\s*reset\n\s*endif'
|
||||
if !search(pat, 'cnW')
|
||||
let err['init'] = 'No initialization'
|
||||
endif
|
||||
|
||||
" 6) Does not use :syn on
|
||||
if search('syn\%[tax]\s\+on', 'cnW')
|
||||
let err['background'] = 'Should not issue :syn on'
|
||||
endif
|
||||
|
||||
" 7) Does not define filetype specfic groups like vimCommand, htmlTag,
|
||||
let hi_groups = ['vim', 'html', 'python', 'sh', 'ruby']
|
||||
for group in hi_groups
|
||||
let pat='\Chi\%[ghlight]\s*\zs'.group.'\w\+\>'
|
||||
if search(pat, 'cnW')
|
||||
let line = search(pat, 'cW')
|
||||
let err['filetype'] = get(err, 'filetype', 'Should not define: ') . matchstr(getline('.'), pat). ' '
|
||||
endif
|
||||
call cursor(1,1)
|
||||
endfor
|
||||
let g:err = err
|
||||
|
||||
" print Result
|
||||
call Result(err)
|
||||
endfu
|
||||
|
||||
fu! Result(err)
|
||||
let do_roups = 0
|
||||
echohl Title|echomsg "---------------"|echohl Normal
|
||||
for key in sort(keys(a:err))
|
||||
if key is# 'highlight'
|
||||
let do_groups = 1
|
||||
continue
|
||||
else
|
||||
if a:err[key] !~ 'OK'
|
||||
echohl Title
|
||||
endif
|
||||
echomsg printf("%15s: %s", key, a:err[key])
|
||||
echohl Normal
|
||||
endif
|
||||
endfor
|
||||
echohl Title|echomsg "---------------"|echohl Normal
|
||||
if do_groups
|
||||
echohl Title | echomsg "Groups" | echohl Normal
|
||||
for v1 in sort(keys(a:err['highlight']))
|
||||
echomsg printf("%25s: %s", v1, a:err['highlight'][v1])
|
||||
endfor
|
||||
endif
|
||||
endfu
|
||||
|
||||
call Test_check_colors()
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
+21
-1
@@ -1,4 +1,4 @@
|
||||
*autocmd.txt* For Vim version 8.0. Last change: 2017 Nov 05
|
||||
*autocmd.txt* For Vim version 8.0. Last change: 2017 Dec 17
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -330,6 +330,7 @@ Name triggered by ~
|
||||
|
||||
|TextChanged| after a change was made to the text in Normal mode
|
||||
|TextChangedI| after a change was made to the text in Insert mode
|
||||
|TextYankPost| after text is yanked or deleted
|
||||
|
||||
|ColorScheme| after loading a color scheme
|
||||
|
||||
@@ -956,6 +957,25 @@ TextChangedI After a change was made to the text in the
|
||||
current buffer in Insert mode.
|
||||
Not triggered when the popup menu is visible.
|
||||
Otherwise the same as TextChanged.
|
||||
*TextYankPost*
|
||||
TextYankPost After text has been yanked or deleted in the
|
||||
current buffer. The following values of
|
||||
|v:event| can be used to determine the operation
|
||||
that triggered this autocmd:
|
||||
operator The operation performed.
|
||||
regcontents Text that was stored in the
|
||||
register, as a list of lines,
|
||||
like with: >
|
||||
getreg(r, 1, 1)
|
||||
< regname Name of the |register| or
|
||||
empty string for the unnamed
|
||||
register.
|
||||
regtype Type of the register, see
|
||||
|getregtype()|.
|
||||
Not triggered when |quote_| is used nor when
|
||||
called recursively.
|
||||
It is not allowed to change the buffer text,
|
||||
see |textlock|.
|
||||
*User*
|
||||
User Never executed automatically. To be used for
|
||||
autocommands that are only executed with
|
||||
|
||||
+66
-19
@@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 8.0. Last change: 2017 Nov 24
|
||||
*eval.txt* For Vim version 8.0. Last change: 2017 Dec 19
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1554,6 +1554,12 @@ v:errors Errors found by assert functions, such as |assert_true()|.
|
||||
< If v:errors is set to anything but a list it is made an empty
|
||||
list by the assert function.
|
||||
|
||||
*v:event* *event-variable*
|
||||
v:event Dictionary containing information about the current
|
||||
|autocommand|. The dictionary is emptied when the |autocommand|
|
||||
finishes, please refer to |dict-identity| for how to get an
|
||||
independent copy of it.
|
||||
|
||||
*v:exception* *exception-variable*
|
||||
v:exception The value of the exception most recently caught and not
|
||||
finished. See also |v:throwpoint| and |throw-variables|.
|
||||
@@ -2031,7 +2037,7 @@ assert_true({actual} [, {msg}]) none assert {actual} is true
|
||||
asin({expr}) Float arc sine of {expr}
|
||||
atan({expr}) Float arc tangent of {expr}
|
||||
atan2({expr1}, {expr2}) Float arc tangent of {expr1} / {expr2}
|
||||
balloon_show({msg}) none show {msg} inside the balloon
|
||||
balloon_show({expr}) none show {expr} inside the balloon
|
||||
balloon_split({msg}) List split {msg} as used for a balloon
|
||||
browse({save}, {title}, {initdir}, {default})
|
||||
String put up a file requester
|
||||
@@ -2270,6 +2276,8 @@ mode([expr]) String current editing mode
|
||||
mzeval({expr}) any evaluate |MzScheme| expression
|
||||
nextnonblank({lnum}) Number line nr of non-blank line >= {lnum}
|
||||
nr2char({expr} [, {utf8}]) String single char with ASCII/UTF8 value {expr}
|
||||
option_restore({list}) none restore options saved by option_save()
|
||||
option_save({list}) List save options values
|
||||
or({expr}, {expr}) Number bitwise OR
|
||||
pathshorten({expr}) String shorten directory names in a path
|
||||
perleval({expr}) any evaluate |Perl| expression
|
||||
@@ -3056,12 +3064,16 @@ ch_open({address} [, {options}]) *ch_open()*
|
||||
ch_read({handle} [, {options}]) *ch_read()*
|
||||
Read from {handle} and return the received message.
|
||||
{handle} can be a Channel or a Job that has a Channel.
|
||||
For a NL channel this waits for a NL to arrive, except when
|
||||
there is nothing more to read (channel was closed).
|
||||
See |channel-more|.
|
||||
{only available when compiled with the |+channel| feature}
|
||||
|
||||
ch_readraw({handle} [, {options}]) *ch_readraw()*
|
||||
Like ch_read() but for a JS and JSON channel does not decode
|
||||
the message. See |channel-more|.
|
||||
the message. For a NL channel it does not block waiting for
|
||||
the NL to arrive, but otherwise works like ch_read().
|
||||
See |channel-more|.
|
||||
{only available when compiled with the |+channel| feature}
|
||||
|
||||
ch_sendexpr({handle}, {expr} [, {options}]) *ch_sendexpr()*
|
||||
@@ -3326,8 +3338,8 @@ count({comp}, {expr} [, {ic} [, {start}]]) *count()*
|
||||
When {ic} is given and it's |TRUE| then case is ignored.
|
||||
|
||||
When {comp} is a string then the number of not overlapping
|
||||
occurrences of {expr} is returned.
|
||||
|
||||
occurrences of {expr} is returned. Zero is returned when
|
||||
{expr} is an empty string.
|
||||
|
||||
*cscope_connection()*
|
||||
cscope_connection([{num} , {dbpath} [, {prepend}]])
|
||||
@@ -4169,6 +4181,7 @@ getbufinfo([{dict}])
|
||||
be specified in {dict}:
|
||||
buflisted include only listed buffers.
|
||||
bufloaded include only loaded buffers.
|
||||
bufmodified include only modified buffers.
|
||||
|
||||
Otherwise, {expr} specifies a particular buffer to return
|
||||
information for. For the use of {expr}, see |bufname()|
|
||||
@@ -4661,6 +4674,8 @@ getqflist([{what}]) *getqflist()*
|
||||
If the optional {what} dictionary argument is supplied, then
|
||||
returns only the items listed in {what} as a dictionary. The
|
||||
following string items are supported in {what}:
|
||||
changedtick get the total number of changes made
|
||||
to the list
|
||||
context get the context stored with |setqflist()|
|
||||
efm errorformat to use when parsing "lines". If
|
||||
not present, then the 'errorformat' option
|
||||
@@ -4679,9 +4694,10 @@ getqflist([{what}]) *getqflist()*
|
||||
the last quickfix list
|
||||
size number of entries in the quickfix list
|
||||
title get the list title
|
||||
winid get the |window-ID| (if opened)
|
||||
winid get the quickfix |window-ID|
|
||||
all all of the above quickfix properties
|
||||
Non-string items in {what} are ignored.
|
||||
Non-string items in {what} are ignored. To get the value of a
|
||||
particular item, set it to zero.
|
||||
If "nr" is not present then the current quickfix list is used.
|
||||
If both "nr" and a non-zero "id" are specified, then the list
|
||||
specified by "id" is used.
|
||||
@@ -4691,18 +4707,24 @@ getqflist([{what}]) *getqflist()*
|
||||
When "lines" is specified, all the other items except "efm"
|
||||
are ignored. The returned dictionary contains the entry
|
||||
"items" with the list of entries.
|
||||
In case of error processing {what}, an empty dictionary is
|
||||
returned.
|
||||
|
||||
The returned dictionary contains the following entries:
|
||||
context context information stored with |setqflist()|
|
||||
id quickfix list ID |quickfix-ID|
|
||||
idx index of the current entry in the list
|
||||
items quickfix list entries
|
||||
nr quickfix list number
|
||||
size number of entries in the quickfix list
|
||||
title quickfix list title text
|
||||
winid quickfix |window-ID| (if opened)
|
||||
changedtick total number of changes made to the
|
||||
list |quickfix-changedtick|
|
||||
context context information stored with |setqflist()|.
|
||||
If not present, set to "".
|
||||
id quickfix list ID |quickfix-ID|. If not
|
||||
present, set to 0.
|
||||
idx index of the current entry in the list. If not
|
||||
present, set to 0.
|
||||
items quickfix list entries. If not present, set to
|
||||
an empty list.
|
||||
nr quickfix list number. If not present, set to 0
|
||||
size number of entries in the quickfix list. If not
|
||||
present, set to 0.
|
||||
title quickfix list title text. If not present, set
|
||||
to "".
|
||||
winid quickfix |window-ID|. If not present, set to 0
|
||||
|
||||
Examples: >
|
||||
:echo getqflist({'all': 1})
|
||||
@@ -6098,6 +6120,31 @@ nr2char({expr} [, {utf8}]) *nr2char()*
|
||||
characters. nr2char(0) is a real NUL and terminates the
|
||||
string, thus results in an empty string.
|
||||
|
||||
option_restore({list}) *option_restore()*
|
||||
Restore options previously saved by option_save().
|
||||
When buffer-local options have been saved, this function must
|
||||
be called when the same buffer is the current buffer.
|
||||
When window-local options have been saved, this function must
|
||||
be called when the same window is the current window.
|
||||
When in the wrong buffer and/or window an error is given and
|
||||
the local options won't be restored.
|
||||
NOT IMPLEMENTED YET!
|
||||
|
||||
option_save({list}) *option_save()*
|
||||
Saves the options named in {list}. The returned value can be
|
||||
passed to option_restore(). Example: >
|
||||
let s:saved_options = option_save([
|
||||
\ 'ignorecase',
|
||||
\ 'iskeyword',
|
||||
\ ])
|
||||
au <buffer> BufLeave *
|
||||
\ call option_restore(s:saved_options)
|
||||
< The advantage over using `:let` is that global and local
|
||||
values are handled and the script ID is restored, so that
|
||||
`:verbose set` will show where the option was originally set,
|
||||
not where it was restored.
|
||||
NOT IMPLEMENTED YET!
|
||||
|
||||
or({expr}, {expr}) *or()*
|
||||
Bitwise OR on the two arguments. The arguments are converted
|
||||
to a number. A List, Dict or Float argument causes an error.
|
||||
@@ -8793,8 +8840,8 @@ writefile({list}, {fname} [, {flags}])
|
||||
the file. This flushes the file to disk, if possible. This
|
||||
takes more time but avoids losing the file if the system
|
||||
crashes.
|
||||
When {flags} does not contain "S" or "s" then fsync is called
|
||||
if the 'fsync' option is set.
|
||||
When {flags} does not contain "S" or "s" then fsync() is
|
||||
called if the 'fsync' option is set.
|
||||
When {flags} contains "S" then fsync() is not called, even
|
||||
when 'fsync' is set.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*filetype.txt* For Vim version 8.0. Last change: 2017 Oct 10
|
||||
*filetype.txt* For Vim version 8.0. Last change: 2017 Dec 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -706,4 +706,23 @@ You can change the default by defining the variable g:tex_flavor to the format
|
||||
Currently no other formats are recognized.
|
||||
|
||||
|
||||
VIM *ft-vim-plugin*
|
||||
|
||||
The Vim filetype plugin defines mappings to move to the start and end of
|
||||
functions with [[ and ]]. Move around comments with ]" and [".
|
||||
|
||||
The mappings can be disabled with: >
|
||||
let g:no_vim_maps = 1
|
||||
|
||||
|
||||
ZIMBU *ft-zimbu-plugin*
|
||||
|
||||
The Zimbu filetype plugin defines mappings to move to the start and end of
|
||||
functions with [[ and ]].
|
||||
|
||||
The mappings can be disabled with: >
|
||||
let g:no_zimbu_maps = 1
|
||||
<
|
||||
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
||||
@@ -736,8 +736,8 @@ or 'pythonthreedll' option can be also used to specify the Python DLL.
|
||||
|
||||
The name of the DLL should match the Python version Vim was compiled with.
|
||||
Currently the name for Python 2 is "python27.dll", that is for Python 2.7.
|
||||
That is the default value for 'pythondll'. For Python 3 it is python35.dll
|
||||
(Python 3.5). To know for sure edit "gvim.exe" and search for
|
||||
That is the default value for 'pythondll'. For Python 3 it is python36.dll
|
||||
(Python 3.6). To know for sure edit "gvim.exe" and search for
|
||||
"python\d*.dll\c".
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 8.0. Last change: 2017 Nov 26
|
||||
*options.txt* For Vim version 8.0. Last change: 2017 Dec 01
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*quickfix.txt* For Vim version 8.0. Last change: 2017 Sep 13
|
||||
*quickfix.txt* For Vim version 8.0. Last change: 2017 Dec 13
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -64,6 +64,14 @@ When a window with a location list is split, the new window gets a copy of the
|
||||
location list. When there are no longer any references to a location list,
|
||||
the location list is destroyed.
|
||||
|
||||
*quickfix-changedtick*
|
||||
Every quickfix and location list has a read-only changedtick variable that
|
||||
tracks the total number of changes made to the list. Every time the quickfix
|
||||
list is modified, this count is incremented. This can be used to perform an
|
||||
action only when the list has changed. The getqflist() and getloclist()
|
||||
functions can be used to query the current value of changedtick. You cannot
|
||||
change the changedtick variable.
|
||||
|
||||
The following quickfix commands can be used. The location list commands are
|
||||
similar to the quickfix commands, replacing the 'c' prefix in the quickfix
|
||||
command with 'l'.
|
||||
@@ -341,6 +349,50 @@ use this code: >
|
||||
au QuickfixCmdPost make call QfMakeConv()
|
||||
Another option is using 'makeencoding'.
|
||||
|
||||
*quickfix-title*
|
||||
Every quickfix and location list has a title. By default the title is set to
|
||||
the command that created the list. The |getqflist()| and |getloclist()|
|
||||
functions can be used to get the title of a quickfix and a location list
|
||||
respectively. The |setqflist()| and |setloclist()| functions can be used to
|
||||
modify the title of a quickfix and location list respectively. Examples: >
|
||||
call setqflist([], 'a', {'title' : 'Cmd output'})
|
||||
echo getqflist({'title' : 1})
|
||||
call setloclist(3, [], 'a', {'title' : 'Cmd output'})
|
||||
echo getloclist(3, {'title' : 1})
|
||||
<
|
||||
*quickfix-size*
|
||||
You can get the number of entries (size) in a quickfix and a location list
|
||||
using the |getqflist()| and |getloclist()| functions respectively. Examples: >
|
||||
echo getqflist({'size' : 1})
|
||||
echo getloclist(5, {'size' : 1})
|
||||
<
|
||||
*quickfix-context*
|
||||
Any Vim type can be associated as a context with a quickfix or location list.
|
||||
The |setqflist()| and the |setloclist()| functions can be used to associate a
|
||||
context with a quickfix and a location list respectively. The |getqflist()|
|
||||
and the |getloclist()| functions can be used to retrieve the context of a
|
||||
quickfix and a location list respectively. This is useful for a Vim plugin
|
||||
dealing with multiple quickfix/location lists.
|
||||
Examples: >
|
||||
|
||||
let somectx = {'name' : 'Vim', 'type' : 'Editor'}
|
||||
call setqflist([], 'a', {'context' : somectx})
|
||||
echo getqflist({'context' : 1})
|
||||
|
||||
let newctx = ['red', 'green', 'blue']
|
||||
call setloclist(2, [], 'a', {'id' : qfid, 'context' : newctx})
|
||||
echo getloclist(2, {'id' : qfid, 'context' : 1})
|
||||
<
|
||||
*quickfix-parse*
|
||||
You can parse a list of lines using 'errorformat' without creating or
|
||||
modifying a quickfix list using the |getqflist()| function. Examples: >
|
||||
echo getqflist({'lines' : ["F1:10:Line10", "F2:20:Line20"]})
|
||||
echo getqflist({'lines' : systemlist('grep -Hn quickfix *')})
|
||||
This returns a dictionary where the 'items' key contains the list of quickfix
|
||||
entries parsed from lines. The following shows how to use a custom
|
||||
'errorformat' to parse the lines without modifying the 'errorformat' option: >
|
||||
echo getqflist({'efm' : '%f#%l#%m', 'lines' : ['F1#10#Line']})
|
||||
<
|
||||
|
||||
EXECUTE A COMMAND IN ALL THE BUFFERS IN QUICKFIX OR LOCATION LIST:
|
||||
*:cdo*
|
||||
@@ -542,6 +594,13 @@ In all of the above cases, if the location list for the selected window is not
|
||||
yet set, then it is set to the location list displayed in the location list
|
||||
window.
|
||||
|
||||
*quickfix-window-ID*
|
||||
You can use the |getqflist()| and |getloclist()| functions to obtain the
|
||||
window ID of the quickfix window and location list window respectively (if
|
||||
present). Examples: >
|
||||
echo getqflist({'winid' : 1}).winid
|
||||
echo getloclist(2, {'winid' : 1}).winid
|
||||
<
|
||||
=============================================================================
|
||||
3. Using more than one list of errors *quickfix-error-lists*
|
||||
|
||||
@@ -586,6 +645,14 @@ list, one newer list is overwritten. This is especially useful if you are
|
||||
browsing with ":grep" |grep|. If you want to keep the more recent error
|
||||
lists, use ":cnewer 99" first.
|
||||
|
||||
To get the number of lists in the quickfix and location list stack, you can
|
||||
use the |getqflist()| and |getloclist()| functions respectively with the list
|
||||
number set to the special value '$'. Examples: >
|
||||
echo getqflist({'nr' : '$'}).nr
|
||||
echo getloclist(3, {'nr' : '$'}).nr
|
||||
To get the number of the current list in the stack: >
|
||||
echo getqflist({'nr' : 0}).nr
|
||||
<
|
||||
=============================================================================
|
||||
4. Using :make *:make_makeprg*
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*repeat.txt* For Vim version 8.0. Last change: 2017 Jun 10
|
||||
*repeat.txt* For Vim version 8.0. Last change: 2017 Dec 17
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -242,6 +242,10 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
|
||||
If the directory pack/*/opt/{name}/after exists it is
|
||||
added at the end of 'runtimepath'.
|
||||
|
||||
If loading packages from "pack/*/start" was skipped,
|
||||
then this directory is searched first:
|
||||
pack/*/start/{name} ~
|
||||
|
||||
Note that {name} is the directory name, not the name
|
||||
of the .vim file. All the files matching the pattern
|
||||
pack/*/opt/{name}/plugin/**/*.vim ~
|
||||
|
||||
@@ -4877,6 +4877,7 @@ TermResponse autocmd.txt /*TermResponse*
|
||||
Terminal-mode terminal.txt /*Terminal-mode*
|
||||
TextChanged autocmd.txt /*TextChanged*
|
||||
TextChangedI autocmd.txt /*TextChangedI*
|
||||
TextYankPost autocmd.txt /*TextYankPost*
|
||||
Transact-SQL ft_sql.txt /*Transact-SQL*
|
||||
U undo.txt /*U*
|
||||
UTF-8 mbyte.txt /*UTF-8*
|
||||
@@ -5930,6 +5931,7 @@ eval() eval.txt /*eval()*
|
||||
eval-examples eval.txt /*eval-examples*
|
||||
eval-sandbox eval.txt /*eval-sandbox*
|
||||
eval.txt eval.txt /*eval.txt*
|
||||
event-variable eval.txt /*event-variable*
|
||||
eventhandler() eval.txt /*eventhandler()*
|
||||
eview starting.txt /*eview*
|
||||
evim starting.txt /*evim*
|
||||
@@ -6292,6 +6294,7 @@ ft-vb-syntax syntax.txt /*ft-vb-syntax*
|
||||
ft-verilog-indent indent.txt /*ft-verilog-indent*
|
||||
ft-vhdl-indent indent.txt /*ft-vhdl-indent*
|
||||
ft-vim-indent indent.txt /*ft-vim-indent*
|
||||
ft-vim-plugin filetype.txt /*ft-vim-plugin*
|
||||
ft-vim-syntax syntax.txt /*ft-vim-syntax*
|
||||
ft-xf86conf-syntax syntax.txt /*ft-xf86conf-syntax*
|
||||
ft-xhtml-omni insert.txt /*ft-xhtml-omni*
|
||||
@@ -6299,6 +6302,7 @@ ft-xml-omni insert.txt /*ft-xml-omni*
|
||||
ft-xml-syntax syntax.txt /*ft-xml-syntax*
|
||||
ft-xpm-syntax syntax.txt /*ft-xpm-syntax*
|
||||
ft-yaml-syntax syntax.txt /*ft-yaml-syntax*
|
||||
ft-zimbu-plugin filetype.txt /*ft-zimbu-plugin*
|
||||
ft-zsh-syntax syntax.txt /*ft-zsh-syntax*
|
||||
ft_ada.txt ft_ada.txt /*ft_ada.txt*
|
||||
ft_rust.txt ft_rust.txt /*ft_rust.txt*
|
||||
@@ -7926,6 +7930,8 @@ option-backslash options.txt /*option-backslash*
|
||||
option-list quickref.txt /*option-list*
|
||||
option-summary options.txt /*option-summary*
|
||||
option-window options.txt /*option-window*
|
||||
option_restore() eval.txt /*option_restore()*
|
||||
option_save() eval.txt /*option_save()*
|
||||
options options.txt /*options*
|
||||
options-changed version5.txt /*options-changed*
|
||||
options-in-terminal terminal.txt /*options-in-terminal*
|
||||
@@ -8158,14 +8164,19 @@ quake.vim syntax.txt /*quake.vim*
|
||||
quickfix quickfix.txt /*quickfix*
|
||||
quickfix-6 version6.txt /*quickfix-6*
|
||||
quickfix-ID quickfix.txt /*quickfix-ID*
|
||||
quickfix-context quickfix.txt /*quickfix-context*
|
||||
quickfix-directory-stack quickfix.txt /*quickfix-directory-stack*
|
||||
quickfix-error-lists quickfix.txt /*quickfix-error-lists*
|
||||
quickfix-functions usr_41.txt /*quickfix-functions*
|
||||
quickfix-gcc quickfix.txt /*quickfix-gcc*
|
||||
quickfix-manx quickfix.txt /*quickfix-manx*
|
||||
quickfix-parse quickfix.txt /*quickfix-parse*
|
||||
quickfix-perl quickfix.txt /*quickfix-perl*
|
||||
quickfix-size quickfix.txt /*quickfix-size*
|
||||
quickfix-title quickfix.txt /*quickfix-title*
|
||||
quickfix-valid quickfix.txt /*quickfix-valid*
|
||||
quickfix-window quickfix.txt /*quickfix-window*
|
||||
quickfix-window-ID quickfix.txt /*quickfix-window-ID*
|
||||
quickfix.txt quickfix.txt /*quickfix.txt*
|
||||
quickref quickref.txt /*quickref*
|
||||
quickref.txt quickref.txt /*quickref.txt*
|
||||
@@ -9204,6 +9215,7 @@ v:ctype eval.txt /*v:ctype*
|
||||
v:dying eval.txt /*v:dying*
|
||||
v:errmsg eval.txt /*v:errmsg*
|
||||
v:errors eval.txt /*v:errors*
|
||||
v:event eval.txt /*v:event*
|
||||
v:exception eval.txt /*v:exception*
|
||||
v:false eval.txt /*v:false*
|
||||
v:fcs_choice eval.txt /*v:fcs_choice*
|
||||
@@ -9572,6 +9584,7 @@ win_getid() eval.txt /*win_getid()*
|
||||
win_gotoid() eval.txt /*win_gotoid()*
|
||||
win_id2tabwin() eval.txt /*win_id2tabwin()*
|
||||
win_id2win() eval.txt /*win_id2win()*
|
||||
win_screenpos() eval.txt /*win_screenpos()*
|
||||
winbufnr() eval.txt /*winbufnr()*
|
||||
wincol() eval.txt /*wincol()*
|
||||
window windows.txt /*window*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*terminal.txt* For Vim version 8.0. Last change: 2017 Nov 17
|
||||
*terminal.txt* For Vim version 8.0. Last change: 2017 Dec 17
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -370,12 +370,14 @@ Starting ~
|
||||
Load the plugin with this command: >
|
||||
packadd termdebug
|
||||
< *:Termdebug*
|
||||
To start debugging use `:TermDebug` folowed by the command name, for example: >
|
||||
To start debugging use `:Termdebug` followed by the command name, for example: >
|
||||
:Termdebug vim
|
||||
|
||||
This opens two windows:
|
||||
|
||||
gdb window A terminal window in which "gdb vim" is executed. Here you
|
||||
can directly interact with gdb. The buffer name is "!gdb".
|
||||
|
||||
program window A terminal window for the executed program. When "run" is
|
||||
used in gdb the program I/O will happen in this window, so
|
||||
that it does not interfere with controlling gdb. The buffer
|
||||
@@ -476,14 +478,15 @@ In the window showing the source code these commands can used to control gdb:
|
||||
:Continue execute the gdb "continue" command
|
||||
:Stop interrupt the program
|
||||
|
||||
The plugin adds a window toolbar with these entries:
|
||||
If 'mouse' is set the plugin adds a window toolbar with these entries:
|
||||
Step :Step
|
||||
Next :Over
|
||||
Finish :Finish
|
||||
Cont :Continue
|
||||
Stop :Stop
|
||||
Eval :Evaluate
|
||||
This way you can use the mouse to perform the most common commands.
|
||||
This way you can use the mouse to perform the most common commands. You need
|
||||
to have the 'mouse' option set to enable mouse clicks.
|
||||
|
||||
|
||||
Inspecting variables ~
|
||||
|
||||
+36
-48
@@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 8.0. Last change: 2017 Nov 29
|
||||
*todo.txt* For Vim version 8.0. Last change: 2017 Dec 17
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -35,13 +35,6 @@ entered there will not be repeated below, unless there is extra information.
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
Motif testgui:
|
||||
From test_options.vim:
|
||||
Found errors in Test_set_values():
|
||||
Caught exception in Test_set_values(): Vim(set):E596: Invalid font(s): guifont=fixedsys @ /home/mool/vim/vim80/src/testdir/opt_test.vim, line 1153
|
||||
|
||||
WinBar: balloon shows up for next line
|
||||
|
||||
No maintainer for Vietnamese translations.
|
||||
No maintainer for Simplified Chinese translations.
|
||||
|
||||
@@ -147,9 +140,14 @@ Suggested by Hiroki Kokubun:
|
||||
- [Iceberg](https://github.com/cocopon/iceberg.vim) (my one)
|
||||
- [hybrid](https://github.com/w0ng/vim-hybrid)
|
||||
Include solarized color scheme?, it does not support termguicolors.
|
||||
-> Make check for colorscheme that it's sane.
|
||||
- Sanitized version of pablo (Lifepillar, 2017 Nov 21)
|
||||
|
||||
heap use after free. (gy741, #2447)
|
||||
heap use after free in set_bufref (gy741, #2448)
|
||||
reproduces with valgrind (Dominique)
|
||||
heap use after free in getout. (gy741, #2449)
|
||||
reproduces with valgrind (Dominique)
|
||||
|
||||
Compiler warnings (geeknik, 2017 Oct 26):
|
||||
- signed integer overflow in do_sub() (#2249)
|
||||
- signed integer overflow in get_address() (#2248)
|
||||
@@ -157,21 +155,10 @@ Compiler warnings (geeknik, 2017 Oct 26):
|
||||
- signed integer overflow in nfa_regatom() (#2251)
|
||||
- undefined left shift in get_string_tv() (#2250)
|
||||
|
||||
patch for: fix SHIFT-Insert on Windows command prompt (Yasuhiro Matsumoto,
|
||||
#2381)
|
||||
|
||||
Patch for profile log truncating halfway a character. (ichizok, 2017 Nov 28,
|
||||
#2385)
|
||||
|
||||
WinBar: Maximizing window causes window size to be wrong. (Lifepillar, 2017
|
||||
Nov 29, #2356)
|
||||
|
||||
CTRL-A does not work with empty line. (Alex, #2387)
|
||||
Patch by Hirohito Higashi, 2017 Nov 29.
|
||||
|
||||
'hlsearch' shows empty matches, which means highlighting everything.
|
||||
Don't do that. For "foo\|" or "\v"
|
||||
Patch from Christian, 2017 Nov 14. Should still display "$" matches.
|
||||
Triggering CursorHoldI happens too often in the GUI. (#2451).
|
||||
Should move code from os_unix.c mch_inchar() up into common use, it's not
|
||||
really machine specific. Also the part of WaitForChar(), it deals with timers
|
||||
and is also for all machines.
|
||||
|
||||
When starting with --clean packages under "start" are not loaded. Make this
|
||||
work: :packadd START {name} similar to :runtime START name
|
||||
@@ -179,6 +166,18 @@ work: :packadd START {name} similar to :runtime START name
|
||||
When using :packadd files under "later" are not used, which is inconsistent
|
||||
with packages under "start". (xtal8, #1994)
|
||||
|
||||
Patch to add changedtick var to quickfix list. (Yegappan Lakshmanan, 2017 Nov
|
||||
18, #2391)
|
||||
|
||||
7 Add a watchpoint in the debug mode: An expression that breaks execution
|
||||
when evaluating to non-zero. Add the "watchadd expr" command, stop when
|
||||
the value of the expression changes. ":watchdel" deletes an item,
|
||||
":watchlist" lists the items. (Charles Campbell)
|
||||
Patch by Christian Brabandt, 2016 Jun 10, #859
|
||||
|
||||
7 Make "ga" show the digraph for a character, if it exists.
|
||||
Patch from Christian Brabandt, 2011 Aug 19.
|
||||
|
||||
Fold at end of the buffer behaves inconsistently. (James McCoy, 2017 Oct 9)
|
||||
|
||||
With foldmethod=syntax and nofoldenable comment highlighting isn't removed.
|
||||
@@ -191,12 +190,18 @@ Using 'wildignore' also applies to literally entered file name. Also with
|
||||
directory (Paulo Marcel Coelho Arabic, 2017 Oct 30, #2266)
|
||||
Also see #1689.
|
||||
|
||||
Patch for 24 bit color support in MS-Windows console, using vcon. (Nobuhiro
|
||||
Takasaki, Ken Takata, 2017 Oct 1, #2060).
|
||||
|
||||
ml_get error when using a Python. (Yggdroot, 2017 Jun 1, #1737)
|
||||
Lemonboy can reproduce (2017 Jun 5)
|
||||
|
||||
Patch to fix E806. (Dominique, 2017 Nov 22, #2368)
|
||||
Kazunobu Kuriyama: caused by XtSetLanguageProc().
|
||||
|
||||
Patch to fix GUI find/replace dialog. (kiloliter, 2017 Dec 11, report in
|
||||
#2418, fix in #2435)
|
||||
|
||||
Invalid range error when using BufWinLeave for closing terminal.
|
||||
(Gabriel Barta, 2017 Nov 15, #2339)
|
||||
|
||||
@@ -219,9 +224,8 @@ Koichi Iwamoto, #2126
|
||||
Patch to fix cmdline abbreviation after '<,'>. (Christian Brabandt, 2017 Nov
|
||||
13, on issue #2320)
|
||||
|
||||
Patch to add TextDeletePost and TextYankPost events. (Philippe Vaucher, 2011
|
||||
May 24) Update May 26.
|
||||
Now in patch by Lemonboy, #2333
|
||||
Patch for Neovim concerning restoring when closing help window. (glacambre
|
||||
neovim #7431)
|
||||
|
||||
Default install on MS-Windows should source defaults.vim.
|
||||
Ask whether to use Windows or Vim key behavior?
|
||||
@@ -238,7 +242,7 @@ matchit hasn't been maintained for a long time. #955.
|
||||
|
||||
Problem with 'delcombine'. (agguser, 2017 Nov 10, #2313)
|
||||
|
||||
MS-Windows: buffer completetion doesn't work when using backslash (or slash)
|
||||
MS-Windows: buffer completion doesn't work when using backslash (or slash)
|
||||
for a path separator. (xtal8, #2201)
|
||||
|
||||
Patch to adjust to DPI setting for GTK. (Roel van de Kraats, 2017 Nov 20,
|
||||
@@ -264,9 +268,6 @@ line breaks. (Ken Takata, 2017 Aug 22)
|
||||
|
||||
The ":move" command does not honor closed folds. (Ryan Lue, #2351)
|
||||
|
||||
Patch for 24 bit color support in MS-Windows console, using vcon. (Nobuhiro
|
||||
Takasaki, Ken Takata, 2017 Oct 1, #2060).
|
||||
|
||||
Memory leaks in test_channel? (or is it because of fork())
|
||||
Memory leak in test_arabic.
|
||||
Using uninitialized value in test_crypt.
|
||||
@@ -304,6 +305,9 @@ Alternatives for ~:
|
||||
|
||||
The ++ options for the :edit command are also useful on the Vim command line.
|
||||
|
||||
When recovering a file, put the swap file name in b:recovered_swapfile. Then
|
||||
a command can delete it.
|
||||
|
||||
Overlong utf-8 sequence is displayed wrong. (Harm te Hennepe, 2017 Sep 14,
|
||||
#2089) Patch with possible solution by Björn Linse.
|
||||
|
||||
@@ -641,7 +645,7 @@ Probably list of keystrokes, with some annotations for mode changes.
|
||||
Could store in logfile to be able to analyse it with an external command.
|
||||
E.g. to see when's the last time a plugin command was used.
|
||||
|
||||
execute() cannot be used with command completeion. (Daniel Hahler, 2016 Oct 1,
|
||||
execute() cannot be used with command completion. (Daniel Hahler, 2016 Oct 1,
|
||||
#1141)
|
||||
|
||||
cmap using execute() has side effects. (Killthemule, 2016 Aug 17, #983)
|
||||
@@ -812,12 +816,6 @@ directory exists. (Sergio Gallelli, 2013 Dec 29)
|
||||
In debug mode one can inspect variables, but not the function parameters
|
||||
(starting with a:). (Luc Hermitte, 2017 Jan 4, #1352)
|
||||
|
||||
7 Add a watchpoint in the debug mode: An expression that breaks execution
|
||||
when evaluating to non-zero. Add the "watchadd expr" command, stop when
|
||||
the value of the expression changes. ":watchdel" deletes an item,
|
||||
":watchlist" lists the items. (Charles Campbell)
|
||||
Patch by Christian Brabandt, 2016 Jun 10, #859
|
||||
|
||||
If ":bd" also closes a Tab page then the " mark is not set. (Harm te Hennepe,
|
||||
2016 Apr 25, #780)
|
||||
|
||||
@@ -1248,13 +1246,6 @@ Patch to allow more types in remote_expr(). (Lech Lorens, 2014 Jan 5)
|
||||
Doesn't work for string in list. Other way to pass all types of variables
|
||||
reliably?
|
||||
|
||||
Using ":call foo#d.f()" doesn't autoload the "foo.vim" file.
|
||||
That is, calling a dictionary function on an autoloaded dict.
|
||||
Works OK for echo, just not for ":call" and ":call call()". (Ted, 2011 Mar
|
||||
17)
|
||||
Patch by Christian Brabandt, 2013 Mar 23.
|
||||
Not 100% sure this is the right solution.
|
||||
|
||||
Patch to add {lhs} to :mapclear: clear all maps starting with {lhs}.
|
||||
(Christian Brabandt, 2013 Dec 9)
|
||||
|
||||
@@ -1523,9 +1514,6 @@ doesn't jump to the correct line with :cfirst. (ZyX, 2011 Sep 18)
|
||||
|
||||
Behavior of i" and a" text objects isn't logical. (Ben Fritz, 2013 Nov 19)
|
||||
|
||||
7 Make "ga" show the digraph for a character, if it exists.
|
||||
Patch from Christian Brabandt, 2011 Aug 19.
|
||||
|
||||
maparg() does not show the <script> flag. When temporarily changing a
|
||||
mapping, how to restore the script ID?
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_41.txt* For Vim version 8.0. Last change: 2017 Nov 19
|
||||
*usr_41.txt* For Vim version 8.0. Last change: 2017 Dec 02
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -902,6 +902,7 @@ Vim server: *server-functions*
|
||||
Window size and position: *window-size-functions*
|
||||
winheight() get height of a specific window
|
||||
winwidth() get width of a specific window
|
||||
win_screenpos() get screen position of a window
|
||||
winrestcmd() return command to restore window sizes
|
||||
winsaveview() get view of current window
|
||||
winrestview() restore saved view of current window
|
||||
|
||||
@@ -1925,6 +1925,9 @@ au StdinReadPost * if !did_filetype() | runtime! scripts.vim | endif
|
||||
" Most of these should call s:StarSetf() to avoid names ending in .gz and the
|
||||
" like are used.
|
||||
|
||||
" More Apache style config files
|
||||
au BufNewFile,BufRead */etc/proftpd/*.conf*,*/etc/proftpd/conf.*/* call s:StarSetf('apachestyle')
|
||||
|
||||
" More Apache config files
|
||||
au BufNewFile,BufRead access.conf*,apache.conf*,apache2.conf*,httpd.conf*,srm.conf* call s:StarSetf('apache')
|
||||
au BufNewFile,BufRead */etc/apache2/*.conf*,*/etc/apache2/conf.*/*,*/etc/apache2/mods-*/*,*/etc/apache2/sites-*/*,*/etc/httpd/conf.d/*.conf* call s:StarSetf('apache')
|
||||
|
||||
+17
-15
@@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin
|
||||
" Language: Vim
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2017 Nov 06
|
||||
" Last Change: 2017 Dec 05
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
@@ -39,21 +39,23 @@ endif
|
||||
" Comments start with a double quote
|
||||
setlocal commentstring=\"%s
|
||||
|
||||
" Move around functions.
|
||||
nnoremap <silent><buffer> [[ m':call search('^\s*fu\%[nction]\>', "bW")<CR>
|
||||
vnoremap <silent><buffer> [[ m':<C-U>exe "normal! gv"<Bar>call search('^\s*fu\%[nction]\>', "bW")<CR>
|
||||
nnoremap <silent><buffer> ]] m':call search('^\s*fu\%[nction]\>', "W")<CR>
|
||||
vnoremap <silent><buffer> ]] m':<C-U>exe "normal! gv"<Bar>call search('^\s*fu\%[nction]\>', "W")<CR>
|
||||
nnoremap <silent><buffer> [] m':call search('^\s*endf*\%[unction]\>', "bW")<CR>
|
||||
vnoremap <silent><buffer> [] m':<C-U>exe "normal! gv"<Bar>call search('^\s*endf*\%[unction]\>', "bW")<CR>
|
||||
nnoremap <silent><buffer> ][ m':call search('^\s*endf*\%[unction]\>', "W")<CR>
|
||||
vnoremap <silent><buffer> ][ m':<C-U>exe "normal! gv"<Bar>call search('^\s*endf*\%[unction]\>', "W")<CR>
|
||||
if !exists("no_plugin_maps") && !exists("no_vim_maps")
|
||||
" Move around functions.
|
||||
nnoremap <silent><buffer> [[ m':call search('^\s*fu\%[nction]\>', "bW")<CR>
|
||||
vnoremap <silent><buffer> [[ m':<C-U>exe "normal! gv"<Bar>call search('^\s*fu\%[nction]\>', "bW")<CR>
|
||||
nnoremap <silent><buffer> ]] m':call search('^\s*fu\%[nction]\>', "W")<CR>
|
||||
vnoremap <silent><buffer> ]] m':<C-U>exe "normal! gv"<Bar>call search('^\s*fu\%[nction]\>', "W")<CR>
|
||||
nnoremap <silent><buffer> [] m':call search('^\s*endf*\%[unction]\>', "bW")<CR>
|
||||
vnoremap <silent><buffer> [] m':<C-U>exe "normal! gv"<Bar>call search('^\s*endf*\%[unction]\>', "bW")<CR>
|
||||
nnoremap <silent><buffer> ][ m':call search('^\s*endf*\%[unction]\>', "W")<CR>
|
||||
vnoremap <silent><buffer> ][ m':<C-U>exe "normal! gv"<Bar>call search('^\s*endf*\%[unction]\>', "W")<CR>
|
||||
|
||||
" Move around comments
|
||||
nnoremap <silent><buffer> ]" :call search('^\(\s*".*\n\)\@<!\(\s*"\)', "W")<CR>
|
||||
vnoremap <silent><buffer> ]" :<C-U>exe "normal! gv"<Bar>call search('^\(\s*".*\n\)\@<!\(\s*"\)', "W")<CR>
|
||||
nnoremap <silent><buffer> [" :call search('\%(^\s*".*\n\)\%(^\s*"\)\@!', "bW")<CR>
|
||||
vnoremap <silent><buffer> [" :<C-U>exe "normal! gv"<Bar>call search('\%(^\s*".*\n\)\%(^\s*"\)\@!', "bW")<CR>
|
||||
" Move around comments
|
||||
nnoremap <silent><buffer> ]" :call search('^\(\s*".*\n\)\@<!\(\s*"\)', "W")<CR>
|
||||
vnoremap <silent><buffer> ]" :<C-U>exe "normal! gv"<Bar>call search('^\(\s*".*\n\)\@<!\(\s*"\)', "W")<CR>
|
||||
nnoremap <silent><buffer> [" :call search('\%(^\s*".*\n\)\%(^\s*"\)\@!', "bW")<CR>
|
||||
vnoremap <silent><buffer> [" :<C-U>exe "normal! gv"<Bar>call search('\%(^\s*".*\n\)\%(^\s*"\)\@!', "bW")<CR>
|
||||
endif
|
||||
|
||||
" Let the matchit plugin know what items can be matched.
|
||||
if exists("loaded_matchit")
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: Zimbu
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2012 Sep 08
|
||||
" Last Change: 2017 Dec 05
|
||||
|
||||
" Only do this when not done yet for this buffer
|
||||
if exists("b:did_ftplugin")
|
||||
@@ -135,8 +135,10 @@ iabbr <buffer> <expr> until GCUpperSpace("until")
|
||||
iabbr <buffer> <expr> while GCUpperSpace("while")
|
||||
iabbr <buffer> <expr> repeat GCUpper("repeat")
|
||||
|
||||
nnoremap <silent> <buffer> [[ m`:call ZimbuGoStartBlock()<CR>
|
||||
nnoremap <silent> <buffer> ]] m`:call ZimbuGoEndBlock()<CR>
|
||||
if !exists("no_plugin_maps") && !exists("no_zimbu_maps")
|
||||
nnoremap <silent> <buffer> [[ m`:call ZimbuGoStartBlock()<CR>
|
||||
nnoremap <silent> <buffer> ]] m`:call ZimbuGoEndBlock()<CR>
|
||||
endif
|
||||
|
||||
" Using a function makes sure the search pattern is restored
|
||||
func! ZimbuGoStartBlock()
|
||||
|
||||
+107
-76
@@ -2,7 +2,7 @@
|
||||
" Language: Javascript
|
||||
" Maintainer: Chris Paul ( https://github.com/bounceme )
|
||||
" URL: https://github.com/pangloss/vim-javascript
|
||||
" Last Change: September 18, 2017
|
||||
" Last Change: December 4, 2017
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists('b:did_indent')
|
||||
@@ -10,10 +10,6 @@ if exists('b:did_indent')
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
" indent correctly if inside <script>
|
||||
" vim/vim@690afe1 for the switch from cindent
|
||||
let b:html_indent_script1 = 'inc'
|
||||
|
||||
" Now, set up our indentation expression and keys that trigger it.
|
||||
setlocal indentexpr=GetJavascriptIndent()
|
||||
setlocal autoindent nolisp nosmartindent
|
||||
@@ -25,13 +21,6 @@ setlocal indentkeys+=0],0)
|
||||
|
||||
let b:undo_indent = 'setlocal indentexpr< smartindent< autoindent< indentkeys<'
|
||||
|
||||
" Regex of syntax group names that are or delimit string or are comments.
|
||||
let b:syng_strcom = get(b:,'syng_strcom','string\|comment\|regex\|special\|doc\|template\%(braces\)\@!')
|
||||
let b:syng_str = get(b:,'syng_str','string\|template\|special')
|
||||
" template strings may want to be excluded when editing graphql:
|
||||
" au! Filetype javascript let b:syng_str = '^\%(.*template\)\@!.*string\|special'
|
||||
" au! Filetype javascript let b:syng_strcom = '^\%(.*template\)\@!.*string\|comment\|regex\|special\|doc'
|
||||
|
||||
" Only define the function once.
|
||||
if exists('*GetJavascriptIndent')
|
||||
finish
|
||||
@@ -40,6 +29,23 @@ endif
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" indent correctly if inside <script>
|
||||
" vim/vim@690afe1 for the switch from cindent
|
||||
" overridden with b:html_indent_script1
|
||||
call extend(g:,{'html_indent_script1': 'inc'},'keep')
|
||||
|
||||
" Regex of syntax group names that are or delimit string or are comments.
|
||||
let s:bvars = {
|
||||
\ 'syng_strcom': 'string\|comment\|regex\|special\|doc\|template\%(braces\)\@!',
|
||||
\ 'syng_str': 'string\|template\|special' }
|
||||
" template strings may want to be excluded when editing graphql:
|
||||
" au! Filetype javascript let b:syng_str = '^\%(.*template\)\@!.*string\|special'
|
||||
" au! Filetype javascript let b:syng_strcom = '^\%(.*template\)\@!.*string\|comment\|regex\|special\|doc'
|
||||
|
||||
function s:GetVars()
|
||||
call extend(b:,extend(s:bvars,{'js_cache': [0,0,0]}),'keep')
|
||||
endfunction
|
||||
|
||||
" Get shiftwidth value
|
||||
if exists('*shiftwidth')
|
||||
function s:sw()
|
||||
@@ -104,21 +110,22 @@ endfunction
|
||||
function s:SkipFunc()
|
||||
if s:top_col == 1
|
||||
throw 'out of bounds'
|
||||
endif
|
||||
let s:top_col = 0
|
||||
if s:check_in
|
||||
elseif s:check_in
|
||||
if eval(s:skip_expr)
|
||||
return 1
|
||||
endif
|
||||
let s:check_in = 0
|
||||
elseif getline('.') =~ '\%<'.col('.').'c\/.\{-}\/\|\%>'.col('.').'c[''"]\|\\$'
|
||||
if eval(s:skip_expr)
|
||||
let s:looksyn = a:firstline
|
||||
return 1
|
||||
endif
|
||||
elseif search('\m`\|\${\|\*\/','nW'.s:z,s:looksyn) && eval(s:skip_expr)
|
||||
let s:check_in = 1
|
||||
return 1
|
||||
elseif search('\m`\|\${\|\*\/','nW'.s:z,s:looksyn)
|
||||
if eval(s:skip_expr)
|
||||
let s:check_in = 1
|
||||
return 1
|
||||
endif
|
||||
else
|
||||
let s:synid_cache[:] += [[line2byte('.') + col('.') - 1], ['']]
|
||||
endif
|
||||
let [s:looksyn, s:top_col] = getpos('.')[1:2]
|
||||
endfunction
|
||||
@@ -159,19 +166,29 @@ function s:Token()
|
||||
return s:LookingAt() =~ '\k' ? expand('<cword>') : s:LookingAt()
|
||||
endfunction
|
||||
|
||||
function s:PreviousToken()
|
||||
let l:col = col('.')
|
||||
function s:PreviousToken(...)
|
||||
let [l:pos, tok] = [getpos('.'), '']
|
||||
if search('\m\k\{1,}\|\S','ebW')
|
||||
if search('\m\*\%#\/\|\/\/\%<'.a:firstline.'l','nbW',line('.')) && eval(s:in_comm)
|
||||
if s:SearchLoop('\S\ze\_s*\/[/*]','bW',s:in_comm)
|
||||
return s:Token()
|
||||
if getline('.')[col('.')-2:col('.')-1] == '*/'
|
||||
if eval(s:in_comm) && !s:SearchLoop('\S\ze\_s*\/[/*]','bW',s:in_comm)
|
||||
call setpos('.',l:pos)
|
||||
else
|
||||
let tok = s:Token()
|
||||
endif
|
||||
call cursor(a:firstline, l:col)
|
||||
else
|
||||
return s:Token()
|
||||
let two = a:0 || line('.') != l:pos[1] ? strridx(getline('.')[:col('.')],'//') + 1 : 0
|
||||
if two && eval(s:in_comm)
|
||||
call cursor(0,two)
|
||||
let tok = s:PreviousToken(1)
|
||||
if tok is ''
|
||||
call setpos('.',l:pos)
|
||||
endif
|
||||
else
|
||||
let tok = s:Token()
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
return ''
|
||||
return tok
|
||||
endfunction
|
||||
|
||||
function s:Pure(f,...)
|
||||
@@ -183,23 +200,30 @@ function s:SearchLoop(pat,flags,expr)
|
||||
endfunction
|
||||
|
||||
function s:ExprCol()
|
||||
if getline('.')[col('.')-2] == ':'
|
||||
return 1
|
||||
endif
|
||||
let bal = 0
|
||||
while s:SearchLoop('[{}?]\|\_[^:]\zs::\@!','bW',s:skip_expr)
|
||||
while s:SearchLoop('[{}?:]','bW',s:skip_expr)
|
||||
if s:LookingAt() == ':'
|
||||
if getline('.')[col('.')-2] == ':'
|
||||
call cursor(0,col('.')-1)
|
||||
continue
|
||||
endif
|
||||
let bal -= 1
|
||||
elseif s:LookingAt() == '?'
|
||||
let bal += 1
|
||||
if bal == 1
|
||||
break
|
||||
if getline('.')[col('.'):col('.')+1] =~ '^\.\d\@!'
|
||||
continue
|
||||
elseif !bal
|
||||
return 1
|
||||
endif
|
||||
let bal += 1
|
||||
elseif s:LookingAt() == '{'
|
||||
let bal = !s:IsBlock()
|
||||
break
|
||||
return !s:IsBlock()
|
||||
elseif !s:GetPair('{','}','bW',s:skip_expr)
|
||||
break
|
||||
endif
|
||||
endwhile
|
||||
return s:Nat(bal)
|
||||
endfunction
|
||||
|
||||
" configurable regexes that define continuation lines, not including (, {, or [.
|
||||
@@ -208,30 +232,29 @@ let s:opfirst = '^' . get(g:,'javascript_opfirst',
|
||||
let s:continuation = get(g:,'javascript_continuation',
|
||||
\ '\C\%([<=,.~!?/*^%|&:]\|+\@<!+\|-\@<!-\|=\@<!>\|\<\%(typeof\|new\|delete\|void\|in\|instanceof\|await\)\)') . '$'
|
||||
|
||||
function s:Continues(ln,con)
|
||||
let tok = matchstr(a:con[-15:],s:continuation)
|
||||
function s:Continues()
|
||||
let tok = matchstr(strpart(getline('.'),col('.')-15,15),s:continuation)
|
||||
if tok =~ '[a-z:]'
|
||||
call cursor(a:ln, len(a:con))
|
||||
return tok == ':' ? s:ExprCol() : s:PreviousToken() != '.'
|
||||
elseif tok !~ '[/>]'
|
||||
return tok isnot ''
|
||||
endif
|
||||
return s:SynAt(a:ln, len(a:con)) !~? (tok == '>' ? 'jsflow\|^html' : 'regex')
|
||||
return s:SynAt(line('.'),col('.')) !~? (tok == '>' ? 'jsflow\|^html' : 'regex')
|
||||
endfunction
|
||||
|
||||
" Check if line 'lnum' has a balanced amount of parentheses.
|
||||
function s:Balanced(lnum)
|
||||
let [l:open, l:line] = [0, getline(a:lnum)]
|
||||
let pos = match(l:line, '[][(){}]')
|
||||
function s:Balanced(lnum,line)
|
||||
let l:open = 0
|
||||
let pos = match(a:line, '[][(){}]')
|
||||
while pos != -1
|
||||
if s:SynAt(a:lnum,pos + 1) !~? b:syng_strcom
|
||||
let l:open += match(' ' . l:line[pos],'[[({]')
|
||||
let l:open += match(' ' . a:line[pos],'[[({]')
|
||||
if l:open < 0
|
||||
return
|
||||
endif
|
||||
endif
|
||||
let pos = match(l:line, !l:open ? '[][(){}]' : '()' =~ l:line[pos] ?
|
||||
\ '[()]' : '{}' =~ l:line[pos] ? '[{}]' : '[][]', pos + 1)
|
||||
let pos = match(a:line, !l:open ? '[][(){}]' : '()' =~ a:line[pos] ?
|
||||
\ '[()]' : '{}' =~ a:line[pos] ? '[{}]' : '[][]', pos + 1)
|
||||
endwhile
|
||||
return !l:open
|
||||
endfunction
|
||||
@@ -244,27 +267,38 @@ function s:OneScope()
|
||||
\ s:Pure('s:PreviousToken') != '.' && !(tok == 'while' && s:DoWhile())
|
||||
elseif s:Token() =~# '^else$\|^do$'
|
||||
return s:Pure('s:PreviousToken') != '.'
|
||||
elseif strpart(getline('.'),col('.')-2,2) == '=>'
|
||||
call cursor(0,col('.')-1)
|
||||
if s:PreviousToken() == ')'
|
||||
return s:GetPair('(', ')', 'bW', s:skip_expr)
|
||||
endif
|
||||
return 1
|
||||
endif
|
||||
return strpart(getline('.'),col('.')-2,2) == '=>'
|
||||
endfunction
|
||||
|
||||
function s:DoWhile()
|
||||
let cpos = searchpos('\m\<','cbW')
|
||||
if s:SearchLoop('\C[{}]\|\<\%(do\|while\)\>','bW',s:skip_expr)
|
||||
if s:{s:LookingAt() == '}' && s:GetPair('{','}','bW',s:skip_expr) ?
|
||||
\ 'Previous' : ''}Token() ==# 'do' && s:IsBlock()
|
||||
return 1
|
||||
while s:SearchLoop('\C[{}]\|\<\%(do\|while\)\>','bW',s:skip_expr)
|
||||
if s:LookingAt() =~ '\a'
|
||||
if s:Pure('s:IsBlock')
|
||||
if s:LookingAt() ==# 'd'
|
||||
return 1
|
||||
endif
|
||||
break
|
||||
endif
|
||||
elseif s:LookingAt() != '}' || !s:GetPair('{','}','bW',s:skip_expr)
|
||||
break
|
||||
endif
|
||||
call call('cursor',cpos)
|
||||
endif
|
||||
endwhile
|
||||
call call('cursor',cpos)
|
||||
endfunction
|
||||
|
||||
" returns total offset from braceless contexts. 'num' is the lineNr which
|
||||
" encloses the entire context, 'cont' if whether a:firstline is a continued
|
||||
" expression, which could have started in a braceless context
|
||||
function s:IsContOne(num,cont)
|
||||
let [l:num, b_l] = [a:num + !a:num, 0]
|
||||
let pind = a:num ? indent(a:num) + s:sw() : 0
|
||||
function s:IsContOne(cont)
|
||||
let [l:num, b_l] = [b:js_cache[1] + !b:js_cache[1], 0]
|
||||
let pind = b:js_cache[1] ? indent(b:js_cache[1]) + s:sw() : 0
|
||||
let ind = indent('.') + !a:cont
|
||||
while line('.') > l:num && ind > pind || line('.') == l:num
|
||||
if indent('.') < ind && s:OneScope()
|
||||
@@ -282,20 +316,16 @@ function s:IsContOne(num,cont)
|
||||
return b_l
|
||||
endfunction
|
||||
|
||||
function s:Class()
|
||||
return (s:Token() ==# 'class' || s:PreviousToken() =~# '^class$\|^extends$') &&
|
||||
\ s:PreviousToken() != '.'
|
||||
endfunction
|
||||
|
||||
function s:IsSwitch()
|
||||
return s:PreviousToken() !~ '[.*]' &&
|
||||
\ (!s:GetPair('{','}','cbW',s:skip_expr) || s:IsBlock() && !s:Class())
|
||||
call call('cursor',b:js_cache[1:])
|
||||
return search('\m\C\%#.\_s*\%(\%(\/\/.*\_$\|\/\*\_.\{-}\*\/\)\@>\_s*\)*\%(case\|default\)\>','nWc'.s:z)
|
||||
endfunction
|
||||
|
||||
" https://github.com/sweet-js/sweet.js/wiki/design#give-lookbehind-to-the-reader
|
||||
function s:IsBlock()
|
||||
let tok = s:PreviousToken()
|
||||
if join(s:stack) =~? 'xml\|jsx' && s:SynAt(line('.'),col('.')-1) =~? 'xml\|jsx'
|
||||
let s:in_jsx = 1
|
||||
return tok != '{'
|
||||
elseif tok =~ '\k'
|
||||
if tok ==# 'type'
|
||||
@@ -320,7 +350,7 @@ function s:IsBlock()
|
||||
endfunction
|
||||
|
||||
function GetJavascriptIndent()
|
||||
let b:js_cache = get(b:,'js_cache',[0,0,0])
|
||||
call s:GetVars()
|
||||
let s:synid_cache = [[],[]]
|
||||
let l:line = getline(v:lnum)
|
||||
" use synstack as it validates syn state and works in an empty line
|
||||
@@ -334,7 +364,7 @@ function GetJavascriptIndent()
|
||||
return -1
|
||||
endif
|
||||
elseif s:stack[-1] =~? b:syng_str
|
||||
if b:js_cache[0] == v:lnum - 1 && s:Balanced(v:lnum-1)
|
||||
if b:js_cache[0] == v:lnum - 1 && s:Balanced(v:lnum-1,getline(v:lnum-1))
|
||||
let b:js_cache[0] = v:lnum
|
||||
endif
|
||||
return -1
|
||||
@@ -361,7 +391,7 @@ function GetJavascriptIndent()
|
||||
call cursor(v:lnum,1)
|
||||
let idx = index([']',')','}'],l:line[0])
|
||||
if b:js_cache[0] > l:lnum && b:js_cache[0] < v:lnum ||
|
||||
\ b:js_cache[0] == l:lnum && s:Balanced(l:lnum)
|
||||
\ b:js_cache[0] == l:lnum && s:Balanced(l:lnum,pline)
|
||||
call call('cursor',b:js_cache[1:])
|
||||
else
|
||||
let [s:looksyn, s:top_col, s:check_in, s:l1] = [v:lnum - 1,0,0,
|
||||
@@ -382,10 +412,10 @@ function GetJavascriptIndent()
|
||||
|
||||
let [b:js_cache[0], num] = [v:lnum, b:js_cache[1]]
|
||||
|
||||
let [num_ind, is_op, b_l, l:switch_offset] = [s:Nat(indent(num)),0,0,0]
|
||||
let [num_ind, is_op, b_l, l:switch_offset, s:in_jsx] = [s:Nat(indent(num)),0,0,0,0]
|
||||
if !num || s:LookingAt() == '{' && s:IsBlock()
|
||||
let ilnum = line('.')
|
||||
if num && s:LookingAt() == ')' && s:GetPair('(',')','bW',s:skip_expr)
|
||||
if num && !s:in_jsx && s:LookingAt() == ')' && s:GetPair('(',')','bW',s:skip_expr)
|
||||
if ilnum == num
|
||||
let [num, num_ind] = [line('.'), indent('.')]
|
||||
endif
|
||||
@@ -399,23 +429,24 @@ function GetJavascriptIndent()
|
||||
endif
|
||||
endif
|
||||
if idx == -1 && pline[-1:] !~ '[{;]'
|
||||
call cursor(l:lnum, len(pline))
|
||||
let sol = matchstr(l:line,s:opfirst)
|
||||
if sol is '' || sol == '/' && s:SynAt(v:lnum,
|
||||
\ 1 + len(getline(v:lnum)) - len(l:line)) =~? 'regex'
|
||||
if s:Continues(l:lnum,pline)
|
||||
if s:Continues()
|
||||
let is_op = s:sw()
|
||||
endif
|
||||
elseif num && sol =~# '^\%(in\%(stanceof\)\=\|\*\)$'
|
||||
call call('cursor',b:js_cache[1:])
|
||||
if s:PreviousToken() =~ '\k' && s:Class()
|
||||
return num_ind + s:sw()
|
||||
endif
|
||||
let is_op = s:sw()
|
||||
elseif num && sol =~# '^\%(in\%(stanceof\)\=\|\*\)$' &&
|
||||
\ s:LookingAt() == '}' && s:GetPair('{','}','bW',s:skip_expr) &&
|
||||
\ s:PreviousToken() == ')' && s:GetPair('(',')','bW',s:skip_expr) &&
|
||||
\ (s:PreviousToken() == ']' || s:LookingAt() =~ '\k' &&
|
||||
\ s:{s:PreviousToken() == '*' ? 'Previous' : ''}Token() !=# 'function')
|
||||
return num_ind + s:sw()
|
||||
else
|
||||
let is_op = s:sw()
|
||||
endif
|
||||
call cursor(l:lnum, len(pline))
|
||||
let b_l = s:Nat(s:IsContOne(b:js_cache[1],is_op) - (!is_op && l:line =~ '^{')) * s:sw()
|
||||
let b_l = s:Nat(s:IsContOne(is_op) - (!is_op && l:line =~ '^{')) * s:sw()
|
||||
endif
|
||||
elseif idx.s:LookingAt().&cino =~ '^-1(.*(' && (search('\m\S','nbW',num) || s:ParseCino('U'))
|
||||
let pval = s:ParseCino('(')
|
||||
@@ -431,10 +462,10 @@ function GetJavascriptIndent()
|
||||
|
||||
" main return
|
||||
if l:line =~ '^[])}]\|^|}'
|
||||
if l:line_raw[0] == ')' && getline(num)[b:js_cache[2]-1] == '('
|
||||
if l:line_raw[0] == ')'
|
||||
if s:ParseCino('M')
|
||||
return indent(l:lnum)
|
||||
elseif &cino =~# 'm' && !s:ParseCino('m')
|
||||
elseif num && &cino =~# 'm' && !s:ParseCino('m')
|
||||
return virtcol('.') - 1
|
||||
endif
|
||||
endif
|
||||
|
||||
+1
-1
@@ -216,7 +216,7 @@ func s:InstallCommands()
|
||||
" TODO: can the K mapping be restored?
|
||||
nnoremap K :Evaluate<CR>
|
||||
|
||||
if has('menu')
|
||||
if has('menu') && &mouse != ''
|
||||
nnoremenu WinBar.Step :Step<CR>
|
||||
nnoremenu WinBar.Next :Over<CR>
|
||||
nnoremenu WinBar.Finish :Finish<CR>
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
if &cp || exists("g:loaded_netrwPlugin")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_netrwPlugin = "v162"
|
||||
let g:loaded_netrwPlugin = "v156"
|
||||
let s:keepcpo = &cpo
|
||||
set cpo&vim
|
||||
"DechoRemOn
|
||||
@@ -42,8 +42,8 @@ augroup END
|
||||
" Network Browsing Reading Writing: {{{2
|
||||
augroup Network
|
||||
au!
|
||||
au BufReadCmd file://* call netrw#FileUrlEdit(expand("<amatch>"))
|
||||
au BufReadCmd ftp://*,rcp://*,scp://*,http://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau BufReadPre ".fnameescape(expand("<amatch>"))|call netrw#Nread(2,expand("<amatch>"))|exe "sil doau BufReadPost ".fnameescape(expand("<amatch>"))
|
||||
au BufReadCmd file://* call netrw#FileUrlRead(expand("<amatch>"))
|
||||
au BufReadCmd ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau BufReadPre ".fnameescape(expand("<amatch>"))|call netrw#Nread(2,expand("<amatch>"))|exe "sil doau BufReadPost ".fnameescape(expand("<amatch>"))
|
||||
au FileReadCmd ftp://*,rcp://*,scp://*,http://*,file://*,https://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau FileReadPre ".fnameescape(expand("<amatch>"))|call netrw#Nread(1,expand("<amatch>"))|exe "sil doau FileReadPost ".fnameescape(expand("<amatch>"))
|
||||
au BufWriteCmd ftp://*,rcp://*,scp://*,http://*,file://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau BufWritePre ".fnameescape(expand("<amatch>"))|exe 'Nwrite '.fnameescape(expand("<amatch>"))|exe "sil doau BufWritePost ".fnameescape(expand("<amatch>"))
|
||||
au FileWriteCmd ftp://*,rcp://*,scp://*,http://*,file://*,dav://*,davs://*,rsync://*,sftp://* exe "sil doau FileWritePre ".fnameescape(expand("<amatch>"))|exe "'[,']".'Nwrite '.fnameescape(expand("<amatch>"))|exe "sil doau FileWritePost ".fnameescape(expand("<amatch>"))
|
||||
@@ -59,7 +59,7 @@ com! -count=1 -nargs=* Nread let s:svpos= winsaveview()<bar>call netrw#NetRead(
|
||||
com! -range=% -nargs=* Nwrite let s:svpos= winsaveview()<bar><line1>,<line2>call netrw#NetWrite(<f-args>)<bar>call winrestview(s:svpos)
|
||||
com! -nargs=* NetUserPass call NetUserPass(<f-args>)
|
||||
com! -nargs=* Nsource let s:svpos= winsaveview()<bar>call netrw#NetSource(<f-args>)<bar>call winrestview(s:svpos)
|
||||
com! -nargs=? Ntree call netrw#SetTreetop(1,<q-args>)
|
||||
com! -nargs=? Ntree call netrw#SetTreetop(<q-args>)
|
||||
|
||||
" Commands: :Explore, :Sexplore, Hexplore, Vexplore, Lexplore {{{2
|
||||
com! -nargs=* -bar -bang -count=0 -complete=dir Explore call netrw#Explore(<count>,0,0+<bang>0,<q-args>)
|
||||
@@ -81,7 +81,7 @@ if !exists("g:netrw_nogx")
|
||||
if !hasmapto('<Plug>NetrwBrowseX')
|
||||
nmap <unique> gx <Plug>NetrwBrowseX
|
||||
endif
|
||||
nno <silent> <Plug>NetrwBrowseX :call netrw#BrowseX(netrw#GX(),netrw#CheckIfRemote(netrw#GX()))<cr>
|
||||
nno <silent> <Plug>NetrwBrowseX :call netrw#BrowseX(expand((exists("g:netrw_gx")? g:netrw_gx : '<cfile>')),netrw#CheckIfRemote())<cr>
|
||||
endif
|
||||
if maparg('gx','v') == ""
|
||||
if !hasmapto('<Plug>NetrwBrowseXVis')
|
||||
@@ -129,15 +129,19 @@ fun! s:LocalBrowse(dirname)
|
||||
elseif isdirectory(a:dirname)
|
||||
" call Decho("(LocalBrowse) dirname<".a:dirname."> ft=".&ft." (isdirectory, not amiga)")
|
||||
" call Dredir("LocalBrowse ft last set: ","verbose set ft")
|
||||
" call Decho("(s:LocalBrowse) COMBAK#23: buf#".bufnr("%")." file<".expand("%")."> line#".line(".")." col#".col("."))
|
||||
sil! call netrw#LocalBrowseCheck(a:dirname)
|
||||
" call Decho("(s:LocalBrowse) COMBAK#24: buf#".bufnr("%")." file<".expand("%")."> line#".line(".")." col#".col("."))
|
||||
if exists("w:netrw_bannercnt") && line('.') < w:netrw_bannercnt
|
||||
exe w:netrw_bannercnt
|
||||
" call Decho("(s:LocalBrowse) COMBAK#25: buf#".bufnr("%")." file<".expand("%")."> line#".line(".")." col#".col("."))
|
||||
endif
|
||||
|
||||
else
|
||||
" not a directory, ignore it
|
||||
" call Decho("(LocalBrowse) dirname<".a:dirname."> not a directory, ignoring...")
|
||||
endif
|
||||
" call Decho("(s:LocalBrowse) COMBAK#26: buf#".bufnr("%")." file<".expand("%")."> line#".line(".")." col#".col("."))
|
||||
|
||||
" call Dret("s:LocalBrowse")
|
||||
endfun
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
" Vim syntax file
|
||||
" Language: Apache-Style configuration files (proftpd.conf/apache.conf/..)
|
||||
" Maintainer: Christian Hammers <ch@westend.com>
|
||||
" URL: none
|
||||
" Maintainer: Ben RUBSON <ben.rubson@gmail.com>
|
||||
" Former Maintainer: Christian Hammers <ch@westend.com>
|
||||
" ChangeLog:
|
||||
" 2017-12-17,ch
|
||||
" correctly detect comments
|
||||
" 2001-05-04,ch
|
||||
" adopted Vim 6.0 syntax style
|
||||
" 1999-10-28,ch
|
||||
@@ -27,8 +29,8 @@ endif
|
||||
|
||||
syn case ignore
|
||||
|
||||
syn match apComment /^\s*#.*$/
|
||||
syn match apOption /^\s*[^ \t#<=]*/
|
||||
syn match apComment /^\s*#.*$/
|
||||
"syn match apLastValue /[^ \t<=#]*$/ contains=apComment ugly
|
||||
|
||||
" tags
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: Haskell
|
||||
" Maintainer: Haskell Cafe mailinglist <haskell-cafe@haskell.org>
|
||||
" Last Change: 2017 Jun 04
|
||||
" Last Change: 2017 Dec 16
|
||||
" Original Author: John Williams <jrw@pobox.com>
|
||||
"
|
||||
" Thanks to Ryan Crumley for suggestions and John Meacham for
|
||||
@@ -59,8 +59,8 @@ syn match hsSpecialCharError contained "\\&\|'''\+"
|
||||
syn region hsString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=hsSpecialChar
|
||||
syn match hsCharacter "[^a-zA-Z0-9_']'\([^\\]\|\\[^']\+\|\\'\)'"lc=1 contains=hsSpecialChar,hsSpecialCharError
|
||||
syn match hsCharacter "^'\([^\\]\|\\[^']\+\|\\'\)'" contains=hsSpecialChar,hsSpecialCharError
|
||||
syn match hsNumber "\<[0-9]\+\>\|\<0[xX][0-9a-fA-F]\+\>\|\<0[oO][0-7]\+\>"
|
||||
syn match hsFloat "\<[0-9]\+\.[0-9]\+\([eE][-+]\=[0-9]\+\)\=\>"
|
||||
syn match hsNumber "\v<[0-9]%(_*[0-9])*>|<0[xX]_*[0-9a-fA-F]%(_*[0-9a-fA-F])*>|<0[oO]_*%(_*[0-7])*>|<0[bB]_*[01]%(_*[01])*>"
|
||||
syn match hsFloat "\v<[0-9]%(_*[0-9])*\.[0-9]%(_*[0-9])*%(_*[eE][-+]?[0-9]%(_*[0-9])*)?>|<[0-9]%(_*[0-9])*_*[eE][-+]?[0-9]%(_*[0-9])*>|<0[xX]_*[0-9a-fA-F]%(_*[0-9a-fA-F])*\.[0-9a-fA-F]%(_*[0-9a-fA-F])*%(_*[pP][-+]?[0-9]%(_*[0-9])*)?>|<0[xX]_*[0-9a-fA-F]%(_*[0-9a-fA-F])*_*[pP][-+]?[0-9]%(_*[0-9])*>"
|
||||
|
||||
" Keyword definitions. These must be patterns instead of keywords
|
||||
" because otherwise they would match as keywords at the start of a
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
" Maintainer: Jorge Maldonado Ventura <jorgesumle@freakspot.net>
|
||||
" Previous Maintainer: Claudio Fleiner <claudio@fleiner.com>
|
||||
" Repository: https://notabug.org/jorgesumle/vim-html-syntax
|
||||
" Last Change: 2017 Sep 30
|
||||
" included patch from Christian Brabandt to make use of the strikethrough attributes
|
||||
" Last Change: 2017 Dec 16
|
||||
" Included patch from Jorge Maldonado Ventura to add the dialog element
|
||||
"
|
||||
|
||||
" Please check :help html.vim for some comments and a description of the options
|
||||
@@ -100,11 +100,11 @@ syn keyword htmlArg contained summary tabindex valuetype version
|
||||
" html 5 arg names
|
||||
syn keyword htmlArg contained allowfullscreen async autocomplete autofocus
|
||||
syn keyword htmlArg contained autoplay challenge contenteditable contextmenu
|
||||
syn keyword htmlArg contained controls crossorigin default dirname download
|
||||
syn keyword htmlArg contained draggable dropzone form formaction formenctype
|
||||
syn keyword htmlArg contained formmethod formnovalidate formtarget hidden
|
||||
syn keyword htmlArg contained high icon inputmode keytype kind list loop low
|
||||
syn keyword htmlArg contained max min minlength muted nonce novalidate open
|
||||
syn keyword htmlArg contained controls crossorigin default dialog dirname
|
||||
syn keyword htmlArg contained download draggable dropzone form formaction
|
||||
syn keyword htmlArg contained formenctype formmethod formnovalidate formtarget
|
||||
syn keyword htmlArg contained hidden high icon inputmode keytype kind list loop
|
||||
syn keyword htmlArg contained low max min minlength muted nonce novalidate open
|
||||
syn keyword htmlArg contained optimum pattern placeholder poster preload
|
||||
syn keyword htmlArg contained radiogroup required reversed sandbox spellcheck
|
||||
syn keyword htmlArg contained sizes srcset srcdoc srclang step title translate
|
||||
|
||||
+8
-15
@@ -1,8 +1,8 @@
|
||||
" Vim syntax file
|
||||
" Language: TeX
|
||||
" Maintainer: Charles E. Campbell <NdrchipO@ScampbellPfamily.AbizM>
|
||||
" Last Change: Oct 12, 2017
|
||||
" Version: 105
|
||||
" Last Change: Dec 11, 2017
|
||||
" Version: 107
|
||||
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TEX
|
||||
"
|
||||
" Notes: {{{1
|
||||
@@ -396,8 +396,8 @@ endif
|
||||
|
||||
" Bad Math (mismatched): {{{1
|
||||
if !exists("g:tex_no_math") && !s:tex_no_error
|
||||
syn match texBadMath "\\end\s*{\s*\(array\|gathered\|bBpvV]matrix\|split\|subequations\|smallmatrix\|xxalignat\)\s*}"
|
||||
syn match texBadMath "\\end\s*{\s*\(align\|alignat\|displaymath\|displaymath\|eqnarray\|equation\|flalign\|gather\|math\|multline\|xalignat\)\*\=\s*}"
|
||||
syn match texBadMath "\\end\s*{\s*\(array\|bBpvV]matrix\|split\|smallmatrix\)\s*}"
|
||||
syn match texBadMath "\\end\s*{\s*\(displaymath\|equation\|eqnarray\|math\)\*\=\s*}"
|
||||
syn match texBadMath "\\[\])]"
|
||||
endif
|
||||
|
||||
@@ -436,17 +436,10 @@ if !exists("g:tex_no_math")
|
||||
endfun
|
||||
|
||||
" Standard Math Zones: {{{2
|
||||
call TexNewMathZone("A","align",1)
|
||||
call TexNewMathZone("B","alignat",1)
|
||||
call TexNewMathZone("C","displaymath",1)
|
||||
call TexNewMathZone("D","eqnarray",1)
|
||||
call TexNewMathZone("E","equation",1)
|
||||
call TexNewMathZone("F","flalign",1)
|
||||
call TexNewMathZone("G","gather",1)
|
||||
call TexNewMathZone("H","math",1)
|
||||
call TexNewMathZone("I","multline",1)
|
||||
call TexNewMathZone("J","xalignat",1)
|
||||
call TexNewMathZone("K","xxalignat",0)
|
||||
call TexNewMathZone("A","displaymath",1)
|
||||
call TexNewMathZone("B","eqnarray",1)
|
||||
call TexNewMathZone("C","equation",1)
|
||||
call TexNewMathZone("D","math",1)
|
||||
|
||||
" Inline Math Zones: {{{2
|
||||
if s:tex_fast =~# 'M'
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
" Vim syntax file
|
||||
" Language: Vim 8.0 script
|
||||
" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
|
||||
" Last Change: November 03, 2017
|
||||
" Version: 8.0-04
|
||||
" Last Change: Dec 15, 2017
|
||||
" Version: 8.0-07
|
||||
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM
|
||||
" Automatically generated keyword lists: {{{1
|
||||
|
||||
@@ -199,7 +199,7 @@ syn keyword vimFTOption contained detect indent off on plugin
|
||||
|
||||
" Augroup : vimAugroupError removed because long augroups caused sync'ing problems. {{{2
|
||||
" ======= : Trade-off: Increasing synclines with slower editing vs augroup END error checking.
|
||||
syn cluster vimAugroupList contains=vimAugroup,vimIsCommand,vimCommand,vimUserCmd,vimExecute,vimNotFunc,vimFuncName,vimFunction,vimFunctionError,vimLineComment,vimMap,vimSpecFile,vimOper,vimNumber,vimOperParen,vimComment,vimString,vimSubst,vimMark,vimRegister,vimAddress,vimFilter,vimCmplxRepeat,vimComment,vimLet,vimSet,vimAutoCmd,vimRegion,vimSynLine,vimNotation,vimCtrlChar,vimFuncVar,vimContinue
|
||||
syn cluster vimAugroupList contains=vimAugroup,vimIsCommand,vimCommand,vimUserCmd,vimExecute,vimNotFunc,vimFuncName,vimFunction,vimFunctionError,vimLineComment,vimMap,vimSpecFile,vimOper,vimNumber,vimOperParen,vimComment,vimString,vimSubst,vimMark,vimRegister,vimAddress,vimFilter,vimCmplxRepeat,vimComment,vimLet,vimSet,vimAutoCmd,vimRegion,vimSynLine,vimNotation,vimCtrlChar,vimFuncVar,vimContinue,vimSetEqual,vimOption
|
||||
if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'a'
|
||||
syn region vimAugroup fold matchgroup=vimAugroupKey start="\<aug\%[roup]\>\ze\s\+\K\k*" end="\<aug\%[roup]\>\ze\s\+[eE][nN][dD]\>" contains=vimAutoCmd,@vimAugroupList
|
||||
else
|
||||
@@ -215,7 +215,8 @@ syn keyword vimAugroupKey contained aug[roup]
|
||||
" =========
|
||||
syn cluster vimOperGroup contains=vimEnvvar,vimFunc,vimFuncVar,vimOper,vimOperParen,vimNumber,vimString,vimRegister,vimContinue
|
||||
syn match vimOper "\(==\|!=\|>=\|<=\|=\~\|!\~\|>\|<\|=\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile
|
||||
syn match vimOper "||\|&&\|[-+.]" skipwhite nextgroup=vimString,vimSpecFile
|
||||
syn match vimOper "\(\<is\>\|\<isnot\>\)[?#]\{0,2}" skipwhite nextgroup=vimString,vimSpecFile
|
||||
syn match vimOper "||\|&&\|[-+.]" skipwhite nextgroup=vimString,vimSpecFile
|
||||
syn region vimOperParen matchgroup=vimParenSep start="(" end=")" contains=@vimOperGroup
|
||||
syn region vimOperParen matchgroup=vimSep start="{" end="}" contains=@vimOperGroup nextgroup=vimVar,vimFuncVar
|
||||
if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noopererror")
|
||||
@@ -559,7 +560,7 @@ syn match vimHiBang contained "!" skipwhite nextgroup=@vimHighlightCluster
|
||||
|
||||
syn match vimHiGroup contained "\i\+"
|
||||
syn case ignore
|
||||
syn keyword vimHiAttrib contained none bold inverse italic reverse standout underline undercurl
|
||||
syn keyword vimHiAttrib contained none bold inverse italic nocombine reverse standout strikethrough underline undercurl
|
||||
syn keyword vimFgBgAttrib contained none bg background fg foreground
|
||||
syn case match
|
||||
syn match vimHiAttribList contained "\i\+" contains=vimHiAttrib
|
||||
|
||||
+72
-11
@@ -34,10 +34,11 @@ Contents:
|
||||
11. Building with Ruby support
|
||||
12. Building with Tcl support
|
||||
13. Building with Terminal support
|
||||
14. Windows 3.1
|
||||
15. MS-DOS
|
||||
14. Building with DirectX (DirectWrite) support
|
||||
15. Windows 3.1
|
||||
16. MS-DOS
|
||||
|
||||
16. Installing after building from sources
|
||||
17. Installing after building from sources
|
||||
|
||||
|
||||
The currently recommended way (that means it has been verified to work) is
|
||||
@@ -438,18 +439,31 @@ You will end up with a Python-enabled, Win32 version. Enjoy!
|
||||
================================
|
||||
|
||||
For building with MSVC 2008 the "Windows Installer" from www.python.org
|
||||
works fine. Python 3.4 is recommended.
|
||||
works fine. Python 3.6 is recommended.
|
||||
|
||||
When building, you need to set the following variables at least:
|
||||
|
||||
PYTHON3: Where Python3 is installed. E.g. C:\Python34
|
||||
PYTHON3: Where Python3 is installed. E.g. C:\Python36
|
||||
DYNAMIC_PYTHON3: Whether dynamic linking is used. Usually, set to yes.
|
||||
PYTHON3_VER: Python3 version. E.g. 34 for Python 3.4.X.
|
||||
PYTHON3_VER: Python3 version. E.g. 36 for Python 3.6.X.
|
||||
|
||||
E.g. When using MSVC (as one line):
|
||||
|
||||
nmake -f Make_mvc.mak
|
||||
PYTHON3=C:\Python34 DYNAMIC_PYTHON3=yes PYTHON3_VER=34
|
||||
PYTHON3=C:\Python36 DYNAMIC_PYTHON3=yes PYTHON3_VER=36
|
||||
|
||||
|
||||
When using msys2 and link with Python3 bundled with msys2 (as one line):
|
||||
|
||||
mingw32-make -f Make_ming.mak PYTHON3=c:/msys64/mingw64
|
||||
PYTHON3_HOME=c:/msys64/mingw64
|
||||
PYTHON3INC=-Ic:/msys64/mingw64/include/python3.6m
|
||||
DYNAMIC_PYTHON3=yes
|
||||
PYTHON3_VER=36
|
||||
DYNAMIC_PYTHON3_DLL=libpython3.6m.dll
|
||||
STATIC_STDCPLUS=yes
|
||||
|
||||
(This is for 64-bit builds. For 32-bit builds, replace mingw64 with mingw32.)
|
||||
|
||||
|
||||
8. Building with Racket or MzScheme support
|
||||
@@ -684,21 +698,33 @@ config.h and Ruby's DLL name. Here are the steps for working around them:
|
||||
There is no need to build whole Ruby, just config.h is needed.
|
||||
If you use 32-bit MSVC 2015, the config.h is generated in the
|
||||
.ext\include\i386-mswin32_140 directory.
|
||||
If you use 64-bit MSVC 2015, the config.h is generated in the
|
||||
.ext\include\x64-mswin64_140 directory.
|
||||
|
||||
3) Install the generated config.h.
|
||||
|
||||
For 32-bit version:
|
||||
|
||||
xcopy /s .ext\include C:\Ruby24\include\ruby-2.4.0
|
||||
|
||||
For 64-bit version:
|
||||
|
||||
xcopy /s .ext\include C:\Ruby24-x64\include\ruby-2.4.0
|
||||
|
||||
Note that 2.4.0 is Ruby API version of Ruby 2.4.X.
|
||||
You may need to close the console and reopen it to pick up the new $PATH.
|
||||
|
||||
4) Build Vim. Note that you need to adjust some variables (as one line):
|
||||
|
||||
For 32-bit version:
|
||||
|
||||
nmake -f Make_mvc.mak
|
||||
RUBY=C:\Ruby24 DYNAMIC_RUBY=yes RUBY_VER=24 RUBY_API_VER_LONG=2.4.0
|
||||
RUBY_MSVCRT_NAME=msvcrt
|
||||
WINVER=0x501
|
||||
|
||||
For 64-bit version, replace RUBY=C:\Ruby24 with RUBY=C:\Ruby24-x64.
|
||||
|
||||
If you set WINVER explicitly, it must be set to >=0x500, when building
|
||||
with Ruby 2.1 or later. (Default is 0x501.)
|
||||
When using this trick, you also need to set RUBY_MSVCRT_NAME to msvcrt
|
||||
@@ -713,6 +739,7 @@ After you install RubyInstaller, just type this (as one line):
|
||||
RUBY=C:/Ruby24 DYNAMIC_RUBY=yes RUBY_VER=24 RUBY_API_VER_LONG=2.4.0
|
||||
WINVER=0x501
|
||||
|
||||
For 64-bit version, replace RUBY=C:/Ruby24 with RUBY=C:/Ruby24-x64.
|
||||
If you set WINVER explicitly, it must be set to >=0x500, when building with
|
||||
Ruby 2.1 or later. (Default is 0x501.)
|
||||
|
||||
@@ -761,25 +788,59 @@ E.g. When using MSVC:
|
||||
|
||||
nmake -f Make_mvc.mak TERMINAL=yes
|
||||
|
||||
Or when using MinGW (as one line):
|
||||
Or when using MinGW:
|
||||
|
||||
mingw32-make -f Make_ming.mak TERMINAL=yes
|
||||
|
||||
|
||||
14. Windows 3.1x
|
||||
14. Building with DirectX (DirectWrite) support
|
||||
===============================================
|
||||
|
||||
Vim with DirectX (DirectWrite) support can be built with either MSVC or MinGW.
|
||||
This requires dwrite_2.h and some other header files which come with Windows
|
||||
SDK 8.1 or later (or MinGW-w64), if you want to enable color emoji support.
|
||||
This also requires MBYTE=yes which is enabled by default.
|
||||
|
||||
A) Using MSVC
|
||||
|
||||
If you use MSVC 2013 or later, Windows SDK 8.1 or later is used by default.
|
||||
You just need to specify DIRECTX=yes:
|
||||
|
||||
nmake -f Make_mvc.mak DIRECTX=yes
|
||||
|
||||
If you use MSVC 2012 or earlier, the required header files are not available
|
||||
by default. However, you can use the header files from newer SDKs with older
|
||||
compilers. E.g.:
|
||||
|
||||
set "INCLUDE=%INCLUDE%;C:\Program Files (x86)\Windows Kits\8.1\Include\um"
|
||||
nmake -f Make_mvc.mak DIRECTX=yes
|
||||
|
||||
If you don't need color emoji support, only dwrite.h is required. You can use
|
||||
older compilers (e.g. VC2010) without Windows SDK 8.1. E.g.:
|
||||
|
||||
nmake -f Make_mvc.mak DIRECTX=yes COLOR_EMOJI=no
|
||||
|
||||
B) Using MinGW-w64
|
||||
|
||||
Just set DIRECTX to yes:
|
||||
|
||||
mingw32-make -f Make_ming.mak DIRECTX=yes
|
||||
|
||||
|
||||
15. Windows 3.1x
|
||||
================
|
||||
|
||||
The Windows 3.1x support was removed in patch 7.4.1364.
|
||||
|
||||
|
||||
15. MS-DOS
|
||||
16. MS-DOS
|
||||
==========
|
||||
|
||||
The MS-DOS support was removed in patch 7.4.1399. Only very old Vim versions
|
||||
work on MS-DOS because of the limited amount of memory available.
|
||||
|
||||
|
||||
16. Installing after building from sources
|
||||
17. Installing after building from sources
|
||||
==========================================
|
||||
|
||||
[provided by Michael Soyka, updated by Ken Takata]
|
||||
|
||||
@@ -1255,7 +1255,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>143</string>
|
||||
<string>144</string>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
|
||||
@@ -316,14 +316,14 @@ endif
|
||||
# Python3 interface:
|
||||
# PYTHON3=[Path to Python3 directory] (Set inside Make_cyg.mak or Make_ming.mak)
|
||||
# DYNAMIC_PYTHON3=yes (to load the Python3 DLL dynamically)
|
||||
# PYTHON3_VER=[Python3 version, eg 31, 32] (default is 35)
|
||||
# PYTHON3_VER=[Python3 version, eg 31, 32] (default is 36)
|
||||
ifdef PYTHON3
|
||||
ifndef DYNAMIC_PYTHON3
|
||||
DYNAMIC_PYTHON3=yes
|
||||
endif
|
||||
|
||||
ifndef PYTHON3_VER
|
||||
PYTHON3_VER=35
|
||||
PYTHON3_VER=36
|
||||
endif
|
||||
ifndef DYNAMIC_PYTHON3_DLL
|
||||
DYNAMIC_PYTHON3_DLL=python$(PYTHON3_VER).dll
|
||||
@@ -588,7 +588,7 @@ endif
|
||||
ifeq ($(DIRECTX),yes)
|
||||
# Only allow DirectWrite for a GUI build.
|
||||
ifeq (yes, $(GUI))
|
||||
DEFINES += -DFEAT_DIRECTX -DDYNAMIC_DIRECTX
|
||||
DEFINES += -DFEAT_DIRECTX -DDYNAMIC_DIRECTX -DFEAT_DIRECTX_COLOR_EMOJI
|
||||
endif
|
||||
endif
|
||||
|
||||
|
||||
+12
-6
@@ -25,12 +25,15 @@
|
||||
#
|
||||
# GUI interface: GUI=yes (default is no)
|
||||
#
|
||||
# GUI with DirectWrite(DirectX): DIRECTX=yes
|
||||
# (default is no, requires GUI=yes)
|
||||
# GUI with DirectWrite (DirectX): DIRECTX=yes
|
||||
# (default is no, requires GUI=yes and MBYTE=yes)
|
||||
#
|
||||
# Color emoji support: COLOR_EMOJI=yes
|
||||
# (default is yes if DIRECTX=yes, requires WinSDK 8.1 or later.)
|
||||
#
|
||||
# OLE interface: OLE=yes (usually with GUI=yes)
|
||||
#
|
||||
# Multibyte support: MBYTE=yes (default is no)
|
||||
# Multibyte support: MBYTE=yes (default is yes for NORMAL, BIG, HUGE)
|
||||
#
|
||||
# IME support: IME=yes (requires GUI=yes)
|
||||
# DYNAMIC_IME=[yes or no] (to load the imm32.dll dynamically, default
|
||||
@@ -67,7 +70,7 @@
|
||||
# Python3 interface:
|
||||
# PYTHON3=[Path to Python3 directory]
|
||||
# DYNAMIC_PYTHON3=yes (to load the Python3 DLL dynamically)
|
||||
# PYTHON3_VER=[Python3 version, eg 30, 31] (default is 35)
|
||||
# PYTHON3_VER=[Python3 version, eg 30, 31] (default is 36)
|
||||
#
|
||||
# Ruby interface:
|
||||
# RUBY=[Path to Ruby directory]
|
||||
@@ -419,9 +422,12 @@ NBDEBUG_SRC = nbdebug.c
|
||||
NETBEANS_LIB = WSock32.lib
|
||||
!endif
|
||||
|
||||
# DirectWrite(DirectX)
|
||||
# DirectWrite (DirectX)
|
||||
!if "$(DIRECTX)" == "yes"
|
||||
DIRECTX_DEFS = -DFEAT_DIRECTX -DDYNAMIC_DIRECTX
|
||||
!if "$(COLOR_EMOJI)" != "no"
|
||||
DIRECTX_DEFS = $(DIRECTX_DEFS) -DFEAT_DIRECTX_COLOR_EMOJI
|
||||
!endif
|
||||
DIRECTX_INCL = gui_dwrite.h
|
||||
DIRECTX_OBJ = $(OUTDIR)\gui_dwrite.obj
|
||||
!endif
|
||||
@@ -906,7 +912,7 @@ PYTHON_LIB = $(PYTHON)\libs\python$(PYTHON_VER).lib
|
||||
# PYTHON3 interface
|
||||
!ifdef PYTHON3
|
||||
!ifndef PYTHON3_VER
|
||||
PYTHON3_VER = 35
|
||||
PYTHON3_VER = 36
|
||||
!endif
|
||||
!message Python3 requested (version $(PYTHON3_VER)) - root dir is "$(PYTHON3)"
|
||||
!if "$(DYNAMIC_PYTHON3)" == "yes"
|
||||
|
||||
+2
-1
@@ -2118,7 +2118,6 @@ run_message_test: $(MESSAGE_TEST_TARGET)
|
||||
# These do not depend on the executable, compile it when needed.
|
||||
test1 \
|
||||
test_eval \
|
||||
test_wordcount \
|
||||
test3 test11 test14 test15 test17 \
|
||||
test29 test30 test36 test37 test39 \
|
||||
test42 test44 test48 test49 \
|
||||
@@ -2137,6 +2136,7 @@ test_arglist \
|
||||
test_assign \
|
||||
test_autochdir \
|
||||
test_autocmd \
|
||||
test_autoload \
|
||||
test_backspace_opt \
|
||||
test_breakindent \
|
||||
test_bufline \
|
||||
@@ -2312,6 +2312,7 @@ test_arglist \
|
||||
test_window_cmd \
|
||||
test_window_id \
|
||||
test_windows_home \
|
||||
test_wordcount \
|
||||
test_writefile \
|
||||
test_alot_latin \
|
||||
test_alot_utf8 \
|
||||
|
||||
Vendored
+7
-2
@@ -4817,8 +4817,13 @@ fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_is_selinux_enabled" >&5
|
||||
$as_echo "$ac_cv_lib_selinux_is_selinux_enabled" >&6; }
|
||||
if test "x$ac_cv_lib_selinux_is_selinux_enabled" = xyes; then :
|
||||
ac_fn_c_check_header_mongrel "$LINENO" "selinux/selinux.h" "ac_cv_header_selinux_selinux_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_selinux_selinux_h" = xyes; then :
|
||||
LIBS="$LIBS -lselinux"
|
||||
$as_echo "#define HAVE_SELINUX 1" >>confdefs.h
|
||||
$as_echo "#define HAVE_SELINUX 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
|
||||
fi
|
||||
|
||||
@@ -7593,7 +7598,7 @@ $as_echo "defaulting to no" >&6; }
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
fi
|
||||
if test "$enable_terminal" = "yes"; then
|
||||
if test "$enable_terminal" = "yes" -a "$enable_channel" = "yes"; then
|
||||
$as_echo "#define FEAT_TERMINAL 1" >>confdefs.h
|
||||
|
||||
TERM_SRC="libvterm/src/encoding.c libvterm/src/keyboard.c libvterm/src/mouse.c libvterm/src/parser.c libvterm/src/pen.c libvterm/src/screen.c libvterm/src/state.c libvterm/src/unicode.c libvterm/src/vterm.c"
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
:: command to build big Vim with OLE, Lua, Perl, Python, Racket, Ruby and Tcl
|
||||
SET VCDIR="C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\"
|
||||
SET TOOLDIR=E:\
|
||||
%VCDIR%nmake -f Make_mvc.mak GUI=yes OLE=yes LUA=%TOOLDIR%lua53 DYNAMIC_LUA=yes LUA_VER=53 PERL=%TOOLDIR%perl524 DYNAMIC_PERL=yes PERL_VER=524 PYTHON=%TOOLDIR%python27 DYNAMIC_PYTHON=yes PYTHON_VER=27 PYTHON3=%TOOLDIR%python35 DYNAMIC_PYTHON3=yes PYTHON3_VER=35 MZSCHEME=%TOOLDIR%Racket DYNAMIC_MZSCHEME=yes MZSCHEME_VER=3m_a36fs8 RUBY=%TOOLDIR%ruby24 DYNAMIC_RUBY=yes RUBY_VER=24 RUBY_API_VER_LONG=2.4.0 RUBY_MSVCRT_NAME=msvcrt TCL=%TOOLDIR%ActiveTcl TCL_VER=86 TCL_VER_LONG=8.6 DYNAMIC_TCL=yes TCL_DLL=tcl86t.dll %1 IME=yes CSCOPE=yes DIRECTX=yes
|
||||
%VCDIR%nmake -f Make_mvc.mak GUI=yes OLE=yes LUA=%TOOLDIR%lua53 DYNAMIC_LUA=yes LUA_VER=53 PERL=%TOOLDIR%perl524 DYNAMIC_PERL=yes PERL_VER=524 PYTHON=%TOOLDIR%python27 DYNAMIC_PYTHON=yes PYTHON_VER=27 PYTHON3=%TOOLDIR%python36 DYNAMIC_PYTHON3=yes PYTHON3_VER=36 MZSCHEME=%TOOLDIR%Racket DYNAMIC_MZSCHEME=yes MZSCHEME_VER=3m_a36fs8 RUBY=%TOOLDIR%ruby24 DYNAMIC_RUBY=yes RUBY_VER=24 RUBY_API_VER_LONG=2.4.0 RUBY_MSVCRT_NAME=msvcrt TCL=%TOOLDIR%ActiveTcl TCL_VER=86 TCL_VER_LONG=8.6 DYNAMIC_TCL=yes TCL_DLL=tcl86t.dll %1 IME=yes CSCOPE=yes DIRECTX=yes
|
||||
|
||||
|
||||
+14
-9
@@ -1669,7 +1669,8 @@ set_curbuf(buf_T *buf, int action)
|
||||
#ifdef FEAT_SYN_HL
|
||||
long old_tw = curbuf->b_p_tw;
|
||||
#endif
|
||||
bufref_T bufref;
|
||||
bufref_T newbufref;
|
||||
bufref_T prevbufref;
|
||||
|
||||
setpcmark();
|
||||
if (!cmdmod.keepalt)
|
||||
@@ -1679,18 +1680,22 @@ set_curbuf(buf_T *buf, int action)
|
||||
/* Don't restart Select mode after switching to another buffer. */
|
||||
VIsual_reselect = FALSE;
|
||||
|
||||
/* close_windows() or apply_autocmds() may change curbuf */
|
||||
/* close_windows() or apply_autocmds() may change curbuf and wipe out "buf"
|
||||
*/
|
||||
prevbuf = curbuf;
|
||||
set_bufref(&bufref, prevbuf);
|
||||
set_bufref(&prevbufref, prevbuf);
|
||||
set_bufref(&newbufref, buf);
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
/* Autocommands may delete the curren buffer and/or the buffer we wan to go
|
||||
* to. In those cases don't close the buffer. */
|
||||
if (!apply_autocmds(EVENT_BUFLEAVE, NULL, NULL, FALSE, curbuf)
|
||||
|| (bufref_valid(&prevbufref)
|
||||
&& bufref_valid(&newbufref)
|
||||
# ifdef FEAT_EVAL
|
||||
|| (bufref_valid(&bufref) && !aborting())
|
||||
# else
|
||||
|| bufref_valid(&bufref)
|
||||
&& !aborting()
|
||||
# endif
|
||||
)
|
||||
))
|
||||
#endif
|
||||
{
|
||||
#ifdef FEAT_SYN_HL
|
||||
@@ -1700,9 +1705,9 @@ set_curbuf(buf_T *buf, int action)
|
||||
if (unload)
|
||||
close_windows(prevbuf, FALSE);
|
||||
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
|
||||
if (bufref_valid(&bufref) && !aborting())
|
||||
if (bufref_valid(&prevbufref) && !aborting())
|
||||
#else
|
||||
if (bufref_valid(&bufref))
|
||||
if (bufref_valid(&prevbufref))
|
||||
#endif
|
||||
{
|
||||
win_T *previouswin = curwin;
|
||||
|
||||
+19
-7
@@ -3332,11 +3332,12 @@ channel_read(channel_T *channel, ch_part_T part, char *func)
|
||||
/*
|
||||
* Read from RAW or NL "channel"/"part". Blocks until there is something to
|
||||
* read or the timeout expires.
|
||||
* When "raw" is TRUE don't block waiting on a NL.
|
||||
* Returns what was read in allocated memory.
|
||||
* Returns NULL in case of error or timeout.
|
||||
*/
|
||||
char_u *
|
||||
channel_read_block(channel_T *channel, ch_part_T part, int timeout)
|
||||
static char_u *
|
||||
channel_read_block(channel_T *channel, ch_part_T part, int timeout, int raw)
|
||||
{
|
||||
char_u *buf;
|
||||
char_u *msg;
|
||||
@@ -3346,7 +3347,7 @@ channel_read_block(channel_T *channel, ch_part_T part, int timeout)
|
||||
readq_T *node;
|
||||
|
||||
ch_log(channel, "Blocking %s read, timeout: %d msec",
|
||||
mode == MODE_RAW ? "RAW" : "NL", timeout);
|
||||
mode == MODE_RAW ? "RAW" : "NL", timeout);
|
||||
|
||||
while (TRUE)
|
||||
{
|
||||
@@ -3359,6 +3360,10 @@ channel_read_block(channel_T *channel, ch_part_T part, int timeout)
|
||||
break;
|
||||
if (channel_collapse(channel, part, mode == MODE_NL) == OK)
|
||||
continue;
|
||||
/* If not blocking or nothing more is coming then return what we
|
||||
* have. */
|
||||
if (raw || fd == INVALID_FD)
|
||||
break;
|
||||
}
|
||||
|
||||
/* Wait for up to the channel timeout. */
|
||||
@@ -3385,11 +3390,16 @@ channel_read_block(channel_T *channel, ch_part_T part, int timeout)
|
||||
nl = channel_first_nl(node);
|
||||
|
||||
/* Convert NUL to NL, the internal representation. */
|
||||
for (p = buf; p < nl && p < buf + node->rq_buflen; ++p)
|
||||
for (p = buf; (nl == NULL || p < nl) && p < buf + node->rq_buflen; ++p)
|
||||
if (*p == NUL)
|
||||
*p = NL;
|
||||
|
||||
if (nl + 1 == buf + node->rq_buflen)
|
||||
if (nl == NULL)
|
||||
{
|
||||
/* must be a closed channel with missing NL */
|
||||
msg = channel_get(channel, part);
|
||||
}
|
||||
else if (nl + 1 == buf + node->rq_buflen)
|
||||
{
|
||||
/* get the whole buffer */
|
||||
msg = channel_get(channel, part);
|
||||
@@ -3532,7 +3542,8 @@ common_channel_read(typval_T *argvars, typval_T *rettv, int raw)
|
||||
timeout = opt.jo_timeout;
|
||||
|
||||
if (raw || mode == MODE_RAW || mode == MODE_NL)
|
||||
rettv->vval.v_string = channel_read_block(channel, part, timeout);
|
||||
rettv->vval.v_string = channel_read_block(channel, part,
|
||||
timeout, raw);
|
||||
else
|
||||
{
|
||||
if (opt.jo_set & JO_ID)
|
||||
@@ -3990,7 +4001,8 @@ ch_raw_common(typval_T *argvars, typval_T *rettv, int eval)
|
||||
timeout = opt.jo_timeout;
|
||||
else
|
||||
timeout = channel_get_timeout(channel, part_read);
|
||||
rettv->vval.v_string = channel_read_block(channel, part_read, timeout);
|
||||
rettv->vval.v_string = channel_read_block(channel, part_read,
|
||||
timeout, TRUE);
|
||||
}
|
||||
free_job_options(&opt);
|
||||
}
|
||||
|
||||
+3
-2
@@ -452,8 +452,9 @@ if test "x$found_smack" = "x"; then
|
||||
if test "$enable_selinux" = "yes"; then
|
||||
AC_MSG_RESULT(no)
|
||||
AC_CHECK_LIB(selinux, is_selinux_enabled,
|
||||
[AC_CHECK_HEADER(selinux/selinux.h,
|
||||
[LIBS="$LIBS -lselinux"
|
||||
AC_DEFINE(HAVE_SELINUX)])
|
||||
AC_DEFINE(HAVE_SELINUX)])])
|
||||
else
|
||||
AC_MSG_RESULT(yes)
|
||||
fi
|
||||
@@ -2122,7 +2123,7 @@ else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
fi
|
||||
if test "$enable_terminal" = "yes"; then
|
||||
if test "$enable_terminal" = "yes" -a "$enable_channel" = "yes"; then
|
||||
AC_DEFINE(FEAT_TERMINAL)
|
||||
TERM_SRC="libvterm/src/encoding.c libvterm/src/keyboard.c libvterm/src/mouse.c libvterm/src/parser.c libvterm/src/pen.c libvterm/src/screen.c libvterm/src/state.c libvterm/src/unicode.c libvterm/src/vterm.c"
|
||||
AC_SUBST(TERM_SRC)
|
||||
|
||||
+33
-3
@@ -47,6 +47,16 @@ dict_alloc(void)
|
||||
return d;
|
||||
}
|
||||
|
||||
dict_T *
|
||||
dict_alloc_lock(int lock)
|
||||
{
|
||||
dict_T *d = dict_alloc();
|
||||
|
||||
if (d != NULL)
|
||||
d->dv_lock = lock;
|
||||
return d;
|
||||
}
|
||||
|
||||
/*
|
||||
* Allocate an empty dict for a return value.
|
||||
* Returns OK or FAIL.
|
||||
@@ -54,13 +64,12 @@ dict_alloc(void)
|
||||
int
|
||||
rettv_dict_alloc(typval_T *rettv)
|
||||
{
|
||||
dict_T *d = dict_alloc();
|
||||
dict_T *d = dict_alloc_lock(0);
|
||||
|
||||
if (d == NULL)
|
||||
return FAIL;
|
||||
|
||||
rettv_dict_set(rettv, d);
|
||||
rettv->v_lock = 0;
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -80,7 +89,7 @@ rettv_dict_set(typval_T *rettv, dict_T *d)
|
||||
* Free a Dictionary, including all non-container items it contains.
|
||||
* Ignores the reference count.
|
||||
*/
|
||||
static void
|
||||
void
|
||||
dict_free_contents(dict_T *d)
|
||||
{
|
||||
int todo;
|
||||
@@ -102,6 +111,8 @@ dict_free_contents(dict_T *d)
|
||||
--todo;
|
||||
}
|
||||
}
|
||||
|
||||
/* The hashtab is still locked, it has to be re-initialized anyway */
|
||||
hash_clear(&d->dv_hashtab);
|
||||
}
|
||||
|
||||
@@ -846,4 +857,23 @@ dict_list(typval_T *argvars, typval_T *rettv, int what)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Make each item in the dict readonly (not the value of the item).
|
||||
*/
|
||||
void
|
||||
dict_set_items_ro(dict_T *di)
|
||||
{
|
||||
int todo = (int)di->dv_hashtab.ht_used;
|
||||
hashitem_T *hi;
|
||||
|
||||
/* Set readonly */
|
||||
for (hi = di->dv_hashtab.ht_array; todo > 0 ; ++hi)
|
||||
{
|
||||
if (HASHITEM_EMPTY(hi))
|
||||
continue;
|
||||
--todo;
|
||||
HI2DI(hi)->di_flags |= DI_FLAGS_RO | DI_FLAGS_FIX;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* defined(FEAT_EVAL) */
|
||||
|
||||
+20
-15
@@ -192,6 +192,7 @@ static struct vimvar
|
||||
{VV_NAME("termu7resp", VAR_STRING), VV_RO},
|
||||
{VV_NAME("termstyleresp", VAR_STRING), VV_RO},
|
||||
{VV_NAME("termblinkresp", VAR_STRING), VV_RO},
|
||||
{VV_NAME("event", VAR_DICT), VV_RO},
|
||||
};
|
||||
|
||||
/* shorthand */
|
||||
@@ -319,8 +320,9 @@ eval_init(void)
|
||||
|
||||
set_vim_var_nr(VV_SEARCHFORWARD, 1L);
|
||||
set_vim_var_nr(VV_HLSEARCH, 1L);
|
||||
set_vim_var_dict(VV_COMPLETED_ITEM, dict_alloc());
|
||||
set_vim_var_dict(VV_COMPLETED_ITEM, dict_alloc_lock(VAR_FIXED));
|
||||
set_vim_var_list(VV_ERRORS, list_alloc());
|
||||
set_vim_var_dict(VV_EVENT, dict_alloc_lock(VAR_FIXED));
|
||||
|
||||
set_vim_var_nr(VV_FALSE, VVAL_FALSE);
|
||||
set_vim_var_nr(VV_TRUE, VVAL_TRUE);
|
||||
@@ -1956,7 +1958,10 @@ get_lval(
|
||||
|
||||
cc = *p;
|
||||
*p = NUL;
|
||||
v = find_var(lp->ll_name, &ht, flags & GLV_NO_AUTOLOAD);
|
||||
/* Only pass &ht when we would write to the variable, it prevents autoload
|
||||
* as well. */
|
||||
v = find_var(lp->ll_name, (flags & GLV_READ_ONLY) ? NULL : &ht,
|
||||
flags & GLV_NO_AUTOLOAD);
|
||||
if (v == NULL && !quiet)
|
||||
EMSG2(_(e_undefvar), lp->ll_name);
|
||||
*p = cc;
|
||||
@@ -6610,6 +6615,8 @@ get_vim_var_nr(int idx)
|
||||
|
||||
/*
|
||||
* Get string v: variable value. Uses a static buffer, can only be used once.
|
||||
* If the String variable has never been set, return an empty string.
|
||||
* Never returns NULL;
|
||||
*/
|
||||
char_u *
|
||||
get_vim_var_str(int idx)
|
||||
@@ -6627,6 +6634,16 @@ get_vim_var_list(int idx)
|
||||
return vimvars[idx].vv_list;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get Dict v: variable value. Caller must take care of reference count when
|
||||
* needed.
|
||||
*/
|
||||
dict_T *
|
||||
get_vim_var_dict(int idx)
|
||||
{
|
||||
return vimvars[idx].vv_dict;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set v:char to character "c".
|
||||
*/
|
||||
@@ -6701,25 +6718,13 @@ set_vim_var_list(int idx, list_T *val)
|
||||
void
|
||||
set_vim_var_dict(int idx, dict_T *val)
|
||||
{
|
||||
int todo;
|
||||
hashitem_T *hi;
|
||||
|
||||
clear_tv(&vimvars[idx].vv_di.di_tv);
|
||||
vimvars[idx].vv_type = VAR_DICT;
|
||||
vimvars[idx].vv_dict = val;
|
||||
if (val != NULL)
|
||||
{
|
||||
++val->dv_refcount;
|
||||
|
||||
/* Set readonly */
|
||||
todo = (int)val->dv_hashtab.ht_used;
|
||||
for (hi = val->dv_hashtab.ht_array; todo > 0 ; ++hi)
|
||||
{
|
||||
if (HASHITEM_EMPTY(hi))
|
||||
continue;
|
||||
--todo;
|
||||
HI2DI(hi)->di_flags |= DI_FLAGS_RO | DI_FLAGS_FIX;
|
||||
}
|
||||
dict_set_items_ro(val);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+11
-2
@@ -2382,7 +2382,7 @@ f_count(typval_T *argvars, typval_T *rettv)
|
||||
char_u *p = argvars[0].vval.v_string;
|
||||
char_u *next;
|
||||
|
||||
if (!error && expr != NULL && p != NULL)
|
||||
if (!error && expr != NULL && *expr != NUL && p != NULL)
|
||||
{
|
||||
if (ic)
|
||||
{
|
||||
@@ -4137,6 +4137,7 @@ f_getbufinfo(typval_T *argvars, typval_T *rettv)
|
||||
int filtered = FALSE;
|
||||
int sel_buflisted = FALSE;
|
||||
int sel_bufloaded = FALSE;
|
||||
int sel_bufmodified = FALSE;
|
||||
|
||||
if (rettv_list_alloc(rettv) != OK)
|
||||
return;
|
||||
@@ -4159,6 +4160,10 @@ f_getbufinfo(typval_T *argvars, typval_T *rettv)
|
||||
di = dict_find(sel_d, (char_u *)"bufloaded", -1);
|
||||
if (di != NULL && get_tv_number(&di->di_tv))
|
||||
sel_bufloaded = TRUE;
|
||||
|
||||
di = dict_find(sel_d, (char_u *)"bufmodified", -1);
|
||||
if (di != NULL && get_tv_number(&di->di_tv))
|
||||
sel_bufmodified = TRUE;
|
||||
}
|
||||
}
|
||||
else if (argvars[0].v_type != VAR_UNKNOWN)
|
||||
@@ -4178,7 +4183,8 @@ f_getbufinfo(typval_T *argvars, typval_T *rettv)
|
||||
if (argbuf != NULL && argbuf != buf)
|
||||
continue;
|
||||
if (filtered && ((sel_bufloaded && buf->b_ml.ml_mfp == NULL)
|
||||
|| (sel_buflisted && !buf->b_p_bl)))
|
||||
|| (sel_buflisted && !buf->b_p_bl)
|
||||
|| (sel_bufmodified && !buf->b_changed)))
|
||||
continue;
|
||||
|
||||
d = get_buffer_info(buf);
|
||||
@@ -11194,7 +11200,10 @@ f_spellbadword(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
/* Find the start and length of the badly spelled word. */
|
||||
len = spell_move_to(curwin, FORWARD, TRUE, TRUE, &attr);
|
||||
if (len != 0)
|
||||
{
|
||||
word = ml_get_cursor();
|
||||
curwin->w_set_curswant = TRUE;
|
||||
}
|
||||
}
|
||||
else if (curwin->w_p_spell && *curbuf->b_s.b_p_spl != NUL)
|
||||
{
|
||||
|
||||
+9
-12
@@ -1482,7 +1482,7 @@ do_shell(
|
||||
#endif
|
||||
&& msg_silent == 0)
|
||||
FOR_ALL_BUFFERS(buf)
|
||||
if (bufIsChanged(buf))
|
||||
if (bufIsChangedNotTerm(buf))
|
||||
{
|
||||
#ifdef FEAT_GUI_MSWIN
|
||||
if (!winstart)
|
||||
@@ -6934,13 +6934,10 @@ fix_help_buffer(void)
|
||||
&& fcount > 0)
|
||||
{
|
||||
#ifdef FEAT_MULTI_LANG
|
||||
int i1;
|
||||
int i2;
|
||||
char_u *f1;
|
||||
char_u *f2;
|
||||
char_u *t1;
|
||||
char_u *e1;
|
||||
char_u *e2;
|
||||
int i1, i2;
|
||||
char_u *f1, *f2;
|
||||
char_u *t1, *t2;
|
||||
char_u *e1, *e2;
|
||||
|
||||
/* If foo.abx is found use it instead of foo.txt in
|
||||
* the same directory. */
|
||||
@@ -6955,10 +6952,9 @@ fix_help_buffer(void)
|
||||
f1 = fnames[i1];
|
||||
f2 = fnames[i2];
|
||||
t1 = gettail(f1);
|
||||
if (fnamencmp(f1, f2, t1 - f1) != 0)
|
||||
continue;
|
||||
t2 = gettail(f2);
|
||||
e1 = vim_strrchr(t1, '.');
|
||||
e2 = vim_strrchr(gettail(f2), '.');
|
||||
e2 = vim_strrchr(t2, '.');
|
||||
if (e1 == NULL || e2 == NULL)
|
||||
continue;
|
||||
if (fnamecmp(e1, ".txt") != 0
|
||||
@@ -6969,7 +6965,8 @@ fix_help_buffer(void)
|
||||
fnames[i1] = NULL;
|
||||
continue;
|
||||
}
|
||||
if (fnamencmp(f1, f2, e1 - f1) != 0)
|
||||
if (e1 - f1 != e2 - f2
|
||||
|| fnamencmp(f1, f2, e1 - f1) != 0)
|
||||
continue;
|
||||
if (fnamecmp(e1, ".txt") == 0
|
||||
&& fnamecmp(e2, fname + 4) == 0)
|
||||
|
||||
+22
-9
@@ -3820,18 +3820,31 @@ ex_packloadall(exarg_T *eap)
|
||||
void
|
||||
ex_packadd(exarg_T *eap)
|
||||
{
|
||||
static char *plugpat = "pack/*/opt/%s";
|
||||
static char *plugpat = "pack/*/%s/%s";
|
||||
int len;
|
||||
char *pat;
|
||||
int round;
|
||||
int res = OK;
|
||||
|
||||
len = (int)STRLEN(plugpat) + (int)STRLEN(eap->arg);
|
||||
pat = (char *)alloc(len);
|
||||
if (pat == NULL)
|
||||
return;
|
||||
vim_snprintf(pat, len, plugpat, eap->arg);
|
||||
do_in_path(p_pp, (char_u *)pat, DIP_ALL + DIP_DIR + DIP_ERR,
|
||||
add_pack_plugin, eap->forceit ? &APP_ADD_DIR : &APP_BOTH);
|
||||
vim_free(pat);
|
||||
/* Round 1: use "start", round 2: use "opt". */
|
||||
for (round = 1; round <= 2; ++round)
|
||||
{
|
||||
/* Only look under "start" when loading packages wasn't done yet. */
|
||||
if (round == 1 && did_source_packages)
|
||||
continue;
|
||||
|
||||
len = (int)STRLEN(plugpat) + (int)STRLEN(eap->arg) + 5;
|
||||
pat = (char *)alloc(len);
|
||||
if (pat == NULL)
|
||||
return;
|
||||
vim_snprintf(pat, len, plugpat, round == 1 ? "start" : "opt", eap->arg);
|
||||
/* The first round don't give a "not found" error, in the second round
|
||||
* only when nothing was found in the first round. */
|
||||
res = do_in_path(p_pp, (char_u *)pat,
|
||||
DIP_ALL + DIP_DIR + (round == 2 && res == FAIL ? DIP_ERR : 0),
|
||||
add_pack_plugin, eap->forceit ? &APP_ADD_DIR : &APP_BOTH);
|
||||
vim_free(pat);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(FEAT_EVAL) && defined(FEAT_AUTOCMD)
|
||||
|
||||
+3
-2
@@ -4538,13 +4538,14 @@ get_address(
|
||||
if (lnum != MAXLNUM)
|
||||
curwin->w_cursor.lnum = lnum;
|
||||
/*
|
||||
* Start a forward search at the end of the line.
|
||||
* Start a forward search at the end of the line (unless
|
||||
* before the first line).
|
||||
* Start a backward search at the start of the line.
|
||||
* This makes sure we never match in the current
|
||||
* line, and can match anywhere in the
|
||||
* next/previous line.
|
||||
*/
|
||||
if (c == '/')
|
||||
if (c == '/' && curwin->w_cursor.lnum > 0)
|
||||
curwin->w_cursor.col = MAXCOL;
|
||||
else
|
||||
curwin->w_cursor.col = 0;
|
||||
|
||||
+24
-1
@@ -172,6 +172,24 @@ abandon_cmdline(void)
|
||||
redraw_cmdline = TRUE;
|
||||
}
|
||||
|
||||
#ifdef FEAT_SEARCH_EXTRA
|
||||
/*
|
||||
* Guess that the pattern matches everything. Only finds specific cases, such
|
||||
* as a trailing \|, which can happen while typing a pattern.
|
||||
*/
|
||||
static int
|
||||
empty_pattern(char_u *p)
|
||||
{
|
||||
int n = STRLEN(p);
|
||||
|
||||
/* remove trailing \v and the like */
|
||||
while (n >= 2 && p[n - 2] == '\\'
|
||||
&& vim_strchr((char_u *)"mMvVcCZ", p[n - 1]) != NULL)
|
||||
n -= 2;
|
||||
return n == 0 || (n >= 2 && p[n - 2] == '\\' && p[n - 1] == '|');
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* getcmdline() - accept a command line starting with firstc.
|
||||
*
|
||||
@@ -1802,11 +1820,11 @@ getcmdline(
|
||||
# endif
|
||||
old_botline = curwin->w_botline;
|
||||
update_screen(NOT_VALID);
|
||||
restore_last_search_pattern();
|
||||
redrawcmdline();
|
||||
}
|
||||
else
|
||||
vim_beep(BO_ERROR);
|
||||
restore_last_search_pattern();
|
||||
goto cmdline_not_changed;
|
||||
}
|
||||
break;
|
||||
@@ -2031,6 +2049,11 @@ cmdline_changed:
|
||||
else
|
||||
end_pos = curwin->w_cursor; /* shutup gcc 4 */
|
||||
|
||||
/* Disable 'hlsearch' highlighting if the pattern matches
|
||||
* everything. Avoids a flash when typing "foo\|". */
|
||||
if (empty_pattern(ccline.cmdbuff))
|
||||
SET_NO_HLSEARCH(TRUE);
|
||||
|
||||
validate_cursor();
|
||||
/* May redraw the status line to show the cursor position. */
|
||||
if (p_ru && curwin->w_status_height > 0)
|
||||
|
||||
@@ -6483,6 +6483,7 @@ buf_modname(
|
||||
/*
|
||||
* Like fgets(), but if the file line is too long, it is truncated and the
|
||||
* rest of the line is thrown away. Returns TRUE for end-of-file.
|
||||
* If the line is truncated then buf[size - 2] will not be NUL.
|
||||
*/
|
||||
int
|
||||
vim_fgets(char_u *buf, int size, FILE *fp)
|
||||
@@ -7894,6 +7895,7 @@ static struct event_name
|
||||
{"WinEnter", EVENT_WINENTER},
|
||||
{"WinLeave", EVENT_WINLEAVE},
|
||||
{"VimResized", EVENT_VIMRESIZED},
|
||||
{"TextYankPost", EVENT_TEXTYANKPOST},
|
||||
{NULL, (event_T)0}
|
||||
};
|
||||
|
||||
@@ -9437,6 +9439,15 @@ has_funcundefined(void)
|
||||
return (first_autopat[(int)EVENT_FUNCUNDEFINED] != NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE when there is a TextYankPost autocommand defined.
|
||||
*/
|
||||
int
|
||||
has_textyankpost(void)
|
||||
{
|
||||
return (first_autopat[(int)EVENT_TEXTYANKPOST] != NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Execute autocommands for "event" and file name "fname".
|
||||
* Return TRUE if some commands were executed.
|
||||
|
||||
@@ -37,7 +37,7 @@ static void gui_set_fg_color(char_u *name);
|
||||
static void gui_set_bg_color(char_u *name);
|
||||
static win_T *xy2win(int x, int y);
|
||||
|
||||
#if defined(UNIX) && !defined(FEAT_GUI_MAC)
|
||||
#if defined(UNIX) && !(defined(FEAT_GUI_MAC) || defined(FEAT_GUI_MACVIM))
|
||||
# define MAY_FORK
|
||||
static void gui_do_fork(void);
|
||||
|
||||
@@ -1151,7 +1151,7 @@ gui_update_cursor(
|
||||
if (id > 0)
|
||||
{
|
||||
cattr = syn_id2colors(id, &cfg, &cbg);
|
||||
#if defined(FEAT_MBYTE) || defined(FEAT_HANGULIN)
|
||||
#if defined(FEAT_XIM) || defined(FEAT_HANGULIN)
|
||||
{
|
||||
static int iid;
|
||||
guicolor_T fg, bg;
|
||||
@@ -2928,6 +2928,20 @@ gui_insert_lines(int row, int count)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef FEAT_TIMERS
|
||||
/*
|
||||
* Passed to ui_wait_for_chars_or_timer(), ignoring extra arguments.
|
||||
*/
|
||||
static int
|
||||
gui_wait_for_chars_3(
|
||||
long wtime,
|
||||
int *interrupted UNUSED,
|
||||
int ignore_input UNUSED)
|
||||
{
|
||||
return gui_mch_wait_for_chars(wtime);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Returns OK if a character was found to be available within the given time,
|
||||
* or FAIL otherwise.
|
||||
@@ -2936,32 +2950,7 @@ gui_insert_lines(int row, int count)
|
||||
gui_wait_for_chars_or_timer(long wtime)
|
||||
{
|
||||
#ifdef FEAT_TIMERS
|
||||
int due_time;
|
||||
long remaining = wtime;
|
||||
int tb_change_cnt = typebuf.tb_change_cnt;
|
||||
|
||||
/* When waiting very briefly don't trigger timers. */
|
||||
if (wtime >= 0 && wtime < 10L)
|
||||
return gui_mch_wait_for_chars(wtime);
|
||||
|
||||
while (wtime < 0 || remaining > 0)
|
||||
{
|
||||
/* Trigger timers and then get the time in wtime until the next one is
|
||||
* due. Wait up to that time. */
|
||||
due_time = check_due_timer();
|
||||
if (typebuf.tb_change_cnt != tb_change_cnt)
|
||||
{
|
||||
/* timer may have used feedkeys() */
|
||||
return FAIL;
|
||||
}
|
||||
if (due_time <= 0 || (wtime > 0 && due_time > remaining))
|
||||
due_time = remaining;
|
||||
if (gui_mch_wait_for_chars(due_time))
|
||||
return OK;
|
||||
if (wtime > 0)
|
||||
remaining -= due_time;
|
||||
}
|
||||
return FAIL;
|
||||
return ui_wait_for_chars_or_timer(wtime, gui_wait_for_chars_3, NULL, 0);
|
||||
#else
|
||||
return gui_mch_wait_for_chars(wtime);
|
||||
#endif
|
||||
@@ -2976,10 +2965,12 @@ gui_wait_for_chars_or_timer(long wtime)
|
||||
* or FAIL otherwise.
|
||||
*/
|
||||
int
|
||||
gui_wait_for_chars(long wtime)
|
||||
gui_wait_for_chars(long wtime, int tb_change_cnt)
|
||||
{
|
||||
int retval;
|
||||
int tb_change_cnt = typebuf.tb_change_cnt;
|
||||
#if defined(ELAPSED_FUNC) && defined(FEAT_AUTOCMD)
|
||||
ELAPSED_TYPE start_tv;
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_MENU
|
||||
/*
|
||||
@@ -3009,6 +3000,10 @@ gui_wait_for_chars(long wtime)
|
||||
return retval;
|
||||
}
|
||||
|
||||
#if defined(ELAPSED_FUNC) && defined(FEAT_AUTOCMD)
|
||||
ELAPSED_INIT(start_tv);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* While we are waiting indefinitely for a character, blink the cursor.
|
||||
*/
|
||||
@@ -3017,13 +3012,17 @@ gui_wait_for_chars(long wtime)
|
||||
retval = FAIL;
|
||||
/*
|
||||
* We may want to trigger the CursorHold event. First wait for
|
||||
* 'updatetime' and if nothing is typed within that time put the
|
||||
* K_CURSORHOLD key in the input buffer.
|
||||
* 'updatetime' and if nothing is typed within that time, and feedkeys()
|
||||
* wasn't used, put the K_CURSORHOLD key in the input buffer.
|
||||
*/
|
||||
if (gui_wait_for_chars_or_timer(p_ut) == OK)
|
||||
retval = OK;
|
||||
#ifdef FEAT_AUTOCMD
|
||||
else if (trigger_cursorhold())
|
||||
else if (trigger_cursorhold()
|
||||
# ifdef ELAPSED_FUNC
|
||||
&& ELAPSED_FUNC(start_tv) >= p_ut
|
||||
# endif
|
||||
&& typebuf.tb_change_cnt == tb_change_cnt)
|
||||
{
|
||||
char_u buf[3];
|
||||
|
||||
@@ -3048,6 +3047,22 @@ gui_wait_for_chars(long wtime)
|
||||
return retval;
|
||||
}
|
||||
|
||||
/*
|
||||
* Equivalent of mch_inchar() for the GUI.
|
||||
*/
|
||||
int
|
||||
gui_inchar(
|
||||
char_u *buf,
|
||||
int maxlen,
|
||||
long wtime, /* milli seconds */
|
||||
int tb_change_cnt)
|
||||
{
|
||||
if (gui_wait_for_chars(wtime, tb_change_cnt)
|
||||
&& !typebuf_changed(tb_change_cnt))
|
||||
return read_from_input_buf(buf, (long)maxlen);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Fill p[4] with mouse coordinates encoded for check_termcode().
|
||||
*/
|
||||
|
||||
+16
-2
@@ -38,7 +38,11 @@
|
||||
# define _Outptr_
|
||||
#endif
|
||||
|
||||
#include <dwrite_2.h>
|
||||
#ifdef FEAT_DIRECTX_COLOR_EMOJI
|
||||
# include <dwrite_2.h>
|
||||
#else
|
||||
# include <dwrite.h>
|
||||
#endif
|
||||
|
||||
#include "gui_dwrite.h"
|
||||
|
||||
@@ -284,7 +288,9 @@ struct DWriteContext {
|
||||
ID2D1SolidColorBrush *mBrush;
|
||||
|
||||
IDWriteFactory *mDWriteFactory;
|
||||
#ifdef FEAT_DIRECTX_COLOR_EMOJI
|
||||
IDWriteFactory2 *mDWriteFactory2;
|
||||
#endif
|
||||
|
||||
IDWriteGdiInterop *mGdiInterop;
|
||||
IDWriteRenderingParams *mRenderingParams;
|
||||
@@ -481,6 +487,7 @@ public:
|
||||
AdjustedGlyphRun adjustedGlyphRun(glyphRun, context->cellWidth,
|
||||
context->offsetX);
|
||||
|
||||
#ifdef FEAT_DIRECTX_COLOR_EMOJI
|
||||
if (pDWC_->mDWriteFactory2 != NULL)
|
||||
{
|
||||
IDWriteColorGlyphRunEnumerator *enumerator = NULL;
|
||||
@@ -517,6 +524,7 @@ public:
|
||||
return S_OK;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// Draw by IDWriteFactory (without color emoji)
|
||||
pDWC_->mRT->DrawGlyphRun(
|
||||
@@ -589,7 +597,9 @@ DWriteContext::DWriteContext() :
|
||||
mGDIRT(NULL),
|
||||
mBrush(NULL),
|
||||
mDWriteFactory(NULL),
|
||||
#ifdef FEAT_DIRECTX_COLOR_EMOJI
|
||||
mDWriteFactory2(NULL),
|
||||
#endif
|
||||
mGdiInterop(NULL),
|
||||
mRenderingParams(NULL),
|
||||
mFontCache(8),
|
||||
@@ -618,6 +628,7 @@ DWriteContext::DWriteContext() :
|
||||
mDWriteFactory);
|
||||
}
|
||||
|
||||
#ifdef FEAT_DIRECTX_COLOR_EMOJI
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
DWriteCreateFactory(
|
||||
@@ -626,6 +637,7 @@ DWriteContext::DWriteContext() :
|
||||
reinterpret_cast<IUnknown**>(&mDWriteFactory2));
|
||||
_RPT1(_CRT_WARN, "IDWriteFactory2: %s\n", SUCCEEDED(hr) ? "available" : "not available");
|
||||
}
|
||||
#endif
|
||||
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
@@ -647,7 +659,9 @@ DWriteContext::~DWriteContext()
|
||||
SafeRelease(&mRenderingParams);
|
||||
SafeRelease(&mGdiInterop);
|
||||
SafeRelease(&mDWriteFactory);
|
||||
#ifdef FEAT_DIRECTX_COLOR_EMOJI
|
||||
SafeRelease(&mDWriteFactory2);
|
||||
#endif
|
||||
SafeRelease(&mBrush);
|
||||
SafeRelease(&mGDIRT);
|
||||
SafeRelease(&mRT);
|
||||
@@ -995,7 +1009,7 @@ DWriteContext::DrawText(const WCHAR *text, int len,
|
||||
|
||||
TextRenderer renderer(this);
|
||||
TextRendererContext context = { color, FLOAT(cellWidth), 0.0f };
|
||||
textLayout->Draw(&context, &renderer, FLOAT(x), FLOAT(y));
|
||||
textLayout->Draw(&context, &renderer, FLOAT(x), FLOAT(y) - 0.5f);
|
||||
}
|
||||
|
||||
SafeRelease(&textLayout);
|
||||
|
||||
+18
-14
@@ -30,11 +30,14 @@
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_DIRECTX)
|
||||
# ifndef FEAT_MBYTE
|
||||
# error FEAT_MBYTE is required for FEAT_DIRECTX.
|
||||
# endif
|
||||
static DWriteContext *s_dwc = NULL;
|
||||
static int s_directx_enabled = 0;
|
||||
static int s_directx_load_attempted = 0;
|
||||
static int s_directx_scrlines = 0;
|
||||
# define IS_ENABLE_DIRECTX() (s_directx_enabled && s_dwc != NULL)
|
||||
# define IS_ENABLE_DIRECTX() (s_directx_enabled && s_dwc != NULL && enc_utf8)
|
||||
static int directx_enabled(void);
|
||||
static void directx_binddc(void);
|
||||
#endif
|
||||
@@ -47,7 +50,7 @@ static int gui_mswin_get_menu_height(int fix_window);
|
||||
int
|
||||
gui_mch_set_rendering_options(char_u *s)
|
||||
{
|
||||
#ifdef FEAT_DIRECTX
|
||||
# ifdef FEAT_DIRECTX
|
||||
char_u *p, *q;
|
||||
|
||||
int dx_enable = 0;
|
||||
@@ -159,9 +162,9 @@ gui_mch_set_rendering_options(char_u *s)
|
||||
s_directx_scrlines = dx_scrlines;
|
||||
|
||||
return OK;
|
||||
#else
|
||||
# else
|
||||
return FAIL;
|
||||
#endif
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -3140,7 +3143,8 @@ gui_mch_delete_lines(
|
||||
{
|
||||
if (s_directx_scrlines > 0 && s_directx_scrlines <= num_lines)
|
||||
{
|
||||
RedrawWindow(s_textArea, &rc, NULL, RDW_INVALIDATE);
|
||||
gui_redraw(rc.left, rc.top,
|
||||
rc.right - rc.left + 1, rc.bottom - rc.top + 1);
|
||||
use_redraw = 1;
|
||||
}
|
||||
else
|
||||
@@ -3152,9 +3156,9 @@ gui_mch_delete_lines(
|
||||
intel_gpu_workaround();
|
||||
ScrollWindowEx(s_textArea, 0, -num_lines * gui.char_height,
|
||||
&rc, &rc, NULL, NULL, get_scroll_flags());
|
||||
UpdateWindow(s_textArea);
|
||||
}
|
||||
|
||||
UpdateWindow(s_textArea);
|
||||
/* This seems to be required to avoid the cursor disappearing when
|
||||
* scrolling such that the cursor ends up in the top-left character on
|
||||
* the screen... But why? (Webb) */
|
||||
@@ -3190,7 +3194,8 @@ gui_mch_insert_lines(
|
||||
{
|
||||
if (s_directx_scrlines > 0 && s_directx_scrlines <= num_lines)
|
||||
{
|
||||
RedrawWindow(s_textArea, &rc, NULL, RDW_INVALIDATE);
|
||||
gui_redraw(rc.left, rc.top,
|
||||
rc.right - rc.left + 1, rc.bottom - rc.top + 1);
|
||||
use_redraw = 1;
|
||||
}
|
||||
else
|
||||
@@ -3204,10 +3209,9 @@ gui_mch_insert_lines(
|
||||
* off-screen. How do we avoid it when it's not needed? */
|
||||
ScrollWindowEx(s_textArea, 0, num_lines * gui.char_height,
|
||||
&rc, &rc, NULL, NULL, get_scroll_flags());
|
||||
UpdateWindow(s_textArea);
|
||||
}
|
||||
|
||||
UpdateWindow(s_textArea);
|
||||
|
||||
gui_clear_block(row, gui.scroll_region_left,
|
||||
row + num_lines - 1, gui.scroll_region_right);
|
||||
}
|
||||
@@ -6401,13 +6405,13 @@ gui_mch_draw_string(
|
||||
if (text[n] >= 0x80)
|
||||
break;
|
||||
|
||||
#if defined(FEAT_DIRECTX)
|
||||
# if defined(FEAT_DIRECTX)
|
||||
/* Quick hack to enable DirectWrite. To use DirectWrite (antialias), it is
|
||||
* required that unicode drawing routine, currently. So this forces it
|
||||
* enabled. */
|
||||
if (enc_utf8 && IS_ENABLE_DIRECTX())
|
||||
if (IS_ENABLE_DIRECTX())
|
||||
n = 0; /* Keep n < len, to enter block for unicode. */
|
||||
#endif
|
||||
# endif
|
||||
|
||||
/* Check if the Unicode buffer exists and is big enough. Create it
|
||||
* with the same length as the multi-byte string, the number of wide
|
||||
@@ -6480,7 +6484,7 @@ gui_mch_draw_string(
|
||||
i += utf_ptr2len_len(text + i, len - i);
|
||||
++clen;
|
||||
}
|
||||
#if defined(FEAT_DIRECTX)
|
||||
# if defined(FEAT_DIRECTX)
|
||||
if (IS_ENABLE_DIRECTX())
|
||||
{
|
||||
/* Add one to "cells" for italics. */
|
||||
@@ -6490,7 +6494,7 @@ gui_mch_draw_string(
|
||||
foptions, pcliprect, unicodepdy);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
# endif
|
||||
ExtTextOutW(s_hdc, TEXT_X(col), TEXT_Y(row),
|
||||
foptions, pcliprect, unicodebuf, wlen, unicodepdy);
|
||||
len = cells; /* used for underlining */
|
||||
|
||||
+3
-3
@@ -92,7 +92,7 @@ write_string(garray_T *gap, char_u *str)
|
||||
char_u numbuf[NUMBUFLEN];
|
||||
|
||||
if (res == NULL)
|
||||
ga_concat(gap, (char_u *)"null");
|
||||
ga_concat(gap, (char_u *)"\"\"");
|
||||
else
|
||||
{
|
||||
#if defined(FEAT_MBYTE) && defined(USE_ICONV)
|
||||
@@ -237,7 +237,7 @@ json_encode_item(garray_T *gap, typval_T *val, int copyID, int options)
|
||||
case VAR_LIST:
|
||||
l = val->vval.v_list;
|
||||
if (l == NULL)
|
||||
ga_concat(gap, (char_u *)"null");
|
||||
ga_concat(gap, (char_u *)"[]");
|
||||
else
|
||||
{
|
||||
if (l->lv_copyID == copyID)
|
||||
@@ -272,7 +272,7 @@ json_encode_item(garray_T *gap, typval_T *val, int copyID, int options)
|
||||
case VAR_DICT:
|
||||
d = val->vval.v_dict;
|
||||
if (d == NULL)
|
||||
ga_concat(gap, (char_u *)"null");
|
||||
ga_concat(gap, (char_u *)"{}");
|
||||
else
|
||||
{
|
||||
if (d->dv_copyID == copyID)
|
||||
|
||||
+7
-2
@@ -642,7 +642,7 @@ vim_main2(void)
|
||||
# ifdef FEAT_SUN_WORKSHOP
|
||||
if (!usingSunWorkShop)
|
||||
# endif
|
||||
gui_wait_for_chars(50L);
|
||||
gui_wait_for_chars(50L, typebuf.tb_change_cnt);
|
||||
TIME_MSG("GUI delay");
|
||||
}
|
||||
#endif
|
||||
@@ -1507,9 +1507,14 @@ getout(int exitval)
|
||||
buf = wp->w_buffer;
|
||||
if (CHANGEDTICK(buf) != -1)
|
||||
{
|
||||
bufref_T bufref;
|
||||
|
||||
set_bufref(&bufref, buf);
|
||||
apply_autocmds(EVENT_BUFWINLEAVE, buf->b_fname,
|
||||
buf->b_fname, FALSE, buf);
|
||||
CHANGEDTICK(buf) = -1; /* note that we did it already */
|
||||
if (bufref_valid(&bufref))
|
||||
CHANGEDTICK(buf) = -1; /* note we did it already */
|
||||
|
||||
/* start all over, autocommands may mess up the lists */
|
||||
next_tp = first_tabpage;
|
||||
break;
|
||||
|
||||
+5
-1
@@ -2650,8 +2650,12 @@ del_lines(
|
||||
int
|
||||
gchar_pos(pos_T *pos)
|
||||
{
|
||||
char_u *ptr = ml_get_pos(pos);
|
||||
char_u *ptr;
|
||||
|
||||
/* When searching columns is sometimes put at the end of a line. */
|
||||
if (pos->col == MAXCOL)
|
||||
return NUL;
|
||||
ptr = ml_get_pos(pos);
|
||||
#ifdef FEAT_MBYTE
|
||||
if (has_mbyte)
|
||||
return (*mb_ptr2char)(ptr);
|
||||
|
||||
+36
-14
@@ -348,24 +348,29 @@ inc_cursor(void)
|
||||
int
|
||||
inc(pos_T *lp)
|
||||
{
|
||||
char_u *p = ml_get_pos(lp);
|
||||
char_u *p;
|
||||
|
||||
if (*p != NUL) /* still within line, move to next char (may be NUL) */
|
||||
/* when searching position may be set to end of a line */
|
||||
if (lp->col != MAXCOL)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
if (has_mbyte)
|
||||
p = ml_get_pos(lp);
|
||||
if (*p != NUL) /* still within line, move to next char (may be NUL) */
|
||||
{
|
||||
int l = (*mb_ptr2len)(p);
|
||||
#ifdef FEAT_MBYTE
|
||||
if (has_mbyte)
|
||||
{
|
||||
int l = (*mb_ptr2len)(p);
|
||||
|
||||
lp->col += l;
|
||||
return ((p[l] != NUL) ? 0 : 2);
|
||||
}
|
||||
lp->col += l;
|
||||
return ((p[l] != NUL) ? 0 : 2);
|
||||
}
|
||||
#endif
|
||||
lp->col++;
|
||||
lp->col++;
|
||||
#ifdef FEAT_VIRTUALEDIT
|
||||
lp->coladd = 0;
|
||||
lp->coladd = 0;
|
||||
#endif
|
||||
return ((p[1] != NUL) ? 0 : 2);
|
||||
return ((p[1] != NUL) ? 0 : 2);
|
||||
}
|
||||
}
|
||||
if (lp->lnum != curbuf->b_ml.ml_line_count) /* there is a next line */
|
||||
{
|
||||
@@ -412,8 +417,21 @@ dec(pos_T *lp)
|
||||
#ifdef FEAT_VIRTUALEDIT
|
||||
lp->coladd = 0;
|
||||
#endif
|
||||
if (lp->col > 0) /* still within line */
|
||||
if (lp->col == MAXCOL)
|
||||
{
|
||||
/* past end of line */
|
||||
p = ml_get(lp->lnum);
|
||||
lp->col = (colnr_T)STRLEN(p);
|
||||
#ifdef FEAT_MBYTE
|
||||
if (has_mbyte)
|
||||
lp->col -= (*mb_head_off)(p, p + lp->col);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (lp->col > 0)
|
||||
{
|
||||
/* still within line */
|
||||
lp->col--;
|
||||
#ifdef FEAT_MBYTE
|
||||
if (has_mbyte)
|
||||
@@ -424,8 +442,10 @@ dec(pos_T *lp)
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
if (lp->lnum > 1) /* there is a prior line */
|
||||
|
||||
if (lp->lnum > 1)
|
||||
{
|
||||
/* there is a prior line */
|
||||
lp->lnum--;
|
||||
p = ml_get(lp->lnum);
|
||||
lp->col = (colnr_T)STRLEN(p);
|
||||
@@ -435,7 +455,9 @@ dec(pos_T *lp)
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
return -1; /* at start of file */
|
||||
|
||||
/* at start of file */
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -6848,6 +6848,8 @@ nv_brackets(cmdarg_T *cap)
|
||||
clearopbeep(cap->oap);
|
||||
break;
|
||||
}
|
||||
else
|
||||
curwin->w_set_curswant = TRUE;
|
||||
# ifdef FEAT_FOLDING
|
||||
if (cap->oap->op_type == OP_NOP && (fdo_flags & FDO_SEARCH) && KeyTyped)
|
||||
foldOpenCursor();
|
||||
@@ -7884,8 +7886,12 @@ n_start_visual_mode(int c)
|
||||
nv_window(cmdarg_T *cap)
|
||||
{
|
||||
if (cap->nchar == ':')
|
||||
{
|
||||
/* "CTRL-W :" is the same as typing ":"; useful in a terminal window */
|
||||
cap->cmdchar = ':';
|
||||
cap->nchar = NUL;
|
||||
nv_colon(cap);
|
||||
}
|
||||
else if (!checkclearop(cap->oap))
|
||||
do_window(cap->nchar, cap->count0, NUL); /* everything is in window.c */
|
||||
}
|
||||
|
||||
@@ -183,8 +183,15 @@ get_op_type(int char1, int char2)
|
||||
if (char1 == 'g' && char2 == Ctrl_X) /* subtract */
|
||||
return OP_NR_SUB;
|
||||
for (i = 0; ; ++i)
|
||||
{
|
||||
if (opchars[i][0] == char1 && opchars[i][1] == char2)
|
||||
break;
|
||||
if (i == (int)(sizeof(opchars) / sizeof(char [3]) - 1))
|
||||
{
|
||||
internal_error("get_op_type()");
|
||||
break;
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
@@ -1645,6 +1652,65 @@ shift_delete_registers()
|
||||
y_regs[1].y_array = NULL; /* set register one to empty */
|
||||
}
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
static void
|
||||
yank_do_autocmd(oparg_T *oap, yankreg_T *reg)
|
||||
{
|
||||
static int recursive = FALSE;
|
||||
dict_T *v_event;
|
||||
list_T *list;
|
||||
int n;
|
||||
char_u buf[NUMBUFLEN + 2];
|
||||
long reglen = 0;
|
||||
|
||||
if (recursive)
|
||||
return;
|
||||
|
||||
v_event = get_vim_var_dict(VV_EVENT);
|
||||
|
||||
list = list_alloc();
|
||||
for (n = 0; n < reg->y_size; n++)
|
||||
list_append_string(list, reg->y_array[n], -1);
|
||||
list->lv_lock = VAR_FIXED;
|
||||
dict_add_list(v_event, "regcontents", list);
|
||||
|
||||
buf[0] = (char_u)oap->regname;
|
||||
buf[1] = NUL;
|
||||
dict_add_nr_str(v_event, "regname", 0, buf);
|
||||
|
||||
buf[0] = get_op_char(oap->op_type);
|
||||
buf[1] = get_extra_op_char(oap->op_type);
|
||||
buf[2] = NUL;
|
||||
dict_add_nr_str(v_event, "operator", 0, buf);
|
||||
|
||||
buf[0] = NUL;
|
||||
buf[1] = NUL;
|
||||
switch (get_reg_type(oap->regname, ®len))
|
||||
{
|
||||
case MLINE: buf[0] = 'V'; break;
|
||||
case MCHAR: buf[0] = 'v'; break;
|
||||
case MBLOCK:
|
||||
vim_snprintf((char *)buf, sizeof(buf), "%c%ld", Ctrl_V,
|
||||
reglen + 1);
|
||||
break;
|
||||
}
|
||||
dict_add_nr_str(v_event, "regtype", 0, buf);
|
||||
|
||||
/* Lock the dictionary and its keys */
|
||||
dict_set_items_ro(v_event);
|
||||
|
||||
recursive = TRUE;
|
||||
textlock++;
|
||||
apply_autocmds(EVENT_TEXTYANKPOST, NULL, NULL, FALSE, curbuf);
|
||||
textlock--;
|
||||
recursive = FALSE;
|
||||
|
||||
/* Empty the dictionary, v:event is still valid */
|
||||
dict_free_contents(v_event);
|
||||
hash_init(&v_event->dv_hashtab);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Handle a delete operation.
|
||||
*
|
||||
@@ -1798,6 +1864,11 @@ op_delete(oparg_T *oap)
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
if (did_yank && has_textyankpost())
|
||||
yank_do_autocmd(oap, y_current);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -3270,6 +3341,11 @@ op_yank(oparg_T *oap, int deleting, int mess)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
if (!deleting && has_textyankpost())
|
||||
yank_do_autocmd(oap, y_current);
|
||||
#endif
|
||||
|
||||
return OK;
|
||||
|
||||
fail: /* free the allocated lines */
|
||||
|
||||
+2
-30
@@ -5812,36 +5812,8 @@ mch_breakcheck(int force)
|
||||
WaitForChar(long msec, int *interrupted, int ignore_input)
|
||||
{
|
||||
#ifdef FEAT_TIMERS
|
||||
long due_time;
|
||||
long remaining = msec;
|
||||
int tb_change_cnt = typebuf.tb_change_cnt;
|
||||
|
||||
/* When waiting very briefly don't trigger timers. */
|
||||
if (msec >= 0 && msec < 10L)
|
||||
return WaitForCharOrMouse(msec, NULL, ignore_input);
|
||||
|
||||
while (msec < 0 || remaining > 0)
|
||||
{
|
||||
/* Trigger timers and then get the time in msec until the next one is
|
||||
* due. Wait up to that time. */
|
||||
due_time = check_due_timer();
|
||||
if (typebuf.tb_change_cnt != tb_change_cnt)
|
||||
{
|
||||
/* timer may have used feedkeys() */
|
||||
return FALSE;
|
||||
}
|
||||
if (due_time <= 0 || (msec > 0 && due_time > remaining))
|
||||
due_time = remaining;
|
||||
if (WaitForCharOrMouse(due_time, interrupted, ignore_input))
|
||||
return TRUE;
|
||||
if (interrupted != NULL && *interrupted)
|
||||
/* Nothing available, but need to return so that side effects get
|
||||
* handled, such as handling a message on a channel. */
|
||||
return FALSE;
|
||||
if (msec > 0)
|
||||
remaining -= due_time;
|
||||
}
|
||||
return FALSE;
|
||||
return ui_wait_for_chars_or_timer(
|
||||
msec, WaitForCharOrMouse, interrupted, ignore_input) == OK;
|
||||
#else
|
||||
return WaitForCharOrMouse(msec, interrupted, ignore_input);
|
||||
#endif
|
||||
|
||||
@@ -31,7 +31,6 @@ void channel_close(channel_T *channel, int invoke_close_cb);
|
||||
void channel_close_in(channel_T *channel);
|
||||
void channel_clear(channel_T *channel);
|
||||
void channel_free_all(void);
|
||||
char_u *channel_read_block(channel_T *channel, ch_part_T part, int timeout);
|
||||
void common_channel_read(typval_T *argvars, typval_T *rettv, int raw);
|
||||
void channel_may_read(channel_T *channel, ch_part_T part, char *func);
|
||||
channel_T *channel_fd2channel(sock_T fd, ch_part_T *partp);
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
/* dict.c */
|
||||
dict_T *dict_alloc(void);
|
||||
dict_T *dict_alloc_lock(int lock);
|
||||
int rettv_dict_alloc(typval_T *rettv);
|
||||
void rettv_dict_set(typval_T *rettv, dict_T *d);
|
||||
void dict_free_contents(dict_T *d);
|
||||
void dict_unref(dict_T *d);
|
||||
int dict_free_nonref(int copyID);
|
||||
void dict_free_items(int copyID);
|
||||
@@ -23,4 +25,5 @@ void dict_extend(dict_T *d1, dict_T *d2, char_u *action);
|
||||
dictitem_T *dict_lookup(hashitem_T *hi);
|
||||
int dict_equal(dict_T *d1, dict_T *d2, int ic, int recursive);
|
||||
void dict_list(typval_T *argvars, typval_T *rettv, int what);
|
||||
void dict_set_items_ro(dict_T *di);
|
||||
/* vim: set ft=c : */
|
||||
|
||||
@@ -64,6 +64,7 @@ void set_vim_var_nr(int idx, varnumber_T val);
|
||||
varnumber_T get_vim_var_nr(int idx);
|
||||
char_u *get_vim_var_str(int idx);
|
||||
list_T *get_vim_var_list(int idx);
|
||||
dict_T * get_vim_var_dict(int idx);
|
||||
void set_vim_var_char(int c);
|
||||
void set_vcount(long count, long count1, int set_prevcount);
|
||||
void set_vim_var_string(int idx, char_u *val, int len);
|
||||
|
||||
@@ -51,6 +51,7 @@ int has_textchangedI(void);
|
||||
int has_insertcharpre(void);
|
||||
int has_cmdundefined(void);
|
||||
int has_funcundefined(void);
|
||||
int has_textyankpost(void);
|
||||
void block_autocmds(void);
|
||||
void unblock_autocmds(void);
|
||||
int is_autocmd_blocked(void);
|
||||
|
||||
+2
-1
@@ -29,7 +29,8 @@ int gui_outstr_nowrap(char_u *s, int len, int flags, guicolor_T fg, guicolor_T b
|
||||
void gui_undraw_cursor(void);
|
||||
void gui_redraw(int x, int y, int w, int h);
|
||||
int gui_redraw_block(int row1, int col1, int row2, int col2, int flags);
|
||||
int gui_wait_for_chars(long wtime);
|
||||
int gui_wait_for_chars(long wtime, int tb_change_cnt);
|
||||
int gui_inchar(char_u *buf, int maxlen, long wtime, int tb_change_cnt);
|
||||
void gui_send_mouse_event(int button, int x, int y, int repeated_click, int_u modifiers);
|
||||
int gui_xy2colrow(int x, int y, int *colp);
|
||||
void gui_menu_cb(vimmenu_T *menu);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
void ui_write(char_u *s, int len);
|
||||
void ui_inchar_undo(char_u *s, int len);
|
||||
int ui_inchar(char_u *buf, int maxlen, long wtime, int tb_change_cnt);
|
||||
int ui_wait_for_chars_or_timer(long wtime, int (*wait_func)(long wtime, int *interrupted, int ignore_input), int *interrupted, int ignore_input);
|
||||
int ui_char_avail(void);
|
||||
void ui_delay(long msec, int ignoreinput);
|
||||
void ui_suspend(void);
|
||||
|
||||
@@ -25,6 +25,7 @@ void u_clearline(void);
|
||||
void u_undoline(void);
|
||||
void u_blockfree(buf_T *buf);
|
||||
int bufIsChanged(buf_T *buf);
|
||||
int bufIsChangedNotTerm(buf_T *buf);
|
||||
int curbufIsChanged(void);
|
||||
void u_eval_tree(u_header_T *first_uhp, list_T *list);
|
||||
/* vim: set ft=c : */
|
||||
|
||||
+245
-86
@@ -76,6 +76,7 @@ typedef struct qf_list_S
|
||||
int qf_multiline;
|
||||
int qf_multiignore;
|
||||
int qf_multiscan;
|
||||
long qf_changedtick;
|
||||
} qf_list_T;
|
||||
|
||||
/*
|
||||
@@ -143,6 +144,7 @@ static int qf_get_fnum(qf_info_T *qi, int qf_idx, char_u *, char_u *);
|
||||
static char_u *qf_push_dir(char_u *, struct dir_stack_T **, int is_file_stack);
|
||||
static char_u *qf_pop_dir(struct dir_stack_T **);
|
||||
static char_u *qf_guess_filepath(qf_info_T *qi, int qf_idx, char_u *);
|
||||
static int qflist_valid(win_T *wp, int_u qf_id);
|
||||
static void qf_fmt_text(char_u *text, char_u *buf, int bufsize);
|
||||
static void qf_clean_dir_stack(struct dir_stack_T **);
|
||||
static int qf_win_pos_update(qf_info_T *qi, int old_qf_index);
|
||||
@@ -176,6 +178,9 @@ static qf_info_T *ll_get_or_alloc_list(win_T *);
|
||||
static char_u *qf_last_bufname = NULL;
|
||||
static bufref_T qf_last_bufref = {NULL, 0, 0};
|
||||
|
||||
static char *e_loc_list_changed =
|
||||
N_("E926: Current location list was changed");
|
||||
|
||||
/*
|
||||
* Read the errorfile "efile" into memory, line by line, building the error
|
||||
* list. Set the error list's title to qf_title.
|
||||
@@ -1668,6 +1673,7 @@ copy_loclist(win_T *from, win_T *to)
|
||||
|
||||
/* Assign a new ID for the location list */
|
||||
to_qfl->qf_id = ++last_qf_id;
|
||||
to_qfl->qf_changedtick = 0L;
|
||||
|
||||
/* When no valid entries are present in the list, qf_ptr points to
|
||||
* the first item in the list */
|
||||
@@ -1925,6 +1931,29 @@ qf_guess_filepath(qf_info_T *qi, int qf_idx, char_u *filename)
|
||||
return ds_ptr==NULL? NULL: ds_ptr->dirname;
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns TRUE if a quickfix/location list with the given identifier exists.
|
||||
*/
|
||||
static int
|
||||
qflist_valid (win_T *wp, int_u qf_id)
|
||||
{
|
||||
qf_info_T *qi = &ql_info;
|
||||
int i;
|
||||
|
||||
if (wp != NULL)
|
||||
{
|
||||
qi = GET_LOC_LIST(wp); /* Location list */
|
||||
if (qi == NULL)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
for (i = 0; i < qi->qf_listcount; ++i)
|
||||
if (qi->qf_lists[i].qf_id == qf_id)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* When loading a file from the quickfix, the auto commands may modify it.
|
||||
* This may invalidate the current quickfix entry. This function checks
|
||||
@@ -2341,14 +2370,28 @@ qf_jump_edit_buffer(
|
||||
else
|
||||
{
|
||||
int old_qf_curlist = qi->qf_curlist;
|
||||
int save_qfid = qi->qf_lists[qi->qf_curlist].qf_id;
|
||||
|
||||
retval = buflist_getfile(qf_ptr->qf_fnum,
|
||||
(linenr_T)1, GETF_SETMARK | GETF_SWITCH, forceit);
|
||||
if (qi != &ql_info && !win_valid_any_tab(oldwin))
|
||||
|
||||
if (qi != &ql_info)
|
||||
{
|
||||
EMSG(_("E924: Current window was closed"));
|
||||
*abort = TRUE;
|
||||
*opened_window = FALSE;
|
||||
/*
|
||||
* Location list. Check whether the associated window is still
|
||||
* present and the list is still valid.
|
||||
*/
|
||||
if (!win_valid_any_tab(oldwin))
|
||||
{
|
||||
EMSG(_("E924: Current window was closed"));
|
||||
*abort = TRUE;
|
||||
*opened_window = FALSE;
|
||||
}
|
||||
else if (!qflist_valid(oldwin, save_qfid))
|
||||
{
|
||||
EMSG(_(e_loc_list_changed));
|
||||
*abort = TRUE;
|
||||
}
|
||||
}
|
||||
else if (old_qf_curlist != qi->qf_curlist
|
||||
|| !is_qf_entry_present(qi, qf_ptr))
|
||||
@@ -2356,7 +2399,7 @@ qf_jump_edit_buffer(
|
||||
if (qi == &ql_info)
|
||||
EMSG(_("E925: Current quickfix was changed"));
|
||||
else
|
||||
EMSG(_("E926: Current location list was changed"));
|
||||
EMSG(_(e_loc_list_changed));
|
||||
*abort = TRUE;
|
||||
}
|
||||
|
||||
@@ -2965,6 +3008,7 @@ qf_free(qf_info_T *qi, int idx)
|
||||
free_tv(qfl->qf_ctx);
|
||||
qfl->qf_ctx = NULL;
|
||||
qfl->qf_id = 0;
|
||||
qfl->qf_changedtick = 0L;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -3604,6 +3648,12 @@ qf_fill_buffer(qf_info_T *qi, buf_T *buf, qfline_T *old_last)
|
||||
KeyTyped = old_KeyTyped;
|
||||
}
|
||||
|
||||
static void
|
||||
qf_list_changed(qf_info_T *qi, int qf_idx)
|
||||
{
|
||||
qi->qf_lists[qf_idx].qf_changedtick++;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE when using ":vimgrep" for ":grep".
|
||||
*/
|
||||
@@ -3713,6 +3763,8 @@ ex_make(exarg_T *eap)
|
||||
*eap->cmdlinep, enc);
|
||||
if (wp != NULL)
|
||||
qi = GET_LOC_LIST(wp);
|
||||
if (res >= 0 && qi != NULL)
|
||||
qf_list_changed(qi, qi->qf_curlist);
|
||||
#ifdef FEAT_AUTOCMD
|
||||
if (au_name != NULL)
|
||||
{
|
||||
@@ -4054,13 +4106,10 @@ ex_cfile(exarg_T *eap)
|
||||
qf_info_T *qi = &ql_info;
|
||||
#ifdef FEAT_AUTOCMD
|
||||
char_u *au_name = NULL;
|
||||
int save_qfid;
|
||||
#endif
|
||||
int res;
|
||||
|
||||
if (eap->cmdidx == CMD_lfile || eap->cmdidx == CMD_lgetfile
|
||||
|| eap->cmdidx == CMD_laddfile)
|
||||
wp = curwin;
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
switch (eap->cmdidx)
|
||||
{
|
||||
@@ -4093,6 +4142,11 @@ ex_cfile(exarg_T *eap)
|
||||
if (*eap->arg != NUL)
|
||||
set_string_option_direct((char_u *)"ef", -1, eap->arg, OPT_FREE, 0);
|
||||
|
||||
if (eap->cmdidx == CMD_lfile
|
||||
|| eap->cmdidx == CMD_lgetfile
|
||||
|| eap->cmdidx == CMD_laddfile)
|
||||
wp = curwin;
|
||||
|
||||
/*
|
||||
* This function is used by the :cfile, :cgetfile and :caddfile
|
||||
* commands.
|
||||
@@ -4105,14 +4159,23 @@ ex_cfile(exarg_T *eap)
|
||||
*/
|
||||
res = qf_init(wp, p_ef, p_efm, (eap->cmdidx != CMD_caddfile
|
||||
&& eap->cmdidx != CMD_laddfile), *eap->cmdlinep, enc);
|
||||
if (wp != NULL)
|
||||
qi = GET_LOC_LIST(wp);
|
||||
if (res >= 0 && qi != NULL)
|
||||
qf_list_changed(qi, qi->qf_curlist);
|
||||
#ifdef FEAT_AUTOCMD
|
||||
save_qfid = qi->qf_lists[qi->qf_curlist].qf_id;
|
||||
if (au_name != NULL)
|
||||
apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name, NULL, FALSE, curbuf);
|
||||
/*
|
||||
* Autocmd might have freed the quickfix/location list. Check whether it is
|
||||
* still valid
|
||||
*/
|
||||
if (!qflist_valid(wp, save_qfid))
|
||||
return;
|
||||
#endif
|
||||
if (res > 0 && (eap->cmdidx == CMD_cfile || eap->cmdidx == CMD_lfile))
|
||||
{
|
||||
if (wp != NULL)
|
||||
qi = GET_LOC_LIST(wp);
|
||||
qf_jump(qi, 0, 0, eap->forceit); /* display first error */
|
||||
}
|
||||
}
|
||||
@@ -4135,8 +4198,11 @@ ex_vimgrep(exarg_T *eap)
|
||||
char_u *p;
|
||||
int fi;
|
||||
qf_info_T *qi = &ql_info;
|
||||
int loclist_cmd = FALSE;
|
||||
#ifdef FEAT_AUTOCMD
|
||||
int_u save_qfid;
|
||||
qfline_T *cur_qf_start;
|
||||
win_T *wp;
|
||||
#endif
|
||||
long lnum;
|
||||
buf_T *buf;
|
||||
@@ -4190,6 +4256,7 @@ ex_vimgrep(exarg_T *eap)
|
||||
qi = ll_get_or_alloc_list(curwin);
|
||||
if (qi == NULL)
|
||||
return;
|
||||
loclist_cmd = TRUE;
|
||||
}
|
||||
|
||||
if (eap->addr_count > 0)
|
||||
@@ -4260,8 +4327,9 @@ ex_vimgrep(exarg_T *eap)
|
||||
mch_dirname(dirname_start, MAXPATHL);
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
/* Remember the value of qf_start, so that we can check for autocommands
|
||||
* changing the current quickfix list. */
|
||||
/* Remember the current values of the quickfix list and qf_start, so that
|
||||
* we can check for autocommands changing the current quickfix list. */
|
||||
save_qfid = qi->qf_lists[qi->qf_curlist].qf_id;
|
||||
cur_qf_start = qi->qf_lists[qi->qf_curlist].qf_start;
|
||||
#endif
|
||||
|
||||
@@ -4321,6 +4389,18 @@ ex_vimgrep(exarg_T *eap)
|
||||
using_dummy = FALSE;
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
if (loclist_cmd)
|
||||
{
|
||||
/*
|
||||
* Verify that the location list is still valid. An autocmd might
|
||||
* have freed the location list.
|
||||
*/
|
||||
if (!qflist_valid(curwin, save_qfid))
|
||||
{
|
||||
EMSG(_(e_loc_list_changed));
|
||||
goto theend;
|
||||
}
|
||||
}
|
||||
if (cur_qf_start != qi->qf_lists[qi->qf_curlist].qf_start)
|
||||
{
|
||||
int idx;
|
||||
@@ -4469,6 +4549,7 @@ ex_vimgrep(exarg_T *eap)
|
||||
qi->qf_lists[qi->qf_curlist].qf_nonevalid = FALSE;
|
||||
qi->qf_lists[qi->qf_curlist].qf_ptr = qi->qf_lists[qi->qf_curlist].qf_start;
|
||||
qi->qf_lists[qi->qf_curlist].qf_index = 1;
|
||||
qf_list_changed(qi, qi->qf_curlist);
|
||||
|
||||
qf_update_buffer(qi, NULL);
|
||||
|
||||
@@ -4476,6 +4557,13 @@ ex_vimgrep(exarg_T *eap)
|
||||
if (au_name != NULL)
|
||||
apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name,
|
||||
curbuf->b_fname, TRUE, curbuf);
|
||||
/*
|
||||
* The QuickFixCmdPost autocmd may free the quickfix list. Check the list
|
||||
* is still valid.
|
||||
*/
|
||||
wp = loclist_cmd ? curwin : NULL;
|
||||
if (!qflist_valid(wp, save_qfid))
|
||||
goto theend;
|
||||
#endif
|
||||
|
||||
/* Jump to first match. */
|
||||
@@ -4572,6 +4660,7 @@ load_dummy_buffer(
|
||||
bufref_T newbuf_to_wipe;
|
||||
int failed = TRUE;
|
||||
aco_save_T aco;
|
||||
int readfile_result;
|
||||
|
||||
/* Allocate a buffer without putting it in the buffer list. */
|
||||
newbuf = buflist_new(NULL, NULL, (linenr_T)1, BLN_DUMMY);
|
||||
@@ -4585,6 +4674,9 @@ load_dummy_buffer(
|
||||
/* need to open the memfile before putting the buffer in a window */
|
||||
if (ml_open(newbuf) == OK)
|
||||
{
|
||||
/* Make sure this buffer isn't wiped out by auto commands. */
|
||||
++newbuf->b_locked;
|
||||
|
||||
/* set curwin/curbuf to buf and save a few things */
|
||||
aucmd_prepbuf(&aco, newbuf);
|
||||
|
||||
@@ -4599,9 +4691,11 @@ load_dummy_buffer(
|
||||
curbuf->b_flags &= ~BF_DUMMY;
|
||||
|
||||
newbuf_to_wipe.br_buf = NULL;
|
||||
if (readfile(fname, NULL,
|
||||
readfile_result = readfile(fname, NULL,
|
||||
(linenr_T)0, (linenr_T)0, (linenr_T)MAXLNUM,
|
||||
NULL, READ_NEW | READ_DUMMY) == OK
|
||||
NULL, READ_NEW | READ_DUMMY);
|
||||
--newbuf->b_locked;
|
||||
if (readfile_result == OK
|
||||
&& !got_int
|
||||
&& !(curbuf->b_flags & BF_NEW))
|
||||
{
|
||||
@@ -4774,7 +4868,8 @@ enum {
|
||||
QF_GETLIST_ID = 0x20,
|
||||
QF_GETLIST_IDX = 0x40,
|
||||
QF_GETLIST_SIZE = 0x80,
|
||||
QF_GETLIST_ALL = 0xFF
|
||||
QF_GETLIST_TICK = 0x100,
|
||||
QF_GETLIST_ALL = 0x1FF
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -4863,70 +4958,24 @@ qf_get_properties(win_T *wp, dict_T *what, dict_T *retdict)
|
||||
if (wp != NULL)
|
||||
qi = GET_LOC_LIST(wp);
|
||||
|
||||
/* List is not present or is empty */
|
||||
if (qi == NULL || qi->qf_listcount == 0)
|
||||
{
|
||||
/* If querying for the size of the list, return 0 */
|
||||
if (((di = dict_find(what, (char_u *)"nr", -1)) != NULL)
|
||||
&& (di->di_tv.v_type == VAR_STRING)
|
||||
&& (STRCMP(di->di_tv.vval.v_string, "$") == 0))
|
||||
return dict_add_nr_str(retdict, "nr", 0, NULL);
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
qf_idx = qi->qf_curlist; /* default is the current list */
|
||||
if ((di = dict_find(what, (char_u *)"nr", -1)) != NULL)
|
||||
{
|
||||
/* Use the specified quickfix/location list */
|
||||
if (di->di_tv.v_type == VAR_NUMBER)
|
||||
{
|
||||
/* for zero use the current list */
|
||||
if (di->di_tv.vval.v_number != 0)
|
||||
{
|
||||
qf_idx = di->di_tv.vval.v_number - 1;
|
||||
if (qf_idx < 0 || qf_idx >= qi->qf_listcount)
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
else if ((di->di_tv.v_type == VAR_STRING)
|
||||
&& (STRCMP(di->di_tv.vval.v_string, "$") == 0))
|
||||
/* Get the last quickfix list number */
|
||||
qf_idx = qi->qf_listcount - 1;
|
||||
else
|
||||
return FAIL;
|
||||
flags |= QF_GETLIST_NR;
|
||||
}
|
||||
|
||||
if ((di = dict_find(what, (char_u *)"id", -1)) != NULL)
|
||||
{
|
||||
/* Look for a list with the specified id */
|
||||
if (di->di_tv.v_type == VAR_NUMBER)
|
||||
{
|
||||
/* For zero, use the current list or the list specifed by 'nr' */
|
||||
if (di->di_tv.vval.v_number != 0)
|
||||
{
|
||||
qf_idx = qf_id2nr(qi, di->di_tv.vval.v_number);
|
||||
if (qf_idx == -1)
|
||||
return FAIL; /* List not found */
|
||||
}
|
||||
flags |= QF_GETLIST_ID;
|
||||
}
|
||||
else
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
if (dict_find(what, (char_u *)"all", -1) != NULL)
|
||||
flags |= QF_GETLIST_ALL;
|
||||
|
||||
if (dict_find(what, (char_u *)"title", -1) != NULL)
|
||||
flags |= QF_GETLIST_TITLE;
|
||||
|
||||
if (dict_find(what, (char_u *)"nr", -1) != NULL)
|
||||
flags |= QF_GETLIST_NR;
|
||||
|
||||
if (dict_find(what, (char_u *)"winid", -1) != NULL)
|
||||
flags |= QF_GETLIST_WINID;
|
||||
|
||||
if (dict_find(what, (char_u *)"context", -1) != NULL)
|
||||
flags |= QF_GETLIST_CONTEXT;
|
||||
|
||||
if (dict_find(what, (char_u *)"id", -1) != NULL)
|
||||
flags |= QF_GETLIST_ID;
|
||||
|
||||
if (dict_find(what, (char_u *)"items", -1) != NULL)
|
||||
flags |= QF_GETLIST_ITEMS;
|
||||
|
||||
@@ -4936,6 +4985,83 @@ qf_get_properties(win_T *wp, dict_T *what, dict_T *retdict)
|
||||
if (dict_find(what, (char_u *)"size", -1) != NULL)
|
||||
flags |= QF_GETLIST_SIZE;
|
||||
|
||||
if (dict_find(what, (char_u *)"changedtick", -1) != NULL)
|
||||
flags |= QF_GETLIST_TICK;
|
||||
|
||||
if (qi != NULL && qi->qf_listcount != 0)
|
||||
{
|
||||
qf_idx = qi->qf_curlist; /* default is the current list */
|
||||
if ((di = dict_find(what, (char_u *)"nr", -1)) != NULL)
|
||||
{
|
||||
/* Use the specified quickfix/location list */
|
||||
if (di->di_tv.v_type == VAR_NUMBER)
|
||||
{
|
||||
/* for zero use the current list */
|
||||
if (di->di_tv.vval.v_number != 0)
|
||||
{
|
||||
qf_idx = di->di_tv.vval.v_number - 1;
|
||||
if (qf_idx < 0 || qf_idx >= qi->qf_listcount)
|
||||
qf_idx = -1;
|
||||
}
|
||||
}
|
||||
else if (di->di_tv.v_type == VAR_STRING
|
||||
&& di->di_tv.vval.v_string != NULL
|
||||
&& STRCMP(di->di_tv.vval.v_string, "$") == 0)
|
||||
/* Get the last quickfix list number */
|
||||
qf_idx = qi->qf_listcount - 1;
|
||||
else
|
||||
qf_idx = -1;
|
||||
flags |= QF_GETLIST_NR;
|
||||
}
|
||||
|
||||
if ((di = dict_find(what, (char_u *)"id", -1)) != NULL)
|
||||
{
|
||||
/* Look for a list with the specified id */
|
||||
if (di->di_tv.v_type == VAR_NUMBER)
|
||||
{
|
||||
/*
|
||||
* For zero, use the current list or the list specifed by 'nr'
|
||||
*/
|
||||
if (di->di_tv.vval.v_number != 0)
|
||||
qf_idx = qf_id2nr(qi, di->di_tv.vval.v_number);
|
||||
flags |= QF_GETLIST_ID;
|
||||
}
|
||||
else
|
||||
qf_idx = -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* List is not present or is empty */
|
||||
if (qi == NULL || qi->qf_listcount == 0 || qf_idx == -1)
|
||||
{
|
||||
if (flags & QF_GETLIST_TITLE)
|
||||
status = dict_add_nr_str(retdict, "title", 0L, (char_u *)"");
|
||||
if ((status == OK) && (flags & QF_GETLIST_ITEMS))
|
||||
{
|
||||
list_T *l = list_alloc();
|
||||
if (l != NULL)
|
||||
status = dict_add_list(retdict, "items", l);
|
||||
else
|
||||
status = FAIL;
|
||||
}
|
||||
if ((status == OK) && (flags & QF_GETLIST_NR))
|
||||
status = dict_add_nr_str(retdict, "nr", 0L, NULL);
|
||||
if ((status == OK) && (flags & QF_GETLIST_WINID))
|
||||
status = dict_add_nr_str(retdict, "winid", 0L, NULL);
|
||||
if ((status == OK) && (flags & QF_GETLIST_CONTEXT))
|
||||
status = dict_add_nr_str(retdict, "context", 0L, (char_u *)"");
|
||||
if ((status == OK) && (flags & QF_GETLIST_ID))
|
||||
status = dict_add_nr_str(retdict, "id", 0L, NULL);
|
||||
if ((status == OK) && (flags & QF_GETLIST_IDX))
|
||||
status = dict_add_nr_str(retdict, "idx", 0L, NULL);
|
||||
if ((status == OK) && (flags & QF_GETLIST_SIZE))
|
||||
status = dict_add_nr_str(retdict, "size", 0L, NULL);
|
||||
if ((status == OK) && (flags & QF_GETLIST_TICK))
|
||||
status = dict_add_nr_str(retdict, "changedtick", 0L, NULL);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
if (flags & QF_GETLIST_TITLE)
|
||||
{
|
||||
char_u *t;
|
||||
@@ -4949,9 +5075,12 @@ qf_get_properties(win_T *wp, dict_T *what, dict_T *retdict)
|
||||
if ((status == OK) && (flags & QF_GETLIST_WINID))
|
||||
{
|
||||
win_T *win;
|
||||
int win_id = 0;
|
||||
|
||||
win = qf_find_win(qi);
|
||||
if (win != NULL)
|
||||
status = dict_add_nr_str(retdict, "winid", win->w_id, NULL);
|
||||
win_id = win->w_id;
|
||||
status = dict_add_nr_str(retdict, "winid", win_id, NULL);
|
||||
}
|
||||
if ((status == OK) && (flags & QF_GETLIST_ITEMS))
|
||||
{
|
||||
@@ -5001,6 +5130,10 @@ qf_get_properties(win_T *wp, dict_T *what, dict_T *retdict)
|
||||
status = dict_add_nr_str(retdict, "size",
|
||||
qi->qf_lists[qf_idx].qf_count, NULL);
|
||||
|
||||
if ((status == OK) && (flags & QF_GETLIST_TICK))
|
||||
status = dict_add_nr_str(retdict, "changedtick",
|
||||
qi->qf_lists[qf_idx].qf_changedtick, NULL);
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -5168,7 +5301,8 @@ qf_set_properties(qf_info_T *qi, dict_T *what, int action, char_u *title)
|
||||
newlist = FALSE; /* use the specified list */
|
||||
}
|
||||
else if (di->di_tv.v_type == VAR_STRING
|
||||
&& STRCMP(di->di_tv.vval.v_string, "$") == 0)
|
||||
&& di->di_tv.vval.v_string != NULL
|
||||
&& STRCMP(di->di_tv.vval.v_string, "$") == 0)
|
||||
{
|
||||
if (qi->qf_listcount > 0)
|
||||
qf_idx = qi->qf_listcount - 1;
|
||||
@@ -5270,6 +5404,9 @@ qf_set_properties(qf_info_T *qi, dict_T *what, int action, char_u *title)
|
||||
retval = OK;
|
||||
}
|
||||
|
||||
if (retval == OK)
|
||||
qf_list_changed(qi, qf_idx);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -5373,7 +5510,11 @@ set_errorlist(
|
||||
else if (what != NULL)
|
||||
retval = qf_set_properties(qi, what, action, title);
|
||||
else
|
||||
{
|
||||
retval = qf_add_entries(qi, qi->qf_curlist, list, title, action);
|
||||
if (retval == OK)
|
||||
qf_list_changed(qi, qi->qf_curlist);
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
@@ -5419,6 +5560,16 @@ set_ref_in_quickfix(int copyID)
|
||||
if (abort)
|
||||
return abort;
|
||||
}
|
||||
if (IS_LL_WINDOW(win) && (win->w_llist_ref->qf_refcount == 1))
|
||||
{
|
||||
/* In a location list window and none of the other windows is
|
||||
* referring to this location list. Mark the location list
|
||||
* context as still in use.
|
||||
*/
|
||||
abort = mark_quickfix_ctx(win->w_llist_ref, copyID);
|
||||
if (abort)
|
||||
return abort;
|
||||
}
|
||||
}
|
||||
|
||||
return abort;
|
||||
@@ -5443,14 +5594,6 @@ ex_cbuffer(exarg_T *eap)
|
||||
#endif
|
||||
int res;
|
||||
|
||||
if (eap->cmdidx == CMD_lbuffer || eap->cmdidx == CMD_lgetbuffer
|
||||
|| eap->cmdidx == CMD_laddbuffer)
|
||||
{
|
||||
qi = ll_get_or_alloc_list(curwin);
|
||||
if (qi == NULL)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
switch (eap->cmdidx)
|
||||
{
|
||||
@@ -5472,6 +5615,16 @@ ex_cbuffer(exarg_T *eap)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Must come after autocommands. */
|
||||
if (eap->cmdidx == CMD_lbuffer
|
||||
|| eap->cmdidx == CMD_lgetbuffer
|
||||
|| eap->cmdidx == CMD_laddbuffer)
|
||||
{
|
||||
qi = ll_get_or_alloc_list(curwin);
|
||||
if (qi == NULL)
|
||||
return;
|
||||
}
|
||||
|
||||
if (*eap->arg == NUL)
|
||||
buf = curbuf;
|
||||
else if (*skipwhite(skipdigits(eap->arg)) == NUL)
|
||||
@@ -5506,6 +5659,8 @@ ex_cbuffer(exarg_T *eap)
|
||||
&& eap->cmdidx != CMD_laddbuffer),
|
||||
eap->line1, eap->line2,
|
||||
qf_title, NULL);
|
||||
if (res >= 0)
|
||||
qf_list_changed(qi, qi->qf_curlist);
|
||||
#ifdef FEAT_AUTOCMD
|
||||
if (au_name != NULL)
|
||||
apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name,
|
||||
@@ -5533,14 +5688,6 @@ ex_cexpr(exarg_T *eap)
|
||||
#endif
|
||||
int res;
|
||||
|
||||
if (eap->cmdidx == CMD_lexpr || eap->cmdidx == CMD_lgetexpr
|
||||
|| eap->cmdidx == CMD_laddexpr)
|
||||
{
|
||||
qi = ll_get_or_alloc_list(curwin);
|
||||
if (qi == NULL)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
switch (eap->cmdidx)
|
||||
{
|
||||
@@ -5562,6 +5709,15 @@ ex_cexpr(exarg_T *eap)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (eap->cmdidx == CMD_lexpr
|
||||
|| eap->cmdidx == CMD_lgetexpr
|
||||
|| eap->cmdidx == CMD_laddexpr)
|
||||
{
|
||||
qi = ll_get_or_alloc_list(curwin);
|
||||
if (qi == NULL)
|
||||
return;
|
||||
}
|
||||
|
||||
/* Evaluate the expression. When the result is a string or a list we can
|
||||
* use it to fill the errorlist. */
|
||||
tv = eval_expr(eap->arg, NULL);
|
||||
@@ -5575,6 +5731,8 @@ ex_cexpr(exarg_T *eap)
|
||||
&& eap->cmdidx != CMD_laddexpr),
|
||||
(linenr_T)0, (linenr_T)0, *eap->cmdlinep,
|
||||
NULL);
|
||||
if (res >= 0)
|
||||
qf_list_changed(qi, qi->qf_curlist);
|
||||
#ifdef FEAT_AUTOCMD
|
||||
if (au_name != NULL)
|
||||
apply_autocmds(EVENT_QUICKFIXCMDPOST, au_name,
|
||||
@@ -5795,6 +5953,7 @@ ex_helpgrep(exarg_T *eap)
|
||||
/* Darn, some plugin changed the value. */
|
||||
free_string_option(save_cpo);
|
||||
|
||||
qf_list_changed(qi, qi->qf_curlist);
|
||||
qf_update_buffer(qi, NULL);
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
|
||||
+4
-4
@@ -2321,7 +2321,6 @@ nfa_regconcat(void)
|
||||
static int
|
||||
nfa_regbranch(void)
|
||||
{
|
||||
int ch;
|
||||
int old_post_pos;
|
||||
|
||||
old_post_pos = (int)(post_ptr - post_start);
|
||||
@@ -2330,11 +2329,13 @@ nfa_regbranch(void)
|
||||
if (nfa_regconcat() == FAIL)
|
||||
return FAIL;
|
||||
|
||||
ch = peekchr();
|
||||
/* Try next concats */
|
||||
while (ch == Magic('&'))
|
||||
while (peekchr() == Magic('&'))
|
||||
{
|
||||
skipchr();
|
||||
/* if concat is empty do emit a node */
|
||||
if (old_post_pos == (int)(post_ptr - post_start))
|
||||
EMIT(NFA_EMPTY);
|
||||
EMIT(NFA_NOPEN);
|
||||
EMIT(NFA_PREV_ATOM_NO_WIDTH);
|
||||
old_post_pos = (int)(post_ptr - post_start);
|
||||
@@ -2344,7 +2345,6 @@ nfa_regbranch(void)
|
||||
if (old_post_pos == (int)(post_ptr - post_start))
|
||||
EMIT(NFA_EMPTY);
|
||||
EMIT(NFA_CONCAT);
|
||||
ch = peekchr();
|
||||
}
|
||||
|
||||
/* if a branch is empty, emit one node for it */
|
||||
|
||||
+19
-5
@@ -8329,15 +8329,29 @@ screen_char(unsigned off, int row, int col)
|
||||
{
|
||||
char_u buf[MB_MAXBYTES + 1];
|
||||
|
||||
/* Convert UTF-8 character to bytes and write it. */
|
||||
|
||||
buf[utfc_char2bytes(off, buf)] = NUL;
|
||||
|
||||
out_str(buf);
|
||||
if (utf_ambiguous_width(ScreenLinesUC[off]))
|
||||
{
|
||||
if (*p_ambw == 'd'
|
||||
# ifdef FEAT_GUI
|
||||
&& !gui.in_use
|
||||
# endif
|
||||
)
|
||||
{
|
||||
/* Clear the two screen cells. If the character is actually
|
||||
* single width it won't change the second cell. */
|
||||
out_str((char_u *)" ");
|
||||
term_windgoto(row, col);
|
||||
}
|
||||
/* not sure where the cursor is after drawing the ambiguous width
|
||||
* character */
|
||||
screen_cur_col = 9999;
|
||||
}
|
||||
else if (utf_char2cells(ScreenLinesUC[off]) > 1)
|
||||
++screen_cur_col;
|
||||
|
||||
/* Convert the UTF-8 character to bytes and write it. */
|
||||
buf[utfc_char2bytes(off, buf)] = NUL;
|
||||
out_str(buf);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
||||
@@ -1130,7 +1130,7 @@ do_tags(exarg_T *eap UNUSED)
|
||||
continue;
|
||||
|
||||
msg_putchar('\n');
|
||||
sprintf((char *)IObuff, "%c%2d %2d %-15s %5ld ",
|
||||
vim_snprintf((char *)IObuff, IOSIZE, "%c%2d %2d %-15s %5ld ",
|
||||
i == tagstackidx ? '>' : ' ',
|
||||
i + 1,
|
||||
tagstack[i].cur_match + 1,
|
||||
|
||||
+5
-2
@@ -3516,6 +3516,9 @@ may_req_ambiguous_char_width(void)
|
||||
out_str((char_u *)" ");
|
||||
term_windgoto(0, 0);
|
||||
|
||||
/* Need to reset the known cursor position. */
|
||||
screen_start();
|
||||
|
||||
/* check for the characters now, otherwise they might be eaten by
|
||||
* get_keystroke() */
|
||||
out_flush();
|
||||
@@ -4591,7 +4594,7 @@ check_termcode(
|
||||
is_mac_terminal = TRUE;
|
||||
}
|
||||
# ifdef FEAT_MOUSE_SGR
|
||||
/* Iterm2 sends 0;95;0 */
|
||||
/* iTerm2 sends 0;95;0 */
|
||||
if (STRNCMP(tp + extra - 2, "0;95;0c", 7) == 0)
|
||||
is_iterm2 = TRUE;
|
||||
# endif
|
||||
@@ -4603,7 +4606,7 @@ check_termcode(
|
||||
{
|
||||
# ifdef FEAT_MOUSE_SGR
|
||||
/* Xterm version 277 supports SGR. Also support
|
||||
* Terminal.app and iterm2. */
|
||||
* Terminal.app and iTerm2. */
|
||||
if (version >= 277 || is_iterm2 || is_mac_terminal)
|
||||
set_option_value((char_u *)"ttym", 0L,
|
||||
(char_u *)"sgr", 0);
|
||||
|
||||
@@ -31,8 +31,7 @@ SCRIPTS_ALL = \
|
||||
test95.out \
|
||||
test99.out \
|
||||
test108.out \
|
||||
test_eval.out \
|
||||
test_wordcount.out
|
||||
test_eval.out
|
||||
|
||||
|
||||
# Tests that run on most systems, but not on Amiga.
|
||||
@@ -73,6 +72,7 @@ NEW_TESTS = test_arabic.res \
|
||||
test_assert.res \
|
||||
test_autochdir.res \
|
||||
test_autocmd.res \
|
||||
test_autoload.res \
|
||||
test_backspace_opt.res \
|
||||
test_breakindent.res \
|
||||
test_bufwintabinfo.res \
|
||||
@@ -182,6 +182,7 @@ NEW_TESTS = test_arabic.res \
|
||||
test_winbuf_close.res \
|
||||
test_window_id.res \
|
||||
test_windows_home.res \
|
||||
test_wordcount.res \
|
||||
test_writefile.res \
|
||||
test_alot_latin.res \
|
||||
test_alot_utf8.res \
|
||||
|
||||
@@ -63,7 +63,7 @@ win32: fixff nolog $(SCRIPTS_FIRST) $(SCRIPTS) $(SCRIPTS_WIN32) newtests
|
||||
fixff:
|
||||
-$(VIMPROG) -u dos.vim $(NO_INITS) "+argdo set ff=dos|upd" +q *.in *.ok
|
||||
-$(VIMPROG) -u dos.vim $(NO_INITS) "+argdo set ff=unix|upd" +q \
|
||||
dotest.in test_wordcount.ok
|
||||
dotest.in
|
||||
|
||||
clean:
|
||||
-@if exist *.out $(DEL) *.out
|
||||
|
||||
@@ -81,13 +81,7 @@ SCRIPT = test1.out test3.out \
|
||||
test64.out test69.out \
|
||||
test72.out test77a.out test88.out \
|
||||
test94.out test95.out test99.out test108.out \
|
||||
test_autocmd_option.out \
|
||||
test_breakindent.out \
|
||||
test_eval.out \
|
||||
test_listlbr.out \
|
||||
test_listlbr_utf8.out \
|
||||
test_utf8.out \
|
||||
test_wordcount.out
|
||||
test_eval.out
|
||||
|
||||
# Known problems:
|
||||
# test17: ?
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
let g:loaded_foo_vim += 1
|
||||
|
||||
let foo#bar = {}
|
||||
|
||||
func foo#bar.echo()
|
||||
let g:called_foo_bar_echo += 1
|
||||
endfunc
|
||||
@@ -0,0 +1 @@
|
||||
" used by Test_globpath()
|
||||
@@ -0,0 +1 @@
|
||||
" used by Test_globpath()
|
||||
@@ -0,0 +1,3 @@
|
||||
let g:loaded_sourced_vim += 1
|
||||
func! sourced#something()
|
||||
endfunc
|
||||
@@ -1124,3 +1124,57 @@ func Test_Filter_noshelltemp()
|
||||
let &shelltemp = shelltemp
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_TextYankPost()
|
||||
enew!
|
||||
call setline(1, ['foo'])
|
||||
|
||||
let g:event = []
|
||||
au TextYankPost * let g:event = copy(v:event)
|
||||
|
||||
call assert_equal({}, v:event)
|
||||
call assert_fails('let v:event = {}', 'E46:')
|
||||
call assert_fails('let v:event.mykey = 0', 'E742:')
|
||||
|
||||
norm "ayiw
|
||||
call assert_equal(
|
||||
\{'regcontents': ['foo'], 'regname': 'a', 'operator': 'y', 'regtype': 'v'},
|
||||
\g:event)
|
||||
norm y_
|
||||
call assert_equal(
|
||||
\{'regcontents': ['foo'], 'regname': '', 'operator': 'y', 'regtype': 'V'},
|
||||
\g:event)
|
||||
call feedkeys("\<C-V>y", 'x')
|
||||
call assert_equal(
|
||||
\{'regcontents': ['f'], 'regname': '', 'operator': 'y', 'regtype': "\x161"},
|
||||
\g:event)
|
||||
norm "xciwbar
|
||||
call assert_equal(
|
||||
\{'regcontents': ['foo'], 'regname': 'x', 'operator': 'c', 'regtype': 'v'},
|
||||
\g:event)
|
||||
norm "bdiw
|
||||
call assert_equal(
|
||||
\{'regcontents': ['bar'], 'regname': 'b', 'operator': 'd', 'regtype': 'v'},
|
||||
\g:event)
|
||||
|
||||
call assert_equal({}, v:event)
|
||||
|
||||
au! TextYankPost
|
||||
unlet g:event
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_nocatch_wipe_all_buffers()
|
||||
" Real nasty autocommand: wipe all buffers on any event.
|
||||
au * * bwipe *
|
||||
call assert_fails('next x', 'E93')
|
||||
bwipe
|
||||
au!
|
||||
endfunc
|
||||
|
||||
func Test_nocatch_wipe_dummy_buffer()
|
||||
" Nasty autocommand: wipe buffer on any event.
|
||||
au * x bwipe
|
||||
call assert_fails('lv½ /x', 'E480')
|
||||
au!
|
||||
endfunc
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
" Tests for autoload
|
||||
|
||||
set runtimepath=./sautest
|
||||
|
||||
func Test_autoload_dict_func()
|
||||
let g:loaded_foo_vim = 0
|
||||
let g:called_foo_bar_echo = 0
|
||||
call g:foo#bar.echo()
|
||||
call assert_equal(1, g:loaded_foo_vim)
|
||||
call assert_equal(1, g:called_foo_bar_echo)
|
||||
endfunc
|
||||
|
||||
func Test_source_autoload()
|
||||
let g:loaded_sourced_vim = 0
|
||||
source sautest/autoload/sourced.vim
|
||||
call assert_equal(1, g:loaded_sourced_vim)
|
||||
endfunc
|
||||
@@ -20,6 +20,13 @@ function Test_getbufwintabinfo()
|
||||
call assert_equal('vim', l[0].variables.editor)
|
||||
call assert_notequal(-1, index(l[0].windows, bufwinid('%')))
|
||||
|
||||
" Test for getbufinfo() with 'bufmodified'
|
||||
call assert_equal(0, len(getbufinfo({'bufmodified' : 1})))
|
||||
call setbufline('Xtestfile1', 1, ["Line1"])
|
||||
let l = getbufinfo({'bufmodified' : 1})
|
||||
call assert_equal(1, len(l))
|
||||
call assert_equal(bufnr('Xtestfile1'), l[0].bufnr)
|
||||
|
||||
if has('signs')
|
||||
call append(0, ['Linux', 'Windows', 'Mac'])
|
||||
sign define Mark text=>> texthl=Search
|
||||
|
||||
@@ -515,7 +515,7 @@ func Test_nl_pipe()
|
||||
call assert_equal("AND this", ch_readraw(handle))
|
||||
|
||||
call ch_sendraw(handle, "split this line\n")
|
||||
call assert_equal("this linethis linethis line", ch_readraw(handle))
|
||||
call assert_equal("this linethis linethis line", ch_read(handle))
|
||||
|
||||
let reply = ch_evalraw(handle, "quit\n")
|
||||
call assert_equal("Goodbye!", reply)
|
||||
@@ -1266,6 +1266,31 @@ func Test_read_in_close_cb()
|
||||
endtry
|
||||
endfunc
|
||||
|
||||
" Use channel in NL mode but received text does not end in NL.
|
||||
func Test_read_in_close_cb_incomplete()
|
||||
if !has('job')
|
||||
return
|
||||
endif
|
||||
call ch_log('Test_read_in_close_cb_incomplete()')
|
||||
|
||||
let g:Ch_received = ''
|
||||
func! CloseHandler(chan)
|
||||
while ch_status(a:chan, {'part': 'out'}) == 'buffered'
|
||||
let g:Ch_received .= ch_read(a:chan)
|
||||
endwhile
|
||||
endfunc
|
||||
let job = job_start(s:python . " test_channel_pipe.py incomplete",
|
||||
\ {'close_cb': 'CloseHandler'})
|
||||
call assert_equal("run", job_status(job))
|
||||
try
|
||||
call WaitFor('g:Ch_received != ""')
|
||||
call assert_equal('incomplete', g:Ch_received)
|
||||
finally
|
||||
call job_stop(job)
|
||||
delfunc CloseHandler
|
||||
endtry
|
||||
endfunc
|
||||
|
||||
func Test_out_cb_lambda()
|
||||
if !has('job')
|
||||
return
|
||||
|
||||
@@ -14,6 +14,10 @@ if __name__ == "__main__":
|
||||
if sys.argv[1].startswith("err"):
|
||||
print(sys.argv[1], file=sys.stderr)
|
||||
sys.stderr.flush()
|
||||
elif sys.argv[1].startswith("incomplete"):
|
||||
print(sys.argv[1], end='')
|
||||
sys.stdout.flush()
|
||||
sys.exit(0)
|
||||
else:
|
||||
print(sys.argv[1])
|
||||
sys.stdout.flush()
|
||||
|
||||
@@ -25,8 +25,8 @@ function Test_glob()
|
||||
endfunction
|
||||
|
||||
function Test_globpath()
|
||||
call assert_equal("sautest/autoload/Test104.vim\nsautest/autoload/footest.vim",
|
||||
\ globpath('sautest/autoload', '*.vim'))
|
||||
call assert_equal(['sautest/autoload/Test104.vim', 'sautest/autoload/footest.vim'],
|
||||
\ globpath('sautest/autoload', '*.vim', 0, 1))
|
||||
call assert_equal("sautest/autoload/globone.vim\nsautest/autoload/globtwo.vim",
|
||||
\ globpath('sautest/autoload', 'glob*.vim'))
|
||||
call assert_equal(['sautest/autoload/globone.vim', 'sautest/autoload/globtwo.vim'],
|
||||
\ globpath('sautest/autoload', 'glob*.vim', 0, 1))
|
||||
endfunction
|
||||
|
||||
@@ -692,6 +692,7 @@ func Test_count()
|
||||
call assert_equal(0, count("foo", "O"))
|
||||
call assert_equal(2, count("foo", "O", 1))
|
||||
call assert_equal(2, count("fooooo", "oo"))
|
||||
call assert_equal(0, count("foo", ""))
|
||||
endfunc
|
||||
|
||||
func Test_changenr()
|
||||
|
||||
@@ -30,3 +30,22 @@ func Test_help_keyword()
|
||||
close
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_help_local_additions()
|
||||
call mkdir('Xruntime/doc', 'p')
|
||||
call writefile(['*mydoc.txt* my awesome doc'], 'Xruntime/doc/mydoc.txt')
|
||||
call writefile(['*mydoc-ext.txt* my extended awesome doc'], 'Xruntime/doc/mydoc-ext.txt')
|
||||
let rtp_save = &rtp
|
||||
set rtp+=./Xruntime
|
||||
help
|
||||
1
|
||||
call search('mydoc.txt')
|
||||
call assert_equal('|mydoc.txt| my awesome doc', getline('.'))
|
||||
1
|
||||
call search('mydoc-ext.txt')
|
||||
call assert_equal('|mydoc-ext.txt| my extended awesome doc', getline('.'))
|
||||
close
|
||||
|
||||
call delete('Xruntime', 'rf')
|
||||
let &rtp = rtp_save
|
||||
endfunc
|
||||
|
||||
@@ -103,6 +103,10 @@ func Test_json_encode()
|
||||
call assert_fails('echo json_encode(function("tr"))', 'E474:')
|
||||
call assert_fails('echo json_encode([function("tr")])', 'E474:')
|
||||
|
||||
call assert_equal('{"a":""}', json_encode({'a': test_null_string()}))
|
||||
call assert_equal('{"a":[]}', json_encode({"a": test_null_list()}))
|
||||
call assert_equal('{"a":{}}', json_encode({"a": test_null_dict()}))
|
||||
|
||||
silent! let res = json_encode(function("tr"))
|
||||
call assert_equal("", res)
|
||||
endfunc
|
||||
|
||||
@@ -404,6 +404,15 @@ func! Test_normal10_expand()
|
||||
call assert_equal(expected[i], expand('<cexpr>'), 'i == ' . i)
|
||||
endfor
|
||||
|
||||
if executable('echo')
|
||||
" Test expand(`...`) i.e. backticks command expansion.
|
||||
" MS-Windows has a trailing space.
|
||||
call assert_match('^abcde *$', expand('`echo abcde`'))
|
||||
endif
|
||||
|
||||
" Test expand(`=...`) i.e. backticks expression expansion
|
||||
call assert_equal('5', expand('`=2+3`'))
|
||||
|
||||
" clean up
|
||||
bw!
|
||||
endfunc
|
||||
@@ -1537,12 +1546,12 @@ fun! Test_normal29_brace()
|
||||
\ 'the ''{'' flag is in ''cpoptions'' then ''{'' in the first column is used as a',
|
||||
\ 'paragraph boundary |posix|.',
|
||||
\ '{',
|
||||
\ 'This is no paragaraph',
|
||||
\ 'This is no paragraph',
|
||||
\ 'unless the ''{'' is set',
|
||||
\ 'in ''cpoptions''',
|
||||
\ '}',
|
||||
\ '.IP',
|
||||
\ 'The nroff macros IP seperates a paragraph',
|
||||
\ 'The nroff macros IP separates a paragraph',
|
||||
\ 'That means, it must be a ''.''',
|
||||
\ 'followed by IP',
|
||||
\ '.LPIt does not matter, if afterwards some',
|
||||
@@ -1557,7 +1566,7 @@ fun! Test_normal29_brace()
|
||||
1
|
||||
norm! 0d2}
|
||||
call assert_equal(['.IP',
|
||||
\ 'The nroff macros IP seperates a paragraph', 'That means, it must be a ''.''', 'followed by IP',
|
||||
\ 'The nroff macros IP separates a paragraph', 'That means, it must be a ''.''', 'followed by IP',
|
||||
\ '.LPIt does not matter, if afterwards some', 'more characters follow.', '.SHAlso section boundaries from the nroff',
|
||||
\ 'macros terminate a paragraph. That means', 'a character like this:', '.NH', 'End of text here', ''], getline(1,'$'))
|
||||
norm! 0d}
|
||||
@@ -1576,21 +1585,21 @@ fun! Test_normal29_brace()
|
||||
set cpo+={
|
||||
1
|
||||
norm! 0d2}
|
||||
call assert_equal(['{', 'This is no paragaraph', 'unless the ''{'' is set', 'in ''cpoptions''', '}',
|
||||
\ '.IP', 'The nroff macros IP seperates a paragraph', 'That means, it must be a ''.''',
|
||||
call assert_equal(['{', 'This is no paragraph', 'unless the ''{'' is set', 'in ''cpoptions''', '}',
|
||||
\ '.IP', 'The nroff macros IP separates a paragraph', 'That means, it must be a ''.''',
|
||||
\ 'followed by IP', '.LPIt does not matter, if afterwards some', 'more characters follow.',
|
||||
\ '.SHAlso section boundaries from the nroff', 'macros terminate a paragraph. That means',
|
||||
\ 'a character like this:', '.NH', 'End of text here', ''], getline(1,'$'))
|
||||
$
|
||||
norm! d}
|
||||
call assert_equal(['{', 'This is no paragaraph', 'unless the ''{'' is set', 'in ''cpoptions''', '}',
|
||||
\ '.IP', 'The nroff macros IP seperates a paragraph', 'That means, it must be a ''.''',
|
||||
call assert_equal(['{', 'This is no paragraph', 'unless the ''{'' is set', 'in ''cpoptions''', '}',
|
||||
\ '.IP', 'The nroff macros IP separates a paragraph', 'That means, it must be a ''.''',
|
||||
\ 'followed by IP', '.LPIt does not matter, if afterwards some', 'more characters follow.',
|
||||
\ '.SHAlso section boundaries from the nroff', 'macros terminate a paragraph. That means',
|
||||
\ 'a character like this:', '.NH', 'End of text here', ''], getline(1,'$'))
|
||||
norm! gg}
|
||||
norm! d5}
|
||||
call assert_equal(['{', 'This is no paragaraph', 'unless the ''{'' is set', 'in ''cpoptions''', '}', ''], getline(1,'$'))
|
||||
call assert_equal(['{', 'This is no paragraph', 'unless the ''{'' is set', 'in ''cpoptions''', '}', ''], getline(1,'$'))
|
||||
|
||||
" clean up
|
||||
set cpo-={
|
||||
|
||||
@@ -45,6 +45,24 @@ func Test_packadd()
|
||||
call assert_fails("packadd", 'E471:')
|
||||
endfunc
|
||||
|
||||
func Test_packadd_start()
|
||||
let plugdir = s:topdir . '/pack/mine/start/other'
|
||||
call mkdir(plugdir . '/plugin', 'p')
|
||||
set rtp&
|
||||
let rtp = &rtp
|
||||
filetype on
|
||||
|
||||
exe 'split ' . plugdir . '/plugin/test.vim'
|
||||
call setline(1, 'let g:plugin_works = 24')
|
||||
wq
|
||||
|
||||
packadd other
|
||||
|
||||
call assert_equal(24, g:plugin_works)
|
||||
call assert_true(len(&rtp) > len(rtp))
|
||||
call assert_true(&rtp =~ '/testdir/Xdir/pack/mine/start/other\($\|,\)')
|
||||
endfunc
|
||||
|
||||
func Test_packadd_noload()
|
||||
call mkdir(s:plugdir . '/plugin', 'p')
|
||||
call mkdir(s:plugdir . '/syntax', 'p')
|
||||
|
||||
+349
-18
@@ -28,7 +28,7 @@ func s:setup_commands(cchar)
|
||||
command! -count -nargs=* -bang Xprev <mods><count>cprev<bang> <args>
|
||||
command! -nargs=* -bang Xfirst <mods>cfirst<bang> <args>
|
||||
command! -nargs=* -bang Xlast <mods>clast<bang> <args>
|
||||
command! -nargs=* -bang Xnfile <mods>cnfile<bang> <args>
|
||||
command! -nargs=* -bang -range Xnfile <mods><count>cnfile<bang> <args>
|
||||
command! -nargs=* -bang Xpfile <mods>cpfile<bang> <args>
|
||||
command! -nargs=* Xexpr <mods>cexpr <args>
|
||||
command! -range -nargs=* Xvimgrep <mods><count>vimgrep <args>
|
||||
@@ -36,6 +36,7 @@ func s:setup_commands(cchar)
|
||||
command! -nargs=* Xgrep <mods> grep <args>
|
||||
command! -nargs=* Xgrepadd <mods> grepadd <args>
|
||||
command! -nargs=* Xhelpgrep helpgrep <args>
|
||||
command! -nargs=0 -count Xcc <count>cc
|
||||
let g:Xgetlist = function('getqflist')
|
||||
let g:Xsetlist = function('setqflist')
|
||||
call setqflist([], 'f')
|
||||
@@ -60,7 +61,7 @@ func s:setup_commands(cchar)
|
||||
command! -count -nargs=* -bang Xprev <mods><count>lprev<bang> <args>
|
||||
command! -nargs=* -bang Xfirst <mods>lfirst<bang> <args>
|
||||
command! -nargs=* -bang Xlast <mods>llast<bang> <args>
|
||||
command! -nargs=* -bang Xnfile <mods>lnfile<bang> <args>
|
||||
command! -nargs=* -bang -range Xnfile <mods><count>lnfile<bang> <args>
|
||||
command! -nargs=* -bang Xpfile <mods>lpfile<bang> <args>
|
||||
command! -nargs=* Xexpr <mods>lexpr <args>
|
||||
command! -range -nargs=* Xvimgrep <mods><count>lvimgrep <args>
|
||||
@@ -68,6 +69,7 @@ func s:setup_commands(cchar)
|
||||
command! -nargs=* Xgrep <mods> lgrep <args>
|
||||
command! -nargs=* Xgrepadd <mods> lgrepadd <args>
|
||||
command! -nargs=* Xhelpgrep lhelpgrep <args>
|
||||
command! -nargs=0 -count Xcc <count>ll
|
||||
let g:Xgetlist = function('getloclist', [0])
|
||||
let g:Xsetlist = function('setloclist', [0])
|
||||
call setloclist(0, [], 'f')
|
||||
@@ -382,12 +384,18 @@ endfunc
|
||||
func Xtest_browse(cchar)
|
||||
call s:setup_commands(a:cchar)
|
||||
|
||||
call g:Xsetlist([], 'f')
|
||||
" Jumping to first or next location list entry without any error should
|
||||
" result in failure
|
||||
if a:cchar == 'l'
|
||||
call assert_fails('lfirst', 'E776:')
|
||||
call assert_fails('lnext', 'E776:')
|
||||
if a:cchar == 'c'
|
||||
let err = 'E42:'
|
||||
else
|
||||
let err = 'E776:'
|
||||
endif
|
||||
call assert_fails('Xnext', err)
|
||||
call assert_fails('Xprev', err)
|
||||
call assert_fails('Xnfile', err)
|
||||
call assert_fails('Xpfile', err)
|
||||
|
||||
call s:create_test_file('Xqftestfile1')
|
||||
call s:create_test_file('Xqftestfile2')
|
||||
@@ -408,6 +416,12 @@ func Xtest_browse(cchar)
|
||||
Xpfile
|
||||
call assert_equal('Xqftestfile1', bufname('%'))
|
||||
call assert_equal(6, line('.'))
|
||||
5Xcc
|
||||
call assert_equal(5, g:Xgetlist({'idx':0}).idx)
|
||||
2Xcc
|
||||
call assert_equal(2, g:Xgetlist({'idx':0}).idx)
|
||||
10Xcc
|
||||
call assert_equal(6, g:Xgetlist({'idx':0}).idx)
|
||||
Xlast
|
||||
Xprev
|
||||
call assert_equal('Xqftestfile2', bufname('%'))
|
||||
@@ -425,6 +439,23 @@ func Xtest_browse(cchar)
|
||||
call assert_equal('Xqftestfile1', bufname('%'))
|
||||
call assert_equal(5, line('.'))
|
||||
|
||||
" Jumping to an error from the error window using cc command
|
||||
Xgetexpr ['Xqftestfile1:5:Line5',
|
||||
\ 'Xqftestfile1:6:Line6',
|
||||
\ 'Xqftestfile2:10:Line10',
|
||||
\ 'Xqftestfile2:11:Line11']
|
||||
Xopen
|
||||
10Xcc
|
||||
call assert_equal(11, line('.'))
|
||||
call assert_equal('Xqftestfile2', bufname('%'))
|
||||
|
||||
" Jumping to an error from the error window (when only the error window is
|
||||
" present)
|
||||
Xopen | only
|
||||
Xlast 1
|
||||
call assert_equal(5, line('.'))
|
||||
call assert_equal('Xqftestfile1', bufname('%'))
|
||||
|
||||
Xexpr ""
|
||||
call assert_fails('Xnext', 'E42:')
|
||||
|
||||
@@ -1397,6 +1428,11 @@ func XquickfixSetListWithAct(cchar)
|
||||
call assert_fails("call g:Xsetlist(list1, 0)", 'E928:')
|
||||
endfunc
|
||||
|
||||
func Test_setqflist_invalid_nr()
|
||||
" The following command used to crash Vim
|
||||
call setqflist([], ' ', {'nr' : $XXX_DOES_NOT_EXIST})
|
||||
endfunc
|
||||
|
||||
func Test_quickfix_set_list_with_act()
|
||||
call XquickfixSetListWithAct('c')
|
||||
call XquickfixSetListWithAct('l')
|
||||
@@ -1497,13 +1533,18 @@ func Test_switchbuf()
|
||||
set switchbuf=usetab
|
||||
tabedit Xqftestfile1
|
||||
tabedit Xqftestfile2
|
||||
tabedit Xqftestfile3
|
||||
tabfirst
|
||||
cfirst | cnext
|
||||
call assert_equal(2, tabpagenr())
|
||||
2cnext
|
||||
call assert_equal(3, tabpagenr())
|
||||
2cnext
|
||||
call assert_equal(3, tabpagenr())
|
||||
6cnext
|
||||
call assert_equal(4, tabpagenr())
|
||||
2cpfile
|
||||
call assert_equal(2, tabpagenr())
|
||||
2cnfile
|
||||
call assert_equal(4, tabpagenr())
|
||||
tabfirst | tabonly | enew
|
||||
|
||||
set switchbuf=split
|
||||
@@ -1797,8 +1838,8 @@ func Xproperty_tests(cchar)
|
||||
call assert_equal(-1, s)
|
||||
|
||||
call assert_equal({}, g:Xgetlist({'abc':1}))
|
||||
call assert_equal({}, g:Xgetlist({'nr':99, 'title':1}))
|
||||
call assert_equal({}, g:Xgetlist({'nr':[], 'title':1}))
|
||||
call assert_equal('', g:Xgetlist({'nr':99, 'title':1}).title)
|
||||
call assert_equal('', g:Xgetlist({'nr':[], 'title':1}).title)
|
||||
|
||||
if a:cchar == 'l'
|
||||
call assert_equal({}, getloclist(99, {'title': 1}))
|
||||
@@ -1834,7 +1875,7 @@ func Xproperty_tests(cchar)
|
||||
call assert_equal([1, 2], getloclist(w2_id, {'context':1}).context)
|
||||
only
|
||||
call setloclist(0, [], 'f')
|
||||
call assert_equal({}, getloclist(0, {'context':1}))
|
||||
call assert_equal('', getloclist(0, {'context':1}).context)
|
||||
endif
|
||||
|
||||
" Test for changing the context of previous quickfix lists
|
||||
@@ -2096,6 +2137,8 @@ func Test_Autocmd()
|
||||
|
||||
call delete('Xtest')
|
||||
call delete('Xempty')
|
||||
au! QuickFixCmdPre
|
||||
au! QuickFixCmdPost
|
||||
endfunc
|
||||
|
||||
func Test_Autocmd_Exception()
|
||||
@@ -2320,7 +2363,7 @@ func XfreeTests(cchar)
|
||||
Xclose
|
||||
endfunc
|
||||
|
||||
" Tests for the quickifx free functionality
|
||||
" Tests for the quickfix free functionality
|
||||
func Test_qf_free()
|
||||
call XfreeTests('c')
|
||||
call XfreeTests('l')
|
||||
@@ -2347,8 +2390,8 @@ func XsizeTests(cchar)
|
||||
|
||||
call g:Xsetlist([], 'f')
|
||||
call assert_equal(0, g:Xgetlist({'nr':'$'}).nr)
|
||||
call assert_equal(1, len(g:Xgetlist({'nr':'$', 'all':1})))
|
||||
call assert_equal(0, len(g:Xgetlist({'nr':0})))
|
||||
call assert_equal('', g:Xgetlist({'nr':'$', 'all':1}).title)
|
||||
call assert_equal(0, g:Xgetlist({'nr':0}).nr)
|
||||
|
||||
Xexpr "File1:10:Line1"
|
||||
Xexpr "File2:20:Line2"
|
||||
@@ -2718,7 +2761,7 @@ func Xqfid_tests(cchar)
|
||||
call s:setup_commands(a:cchar)
|
||||
|
||||
call g:Xsetlist([], 'f')
|
||||
call assert_equal({}, g:Xgetlist({'id':0}))
|
||||
call assert_equal(0, g:Xgetlist({'id':0}).id)
|
||||
Xexpr ''
|
||||
let start_id = g:Xgetlist({'id' : 0}).id
|
||||
Xexpr '' | Xexpr ''
|
||||
@@ -2726,10 +2769,10 @@ func Xqfid_tests(cchar)
|
||||
call assert_equal(start_id, g:Xgetlist({'id':0, 'nr':1}).id)
|
||||
call assert_equal(start_id + 1, g:Xgetlist({'id':0, 'nr':0}).id)
|
||||
call assert_equal(start_id + 2, g:Xgetlist({'id':0, 'nr':'$'}).id)
|
||||
call assert_equal({}, g:Xgetlist({'id':0, 'nr':99}))
|
||||
call assert_equal(0, g:Xgetlist({'id':0, 'nr':99}).id)
|
||||
call assert_equal(2, g:Xgetlist({'id':start_id + 1, 'nr':0}).nr)
|
||||
call assert_equal({}, g:Xgetlist({'id':99, 'nr':0}))
|
||||
call assert_equal({}, g:Xgetlist({'id':"abc", 'nr':0}))
|
||||
call assert_equal(0, g:Xgetlist({'id':99, 'nr':0}).id)
|
||||
call assert_equal(0, g:Xgetlist({'id':"abc", 'nr':0}).id)
|
||||
|
||||
call g:Xsetlist([], 'a', {'id':start_id, 'context':[1,2]})
|
||||
call assert_equal([1,2], g:Xgetlist({'nr':1, 'context':1}).context)
|
||||
@@ -2740,10 +2783,298 @@ func Xqfid_tests(cchar)
|
||||
|
||||
let qfid = g:Xgetlist({'id':0, 'nr':0})
|
||||
call g:Xsetlist([], 'f')
|
||||
call assert_equal({}, g:Xgetlist({'id':qfid, 'nr':0}))
|
||||
call assert_equal(0, g:Xgetlist({'id':qfid, 'nr':0}).id)
|
||||
endfunc
|
||||
|
||||
func Test_qf_id()
|
||||
call Xqfid_tests('c')
|
||||
call Xqfid_tests('l')
|
||||
endfunc
|
||||
|
||||
func Xqfjump_tests(cchar)
|
||||
call s:setup_commands(a:cchar)
|
||||
|
||||
call writefile(["Line1\tFoo", "Line2"], 'F1')
|
||||
call writefile(["Line1\tBar", "Line2"], 'F2')
|
||||
call writefile(["Line1\tBaz", "Line2"], 'F3')
|
||||
|
||||
call g:Xsetlist([], 'f')
|
||||
|
||||
" Tests for
|
||||
" Jumping to a line using a pattern
|
||||
" Jumping to a column greater than the last column in a line
|
||||
" Jumping to a line greater than the last line in the file
|
||||
let l = []
|
||||
for i in range(1, 7)
|
||||
call add(l, {})
|
||||
endfor
|
||||
let l[0].filename='F1'
|
||||
let l[0].pattern='Line1'
|
||||
let l[1].filename='F2'
|
||||
let l[1].pattern='Line1'
|
||||
let l[2].filename='F3'
|
||||
let l[2].pattern='Line1'
|
||||
let l[3].filename='F3'
|
||||
let l[3].lnum=1
|
||||
let l[3].col=9
|
||||
let l[3].vcol=1
|
||||
let l[4].filename='F3'
|
||||
let l[4].lnum=99
|
||||
let l[5].filename='F3'
|
||||
let l[5].lnum=1
|
||||
let l[5].col=99
|
||||
let l[5].vcol=1
|
||||
let l[6].filename='F3'
|
||||
let l[6].pattern='abcxyz'
|
||||
|
||||
call g:Xsetlist([], ' ', {'items' : l})
|
||||
Xopen | only
|
||||
2Xnext
|
||||
call assert_equal(3, g:Xgetlist({'idx' : 0}).idx)
|
||||
call assert_equal('F3', bufname('%'))
|
||||
Xnext
|
||||
call assert_equal(7, col('.'))
|
||||
Xnext
|
||||
call assert_equal(2, line('.'))
|
||||
Xnext
|
||||
call assert_equal(9, col('.'))
|
||||
2
|
||||
Xnext
|
||||
call assert_equal(2, line('.'))
|
||||
|
||||
if a:cchar == 'l'
|
||||
" When jumping to a location list entry in the location list window and
|
||||
" no usable windows are available, then a new window should be opened.
|
||||
enew! | new | only
|
||||
call g:Xsetlist([], 'f')
|
||||
setlocal buftype=nofile
|
||||
new
|
||||
call g:Xsetlist([], ' ', {'lines' : ['F1:1:1:Line1', 'F1:2:2:Line2', 'F2:1:1:Line1', 'F2:2:2:Line2', 'F3:1:1:Line1', 'F3:2:2:Line2']})
|
||||
Xopen
|
||||
let winid = win_getid()
|
||||
wincmd p
|
||||
close
|
||||
call win_gotoid(winid)
|
||||
Xnext
|
||||
call assert_equal(3, winnr('$'))
|
||||
call assert_equal(1, winnr())
|
||||
call assert_equal(2, line('.'))
|
||||
|
||||
" When jumping to an entry in the location list window and the window
|
||||
" associated with the location list is not present and a window containing
|
||||
" the file is already present, then that window should be used.
|
||||
close
|
||||
belowright new
|
||||
call g:Xsetlist([], 'f')
|
||||
edit F3
|
||||
call win_gotoid(winid)
|
||||
Xlast
|
||||
call assert_equal(3, winnr())
|
||||
call assert_equal(6, g:Xgetlist({'size' : 1}).size)
|
||||
call assert_equal(winid, g:Xgetlist({'winid' : 1}).winid)
|
||||
endif
|
||||
|
||||
" Cleanup
|
||||
enew!
|
||||
new | only
|
||||
|
||||
call delete('F1')
|
||||
call delete('F2')
|
||||
call delete('F3')
|
||||
endfunc
|
||||
|
||||
func Test_qfjump()
|
||||
call Xqfjump_tests('c')
|
||||
call Xqfjump_tests('l')
|
||||
endfunc
|
||||
|
||||
" Tests for the getqflist() and getloclist() functions when the list is not
|
||||
" present or is empty
|
||||
func Xgetlist_empty_tests(cchar)
|
||||
call s:setup_commands(a:cchar)
|
||||
|
||||
" Empty quickfix stack
|
||||
call g:Xsetlist([], 'f')
|
||||
call assert_equal('', g:Xgetlist({'context' : 0}).context)
|
||||
call assert_equal(0, g:Xgetlist({'id' : 0}).id)
|
||||
call assert_equal(0, g:Xgetlist({'idx' : 0}).idx)
|
||||
call assert_equal([], g:Xgetlist({'items' : 0}).items)
|
||||
call assert_equal(0, g:Xgetlist({'nr' : 0}).nr)
|
||||
call assert_equal(0, g:Xgetlist({'size' : 0}).size)
|
||||
call assert_equal('', g:Xgetlist({'title' : 0}).title)
|
||||
call assert_equal(0, g:Xgetlist({'winid' : 0}).winid)
|
||||
call assert_equal(0, g:Xgetlist({'changedtick' : 0}).changedtick)
|
||||
call assert_equal({'context' : '', 'id' : 0, 'idx' : 0, 'items' : [], 'nr' : 0, 'size' : 0, 'title' : '', 'winid' : 0, 'changedtick': 0}, g:Xgetlist({'all' : 0}))
|
||||
|
||||
" Empty quickfix list
|
||||
Xexpr ""
|
||||
call assert_equal('', g:Xgetlist({'context' : 0}).context)
|
||||
call assert_notequal(0, g:Xgetlist({'id' : 0}).id)
|
||||
call assert_equal(0, g:Xgetlist({'idx' : 0}).idx)
|
||||
call assert_equal([], g:Xgetlist({'items' : 0}).items)
|
||||
call assert_notequal(0, g:Xgetlist({'nr' : 0}).nr)
|
||||
call assert_equal(0, g:Xgetlist({'size' : 0}).size)
|
||||
call assert_notequal('', g:Xgetlist({'title' : 0}).title)
|
||||
call assert_equal(0, g:Xgetlist({'winid' : 0}).winid)
|
||||
call assert_equal(1, g:Xgetlist({'changedtick' : 0}).changedtick)
|
||||
|
||||
let qfid = g:Xgetlist({'id' : 0}).id
|
||||
call g:Xsetlist([], 'f')
|
||||
|
||||
" Non-existing quickfix identifier
|
||||
call assert_equal('', g:Xgetlist({'id' : qfid, 'context' : 0}).context)
|
||||
call assert_equal(0, g:Xgetlist({'id' : qfid}).id)
|
||||
call assert_equal(0, g:Xgetlist({'id' : qfid, 'idx' : 0}).idx)
|
||||
call assert_equal([], g:Xgetlist({'id' : qfid, 'items' : 0}).items)
|
||||
call assert_equal(0, g:Xgetlist({'id' : qfid, 'nr' : 0}).nr)
|
||||
call assert_equal(0, g:Xgetlist({'id' : qfid, 'size' : 0}).size)
|
||||
call assert_equal('', g:Xgetlist({'id' : qfid, 'title' : 0}).title)
|
||||
call assert_equal(0, g:Xgetlist({'id' : qfid, 'winid' : 0}).winid)
|
||||
call assert_equal(0, g:Xgetlist({'id' : qfid, 'changedtick' : 0}).changedtick)
|
||||
call assert_equal({'context' : '', 'id' : 0, 'idx' : 0, 'items' : [], 'nr' : 0, 'size' : 0, 'title' : '', 'winid' : 0, 'changedtick' : 0}, g:Xgetlist({'id' : qfid, 'all' : 0}))
|
||||
|
||||
" Non-existing quickfix list number
|
||||
call assert_equal('', g:Xgetlist({'nr' : 5, 'context' : 0}).context)
|
||||
call assert_equal(0, g:Xgetlist({'nr' : 5}).nr)
|
||||
call assert_equal(0, g:Xgetlist({'nr' : 5, 'idx' : 0}).idx)
|
||||
call assert_equal([], g:Xgetlist({'nr' : 5, 'items' : 0}).items)
|
||||
call assert_equal(0, g:Xgetlist({'nr' : 5, 'id' : 0}).id)
|
||||
call assert_equal(0, g:Xgetlist({'nr' : 5, 'size' : 0}).size)
|
||||
call assert_equal('', g:Xgetlist({'nr' : 5, 'title' : 0}).title)
|
||||
call assert_equal(0, g:Xgetlist({'nr' : 5, 'winid' : 0}).winid)
|
||||
call assert_equal(0, g:Xgetlist({'nr' : 5, 'changedtick' : 0}).changedtick)
|
||||
call assert_equal({'context' : '', 'id' : 0, 'idx' : 0, 'items' : [], 'nr' : 0, 'size' : 0, 'title' : '', 'winid' : 0, 'changedtick' : 0}, g:Xgetlist({'nr' : 5, 'all' : 0}))
|
||||
endfunc
|
||||
|
||||
func Test_getqflist()
|
||||
call Xgetlist_empty_tests('c')
|
||||
call Xgetlist_empty_tests('l')
|
||||
endfunc
|
||||
|
||||
func Test_getqflist_invalid_nr()
|
||||
" The following commands used to crash Vim
|
||||
cexpr ""
|
||||
call getqflist({'nr' : $XXX_DOES_NOT_EXIST_XXX})
|
||||
|
||||
" Cleanup
|
||||
call setqflist([], 'r')
|
||||
endfunc
|
||||
|
||||
" Tests for the quickfix/location list changedtick
|
||||
func Xqftick_tests(cchar)
|
||||
call s:setup_commands(a:cchar)
|
||||
|
||||
call g:Xsetlist([], 'f')
|
||||
|
||||
Xexpr "F1:10:Line10"
|
||||
let qfid = g:Xgetlist({'id' : 0}).id
|
||||
call assert_equal(1, g:Xgetlist({'changedtick' : 0}).changedtick)
|
||||
Xaddexpr "F2:20:Line20\nF2:21:Line21"
|
||||
call assert_equal(2, g:Xgetlist({'changedtick' : 0}).changedtick)
|
||||
call g:Xsetlist([], 'a', {'lines' : ["F3:30:Line30", "F3:31:Line31"]})
|
||||
call assert_equal(3, g:Xgetlist({'changedtick' : 0}).changedtick)
|
||||
call g:Xsetlist([], 'r', {'lines' : ["F4:40:Line40"]})
|
||||
call assert_equal(4, g:Xgetlist({'changedtick' : 0}).changedtick)
|
||||
call g:Xsetlist([], 'a', {'title' : 'New Title'})
|
||||
call assert_equal(5, g:Xgetlist({'changedtick' : 0}).changedtick)
|
||||
|
||||
enew!
|
||||
call append(0, ["F5:50:L50", "F6:60:L60"])
|
||||
Xaddbuffer
|
||||
call assert_equal(6, g:Xgetlist({'changedtick' : 0}).changedtick)
|
||||
enew!
|
||||
|
||||
call g:Xsetlist([], 'a', {'context' : {'bus' : 'pci'}})
|
||||
call assert_equal(7, g:Xgetlist({'changedtick' : 0}).changedtick)
|
||||
call g:Xsetlist([{'filename' : 'F7', 'lnum' : 10, 'text' : 'L7'},
|
||||
\ {'filename' : 'F7', 'lnum' : 11, 'text' : 'L11'}], 'a')
|
||||
call assert_equal(8, g:Xgetlist({'changedtick' : 0}).changedtick)
|
||||
call g:Xsetlist([{'filename' : 'F7', 'lnum' : 10, 'text' : 'L7'},
|
||||
\ {'filename' : 'F7', 'lnum' : 11, 'text' : 'L11'}], ' ')
|
||||
call assert_equal(1, g:Xgetlist({'changedtick' : 0}).changedtick)
|
||||
call g:Xsetlist([{'filename' : 'F7', 'lnum' : 10, 'text' : 'L7'},
|
||||
\ {'filename' : 'F7', 'lnum' : 11, 'text' : 'L11'}], 'r')
|
||||
call assert_equal(2, g:Xgetlist({'changedtick' : 0}).changedtick)
|
||||
|
||||
call writefile(["F8:80:L80", "F8:81:L81"], "Xone")
|
||||
Xfile Xone
|
||||
call assert_equal(1, g:Xgetlist({'changedtick' : 0}).changedtick)
|
||||
Xaddfile Xone
|
||||
call assert_equal(2, g:Xgetlist({'changedtick' : 0}).changedtick)
|
||||
|
||||
" Test case for updating a non-current quickfix list
|
||||
call g:Xsetlist([], 'f')
|
||||
Xexpr "F1:1:L1"
|
||||
Xexpr "F2:2:L2"
|
||||
call g:Xsetlist([], 'a', {'nr' : 1, "lines" : ["F10:10:L10"]})
|
||||
call assert_equal(1, g:Xgetlist({'changedtick' : 0}).changedtick)
|
||||
call assert_equal(2, g:Xgetlist({'nr' : 1, 'changedtick' : 0}).changedtick)
|
||||
|
||||
call delete("Xone")
|
||||
endfunc
|
||||
|
||||
func Test_qf_tick()
|
||||
call Xqftick_tests('c')
|
||||
call Xqftick_tests('l')
|
||||
endfunc
|
||||
|
||||
" The following test used to crash Vim.
|
||||
" Open the location list window and close the regular window associated with
|
||||
" the location list. When the garbage collection runs now, it incorrectly
|
||||
" marks the location list context as not in use and frees the context.
|
||||
func Test_ll_window_ctx()
|
||||
call setloclist(0, [], 'f')
|
||||
call setloclist(0, [], 'a', {'context' : []})
|
||||
lopen | only
|
||||
call test_garbagecollect_now()
|
||||
echo getloclist(0, {'context' : 1}).context
|
||||
enew | only
|
||||
endfunc
|
||||
|
||||
" The following test used to crash vim
|
||||
func Test_lfile_crash()
|
||||
sp Xtest
|
||||
au QuickFixCmdPre * bw
|
||||
call assert_fails('lfile', 'E40')
|
||||
au! QuickFixCmdPre
|
||||
endfunc
|
||||
|
||||
" The following test used to crash vim
|
||||
func Test_lbuffer_crash()
|
||||
sv Xtest
|
||||
augroup QF_Test
|
||||
au!
|
||||
au * * bw
|
||||
augroup END
|
||||
lbuffer
|
||||
augroup QF_Test
|
||||
au!
|
||||
augroup END
|
||||
endfunc
|
||||
|
||||
" The following test used to crash vim
|
||||
func Test_lexpr_crash()
|
||||
augroup QF_Test
|
||||
au!
|
||||
au * * call setloclist(0, [], 'f')
|
||||
augroup END
|
||||
lexpr ""
|
||||
augroup QF_Test
|
||||
au!
|
||||
augroup END
|
||||
enew | only
|
||||
endfunc
|
||||
|
||||
" The following test used to crash Vim
|
||||
func Test_lvimgrep_crash()
|
||||
sv Xtest
|
||||
augroup QF_Test
|
||||
au!
|
||||
au * * call setloclist(0, [], 'f')
|
||||
augroup END
|
||||
lvimgrep quickfix test_quickfix.vim
|
||||
augroup QF_Test
|
||||
au!
|
||||
augroup END
|
||||
enew | only
|
||||
endfunc
|
||||
|
||||
@@ -721,3 +721,20 @@ func Test_search_multibyte()
|
||||
enew!
|
||||
let &encoding = save_enc
|
||||
endfunc
|
||||
|
||||
" This was causing E874. Also causes an invalid read?
|
||||
func Test_look_behind()
|
||||
new
|
||||
call setline(1, '0\|\&\n\@<=')
|
||||
call search(getline("."))
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_search_sentence()
|
||||
new
|
||||
" this used to cause a crash
|
||||
call assert_fails("/\\%')", 'E486')
|
||||
call assert_fails("/", 'E486')
|
||||
/\%'(
|
||||
/
|
||||
endfunc
|
||||
|
||||
@@ -28,6 +28,37 @@ func Test_wrap_search()
|
||||
set nospell
|
||||
endfunc
|
||||
|
||||
func Test_curswant()
|
||||
new
|
||||
call setline(1, ['Another plong line', 'abcdefghijklmnopq'])
|
||||
set spell wrapscan
|
||||
normal 0]s
|
||||
call assert_equal('plong', expand('<cword>'))
|
||||
normal j
|
||||
call assert_equal(9, getcurpos()[2])
|
||||
normal 0[s
|
||||
call assert_equal('plong', expand('<cword>'))
|
||||
normal j
|
||||
call assert_equal(9, getcurpos()[2])
|
||||
|
||||
normal 0]S
|
||||
call assert_equal('plong', expand('<cword>'))
|
||||
normal j
|
||||
call assert_equal(9, getcurpos()[2])
|
||||
normal 0[S
|
||||
call assert_equal('plong', expand('<cword>'))
|
||||
normal j
|
||||
call assert_equal(9, getcurpos()[2])
|
||||
|
||||
normal 1G0
|
||||
call assert_equal('plong', spellbadword()[0])
|
||||
normal j
|
||||
call assert_equal(9, getcurpos()[2])
|
||||
|
||||
bwipe!
|
||||
set nospell
|
||||
endfunc
|
||||
|
||||
func Test_z_equal_on_invalid_utf8_word()
|
||||
split
|
||||
set spell
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
" test 'taglist' function
|
||||
" test 'taglist' function and :tags command
|
||||
|
||||
func Test_taglist()
|
||||
call writefile([
|
||||
@@ -56,3 +56,8 @@ func Test_taglist_ctags_etags()
|
||||
|
||||
call delete('Xtags')
|
||||
endfunc
|
||||
|
||||
func Test_tags_too_long()
|
||||
call assert_fails('tag ' . repeat('x', 1020), 'E426')
|
||||
tags
|
||||
endfunc
|
||||
|
||||
@@ -467,4 +467,9 @@ func Test_window_contents()
|
||||
call test_garbagecollect_now()
|
||||
endfunc
|
||||
|
||||
func Test_window_colon_command()
|
||||
" This was reading invalid memory.
|
||||
exe "norm! v\<C-W>:\<C-U>echo v:version"
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
||||
@@ -1,126 +0,0 @@
|
||||
Test for wordcount() function
|
||||
|
||||
STARTTEST
|
||||
:so small.vim
|
||||
:so mbyte.vim
|
||||
:set enc=utf8
|
||||
:set selection=inclusive fileformat=unix fileformats=unix
|
||||
:new
|
||||
:fu DoRecordWin(...)
|
||||
: wincmd k
|
||||
: if exists("a:1")
|
||||
: call cursor(a:1)
|
||||
: endif
|
||||
: let result=[]
|
||||
: call add(result, g:test)
|
||||
: call add(result, getline(1, '$'))
|
||||
: call add(result, wordcount())
|
||||
: wincmd j
|
||||
: return result
|
||||
:endfu
|
||||
:fu PutInWindow(args)
|
||||
: wincmd k
|
||||
: %d _
|
||||
: call append(1, a:args)
|
||||
: wincmd j
|
||||
:endfu
|
||||
:fu Log()
|
||||
: $put ='----'
|
||||
: $put =remove(g:log,0)
|
||||
: $put =string(g:log)
|
||||
:endfu
|
||||
:fu! STL()
|
||||
: if mode() =~? 'V'
|
||||
: let g:visual_stat=wordcount()
|
||||
: endif
|
||||
: return string(wordcount())
|
||||
:endfu
|
||||
:let g:test="Test 1: empty window"
|
||||
:let log=DoRecordWin()
|
||||
:call Log()
|
||||
:"
|
||||
:let g:test="Test 2: some words, cursor at start"
|
||||
:call PutInWindow('one two three')
|
||||
:let log=DoRecordWin([1,1,0])
|
||||
:call Log()
|
||||
:"
|
||||
:let g:test="Test 3: some words, cursor at end"
|
||||
:call PutInWindow('one two three')
|
||||
:let log=DoRecordWin([2,99,0])
|
||||
:call Log()
|
||||
:"
|
||||
:let g:test="Test 4: some words, cursor at end, ve=all"
|
||||
:set ve=all
|
||||
:call PutInWindow('one two three')
|
||||
:let log=DoRecordWin([2,99,0])
|
||||
:call Log()
|
||||
:set ve=
|
||||
:"
|
||||
:let g:test="Test 5: several lines with words"
|
||||
:call PutInWindow(['one two three', 'one two three', 'one two three'])
|
||||
:let log=DoRecordWin([4,99,0])
|
||||
:call Log()
|
||||
:"
|
||||
:let g:test="Test 6: one line with BOM set"
|
||||
:call PutInWindow('one two three')
|
||||
:wincmd k
|
||||
:set bomb
|
||||
:w! Xtest
|
||||
:wincmd j
|
||||
:let log=DoRecordWin([2,99,0])
|
||||
:call Log()
|
||||
:wincmd k
|
||||
:set nobomb
|
||||
:w!
|
||||
:wincmd j
|
||||
:"
|
||||
:let g:test="Test 7: one line with multibyte words"
|
||||
:call PutInWindow(['Äne M¤ne Müh'])
|
||||
:let log=DoRecordWin([2,99,0])
|
||||
:call Log()
|
||||
:"
|
||||
:let g:test="Test 8: several lines with multibyte words"
|
||||
:call PutInWindow(['Äne M¤ne Müh', 'und raus bist dü!'])
|
||||
:let log=DoRecordWin([3,99,0])
|
||||
:call Log()
|
||||
:"
|
||||
:let g:test="Test 9: visual mode, complete buffer"
|
||||
:call PutInWindow(['Äne M¤ne Müh', 'und raus bist dü!'])
|
||||
:wincmd k
|
||||
:set ls=2 stl=%{STL()}
|
||||
:" start visual mode quickly and select complete buffer
|
||||
:0
|
||||
V2jy
|
||||
:set stl= ls=1
|
||||
:let log=DoRecordWin([3,99,0])
|
||||
:let log[2]=g:visual_stat
|
||||
:call Log()
|
||||
:"
|
||||
:let g:test="Test 10: visual mode (empty)"
|
||||
:call PutInWindow(['Äne M¤ne Müh', 'und raus bist dü!'])
|
||||
:wincmd k
|
||||
:set ls=2 stl=%{STL()}
|
||||
:" start visual mode quickly and select complete buffer
|
||||
:0
|
||||
v$y
|
||||
:set stl= ls=1
|
||||
:let log=DoRecordWin([3,99,0])
|
||||
:let log[2]=g:visual_stat
|
||||
:call Log()
|
||||
:"
|
||||
:let g:test="Test 11: visual mode, single line"
|
||||
:call PutInWindow(['Äne M¤ne Müh', 'und raus bist dü!'])
|
||||
:wincmd k
|
||||
:set ls=2 stl=%{STL()}
|
||||
:" start visual mode quickly and select complete buffer
|
||||
:2
|
||||
0v$y
|
||||
:set stl= ls=1
|
||||
:let log=DoRecordWin([3,99,0])
|
||||
:let log[2]=g:visual_stat
|
||||
:call Log()
|
||||
:"
|
||||
:/^RESULT test/,$w! test.out
|
||||
:qa!
|
||||
ENDTEST
|
||||
RESULT test:
|
||||
@@ -1,34 +0,0 @@
|
||||
RESULT test:
|
||||
----
|
||||
Test 1: empty window
|
||||
[[''], {'chars': 0, 'cursor_chars': 0, 'words': 0, 'cursor_words': 0, 'bytes': 0, 'cursor_bytes': 0}]
|
||||
----
|
||||
Test 2: some words, cursor at start
|
||||
[['', 'one two three'], {'chars': 15, 'cursor_chars': 1, 'words': 3, 'cursor_words': 0, 'bytes': 15, 'cursor_bytes': 1}]
|
||||
----
|
||||
Test 3: some words, cursor at end
|
||||
[['', 'one two three'], {'chars': 15, 'cursor_chars': 14, 'words': 3, 'cursor_words': 3, 'bytes': 15, 'cursor_bytes': 14}]
|
||||
----
|
||||
Test 4: some words, cursor at end, ve=all
|
||||
[['', 'one two three'], {'chars': 15, 'cursor_chars': 15, 'words': 3, 'cursor_words': 3, 'bytes': 15, 'cursor_bytes': 15}]
|
||||
----
|
||||
Test 5: several lines with words
|
||||
[['', 'one two three', 'one two three', 'one two three'], {'chars': 43, 'cursor_chars': 42, 'words': 9, 'cursor_words': 9, 'bytes': 43, 'cursor_bytes': 42}]
|
||||
----
|
||||
Test 6: one line with BOM set
|
||||
[['', 'one two three'], {'chars': 15, 'cursor_chars': 14, 'words': 3, 'cursor_words': 3, 'bytes': 18, 'cursor_bytes': 14}]
|
||||
----
|
||||
Test 7: one line with multibyte words
|
||||
[['', 'Äne M¤ne Müh'], {'chars': 14, 'cursor_chars': 13, 'words': 3, 'cursor_words': 3, 'bytes': 17, 'cursor_bytes': 16}]
|
||||
----
|
||||
Test 8: several lines with multibyte words
|
||||
[['', 'Äne M¤ne Müh', 'und raus bist dü!'], {'chars': 32, 'cursor_chars': 31, 'words': 7, 'cursor_words': 7, 'bytes': 36, 'cursor_bytes': 35}]
|
||||
----
|
||||
Test 9: visual mode, complete buffer
|
||||
[['', 'Äne M¤ne Müh', 'und raus bist dü!'], {'chars': 32, 'words': 7, 'bytes': 36, 'visual_chars': 32, 'visual_words': 7, 'visual_bytes': 36}]
|
||||
----
|
||||
Test 10: visual mode (empty)
|
||||
[['', 'Äne M¤ne Müh', 'und raus bist dü!'], {'chars': 32, 'words': 7, 'bytes': 36, 'visual_chars': 1, 'visual_words': 0, 'visual_bytes': 1}]
|
||||
----
|
||||
Test 11: visual mode, single line
|
||||
[['', 'Äne M¤ne Müh', 'und raus bist dü!'], {'chars': 32, 'words': 7, 'bytes': 36, 'visual_chars': 13, 'visual_words': 3, 'visual_bytes': 16}]
|
||||
@@ -0,0 +1,108 @@
|
||||
" Test for wordcount() function
|
||||
|
||||
if !has('multi_byte')
|
||||
finish
|
||||
endif
|
||||
|
||||
func Test_wordcount()
|
||||
let save_enc = &enc
|
||||
set encoding=utf-8
|
||||
set selection=inclusive fileformat=unix fileformats=unix
|
||||
|
||||
new
|
||||
|
||||
" Test 1: empty window
|
||||
call assert_equal({'chars': 0, 'cursor_chars': 0, 'words': 0, 'cursor_words': 0,
|
||||
\ 'bytes': 0, 'cursor_bytes': 0}, wordcount())
|
||||
|
||||
" Test 2: some words, cursor at start
|
||||
call append(1, 'one two three')
|
||||
call cursor([1, 1, 0])
|
||||
call assert_equal({'chars': 15, 'cursor_chars': 1, 'words': 3, 'cursor_words': 0,
|
||||
\ 'bytes': 15, 'cursor_bytes': 1}, wordcount())
|
||||
|
||||
" Test 3: some words, cursor at end
|
||||
%d _
|
||||
call append(1, 'one two three')
|
||||
call cursor([2, 99, 0])
|
||||
call assert_equal({'chars': 15, 'cursor_chars': 14, 'words': 3, 'cursor_words': 3,
|
||||
\ 'bytes': 15, 'cursor_bytes': 14}, wordcount())
|
||||
|
||||
" Test 4: some words, cursor at end, ve=all
|
||||
set ve=all
|
||||
%d _
|
||||
call append(1, 'one two three')
|
||||
call cursor([2, 99, 0])
|
||||
call assert_equal({'chars': 15, 'cursor_chars': 15, 'words': 3, 'cursor_words': 3,
|
||||
\ 'bytes': 15, 'cursor_bytes': 15}, wordcount())
|
||||
set ve=
|
||||
|
||||
" Test 5: several lines with words
|
||||
%d _
|
||||
call append(1, ['one two three', 'one two three', 'one two three'])
|
||||
call cursor([4, 99, 0])
|
||||
call assert_equal({'chars': 43, 'cursor_chars': 42, 'words': 9, 'cursor_words': 9,
|
||||
\ 'bytes': 43, 'cursor_bytes': 42}, wordcount())
|
||||
|
||||
" Test 6: one line with BOM set
|
||||
%d _
|
||||
call append(1, 'one two three')
|
||||
set bomb
|
||||
w! Xtest
|
||||
call cursor([2, 99, 0])
|
||||
call assert_equal({'chars': 15, 'cursor_chars': 14, 'words': 3, 'cursor_words': 3,
|
||||
\ 'bytes': 18, 'cursor_bytes': 14}, wordcount())
|
||||
set nobomb
|
||||
w!
|
||||
call delete('Xtest')
|
||||
|
||||
" Test 7: one line with multibyte words
|
||||
%d _
|
||||
call append(1, ['Äne M¤ne Müh'])
|
||||
call cursor([2, 99, 0])
|
||||
call assert_equal({'chars': 14, 'cursor_chars': 13, 'words': 3, 'cursor_words': 3,
|
||||
\ 'bytes': 17, 'cursor_bytes': 16}, wordcount())
|
||||
|
||||
" Test 8: several lines with multibyte words
|
||||
%d _
|
||||
call append(1, ['Äne M¤ne Müh', 'und raus bist dü!'])
|
||||
call cursor([3, 99, 0])
|
||||
call assert_equal({'chars': 32, 'cursor_chars': 31, 'words': 7, 'cursor_words': 7,
|
||||
\ 'bytes': 36, 'cursor_bytes': 35}, wordcount())
|
||||
|
||||
" Visual map to capture wordcount() in visual mode
|
||||
vnoremap <expr> <F2> execute("let g:visual_stat = wordcount()")
|
||||
|
||||
" Test 9: visual mode, complete buffer
|
||||
let g:visual_stat = {}
|
||||
%d _
|
||||
call append(1, ['Äne M¤ne Müh', 'und raus bist dü!'])
|
||||
" start visual mode and select the complete buffer
|
||||
0
|
||||
exe "normal V2j\<F2>y"
|
||||
call assert_equal({'chars': 32, 'words': 7, 'bytes': 36, 'visual_chars': 32,
|
||||
\ 'visual_words': 7, 'visual_bytes': 36}, g:visual_stat)
|
||||
|
||||
" Test 10: visual mode (empty)
|
||||
%d _
|
||||
call append(1, ['Äne M¤ne Müh', 'und raus bist dü!'])
|
||||
" start visual mode and select the complete buffer
|
||||
0
|
||||
exe "normal v$\<F2>y"
|
||||
call assert_equal({'chars': 32, 'words': 7, 'bytes': 36, 'visual_chars': 1,
|
||||
\ 'visual_words': 0, 'visual_bytes': 1}, g:visual_stat)
|
||||
|
||||
" Test 11: visual mode, single line
|
||||
%d _
|
||||
call append(1, ['Äne M¤ne Müh', 'und raus bist dü!'])
|
||||
" start visual mode and select the complete buffer
|
||||
2
|
||||
exe "normal 0v$\<F2>y"
|
||||
call assert_equal({'chars': 32, 'words': 7, 'bytes': 36, 'visual_chars': 13,
|
||||
\ 'visual_words': 3, 'visual_bytes': 16}, g:visual_stat)
|
||||
|
||||
set selection& fileformat& fileformats&
|
||||
let &enc = save_enc
|
||||
enew!
|
||||
close
|
||||
endfunc
|
||||
@@ -32,7 +32,7 @@ ui_write(char_u *s, int len)
|
||||
{
|
||||
gui_write(s, len);
|
||||
if (p_wd)
|
||||
gui_wait_for_chars(p_wd);
|
||||
gui_wait_for_chars(p_wd, typebuf.tb_change_cnt);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
@@ -182,18 +182,13 @@ ui_inchar(
|
||||
|
||||
#ifdef FEAT_GUI
|
||||
if (gui.in_use)
|
||||
{
|
||||
if (gui_wait_for_chars(wtime) && !typebuf_changed(tb_change_cnt))
|
||||
retval = read_from_input_buf(buf, (long)maxlen);
|
||||
}
|
||||
retval = gui_inchar(buf, maxlen, wtime, tb_change_cnt);
|
||||
#endif
|
||||
#ifndef NO_CONSOLE
|
||||
# ifdef FEAT_GUI
|
||||
else
|
||||
# endif
|
||||
{
|
||||
retval = mch_inchar(buf, maxlen, wtime, tb_change_cnt);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (wtime == -1 || wtime > 100L)
|
||||
@@ -212,6 +207,52 @@ theend:
|
||||
return retval;
|
||||
}
|
||||
|
||||
#if defined(FEAT_TIMERS) || defined(PROT)
|
||||
/*
|
||||
* Wait for a timer to fire or "wait_func" to return non-zero.
|
||||
* Returns OK when something was read.
|
||||
* Returns FAIL when it timed out or was interrupted.
|
||||
*/
|
||||
int
|
||||
ui_wait_for_chars_or_timer(
|
||||
long wtime,
|
||||
int (*wait_func)(long wtime, int *interrupted, int ignore_input),
|
||||
int *interrupted,
|
||||
int ignore_input)
|
||||
{
|
||||
int due_time;
|
||||
long remaining = wtime;
|
||||
int tb_change_cnt = typebuf.tb_change_cnt;
|
||||
|
||||
/* When waiting very briefly don't trigger timers. */
|
||||
if (wtime >= 0 && wtime < 10L)
|
||||
return wait_func(wtime, NULL, ignore_input);
|
||||
|
||||
while (wtime < 0 || remaining > 0)
|
||||
{
|
||||
/* Trigger timers and then get the time in wtime until the next one is
|
||||
* due. Wait up to that time. */
|
||||
due_time = check_due_timer();
|
||||
if (typebuf.tb_change_cnt != tb_change_cnt)
|
||||
{
|
||||
/* timer may have used feedkeys() */
|
||||
return FAIL;
|
||||
}
|
||||
if (due_time <= 0 || (wtime > 0 && due_time > remaining))
|
||||
due_time = remaining;
|
||||
if (wait_func(due_time, interrupted, ignore_input))
|
||||
return OK;
|
||||
if (interrupted != NULL && *interrupted)
|
||||
/* Nothing available, but need to return so that side effects get
|
||||
* handled, such as handling a message on a channel. */
|
||||
return FALSE;
|
||||
if (wtime > 0)
|
||||
remaining -= due_time;
|
||||
}
|
||||
return FAIL;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* return non-zero if a character is available
|
||||
*/
|
||||
@@ -245,7 +286,7 @@ ui_delay(long msec, int ignoreinput)
|
||||
{
|
||||
#ifdef FEAT_GUI
|
||||
if (gui.in_use && !ignoreinput)
|
||||
gui_wait_for_chars(msec);
|
||||
gui_wait_for_chars(msec, typebuf.tb_change_cnt);
|
||||
else
|
||||
#endif
|
||||
{
|
||||
|
||||
+11
@@ -3523,6 +3523,8 @@ u_save_line(linenr_T lnum)
|
||||
* Check if the 'modified' flag is set, or 'ff' has changed (only need to
|
||||
* check the first character, because it can only be "dos", "unix" or "mac").
|
||||
* "nofile" and "scratch" type buffers are considered to always be unchanged.
|
||||
* Also considers a buffer changed when a terminal window contains a running
|
||||
* job.
|
||||
*/
|
||||
int
|
||||
bufIsChanged(buf_T *buf)
|
||||
@@ -3531,6 +3533,15 @@ bufIsChanged(buf_T *buf)
|
||||
if (term_job_running(buf->b_term))
|
||||
return TRUE;
|
||||
#endif
|
||||
return bufIsChangedNotTerm(buf);
|
||||
}
|
||||
|
||||
/*
|
||||
* Like bufIsChanged() but ignoring a terminal window.
|
||||
*/
|
||||
int
|
||||
bufIsChangedNotTerm(buf_T *buf)
|
||||
{
|
||||
return !bt_dontwrite(buf)
|
||||
&& (buf->b_changed || file_ff_differs(buf, TRUE));
|
||||
}
|
||||
|
||||
+2
-2
@@ -1594,7 +1594,7 @@ trans_function_name(
|
||||
start += lead;
|
||||
|
||||
/* Note that TFN_ flags use the same values as GLV_ flags. */
|
||||
end = get_lval(start, NULL, &lv, FALSE, skip, flags,
|
||||
end = get_lval(start, NULL, &lv, FALSE, skip, flags | GLV_READ_ONLY,
|
||||
lead > 2 ? 0 : FNE_CHECK_START);
|
||||
if (end == start)
|
||||
{
|
||||
@@ -1886,7 +1886,7 @@ ex_function(exarg_T *eap)
|
||||
* g:func global function name, same as "func"
|
||||
*/
|
||||
p = eap->arg;
|
||||
name = trans_function_name(&p, eap->skip, 0, &fudi, NULL);
|
||||
name = trans_function_name(&p, eap->skip, TFN_NO_AUTOLOAD, &fudi, NULL);
|
||||
paren = (vim_strchr(p, '(') != NULL);
|
||||
if (name == NULL && (fudi.fd_dict == NULL || !paren) && !eap->skip)
|
||||
{
|
||||
|
||||
@@ -786,6 +786,94 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
1420,
|
||||
/**/
|
||||
1419,
|
||||
/**/
|
||||
1418,
|
||||
/**/
|
||||
1417,
|
||||
/**/
|
||||
1416,
|
||||
/**/
|
||||
1415,
|
||||
/**/
|
||||
1414,
|
||||
/**/
|
||||
1413,
|
||||
/**/
|
||||
1412,
|
||||
/**/
|
||||
1411,
|
||||
/**/
|
||||
1410,
|
||||
/**/
|
||||
1409,
|
||||
/**/
|
||||
1408,
|
||||
/**/
|
||||
1407,
|
||||
/**/
|
||||
1406,
|
||||
/**/
|
||||
1405,
|
||||
/**/
|
||||
1404,
|
||||
/**/
|
||||
1403,
|
||||
/**/
|
||||
1402,
|
||||
/**/
|
||||
1401,
|
||||
/**/
|
||||
1400,
|
||||
/**/
|
||||
1399,
|
||||
/**/
|
||||
1398,
|
||||
/**/
|
||||
1397,
|
||||
/**/
|
||||
1396,
|
||||
/**/
|
||||
1395,
|
||||
/**/
|
||||
1394,
|
||||
/**/
|
||||
1393,
|
||||
/**/
|
||||
1392,
|
||||
/**/
|
||||
1391,
|
||||
/**/
|
||||
1390,
|
||||
/**/
|
||||
1389,
|
||||
/**/
|
||||
1388,
|
||||
/**/
|
||||
1387,
|
||||
/**/
|
||||
1386,
|
||||
/**/
|
||||
1385,
|
||||
/**/
|
||||
1384,
|
||||
/**/
|
||||
1383,
|
||||
/**/
|
||||
1382,
|
||||
/**/
|
||||
1381,
|
||||
/**/
|
||||
1380,
|
||||
/**/
|
||||
1379,
|
||||
/**/
|
||||
1378,
|
||||
/**/
|
||||
1377,
|
||||
/**/
|
||||
1376,
|
||||
/**/
|
||||
|
||||
@@ -1341,6 +1341,7 @@ enum auto_event
|
||||
EVENT_TEXTCHANGEDI, /* text was modified in Insert mode*/
|
||||
EVENT_CMDUNDEFINED, /* command undefined */
|
||||
EVENT_OPTIONSET, /* option was set */
|
||||
EVENT_TEXTYANKPOST, /* after some text was yanked */
|
||||
NUM_EVENTS /* MUST be the last one */
|
||||
};
|
||||
|
||||
@@ -1990,7 +1991,8 @@ typedef int sock_T;
|
||||
#define VV_TERMU7RESP 83
|
||||
#define VV_TERMSTYLERESP 84
|
||||
#define VV_TERMBLINKRESP 85
|
||||
#define VV_LEN 86 /* number of v: vars */
|
||||
#define VV_EVENT 86
|
||||
#define VV_LEN 87 /* number of v: vars */
|
||||
|
||||
/* used for v_number in VAR_SPECIAL */
|
||||
#define VVAL_FALSE 0L
|
||||
|
||||
Reference in New Issue
Block a user