mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-02 11:19:22 +02:00
Compare commits
60 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 239a7e4f53 | |||
| 4d9d4ac26a | |||
| 7756e7465d | |||
| bbfcd01b07 | |||
| bb09ceb954 | |||
| 025e3e0baf | |||
| 9ec7fa82a2 | |||
| 3611fbfb56 | |||
| cbd3bd6cbe | |||
| a77a9b24dc | |||
| 869e35270e | |||
| 8507747600 | |||
| 265671c4a9 | |||
| 04d045a60f | |||
| d7e940584b | |||
| e9a431e6c3 | |||
| 3b3d235308 | |||
| a1a9cc7ef6 | |||
| 2ae331a486 | |||
| 156919f99a | |||
| ca291aec99 | |||
| 0a9046fbcb | |||
| 97792de276 | |||
| 472e85970e | |||
| 9e507ca8a3 | |||
| a6c27ee6db | |||
| 673a11a9d1 | |||
| 01765cd070 | |||
| 39c4be7ac4 | |||
| 9172041601 | |||
| 4575876dc8 | |||
| 3e8474dd50 | |||
| e8ef3a0934 | |||
| 0ba407012c | |||
| cea912af72 | |||
| a7c023ec88 | |||
| 4cf97cebcf | |||
| 0f16ec94a6 | |||
| dc08328821 | |||
| a8e1b3df21 | |||
| b28f194bcf | |||
| a550884a40 | |||
| 96dc4e1390 | |||
| 8743ed43c8 | |||
| 1e00286144 | |||
| dc0ccaee68 | |||
| 9b45794818 | |||
| 936c48f8ca | |||
| 8ddef48d1e | |||
| 70d6f82178 | |||
| 226630a030 | |||
| d22cb61149 | |||
| ec68a99464 | |||
| 8610e74d73 | |||
| 84dbd494dc | |||
| d76626f3c9 | |||
| 6100d02aab | |||
| 6c585c1bfd | |||
| c036347336 | |||
| 2ec618c9fe |
@@ -1,6 +1,6 @@
|
||||
" Vim autoload file for editing compressed files.
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2014 Nov 05
|
||||
" Last Change: 2016 Sep 28
|
||||
|
||||
" These functions are used by the gzip plugin.
|
||||
|
||||
@@ -63,6 +63,9 @@ fun gzip#read(cmd)
|
||||
" set 'modifiable'
|
||||
let ma_save = &ma
|
||||
setlocal ma
|
||||
" set 'write'
|
||||
let write_save = &write
|
||||
set write
|
||||
" Reset 'foldenable', otherwise line numbers get adjusted.
|
||||
if has("folding")
|
||||
let fen_save = &fen
|
||||
@@ -127,6 +130,7 @@ fun gzip#read(cmd)
|
||||
let &pm = pm_save
|
||||
let &cpo = cpo_save
|
||||
let &l:ma = ma_save
|
||||
let &write = write_save
|
||||
if has("folding")
|
||||
let &l:fen = fen_save
|
||||
endif
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
" Maintainer: Dávid Szabó ( complex857 AT gmail DOT com )
|
||||
" Previous Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
|
||||
" URL: https://github.com/shawncplus/phpcomplete.vim
|
||||
" Last Change: 2015 Jul 13
|
||||
" Last Change: 2016 Oct 10
|
||||
"
|
||||
" OPTIONS:
|
||||
"
|
||||
@@ -195,6 +195,8 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{
|
||||
" }}}
|
||||
elseif context =~? 'implements'
|
||||
return phpcomplete#CompleteClassName(a:base, ['i'], current_namespace, imports)
|
||||
elseif context =~? 'instanceof'
|
||||
return phpcomplete#CompleteClassName(a:base, ['c', 'n'], current_namespace, imports)
|
||||
elseif context =~? 'extends\s\+.\+$' && a:base == ''
|
||||
return ['implements']
|
||||
elseif context =~? 'extends'
|
||||
@@ -787,6 +789,8 @@ function! phpcomplete#CompleteClassName(base, kinds, current_namespace, imports)
|
||||
|
||||
if kinds == ['c', 'i']
|
||||
let filterstr = 'v:val =~? "\\(class\\|interface\\)\\s\\+[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*"'
|
||||
elseif kinds == ['c', 'n']
|
||||
let filterstr = 'v:val =~? "\\(class\\|namespace\\)\\s\\+[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*"'
|
||||
elseif kinds == ['c']
|
||||
let filterstr = 'v:val =~? "class\\s\\+[a-zA-Z_\\x7f-\\xff][a-zA-Z_0-9\\x7f-\\xff]*\\s*"'
|
||||
elseif kinds == ['i']
|
||||
@@ -996,7 +1000,7 @@ function! phpcomplete#CompleteUserClass(context, base, sccontent, visibility) "
|
||||
let required_modifiers += ['static']
|
||||
endif
|
||||
let all_variable = filter(deepcopy(a:sccontent),
|
||||
\ 'v:val =~ "^\\s*\\(var\\s\\+\\|public\\s\\+\\|protected\\s\\+\\|private\\s\\+\\|final\\s\\+\\|abstract\\s\\+\\|static\\s\\+\\)\\+\\$"')
|
||||
\ 'v:val =~ "\\(^\\s*\\(var\\s\\+\\|public\\s\\+\\|protected\\s\\+\\|private\\s\\+\\|final\\s\\+\\|abstract\\s\\+\\|static\\s\\+\\)\\+\\$\\|^\\s*\\(\\/\\|\\*\\)*\\s*@property\\s\\+\\S\\+\\s\\S\\{-}\\s*$\\)"')
|
||||
|
||||
let variables = []
|
||||
for i in all_variable
|
||||
@@ -1160,6 +1164,14 @@ function! phpcomplete#GetTaglist(pattern) " {{{
|
||||
endif
|
||||
|
||||
let tags = taglist(a:pattern)
|
||||
for tag in tags
|
||||
for prop in keys(tag)
|
||||
if prop == 'cmd' || prop == 'static' || prop == 'kind' || prop == 'builtin'
|
||||
continue
|
||||
endif
|
||||
let tag[prop] = substitute(tag[prop], '\\\\', '\\', 'g')
|
||||
endfor
|
||||
endfor
|
||||
let s:cache_tags[a:pattern] = tags
|
||||
let has_key = has_key(s:cache_tags, a:pattern)
|
||||
let s:cache_tags_checksum = cache_checksum
|
||||
@@ -1379,7 +1391,7 @@ function! phpcomplete#GetCallChainReturnType(classname_candidate, class_candidat
|
||||
" Get Structured information of all classes and subclasses including namespace and includes
|
||||
" try to find the method's return type in docblock comment
|
||||
for classstructure in classcontents
|
||||
let docblock_target_pattern = 'function\s\+&\?'.method.'\|\(public\|private\|protected\|var\).\+\$'.method
|
||||
let docblock_target_pattern = 'function\s\+&\?'.method.'\>\|\(public\|private\|protected\|var\).\+\$'.method.'\>\|@property.\+\$'.method.'\>'
|
||||
let doc_str = phpcomplete#GetDocBlock(split(classstructure.content, '\n'), docblock_target_pattern)
|
||||
if doc_str != ''
|
||||
break
|
||||
@@ -1387,8 +1399,17 @@ function! phpcomplete#GetCallChainReturnType(classname_candidate, class_candidat
|
||||
endfor
|
||||
if doc_str != ''
|
||||
let docblock = phpcomplete#ParseDocBlock(doc_str)
|
||||
if has_key(docblock.return, 'type') || has_key(docblock.var, 'type')
|
||||
let type = has_key(docblock.return, 'type') ? docblock.return.type : docblock.var.type
|
||||
if has_key(docblock.return, 'type') || has_key(docblock.var, 'type') || len(docblock.properties) > 0
|
||||
let type = has_key(docblock.return, 'type') ? docblock.return.type : has_key(docblock.var, 'type') ? docblock.var.type : ''
|
||||
|
||||
if type == ''
|
||||
for property in docblock.properties
|
||||
if property.description =~? method
|
||||
let type = property.type
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
|
||||
" there's a namespace in the type, threat the type as FQCN
|
||||
if type =~ '\\'
|
||||
@@ -1554,6 +1575,9 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
elseif get(methodstack, 0) =~# function_invocation_pattern
|
||||
let function_name = matchstr(methodstack[0], '^\s*\zs'.function_name_pattern)
|
||||
let function_file = phpcomplete#GetFunctionLocation(function_name, a:current_namespace)
|
||||
if function_file == ''
|
||||
let function_file = phpcomplete#GetFunctionLocation(function_name, '\')
|
||||
endif
|
||||
|
||||
if function_file == 'VIMPHP_BUILTINFUNCTION'
|
||||
" built in function, grab the return type from the info string
|
||||
@@ -1569,7 +1593,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
let [class_candidate_namespace, function_imports] = phpcomplete#GetCurrentNameSpace(file_lines)
|
||||
" try to expand the classname of the returned type with the context got from the function's source file
|
||||
|
||||
let [classname_candidate, unused] = phpcomplete#ExpandClassName(classname_candidate, class_candidate_namespace, function_imports)
|
||||
let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, class_candidate_namespace, function_imports)
|
||||
endif
|
||||
endif
|
||||
if classname_candidate != ''
|
||||
@@ -1650,9 +1674,10 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
let sub_methodstack = phpcomplete#GetMethodStack(matchstr(line, '^\s*'.object.'\s*=&\?\s*\s\+\zs.*'))
|
||||
let [classname_candidate, class_candidate_namespace] = phpcomplete#GetCallChainReturnType(
|
||||
\ classname,
|
||||
\ a:current_namespace,
|
||||
\ namespace_for_class,
|
||||
\ a:imports,
|
||||
\ sub_methodstack)
|
||||
|
||||
return (class_candidate_namespace == '\' || class_candidate_namespace == '') ? classname_candidate : class_candidate_namespace.'\'.classname_candidate
|
||||
endif
|
||||
endif
|
||||
@@ -1783,6 +1808,9 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
let [function_name, function_namespace] = phpcomplete#ExpandClassName(function_name, a:current_namespace, a:imports)
|
||||
|
||||
let function_file = phpcomplete#GetFunctionLocation(function_name, function_namespace)
|
||||
if function_file == ''
|
||||
let function_file = phpcomplete#GetFunctionLocation(function_name, '\')
|
||||
endif
|
||||
|
||||
if function_file == 'VIMPHP_BUILTINFUNCTION'
|
||||
" built in function, grab the return type from the info string
|
||||
@@ -1798,7 +1826,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
let classname_candidate = docblock.return.type
|
||||
let [class_candidate_namespace, function_imports] = phpcomplete#GetCurrentNameSpace(file_lines)
|
||||
" try to expand the classname of the returned type with the context got from the function's source file
|
||||
let [classname_candidate, unused] = phpcomplete#ExpandClassName(classname_candidate, class_candidate_namespace, function_imports)
|
||||
let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, class_candidate_namespace, function_imports)
|
||||
break
|
||||
endif
|
||||
endif
|
||||
@@ -1861,6 +1889,8 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
||||
for tag in tags
|
||||
if tag.kind ==? 'v' && tag.cmd =~? '=\s*new\s\+\zs'.class_name_pattern.'\ze'
|
||||
let classname = matchstr(tag.cmd, '=\s*new\s\+\zs'.class_name_pattern.'\ze')
|
||||
" unescape the classname, it would have "\" doubled since it is an ex command
|
||||
let classname = substitute(classname, '\\\(\_.\)', '\1', 'g')
|
||||
return classname
|
||||
endif
|
||||
endfor
|
||||
@@ -2077,6 +2107,19 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
|
||||
endif
|
||||
call searchpair('{', '', '}', 'W')
|
||||
let class_closing_bracket_line = line('.')
|
||||
|
||||
" Include class docblock
|
||||
let doc_line = cfline - 1
|
||||
if getline(doc_line) =~? '^\s*\*/'
|
||||
while doc_line != 0
|
||||
if getline(doc_line) =~? '^\s*/\*\*'
|
||||
let cfline = doc_line
|
||||
break
|
||||
endif
|
||||
let doc_line -= 1
|
||||
endwhile
|
||||
endif
|
||||
|
||||
let classcontent = join(getline(cfline, class_closing_bracket_line), "\n")
|
||||
|
||||
let used_traits = []
|
||||
@@ -2241,8 +2284,19 @@ function! phpcomplete#GetDocBlock(sccontent, search) " {{{
|
||||
let line = a:sccontent[i]
|
||||
" search for a function declaration
|
||||
if line =~? a:search
|
||||
let l = i - 1
|
||||
" start backward serch for the comment block
|
||||
if line =~? '@property'
|
||||
let doc_line = i
|
||||
while doc_line != sccontent_len - 1
|
||||
if a:sccontent[doc_line] =~? '^\s*\*/'
|
||||
let l = doc_line
|
||||
break
|
||||
endif
|
||||
let doc_line += 1
|
||||
endwhile
|
||||
else
|
||||
let l = i - 1
|
||||
endif
|
||||
" start backward search for the comment block
|
||||
while l != 0
|
||||
let line = a:sccontent[l]
|
||||
" if it's a one line docblock like comment and we can just return it right away
|
||||
@@ -2263,7 +2317,7 @@ function! phpcomplete#GetDocBlock(sccontent, search) " {{{
|
||||
return ''
|
||||
end
|
||||
|
||||
while l != 0
|
||||
while l >= 0
|
||||
let line = a:sccontent[l]
|
||||
if line =~? '^\s*/\*\*'
|
||||
let comment_start = l
|
||||
@@ -2297,9 +2351,10 @@ function! phpcomplete#ParseDocBlock(docblock) " {{{
|
||||
\ 'return': {},
|
||||
\ 'throws': [],
|
||||
\ 'var': {},
|
||||
\ 'properties': [],
|
||||
\ }
|
||||
|
||||
let res.description = substitute(matchstr(a:docblock, '\zs\_.\{-}\ze\(@var\|@param\|@return\|$\)'), '\(^\_s*\|\_s*$\)', '', 'g')
|
||||
let res.description = substitute(matchstr(a:docblock, '\zs\_.\{-}\ze\(@type\|@var\|@param\|@return\|$\)'), '\(^\_s*\|\_s*$\)', '', 'g')
|
||||
let docblock_lines = split(a:docblock, "\n")
|
||||
|
||||
let param_lines = filter(copy(docblock_lines), 'v:val =~? "^@param"')
|
||||
@@ -2334,15 +2389,26 @@ function! phpcomplete#ParseDocBlock(docblock) " {{{
|
||||
endif
|
||||
endfor
|
||||
|
||||
let var_line = filter(copy(docblock_lines), 'v:val =~? "^@var"')
|
||||
let var_line = filter(copy(docblock_lines), 'v:val =~? "^\\(@var\\|@type\\)"')
|
||||
if len(var_line) > 0
|
||||
let var_parts = matchlist(var_line[0], '@var\s\+\(\S\+\)\s*\(.*\)')
|
||||
let var_parts = matchlist(var_line[0], '\(@var\|@type\)\s\+\(\S\+\)\s*\(.*\)')
|
||||
let res['var'] = {
|
||||
\ 'line': var_parts[0],
|
||||
\ 'type': phpcomplete#GetTypeFromDocBlockParam(get(var_parts, 1, '')),
|
||||
\ 'description': get(var_parts, 2, '')}
|
||||
\ 'type': phpcomplete#GetTypeFromDocBlockParam(get(var_parts, 2, '')),
|
||||
\ 'description': get(var_parts, 3, '')}
|
||||
endif
|
||||
|
||||
let property_lines = filter(copy(docblock_lines), 'v:val =~? "^@property"')
|
||||
for property_line in property_lines
|
||||
let parts = matchlist(property_line, '\(@property\)\s\+\(\S\+\)\s*\(.*\)')
|
||||
if len(parts) > 0
|
||||
call add(res.properties, {
|
||||
\ 'line': parts[0],
|
||||
\ 'type': phpcomplete#GetTypeFromDocBlockParam(get(parts, 2, '')),
|
||||
\ 'description': get(parts, 3, '')})
|
||||
endif
|
||||
endfor
|
||||
|
||||
return res
|
||||
endfunction
|
||||
" }}}
|
||||
@@ -2498,6 +2564,7 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
|
||||
let name = matchstr(name, '\\\zs[^\\]\+\ze$')
|
||||
endif
|
||||
endif
|
||||
|
||||
" leading slash is not required use imports are always absolute
|
||||
let imports[name] = {'name': object, 'kind': ''}
|
||||
endfor
|
||||
@@ -2533,6 +2600,7 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
|
||||
elseif !exists('no_namespace_candidate')
|
||||
" save the first namespacless match to be used if no better
|
||||
" candidate found later on
|
||||
let tag.namespace = namespace_for_classes
|
||||
let no_namespace_candidate = tag
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -196,7 +196,7 @@ function! rubycomplete#Complete(findstart, base)
|
||||
if c =~ '\w'
|
||||
continue
|
||||
elseif ! c =~ '\.'
|
||||
idx = -1
|
||||
let idx = -1
|
||||
break
|
||||
else
|
||||
break
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
" Vim color file
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2006 Apr 14
|
||||
" Last Change: 2016 Oct 10
|
||||
|
||||
" This color scheme uses a dark grey background.
|
||||
|
||||
@@ -46,8 +46,8 @@ hi CursorColumn term=reverse ctermbg=Black guibg=grey40
|
||||
hi CursorLine term=underline cterm=underline guibg=grey40
|
||||
|
||||
" Groups for syntax highlighting
|
||||
hi Constant term=underline ctermfg=Magenta guifg=#ffa0a0 guibg=grey5
|
||||
hi Special term=bold ctermfg=LightRed guifg=Orange guibg=grey5
|
||||
hi Constant term=underline ctermfg=Magenta guifg=#ffa0a0
|
||||
hi Special term=bold ctermfg=LightRed guifg=Orange
|
||||
if &t_Co > 8
|
||||
hi Statement term=bold cterm=bold ctermfg=Yellow guifg=#ffff60 gui=bold
|
||||
endif
|
||||
|
||||
+14
-5
@@ -1,4 +1,4 @@
|
||||
*autocmd.txt* For Vim version 8.0. Last change: 2016 Sep 21
|
||||
*autocmd.txt* For Vim version 8.0. Last change: 2016 Sep 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -79,11 +79,15 @@ exception is that "<sfile>" is expanded when the autocmd is defined. Example:
|
||||
|
||||
Here Vim expands <sfile> to the name of the file containing this line.
|
||||
|
||||
When your .vimrc file is sourced twice, the autocommands will appear twice.
|
||||
To avoid this, put this command in your .vimrc file, before defining
|
||||
autocommands: >
|
||||
`:autocmd` adds to the list of autocommands regardless of whether they are
|
||||
already present. When your .vimrc file is sourced twice, the autocommands
|
||||
will appear twice. To avoid this, define your autocommands in a group, so
|
||||
that you can easily clear them: >
|
||||
|
||||
:autocmd! " Remove ALL autocommands for the current group.
|
||||
augroup vimrc
|
||||
autocmd! " Remove all vimrc autocommands
|
||||
au BufNewFile,BufRead *.html so <sfile>:h/html.vim
|
||||
augroup END
|
||||
|
||||
If you don't want to remove all autocommands, you can instead use a variable
|
||||
to ensure that Vim includes the autocommands only once: >
|
||||
@@ -130,8 +134,13 @@ prompt. When one command outputs two messages this can happen anyway.
|
||||
|
||||
:au[tocmd]! [group] {event}
|
||||
Remove ALL autocommands for {event}.
|
||||
Warning: You should not do this without a group for
|
||||
|BufRead| and other common events, it can break
|
||||
plugins, syntax highlighting, etc.
|
||||
|
||||
:au[tocmd]! [group] Remove ALL autocommands.
|
||||
Warning: You should normally not do this without a
|
||||
group, it breaks plugins, syntax highlighting, etc.
|
||||
|
||||
When the [group] argument is not given, Vim uses the current group (as defined
|
||||
with ":augroup"); otherwise, Vim uses the group defined with [group].
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*change.txt* For Vim version 8.0. Last change: 2016 Sep 11
|
||||
*change.txt* For Vim version 8.0. Last change: 2016 Oct 02
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -913,8 +913,7 @@ Exceptions:
|
||||
Substitute with an expression *sub-replace-expression*
|
||||
*sub-replace-\=* *s/\=*
|
||||
When the substitute string starts with "\=" the remainder is interpreted as an
|
||||
expression. This does not work recursively: a |substitute()| function inside
|
||||
the expression cannot use "\=" for the substitute string.
|
||||
expression.
|
||||
|
||||
The special meaning for characters as mentioned at |sub-replace-special| does
|
||||
not apply except for "<CR>". A <NL> character is used as a line break, you
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*channel.txt* For Vim version 8.0. Last change: 2016 Sep 20
|
||||
*channel.txt* For Vim version 8.0. Last change: 2016 Sep 29
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -465,6 +465,11 @@ it like this: >
|
||||
Without the handler you need to read the output with |ch_read()| or
|
||||
|ch_readraw()|. You can do this in the close callback, see |read-in-close-cb|.
|
||||
|
||||
Note that if the job exits before you read the output, the output may be lost.
|
||||
This depends on the system (on Unix this happens because closing the write end
|
||||
of a pipe causes the read end to get EOF). To avoid this make the job sleep
|
||||
for a short while before it exits.
|
||||
|
||||
The handler defined for "out_cb" will not receive stderr. If you want to
|
||||
handle that separately, add an "err_cb" handler: >
|
||||
let job = job_start(command, {"out_cb": "MyHandler",
|
||||
@@ -516,7 +521,7 @@ If the job can take some time and you don't need intermediate results, you can
|
||||
add a close callback and read the output there: >
|
||||
|
||||
func! CloseHandler(channel)
|
||||
while ch_status(a:channel) == 'buffered'
|
||||
while ch_status(a:channel, {'part': 'out'}) == 'buffered'
|
||||
echomsg ch_read(a:channel)
|
||||
endwhile
|
||||
endfunc
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*cmdline.txt* For Vim version 8.0. Last change: 2016 Aug 27
|
||||
*cmdline.txt* For Vim version 8.0. Last change: 2016 Sep 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -229,9 +229,10 @@ CTRL-Y When there is a modeless selection, copy the selection into
|
||||
the clipboard. |modeless-selection|
|
||||
If there is no selection CTRL-Y is inserted as a character.
|
||||
|
||||
CTRL-J *c_CTRL-J* *c_<NL>* *c_<CR>* *c_CR*
|
||||
CTRL-M or CTRL-J *c_CTRL-M* *c_CTRL-J* *c_<NL>* *c_<CR>* *c_CR*
|
||||
<CR> or <NL> start entered command
|
||||
*c_<Esc>* *c_Esc*
|
||||
|
||||
CTRL-[ *c_CTRL-[* *c_<Esc>* *c_Esc*
|
||||
<Esc> When typed and 'x' not present in 'cpoptions', quit
|
||||
Command-line mode without executing. In macros or when 'x'
|
||||
present in 'cpoptions', start entered command.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*editing.txt* For Vim version 8.0. Last change: 2016 Aug 06
|
||||
*editing.txt* For Vim version 8.0. Last change: 2016 Sep 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -181,7 +181,8 @@ start editing another file, Vim will refuse this. In order to overrule this
|
||||
protection, add a '!' to the command. The changes will then be lost. For
|
||||
example: ":q" will not work if the buffer was changed, but ":q!" will. To see
|
||||
whether the buffer was changed use the "CTRL-G" command. The message includes
|
||||
the string "[Modified]" if the buffer has been changed.
|
||||
the string "[Modified]" if the buffer has been changed, or "+" if the 'm' flag
|
||||
is in 'shortmess'.
|
||||
|
||||
If you want to automatically save the changes without asking, switch on the
|
||||
'autowriteall' option. 'autowrite' is the associated Vi-compatible option
|
||||
|
||||
+12
-7
@@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 8.0. Last change: 2016 Sep 25
|
||||
*eval.txt* For Vim version 8.0. Last change: 2016 Oct 02
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -3072,7 +3072,7 @@ ch_log({msg} [, {handle}]) *ch_log()*
|
||||
When {handle} is passed the channel number is used for the
|
||||
message.
|
||||
{handle} can be Channel or a Job that has a Channel. The
|
||||
Channel must open.
|
||||
Channel must be open for the channel number to be used.
|
||||
|
||||
ch_logfile({fname} [, {mode}]) *ch_logfile()*
|
||||
Start logging channel activity to {fname}.
|
||||
@@ -3738,7 +3738,7 @@ filter({expr1}, {expr2}) *filter()*
|
||||
call filter(myList, {idx, val -> idx * val <= 42})
|
||||
< If you do not use "val" you can leave it out: >
|
||||
call filter(myList, {idx -> idx % 2 == 1})
|
||||
|
||||
<
|
||||
The operation is done in-place. If you want a |List| or
|
||||
|Dictionary| to remain unmodified make a copy first: >
|
||||
:let l = filter(copy(mylist), 'v:val =~ "KEEP"')
|
||||
@@ -4287,7 +4287,9 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()*
|
||||
locale locale names (as output of locale -a)
|
||||
mapping mapping name
|
||||
menu menus
|
||||
messages |:messages| suboptions
|
||||
option options
|
||||
packadd optional package |pack-add| names
|
||||
shellcmd Shell command
|
||||
sign |:sign| suboptions
|
||||
syntax syntax file names |'syntax'|
|
||||
@@ -4369,7 +4371,7 @@ getfperm({fname}) *getfperm()*
|
||||
< This will hopefully (from a security point of view) display
|
||||
the string "rw-r--r--" or even "rw-------".
|
||||
|
||||
For setting permissins use |setfperm()|.
|
||||
For setting permissions use |setfperm()|.
|
||||
|
||||
getftime({fname}) *getftime()*
|
||||
The result is a Number, which is the last modification time of
|
||||
@@ -6168,9 +6170,9 @@ range({expr} [, {max} [, {stride}]]) *range()*
|
||||
*readfile()*
|
||||
readfile({fname} [, {binary} [, {max}]])
|
||||
Read file {fname} and return a |List|, each line of the file
|
||||
as an item. Lines broken at NL characters. Macintosh files
|
||||
separated with CR will result in a single long line (unless a
|
||||
NL appears somewhere).
|
||||
as an item. Lines are broken at NL characters. Macintosh
|
||||
files separated with CR will result in a single long line
|
||||
(unless a NL appears somewhere).
|
||||
All NUL characters are replaced with a NL character.
|
||||
When {binary} contains "b" binary mode is used:
|
||||
- When the last line ends in a NL an extra empty list item is
|
||||
@@ -7390,6 +7392,9 @@ submatch({nr}[, {list}]) *submatch()* *E935*
|
||||
|substitute()| this list will always contain one or zero
|
||||
items, since there are no real line breaks.
|
||||
|
||||
When substitute() is used recursively only the submatches in
|
||||
the current (deepest) call can be obtained.
|
||||
|
||||
Example: >
|
||||
:s/\d\+/\=submatch(0) + 1/
|
||||
< This finds the first number in the line and adds one to it.
|
||||
|
||||
+7
-28
@@ -49,10 +49,6 @@ If you want Vim to start with a maximized window, add this command to your
|
||||
vimrc or gvimrc file: >
|
||||
au GUIEnter * simalt ~x
|
||||
<
|
||||
*gui-w32s*
|
||||
There is a specific version of gvim.exe that runs under the Win32s subsystem
|
||||
of Windows 3.1 or 3.11. See |win32s|.
|
||||
|
||||
|
||||
Using Vim as a plugin *gui-w32-windowid*
|
||||
|
||||
@@ -100,9 +96,10 @@ when you have got a new version):
|
||||
You can also install Vim in the "Send To" menu:
|
||||
1. Start a Windows Explorer
|
||||
2. Navigate to your sendto directory:
|
||||
Windows 95: %windir%\sendto (e.g. "c:\windows\sendto")
|
||||
Windows NT: %windir%\profiles\%user%\sendto (e.g.
|
||||
"c:\winnt\profiles\mattha\sendto").
|
||||
"c:\winnt\profiles\mattha\sendto")
|
||||
Windows XP: C:\Documents and Settings\%user%\SendTo
|
||||
Windows Vista: C:\Users\%user%\AppData\Roaming\Microsoft\Windows\SendTo .
|
||||
3. Right-click in the file pane and select New->Shortcut
|
||||
4. Follow the shortcut wizard, using the full path to VIM/GVIM.
|
||||
|
||||
@@ -274,35 +271,17 @@ WARNING: If you close this window with the "X" button, and confirm the
|
||||
question if you really want to kill the application, Vim may be killed too!
|
||||
(This does not apply to commands run asynchronously with ":!start".)
|
||||
|
||||
In Windows 95, the window in which the commands are executed is always 25x80
|
||||
characters, to be as DOS compatible as possible (this matters!). The default
|
||||
system font is used. On NT, the window will be the default you have set up for
|
||||
"Console" in Control Panel. On Win32s, the properties of the DOS box are
|
||||
determined by _default.pif in the windows directory.
|
||||
|
||||
*msdos-mode*
|
||||
If you get a dialog that says "This program is set to run in MS-DOS mode..."
|
||||
when you run an external program, you can solve this by changing the
|
||||
properties of the associated shortcut:
|
||||
- Use a Windows Explorer to find the command.com that is used. It can be
|
||||
c:\command.com, c:\dos\command.com, c:\windows\command.com, etc.
|
||||
- With the right mouse button, select properties of this command.com.
|
||||
- In the Program tab select "Advanced".
|
||||
- Unselect "MS-DOS mode".
|
||||
- Click "OK" twice.
|
||||
The window in which the commands are executed will be the default you have set
|
||||
up for "Console" in Control Panel.
|
||||
|
||||
*win32-!start*
|
||||
Normally, Vim waits for a command to complete before continuing (this makes
|
||||
sense for most shell commands which produce output for Vim to use). If you
|
||||
want Vim to start a program and return immediately, you can use the following
|
||||
syntax on W95 & NT: >
|
||||
syntax: >
|
||||
:!start [/min] {command}
|
||||
The optional "/min" causes the window to be minimized.
|
||||
|
||||
On Win32s, you will have to go to another window instead. Don't forget that
|
||||
you must tell Windows 3.1x to keep executing a DOS command in the background
|
||||
while you switch back to Vim.
|
||||
|
||||
==============================================================================
|
||||
5. Special colors *win32-colors*
|
||||
|
||||
@@ -311,7 +290,7 @@ On Win32, the normal DOS colors can be used. See |dos-colors|.
|
||||
Additionally the system configured colors can also be used. These are known
|
||||
by the names Sys_XXX, where XXX is the appropriate system color name, from the
|
||||
following list (see the Win32 documentation for full descriptions). Case is
|
||||
ignored. Note: On Win32s not all of these colors are supported.
|
||||
ignored.
|
||||
|
||||
Sys_3DDKShadow Sys_3DFace Sys_BTNFace
|
||||
Sys_3DHilight Sys_3DHighlight Sys_BTNHilight
|
||||
|
||||
@@ -207,21 +207,19 @@ MS-Windows ~
|
||||
|
||||
You need to install the right version of Ruby for this to work. You can find
|
||||
the package to download from:
|
||||
http://www.garbagecollect.jp/ruby/mswin32/en/download/release.html
|
||||
Currently that is ruby-1.9.2-p136-i386-mswin32.zip
|
||||
http://rubyinstaller.org/downloads/
|
||||
Currently that is rubyinstaller-2.2.5.exe
|
||||
|
||||
To use the Ruby interface the Ruby DLL must be in your search path. In a
|
||||
console window type "path" to see what directories are used. The 'rubydll'
|
||||
option can be also used to specify the Ruby DLL.
|
||||
|
||||
The name of the DLL must match the Ruby version Vim was compiled with.
|
||||
Currently the name is "msvcrt-ruby191.dll". That is for Ruby 1.9.1. To know
|
||||
Currently the name is "msvcrt-ruby220.dll". That is for Ruby 2.2.X. To know
|
||||
for sure edit "gvim.exe" and search for "ruby\d*.dll\c".
|
||||
|
||||
If you want to build Vim with Ruby 1.9.1, you need to edit the config.h file
|
||||
and comment-out the check for _MSC_VER.
|
||||
You may also need to rename the include directory name to match the version,
|
||||
strangely for Ruby 1.9.3 the directory is called 1.9.1.
|
||||
If you want to build Vim with RubyInstaller 1.9 or 2.X using MSVC, you need
|
||||
some tricks. See the src/INSTALLpc.txt for detail.
|
||||
|
||||
|
||||
Unix ~
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*index.txt* For Vim version 8.0. Last change: 2016 Aug 27
|
||||
*index.txt* For Vim version 8.0. Last change: 2016 Sep 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1002,7 +1002,7 @@ tag command action in Command-line editing mode ~
|
||||
|c_CTRL-L| CTRL-L do completion on the pattern in front of the
|
||||
cursor and insert the longest common part
|
||||
|c_<CR>| <CR> execute entered command
|
||||
|c_<CR>| CTRL-M same as <CR>
|
||||
|c_CTRL-M| CTRL-M same as <CR>
|
||||
|c_CTRL-N| CTRL-N after using 'wildchar' with multiple matches:
|
||||
go to next match, otherwise: same as <Down>
|
||||
CTRL-O not used
|
||||
@@ -1026,7 +1026,7 @@ tag command action in Command-line editing mode ~
|
||||
CTRL-Y copy (yank) modeless selection
|
||||
CTRL-Z not used (reserved for suspend)
|
||||
|c_<Esc>| <Esc> abandon command-line without executing it
|
||||
|c_<Esc>| CTRL-[ same as <Esc>
|
||||
|c_CTRL-[| CTRL-[ same as <Esc>
|
||||
|c_CTRL-\_CTRL-N| CTRL-\ CTRL-N go to Normal mode, abandon command-line
|
||||
|c_CTRL-\_CTRL-G| CTRL-\ CTRL-G go to mode specified with 'insertmode',
|
||||
abandon command-line
|
||||
|
||||
@@ -1280,6 +1280,7 @@ completion can be enabled:
|
||||
-complete=locale locale names (as output of locale -a)
|
||||
-complete=mapping mapping name
|
||||
-complete=menu menus
|
||||
-complete=messages |:messages| suboptions
|
||||
-complete=option options
|
||||
-complete=packadd optional package |pack-add| names
|
||||
-complete=shellcmd Shell command
|
||||
|
||||
+11
-9
@@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 8.0. Last change: 2016 Sep 16
|
||||
*options.txt* For Vim version 8.0. Last change: 2016 Oct 12
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -10,7 +10,7 @@ Options *options*
|
||||
2. Automatically setting options |auto-setting|
|
||||
3. Options summary |option-summary|
|
||||
|
||||
For an overview of options see help.txt |option-list|.
|
||||
For an overview of options see quickref.txt |option-list|.
|
||||
|
||||
Vim has a number of internal variables and switches which can be set to
|
||||
achieve special effects. These options come in three forms:
|
||||
@@ -1747,12 +1747,12 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
option + set value effect ~
|
||||
|
||||
'allowrevins' off no CTRL-_ command
|
||||
'backupcopy' Unix: "yes" backup file is a copy
|
||||
others: "auto" copy or rename backup file
|
||||
'backspace' "" normal backspace
|
||||
'backupcopy' Unix: "yes" backup file is a copy
|
||||
else: "auto" copy or rename backup file
|
||||
'backup' off no backup file
|
||||
'cindent' off no C code indentation
|
||||
'cedit' + "" no key to open the |cmdwin|
|
||||
'cindent' off no C code indentation
|
||||
'cpoptions' + (all flags) Vi-compatible flags
|
||||
'cscopetag' off don't use cscope for ":tag"
|
||||
'cscopetagorder' 0 see |cscopetagorder|
|
||||
@@ -1794,6 +1794,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
'textwidth' 0 no automatic line wrap
|
||||
'tildeop' off tilde is not an operator
|
||||
'ttimeout' off no terminal timeout
|
||||
'viminfo' + {unchanged} no viminfo file
|
||||
'whichwrap' + "" left-right movements don't wrap
|
||||
'wildchar' + CTRL-E only when the current value is <Tab>
|
||||
use CTRL-E for cmdline completion
|
||||
@@ -4440,8 +4441,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
original position when no match is found and when pressing <Esc>. You
|
||||
still need to finish the search command with <Enter> to move the
|
||||
cursor to the match.
|
||||
You can use the CTRL-N and CTRL-P keys to move to the next and
|
||||
previous match. |c_CTRL-N| |c_CTRL-P|
|
||||
You can use the CTRL-G and CTRL-T keys to move to the next and
|
||||
previous match. |c_CTRL-G| |c_CTRL-T|
|
||||
When compiled with the |+reltime| feature Vim only searches for about
|
||||
half a second. With a complicated pattern and/or a lot of text the
|
||||
match may not be found. This is to avoid that Vim hangs while you
|
||||
@@ -8131,8 +8132,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
"xterm", "xterm2", "urxvt" or "sgr" (because dec mouse codes conflict
|
||||
with them).
|
||||
This option is automatically set to "xterm", when the 'term' option is
|
||||
set to a name that starts with "xterm", "mlterm", "screen", "st" (full
|
||||
match only), "st-" or "stterm", and 'ttymouse' is not set already.
|
||||
set to a name that starts with "xterm", "mlterm", "screen", "tmux",
|
||||
"st" (full match only), "st-" or "stterm", and 'ttymouse' is not set
|
||||
already.
|
||||
Additionally, if vim is compiled with the |+termresponse| feature and
|
||||
|t_RV| is set to the escape sequence to request the xterm version
|
||||
number, more intelligent detection process runs.
|
||||
|
||||
+16
-134
@@ -1,4 +1,4 @@
|
||||
*os_win32.txt* For Vim version 8.0. Last change: 2016 Aug 28
|
||||
*os_win32.txt* For Vim version 8.0. Last change: 2016 Oct 12
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by George Reilly
|
||||
@@ -7,20 +7,18 @@
|
||||
*win32* *Win32* *MS-Windows*
|
||||
This file documents the idiosyncrasies of the Win32 version of Vim.
|
||||
|
||||
The Win32 version of Vim works on Windows NT, 95, 98, ME, XP, Vista and
|
||||
Windows 7. There are both console and GUI versions.
|
||||
The Win32 version of Vim works on Windows XP, Vista, 7, 8 and 10. There are
|
||||
both console and GUI versions.
|
||||
|
||||
The 32 bit version also runs on 64 bit MS-Windows systems.
|
||||
|
||||
There is GUI version for use in the Win32s subsystem in Windows 3.1[1]. You
|
||||
can also use the 32-bit DOS version of Vim instead. See |os_msdos.txt|.
|
||||
|
||||
1. Known problems |win32-problems|
|
||||
2. Startup |win32-startup|
|
||||
3. Restore screen contents |win32-restore|
|
||||
4. Using the mouse |win32-mouse|
|
||||
5. Running under Windows 3.1 |win32-win3.1|
|
||||
6. Win32 mini FAQ |win32-faq|
|
||||
5. Running under Windows 95 |win32-win95|
|
||||
6. Running under Windows 3.1 |win32-win3.1|
|
||||
7. Win32 mini FAQ |win32-faq|
|
||||
|
||||
Additionally, there are a number of common Win32 and DOS items:
|
||||
File locations |dos-locations|
|
||||
@@ -43,20 +41,7 @@ The GUI version was made by George V. Reilly and Robert Webb.
|
||||
For compiling see "src/INSTALLpc.txt". *win32-compiling*
|
||||
|
||||
==============================================================================
|
||||
1. Known problems *windows95* *win32-problems*
|
||||
|
||||
There are a few known problems with running in a console on Windows 95. As
|
||||
far as we know, this is the same in Windows 98 and Windows ME.
|
||||
|
||||
Comments from somebody working at Microsoft: "Win95 console support has always
|
||||
been and will always be flaky".
|
||||
1. Dead key support doesn't work.
|
||||
2. Resizing the window with ":set columns=nn lines=nn" works, but executing
|
||||
external commands MAY CAUSE THE SYSTEM TO HANG OR CRASH.
|
||||
3. Screen updating is slow, unless you change 'columns' or 'lines' to a
|
||||
non-DOS value. But then the second problem applies!
|
||||
|
||||
If this bothers you, use the 32 bit MS-DOS version or the Win32 GUI version.
|
||||
1. Known problems *win32-problems*
|
||||
|
||||
When doing file name completion, Vim also finds matches for the short file
|
||||
name. But Vim will still find and use the corresponding long file name. For
|
||||
@@ -141,60 +126,20 @@ When the mouse doesn't work, try disabling the "Quick Edit Mode" feature of
|
||||
the console.
|
||||
|
||||
==============================================================================
|
||||
5. Running under Windows 3.1 *win32-win3.1*
|
||||
5. Running under Windows 95 *win32-win95*
|
||||
*windows95* *windows98* *windowsme*
|
||||
Windows 95/98/ME support was removed in patch 8.0.0029 If you want to use it
|
||||
you will need to get a version older than that.
|
||||
|
||||
*win32s* *windows-3.1*
|
||||
==============================================================================
|
||||
6. Running under Windows 3.1 *win32-win3.1*
|
||||
|
||||
*win32s* *windows-3.1* *gui-w32s*
|
||||
There was a special version of Gvim that runs under Windows 3.1 and 3.11.
|
||||
Support was removed in patch 7.4.1363.
|
||||
|
||||
==============================================================================
|
||||
6. Win32 mini FAQ *win32-faq*
|
||||
|
||||
Q. Why does the Win32 version of Vim update the screen so slowly on Windows 95?
|
||||
A. The support for Win32 console mode applications is very buggy in Win95.
|
||||
For some unknown reason, the screen updates very slowly when Vim is run at
|
||||
one of the standard resolutions (80x25, 80x43, or 80x50) and the 16-bit DOS
|
||||
version updates the screen much more quickly than the Win32 version.
|
||||
However, if the screen is set to some other resolution, such as by ":set
|
||||
columns=100" or ":set lines=40", screen updating becomes about as fast as
|
||||
it is with the 16-bit version.
|
||||
|
||||
WARNING: Changing 'columns' may make Windows 95 crash while updating the
|
||||
window (complaints --> Microsoft). Since this mostly works, this has not
|
||||
been disabled, but be careful with changing 'columns'.
|
||||
|
||||
Changing the screen resolution makes updates faster, but it brings
|
||||
additional problems. External commands (e.g., ":!dir") can cause Vim to
|
||||
freeze when the screen is set to a non-standard resolution, particularly
|
||||
when 'columns' is not equal to 80. It is not possible for Vim to reliably
|
||||
set the screen resolution back to the value it had upon startup before
|
||||
running external commands, so if you change the number of 'lines' or
|
||||
'columns', be very, very careful. In fact, Vim will not allow you to
|
||||
execute external commands when 'columns' is not equal to 80, because it is
|
||||
so likely to freeze up afterwards.
|
||||
|
||||
None of the above applies on Windows NT. Screen updates are fast, no
|
||||
matter how many 'lines' or 'columns' the window has, and external commands
|
||||
do not cause Vim to freeze.
|
||||
|
||||
Q. So if the Win32 version updates the screen so slowly on Windows 95 and the
|
||||
16-bit DOS version updates the screen quickly, why would I want to run the
|
||||
Win32 version?
|
||||
A. Firstly, the Win32 version isn't that slow, especially when the screen is
|
||||
set to some non-standard number of 'lines' or 'columns'. Secondly, the
|
||||
16-bit DOS version has some severe limitations: It can't do big changes and
|
||||
it doesn't know about long file names. The Win32 version doesn't have these
|
||||
limitations and it's faster overall (the same is true for the 32-bit DJGPP
|
||||
DOS version of Vim). The Win32 version is smarter about handling the
|
||||
screen, the mouse, and the keyboard than the DJGPP version is.
|
||||
|
||||
Q. And what about the 16-bit DOS version versus the Win32 version on NT?
|
||||
A. There are no good reasons to run the 16-bit DOS version on NT. The Win32
|
||||
version updates the screen just as fast as the 16-bit version does when
|
||||
running on NT. All of the above disadvantages apply. Finally, DOS
|
||||
applications can take a long time to start up and will run more slowly. On
|
||||
non-Intel NT platforms, the DOS version is almost unusably slow, because it
|
||||
runs on top of an 80x86 emulator.
|
||||
7. Win32 mini FAQ *win32-faq*
|
||||
|
||||
Q. How do I change the font?
|
||||
A. In the GUI version, you can use the 'guifont' option. Example: >
|
||||
@@ -202,47 +147,6 @@ A. In the GUI version, you can use the 'guifont' option. Example: >
|
||||
< In the console version, you need to set the font of the console itself.
|
||||
You cannot do this from within Vim.
|
||||
|
||||
Q. When I change the size of the console window with ':set lines=xx' or
|
||||
similar, the font changes! (Win95)
|
||||
A. You have the console font set to 'Auto' in Vim's (or your MS-DOS prompt's)
|
||||
properties. This makes W95 guess (badly!) what font is best. Set an explicit
|
||||
font instead.
|
||||
|
||||
Q. Why can't I paste into Vim when running Windows 95?
|
||||
A. In the properties dialog box for the MS-DOS window, go to "MS-DOS
|
||||
Prompt/Misc/Fast pasting" and make sure that it is NOT checked. You should
|
||||
also do ":set paste" in Vim to avoid unexpected effects. |'paste'|
|
||||
|
||||
Q. How do I type dead keys on Windows 95, in the console version?
|
||||
(A dead key is an accent key, such as acute, grave, or umlaut, that doesn't
|
||||
produce a character by itself, but when followed by another key, produces
|
||||
an accented character, such as a-acute, e-grave, u-umlaut, n-tilde, and so
|
||||
on. Very useful for most European languages. English-language keyboard
|
||||
layouts don't use dead keys, as far as we know.)
|
||||
A. You don't. The console mode input routines simply do not work correctly in
|
||||
Windows 95, and I have not been able to work around them. In the words
|
||||
of a senior developer at Microsoft:
|
||||
Win95 console support has always been and will always be flaky.
|
||||
|
||||
The flakiness is unavoidable because we are stuck between the world of
|
||||
MS-DOS keyboard TSRs like KEYB (which wants to cook the data;
|
||||
important for international) and the world of Win32.
|
||||
|
||||
So keys that don't "exist" in MS-DOS land (like dead keys) have a
|
||||
very tenuous existence in Win32 console land. Keys that act
|
||||
differently between MS-DOS land and Win32 console land (like
|
||||
capslock) will act flaky.
|
||||
|
||||
Don't even _mention_ the problems with multiple language keyboard
|
||||
layouts...
|
||||
|
||||
You may be able to fashion some sort of workaround with the digraphs
|
||||
mechanism. |digraphs|
|
||||
|
||||
The best solution is to use the Win32 GUI version gvim.exe. Alternatively,
|
||||
you can try one of the DOS versions of Vim where dead keys reportedly do
|
||||
work.
|
||||
|
||||
Q. How do I type dead keys on Windows NT?
|
||||
A. Dead keys work on NT 3.51. Just type them as you would in any other
|
||||
application.
|
||||
@@ -349,28 +253,6 @@ A. You have two possible solutions depending on what you want:
|
||||
< The first command runs notepad minimized and the second one runs it
|
||||
normally.
|
||||
|
||||
Q. I'm using Win32s, and when I try to run an external command like "make",
|
||||
Vim doesn't wait for it to finish! Help!
|
||||
A. The problem is that a 32-bit application (Vim) can't get notification from
|
||||
Windows that a 16-bit application (your DOS session) has finished. Vim
|
||||
includes a work-around for this, but you must set up your DOS commands to
|
||||
run in a window, not full-screen. Unfortunately the default when you
|
||||
install Windows is full-screen. To change this:
|
||||
1) Start PIF editor (in the Main program group).
|
||||
2) Open the file "_DEFAULT.PIF" in your Windows directory.
|
||||
3) Changes the display option from "Full Screen" to "Windowed".
|
||||
4) Save and exit.
|
||||
|
||||
To test, start Vim and type >
|
||||
:!dir C:\<CR>".
|
||||
< You should see a DOS box window appear briefly with the directory listing.
|
||||
|
||||
Q. I use Vim under Win32s and NT. In NT, I can define the console to default to
|
||||
50 lines, so that I get a 80x50 shell when I ':sh'. Can I do the same in
|
||||
W3.1x, or am I stuck with 80x25?
|
||||
A. Edit SYSTEM.INI and add 'ScreenLines=50' to the [NonWindowsApp] section. DOS
|
||||
prompts and external DOS commands will now run in a 50-line window.
|
||||
|
||||
*windows-icon*
|
||||
Q. I don't like the Vim icon, can I change it?
|
||||
A. Yes, place your favorite icon in bitmaps/vim.ico in a directory of
|
||||
|
||||
+26
-21
@@ -1,4 +1,4 @@
|
||||
*syntax.txt* For Vim version 8.0. Last change: 2016 Sep 13
|
||||
*syntax.txt* For Vim version 8.0. Last change: 2016 Sep 29
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -2863,9 +2863,11 @@ vimrc file: >
|
||||
(Adapted from the html.vim help text by Claudio Fleiner <claudio@fleiner.com>)
|
||||
|
||||
|
||||
SH *sh.vim* *ft-sh-syntax* *ft-bash-syntax* *ft-ksh-syntax*
|
||||
*ft-posix-synax* *ft-dash-syntax*
|
||||
SH *sh.vim* *ft-sh-syntax* *ft-bash-syntax* *ft-ksh-syntax*
|
||||
|
||||
This covers the "normal" Unix (Bourne) sh, bash and the Korn shell.
|
||||
This covers syntax highlighting for the older Unix (Bourne) sh, and newer
|
||||
shells such as bash, dash, posix, and the Korn shells.
|
||||
|
||||
Vim attempts to determine which shell type is in use by specifying that
|
||||
various filenames are of specific types: >
|
||||
@@ -2874,28 +2876,31 @@ various filenames are of specific types: >
|
||||
bash: .bashrc* bashrc bash.bashrc .bash_profile* *.bash
|
||||
<
|
||||
If none of these cases pertain, then the first line of the file is examined
|
||||
(ex. /bin/sh /bin/ksh /bin/bash). If the first line specifies a shelltype,
|
||||
then that shelltype is used. However some files (ex. .profile) are known to
|
||||
be shell files but the type is not apparent. Furthermore, on many systems
|
||||
sh is symbolically linked to "bash" (Linux, Windows+cygwin) or "ksh" (Posix).
|
||||
(ex. looking for /bin/sh /bin/ksh /bin/bash). If the first line specifies a
|
||||
shelltype, then that shelltype is used. However some files (ex. .profile) are
|
||||
known to be shell files but the type is not apparent. Furthermore, on many
|
||||
systems sh is symbolically linked to "bash" (Linux, Windows+cygwin) or "ksh"
|
||||
(Posix).
|
||||
|
||||
One may specify a global default by instantiating one of the following three
|
||||
One may specify a global default by instantiating one of the following
|
||||
variables in your <.vimrc>:
|
||||
|
||||
ksh: >
|
||||
ksh: >
|
||||
let g:is_kornshell = 1
|
||||
< posix: (using this is the same as setting is_kornshell to 1) >
|
||||
< posix: (using this is the nearly the same as setting g:is_kornshell to 1) >
|
||||
let g:is_posix = 1
|
||||
< bash: >
|
||||
let g:is_bash = 1
|
||||
< sh: (default) Bourne shell >
|
||||
let g:is_sh = 1
|
||||
|
||||
< (dash users should use posix)
|
||||
|
||||
If there's no "#! ..." line, and the user hasn't availed himself/herself of a
|
||||
default sh.vim syntax setting as just shown, then syntax/sh.vim will assume
|
||||
the Bourne shell syntax. No need to quote RFCs or market penetration
|
||||
statistics in error reports, please -- just select the default version of the
|
||||
sh your system uses in your <.vimrc>.
|
||||
sh your system uses and install the associated "let..." in your <.vimrc>.
|
||||
|
||||
The syntax/sh.vim file provides several levels of syntax-based folding: >
|
||||
|
||||
@@ -2904,7 +2909,7 @@ The syntax/sh.vim file provides several levels of syntax-based folding: >
|
||||
let g:sh_fold_enabled= 2 (enable heredoc folding)
|
||||
let g:sh_fold_enabled= 4 (enable if/do/for folding)
|
||||
>
|
||||
then various syntax items (HereDocuments and function bodies) become
|
||||
then various syntax items (ie. HereDocuments and function bodies) become
|
||||
syntax-foldable (see |:syn-fold|). You also may add these together
|
||||
to get multiple types of folding: >
|
||||
|
||||
@@ -2928,14 +2933,7 @@ reduce this, the "sh_maxlines" internal variable can be set. Example: >
|
||||
The default is to use the twice sh_minlines. Set it to a smaller number to
|
||||
speed up displaying. The disadvantage is that highlight errors may appear.
|
||||
|
||||
*g:sh_isk* *g:sh_noisk*
|
||||
The shell languages appear to let "." be part of words, commands, etc;
|
||||
consequently it should be in the isk for sh.vim. As of v116 of syntax/sh.vim,
|
||||
syntax/sh.vim will append the "." to |'iskeyword'| by default; you may control
|
||||
this behavior with: >
|
||||
let g:sh_isk = '..whatever characters you want as part of iskeyword'
|
||||
let g:sh_noisk= 1 " otherwise, if this exists, the isk will NOT chg
|
||||
<
|
||||
|
||||
*sh-embed* *sh-awk*
|
||||
Sh: EMBEDDING LANGUAGES~
|
||||
|
||||
@@ -3580,7 +3578,11 @@ DEFINING KEYWORDS *:syn-keyword*
|
||||
|
||||
DEFINING MATCHES *:syn-match*
|
||||
|
||||
:sy[ntax] match {group-name} [{options}] [excludenl] {pattern} [{options}]
|
||||
:sy[ntax] match {group-name} [{options}]
|
||||
[excludenl]
|
||||
[keepend]
|
||||
{pattern}
|
||||
[{options}]
|
||||
|
||||
This defines one match.
|
||||
|
||||
@@ -3589,6 +3591,9 @@ DEFINING MATCHES *:syn-match*
|
||||
[excludenl] Don't make a pattern with the end-of-line "$"
|
||||
extend a containing match or region. Must be
|
||||
given before the pattern. |:syn-excludenl|
|
||||
keepend Don't allow contained matches to go past a
|
||||
match with the end pattern. See
|
||||
|:syn-keepend|.
|
||||
{pattern} The search pattern that defines the match.
|
||||
See |:syn-pattern| below.
|
||||
Note that the pattern may match more than one
|
||||
|
||||
+8
-4
@@ -5238,6 +5238,7 @@ c_CTRL-I cmdline.txt /*c_CTRL-I*
|
||||
c_CTRL-J cmdline.txt /*c_CTRL-J*
|
||||
c_CTRL-K cmdline.txt /*c_CTRL-K*
|
||||
c_CTRL-L cmdline.txt /*c_CTRL-L*
|
||||
c_CTRL-M cmdline.txt /*c_CTRL-M*
|
||||
c_CTRL-N cmdline.txt /*c_CTRL-N*
|
||||
c_CTRL-P cmdline.txt /*c_CTRL-P*
|
||||
c_CTRL-Q cmdline.txt /*c_CTRL-Q*
|
||||
@@ -5254,6 +5255,7 @@ c_CTRL-U cmdline.txt /*c_CTRL-U*
|
||||
c_CTRL-V cmdline.txt /*c_CTRL-V*
|
||||
c_CTRL-W cmdline.txt /*c_CTRL-W*
|
||||
c_CTRL-Y cmdline.txt /*c_CTRL-Y*
|
||||
c_CTRL-[ cmdline.txt /*c_CTRL-[*
|
||||
c_CTRL-\_CTRL-G intro.txt /*c_CTRL-\\_CTRL-G*
|
||||
c_CTRL-\_CTRL-N intro.txt /*c_CTRL-\\_CTRL-N*
|
||||
c_CTRL-\_e cmdline.txt /*c_CTRL-\\_e*
|
||||
@@ -6083,6 +6085,7 @@ ft-csh-syntax syntax.txt /*ft-csh-syntax*
|
||||
ft-css-omni insert.txt /*ft-css-omni*
|
||||
ft-cweb-syntax syntax.txt /*ft-cweb-syntax*
|
||||
ft-cynlib-syntax syntax.txt /*ft-cynlib-syntax*
|
||||
ft-dash-syntax syntax.txt /*ft-dash-syntax*
|
||||
ft-desktop-syntax syntax.txt /*ft-desktop-syntax*
|
||||
ft-dircolors-syntax syntax.txt /*ft-dircolors-syntax*
|
||||
ft-docbk-syntax syntax.txt /*ft-docbk-syntax*
|
||||
@@ -6143,6 +6146,7 @@ ft-php-syntax syntax.txt /*ft-php-syntax*
|
||||
ft-php3-syntax syntax.txt /*ft-php3-syntax*
|
||||
ft-phtml-syntax syntax.txt /*ft-phtml-syntax*
|
||||
ft-plaintex-syntax syntax.txt /*ft-plaintex-syntax*
|
||||
ft-posix-synax syntax.txt /*ft-posix-synax*
|
||||
ft-postscr-syntax syntax.txt /*ft-postscr-syntax*
|
||||
ft-ppwiz-syntax syntax.txt /*ft-ppwiz-syntax*
|
||||
ft-printcap-syntax syntax.txt /*ft-printcap-syntax*
|
||||
@@ -6396,8 +6400,6 @@ g:netrw_win95ftp pi_netrw.txt /*g:netrw_win95ftp*
|
||||
g:netrw_winsize pi_netrw.txt /*g:netrw_winsize*
|
||||
g:netrw_wiw pi_netrw.txt /*g:netrw_wiw*
|
||||
g:netrw_xstrlen pi_netrw.txt /*g:netrw_xstrlen*
|
||||
g:sh_isk syntax.txt /*g:sh_isk*
|
||||
g:sh_noisk syntax.txt /*g:sh_noisk*
|
||||
g:syntax_on syntax.txt /*g:syntax_on*
|
||||
g:tar_browseoptions pi_tar.txt /*g:tar_browseoptions*
|
||||
g:tar_cmd pi_tar.txt /*g:tar_cmd*
|
||||
@@ -6613,7 +6615,7 @@ gui-w32-printing gui_w32.txt /*gui-w32-printing*
|
||||
gui-w32-start gui_w32.txt /*gui-w32-start*
|
||||
gui-w32-various gui_w32.txt /*gui-w32-various*
|
||||
gui-w32-windowid gui_w32.txt /*gui-w32-windowid*
|
||||
gui-w32s gui_w32.txt /*gui-w32s*
|
||||
gui-w32s os_win32.txt /*gui-w32s*
|
||||
gui-win32-maximized gui_w32.txt /*gui-win32-maximized*
|
||||
gui-x11 gui_x11.txt /*gui-x11*
|
||||
gui-x11-athena gui_x11.txt /*gui-x11-athena*
|
||||
@@ -7353,7 +7355,6 @@ mouse_winid-variable eval.txt /*mouse_winid-variable*
|
||||
movement intro.txt /*movement*
|
||||
ms-dos os_msdos.txt /*ms-dos*
|
||||
msdos os_msdos.txt /*msdos*
|
||||
msdos-mode gui_w32.txt /*msdos-mode*
|
||||
msql.vim syntax.txt /*msql.vim*
|
||||
mswin.vim gui_w32.txt /*mswin.vim*
|
||||
multi-byte mbyte.txt /*multi-byte*
|
||||
@@ -9327,6 +9328,7 @@ win32-startup os_win32.txt /*win32-startup*
|
||||
win32-term os_win32.txt /*win32-term*
|
||||
win32-vimrun gui_w32.txt /*win32-vimrun*
|
||||
win32-win3.1 os_win32.txt /*win32-win3.1*
|
||||
win32-win95 os_win32.txt /*win32-win95*
|
||||
win32s os_win32.txt /*win32s*
|
||||
win_findbuf() eval.txt /*win_findbuf()*
|
||||
win_getid() eval.txt /*win_getid()*
|
||||
@@ -9356,6 +9358,8 @@ windows-intro windows.txt /*windows-intro*
|
||||
windows-starting windows.txt /*windows-starting*
|
||||
windows.txt windows.txt /*windows.txt*
|
||||
windows95 os_win32.txt /*windows95*
|
||||
windows98 os_win32.txt /*windows98*
|
||||
windowsme os_win32.txt /*windowsme*
|
||||
winheight() eval.txt /*winheight()*
|
||||
winid windows.txt /*winid*
|
||||
winline() eval.txt /*winline()*
|
||||
|
||||
+38
-302
@@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 8.0. Last change: 2016 Sep 25
|
||||
*todo.txt* For Vim version 8.0. Last change: 2016 Oct 12
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -34,30 +34,11 @@ not be repeated below, unless there is extra information.
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
Move test71 tests to test_crypt.
|
||||
|
||||
Idea from Sven: record sequence of keys. Useful to show others what they are
|
||||
doing (look over the shoulder), and also to see what happened.
|
||||
Probably list of keystrokes, with some annotations for mode changes.
|
||||
Could store in logfile to be able to analyise it with an external command.
|
||||
E.g. to see when's the last time a plugin command was used.
|
||||
|
||||
Patch for typos. (Matthew Brener, 2016 Sep 16, #1088)
|
||||
Lots of its to it's.
|
||||
|
||||
After 8.0 is released:
|
||||
- Drop support for older MS-Windows systems, before XP.
|
||||
Patch from Ken Takata, updated 2016 Sep 12.
|
||||
|
||||
+channel:
|
||||
- channel_wait() may return an error while there is still something to read.
|
||||
Perhaps try to read once more?
|
||||
Possibly reproduced by Santiago Alejandro Agüero, 2016 Sep 12, 13.
|
||||
Apparently select() returns an error while reading could work.
|
||||
Another example from Daniel Hahler, Sep 24.
|
||||
- Problem with stderr on Windows? (Vincent Rischmann, 2016 Aug 31, #1026)
|
||||
- Add 'cwd' argument to start_job(): directory to change to in the child.
|
||||
check for valid directory before forking.
|
||||
Part of patch for environment, Yasuhiro Matsumoto, #1160
|
||||
- Implement |job-term| ?
|
||||
- Channel test fails with Motif. Sometimes kills the X11 server.
|
||||
- When a message in the queue but there is no callback, drop it after a while?
|
||||
@@ -78,9 +59,6 @@ Regexp problems:
|
||||
(Manuel Ortega, 2016 Apr 24)
|
||||
Test fails on Mac. Avoid using isalpha(), isalnum(), etc? Depends on
|
||||
LC_CTYPE
|
||||
- The regexp engines are not reentrant, causing havoc when interrupted by a
|
||||
remote expression or something else. Move global variables onto the stack
|
||||
or into an allocated struct.
|
||||
- The old engine does not find a match for "/\%#=1\(\)\{80}", the new engine
|
||||
matches everywhere.
|
||||
- Using win_linetabsize() can still be slow. Cache the result, store col and
|
||||
@@ -96,6 +74,7 @@ Regexp problems:
|
||||
- NFA regexp doesn't handle \%<v correctly. (Ingo Karkat, 2014 May 12)
|
||||
- Does not work with NFA regexp engine:
|
||||
\%u, \%x, \%o, \%d followed by a composing character
|
||||
- Search for \%d0\+ may fail with E363. (Christian Brabandt, 2016 Oct 4)
|
||||
- \%'[ does not work. '%'] does work. (Masaaki Nakamura, 2016 Apr 4)
|
||||
- Bug relating to back references. (Ingo Karkat, 2014 Jul 24)
|
||||
- New RE does not give an error for empty group: "\(\)\{2}" (Dominique Pelle,
|
||||
@@ -118,11 +97,6 @@ Regexp problems:
|
||||
matches the empty string. (Dominique Pelle, 2015 Oct 2, Nov 24)
|
||||
had_endbrace[] is set but not initialized or used.
|
||||
|
||||
Strang syntax highlighting problem. (Brett Stahlman, 2016 Sep 17)
|
||||
|
||||
Patch to convert test_command_count into new style. (Naruhiko Nishino, 2016
|
||||
Sep 17)
|
||||
|
||||
json_encode(): should convert to utf-8. (Nikolai Pavlov, 2016 Jan 23)
|
||||
What if there is an invalid character?
|
||||
|
||||
@@ -131,22 +105,22 @@ Or avoid recursiveness.
|
||||
|
||||
Error in test_startup_utf8 on Solaris. (Danek Duvall, 2016 Aug 17)
|
||||
|
||||
Patch to fix escaping of job arguments. (Yasuhiro Matsumoto, 2016 Oct 5)
|
||||
Still not right.
|
||||
|
||||
Once .exe with updated installer is available: Add remark to download page
|
||||
about /S and /D options (Ken Takata, 2016 Apr 13)
|
||||
Or point to nightly builds: https://github.com/vim/vim-win32-installer/releases
|
||||
|
||||
Javascript indent wrong after /* in single quoted string:
|
||||
var SRC = 'src/*.js';
|
||||
function log(tag) {
|
||||
a = b;
|
||||
}
|
||||
|
||||
Problem passing non-UTF-8 strings to Python 3. (Björn Linse, 2016 Sep 11,
|
||||
#1053) With patch, does it work?
|
||||
|
||||
Use ADDR_OTHER instead of ADDR_LINES for many more commands.
|
||||
Add tests for using number larger than number of lines in buffer.
|
||||
|
||||
Patch to make v:shell_error writable. (Christian Brabandt, 2016 Sep 27)
|
||||
Is there another solution?
|
||||
|
||||
Invalid behavior with NULL list. (Nikolai Pavlov, #768)
|
||||
E.g. deepcopy(test_null_list())
|
||||
|
||||
@@ -156,13 +130,34 @@ Patch to make it possible to extend a list with itself.
|
||||
min() and max() spawn lots of error messages if sorted list/dictionary
|
||||
contains invalid data (Nikolay Pavlov, 2016 Sep 4, #1039)
|
||||
|
||||
Should :vmap in matchit.vim be :xmap? (Tony Mechelynck)
|
||||
|
||||
Problem with whitespace in errorformat. (Gerd Wachsmuth, 2016 May 15, #807)
|
||||
|
||||
Undo problem: "g-" doesn't go back, gets stuck. (Björn Linse, 2016 Jul 18)
|
||||
|
||||
Add "unicode true" to NSIS installer. Doesn't work with Windows 95, which we
|
||||
no longer support.
|
||||
|
||||
sort() is not stable when using numeric/float sort (Nikolay Pavlov, 2016 Sep
|
||||
4#1038)
|
||||
|
||||
Patch to add "cmdline" completion to getcompletion(). (Shougo, Oct 1, #1140)
|
||||
|
||||
Patch for systemlist(), add empty item. (thinca, Sep 30, #1135)
|
||||
Add an argument to choose binary or non-binary (like readfile()), when omitted
|
||||
use the current behavior.
|
||||
Include the test.
|
||||
|
||||
Idea from Sven: record sequence of keys. Useful to show others what they are
|
||||
doing (look over the shoulder), and also to see what happened.
|
||||
Probably list of keystrokes, with some annotations for mode changes.
|
||||
Could store in logfile to be able to analyise 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,
|
||||
#1141)
|
||||
|
||||
cmap using execute() has side effects. (Killthemule, 2016 Aug 17, #983)
|
||||
|
||||
Patch to change order of compiler flags. (Yousong Zhou, 2016 Sep 19, #1100)
|
||||
@@ -187,6 +182,9 @@ Cannot delete a file with square brackets with delete(). (#696)
|
||||
Completion for input() does not expand environment variables. (chdiza, 2016
|
||||
Jul 25, #948)
|
||||
|
||||
Patch to fix wrong encoding of error message on Cygwin/MSYS terminal.
|
||||
(Ken Takata, 2016 Oct 4)
|
||||
|
||||
'hlsearch' interferes with a Conceal match. (Rom Grk, 2016 Aug 9)
|
||||
|
||||
Patch to add context information to quickfix/location list. (Yegappan
|
||||
@@ -200,6 +198,9 @@ Also for ":@.".
|
||||
|
||||
Repeating 'opfunc' in a function only works once. (Tarmean, 2016 Jul 15, #925)
|
||||
|
||||
Have a way to get the call stack, in a function and from an exception.
|
||||
#1125
|
||||
|
||||
Second problem in #966: ins_compl_add_tv() uses get_dict_string() multiple
|
||||
times, overwrites the one buffer. (Nikolay Pavlov, 2016 Aug 5)
|
||||
|
||||
@@ -230,12 +231,6 @@ the last change in any buffer? Can we use ', (, is next to .)?
|
||||
|
||||
Ramel Eshed: system() is much slower than job_start(), why? (Aug 26)
|
||||
|
||||
Patch for Python: #622. (Roland Puntaier, 2016 Feb 2)
|
||||
What does it change?
|
||||
|
||||
Patch to make gd and gD work better for non-K&R code and with comments.
|
||||
(Anton Lindqvist, 2016 Aug 29)
|
||||
|
||||
When generating the Unicode tables with runtime/tools/unicode.vim the
|
||||
emoji_width table has only one entry.
|
||||
|
||||
@@ -250,11 +245,6 @@ Patch to support strikethrough next to bold and italic. (Christian Brabandt,
|
||||
Update mentioned by Christian, 2016 Apr 25.
|
||||
Update from Ken Takata, 2016 Jul 17.
|
||||
|
||||
Patch to improve cscope. (Adrian Kocis, #843)
|
||||
|
||||
Patch for groovy multi-line comment highlighting. (Justin M. Keyes, 2016 May
|
||||
20 #644)
|
||||
|
||||
When doing "vi buf.md" a BufNew autocommand for *.md is not triggered.
|
||||
Because of using the initial buffer? (Dun Peal, 2016 May 12)
|
||||
|
||||
@@ -329,9 +319,6 @@ Should use /usr/local/share/applications or /usr/share/applications.
|
||||
Or use $XDG_DATA_DIRS.
|
||||
Also need to run update-desktop-database (Kuriyama Kazunobu, 2015 Nov 4)
|
||||
|
||||
Patch to test popupmenu. Fails, possibly due to a bug.
|
||||
(Christian Brabandt, 2016 Jul 23)
|
||||
|
||||
Patch to introduce 'cmdencoding'. (Ken Takata, Aug 18?)
|
||||
Better help Aug 19.
|
||||
Problem: applies to too many commands, such as :cbuffer.
|
||||
@@ -344,9 +331,6 @@ Patch to have text objects defined by arbitrary single characters. (Daniel
|
||||
Thau, 2013 Nov 20, 2014 Jan 29, 2014 Jan 31)
|
||||
Added tests (James McCoy, 2016 Aug 3). Still needs more work.
|
||||
|
||||
Patch to add CTRL-N / CTRL-P while searching. (Christian Brabandt, 2016 Aug
|
||||
3) Problem: two matches in one line and using CTRL-P does not move back.
|
||||
|
||||
Access to uninitialized memory in match_backref() regexp_nda.c:4882
|
||||
(Dominique Pelle, 2015 Nov 6)
|
||||
|
||||
@@ -427,8 +411,6 @@ Add "===" to have a strict comparison (type and value match).
|
||||
Add "==*" (?) to have a value match, but no automatic conversion, and v:true
|
||||
equals 1 and 1.0, v:false equals 0 and 0.0.?
|
||||
|
||||
Plugin to use Vim in MANPAGER. Konfekt, PR #491
|
||||
|
||||
Using uninitialized memory. (Dominique Pelle, 2015 Nov 4)
|
||||
|
||||
MS-Windows: When editing a file with a leading space, writing it uses the
|
||||
@@ -453,9 +435,6 @@ I can't recommend it though.
|
||||
Build with Python on Mac does not always use the right library.
|
||||
(Kazunobu Kuriyama, 2015 Mar 28)
|
||||
|
||||
Need a Vim equivalent of Python's None and a way to test for it.
|
||||
Use v:none. var == v:none
|
||||
|
||||
Patch to add arguments to argc() and argv(). (Yegappan Lakshmanan, 2016 Jan
|
||||
24) Also need a way to get the global arg list? Update later on Jan 24
|
||||
Update Mar 5. Update Apr 7. Update Jun 5.
|
||||
@@ -498,10 +477,6 @@ the file name ends up encoded wrong. (Raul Coronado, 2015 Dec 21)
|
||||
Patch for problem with restoring screen on Windows. (Nobuhiro Takasaki, 2015
|
||||
Sep 10)
|
||||
|
||||
Patch to set antialiasing style on Windows. (Ondrej Balaz, 2013 Mar 14)
|
||||
Needs a different check for CLEARTYPE_QUALITY.
|
||||
Problem mentioned by Christian Brabandt, 2016 Jan 4.
|
||||
|
||||
Example in editing.txt uses $HOME with the expectation that it ends in a
|
||||
slash. For me it does, but perhaps not for everybody. Add a function that
|
||||
inserts a slash when needed? pathconcat(dir, path) (Thilo Six, 2015 Aug 12)
|
||||
@@ -543,9 +518,6 @@ Breaks test_eval. Inefficient, can we only compute y_width when needed?
|
||||
Patch to use different terminal mode settings for system(). (Hayaki Saito)
|
||||
Does this work for everybody?
|
||||
|
||||
Patch to add wordcount(). Same info as g CTRL-G. (Christian Brabandt, 2015
|
||||
Nov 17)
|
||||
|
||||
Patch for man.vim. (SungHyun Nam, 2015 May 20)
|
||||
Doesn't work completely (Dominique Orban)
|
||||
|
||||
@@ -567,9 +539,6 @@ Mixup of highlighting when there is a match and SpellBad. (ZyX, 2015 Jan 1)
|
||||
|
||||
Patch on Issue 72: 'autochdir' causes problems for :vimgrep.
|
||||
|
||||
When 'balloonexpr' returns a list the result has a trailing newline.
|
||||
Just remove one trailing newline. (lcd, 2014 Oct 17)
|
||||
|
||||
When two SIGWINCH arrive very quickly, the second one may be lost.
|
||||
(Josh Triplett, 2015 Sep 17)
|
||||
|
||||
@@ -673,7 +642,7 @@ right-mouse-drag on the status line to move a window up/down without changing
|
||||
its height? It's like dragging the status bar above it at the same time.
|
||||
|
||||
Can we make ":unlet $VAR" use unsetenv() to delete the env var?
|
||||
What for systems that don't have unsetenv()?
|
||||
What for systems that don't have unsetenv()? (Issue #1116)
|
||||
|
||||
Patch to add a :domodeline command. (Christian Brabandt, 2014 Oct 21)
|
||||
|
||||
@@ -728,9 +697,6 @@ Out of scope:
|
||||
Setting the spell file in a session only reads the local additions, not the
|
||||
normal spell file. (Enno Nagel, 2014 Mar 29)
|
||||
|
||||
CTRL-] in Visual mode uses the selected text as a tag. This does not work
|
||||
when preceded with CTRL-W. (Patrick Hemmer, 2014 Jun 28)
|
||||
|
||||
When typing the first character of a command, e.g. "f", then using a menu, the
|
||||
menu item doesn't work. Clear typeahead when using a menu?
|
||||
|
||||
@@ -772,9 +738,6 @@ Patch to right-align signs. (James Kolb (email james), 2013 Sep 23)
|
||||
|
||||
Patch to handle integer overflow. (Aaron Burrow, 2013 Dec 12)
|
||||
|
||||
With "$" in 'cpoptions' the popup menu isn't fully drawn. (Matti Niemenmaa,
|
||||
2013 Sep 5)
|
||||
|
||||
Patch to add "ntab" item in 'listchars' to repeat first character. (Nathaniel
|
||||
Braun, pragm, 2013 Oct 13) A better solution 2014 Mar 5.
|
||||
|
||||
@@ -839,10 +802,6 @@ Patch to add {lhs} to :mapclear: clear all maps starting with {lhs}.
|
||||
Exception caused by argument of return is not caught by try/catch.
|
||||
(David Barnett, 2013 Nov 19)
|
||||
|
||||
8 'backupdir' and 'directory' should use $TMPDIR, $TMP and/or $TEMP when
|
||||
defined.
|
||||
Issue 28.
|
||||
|
||||
Patch to fix that 'cedit' is recognized after :normal. (Christian Brabandt,
|
||||
2013 Mar 19, later message)
|
||||
|
||||
@@ -887,8 +846,6 @@ How to test that it works well for all Vim users?
|
||||
|
||||
Patch to make fold updates much faster. (Christian Brabandt, 2012 Dec)
|
||||
|
||||
Issue 54: document behavior of -complete, also expands arg.
|
||||
|
||||
- Add regex for 'paragraphs' and 'sections': 'parare' and 'sectre'. Combine
|
||||
the two into a regex for searching. (Ned Konz)
|
||||
Patch by Christian Brabandt, 2013 Apr 20, unfinished.
|
||||
@@ -899,20 +856,11 @@ In the ATTENTION message about an existing swap file, mention the name of the
|
||||
process that is running. It might actually be some other program, e.g. after
|
||||
a reboot.
|
||||
|
||||
Patch to select the next or previous text object if there isn't one under the
|
||||
cursor. (Daniel Thau, 2013 Nov 20)
|
||||
|
||||
patch to add "combine" flag to syntax commands. (so8res, 2012 Dec 6)
|
||||
|
||||
Bug caused by patch 7.3.1288? Issue 183.
|
||||
I can't reproduce it.
|
||||
|
||||
Syntax update problem in one buffer opened in two windows, bottom window is
|
||||
not correctly updated. (Paul Harris, 2012 Feb 27)
|
||||
|
||||
Patch to add assignments in cscope. (Uli Meis, Estabrooks, 2012 Sep 1)
|
||||
Alternate patch by Gary Johnson, Sep 4.
|
||||
|
||||
Patch to add getsid(). (Tyru, 2011 Oct 2) Do we want this? Update Oct 4.
|
||||
Or use expand('<sid>')?
|
||||
|
||||
@@ -950,10 +898,6 @@ Szamotulski, 2012 Nov 8)
|
||||
Session file creation: 'autochdir' causes trouble. Keep it off until after
|
||||
loading all files.
|
||||
|
||||
Win32: When 'autochdir' is on and 'encoding' is changed, files on the command
|
||||
line are opened again, but from the wrong directory. Apply 'autochdir' only
|
||||
after starting up?
|
||||
|
||||
8 "stl" and "stlnc" in 'fillchars' don't work for multi-byte characters.
|
||||
Patch by Christian Wellenbrock, 2013 Jul 5.
|
||||
|
||||
@@ -971,9 +915,6 @@ of many matches. (Cody Cutler, 2013 Mar 28)
|
||||
|
||||
Patch to add tagfunc(). Cleaned up by Christian Brabandt, 2013 Jun 22.
|
||||
|
||||
Help for 'b:undo_indent'. (Thilo Six, 2012 May 28)
|
||||
Also question if examples are correct.
|
||||
|
||||
The input map for CTRL-O in mswin.vim causes problems after CTRL-X CTRL-O.
|
||||
Suggestion for another map. (Philip Mat, 2012 Jun 18)
|
||||
But use "gi" instead of "a". Or use CTRL-\ CTRL-O.
|
||||
@@ -1050,8 +991,6 @@ Only for MS-Windows. No documentation. Do we want this?
|
||||
|
||||
Patch to support cursor shape in Cygwin console. (Ben bgold, 2011 Dec 27)
|
||||
|
||||
Issue 64: when 'incsearch' is on can't paste LF on command line.
|
||||
|
||||
On MS-Windows a temp dir with a & init causes system() to fail. (Ben Fritz,
|
||||
2012 Jun 19)
|
||||
|
||||
@@ -1103,10 +1042,6 @@ When using a Vim server, a # in the path causes an error message.
|
||||
Setting $HOME on MS-Windows is not very well documented. Suggestion by Ben
|
||||
Fritz (2011 Oct 27).
|
||||
|
||||
Bug: Windows 7 64 bit system freezes when 'clipboard' set to "unnamed" and
|
||||
doing ":g/test/d". Putting every delete on the clipboard? (Robert Chan, 2011
|
||||
Jun 17)
|
||||
|
||||
When there is a ">" in a line that "gq" wraps to the start of the next line,
|
||||
then the following line will pick it up as a leader. Should get the leader
|
||||
from the first line, not a wrapped line. (Matt Ackeret, 2012 Feb 27)
|
||||
@@ -1186,12 +1121,6 @@ Is this needed? CTRL-O and CTRL-I do the same, just more difficult to use.
|
||||
8 Add a command to jump to the next character highlighted with "Error".
|
||||
Patch by Christian Brabandt, uses ]e [e ]t and [t. 2011 Aug 9.
|
||||
|
||||
8 Add an event like CursorHold that is triggered repeatedly, not just once
|
||||
after typing something.
|
||||
Need for CursorHold that retriggers. Use a key that doesn't do anything, or a
|
||||
function that resets did_cursorhold.
|
||||
Patch by Christian Brabandt, 2011 May 6.
|
||||
|
||||
Add event for when the text scrolls. A bit like CursorMoved. Also a similar
|
||||
one for insert mode. Use the event in matchparen to update the highlight if
|
||||
the match scrolls into view.
|
||||
@@ -1328,9 +1257,6 @@ setwinvar().
|
||||
|
||||
Patch for GVimExt to show an icon. (Dominik Riebeling, 2010 Nov 7)
|
||||
|
||||
When writing a file > 2Gbyte, the reported number of bytes is negative.
|
||||
(Antonio Colombo, 2010 Dec 18)
|
||||
|
||||
When 'lines' is 25 and 'scrolloff' is 12, "j" scrolls zero or two lines
|
||||
instead of one. (Constantin Pan, 2010 Sep 10)
|
||||
|
||||
@@ -1493,8 +1419,6 @@ Patch for GTK buttons X1Mouse and X2Mouse. (Christian J. Robinson, 2010 Aug 9)
|
||||
|
||||
Motif: Build on Ubuntu can't enter any text in dialog text fields.
|
||||
|
||||
When 'ft' changes redraw custom status line.
|
||||
|
||||
":tab split fname" doesn't set the alternate file in the original window,
|
||||
because win_valid() always returns FALSE. Below win_new_tabpage() in
|
||||
ex_docmd.c.
|
||||
@@ -1542,10 +1466,6 @@ perhaps. And undo CTRL-W. CTRL-G l would redo.
|
||||
|
||||
Diff mode out of sync. (Gary Johnson, 2010 Aug 4)
|
||||
|
||||
Support a 'systemencoding' option (for Unix). It specifies the encoding of
|
||||
file names. (Kikuchan, 2010 Oct 5). Useful on a latin1 or double-byte Asian
|
||||
system when 'encoding' is "utf-8".
|
||||
|
||||
Win32 GUI: last message from startup doesn't show up when there is an echoerr
|
||||
command. (Cyril Slobin, 2009 Mar 13)
|
||||
|
||||
@@ -1590,9 +1510,6 @@ Sergey Khorev)
|
||||
Consider making YankRing or something else that keeps a list of yanked text
|
||||
part of standard Vim. The "1 to "9 registers are not sufficient.
|
||||
|
||||
netrw: dragging status line causes selection of entry. Should check row
|
||||
number to be below last visible line.
|
||||
|
||||
After doing "su" $HOME can be the old user's home, thus ~root/file is not
|
||||
correct. Don't use it in the swap file.
|
||||
|
||||
@@ -1663,8 +1580,6 @@ doesn't. (John Little, 2008 Nov 9)
|
||||
Shell expansion returns unexpanded string?
|
||||
Don't use shell when "~" is not at the start?
|
||||
|
||||
":unlet $VAR" doesn't work.
|
||||
|
||||
When using ":e ++enc=foo file" and the file is already loaded with
|
||||
'fileencoding' set to "bar", then do_ecmd() uses that buffer, even though the
|
||||
fileencoding differs. Reload the buffer in this situation? Need to check for
|
||||
@@ -1699,9 +1614,6 @@ command is not executed. Fix by Ian Kelling?
|
||||
":help s/~" jumps to *s/\~*, while ":help s/\~" doesn't find anything. (Tim
|
||||
Chase) Fix by Ian Kelling, 2008 Jul 14.
|
||||
|
||||
Use "\U12345678" for 32 bit Unicode characters? (Tony Mechelynck, 2009
|
||||
Apr 6) Or use "\u(123456)", similar to Perl.
|
||||
|
||||
When mapping : to ; and ; to :, @; doesn't work like @: and @: doesn't work
|
||||
either. Matt Wozniski: nv_at() calls do_execreg() which uses
|
||||
put_in_typebuf(). Char mapped twice?
|
||||
@@ -1758,8 +1670,6 @@ Works OK when 'cmdheight' is 2.
|
||||
that the context can be taken into account. (Robert Webb)
|
||||
Patch by Christian Brabandt, 2013 May 31.
|
||||
|
||||
Test54 should not use shell commands. Make it portable.
|
||||
|
||||
The utf class table is missing some entries:
|
||||
0x2212, minus sign
|
||||
0x2217, star
|
||||
@@ -1889,10 +1799,6 @@ popup menu over it, first draw the new popup menu, remember its position and
|
||||
size and then redraw the text, skipping the characters under the popup menu.
|
||||
This should avoid flicker. Other solution by A.Politz, 2007 Aug 22.
|
||||
|
||||
Windows 98: pasting from the clipboard with text from another application has
|
||||
a trailing NUL. (Joachim Hofmann) Perhaps the length specified for CF_TEXT
|
||||
isn't right?
|
||||
|
||||
When a register contains illegal bytes, writing viminfo in utf-8 and reading
|
||||
it back doesn't result in utf-8. (Devin Bayer)
|
||||
|
||||
@@ -1968,8 +1874,6 @@ patches by Mathias, see mail Feb 22)
|
||||
Win32: compiling with normal features and OLE fails. Patch by Mathias
|
||||
Michaelis, 2006 Jun 4.
|
||||
|
||||
Win16: include patches to make Win16 version work. (Vince Negri, 2006 May 22)
|
||||
|
||||
Win32: after "[I" showing matches, scroll wheel messes up screen. (Tsakiridis,
|
||||
2007 Feb 18)
|
||||
Patch by Alex Dobrynin, 2007 Jun 3. Also fixes other scroll wheel problems.
|
||||
@@ -2007,9 +1911,6 @@ F1 - F4 in an xterm produce a different escape sequence when used with a
|
||||
modifier key. Need to catch three different sequences. Use K_ZF1, like
|
||||
K_ZHOME? (Dickey, 2007 Dec 2)
|
||||
|
||||
UTF-8: mapping a multi-byte key where the second byte is 0x80 doesn't appear
|
||||
to work. (Tony Mechelynck, 2007 March 2)
|
||||
|
||||
In debug mode, using CTRL-R = to evaluate a function causes stepping through
|
||||
the function. (Hari Krishna Dara, 2006 Jun 28)
|
||||
|
||||
@@ -2114,15 +2015,6 @@ When showing a diff between a non-existent file and an existing one, with the
|
||||
cursor in the empty buffer, the other buffer only shows the last line. Change
|
||||
the "insert" into a change from one line to many? (Yakov Lerner, 2008 May 27)
|
||||
|
||||
Add autocommand for when a tabpage is being closed. Also for when a tab page
|
||||
has been created.
|
||||
|
||||
Using ":make" blocks Vim. Allow running one make in the background (if the
|
||||
shell supports it), catch errors in a file and update the error list on the
|
||||
fly. A bit like "!make > file&" and repeating ":cf file". ":bgmake",
|
||||
background make. ":bgcancel" interrupts it.
|
||||
A.Politz may work on this.
|
||||
|
||||
These two abbreviations don't give the same result:
|
||||
let asdfasdf = "xyz\<Left>"
|
||||
cabbr XXX <C-R>=asdfasdf<CR>
|
||||
@@ -2135,9 +2027,6 @@ In FileChangedShell command it's no longer allowed to switch to another
|
||||
buffer. But the changed buffer may differ from the current buffer, how to
|
||||
reload it then?
|
||||
|
||||
New syntax files for fstab and resolv from Radu Dineiu, David Necas did
|
||||
previous version.
|
||||
|
||||
For Aap: include a config.arg.example file with hints how to use config.arg.
|
||||
|
||||
Command line completion when 'cmdheight' is maximum and 'wildmenu' is set,
|
||||
@@ -2167,11 +2056,6 @@ start of the path is shown in the menu. Should move the menu to the right to
|
||||
show more text of the completions. Shorten the items that don't fit in the
|
||||
middle?
|
||||
|
||||
When running inside screen it's possible to kill the X server and restart it
|
||||
(using pty's the program can keep on running). Vim dies because it loses the
|
||||
connection to the X server. Can Vim simply quit using the X server instead of
|
||||
dying? Also relevant when running in a console.
|
||||
|
||||
Accessing file#var in a function should not need the g: prepended.
|
||||
|
||||
When exiting detects a modified buffer, instead of opening the buffer in the
|
||||
@@ -2206,10 +2090,6 @@ the cursor line. It works OK after some other commands.
|
||||
|
||||
Win32: Is it possible to have both postscript and Win32 printing?
|
||||
|
||||
Check: Running Vim in a console and still having connect to the X server for
|
||||
copy/paste: is stopping the X server handled gracefully? Should catch the X
|
||||
error and stop using the connection to the server.
|
||||
|
||||
Problem with 'cdpath' on MS-Windows when a directory is equal to $HOME. (2006
|
||||
Jul 26, Gary Johnson)
|
||||
|
||||
@@ -2246,30 +2126,11 @@ differently and unexpectedly. Caused by patch 7.2.398?
|
||||
The magic clipboard format "VimClipboard2" appears in several places. Should
|
||||
be only one.
|
||||
|
||||
"vim -C" often has 'nocompatible', because it's set somewhere in a startup
|
||||
script. Do "set compatible" after startup?
|
||||
|
||||
It's difficult to debug numbered functions (function in a Dictionary). Print
|
||||
the function name before resolving it to a number?
|
||||
let d = {}
|
||||
fun! d.foo()
|
||||
echo "here"
|
||||
endfun
|
||||
call d.foo(9)
|
||||
|
||||
Add a mark for the other end of the Visual area (VIsual pos). '< and '> are
|
||||
only set after Visual moded is ended.
|
||||
Also add a variable for the Visual mode. So that this mode and '< '> can be
|
||||
used to set what "gv" selects. (Ben Schmidt)
|
||||
|
||||
Win32, NTFS: When editing a specific infostream directly and 'backupcopy' is
|
||||
"auto" should detect this situation and work like 'backupcopy' is "yes". File
|
||||
name is something like "c:\path\foo.txt:bar", includes a colon. (Alex
|
||||
Jakushev, 2008 Feb 1)
|
||||
|
||||
printf() uses the field width in bytes. Can it be made character width,
|
||||
perhaps with a modifier? What does Posix say?
|
||||
|
||||
Small problem displaying diff filler line when opening windows with a script.
|
||||
(David Luyer, 2007 Mar 1 ~/Mail/oldmail/mool/in.15872 )
|
||||
|
||||
@@ -2290,8 +2151,6 @@ When completing from another file that uses a different encoding completion
|
||||
text has the wrong encoding. E.g., when 'encoding' is utf-8 and file is
|
||||
latin1. Example from Gombault Damien, 2007 Mar 24.
|
||||
|
||||
Is it possible to use "foo#var" instead of "g:foo#var" inside a function?
|
||||
|
||||
Syntax HL: When using "nextgroup" and the group has an empty match, there is
|
||||
no search at that position for another match. (Lukas Mai, 2008 April 11)
|
||||
|
||||
@@ -2352,8 +2211,6 @@ More patches:
|
||||
- Another patch for Javascript indenting. (Hari Kumar, 2010 Jul 11)
|
||||
Needs a few tests.
|
||||
- Add 'cscopeignorecase' option. (Liang Wenzhi, 2006 Sept 3)
|
||||
- Argument for feedkeys() to prepend to typeahead (Yakov Lerner, 2006 Oct
|
||||
21)
|
||||
- Load intl.dll too, not only libintl.dll. (Mike Williams, 2006 May 9, docs
|
||||
patch May 10)
|
||||
- Extra argument to strtrans() to translate special keys to their name (Eric
|
||||
@@ -2378,8 +2235,6 @@ More patches:
|
||||
Schmidt, 2008 Jul 22.
|
||||
- testdir/Make_dos_sh.mak for running tests with MingW. (Bill Mccarthy, 2008
|
||||
Sep 13)
|
||||
- Patch for adding "space" item in 'listchars'. (Jérémie Roquet, 2009 Oct 29,
|
||||
Docs patch Oct 30, update David Burgin (glts) 2013 Aug 24, 2014 Oct 10)
|
||||
- Replace ccomplete.vim by cppcomplete.vim from www.vim.org? script 1520 by
|
||||
Vissale Neang. (Martin Stubenschrott) Asked Vissale to make the scripts
|
||||
more friendly for the Vim distribution.
|
||||
@@ -2402,8 +2257,6 @@ Awaiting updated patches:
|
||||
9 HTML indenting can be slow. Caused by using searchpair(). Can search()
|
||||
be used instead? A.Politz is looking into a solution.
|
||||
8 Win32: Add minidump generation. (George Reilly, 2006 Apr 24)
|
||||
8 Add ":n" to fnamemodify(): normalize path, remove "../" when possible.
|
||||
Aric Blumer has a patch for this. He will update the patch for 6.3.
|
||||
7 Completion of network shares, patch by Yasuhiro Matsumoto.
|
||||
Update 2004 Sep 6.
|
||||
How does this work? Missing comments.
|
||||
@@ -2504,8 +2357,6 @@ Vi incompatibility:
|
||||
the ":map" when it's used without arguments?
|
||||
7 CTRL-L is not the end of a section? It is for Posix! Make it an option.
|
||||
7 Implement 'prompt' option. Init to off when stdin is not a tty.
|
||||
7 CTRL-T in Insert mode inserts 'shiftwidth' of spaces at the cursor. Add a
|
||||
flag in 'cpoptions' for this.
|
||||
7 Add a way to send an email for a crashed edit session. Create a file when
|
||||
making changes (containing name of the swap file), delete it when writing
|
||||
the file. Supply a program that can check for crashed sessions (either
|
||||
@@ -2553,8 +2404,6 @@ GTK+ GUI known bugs:
|
||||
Win32 GUI known bugs:
|
||||
- Win32: tearoff menu window should have a scrollbar when it's taller than
|
||||
the screen.
|
||||
8 On Windows 98 the unicows library is needed to support functions with UCS2
|
||||
file names. Can we load unicows.dll dynamically?
|
||||
8 The -P argument doesn't work very well with many MDI applications.
|
||||
The last argument of CreateWindowEx() should be used, see MSDN docs.
|
||||
Tutorial: http://win32assembly.online.fr/tut32.html
|
||||
@@ -2568,9 +2417,6 @@ Win32 GUI known bugs:
|
||||
7 When font smoothing is enabled, redrawing can become very slow. The reason
|
||||
appears to be drawing with a transparent background. Would it be possible
|
||||
to use an opaque background in most places?
|
||||
8 Use another default for 'termencoding': the active codepage. Means that
|
||||
when 'encoding' is changed typing characters still works properly.
|
||||
Alternative: use the Unicode functions to obtain typed characters.
|
||||
7 The cursor color indicating IME mode doesn't work properly. (Shizhu Pan,
|
||||
2004 May 9)
|
||||
8 Win32: When clicking on the gvim title bar, which gives it focus, produces
|
||||
@@ -2783,14 +2629,6 @@ Win32 console:
|
||||
backslashes. (Ronald Hoellwarth)
|
||||
|
||||
|
||||
Windows 95:
|
||||
8 Editing a file by its short file name and writing it, makes the long file
|
||||
name disappear. Setting 'backupcopy' helps.
|
||||
Use FindFirstFile()->cAlternateFileName in fname_case() (George Reilly).
|
||||
8 Doing wildcard expansion, will match the short filename, but result in the
|
||||
long filename (both DJGPP and Win32).
|
||||
|
||||
|
||||
Win32 console:
|
||||
9 When editing a file by its short file name, it should be expanded into its
|
||||
long file name, to avoid problems like these: (Mccollister)
|
||||
@@ -2814,9 +2652,6 @@ Win32 console:
|
||||
a Netware network drive. Use same function as for Win32 GUI?
|
||||
8 In os_win32.h, HAVE_STRICMP and HAVE_STRNICMP are defined only if __GNUC__
|
||||
is not defined. Shouldn't that be the other way around?
|
||||
7 Use SetConsoleCP() and SetConsoleOutputCP() to implement 'termencoding'?
|
||||
Avoids that input and output work differently. Need to be restored when
|
||||
exiting.
|
||||
|
||||
|
||||
Amiga:
|
||||
@@ -2919,9 +2754,6 @@ Macintosh:
|
||||
is currently fixed to use ".,:;!". Add an option to make this
|
||||
configurable?
|
||||
8 'hkmap' should probably be global-local.
|
||||
9 When "$" is in 'cpoptions' and folding is active, a "C" command changes
|
||||
the folds and resets w_lines_valid. The display updating doesn't work
|
||||
then. (Pritesh Mistry)
|
||||
8 Using ":s" in a function changes the previous replacement string. Save
|
||||
"old_sub" in save_search_patterns()?
|
||||
8 Should allow multi-byte characters for the delimiter: ":s+a+b+" where "+"
|
||||
@@ -2965,11 +2797,6 @@ Macintosh:
|
||||
- Be able to print a window in diff mode.
|
||||
- Be able to specify a colorscheme to use for printing. And a separate
|
||||
one for B&W printing (if that can be detected).
|
||||
8 In Visual block mode with 'lbr' set, a change command doesn't insert the
|
||||
text in following lines where the linebreak changes.
|
||||
9 dosinst.c: The DJGPP version can't uninstall the Uninstall registry key on
|
||||
Windows NT. How to install a .inf file on Windows NT and how to detect
|
||||
that Windows NT is being used?
|
||||
8 When 'virtualedit' is "block,insert" and encoding is "utf-8", selecting a
|
||||
block of one double-wide character, then "d" deletes only half of it.
|
||||
8 When 'virtualedit' is set, should "I" in blockwise visual mode also insert
|
||||
@@ -3026,8 +2853,6 @@ Macintosh:
|
||||
(e.g., ":w").
|
||||
8 CTRL-A can't handle big "long" numbers, they become negative. Check for
|
||||
"-" character, if not present, use unsigned long.
|
||||
8 Make it possible to disable the special meaning of "#" in the first column
|
||||
for ">>".
|
||||
8 Add suspending with CTRL-Z at the "more" prompt, and when executing a long
|
||||
script in do_cmdline().
|
||||
8 When using 'hidden', many swap files will be open. When Vim runs into the
|
||||
@@ -3149,11 +2974,6 @@ Problems that will (probably) not be solved:
|
||||
- Amiga: The ":cq" command does not always abort the Manx compiler. Why?
|
||||
- Linux: A file with protection r--rw-rw- is seen readonly for others. The
|
||||
access() function in GNU libc is probably wrong.
|
||||
- MSDOS: When using smartdrive with write-back buffering, writing to a
|
||||
readonly floppy will cause problems. How to test for a writable floppy
|
||||
first?
|
||||
- MSDOS: Both 16 and 32 bit versions: File name expansion doesn't work for
|
||||
names that start with a dot. These used to be illegal file names.
|
||||
- When doing a CTRL-Z and typing a command for the shell, while Vim is busy
|
||||
(e.g. writing a file), the command for the shell is sometimes eaten by Vim,
|
||||
because the terminal mode is changed from RAW to CBREAK.
|
||||
@@ -3264,7 +3084,6 @@ Documentation:
|
||||
8 List of options should mention whether environment variables are expanded
|
||||
or not.
|
||||
8 Extend usr_27.txt a bit. (Adam Seyfarth)
|
||||
7 Add a section on debugging scripts in the user manual.
|
||||
9 Make the Reference Manual more precise. For each command mention:
|
||||
- change to cursor position and curswant
|
||||
- if it can be undone (u/CTRL-R) and redone (.)
|
||||
@@ -3290,7 +3109,6 @@ Help:
|
||||
- When a help item has multiple matches make it possible to use ":tn" to go
|
||||
to the other matches.
|
||||
- Support a way to view (and edit) .info files.
|
||||
- Default mapping for help files: <Tab> to position cursor on next |:tag|.
|
||||
- Implement a "sticky" help window, some help text lines that are always
|
||||
displayed in a window with fixed height. (Guckes) Use "~/.vimhelp" file,
|
||||
user can edit it to insert his favorite commands, new account can contain a
|
||||
@@ -3314,20 +3132,12 @@ User Friendlier:
|
||||
$HOME/_vimrc, etc.) and add "edit vimrc" to the File menu.
|
||||
- Add a way to save local settings and mappings into a new plugin file.
|
||||
":mkplugin <file>"?
|
||||
8 Add ":plugininstall" command. Can be used to install a plugin file that
|
||||
includes documentation. Let the user select a directory from
|
||||
'runtimepath'.
|
||||
" Vim plugin
|
||||
<main plugin code>
|
||||
" >>> plugin help start <<<
|
||||
<plugin docs>
|
||||
- Add mappings local to a window: ":map <window> ..."?
|
||||
9 Add buffer-local menu. Should offer a choice between removing the menu or
|
||||
disabling it. Be careful that tear-offs don't disappear (keep one empty
|
||||
item?).
|
||||
Alternative: use BufEnter and BufLeave autocommands.
|
||||
8 make a vimtutor script for Amiga and other systems.
|
||||
7 Add the arguments for configure to the ":version" output?
|
||||
7 When Vim detects a file is being edited elsewhere and it's a gvim session
|
||||
of the same user it should offer a "Raise" button, so that the other gvim
|
||||
window can be displayed. (Eduard)
|
||||
@@ -3346,7 +3156,6 @@ Tab pages:
|
||||
7 :tabdup duplicate the tab with all its windows.
|
||||
7 Option to put tab line at the left or right? Need an option to specify
|
||||
its width. It's like a separate window with ":tabs" output.
|
||||
7 Add local variables for each tab page?
|
||||
8 Add local options for each tab page? E.g., 'diffopt' could differ between
|
||||
tab pages.
|
||||
7 Add local highlighting for each tab page?
|
||||
@@ -3450,15 +3259,8 @@ Diff mode:
|
||||
9 Instead invoking an external diff program, use builtin code. One can be
|
||||
found here: http://www.ioplex.com/~miallen/libmba/dl/src/diff.c
|
||||
It's quite big and badly documented though.
|
||||
8 Use diff mode to show the changes made in a buffer (compared to the file).
|
||||
Use an unnamed buffer, like doing:
|
||||
new | set bt=nofile | r # | 0d_ | diffthis | wincmd p | diffthis
|
||||
Also show difference with the file when editing started? Should show what
|
||||
8 Also show difference with the file when editing started? Should show what
|
||||
can be undone. (Tom Popovich)
|
||||
7 Add cursor-binding: when moving the cursor in one diff'ed buffer, also
|
||||
move it in other diff'ed buffers, so that CTRL-W commands go to the same
|
||||
location.
|
||||
|
||||
|
||||
Folding:
|
||||
(commands still available: zI zJ zK zp zP zq zQ zV zy zY;
|
||||
@@ -3466,8 +3268,6 @@ Folding:
|
||||
8 Vertical folds: looks like vertically split windows, but the cursor moves
|
||||
through the vertical separator, separator moves when scrolling.
|
||||
8 Add "z/" and "z?" for searching in not folded text only.
|
||||
9 Add search pattern item to only match in closed or open fold and/or fold
|
||||
with certain level. Allows doing ":g/pat/cmd" to work on closed folds.
|
||||
8 When a closed fold is displayed open because of 'foldminlines', the
|
||||
behavior of commands is still like the fold is closed. How to make the
|
||||
user aware of this?
|
||||
@@ -3498,9 +3298,6 @@ Folding:
|
||||
- 'foldmethod' "syntax": "fold=3" argument: set fold level for a region or
|
||||
match.
|
||||
- Apply a new foldlevel to a range of lines. (Steve Litt)
|
||||
8 Have some way to restrict commands to not folded text. Also commands like
|
||||
searches.
|
||||
|
||||
|
||||
Multi-byte characters:
|
||||
- When editing a file with both utf-8 and latin1 text Vim always falls back
|
||||
@@ -3692,9 +3489,6 @@ Syntax highlighting:
|
||||
8 When using a regexp for "contains=", should delay matching with it until
|
||||
redrawing happens. Set a flag when a group is added, check this flag when
|
||||
highlighting starts.
|
||||
8 Some terminals can display colors like the GUI. Add some setting to use
|
||||
GUI colors for the terminal? With something to define the escape
|
||||
sequence.
|
||||
7 It's possible for an item to be transparent, so that the colors of an item
|
||||
lower on the stack is used. Also do this with highlighting, so that the
|
||||
user can set transparent highlighting? E.g. a number in a C comment would
|
||||
@@ -3900,9 +3694,6 @@ Performance:
|
||||
so that we don't need to make a copy? Or avoid invoking ml_updatechunk(),
|
||||
that is taking a lot of time. (Ralf Wildenhues, 2008 Jul 7)
|
||||
With a patch, but does it work?
|
||||
8 Instead of loading rgb.txt every time a color wasn't recognized load it
|
||||
once and keep it in memory. Move the code to a common place to avoid
|
||||
repeating it in various system files.
|
||||
8 Turn b_syn_ic and b_syn_containedin into b_syn_flags.
|
||||
9 Loading menu.vim still takes quite a bit of time. How to make it faster?
|
||||
8 in_id_list() takes much time for syntax highlighting. Cache the result?
|
||||
@@ -3927,7 +3718,6 @@ Performance:
|
||||
http://www.theregister.co.uk/content/4/22908.html. (Andre Pang)
|
||||
7 Check how performance of loading the wordlist can be improved (adding a
|
||||
lot of abbreviations).
|
||||
7 MS-DOS console: Add t_DL support, to make scrolling faster.
|
||||
7 Compile Ex commands to byte codes. Store byte codes in a vim script file
|
||||
at the end, after "compiled:. Make it look like a single comment line
|
||||
for old Vim versions. Insert first line "Vim script compiled <timestamp>.
|
||||
@@ -4052,8 +3842,6 @@ Screen updating:
|
||||
8 Add a ":refresh [winnr]" command, to force updating a window. Useful from
|
||||
an event handler where ":normal" can't be used. Also useful when
|
||||
'lazyredraw' is set in a mapping.
|
||||
7 Make 'list' and 'linebreak' work together.
|
||||
|
||||
|
||||
Scrolling:
|
||||
8 Add "zy" command: scroll horizontally to put the cursor in the middle.
|
||||
@@ -4237,8 +4025,6 @@ GUI:
|
||||
use them again? Otherwise, allow disabling allocating the default colors.
|
||||
Or allocate an own colormap (check UAE). With an option to use it. For
|
||||
the commandline, "-install" is mostly used for X11 programs.
|
||||
7 Add command line argument for "gvim" not to start the GUI. Sort of the
|
||||
inverse of "vim -g". (Vikas)
|
||||
7 Should support multi-column menus.
|
||||
- Should add option for where to put the "Help" menu: like Motif at the far
|
||||
right, or with the other menus (but still at the right).
|
||||
@@ -4539,7 +4325,6 @@ Insert mode:
|
||||
7 Use CTRL-G <count> to repeat what follows. Useful for inserting a
|
||||
character multiple times or repeating CTRL-Y.
|
||||
- Make 'revins' work in Replace mode.
|
||||
9 Can't use multi-byte characters for 'matchpairs'.
|
||||
7 Use 'matchpairs' for 'showmatch': When inserting a character check if it
|
||||
appears in the rhs of 'matchpairs'.
|
||||
- In Insert mode (and command line editing?): Allow undo of the last typed
|
||||
@@ -4681,8 +4466,6 @@ Text objects:
|
||||
use "aq" and "iq". Use 'quotepairs' to define pairs of quotes, like
|
||||
'matchpairs'?
|
||||
8 Add text object for any kind of parens, also multi-byte ones.
|
||||
7 Add text object for current search pattern: "a/" and "i/". Makes it
|
||||
possible to turn text highlighted for 'hlsearch' into a Visual area.
|
||||
8 Add a way to make an ":omap" for a user-defined text object. Requires
|
||||
changing the starting position in oap->start.
|
||||
8 Add "gp" and "gP" commands: insert text and make sure there is a single
|
||||
@@ -4739,8 +4522,6 @@ Visual mode:
|
||||
receive dropped text from another program. (Ben Godfrey)
|
||||
7 With blockwise Visual mode and "c", "C", "I", "A", etc., allow the use of
|
||||
a <CR>. The entered lines are repeated over the Visual area.
|
||||
7 CTRL-V :s should substitute only in the block, not to whole lines. (David
|
||||
Young is working on this)
|
||||
7 Filtering a block should only apply to the block, not to the whole lines.
|
||||
When the number of lines is increased, add lines. When decreased, pad with
|
||||
spaces or delete? Use ":`<,`>" on the command line.
|
||||
@@ -4770,8 +4551,6 @@ Visual mode:
|
||||
|
||||
More advanced repeating commands:
|
||||
- Add "." command for visual mode: redo last visual command (e.g. ":fmt").
|
||||
7 Repeating "d:{cmd}" with "." doesn't work. (Benji Fisher) Somehow remember
|
||||
the command line so that it can be repeated?
|
||||
- Add command to repeat last movement. Including count.
|
||||
- Add "." command after operator: repeat last command of same operator. E.g.
|
||||
"c." will repeat last change, also when "x" used since then (Webb).
|
||||
@@ -4800,9 +4579,6 @@ Mappings and Abbreviations:
|
||||
not the <Space>.
|
||||
8 Give a warning when using CTRL-C in the lhs of a mapping. It will never
|
||||
(?) work.
|
||||
8 Add a way to save a current mapping and restore it later. Use a function
|
||||
that returns the mapping command to restore it: mapcmd()? mapcheck() is
|
||||
not fool proof. How to handle ambiguous mappings?
|
||||
7 Add <0x8f> (hex), <033> (octal) and <123> (decimal) to <> notation?
|
||||
7 When someone tries to unmap with a trailing space, and it fails, try
|
||||
unmapping without the trailing space. Helps for ":unmap xx | unmap yy".
|
||||
@@ -4855,8 +4631,6 @@ Incsearch:
|
||||
cases, saves a lot of time in big files. (Slootman wants to work on this?)
|
||||
When not using special characters, can continue search from the last match
|
||||
(or not at all, when there was no match). See oldmail/webb/in.872.
|
||||
- With incsearch, use CTRL-N/CTRL-P to go to next/previous match, some other
|
||||
key to copy matched word to search pattern (Alexander Schmid).
|
||||
|
||||
|
||||
Searching:
|
||||
@@ -4880,9 +4654,6 @@ Searching:
|
||||
8 Show the progress every second. Could use the code that checks for CTRL-C
|
||||
to find out how much time has passed. Or use SIGALRM. Where to show the
|
||||
number?
|
||||
8 When using an expression for ":s", set the match position in a v:
|
||||
variable. So that you can do ":%s/^/\=v:lnum/" to put a line number
|
||||
before each line.
|
||||
7 Support for approximate-regexps to find similar words (agrep
|
||||
http://www.tgries.de/agrep/ tre: http://laurikari.net/tre/index.html).
|
||||
8 Add an item for a big character range, so that one can search for a
|
||||
@@ -4891,8 +4662,6 @@ Searching:
|
||||
the stack if previous atom matched". Other side is "match with top of
|
||||
stack, pop it when it matches". Use "\@pX" and "\@m"?
|
||||
Example: \((\@p).\{-}\@m\)*
|
||||
7 Add an option to accept a match at the cursor position. Also for
|
||||
search(). (Brett)
|
||||
7 Add a flag to "/pat/" to discard an error. Useful to continue a mapping
|
||||
when a search fails. Could be "/pat/E" (e is already used for end offset).
|
||||
7 Add pattern item to use properties of Unicode characters. In Perl it's
|
||||
@@ -4996,9 +4765,6 @@ Undo:
|
||||
when tests fail after making changes and you forgot in which files.
|
||||
9 After undo/redo, in the message show whether the buffer is modified or
|
||||
not.
|
||||
8 Use timestamps for undo, so that a version a certain time ago can be found
|
||||
and info before some time/date can be flushed. 'undopersist' gives maximum
|
||||
time to keep undo: "3h", "1d", "2w", "1y", etc.
|
||||
8 Search for pattern in undo tree, showing when it happened and the text
|
||||
state, so that you can jump to it.
|
||||
8 Undo tree: visually show the tree somehow (Damian Conway)
|
||||
@@ -5006,13 +4772,6 @@ Undo:
|
||||
timestamp?
|
||||
Put branch with most recent change on the left, older changes get more
|
||||
indent?
|
||||
8 See ":e" as a change operation, find the changes and add them to the
|
||||
undo info. Also be able to undo the "Reload file" choice for when a file
|
||||
was changed outside of Vim.
|
||||
Would require doing a diff between the buffer text and the file and
|
||||
storing the differences.
|
||||
Alternative: before reloading a buffer, store it somewhere. Keep a list
|
||||
of about 10 last reloaded buffers.
|
||||
- Make it possible to undo all the commands from a mapping, including a
|
||||
trailing unfinished command, e.g. for ":map K iX^[r".
|
||||
- When accidentally hitting "R" instead of Ctrl-R, further Ctrl-R is not
|
||||
@@ -5064,8 +4823,6 @@ Buffer list:
|
||||
7 Add expansion of buffer names, so that "*.c" is expanded to all buffer
|
||||
names. Needed for ":bdel *.c", ":bunload *.c", etc.
|
||||
8 Support for <afile> where a buffer name is expected.
|
||||
8 Some commands don't use line numbers, but buffer numbers. '$'
|
||||
should then mean the number of the last buffer. E.g.: "4,$bdel".
|
||||
7 Add an option to mostly use slashes in file names. Separately for
|
||||
internal use and for when executing an external program?
|
||||
8 Some file systems are case-sensitive, some are not. Besides
|
||||
@@ -5385,11 +5142,6 @@ Various improvements:
|
||||
7 Allow a window not to have a statusline. Makes it possible to use a
|
||||
window as a buffer-tab selection.
|
||||
8 Allow non-active windows to have a different statusline. (Yakov Lerner)
|
||||
7 Support using ":vert" with User commands. Add expandable items <vert>.
|
||||
Do the same for ":browse" and ":confirm"?
|
||||
For ":silent" and ":debug" apply to the whole user command.
|
||||
More general: need a way to access command modifiers in a user command.
|
||||
Assign them to a v: variable?
|
||||
7 Add an invisible buffer which can be edited. For use in scripts that want
|
||||
to manipulate text without changing the window layout.
|
||||
8 Add a command to revert to the saved version of file; undo or redo until
|
||||
@@ -5439,10 +5191,6 @@ Various improvements:
|
||||
non-unix systems. Perhaps let configure define CONF_XXX, and use #ifdef
|
||||
CONF_XXX in feature.h? Then what should min-features and max-features do?
|
||||
8 Add "g^E" and "g^Y", to scroll a screen-full line up and down.
|
||||
6 Add ":timer" command, to set a command to be executed at a certain
|
||||
interval, or once after some time has elapsed. (Aaron)
|
||||
Perhaps an autocommand event like CursorHold is better?
|
||||
Patch to add async functionality. (Geoff Greer, 2013 Sep 1 and later)
|
||||
8 Add ":confirm" handling in open_exfile(), for when file already exists.
|
||||
8 When quitting with changed files, make the dialog list the changed file
|
||||
and allow "write all", "discard all", "write some". The last one would
|
||||
@@ -5678,7 +5426,6 @@ Various improvements:
|
||||
gives read errors. Check protection before opening.
|
||||
- When writing check for file exists but no permission, "Permission denied".
|
||||
- If file does not exist, check if directory exists.
|
||||
- MSDOS: although t_cv and t_ci are not set, do invert char under cursor.
|
||||
- Settings edit mode: make file with ":set opt=xx", edit it, parse it as ex
|
||||
commands.
|
||||
- ":set -w all": list one option per line.
|
||||
@@ -5713,10 +5460,7 @@ Various improvements:
|
||||
instead of CTRL-R to make repeating possible. (Marinichev)
|
||||
- Add "^Vb" on the command line, replace with word before or under the
|
||||
cursor?
|
||||
- Option to make a .swp file only when a change is made (Templeton).
|
||||
- Support mapping for replace mode and "r" command (Vi doesn't do this)?
|
||||
5 Add 'ignorefilecase' option: Ignore case when expanding file names.
|
||||
":e ma<Tab>" would also find "Makefile" on Unix.
|
||||
8 Sorting of filenames for completion is wrong on systems that ignore
|
||||
case of filenames. Add 'ignorefncase' option. When set, case in
|
||||
filenames is ignored for sorting them. Patch by Mike Williams:
|
||||
@@ -5785,11 +5529,6 @@ Far future and "big" extensions:
|
||||
- Add open mode, use it when terminal has no cursor positioning.
|
||||
- Special "drawing mode": a line is drawn where the cursor is moved to.
|
||||
Backspace deletes along the line (from jvim).
|
||||
- Implement ":Bset", set option in all buffers. Also ":Wset", set in all
|
||||
windows, ":Aset, set in all arguments and ":Tset", set in all files
|
||||
mentioned in the tags file.
|
||||
Add buffer/arg range, like in ":2,5B%s/..." (do we really need this???)
|
||||
Add search string: "B/*.c/%s/.."? Or ":F/*.c/%s/.."?
|
||||
- Support for underlining (underscore-BS-char), bold (char-BS-char) and other
|
||||
standout modes switched on/off with , 'overstrike' option (Reiter).
|
||||
- Add vertical mode (Paul Jury, Demirel): "5vdw" deletes a word in five
|
||||
@@ -5805,8 +5544,5 @@ Far future and "big" extensions:
|
||||
are reflected in each Vim immediately. Could work with local files but
|
||||
also over the internet. See http://www.codingmonkeys.de/subethaedit/.
|
||||
|
||||
When using "do" or ":diffget" in a buffer with changes in every line an extra
|
||||
empty line would appear.
|
||||
|
||||
vim:tw=78:sw=4:sts=4:ts=8:ft=help:norl:
|
||||
vim: set fo+=n :
|
||||
|
||||
+56
-5
@@ -1,7 +1,8 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: MetaFont
|
||||
" Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2008-07-09
|
||||
" Language: METAFONT
|
||||
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
|
||||
" Former Maintainers: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2016 Oct 2
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
@@ -11,9 +12,59 @@ let b:did_ftplugin = 1
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
let b:undo_ftplugin = "setl com< cms< fo<"
|
||||
let b:undo_ftplugin = "setl com< cms< fo< sua< inc< def< ofu<"
|
||||
\ . "| unlet! b:match_ignorecase b:match_words b:match_skip"
|
||||
|
||||
setlocal comments=:% commentstring=%\ %s formatoptions-=t formatoptions+=croql
|
||||
setlocal comments=:% commentstring=%\ %s formatoptions-=t formatoptions+=cjroql2
|
||||
setlocal suffixesadd=.mf
|
||||
let &l:include = '\<input\>'
|
||||
let &l:define = '\<\%(let\|newinternal\|interim\|def\|vardef\)\>\|\<\%(primary\|secondary\|tertiary\)def\>\s*[^ .]\+'
|
||||
setlocal omnifunc=syntaxcomplete#Complete
|
||||
let g:omni_syntax_group_include_mf = 'mf\w\+'
|
||||
let g:omni_syntax_group_exclude_mf = 'mfTodoComment'
|
||||
|
||||
let s:mp_regex = {
|
||||
\ 'beginsection' : '^\s*\%(\%(\|var\|primary\|secondary\|tertiary\)def\|beginchar\|beginlogochar\)\>',
|
||||
\ 'endsection' : '^\s*\%(enddef\|endchar\)\>',
|
||||
\ 'beginblock' : '^\s*\%(begingroup\|if\|for\%(\|suffixes\|ever\)\)\>',
|
||||
\ 'endblock' : '^\s*\%(endgroup\|fi\|endfor\)\>'
|
||||
\ }
|
||||
|
||||
function! s:move_around(count, what, flags, visual)
|
||||
if a:visual
|
||||
exe "normal! gv"
|
||||
endif
|
||||
call search(s:mp_regex[a:what], a:flags.'s') " 's' sets previous context mark
|
||||
call map(range(2, a:count), 'search(s:mp_regex[a:what], a:flags)')
|
||||
endfunction
|
||||
|
||||
|
||||
" Move around macros.
|
||||
nnoremap <silent><buffer> [[ :<C-U>call <SID>move_around(v:count1, "beginsection", "bW", v:false) <CR>
|
||||
vnoremap <silent><buffer> [[ :<C-U>call <SID>move_around(v:count1, "beginsection", "bW", v:true) <CR>
|
||||
nnoremap <silent><buffer> ]] :<C-U>call <SID>move_around(v:count1, "beginsection", "W", v:false) <CR>
|
||||
vnoremap <silent><buffer> ]] :<C-U>call <SID>move_around(v:count1, "beginsection", "W", v:true) <CR>
|
||||
nnoremap <silent><buffer> [] :<C-U>call <SID>move_around(v:count1, "endsection", "bW", v:false) <CR>
|
||||
vnoremap <silent><buffer> [] :<C-U>call <SID>move_around(v:count1, "endsection", "bW", v:true) <CR>
|
||||
nnoremap <silent><buffer> ][ :<C-U>call <SID>move_around(v:count1, "endsection", "W", v:false) <CR>
|
||||
vnoremap <silent><buffer> ][ :<C-U>call <SID>move_around(v:count1, "endsection", "W", v:true) <CR>
|
||||
nnoremap <silent><buffer> [{ :<C-U>call <SID>move_around(v:count1, "beginblock", "bW", v:false) <CR>
|
||||
vnoremap <silent><buffer> [{ :<C-U>call <SID>move_around(v:count1, "beginblock", "bW", v:true) <CR>
|
||||
nnoremap <silent><buffer> ]} :<C-U>call <SID>move_around(v:count1, "endblock", "W", v:false) <CR>
|
||||
vnoremap <silent><buffer> ]} :<C-U>call <SID>move_around(v:count1, "endblock", "W", v:true) <CR>
|
||||
|
||||
if exists("loaded_matchit")
|
||||
let b:match_ignorecase = 0
|
||||
let b:match_words =
|
||||
\ '\<if\>:\<else\%[if]\>:\<fi\>,' .
|
||||
\ '\<for\%(\|suffixes\|ever\)\>:\<exit\%(if\|unless\)\>:\<endfor\>,' .
|
||||
\ '\<\%(\|var\|primary\|secondary\|tertiary\)def\>:\<enddef\>,' .
|
||||
\ '\<begingroup\>:\<endgroup\>,' .
|
||||
\ '\<begin\%(logo\)\?char\>:\<endchar\>'
|
||||
" Ignore comments and strings
|
||||
let b:match_skip = 'synIDattr(synID(line("."), col("."), 1), "name")
|
||||
\ =~# "mf\\(Comment\\|String\\)$"'
|
||||
endif
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
+59
-5
@@ -1,7 +1,8 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: MetaPost
|
||||
" Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2008-07-09
|
||||
" Language: MetaPost
|
||||
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
|
||||
" Former Maintainers: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2016 Oct 2
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
@@ -11,9 +12,16 @@ let b:did_ftplugin = 1
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
let b:undo_ftplugin = "setl com< cms< fo<"
|
||||
let b:undo_ftplugin = "setl com< cms< fo< sua< inc< def< ofu<"
|
||||
\ . "| unlet! b:match_ignorecase b:match_words b:match_skip"
|
||||
|
||||
setlocal comments=:% commentstring=%\ %s formatoptions-=t formatoptions+=croql
|
||||
setlocal comments=:% commentstring=%\ %s formatoptions-=t formatoptions+=cjroql2
|
||||
setlocal suffixesadd=.mp,.mpiv
|
||||
let &l:include = '\<\%(input\|loadmodule\)\>' " loadmodule is in MetaFun
|
||||
let &l:define = '\<\%(let\|newinternal\|interim\|def\|vardef\)\>\|\<\%(primary\|secondary\|tertiary\)def\>\s*[^ .]\+'
|
||||
setlocal omnifunc=syntaxcomplete#Complete
|
||||
let g:omni_syntax_group_include_mp = 'mf\w\+,mp\w\+'
|
||||
let g:omni_syntax_group_exclude_mp = 'mfTodoComment'
|
||||
|
||||
if exists(":FixBeginfigs") != 2
|
||||
command -nargs=0 FixBeginfigs call s:fix_beginfigs()
|
||||
@@ -24,5 +32,51 @@ if exists(":FixBeginfigs") != 2
|
||||
endfunction
|
||||
endif
|
||||
|
||||
let s:mp_regex = {
|
||||
\ 'beginsection' : '^\s*\%(\%(\|var\|primary\|secondary\|tertiary\)def\|begin\%(fig\|char\|logochar\|glyph\|graph\)\)\>',
|
||||
\ 'endsection' : '^\s*\%(enddef\|end\%(fig\|char\|glyph\|graph\)\)\>',
|
||||
\ 'beginblock' : '^\s*\%(begingroup\|if\|for\%(\|suffixes\|ever\)\)\>',
|
||||
\ 'endblock' : '^\s*\%(endgroup\|fi\|endfor\)\>'
|
||||
\ }
|
||||
|
||||
function! s:move_around(count, what, flags, visual)
|
||||
if a:visual
|
||||
exe "normal! gv"
|
||||
endif
|
||||
call search(s:mp_regex[a:what], a:flags.'s') " 's' sets previous context mark
|
||||
call map(range(2, a:count), 'search(s:mp_regex[a:what], a:flags)')
|
||||
endfunction
|
||||
|
||||
|
||||
" Move around macros.
|
||||
nnoremap <silent><buffer> [[ :<C-U>call <SID>move_around(v:count1, "beginsection", "bW", v:false) <CR>
|
||||
vnoremap <silent><buffer> [[ :<C-U>call <SID>move_around(v:count1, "beginsection", "bW", v:true) <CR>
|
||||
nnoremap <silent><buffer> ]] :<C-U>call <SID>move_around(v:count1, "beginsection", "W", v:false) <CR>
|
||||
vnoremap <silent><buffer> ]] :<C-U>call <SID>move_around(v:count1, "beginsection", "W", v:true) <CR>
|
||||
nnoremap <silent><buffer> [] :<C-U>call <SID>move_around(v:count1, "endsection", "bW", v:false) <CR>
|
||||
vnoremap <silent><buffer> [] :<C-U>call <SID>move_around(v:count1, "endsection", "bW", v:true) <CR>
|
||||
nnoremap <silent><buffer> ][ :<C-U>call <SID>move_around(v:count1, "endsection", "W", v:false) <CR>
|
||||
vnoremap <silent><buffer> ][ :<C-U>call <SID>move_around(v:count1, "endsection", "W", v:true) <CR>
|
||||
nnoremap <silent><buffer> [{ :<C-U>call <SID>move_around(v:count1, "beginblock", "bW", v:false) <CR>
|
||||
vnoremap <silent><buffer> [{ :<C-U>call <SID>move_around(v:count1, "beginblock", "bW", v:true) <CR>
|
||||
nnoremap <silent><buffer> ]} :<C-U>call <SID>move_around(v:count1, "endblock", "W", v:false) <CR>
|
||||
vnoremap <silent><buffer> ]} :<C-U>call <SID>move_around(v:count1, "endblock", "W", v:true) <CR>
|
||||
|
||||
if exists("loaded_matchit")
|
||||
let b:match_ignorecase = 0
|
||||
let b:match_words =
|
||||
\ '\<if\>:\<else\%[if]\>:\<fi\>,' .
|
||||
\ '\<for\%(\|suffixes\|ever\)\>:\<exit\%(if\|unless\)\>:\<endfor\>,' .
|
||||
\ '\<\%(\|var\|primary\|secondary\|tertiary\)def\>:\<enddef\>,' .
|
||||
\ '\<beginfig\>:\<endfig\>,' .
|
||||
\ '\<begingroup\>:\<endgroup\>,' .
|
||||
\ '\<begin\%(logo\)\?char\>:\<endchar\>,' .
|
||||
\ '\<beginglyph\>:\<endglyph\>,' .
|
||||
\ '\<begingraph\>:\<endgraph\>'
|
||||
" Ignore comments and strings
|
||||
let b:match_skip = 'synIDattr(synID(line("."), col("."), 1), "name")
|
||||
\ =~# "^mf\\%(Comment\\|String\\|\\)$\\|^mpTeXinsert$"'
|
||||
endif
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" Language: python
|
||||
" Maintainer: James Sully <sullyj3@gmail.com>
|
||||
" Previous Maintainer: Johannes Zellner <johannes@zellner.org>
|
||||
" Last Change: Tue, 06 September 2016
|
||||
" Last Change: Tue, 09 October 2016
|
||||
" https://github.com/sullyj3/vim-ftplugin-python
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
@@ -22,10 +22,10 @@ setlocal omnifunc=pythoncomplete#Complete
|
||||
|
||||
set wildignore+=*.pyc
|
||||
|
||||
let b:next_toplevel='\v%$\|^(class\|def)>'
|
||||
let b:prev_toplevel='\v^(class\|def)>'
|
||||
let b:next='\v%$\|^\s*(class\|def)>'
|
||||
let b:prev='\v^\s*(class\|def)>'
|
||||
let b:next_toplevel='\v%$\|^(class\|def\|async def)>'
|
||||
let b:prev_toplevel='\v^(class\|def\|async def)>'
|
||||
let b:next='\v%$\|^\s*(class\|def\|async def)>'
|
||||
let b:prev='\v^\s*(class\|def\|async def)>'
|
||||
|
||||
execute "nnoremap <silent> <buffer> ]] :call <SID>Python_jump('n', '". b:next_toplevel."', 'W')<cr>"
|
||||
execute "nnoremap <silent> <buffer> [[ :call <SID>Python_jump('n', '". b:prev_toplevel."', 'Wb')<cr>"
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
" Vim indent file
|
||||
" Language: Fortran 2008 (and older: Fortran 2003, 95, 90, and 77)
|
||||
" Version: 0.45
|
||||
" Last Change: 2016 Aug. 29
|
||||
" Version: 0.46
|
||||
" Last Change: 2016 Sep. 27
|
||||
" Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www2.unb.ca/~ajit/>
|
||||
" Usage: For instructions, do :help fortran-indent from Vim
|
||||
" Credits:
|
||||
" Useful suggestions were made by: Albert Oliver Serra and Takuya Fujiwara.
|
||||
" Useful suggestions were made, in chronological order, by:
|
||||
" Albert Oliver Serra, Takuya Fujiwara and Philipp Edelmann.
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
@@ -121,7 +122,8 @@ function FortranGetIndent(lnum)
|
||||
let prefix='\(\(pure\|impure\|elemental\|recursive\)\s\+\)\{,2}'
|
||||
let type='\(\(integer\|real\|double\s\+precision\|complex\|logical'
|
||||
\.'\|character\|type\|class\)\s*\S*\s\+\)\='
|
||||
if prevstat =~? '^\s*\(module\|contains\/submodule\|program\)\>'
|
||||
if prevstat =~? '^\s*\(contains\|submodule\|program\)\>'
|
||||
\ ||prevstat =~? '^\s*'.'module\>\(\s*\procedure\)\@!'
|
||||
\ ||prevstat =~? '^\s*'.prefix.'subroutine\>'
|
||||
\ ||prevstat =~? '^\s*'.prefix.type.'function\>'
|
||||
\ ||prevstat =~? '^\s*'.type.prefix.'function\>'
|
||||
@@ -129,7 +131,7 @@ function FortranGetIndent(lnum)
|
||||
endif
|
||||
if getline(v:lnum) =~? '^\s*contains\>'
|
||||
\ ||getline(v:lnum)=~? '^\s*end\s*'
|
||||
\ .'\(function\|subroutine\|module\/submodule\|program\)\>'
|
||||
\ .'\(function\|subroutine\|module\|submodule\|program\)\>'
|
||||
let ind = ind - shiftwidth()
|
||||
endif
|
||||
endif
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
" METAFONT indent file
|
||||
" Language: METAFONT
|
||||
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
|
||||
" Last Change: 2016 Oct 1
|
||||
|
||||
runtime! indent/mp.vim
|
||||
+324
-175
@@ -1,56 +1,19 @@
|
||||
" MetaPost indent file
|
||||
" Language: MetaPost
|
||||
" Maintainer: Eugene Minkovskii <emin@mccme.ru>
|
||||
" Last Change: 2012 May 18
|
||||
" Version: 0.1
|
||||
" ==========================================================================
|
||||
" Language: MetaPost
|
||||
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
|
||||
" Former Maintainers: Eugene Minkovskii <emin@mccme.ru>
|
||||
" Last Change: 2016 Oct 2, 4:13pm
|
||||
" Version: 0.2
|
||||
|
||||
" Identation Rules: {{{1
|
||||
" First of all, MetaPost language don't expect any identation rules.
|
||||
" This screept need for you only if you (not MetaPost) need to do
|
||||
" exactly code. If you don't need to use indentation, see
|
||||
" :help filetype-indent-off
|
||||
"
|
||||
" Note: Every rules of identation in MetaPost or TeX languages (and in some
|
||||
" other of course) is very subjective. I can release only my vision of this
|
||||
" promlem.
|
||||
"
|
||||
" ..........................................................................
|
||||
" Example of correct (by me) identation {{{2
|
||||
" shiftwidth=4
|
||||
" ==========================================================================
|
||||
" for i=0 upto 99:
|
||||
" z[i] = (0,1u) rotated (i*360/100);
|
||||
" endfor
|
||||
" draw z0 -- z10 -- z20
|
||||
" withpen ... % <- 2sw because breaked line
|
||||
" withcolor ...; % <- same as previous
|
||||
" draw z0 for i=1 upto 99:
|
||||
" -- z[i] % <- 1sw from left end of 'for' satement
|
||||
" endfor withpen ... % <- 0sw from left end of 'for' satement
|
||||
" withcolor ...; % <- 2sw because breaked line
|
||||
" draw if One: % <- This is internal if (like 'for' above)
|
||||
" one
|
||||
" elsif Other:
|
||||
" other
|
||||
" fi withpen ...;
|
||||
" if one: % <- This is external if
|
||||
" draw one;
|
||||
" elseif other:
|
||||
" draw other;
|
||||
" fi
|
||||
" draw z0; draw z1;
|
||||
" }}}
|
||||
" }}}
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal indentexpr=GetMetaPostIndent()
|
||||
setlocal indentkeys+=;,<:>,=if,=for,=def,=end,=else,=fi
|
||||
setlocal indentkeys+==end,=else,=fi,=fill,0),0]
|
||||
|
||||
let b:undo_indent = "setl indentkeys< indentexpr<"
|
||||
|
||||
" Only define the function once.
|
||||
if exists("*GetMetaPostIndent")
|
||||
@@ -59,151 +22,337 @@ endif
|
||||
let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
|
||||
" Auxiliary Definitions: {{{1
|
||||
function! MetaNextNonblankNoncomment(pos)
|
||||
" Like nextnonblank() but ignore comment lines
|
||||
let tmp = nextnonblank(a:pos)
|
||||
while tmp && getline(tmp) =~ '^\s*%'
|
||||
let tmp = nextnonblank(tmp+1)
|
||||
function GetMetaPostIndent()
|
||||
let ignorecase_save = &ignorecase
|
||||
try
|
||||
let &ignorecase = 0
|
||||
return GetMetaPostIndentIntern()
|
||||
finally
|
||||
let &ignorecase = ignorecase_save
|
||||
endtry
|
||||
endfunc
|
||||
|
||||
" Regexps {{{
|
||||
" Note: the next three variables are made global so that a user may add
|
||||
" further keywords.
|
||||
"
|
||||
" Example:
|
||||
"
|
||||
" Put these in ~/.vim/after/indent/mp.vim
|
||||
"
|
||||
" let g:mp_open_tag .= '\|\<begintest\>'
|
||||
" let g:mp_close_tag .= '\|\<endtest\>'
|
||||
|
||||
" Expressions starting indented blocks
|
||||
let g:mp_open_tag = ''
|
||||
\ . '\<if\>'
|
||||
\ . '\|\<else\%[if]\>'
|
||||
\ . '\|\<for\%(\|ever\|suffixes\)\>'
|
||||
\ . '\|\<begingroup\>'
|
||||
\ . '\|\<\%(\|var\|primary\|secondary\|tertiary\)def\>'
|
||||
\ . '\|^\s*\<begin\%(fig\|graph\|glyph\|char\|logochar\)\>'
|
||||
\ . '\|[([{]'
|
||||
|
||||
" Expressions ending indented blocks
|
||||
let g:mp_close_tag = ''
|
||||
\ . '\<fi\>'
|
||||
\ . '\|\<else\%[if]\>'
|
||||
\ . '\|\<end\%(\|for\|group\|def\|fig\|char\|glyph\|graph\)\>'
|
||||
\ . '\|[)\]}]'
|
||||
|
||||
" Statements that may span multiple lines and are ended by a semicolon. To
|
||||
" keep this list short, statements that are unlikely to be very long or are
|
||||
" not very common (e.g., keywords like `interim` or `showtoken`) are not
|
||||
" included.
|
||||
"
|
||||
" The regex for assignments and equations (the last branch) is tricky, because
|
||||
" it must not match things like `for i :=`, `if a=b`, `def...=`, etc... It is
|
||||
" not perfect, but it works reasonably well.
|
||||
let g:mp_statement = ''
|
||||
\ . '\<\%(\|un\|cut\)draw\>'
|
||||
\ . '\|\<\%(\|un\)fill\%[draw]\>'
|
||||
\ . '\|\<draw\%(dbl\)\=arrow\>'
|
||||
\ . '\|\<clip\>'
|
||||
\ . '\|\<addto\>'
|
||||
\ . '\|\<save\>'
|
||||
\ . '\|\<setbounds\>'
|
||||
\ . '\|\<message\>'
|
||||
\ . '\|\<errmessage\>'
|
||||
\ . '\|\<errhelp\>'
|
||||
\ . '\|\<fontmapline\>'
|
||||
\ . '\|\<pickup\>'
|
||||
\ . '\|\<show\>'
|
||||
\ . '\|\<special\>'
|
||||
\ . '\|\<write\>'
|
||||
\ . '\|\%(^\|;\)\%([^;=]*\%('.g:mp_open_tag.'\)\)\@!.\{-}:\=='
|
||||
|
||||
" A line ends with zero or more spaces, possibly followed by a comment.
|
||||
let s:eol = '\s*\%($\|%\)'
|
||||
" }}}
|
||||
|
||||
" Auxiliary functions {{{
|
||||
" Returns 1 if (0-based) position immediately preceding `pos` in `line` is
|
||||
" inside a string or a comment; returns 0 otherwise.
|
||||
|
||||
" This is the function that is called more often when indenting, so it is
|
||||
" critical that it is efficient. The method we use is significantly faster
|
||||
" than using syntax attributes, and more general (it does not require
|
||||
" syntax_items). It is also faster than using a single regex matching an even
|
||||
" number of quotes. It helps that MetaPost strings cannot span more than one
|
||||
" line and cannot contain escaped quotes.
|
||||
function! s:CommentOrString(line, pos)
|
||||
let in_string = 0
|
||||
let q = stridx(a:line, '"')
|
||||
let c = stridx(a:line, '%')
|
||||
while q >= 0 && q < a:pos
|
||||
if c >= 0 && c < q
|
||||
if in_string " Find next percent symbol
|
||||
let c = stridx(a:line, '%', q + 1)
|
||||
else " Inside comment
|
||||
return 1
|
||||
endif
|
||||
endif
|
||||
let in_string = 1 - in_string
|
||||
let q = stridx(a:line, '"', q + 1) " Find next quote
|
||||
endwhile
|
||||
return tmp
|
||||
return in_string || (c >= 0 && c <= a:pos)
|
||||
endfunction
|
||||
|
||||
function! MetaPrevNonblankNoncomment(pos)
|
||||
" Like prevnonblank() but ignore comment lines
|
||||
let tmp = prevnonblank(a:pos)
|
||||
while tmp && getline(tmp) =~ '^\s*%'
|
||||
let tmp = prevnonblank(tmp-1)
|
||||
" Find the first non-comment non-blank line before the current line.
|
||||
function! s:PrevNonBlankNonComment(lnum)
|
||||
let l:lnum = prevnonblank(a:lnum - 1)
|
||||
while getline(l:lnum) =~# '^\s*%'
|
||||
let l:lnum = prevnonblank(l:lnum - 1)
|
||||
endwhile
|
||||
return tmp
|
||||
return l:lnum
|
||||
endfunction
|
||||
|
||||
function! MetaSearchNoncomment(pattern, ...)
|
||||
" Like search() but ignore commented areas
|
||||
if a:0
|
||||
let flags = a:1
|
||||
elseif &wrapscan
|
||||
let flags = "w"
|
||||
else
|
||||
let flags = "W"
|
||||
endif
|
||||
let cl = line(".")
|
||||
let cc = col(".")
|
||||
let tmp = search(a:pattern, flags)
|
||||
while tmp && synIDattr(synID(line("."), col("."), 1), "name") =~
|
||||
\ 'm[fp]\(Comment\|TeXinsert\|String\)'
|
||||
let tmp = search(a:pattern, flags)
|
||||
" Returns true if the last tag appearing in the line is an open tag; returns
|
||||
" false otherwise.
|
||||
function! s:LastTagIsOpen(line)
|
||||
let o = s:LastValidMatchEnd(a:line, g:mp_open_tag, 0)
|
||||
if o == - 1 | return v:false | endif
|
||||
return s:LastValidMatchEnd(a:line, g:mp_close_tag, o) < 0
|
||||
endfunction
|
||||
|
||||
" A simple, efficient and quite effective heuristics is used to test whether
|
||||
" a line should cause the next line to be indented: count the "opening tags"
|
||||
" (if, for, def, ...) in the line, count the "closing tags" (endif, endfor,
|
||||
" ...) in the line, and compute the difference. We call the result the
|
||||
" "weight" of the line. If the weight is positive, then the next line should
|
||||
" most likely be indented. Note that `else` and `elseif` are both opening and
|
||||
" closing tags, so they "cancel out" in almost all cases, the only exception
|
||||
" being a leading `else[if]`, which is counted as an opening tag, but not as
|
||||
" a closing tag (so that, for instance, a line containing a single `else:`
|
||||
" will have weight equal to one, not zero). We do not treat a trailing
|
||||
" `else[if]` in any special way, because lines ending with an open tag are
|
||||
" dealt with separately before this function is called (see
|
||||
" GetMetaPostIndentIntern()).
|
||||
"
|
||||
" Example:
|
||||
"
|
||||
" forsuffixes $=a,b: if x.$ = y.$ : draw else: fill fi
|
||||
" % This line will be indented because |{forsuffixes,if,else}| > |{else,fi}| (3 > 2)
|
||||
" endfor
|
||||
|
||||
function! s:Weight(line)
|
||||
let [o, i] = [0, s:ValidMatchEnd(a:line, g:mp_open_tag, 0)]
|
||||
while i > 0
|
||||
let o += 1
|
||||
let i = s:ValidMatchEnd(a:line, g:mp_open_tag, i)
|
||||
endwhile
|
||||
if !tmp
|
||||
call cursor(cl,cc)
|
||||
let [c, i] = [0, matchend(a:line, '^\s*\<else\%[if]\>')] " Skip a leading else[if]
|
||||
let i = s:ValidMatchEnd(a:line, g:mp_close_tag, i)
|
||||
while i > 0
|
||||
let c += 1
|
||||
let i = s:ValidMatchEnd(a:line, g:mp_close_tag, i)
|
||||
endwhile
|
||||
return o - c
|
||||
endfunction
|
||||
|
||||
" Similar to matchend(), but skips strings and comments.
|
||||
" line: a String
|
||||
function! s:ValidMatchEnd(line, pat, start)
|
||||
let i = matchend(a:line, a:pat, a:start)
|
||||
while i > 0 && s:CommentOrString(a:line, i)
|
||||
let i = matchend(a:line, a:pat, i)
|
||||
endwhile
|
||||
return i
|
||||
endfunction
|
||||
|
||||
" Like s:ValidMatchEnd(), but returns the end position of the last (i.e.,
|
||||
" rightmost) match.
|
||||
function! s:LastValidMatchEnd(line, pat, start)
|
||||
let last_found = -1
|
||||
let i = matchend(a:line, a:pat, a:start)
|
||||
while i > 0
|
||||
if !s:CommentOrString(a:line, i)
|
||||
let last_found = i
|
||||
endif
|
||||
let i = matchend(a:line, a:pat, i)
|
||||
endwhile
|
||||
return last_found
|
||||
endfunction
|
||||
|
||||
function! s:DecreaseIndentOnClosingTag(curr_indent)
|
||||
let cur_text = getline(v:lnum)
|
||||
if cur_text =~# '^\s*\%('.g:mp_close_tag.'\)'
|
||||
return max([a:curr_indent - shiftwidth(), 0])
|
||||
endif
|
||||
return tmp
|
||||
return a:curr_indent
|
||||
endfunction
|
||||
" }}}
|
||||
|
||||
function! GetMetaPostIndent()
|
||||
" not indent in comment ???
|
||||
if synIDattr(synID(line("."), col("."), 1), "name") =~
|
||||
\ 'm[fp]\(Comment\|TeXinsert\|String\)'
|
||||
" Main function {{{
|
||||
"
|
||||
" Note: Every rule of indentation in MetaPost is very subjective. We might get
|
||||
" creative, but things get murky very soon (there are too many corner cases).
|
||||
" So, we provide a means for the user to decide what to do when this script
|
||||
" doesn't get it. We use a simple idea: use '%>', '%<' and '%=' to explicitly
|
||||
" control indentation. The '<' and '>' symbols may be repeated many times
|
||||
" (e.g., '%>>' will cause the next line to be indented twice).
|
||||
"
|
||||
" By using '%>...', '%<...' and '%=', the indentation the user wants is
|
||||
" preserved by commands like gg=G, even if it does not follow the rules of
|
||||
" this script.
|
||||
"
|
||||
" Example:
|
||||
"
|
||||
" def foo =
|
||||
" makepen(
|
||||
" subpath(T-n,t) of r %>
|
||||
" shifted .5down %>
|
||||
" --subpath(t,T) of r shifted .5up -- cycle %<<<
|
||||
" )
|
||||
" withcolor black
|
||||
" enddef
|
||||
"
|
||||
" The default indentation of the previous example would be:
|
||||
"
|
||||
" def foo =
|
||||
" makepen(
|
||||
" subpath(T-n,t) of r
|
||||
" shifted .5down
|
||||
" --subpath(t,T) of r shifted .5up -- cycle
|
||||
" )
|
||||
" withcolor black
|
||||
" enddef
|
||||
"
|
||||
" Personally, I prefer the latter, but anyway...
|
||||
function! GetMetaPostIndentIntern()
|
||||
" Do not touch indentation inside verbatimtex/btex.. etex blocks.
|
||||
if synIDattr(synID(v:lnum, 1, 1), "name") =~# '^mpTeXinsert$\|^tex\|^Delimiter'
|
||||
return -1
|
||||
endif
|
||||
" Some RegExps: {{{1
|
||||
" end_of_item: all of end by ';'
|
||||
" + all of end by :endfor, :enddef, :endfig, :endgroup, :fi
|
||||
" + all of start by :beginfig(num), :begingroup
|
||||
" + all of start by :for, :if, :else, :elseif and end by ':'
|
||||
" + all of start by :def, :vardef and end by '='
|
||||
let end_of_item = '\(' .
|
||||
\ ';\|' .
|
||||
\ '\<\(end\(for\|def\|fig\|group\)\|fi\)\>\|' .
|
||||
\ '\<begin\(group\>\|fig\s*(\s*\d\+\s*)\)\|' .
|
||||
\ '\<\(for\|if\|else\(if\)\=\)\>.\+:\|' .
|
||||
\ '\<\(var\)\=def\>.\+=' . '\)'
|
||||
" }}}
|
||||
" Save: current position {{{1
|
||||
let cl = line (".")
|
||||
let cc = col (".")
|
||||
let cs = getline(".")
|
||||
" if it is :beginfig or :endfig use zero indent
|
||||
if cs =~ '^\s*\(begin\|end\)fig\>'
|
||||
return 0
|
||||
endif
|
||||
" }}}
|
||||
" Initialise: ind variable {{{1
|
||||
" search previous item not in current line
|
||||
let p_semicol_l = MetaSearchNoncomment(end_of_item,"bW")
|
||||
while p_semicol_l == cl
|
||||
let p_semicol_l = MetaSearchNoncomment(end_of_item,"bW")
|
||||
endwhile
|
||||
" if this is first item in program use zero indent
|
||||
if !p_semicol_l
|
||||
return 0
|
||||
endif
|
||||
" if this is multiline item, remember first indent
|
||||
if MetaNextNonblankNoncomment(p_semicol_l+1) < cl
|
||||
let ind = indent(MetaNextNonblankNoncomment(p_semicol_l+1))
|
||||
" else --- search pre-previous item for search first line in previous item
|
||||
else
|
||||
" search pre-previous item not in current line
|
||||
let pp_semicol_l = MetaSearchNoncomment(end_of_item,"bW")
|
||||
while pp_semicol_l == p_semicol_l
|
||||
let pp_semicol_l = MetaSearchNoncomment(end_of_item,"bW")
|
||||
endwhile
|
||||
" if we find pre-previous item, remember indent of previous item
|
||||
" else --- remember zero
|
||||
if pp_semicol_l
|
||||
let ind = indent(MetaNextNonblankNoncomment(line(".")+1))
|
||||
else
|
||||
let ind = 0
|
||||
endif
|
||||
endif
|
||||
" }}}
|
||||
" Increase Indent: {{{1
|
||||
" if it is an internal/external :for or :if statements {{{2
|
||||
let pnn_s = getline(MetaPrevNonblankNoncomment(cl-1))
|
||||
if pnn_s =~ '\<\(for\|if\)\>.\+:\s*\($\|%\)'
|
||||
let ind = match(pnn_s, '\<\(for\|if\)\>.\+:\s*\($\|%\)') + &sw
|
||||
" }}}
|
||||
" if it is a :def, :vardef, :beginfig, :begingroup, :else, :elseif {{{2
|
||||
elseif pnn_s =~ '^\s*\(' .
|
||||
\ '\(var\)\=def\|' .
|
||||
\ 'begin\(group\|fig\s*(\s*\d\+\s*)\)\|' .
|
||||
\ 'else\(if\)\=' . '\)\>'
|
||||
let ind = ind + &sw
|
||||
" }}}
|
||||
" if it is a broken line {{{2
|
||||
elseif pnn_s !~ end_of_item.'\s*\($\|%\)'
|
||||
let ind = ind + (2 * &sw)
|
||||
endif
|
||||
" }}}
|
||||
" }}}
|
||||
" Decrease Indent: {{{1
|
||||
" if this is :endfor or :enddef statements {{{2
|
||||
" this is correct because :def cannot be inside :for
|
||||
if cs =~ '\<end\(for\|def\)\=\>'
|
||||
call MetaSearchNoncomment('\<for\>.\+:\s*\($\|%\)' . '\|' .
|
||||
\ '^\s*\(var\)\=def\>',"bW")
|
||||
if col(".") > 1
|
||||
let ind = col(".") - 1
|
||||
else
|
||||
let ind = indent(".")
|
||||
endif
|
||||
" }}}
|
||||
" if this is :fi, :else, :elseif statements {{{2
|
||||
elseif cs =~ '\<\(else\(if\)\=\|fi\)\>'
|
||||
call MetaSearchNoncomment('\<if\>.\+:\s*\($\|%\)',"bW")
|
||||
let ind = col(".") - 1
|
||||
" }}}
|
||||
" if this is :endgroup statement {{{2
|
||||
elseif cs =~ '^\s*endgroup\>'
|
||||
let ind = ind - &sw
|
||||
endif
|
||||
" }}}
|
||||
" }}}
|
||||
|
||||
return ind
|
||||
" This is the reference line relative to which the current line is indented
|
||||
" (but see below).
|
||||
let lnum = s:PrevNonBlankNonComment(v:lnum)
|
||||
|
||||
" At the start of the file use zero indent.
|
||||
if lnum == 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
let prev_text = getline(lnum)
|
||||
|
||||
" User-defined overrides take precedence over anything else.
|
||||
" See above for an example.
|
||||
let j = match(prev_text, '%[<>=]')
|
||||
if j > 0
|
||||
let i = strlen(matchstr(prev_text, '%>\+', j)) - 1
|
||||
if i > 0
|
||||
return indent(lnum) + i * shiftwidth()
|
||||
endif
|
||||
|
||||
let i = strlen(matchstr(prev_text, '%<\+', j)) - 1
|
||||
if i > 0
|
||||
return max([indent(lnum) - i * shiftwidth(), 0])
|
||||
endif
|
||||
|
||||
if match(prev_text, '%=', j)
|
||||
return indent(lnum)
|
||||
endif
|
||||
endif
|
||||
|
||||
" If the reference line ends with an open tag, indent.
|
||||
"
|
||||
" Example:
|
||||
"
|
||||
" if c:
|
||||
" 0
|
||||
" else:
|
||||
" 1
|
||||
" fi if c2: % Note that this line has weight equal to zero.
|
||||
" ... % This line will be indented
|
||||
if s:LastTagIsOpen(prev_text)
|
||||
return s:DecreaseIndentOnClosingTag(indent(lnum) + shiftwidth())
|
||||
endif
|
||||
|
||||
" Lines with a positive weight are unbalanced and should likely be indented.
|
||||
"
|
||||
" Example:
|
||||
"
|
||||
" def f = enddef for i = 1 upto 5: if x[i] > 0: 1 else: 2 fi
|
||||
" ... % This line will be indented (because of the unterminated `for`)
|
||||
if s:Weight(prev_text) > 0
|
||||
return s:DecreaseIndentOnClosingTag(indent(lnum) + shiftwidth())
|
||||
endif
|
||||
|
||||
" Unterminated statements cause indentation to kick in.
|
||||
"
|
||||
" Example:
|
||||
"
|
||||
" draw unitsquare
|
||||
" withcolor black; % This line is indented because of `draw`.
|
||||
" x := a + b + c
|
||||
" + d + e; % This line is indented because of `:=`.
|
||||
"
|
||||
let i = s:LastValidMatchEnd(prev_text, g:mp_statement, 0)
|
||||
if i >= 0 " Does the line contain a statement?
|
||||
if s:ValidMatchEnd(prev_text, ';', i) < 0 " Is the statement unterminated?
|
||||
return indent(lnum) + shiftwidth()
|
||||
else
|
||||
return s:DecreaseIndentOnClosingTag(indent(lnum))
|
||||
endif
|
||||
endif
|
||||
|
||||
" Deal with the special case of a statement spanning multiple lines. If the
|
||||
" current reference line L ends with a semicolon, search backwards for
|
||||
" another semicolon or a statement keyword. If the latter is found first,
|
||||
" its line is used as the reference line for indenting the current line
|
||||
" instead of L.
|
||||
"
|
||||
" Example:
|
||||
"
|
||||
" if cond:
|
||||
" draw if a: z0 else: z1 fi
|
||||
" shifted S
|
||||
" scaled T; % L
|
||||
"
|
||||
" for i = 1 upto 3: % <-- Current line: this gets the same indent as `draw ...`
|
||||
"
|
||||
" NOTE: we get here only if L does not contain a statement (among those
|
||||
" listed in g:mp_statement).
|
||||
if s:ValidMatchEnd(prev_text, ';'.s:eol, 0) >= 0 " L ends with a semicolon
|
||||
let stm_lnum = s:PrevNonBlankNonComment(lnum)
|
||||
while stm_lnum > 0
|
||||
let prev_text = getline(stm_lnum)
|
||||
let sc_pos = s:LastValidMatchEnd(prev_text, ';', 0)
|
||||
let stm_pos = s:ValidMatchEnd(prev_text, g:mp_statement, sc_pos)
|
||||
if stm_pos > sc_pos
|
||||
let lnum = stm_lnum
|
||||
break
|
||||
elseif sc_pos > stm_pos
|
||||
break
|
||||
endif
|
||||
let stm_lnum = s:PrevNonBlankNonComment(stm_lnum)
|
||||
endwhile
|
||||
endif
|
||||
|
||||
return s:DecreaseIndentOnClosingTag(indent(lnum))
|
||||
endfunction
|
||||
"
|
||||
" }}}
|
||||
|
||||
let &cpo = s:keepcpo
|
||||
unlet s:keepcpo
|
||||
|
||||
@@ -92,11 +92,12 @@ let s:end_skip_expr = s:skip_expr .
|
||||
\ ' && getline(".") =~ "^\\s*\\<\\(while\\|until\\|for\\):\\@!\\>")'
|
||||
|
||||
" Regex that defines continuation lines, not including (, {, or [.
|
||||
let s:non_bracket_continuation_regex = '\%([\\.,:*/%+]\|\<and\|\<or\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\)\s*\%(#.*\)\=$'
|
||||
let s:non_bracket_continuation_regex =
|
||||
\ '\%([\\.,:*/%+]\|\<and\|\<or\|\%(<%\)\@<![=-]\|:\@<![^[:alnum:]:][|&?]\|||\|&&\)\s*\%(#.*\)\=$'
|
||||
|
||||
" Regex that defines continuation lines.
|
||||
let s:continuation_regex =
|
||||
\ '\%(%\@<![({[\\.,:*/%+]\|\<and\|\<or\|\%(<%\)\@<![=-]\|\W[|&?]\|||\|&&\)\s*\%(#.*\)\=$'
|
||||
\ '\%(%\@<![({[\\.,:*/%+]\|\<and\|\<or\|\%(<%\)\@<![=-]\|:\@<![^[:alnum:]:][|&?]\|||\|&&\)\s*\%(#.*\)\=$'
|
||||
|
||||
" Regex that defines continuable keywords
|
||||
let s:continuable_regex =
|
||||
@@ -389,7 +390,7 @@ function! s:FindContainingClass()
|
||||
call setpos('.', saved_position)
|
||||
return found_lnum
|
||||
endif
|
||||
endif
|
||||
endwhile
|
||||
|
||||
call setpos('.', saved_position)
|
||||
return 0
|
||||
|
||||
+32
-5
@@ -389,19 +389,46 @@ endfun
|
||||
|
||||
" get NL separated string with file names
|
||||
let s:n = globpath(&runtimepath, "colors/*.vim")
|
||||
let s:n .= globpath(&packpath, "pack/*/{opt,start}/*/colors/*.vim")
|
||||
|
||||
" split at NL, Ignore case for VMS and windows, sort on name
|
||||
let s:names = sort(map(split(s:n, "\n"), 'substitute(v:val, "\\c.*[/\\\\:\\]]\\([^/\\\\:]*\\)\\.vim", "\\1", "")'), 1)
|
||||
|
||||
" define all the submenu entries
|
||||
let s:idx = 100
|
||||
let s:cs_idx = 100
|
||||
for s:name in s:names
|
||||
exe "an 20.450." . s:idx . ' &Edit.C&olor\ Scheme.' . s:name . " :colors " . s:name . "<CR>"
|
||||
let s:idx = s:idx + 10
|
||||
exe "an 20.450." . s:cs_idx . ' &Edit.C&olor\ Scheme.' . s:name . " :colors " . s:name . "<CR>"
|
||||
let s:cs_idx = s:cs_idx + 10
|
||||
endfor
|
||||
unlet s:name s:names s:n s:idx
|
||||
exe "an 20.450." . s:cs_idx . ' &Edit.C&olor\ Scheme.-SEP- <Nop>'
|
||||
let s:cs_idx = s:cs_idx + 10
|
||||
exe "an <silent> 20.450." . s:cs_idx '&Edit.C&olor\ Scheme.Find\ More\ Color\ Schemes' ":call <SID>Colorschemes()<CR>"
|
||||
let s:cs_idx = s:cs_idx + 10
|
||||
unlet s:name s:names s:n
|
||||
|
||||
let s:undo_colorschemes = ['aun &Edit.C&olor\ Scheme.Find\ More\ Color\ Schemes']
|
||||
func! s:Colorschemes()
|
||||
for cmd in s:undo_colorschemes
|
||||
exe "silent! " . cmd
|
||||
endfor
|
||||
let s:undo_colorschemes = []
|
||||
|
||||
let s = globpath(&packpath, "pack/*/{opt,start}/*/colors/*.vim")
|
||||
let names = sort(map(split(s, "\n"), 'substitute(v:val, "\\c.*[/\\\\:\\]]\\([^/\\\\:]*\\)\\.vim", "\\1", "")'), 1)
|
||||
let n = s:cs_idx
|
||||
for name in names
|
||||
let menuname = '&Edit.C&olor\ Scheme.' . name
|
||||
exe 'an 20.450.' . n . ' ' . menuname . " :colors " . name . "<CR>"
|
||||
let s:undo_colorschemes += ['aun ' . menuname]
|
||||
let n += 10
|
||||
endfor
|
||||
if empty(names)
|
||||
echomsg "Could not find other color schemes"
|
||||
elseif len(names) == 1
|
||||
echomsg "Found color scheme " . names[0]
|
||||
else
|
||||
echomsg "Found " . len(names) . " more color schemes"
|
||||
endif
|
||||
endfun
|
||||
|
||||
" Setup the Edit.Keymap submenu
|
||||
if has("keymap")
|
||||
|
||||
@@ -2,14 +2,12 @@
|
||||
" Language: AVR Assembler (AVRA)
|
||||
" AVRA Home: http://avra.sourceforge.net/index.html
|
||||
" AVRA Version: 1.3.0
|
||||
" Last Update: 2016 Oct 7
|
||||
" Maintainer: Marius Ghita <mhitza@gmail.com>
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
setlocal iskeyword=a-z,A-Z,48-57,.,_
|
||||
" 'isident' is a global option, better not set it
|
||||
" setlocal isident=a-z,A-Z,48-57,.,_
|
||||
syn case ignore
|
||||
|
||||
syn keyword avraRegister r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" Language: Debian sources.list
|
||||
" Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
|
||||
" Former Maintainer: Matthijs Mohlmann <matthijs@cacholong.nl>
|
||||
" Last Change: 2016 Aug 30
|
||||
" Last Change: 2016 Sep 27
|
||||
" URL: https://anonscm.debian.org/cgit/pkg-vim/vim.git/plain/runtime/syntax/debsources.vim
|
||||
|
||||
" Standard syntax initialization
|
||||
@@ -39,7 +39,7 @@ let s:unsupported = [
|
||||
let &cpo=s:cpo
|
||||
|
||||
" Match uri's
|
||||
syn match debsourcesUri +\(http://\|ftp://\|[rs]sh://\|debtorrent://\|\(cdrom\|copy\|file\):\)[^' <>"]\++
|
||||
syn match debsourcesUri +\(https\?://\|ftp://\|[rs]sh://\|debtorrent://\|\(cdrom\|copy\|file\):\)[^' <>"]\++
|
||||
exe 'syn match debsourcesDistrKeyword +\([[:alnum:]_./]*\)\('. join(s:supported, '\|'). '\)\([-[:alnum:]_./]*\)+'
|
||||
exe 'syn match debsourcesUnsupportedDistrKeyword +\([[:alnum:]_./]*\)\('. join(s:unsupported, '\|') .'\)\([-[:alnum:]_./]*\)+'
|
||||
|
||||
|
||||
+241
-130
@@ -1,184 +1,295 @@
|
||||
" Vim syntax file
|
||||
" Language: Metafont
|
||||
" Maintainer: Andreas Scherer <andreas.scherer@pobox.com>
|
||||
" Last Change: April 25, 2001
|
||||
" Language: METAFONT
|
||||
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
|
||||
" Former Maintainers: Andreas Scherer <andreas.scherer@pobox.com>
|
||||
" Last Change: 2016 Oct 1
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
" Metafont 'primitives' as defined in chapter 25 of 'The METAFONTbook'
|
||||
syn iskeyword @,_
|
||||
|
||||
" METAFONT 'primitives' as defined in chapter 25 of 'The METAFONTbook'
|
||||
" Page 210: 'boolean expressions'
|
||||
syn keyword mfBoolExp true false known unknown odd charexists not and or
|
||||
syn keyword mfBoolExp and charexists false known not odd or true unknown
|
||||
|
||||
" Page 210: 'numeric expression'
|
||||
syn keyword mfNumExp normaldeviate length ASCII oct hex angle turningnumber
|
||||
syn keyword mfNumExp totalweight directiontime xpart ypart xxpart xypart
|
||||
syn keyword mfNumExp yxpart yypart sqrt sind cosd mlog mexp floor
|
||||
syn keyword mfNumExp uniformdeviate
|
||||
syn keyword mfNumExp ASCII angle cosd directiontime floor hex length
|
||||
syn keyword mfNumExp mexp mlog normaldeviate oct sind sqrt totalweight
|
||||
syn keyword mfNumExp turningnumber uniformdeviate xpart xxpart xypart
|
||||
syn keyword mfNumExp ypart yxpart yypart
|
||||
|
||||
" Page 211: 'internal quantities'
|
||||
syn keyword mfInternal tracingtitles tracingequations tracingcapsules
|
||||
syn keyword mfInternal tracingchoices tracingspecs tracingpens
|
||||
syn keyword mfInternal tracingcommands tracingrestores tracingmacros
|
||||
syn keyword mfInternal tracingedges tracingoutput tracingonline tracingstats
|
||||
syn keyword mfInternal pausing showstopping fontmaking proofing
|
||||
syn keyword mfInternal turningcheck warningcheck smoothing autorounding
|
||||
syn keyword mfInternal granularity fillin year month day time
|
||||
syn keyword mfInternal charcode charext charwd charht chardp charic
|
||||
syn keyword mfInternal chardx chardy designsize hppp vppp xoffset yoffset
|
||||
syn keyword mfInternal boundarychar
|
||||
syn keyword mfInternal autorounding boundarychar charcode chardp chardx
|
||||
syn keyword mfInternal chardy charext charht charic charwd day designsize
|
||||
syn keyword mfInternal fillin fontmaking granularity hppp jobname month
|
||||
syn keyword mfInternal pausing proofing showstopping smoothing time
|
||||
syn keyword mfInternal tracingcapsules tracingchoices tracingcommands
|
||||
syn keyword mfInternal tracingedges tracingequations tracingmacros
|
||||
syn keyword mfInternal tracingonline tracingoutput tracingpens
|
||||
syn keyword mfInternal tracingrestores tracingspecs tracingstats
|
||||
syn keyword mfInternal tracingtitles turningcheck vppp warningcheck
|
||||
syn keyword mfInternal xoffset year yoffset
|
||||
|
||||
" Page 212: 'pair expressions'
|
||||
syn keyword mfPairExp point of precontrol postcontrol penoffset rotated
|
||||
syn keyword mfPairExp scaled shifted slanted transformed xscaled yscaled
|
||||
syn keyword mfPairExp zscaled
|
||||
syn keyword mfPairExp of penoffset point postcontrol precontrol rotated
|
||||
syn keyword mfPairExp scaled shifted slanted transformed xscaled yscaled
|
||||
syn keyword mfPairExp zscaled
|
||||
|
||||
" Page 213: 'path expressions'
|
||||
syn keyword mfPathExp makepath reverse subpath curl tension atleast
|
||||
syn keyword mfPathExp controls cycle
|
||||
syn keyword mfPathExp atleast controls curl cycle makepath reverse
|
||||
syn keyword mfPathExp subpath tension
|
||||
|
||||
" Page 214: 'pen expressions'
|
||||
syn keyword mfPenExp nullpen pencircle makepen
|
||||
syn keyword mfPenExp makepen nullpen pencircle
|
||||
|
||||
" Page 214: 'picutre expressions'
|
||||
syn keyword mfPicExp nullpicture
|
||||
" Page 214: 'picture expressions'
|
||||
syn keyword mfPicExp nullpicture
|
||||
|
||||
" Page 214: 'string expressions'
|
||||
syn keyword mfStringExp jobname readstring str char decimal substring
|
||||
syn keyword mfStringExp char decimal readstring str substring
|
||||
|
||||
" Page 217: 'commands and statements'
|
||||
syn keyword mfCommand end dump save interim newinternal randomseed let
|
||||
syn keyword mfCommand delimiters outer everyjob show showvariable showtoken
|
||||
syn keyword mfCommand showdependencies showstats message errmessage errhelp
|
||||
syn keyword mfCommand batchmode nonstopmode scrollmode errorstopmode
|
||||
syn keyword mfCommand addto also contour doublepath withpen withweight cull
|
||||
syn keyword mfCommand keeping dropping display inwindow openwindow at from to
|
||||
syn keyword mfCommand shipout special numspecial
|
||||
syn keyword mfCommand addto also at batchmode contour cull delimiters
|
||||
syn keyword mfCommand display doublepath dropping dump end errhelp
|
||||
syn keyword mfCommand errmessage errorstopmode everyjob from interim
|
||||
syn keyword mfCommand inwindow keeping let message newinternal
|
||||
syn keyword mfCommand nonstopmode numspecial openwindow outer randomseed
|
||||
syn keyword mfCommand save scrollmode shipout show showdependencies
|
||||
syn keyword mfCommand showstats showtoken showvariable special to withpen
|
||||
syn keyword mfCommand withweight
|
||||
|
||||
" Page 56: 'types'
|
||||
syn keyword mfType boolean numeric pair path pen picture string transform
|
||||
syn keyword mfType boolean numeric pair path pen picture string
|
||||
syn keyword mfType transform
|
||||
|
||||
" Page 155: 'grouping'
|
||||
syn keyword mfStatement begingroup endgroup
|
||||
syn keyword mfStatement begingroup endgroup
|
||||
|
||||
" Page 165: 'definitions'
|
||||
syn keyword mfDefinition enddef def expr suffix text primary secondary
|
||||
syn keyword mfDefinition tertiary vardef primarydef secondarydef tertiarydef
|
||||
syn keyword mfDefinition def enddef expr primary primarydef secondary
|
||||
syn keyword mfDefinition secondarydef suffix tertiary tertiarydef text
|
||||
syn keyword mfDefinition vardef
|
||||
|
||||
" Page 169: 'conditions and loops'
|
||||
syn keyword mfCondition if fi else elseif endfor for forsuffixes forever
|
||||
syn keyword mfCondition step until exitif
|
||||
syn keyword mfCondition else elseif endfor exitif fi for forever
|
||||
syn keyword mfCondition forsuffixes if step until
|
||||
|
||||
" Other primitives listed in the index
|
||||
syn keyword mfPrimitive charlist endinput expandafter extensible
|
||||
syn keyword mfPrimitive fontdimen headerbyte inner input intersectiontimes
|
||||
syn keyword mfPrimitive kern ligtable quote scantokens skipto
|
||||
syn keyword mfPrimitive charlist endinput expandafter extensible fontdimen
|
||||
syn keyword mfPrimitive headerbyte inner input intersectiontimes kern
|
||||
syn keyword mfPrimitive ligtable quote scantokens skipto
|
||||
|
||||
" Implicit suffix parameters
|
||||
syn match mfSuffixParam "@#\|#@\|@"
|
||||
|
||||
" These are just tags, but given their special status, we
|
||||
" highlight them as variables
|
||||
syn keyword mfVariable x y
|
||||
|
||||
" Keywords defined by plain.mf (defined on pp.262-278)
|
||||
if !exists("plain_mf_macros")
|
||||
let plain_mf_macros = 1 " Set this to '0' if your source gets too colourful
|
||||
" metapost.vim does so to turn off Metafont macros
|
||||
if get(g:, "plain_mf_macros", 1)
|
||||
syn keyword mfDef addto_currentpicture beginchar capsule_def
|
||||
syn keyword mfDef change_width clear_pen_memory clearit clearpen
|
||||
syn keyword mfDef clearxy culldraw cullit cutdraw
|
||||
syn keyword mfDef define_blacker_pixels define_corrected_pixels
|
||||
syn keyword mfDef define_good_x_pixels define_good_y_pixels
|
||||
syn keyword mfDef define_horizontal_corrected_pixels define_pixels
|
||||
syn keyword mfDef define_whole_blacker_pixels define_whole_pixels
|
||||
syn keyword mfDef define_whole_vertical_blacker_pixels
|
||||
syn keyword mfDef define_whole_vertical_pixels downto draw drawdot
|
||||
syn keyword mfDef endchar erase exitunless fill filldraw fix_units
|
||||
syn keyword mfDef flex font_coding_scheme font_extra_space
|
||||
syn keyword mfDef font_identifier font_normal_shrink
|
||||
syn keyword mfDef font_normal_space font_normal_stretch font_quad
|
||||
syn keyword mfDef font_size font_slant font_x_height gfcorners gobble
|
||||
syn keyword mfDef hide imagerules interact italcorr killtext
|
||||
syn keyword mfDef loggingall lowres_fix makebox makegrid maketicks
|
||||
syn keyword mfDef mode_def mode_setup nodisplays notransforms numtok
|
||||
syn keyword mfDef openit penrazor pensquare penstroke pickup
|
||||
syn keyword mfDef proofoffset proofrule range reflectedabout
|
||||
syn keyword mfDef rotatedaround screenchars screenrule screenstrokes
|
||||
syn keyword mfDef shipit showit smode stop superellipse takepower
|
||||
syn keyword mfDef tracingall tracingnone undraw undrawdot unfill
|
||||
syn keyword mfDef unfilldraw upto z
|
||||
syn match mfDef "???"
|
||||
syn keyword mfVardef bot byte ceiling counterclockwise cutoff decr dir
|
||||
syn keyword mfVardef direction directionpoint grayfont hround incr
|
||||
syn keyword mfVardef interpath inverse labelfont labels lft magstep
|
||||
" Note: nodot is not a vardef, it is used as in makelabel.lft.nodot("5",z5)
|
||||
" (METAFONT only)
|
||||
syn keyword mfVardef makelabel max min nodot penlabels penpos
|
||||
syn keyword mfVardef proofrulethickness round rt savepen slantfont solve
|
||||
syn keyword mfVardef tensepath titlefont top unitvector vround whatever
|
||||
syn match mpVardef "\<good\.\%(x\|y\|lft\|rt\|top\|bot\)\>"
|
||||
syn keyword mfPrimaryDef div dotprod gobbled mod
|
||||
syn keyword mfSecondaryDef intersectionpoint
|
||||
syn keyword mfTertiaryDef softjoin thru
|
||||
syn keyword mfNewInternal blacker currentwindow displaying eps epsilon
|
||||
syn keyword mfNewInternal infinity join_radius number_of_modes o_correction
|
||||
syn keyword mfNewInternal pen_bot pen_lft pen_rt pen_top pixels_per_inch
|
||||
syn keyword mfNewInternal screen_cols screen_rows tolerance
|
||||
" Predefined constants
|
||||
syn keyword mfConstant base_name base_version blankpicture ditto down
|
||||
syn keyword mfConstant fullcircle halfcircle identity left lowres origin
|
||||
syn keyword mfConstant penspeck proof quartercircle right rulepen smoke
|
||||
syn keyword mfConstant unitpixel unitsquare up
|
||||
" Other predefined variables
|
||||
syn keyword mfVariable aspect_ratio currentpen extra_beginchar
|
||||
syn keyword mfVariable extra_endchar currentpen_path currentpicture
|
||||
syn keyword mfVariable currenttransform d extra_setup h localfont mag mode
|
||||
syn keyword mfVariable mode_name w
|
||||
" let statements:
|
||||
syn keyword mfnumExp abs
|
||||
syn keyword mfPairExp rotatedabout
|
||||
syn keyword mfCommand bye relax
|
||||
endif
|
||||
if plain_mf_macros
|
||||
syn keyword mfMacro abs addto_currentpicture aspect_ratio base_name
|
||||
syn keyword mfMacro base_version beginchar blacker blankpicture bot bye byte
|
||||
syn keyword mfMacro capsule_def ceiling change_width clear_pen_memory clearit
|
||||
syn keyword mfMacro clearpen clearxy counterclockwise culldraw cullit
|
||||
syn keyword mfMacro currentpen currentpen_path currentpicture
|
||||
syn keyword mfMacro currenttransform currentwindow cutdraw cutoff d decr
|
||||
syn keyword mfMacro define_blacker_pixels define_corrected_pixels
|
||||
syn keyword mfMacro define_good_x_pixels define_good_y_pixels
|
||||
syn keyword mfMacro define_horizontal_corrected_pixels define_pixels
|
||||
syn keyword mfMacro define_whole_blacker_pixels define_whole_pixels
|
||||
syn keyword mfMacro define_whole_vertical_blacker_pixels
|
||||
syn keyword mfMacro define_whole_vertical_pixels dir direction directionpoint
|
||||
syn keyword mfMacro displaying ditto div dotprod down downto draw drawdot
|
||||
syn keyword mfMacro endchar eps epsilon extra_beginchar extra_endchar
|
||||
syn keyword mfMacro extra_setup erase exitunless fill filldraw fix_units flex
|
||||
syn keyword mfMacro font_coding_scheme font_extra_space font_identifier
|
||||
syn keyword mfMacro font_normal_shrink font_normal_space font_normal_stretch
|
||||
syn keyword mfMacro font_quad font_setup font_size font_slant font_x_height
|
||||
syn keyword mfMacro fullcircle generate gfcorners gobble gobbled grayfont h
|
||||
syn keyword mfMacro halfcircle hide hround identity image_rules incr infinity
|
||||
syn keyword mfMacro interact interpath intersectionpoint inverse italcorr
|
||||
syn keyword mfMacro join_radius killtext labelfont labels left lft localfont
|
||||
syn keyword mfMacro loggingall lowres lowres_fix mag magstep makebox makegrid
|
||||
syn keyword mfMacro makelabel maketicks max min mod mode mode_def mode_name
|
||||
syn keyword mfMacro mode_setup nodisplays notransforms number_of_modes numtok
|
||||
syn keyword mfMacro o_correction openit origin pen_bot pen_lft pen_rt pen_top
|
||||
syn keyword mfMacro penlabels penpos penrazor penspeck pensquare penstroke
|
||||
syn keyword mfMacro pickup pixels_per_inch proof proofoffset proofrule
|
||||
syn keyword mfMacro proofrulethickness quartercircle range reflectedabout
|
||||
syn keyword mfMacro relax right rotatedabout rotatedaround round rt rulepen
|
||||
syn keyword mfMacro savepen screenchars screen_rows screen_cols screenrule
|
||||
syn keyword mfMacro screenstrokes shipit showit slantfont smode smoke softjoin
|
||||
syn keyword mfMacro solve stop superellipse takepower tensepath titlefont
|
||||
syn keyword mfMacro tolerance top tracingall tracingnone undraw undrawdot
|
||||
syn keyword mfMacro unfill unfilldraw unitpixel unitsquare unitvector up upto
|
||||
syn keyword mfMacro vround w whatever
|
||||
|
||||
" By default, METAFONT loads modes.mf, too
|
||||
if get(g:, "plain_mf_modes", 1)
|
||||
syn keyword mfConstant APSSixMed AgfaFourZeroZero AgfaThreeFourZeroZero
|
||||
syn keyword mfConstant AtariNineFive AtariNineSix AtariSLMEightZeroFour
|
||||
syn keyword mfConstant AtariSMOneTwoFour CItohEightFiveOneZero
|
||||
syn keyword mfConstant CItohThreeOneZero CanonBJCSixZeroZero CanonCX
|
||||
syn keyword mfConstant CanonEX CanonLBPLX CanonLBPTen CanonSX ChelgraphIBX
|
||||
syn keyword mfConstant CompugraphicEightSixZeroZero
|
||||
syn keyword mfConstant CompugraphicNineSixZeroZero DD DEClarge DECsmall
|
||||
syn keyword mfConstant DataDiscNew EightThree EpsonAction
|
||||
syn keyword mfConstant EpsonLQFiveZeroZeroLo EpsonLQFiveZeroZeroMed
|
||||
syn keyword mfConstant EpsonMXFX EpsonSQEightSevenZero EpsonStylusPro
|
||||
syn keyword mfConstant EpsonStylusProHigh EpsonStylusProLow
|
||||
syn keyword mfConstant EpsonStylusProMed FourFour GThreefax HPDeskJet
|
||||
syn keyword mfConstant HPLaserJetIIISi IBMFourTwoFiveZero IBMFourTwoOneSix
|
||||
syn keyword mfConstant IBMFourTwoThreeZero IBMFourZeroOneNine
|
||||
syn keyword mfConstant IBMFourZeroThreeNine IBMFourZeroTwoNine
|
||||
syn keyword mfConstant IBMProPrinter IBMSixOneFiveFour IBMSixSixSevenZero
|
||||
syn keyword mfConstant IBMThreeEightOneTwo IBMThreeEightTwoZero
|
||||
syn keyword mfConstant IBMThreeOneNineThree IBMThreeOneSevenNine
|
||||
syn keyword mfConstant IBMUlfHolleberg LASevenFive LNOthreR LNOthree
|
||||
syn keyword mfConstant LNZeroOne LNZeroThree LPSFourZero LPSTwoZero
|
||||
syn keyword mfConstant LexmarkFourZeroThreeNine LexmarkOptraR
|
||||
syn keyword mfConstant LexmarkOptraS LinotypeLThreeThreeZero
|
||||
syn keyword mfConstant LinotypeOneZeroZero LinotypeOneZeroZeroLo
|
||||
syn keyword mfConstant LinotypeThreeZeroZeroHi MacTrueSize NeXTprinter
|
||||
syn keyword mfConstant NeXTscreen NecTwoZeroOne Newgen NineOne
|
||||
syn keyword mfConstant OCESixSevenFiveZeroPS OneTwoZero OneZeroZero
|
||||
syn keyword mfConstant PrintwareSevenTwoZeroIQ Prism QMSOneSevenTwoFive
|
||||
syn keyword mfConstant QMSOneSevenZeroZero QMSTwoFourTwoFive RicohA
|
||||
syn keyword mfConstant RicohFortyEighty RicohFourZeroEightZero RicohLP
|
||||
syn keyword mfConstant SparcPrinter StarNLOneZero VAXstation VTSix
|
||||
syn keyword mfConstant VarityperFiveZeroSixZeroW
|
||||
syn keyword mfConstant VarityperFourThreeZeroZeroHi
|
||||
syn keyword mfConstant VarityperFourThreeZeroZeroLo
|
||||
syn keyword mfConstant VarityperFourTwoZeroZero VarityperSixZeroZero
|
||||
syn keyword mfConstant XeroxDocutech XeroxEightSevenNineZero
|
||||
syn keyword mfConstant XeroxFourZeroFiveZero XeroxNineSevenZeroZero
|
||||
syn keyword mfConstant XeroxPhaserSixTwoZeroZeroDP XeroxThreeSevenZeroZero
|
||||
syn keyword mfConstant Xerox_world agfafzz agfatfzz amiga aps apssixhi
|
||||
syn keyword mfConstant aselect atariezf atarinf atarins atariotf bitgraph
|
||||
syn keyword mfConstant bjtenex bjtzzex bjtzzl bjtzzs boise canonbjc
|
||||
syn keyword mfConstant canonex canonlbp cg cgl cgnszz citohtoz corona crs
|
||||
syn keyword mfConstant cthreeten cx datadisc declarge decsmall deskjet
|
||||
syn keyword mfConstant docutech dover dp dpdfezzz eighthre elvira epscszz
|
||||
syn keyword mfConstant epsdraft epsdrft epsdrftl epsfast epsfastl epshi
|
||||
syn keyword mfConstant epslo epsmed epsmedl epson epsonact epsonfx epsonl
|
||||
syn keyword mfConstant epsonlo epsonlol epsonlq epsonsq epstylus epstylwr
|
||||
syn keyword mfConstant epstyplo epstypmd epstypml epstypro epswlo epswlol
|
||||
syn keyword mfConstant esphi fourfour gpx gtfax gtfaxhi gtfaxl gtfaxlo
|
||||
syn keyword mfConstant gtfaxlol help hifax highfax hplaser hprugged ibm_a
|
||||
syn keyword mfConstant ibmd ibmega ibmegal ibmfzon ibmfztn ibmpp ibmppl
|
||||
syn keyword mfConstant ibmsoff ibmteot ibmtetz ibmtont ibmtosn ibmtosnl
|
||||
syn keyword mfConstant ibmvga ibx imagen imagewriter itoh itohl itohtoz
|
||||
syn keyword mfConstant itohtozl iw jetiiisi kyocera laserjet laserjetfive
|
||||
syn keyword mfConstant laserjetfivemp laserjetfour laserjetfourthousand
|
||||
syn keyword mfConstant laserjetfourzerozerozero laserjethi laserjetlo
|
||||
syn keyword mfConstant laserjettwoonezerozero
|
||||
syn keyword mfConstant laserjettwoonezerozerofastres lasermaster
|
||||
syn keyword mfConstant laserwriter lasf lexmarkr lexmarks lexmarku
|
||||
syn keyword mfConstant linohalf linohi linolo linolttz linoone linosuper
|
||||
syn keyword mfConstant linothree linothreelo linotzzh ljfive ljfivemp
|
||||
syn keyword mfConstant ljfour ljfzzz ljfzzzfr ljlo ljtozz ljtozzfr lmaster
|
||||
syn keyword mfConstant lnotr lnzo lps lpstz lqhires lqlores lqmed lqmedl
|
||||
syn keyword mfConstant lqmedres lview lviewl lwpro macmag mactrue modes_mf
|
||||
syn keyword mfConstant ncd nec nechi neclm nectzo newdd newddl nexthi
|
||||
syn keyword mfConstant nextscreen nextscrn nineone nullmode ocessfz
|
||||
syn keyword mfConstant okidata okidatal okifourten okifte okihi onetz
|
||||
syn keyword mfConstant onezz pcprevw pcscreen phaser phaserfs phasertf
|
||||
syn keyword mfConstant phasertfl phasertl pixpt printware prntware
|
||||
syn keyword mfConstant proprinter qms qmsesz qmsostf qmsoszz qmstftf ricoh
|
||||
syn keyword mfConstant ricoha ricohlp ricohsp sherpa sparcptr starnlt
|
||||
syn keyword mfConstant starnltl styletwo stylewr stylewri stylewriter sun
|
||||
syn keyword mfConstant supre swtwo toshiba ultre varityper vs vtftzz
|
||||
syn keyword mfConstant vtftzzhi vtftzzlo vtfzszw vtszz xpstzz xpstzzl
|
||||
syn keyword mfConstant xrxesnz xrxfzfz xrxnszz xrxtszz
|
||||
syn keyword mfDef BCPL_string coding_scheme font_face_byte
|
||||
syn keyword mfDef font_family landscape
|
||||
syn keyword mfDef mode_extra_info mode_help mode_param
|
||||
syn keyword mfNewInternal blacker_min
|
||||
endif
|
||||
|
||||
" Some other basic macro names, e.g., from cmbase, logo, etc.
|
||||
if !exists("other_mf_macros")
|
||||
let other_mf_macros = 1 " Set this to '0' if your code gets too colourful
|
||||
" metapost.vim does so to turn off Metafont macros
|
||||
endif
|
||||
if other_mf_macros
|
||||
syn keyword mfMacro beginlogochar
|
||||
if get(g:, "other_mf_macros", 1)
|
||||
syn keyword mfDef beginlogochar
|
||||
syn keyword mfDef font_setup
|
||||
syn keyword mfPrimitive generate
|
||||
endif
|
||||
|
||||
" Numeric tokens
|
||||
syn match mfNumeric "[-]\=\d\+"
|
||||
syn match mfNumeric "[-]\=\.\d\+"
|
||||
syn match mfNumeric "[-]\=\d\+\.\d\+"
|
||||
syn match mfNumeric "[-]\=\d\+"
|
||||
syn match mfNumeric "[-]\=\.\d\+"
|
||||
syn match mfNumeric "[-]\=\d\+\.\d\+"
|
||||
|
||||
" Metafont lengths
|
||||
syn match mfLength "\<\(bp\|cc\|cm\|dd\|in\|mm\|pc\|pt\)\>"
|
||||
syn match mfLength "\<[-]\=\d\+\(bp\|cc\|cm\|dd\|in\|mm\|pc\|pt\)\#\=\>"
|
||||
syn match mfLength "\<[-]\=\.\d\+\(bp\|cc\|cm\|dd\|in\|mm\|pc\|pt\)\#\=\>"
|
||||
syn match mfLength "\<[-]\=\d\+\.\d\+\(bp\|cc\|cm\|dd\|in\|mm\|pc\|pt\)\#\=\>"
|
||||
|
||||
" Metafont coordinates and points
|
||||
syn match mfCoord "\<[xy]\d\+\>"
|
||||
syn match mfPoint "\<z\d\+\>"
|
||||
" METAFONT lengths
|
||||
syn match mfLength "\<\(bp\|cc\|cm\|dd\|in\|mm\|pc\|pt\)\>"
|
||||
syn match mfLength "[-]\=\d\+\(bp\|cc\|cm\|dd\|in\|mm\|pc\|pt\)\#\="
|
||||
syn match mfLength "[-]\=\.\d\+\(bp\|cc\|cm\|dd\|in\|mm\|pc\|pt\)\#\="
|
||||
syn match mfLength "[-]\=\d\+\.\d\+\(bp\|cc\|cm\|dd\|in\|mm\|pc\|pt\)\#\="
|
||||
|
||||
" String constants
|
||||
syn region mfString start=+"+ end=+"+
|
||||
syn match mfOpenString /"[^"]*/
|
||||
syn region mfString oneline keepend start=+"+ end=+"+
|
||||
|
||||
" Comments:
|
||||
syn match mfComment "%.*$"
|
||||
syn keyword mfTodoComment contained TODO FIXME XXX DEBUG NOTE
|
||||
syn match mfComment "%.*$" contains=mfTodoComment,@Spell
|
||||
|
||||
" synchronizing
|
||||
syn sync maxlines=50
|
||||
|
||||
" Define the default highlighting
|
||||
" Only when an item doesn't have highlighting yet
|
||||
|
||||
hi def link mfBoolExp Statement
|
||||
hi def link mfNumExp Statement
|
||||
hi def link mfInternal Identifier
|
||||
hi def link mfPairExp Statement
|
||||
hi def link mfPathExp Statement
|
||||
hi def link mfPenExp Statement
|
||||
hi def link mfPicExp Statement
|
||||
hi def link mfStringExp Statement
|
||||
hi def link mfCommand Statement
|
||||
hi def link mfType Type
|
||||
hi def link mfStatement Statement
|
||||
hi def link mfDefinition Statement
|
||||
hi def link mfCondition Conditional
|
||||
hi def link mfPrimitive Statement
|
||||
hi def link mfMacro Macro
|
||||
hi def link mfCoord Identifier
|
||||
hi def link mfPoint Identifier
|
||||
hi def link mfNumeric Number
|
||||
hi def link mfLength Number
|
||||
hi def link mfComment Comment
|
||||
hi def link mfString String
|
||||
|
||||
hi def link mfBoolExp Statement
|
||||
hi def link mfNumExp Statement
|
||||
hi def link mfPairExp Statement
|
||||
hi def link mfPathExp Statement
|
||||
hi def link mfPenExp Statement
|
||||
hi def link mfPicExp Statement
|
||||
hi def link mfStringExp Statement
|
||||
hi def link mfInternal Identifier
|
||||
hi def link mfCommand Statement
|
||||
hi def link mfType Type
|
||||
hi def link mfStatement Statement
|
||||
hi def link mfDefinition Statement
|
||||
hi def link mfCondition Conditional
|
||||
hi def link mfPrimitive Statement
|
||||
hi def link mfDef Function
|
||||
hi def link mfVardef mfDef
|
||||
hi def link mfPrimaryDef mfDef
|
||||
hi def link mfSecondaryDef mfDef
|
||||
hi def link mfTertiaryDef mfDef
|
||||
hi def link mfCoord Identifier
|
||||
hi def link mfPoint Identifier
|
||||
hi def link mfNumeric Number
|
||||
hi def link mfLength Number
|
||||
hi def link mfComment Comment
|
||||
hi def link mfString String
|
||||
hi def link mfOpenString Todo
|
||||
hi def link mfSuffixParam Label
|
||||
hi def link mfNewInternal mfInternal
|
||||
hi def link mfVariable Identifier
|
||||
hi def link mfConstant Constant
|
||||
hi def link mfTodoComment Todo
|
||||
|
||||
let b:current_syntax = "mf"
|
||||
|
||||
" vim: ts=8
|
||||
" vim:sw=2
|
||||
|
||||
+740
-90
@@ -1,115 +1,765 @@
|
||||
" Vim syntax file
|
||||
" Language: MetaPost
|
||||
" Maintainer: Andreas Scherer <andreas.scherer@pobox.com>
|
||||
" Last Change: April 30, 2001
|
||||
" Language: MetaPost
|
||||
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
|
||||
" Former Maintainers: Andreas Scherer <andreas.scherer@pobox.com>
|
||||
" Last Change: 2016 Oct 01
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
let plain_mf_macros = 0 " plain.mf has no special meaning for MetaPost
|
||||
let other_mf_macros = 0 " cmbase.mf, logo.mf, ... neither
|
||||
let s:cpo_sav = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" Read the Metafont syntax to start with
|
||||
if exists("g:plain_mf_macros")
|
||||
let s:plain_mf_macros = g:plain_mf_macros
|
||||
endif
|
||||
if exists("g:plain_mf_modes")
|
||||
let s:plain_mf_modes = g:plain_mf_modes
|
||||
endif
|
||||
if exists("g:other_mf_macros")
|
||||
let s:other_mf_macros = g:other_mf_macros
|
||||
endif
|
||||
|
||||
let g:plain_mf_macros = 0 " plain.mf has no special meaning for MetaPost
|
||||
let g:plain_mf_modes = 0 " No METAFONT modes
|
||||
let g:other_mf_macros = 0 " cmbase.mf, logo.mf, ... neither
|
||||
|
||||
" Read the METAFONT syntax to start with
|
||||
runtime! syntax/mf.vim
|
||||
unlet b:current_syntax " Necessary for syn include below
|
||||
|
||||
" MetaPost has TeX inserts for typeset labels
|
||||
" verbatimtex, btex, and etex will be treated as keywords
|
||||
syn match mpTeXbegin "\(verbatimtex\|btex\)"
|
||||
syn match mpTeXend "etex"
|
||||
syn region mpTeXinsert start="\(verbatimtex\|btex\)"hs=e+1 end="etex"he=s-1 contains=mpTeXbegin,mpTeXend keepend
|
||||
" Restore the value of existing global variables
|
||||
if exists("s:plain_mf_macros")
|
||||
let g:plain_mf_macros = s:plain_mf_macros
|
||||
else
|
||||
unlet g:plain_mf_macros
|
||||
endif
|
||||
if exists("s:plain_mf_modes")
|
||||
let g:plain_mf_modes = s:plain_mf_modes
|
||||
else
|
||||
unlet g:plain_mf_modes
|
||||
endif
|
||||
if exists("s:other_mf_macros")
|
||||
let g:other_mf_macros = s:other_mf_macros
|
||||
else
|
||||
unlet g:other_mf_macros
|
||||
endif
|
||||
|
||||
" MetaPost primitives not found in Metafont
|
||||
syn keyword mpInternal bluepart clip color dashed fontsize greenpart infont
|
||||
syn keyword mpInternal linecap linejoin llcorner lrcorner miterlimit mpxbreak
|
||||
syn keyword mpInternal prologues redpart setbounds tracinglostchars
|
||||
syn keyword mpInternal truecorners ulcorner urcorner withcolor
|
||||
" Use TeX highlighting inside verbatimtex/btex... etex
|
||||
syn include @MPTeX syntax/tex.vim
|
||||
unlet b:current_syntax
|
||||
" These are defined as keywords rather than using matchgroup
|
||||
" in order to make them available to syntaxcomplete.
|
||||
syn keyword mpTeXdelim btex etex verbatimtex contained
|
||||
syn region mpTeXinsert
|
||||
\ start=/\<verbatimtex\>\|\<btex\>/rs=e+1
|
||||
\ end=/\<etex\>/re=s-1 keepend
|
||||
\ contains=@MPTeX,mpTeXdelim
|
||||
|
||||
" Metafont primitives not found in MetaPost
|
||||
syn keyword notDefined autorounding chardx chardy fillin granularity hppp
|
||||
syn keyword notDefined proofing smoothing tracingedges tracingpens
|
||||
syn keyword notDefined turningcheck vppp xoffset yoffset
|
||||
" iskeyword must be set after the syn include above, because tex.vim sets `syn
|
||||
" iskeyword`. Note that keywords do not contain numbers (numbers are
|
||||
" subscripts)
|
||||
syntax iskeyword @,_
|
||||
|
||||
" MetaPost primitives not found in METAFONT
|
||||
syn keyword mpBoolExp bounded clipped filled stroked textual arclength
|
||||
syn keyword mpNumExp arctime blackpart bluepart colormodel cyanpart
|
||||
syn keyword mpNumExp fontsize greenpart greypart magentapart redpart
|
||||
syn keyword mpPairExp yellowpart llcorner lrcorner ulcorner urcorner
|
||||
" envelope is seemingly undocumented, but it exists since mpost 1.003.
|
||||
" The syntax is: envelope <polygonal pen> of <path primary>. For example,
|
||||
" path p;
|
||||
" p := envelope pensquare of (up--left);
|
||||
" (Thanks to Daniel H. Luecking for the example!)
|
||||
syn keyword mpPathExp envelope pathpart
|
||||
syn keyword mpPenExp penpart
|
||||
syn keyword mpPicExp dashpart glyph infont
|
||||
syn keyword mpStringExp fontpart readfrom textpart
|
||||
syn keyword mpType cmykcolor color rgbcolor
|
||||
" Other MetaPost primitives listed in the manual
|
||||
syn keyword mpPrimitive mpxbreak within
|
||||
" Internal quantities not found in METAFONT
|
||||
" (Table 6 in MetaPost: A User's Manual)
|
||||
syn keyword mpInternal defaultcolormodel hour minute linecap linejoin
|
||||
syn keyword mpInternal miterlimit mpprocset mpversion numberprecision
|
||||
syn keyword mpInternal numbersystem outputfilename outputformat
|
||||
syn keyword mpInternal outputformatoptions outputtemplate prologues
|
||||
syn keyword mpInternal restoreclipcolor tracinglostchars troffmode
|
||||
syn keyword mpInternal truecorners
|
||||
" List of commands not found in METAFONT (from MetaPost: A User's Manual)
|
||||
syn keyword mpCommand clip closefrom dashed filenametemplate fontmapfile
|
||||
syn keyword mpCommand fontmapline setbounds withcmykcolor withcolor
|
||||
syn keyword mpCommand withgreyscale withoutcolor withpostscript
|
||||
syn keyword mpCommand withprescript withrgbcolor write
|
||||
" METAFONT internal variables not found in MetaPost
|
||||
syn keyword notDefined autorounding chardx chardy fillin granularity
|
||||
syn keyword notDefined proofing smoothing tracingedges tracingpens
|
||||
syn keyword notDefined turningcheck xoffset yoffset
|
||||
" Suffix defined only in METAFONT:
|
||||
syn keyword notDefined nodot
|
||||
" Other not implemented primitives (see MetaPost: A User's Manual, §C.1)
|
||||
syn keyword notDefined cull display openwindow numspecial totalweight
|
||||
syn keyword notDefined withweight
|
||||
|
||||
" Keywords defined by plain.mp
|
||||
if !exists("plain_mp_macros")
|
||||
let plain_mp_macros = 1 " Set this to '0' if your source gets too colourful
|
||||
endif
|
||||
if plain_mp_macros
|
||||
syn keyword mpMacro ahangle ahlength background bbox bboxmargin beginfig
|
||||
syn keyword mpMacro beveled black blue buildcycle butt center cutafter
|
||||
syn keyword mpMacro cutbefore cuttings dashpattern defaultfont defaultpen
|
||||
syn keyword mpMacro defaultscale dotlabel dotlabels drawarrow drawdblarrow
|
||||
syn keyword mpMacro drawoptions endfig evenly extra_beginfig extra_endfig
|
||||
syn keyword mpMacro green label labeloffset mitered red rounded squared
|
||||
syn keyword mpMacro thelabel white base_name base_version
|
||||
syn keyword mpMacro upto downto exitunless relax gobble gobbled
|
||||
syn keyword mpMacro interact loggingall tracingall tracingnone
|
||||
syn keyword mpMacro eps epsilon infinity right left up down origin
|
||||
syn keyword mpMacro quartercircle halfcircle fullcircle unitsquare identity
|
||||
syn keyword mpMacro blankpicture withdots ditto EOF pensquare penrazor
|
||||
syn keyword mpMacro penspeck whatever abs round ceiling byte dir unitvector
|
||||
syn keyword mpMacro inverse counterclockwise tensepath mod div dotprod
|
||||
syn keyword mpMacro takepower direction directionpoint intersectionpoint
|
||||
syn keyword mpMacro softjoin incr decr reflectedabout rotatedaround
|
||||
syn keyword mpMacro rotatedabout min max flex superellipse interpath
|
||||
syn keyword mpMacro magstep currentpen currentpen_path currentpicture
|
||||
syn keyword mpMacro fill draw filldraw drawdot unfill undraw unfilldraw
|
||||
syn keyword mpMacro undrawdot erase cutdraw image pickup numeric_pickup
|
||||
syn keyword mpMacro pen_lft pen_rt pen_top pen_bot savepen clearpen
|
||||
syn keyword mpMacro clear_pen_memory lft rt top bot ulft urt llft lrt
|
||||
syn keyword mpMacro penpos penstroke arrowhead makelabel labels penlabel
|
||||
syn keyword mpMacro range numtok thru clearxy clearit clearpen pickup
|
||||
syn keyword mpMacro shipit bye hide stop solve
|
||||
if get(g:, "plain_mp_macros", 1) || get(g:, "mp_metafun_macros", 0)
|
||||
syn keyword mpDef beginfig clear_pen_memory clearit clearpen clearpen
|
||||
syn keyword mpDef clearxy colorpart cutdraw downto draw drawarrow
|
||||
syn keyword mpDef drawdblarrow drawdot drawoptions endfig erase
|
||||
syn keyword mpDef exitunless fill filldraw flex gobble hide interact
|
||||
syn keyword mpDef label loggingall makelabel numtok penstroke pickup
|
||||
syn keyword mpDef range reflectedabout rotatedaround shipit
|
||||
syn keyword mpDef stop superellipse takepower tracingall tracingnone
|
||||
syn keyword mpDef undraw undrawdot unfill unfilldraw upto
|
||||
syn match mpDef "???"
|
||||
syn keyword mpVardef arrowhead bbox bot buildcycle byte ceiling center
|
||||
syn keyword mpVardef counterclockwise decr dir direction directionpoint
|
||||
syn keyword mpVardef dotlabel dotlabels image incr interpath inverse
|
||||
syn keyword mpVardef labels lft magstep max min penlabels penpos round
|
||||
syn keyword mpVardef rt savepen solve tensepath thelabel top unitvector
|
||||
syn keyword mpVardef whatever z
|
||||
syn keyword mpPrimaryDef div dotprod gobbled mod
|
||||
syn keyword mpSecondaryDef intersectionpoint
|
||||
syn keyword mpTertiaryDef cutafter cutbefore softjoin thru
|
||||
syn keyword mpNewInternal ahangle ahlength bboxmargin beveled butt defaultpen
|
||||
syn keyword mpNewInternal defaultscale dotlabeldiam eps epsilon infinity
|
||||
syn keyword mpNewInternal join_radius labeloffset mitered pen_bot pen_lft
|
||||
syn keyword mpNewInternal pen_rt pen_top rounded squared tolerance
|
||||
" Predefined constants
|
||||
syn keyword mpConstant EOF background base_name base_version black
|
||||
syn keyword mpConstant blankpicture blue ditto down evenly fullcircle
|
||||
syn keyword mpConstant green halfcircle identity left origin penrazor
|
||||
syn keyword mpConstant penspeck pensquare quartercircle red right
|
||||
syn keyword mpConstant unitsquare up white withdots
|
||||
" Other predefined variables
|
||||
syn keyword mpVariable currentpen currentpen_path currentpicture cuttings
|
||||
syn keyword mpVariable defaultfont extra_beginfig extra_endfig
|
||||
syn match mpVariable /\<\%(laboff\|labxf\|labyf\)\>/
|
||||
syn match mpVariable /\<\%(laboff\|labxf\|labyf\)\.\%(lft\|rt\|bot\|top\|ulft\|urt\|llft\|lrt\)\>/
|
||||
" let statements:
|
||||
syn keyword mpnumExp abs
|
||||
syn keyword mpDef rotatedabout
|
||||
syn keyword mpCommand bye relax
|
||||
" on and off are not technically keywords, but it is nice to highlight them
|
||||
" inside dashpattern().
|
||||
syn keyword mpOnOff off on contained
|
||||
syn keyword mpDash dashpattern contained
|
||||
syn region mpDashPattern
|
||||
\ start="dashpattern\s*"
|
||||
\ end=")"he=e-1
|
||||
\ contains=mfNumeric,mfLength,mpOnOff,mpDash
|
||||
endif
|
||||
|
||||
" Keywords defined by mfplain.mp
|
||||
if !exists("mfplain_mp_macros")
|
||||
let mfplain_mp_macros = 0 " Set this to '1' to include these macro names
|
||||
endif
|
||||
if mfplain_mp_macros
|
||||
syn keyword mpMacro beginchar blacker capsule_def change_width
|
||||
syn keyword mpMacro define_blacker_pixels define_corrected_pixels
|
||||
syn keyword mpMacro define_good_x_pixels define_good_y_pixels
|
||||
syn keyword mpMacro define_horizontal_corrected_pixels
|
||||
syn keyword mpMacro define_pixels define_whole_blacker_pixels
|
||||
syn keyword mpMacro define_whole_vertical_blacker_pixels
|
||||
syn keyword mpMacro define_whole_vertical_pixels endchar
|
||||
syn keyword mpMacro extra_beginchar extra_endchar extra_setup
|
||||
syn keyword mpMacro font_coding_scheme font_extra_space font_identifier
|
||||
syn keyword mpMacro font_normal_shrink font_normal_space
|
||||
syn keyword mpMacro font_normal_stretch font_quad font_size
|
||||
syn keyword mpMacro font_slant font_x_height italcorr labelfont
|
||||
syn keyword mpMacro makebox makegrid maketicks mode_def mode_setup
|
||||
syn keyword mpMacro o_correction proofrule proofrulethickness rulepen smode
|
||||
|
||||
if get(g:, "mfplain_mp_macros", 0)
|
||||
syn keyword mpDef beginchar capsule_def change_width
|
||||
syn keyword mpDef define_blacker_pixels define_corrected_pixels
|
||||
syn keyword mpDef define_good_x_pixels define_good_y_pixels
|
||||
syn keyword mpDef define_horizontal_corrected_pixels define_pixels
|
||||
syn keyword mpDef define_whole_blacker_pixels define_whole_pixels
|
||||
syn keyword mpDef define_whole_vertical_blacker_pixels
|
||||
syn keyword mpDef define_whole_vertical_pixels endchar
|
||||
syn keyword mpDef font_coding_scheme font_extra_space font_identifier
|
||||
syn keyword mpDef font_normal_shrink font_normal_space
|
||||
syn keyword mpDef font_normal_stretch font_quad font_size font_slant
|
||||
syn keyword mpDef font_x_height italcorr labelfont lowres_fix makebox
|
||||
syn keyword mpDef makegrid maketicks mode_def mode_setup proofrule
|
||||
syn keyword mpDef smode
|
||||
syn keyword mpVardef hround proofrulethickness vround
|
||||
syn keyword mpNewInternal blacker o_correction
|
||||
syn keyword mpVariable extra_beginchar extra_endchar extra_setup rulepen
|
||||
" plus some no-ops, also from mfplain.mp
|
||||
syn keyword mpMacro cullit currenttransform gfcorners grayfont hround
|
||||
syn keyword mpMacro imagerules lowres_fix nodisplays notransforms openit
|
||||
syn keyword mpMacro proofoffset screenchars screenrule screenstrokes
|
||||
syn keyword mpMacro showit slantfont titlefont unitpixel vround
|
||||
syn keyword mpDef cull cullit gfcorners imagerules nodisplays
|
||||
syn keyword mpDef notransforms openit proofoffset screenchars
|
||||
syn keyword mpDef screenrule screenstrokes showit
|
||||
syn keyword mpVardef grayfont slantfont titlefont
|
||||
syn keyword mpVariable currenttransform
|
||||
syn keyword mpConstant unitpixel
|
||||
" These are not listed in the MetaPost manual, and some are ignored by
|
||||
" MetaPost, but are nonetheless defined in mfplain.mp
|
||||
syn keyword mpDef killtext
|
||||
syn match mpVardef "\<good\.\%(x\|y\|lft\|rt\|top\|bot\)\>"
|
||||
syn keyword mpVariable aspect_ratio localfont mag mode mode_name
|
||||
syn keyword mpVariable proofcolor
|
||||
syn keyword mpConstant lowres proof smoke
|
||||
syn keyword mpNewInternal autorounding bp_per_pixel granularity
|
||||
syn keyword mpNewInternal number_of_modes proofing smoothing turningcheck
|
||||
endif
|
||||
|
||||
" Keywords defined by other macro packages, e.g., boxes.mp
|
||||
if !exists("other_mp_macros")
|
||||
let other_mp_macros = 1 " Set this to '0' if your source gets too colourful
|
||||
endif
|
||||
if other_mp_macros
|
||||
syn keyword mpMacro circmargin defaultdx defaultdy
|
||||
syn keyword mpMacro boxit boxjoin bpath circleit drawboxed drawboxes
|
||||
syn keyword mpMacro drawunboxed fixpos fixsize pic
|
||||
" Keywords defined by all base macro packages:
|
||||
" - (r)boxes.mp
|
||||
" - format.mp
|
||||
" - graph.mp
|
||||
" - marith.mp
|
||||
" - sarith.mp
|
||||
" - string.mp
|
||||
" - TEX.mp
|
||||
if get(g:, "other_mp_macros", 1)
|
||||
" boxes and rboxes
|
||||
syn keyword mpDef boxjoin drawboxed drawboxes drawunboxed
|
||||
syn keyword mpNewInternal circmargin defaultdx defaultdy rbox_radius
|
||||
syn keyword mpVardef boxit bpath circleit fixpos fixsize generic_declare
|
||||
syn keyword mpVardef generic_redeclare generisize pic rboxit str_prefix
|
||||
" format
|
||||
syn keyword mpVardef Mformat format init_numbers roundd
|
||||
syn keyword mpVariable Fe_base Fe_plus
|
||||
syn keyword mpConstant Ten_to
|
||||
" graph
|
||||
syn keyword mpDef Gfor Gxyscale OUT auto begingraph endgraph gdata
|
||||
syn keyword mpDef gdraw gdrawarrow gdrawdblarrow gfill plot
|
||||
syn keyword mpVardef augment autogrid frame gdotlabel glabel grid itick
|
||||
syn keyword mpVardef otick
|
||||
syn keyword mpVardef Mreadpath setcoords setrange
|
||||
syn keyword mpNewInternal Gmarks Gminlog Gpaths linear log
|
||||
syn keyword mpVariable Autoform Gemarks Glmarks Gumarks
|
||||
syn keyword mpConstant Gtemplate
|
||||
syn match mpVariable /Gmargin\.\%(low\|high\)/
|
||||
" marith
|
||||
syn keyword mpVardef Mabs Meform Mexp Mexp_str Mlog Mlog_Str Mlog_str
|
||||
syn keyword mpPrimaryDef Mdiv Mmul
|
||||
syn keyword mpSecondaryDef Madd Msub
|
||||
syn keyword mpTertiaryDef Mleq
|
||||
syn keyword mpNewInternal Mten Mzero
|
||||
" sarith
|
||||
syn keyword mpVardef Sabs Scvnum
|
||||
syn keyword mpPrimaryDef Sdiv Smul
|
||||
syn keyword mpSecondaryDef Sadd Ssub
|
||||
syn keyword mpTertiaryDef Sleq Sneq
|
||||
" string
|
||||
syn keyword mpVardef cspan isdigit loptok
|
||||
" TEX
|
||||
syn keyword mpVardef TEX TEXPOST TEXPRE
|
||||
endif
|
||||
|
||||
" Up to date as of 23-Sep-2016.
|
||||
if get(g:, "mp_metafun_macros", 0)
|
||||
" These keywords have been added manually.
|
||||
syn keyword mpPrimitive runscript
|
||||
|
||||
" The following MetaFun keywords have been extracted automatically from
|
||||
" ConTeXt source code. They include all "public" macros (where a macro is
|
||||
" considered public if and only if it does not start with _, mfun_, mlib_, or
|
||||
" do_, and it does not end with _), all "public" unsaved variables, and all
|
||||
" `let` statements.
|
||||
|
||||
" mp-abck.mpiv
|
||||
syn keyword mpDef abck_grid_line anchor_box box_found boxfilloptions
|
||||
syn keyword mpDef boxgridoptions boxlineoptions draw_multi_pars
|
||||
syn keyword mpDef draw_multi_side draw_multi_side_path freeze_box
|
||||
syn keyword mpDef initialize_box initialize_box_pos
|
||||
syn keyword mpDef multi_side_draw_options show_multi_kind
|
||||
syn keyword mpDef show_multi_pars
|
||||
syn keyword mpVardef abck_baseline_grid abck_draw_path abck_graphic_grid
|
||||
syn keyword mpVariable boxdashtype boxfilloffset boxfilltype
|
||||
syn keyword mpVariable boxgriddirection boxgriddistance boxgridshift
|
||||
syn keyword mpVariable boxgridtype boxgridwidth boxlineoffset
|
||||
syn keyword mpVariable boxlineradius boxlinetype boxlinewidth multikind
|
||||
syn keyword mpConstant context_abck
|
||||
" mp-apos.mpiv
|
||||
syn keyword mpDef anch_sidebars_draw boxfilloptions boxlineoptions
|
||||
syn keyword mpDef connect_positions
|
||||
syn keyword mpConstant context_apos
|
||||
" mp-asnc.mpiv
|
||||
syn keyword mpDef FlushSyncTasks ProcessSyncTask ResetSyncTasks
|
||||
syn keyword mpDef SetSyncColor SetSyncThreshold SyncTask
|
||||
syn keyword mpVardef PrepareSyncTasks SyncBox TheSyncColor
|
||||
syn keyword mpVardef TheSyncThreshold
|
||||
syn keyword mpVariable CurrentSyncClass NOfSyncPaths SyncColor
|
||||
syn keyword mpVariable SyncLeftOffset SyncPaths SyncTasks SyncThreshold
|
||||
syn keyword mpVariable SyncThresholdMethod SyncWidth
|
||||
syn keyword mpConstant context_asnc
|
||||
" mp-back.mpiv
|
||||
syn keyword mpDef some_double_back some_hash
|
||||
syn keyword mpVariable back_nillcolor
|
||||
syn keyword mpConstant context_back
|
||||
" mp-bare.mpiv
|
||||
syn keyword mpVardef colordecimals rawtextext
|
||||
syn keyword mpPrimaryDef infont
|
||||
syn keyword mpConstant context_bare
|
||||
" mp-base.mpiv
|
||||
" This is essentially plain.mp with only a few keywords added
|
||||
syn keyword mpNumExp graypart
|
||||
syn keyword mpType graycolor greycolor
|
||||
syn keyword mpConstant cyan magenta yellow
|
||||
" mp-butt.mpiv
|
||||
syn keyword mpDef predefinedbutton some_button
|
||||
syn keyword mpConstant context_butt
|
||||
" mp-char.mpiv
|
||||
syn keyword mpDef flow_begin_chart flow_begin_sub_chart
|
||||
syn keyword mpDef flow_chart_draw_comment flow_chart_draw_exit
|
||||
syn keyword mpDef flow_chart_draw_label flow_chart_draw_text
|
||||
syn keyword mpDef flow_clip_chart flow_collapse_points
|
||||
syn keyword mpDef flow_connect_bottom_bottom flow_connect_bottom_left
|
||||
syn keyword mpDef flow_connect_bottom_right flow_connect_bottom_top
|
||||
syn keyword mpDef flow_connect_left_bottom flow_connect_left_left
|
||||
syn keyword mpDef flow_connect_left_right flow_connect_left_top
|
||||
syn keyword mpDef flow_connect_right_bottom flow_connect_right_left
|
||||
syn keyword mpDef flow_connect_right_right flow_connect_right_top
|
||||
syn keyword mpDef flow_connect_top_bottom flow_connect_top_left
|
||||
syn keyword mpDef flow_connect_top_right flow_connect_top_top
|
||||
syn keyword mpDef flow_draw_connection flow_draw_connection_point
|
||||
syn keyword mpDef flow_draw_midpoint flow_draw_shape
|
||||
syn keyword mpDef flow_draw_test_area flow_draw_test_shape
|
||||
syn keyword mpDef flow_draw_test_shapes flow_end_chart
|
||||
syn keyword mpDef flow_end_sub_chart flow_flush_connections
|
||||
syn keyword mpDef flow_flush_picture flow_flush_pictures
|
||||
syn keyword mpDef flow_flush_shape flow_flush_shapes
|
||||
syn keyword mpDef flow_initialize_grid flow_new_chart flow_new_shape
|
||||
syn keyword mpDef flow_scaled_to_grid flow_show_connection
|
||||
syn keyword mpDef flow_show_connections flow_show_shapes
|
||||
syn keyword mpDef flow_xy_offset flow_y_pos
|
||||
syn keyword mpVardef flow_connection_path flow_down_on_grid
|
||||
syn keyword mpVardef flow_down_to_grid flow_i_point flow_left_on_grid
|
||||
syn keyword mpVardef flow_left_to_grid flow_offset
|
||||
syn keyword mpVardef flow_points_initialized flow_right_on_grid
|
||||
syn keyword mpVardef flow_right_to_grid flow_smooth_connection
|
||||
syn keyword mpVardef flow_trim_points flow_trimmed flow_up_on_grid
|
||||
syn keyword mpVardef flow_up_to_grid flow_valid_connection
|
||||
syn keyword mpVardef flow_x_on_grid flow_xy_bottom flow_xy_left
|
||||
syn keyword mpVardef flow_xy_on_grid flow_xy_right flow_xy_top
|
||||
syn keyword mpVardef flow_y_on_grid
|
||||
syn keyword mpVariable flow_arrowtip flow_chart_background_color
|
||||
syn keyword mpVariable flow_chart_offset flow_comment_offset
|
||||
syn keyword mpVariable flow_connection_arrow_size
|
||||
syn keyword mpVariable flow_connection_dash_size
|
||||
syn keyword mpVariable flow_connection_line_color
|
||||
syn keyword mpVariable flow_connection_line_width
|
||||
syn keyword mpVariable flow_connection_smooth_size flow_connections
|
||||
syn keyword mpVariable flow_cpath flow_dash_pattern flow_dashline
|
||||
syn keyword mpVariable flow_exit_offset flow_forcevalid flow_grid_height
|
||||
syn keyword mpVariable flow_grid_width flow_label_offset flow_max_x
|
||||
syn keyword mpVariable flow_max_y flow_peepshape flow_reverse_connection
|
||||
syn keyword mpVariable flow_reverse_y flow_shape_action flow_shape_archive
|
||||
syn keyword mpVariable flow_shape_decision flow_shape_down
|
||||
syn keyword mpVariable flow_shape_fill_color flow_shape_height
|
||||
syn keyword mpVariable flow_shape_left flow_shape_line_color
|
||||
syn keyword mpVariable flow_shape_line_width flow_shape_loop
|
||||
syn keyword mpVariable flow_shape_multidocument flow_shape_node
|
||||
syn keyword mpVariable flow_shape_procedure flow_shape_product
|
||||
syn keyword mpVariable flow_shape_right flow_shape_singledocument
|
||||
syn keyword mpVariable flow_shape_subprocedure flow_shape_up
|
||||
syn keyword mpVariable flow_shape_wait flow_shape_width
|
||||
syn keyword mpVariable flow_show_all_points flow_show_con_points
|
||||
syn keyword mpVariable flow_show_mid_points flow_showcrossing flow_smooth
|
||||
syn keyword mpVariable flow_touchshape flow_xypoint flow_zfactor
|
||||
syn keyword mpConstant context_flow
|
||||
" mp-chem.mpiv
|
||||
syn keyword mpDef chem_init_all chem_reset chem_start_structure
|
||||
syn keyword mpDef chem_transformed
|
||||
syn keyword mpVardef chem_ad chem_adj chem_align chem_arrow chem_au
|
||||
syn keyword mpVardef chem_b chem_bb chem_bd chem_bw chem_c chem_cc
|
||||
syn keyword mpVardef chem_ccd chem_cd chem_crz chem_cz chem_dash chem_db
|
||||
syn keyword mpVardef chem_diff chem_dir chem_do chem_dr chem_draw
|
||||
syn keyword mpVardef chem_drawarrow chem_eb chem_ed chem_ep chem_er
|
||||
syn keyword mpVardef chem_es chem_et chem_fill chem_hb chem_init_some
|
||||
syn keyword mpVardef chem_label chem_ldb chem_ldd chem_line chem_lr
|
||||
syn keyword mpVardef chem_lrb chem_lrbd chem_lrd chem_lrh chem_lrn
|
||||
syn keyword mpVardef chem_lrt chem_lrz chem_lsr chem_lsub chem_mark
|
||||
syn keyword mpVardef chem_marked chem_mid chem_mids chem_midz chem_mir
|
||||
syn keyword mpVardef chem_mov chem_move chem_number chem_oe chem_off
|
||||
syn keyword mpVardef chem_pb chem_pe chem_r chem_r_fragment chem_rb
|
||||
syn keyword mpVardef chem_rbd chem_rd chem_rdb chem_rdd chem_restore
|
||||
syn keyword mpVardef chem_rh chem_rm chem_rn chem_rot chem_rr chem_rrb
|
||||
syn keyword mpVardef chem_rrbd chem_rrd chem_rrh chem_rrn chem_rrt
|
||||
syn keyword mpVardef chem_rrz chem_rsr chem_rsub chem_rt chem_rz chem_s
|
||||
syn keyword mpVardef chem_save chem_sb chem_sd chem_set chem_sr chem_ss
|
||||
syn keyword mpVardef chem_start_component chem_stop_component
|
||||
syn keyword mpVardef chem_stop_structure chem_sub chem_symbol chem_tb
|
||||
syn keyword mpVardef chem_text chem_z chem_zln chem_zlt chem_zn chem_zrn
|
||||
syn keyword mpVardef chem_zrt chem_zt
|
||||
syn keyword mpVariable chem_mark_pair chem_stack_mirror chem_stack_origin
|
||||
syn keyword mpVariable chem_stack_p chem_stack_previous
|
||||
syn keyword mpVariable chem_stack_rotation chem_trace_boundingbox
|
||||
syn keyword mpVariable chem_trace_nesting chem_trace_text
|
||||
syn keyword mpConstant context_chem
|
||||
" mp-core.mpiv
|
||||
syn keyword mpDef FlushSyncTasks ProcessSyncTask
|
||||
syn keyword mpDef RegisterLocalTextArea RegisterPlainTextArea
|
||||
syn keyword mpDef RegisterRegionTextArea RegisterTextArea
|
||||
syn keyword mpDef ResetLocalTextArea ResetSyncTasks ResetTextAreas
|
||||
syn keyword mpDef SaveTextAreas SetSyncColor SetSyncThreshold
|
||||
syn keyword mpDef SyncTask anchor_box box_found boxfilloptions
|
||||
syn keyword mpDef boxgridoptions boxlineoptions collapse_multi_pars
|
||||
syn keyword mpDef draw_box draw_multi_pars draw_par freeze_box
|
||||
syn keyword mpDef initialize_area initialize_area_par initialize_box
|
||||
syn keyword mpDef initialize_box_pos initialize_par
|
||||
syn keyword mpDef prepare_multi_pars relocate_multipars save_multipar
|
||||
syn keyword mpDef set_par_line_height show_multi_pars show_par
|
||||
syn keyword mpDef simplify_multi_pars sort_multi_pars
|
||||
syn keyword mpVardef InsideSavedTextArea InsideSomeSavedTextArea
|
||||
syn keyword mpVardef InsideSomeTextArea InsideTextArea PrepareSyncTasks
|
||||
syn keyword mpVardef SyncBox TextAreaH TextAreaW TextAreaWH TextAreaX
|
||||
syn keyword mpVardef TextAreaXY TextAreaY TheSyncColor TheSyncThreshold
|
||||
syn keyword mpVardef baseline_grid graphic_grid multi_par_at_top
|
||||
syn keyword mpVariable CurrentSyncClass NOfSavedTextAreas
|
||||
syn keyword mpVariable NOfSavedTextColumns NOfSyncPaths NOfTextAreas
|
||||
syn keyword mpVariable NOfTextColumns PlainTextArea RegionTextArea
|
||||
syn keyword mpVariable SavedTextColumns SyncColor SyncLeftOffset SyncPaths
|
||||
syn keyword mpVariable SyncTasks SyncThreshold SyncThresholdMethod
|
||||
syn keyword mpVariable SyncWidth TextAreas TextColumns
|
||||
syn keyword mpVariable auto_multi_par_hsize boxdashtype boxfilloffset
|
||||
syn keyword mpVariable boxfilltype boxgriddirection boxgriddistance
|
||||
syn keyword mpVariable boxgridshift boxgridtype boxgridwidth boxlineradius
|
||||
syn keyword mpVariable boxlinetype boxlinewidth check_multi_par_chain
|
||||
syn keyword mpVariable compensate_multi_par_topskip
|
||||
syn keyword mpVariable enable_multi_par_fallback force_multi_par_chain
|
||||
syn keyword mpVariable ignore_multi_par_page last_multi_par_shift lefthang
|
||||
syn keyword mpVariable local_multi_par_area multi_column_first_page_hack
|
||||
syn keyword mpVariable multi_par_pages multiloc multilocs multipar
|
||||
syn keyword mpVariable multipars multiref multirefs nofmultipars
|
||||
syn keyword mpVariable obey_multi_par_hang obey_multi_par_more
|
||||
syn keyword mpVariable one_piece_multi_par par_hang_after par_hang_indent
|
||||
syn keyword mpVariable par_indent par_left_skip par_line_height
|
||||
syn keyword mpVariable par_right_skip par_start_pos par_stop_pos
|
||||
syn keyword mpVariable par_strut_depth par_strut_height ppos righthang
|
||||
syn keyword mpVariable snap_multi_par_tops somehang span_multi_column_pars
|
||||
syn keyword mpVariable use_multi_par_region
|
||||
syn keyword mpConstant context_core
|
||||
syn keyword LET anchor_area anchor_par draw_area
|
||||
" mp-cows.mpiv
|
||||
syn keyword mpConstant context_cows cow
|
||||
" mp-crop.mpiv
|
||||
syn keyword mpDef page_marks_add_color page_marks_add_lines
|
||||
syn keyword mpDef page_marks_add_marking page_marks_add_number
|
||||
syn keyword mpVardef crop_color crop_gray crop_marks_cmyk
|
||||
syn keyword mpVardef crop_marks_cmykrgb crop_marks_gray crop_marks_lines
|
||||
syn keyword mpVariable crop_colors more page
|
||||
syn keyword mpConstant context_crop
|
||||
" mp-figs.mpiv
|
||||
syn keyword mpDef naturalfigure registerfigure
|
||||
syn keyword mpVardef figuredimensions figureheight figuresize
|
||||
syn keyword mpVardef figurewidth
|
||||
syn keyword mpConstant context_figs
|
||||
" mp-fobg.mpiv
|
||||
syn keyword mpDef DrawFoFrame
|
||||
syn keyword mpVardef equalpaths
|
||||
syn keyword mpPrimaryDef inset outset
|
||||
syn keyword mpVariable FoBackground FoBackgroundColor FoFrame FoLineColor
|
||||
syn keyword mpVariable FoLineStyle FoLineWidth FoSplit
|
||||
syn keyword mpConstant FoAll FoBottom FoDash FoDotted FoDouble FoGroove
|
||||
syn keyword mpConstant FoHidden FoInset FoLeft FoMedium FoNoColor FoNone
|
||||
syn keyword mpConstant FoOutset FoRidge FoRight FoSolid FoThick FoThin
|
||||
syn keyword mpConstant FoTop context_fobg
|
||||
" mp-form.mpiv
|
||||
syn keyword mpConstant context_form
|
||||
" mp-func.mpiv
|
||||
syn keyword mpDef constructedfunction constructedpairs
|
||||
syn keyword mpDef constructedpath curvedfunction curvedpairs
|
||||
syn keyword mpDef curvedpath function pathconnectors straightfunction
|
||||
syn keyword mpDef straightpairs straightpath
|
||||
syn keyword mpConstant context_func
|
||||
" mp-grap.mpiv
|
||||
syn keyword mpDef Gfor OUT auto begingraph circles crosses diamonds
|
||||
syn keyword mpDef downtriangles endgraph gdata gdraw gdrawarrow
|
||||
syn keyword mpDef gdrawdblarrow gfill graph_addto
|
||||
syn keyword mpDef graph_addto_currentpicture graph_comma
|
||||
syn keyword mpDef graph_coordinate_multiplication graph_draw
|
||||
syn keyword mpDef graph_draw_label graph_errorbar_text graph_fill
|
||||
syn keyword mpDef graph_generate_exponents
|
||||
syn keyword mpDef graph_generate_label_position
|
||||
syn keyword mpDef graph_generate_numbers graph_label_location
|
||||
syn keyword mpDef graph_scan_mark graph_scan_marks graph_setbounds
|
||||
syn keyword mpDef graph_suffix graph_tick_label
|
||||
syn keyword mpDef graph_with_pen_and_color graph_withlist
|
||||
syn keyword mpDef graph_xyscale lefttriangles makefunctionpath plot
|
||||
syn keyword mpDef plotsymbol points rainbow righttriangles smoothpath
|
||||
syn keyword mpDef squares stars uptriangles witherrorbars
|
||||
syn keyword mpVardef addtopath augment autogrid constant_fit
|
||||
syn keyword mpVardef constant_function det escaped_format exp
|
||||
syn keyword mpVardef exponential_fit exponential_function format
|
||||
syn keyword mpVardef formatted frame functionpath gaussian_fit
|
||||
syn keyword mpVardef gaussian_function gdotlabel glabel graph_Feform
|
||||
syn keyword mpVardef graph_Meform graph_arrowhead_extent graph_bounds
|
||||
syn keyword mpVardef graph_clear_bounds
|
||||
syn keyword mpVardef graph_convert_user_path_to_internal graph_cspan
|
||||
syn keyword mpVardef graph_draw_arrowhead graph_error graph_errorbars
|
||||
syn keyword mpVardef graph_exp graph_factor_and_exponent_to_string
|
||||
syn keyword mpVardef graph_gridline_picture graph_is_null
|
||||
syn keyword mpVardef graph_label_convert_user_to_internal graph_loptok
|
||||
syn keyword mpVardef graph_match_exponents graph_mlog
|
||||
syn keyword mpVardef graph_modified_exponent_ypart graph_pair_adjust
|
||||
syn keyword mpVardef graph_picture_conversion graph_post_draw
|
||||
syn keyword mpVardef graph_read_line graph_readpath graph_remap
|
||||
syn keyword mpVardef graph_scan_path graph_select_exponent_mark
|
||||
syn keyword mpVardef graph_select_mark graph_set_bounds
|
||||
syn keyword mpVardef graph_set_default_bounds graph_shapesize
|
||||
syn keyword mpVardef graph_stash_label graph_tick_mark_spacing
|
||||
syn keyword mpVardef graph_unknown_pair_bbox grid isdigit itick
|
||||
syn keyword mpVardef linear_fit linear_function ln logten lorentzian_fit
|
||||
syn keyword mpVardef lorentzian_function otick polynomial_fit
|
||||
syn keyword mpVardef polynomial_function power_law_fit
|
||||
syn keyword mpVardef power_law_function powten setcoords setrange
|
||||
syn keyword mpVardef sortpath strfmt tick varfmt
|
||||
syn keyword mpNewInternal Mzero doubleinfinity graph_log_minimum
|
||||
syn keyword mpNewInternal graph_minimum_number_of_marks largestmantissa
|
||||
syn keyword mpNewInternal linear lntwo log mlogten singleinfinity
|
||||
syn keyword mpVariable Autoform determinant fit_chi_squared
|
||||
syn keyword mpVariable graph_errorbar_picture graph_exp_marks
|
||||
syn keyword mpVariable graph_frame_pair_a graph_frame_pair_b
|
||||
syn keyword mpVariable graph_lin_marks graph_log_marks graph_modified_bias
|
||||
syn keyword mpVariable graph_modified_higher graph_modified_lower
|
||||
syn keyword mpVariable graph_shape r_s resistance_color resistance_name
|
||||
syn keyword mpConstant context_grap
|
||||
" mp-grid.mpiv
|
||||
syn keyword mpDef hlingrid hloggrid vlingrid vloggrid
|
||||
syn keyword mpVardef hlinlabel hlintext hlogtext linlin linlinpath
|
||||
syn keyword mpVardef linlog linlogpath loglin loglinpath loglog
|
||||
syn keyword mpVardef loglogpath processpath vlinlabel vlintext vlogtext
|
||||
syn keyword mpVariable fmt_initialize fmt_pictures fmt_precision
|
||||
syn keyword mpVariable fmt_separator fmt_zerocheck grid_eps
|
||||
syn keyword mpConstant context_grid
|
||||
" mp-grph.mpiv
|
||||
syn keyword mpDef beginfig begingraphictextfig data_mpo_file
|
||||
syn keyword mpDef data_mpy_file doloadfigure draw endfig
|
||||
syn keyword mpDef endgraphictextfig fill fixedplace graphictext
|
||||
syn keyword mpDef loadfigure new_graphictext normalwithshade number
|
||||
syn keyword mpDef old_graphictext outlinefill protectgraphicmacros
|
||||
syn keyword mpDef resetfig reversefill withdrawcolor withfillcolor
|
||||
syn keyword mpDef withshade
|
||||
syn keyword mpVariable currentgraphictext figureshift
|
||||
syn keyword mpConstant context_grph
|
||||
" mp-idea.mpiv
|
||||
syn keyword mpVardef bcomponent ccomponent gcomponent mcomponent
|
||||
syn keyword mpVardef rcomponent somecolor ycomponent
|
||||
" mp-luas.mpiv
|
||||
syn keyword mpDef luacall message
|
||||
syn keyword mpVardef MP lua lualist
|
||||
syn keyword mpConstant context_luas
|
||||
" mp-mlib.mpiv
|
||||
syn keyword mpDef autoalign bitmapimage circular_shade cmyk comment
|
||||
syn keyword mpDef defineshade eofill eofillup externalfigure figure
|
||||
syn keyword mpDef fillup label linear_shade multitonecolor namedcolor
|
||||
syn keyword mpDef nofill onlayer passarrayvariable passvariable
|
||||
syn keyword mpDef plain_label register resolvedcolor scantokens
|
||||
syn keyword mpDef set_circular_vector set_linear_vector shaded
|
||||
syn keyword mpDef spotcolor startpassingvariable stoppassingvariable
|
||||
syn keyword mpDef thelabel transparent[] usemetafunlabels
|
||||
syn keyword mpDef useplainlabels withcircularshade withlinearshade
|
||||
syn keyword mpDef withmask withproperties withshadecenter
|
||||
syn keyword mpDef withshadecolors withshadedirection withshadedomain
|
||||
syn keyword mpDef withshadefactor withshadefraction withshadeorigin
|
||||
syn keyword mpDef withshaderadius withshadestep withshadetransform
|
||||
syn keyword mpDef withshadevector withtransparency
|
||||
syn keyword mpVardef anchored checkbounds checkedbounds
|
||||
syn keyword mpVardef define_circular_shade define_linear_shade dotlabel
|
||||
syn keyword mpVardef escaped_format fmttext fontsize format formatted
|
||||
syn keyword mpVardef installlabel onetimefmttext onetimetextext
|
||||
syn keyword mpVardef outlinetext plain_thelabel properties rawfmttext
|
||||
syn keyword mpVardef rawtexbox rawtextext rule strfmt strut texbox
|
||||
syn keyword mpVardef textext thefmttext thelabel thetexbox thetextext
|
||||
syn keyword mpVardef tostring transparency_alternative_to_number
|
||||
syn keyword mpVardef validtexbox varfmt verbatim
|
||||
syn keyword mpPrimaryDef asgroup infont normalinfont shadedinto
|
||||
syn keyword mpPrimaryDef shownshadecenter shownshadedirection
|
||||
syn keyword mpPrimaryDef shownshadeorigin shownshadevector withshade
|
||||
syn keyword mpPrimaryDef withshademethod
|
||||
syn keyword mpNewInternal colorburntransparent colordodgetransparent
|
||||
syn keyword mpNewInternal colortransparent darkentransparent
|
||||
syn keyword mpNewInternal differencetransparent exclusiontransparent
|
||||
syn keyword mpNewInternal hardlighttransparent huetransparent
|
||||
syn keyword mpNewInternal lightentransparent luminositytransparent
|
||||
syn keyword mpNewInternal multiplytransparent normaltransparent
|
||||
syn keyword mpNewInternal overlaytransparent saturationtransparent
|
||||
syn keyword mpNewInternal screentransparent shadefactor softlighttransparent
|
||||
syn keyword mpNewInternal textextoffset
|
||||
syn keyword mpType property transparency
|
||||
syn keyword mpVariable currentoutlinetext shadeddown shadedleft
|
||||
syn keyword mpVariable shadedright shadedup shadeoffset trace_shades
|
||||
syn keyword mpConstant context_mlib
|
||||
" mp-page.mpiv
|
||||
syn keyword mpDef BoundCoverAreas BoundPageAreas Enlarged FakeRule
|
||||
syn keyword mpDef FakeWord LoadPageState OverlayBox RuleColor
|
||||
syn keyword mpDef SetAreaVariables SetPageArea SetPageBackPage
|
||||
syn keyword mpDef SetPageCoverPage SetPageField SetPageFrontPage
|
||||
syn keyword mpDef SetPageHsize SetPageHstep SetPageLocation
|
||||
syn keyword mpDef SetPagePage SetPageSpine SetPageVariables
|
||||
syn keyword mpDef SetPageVsize SetPageVstep StartCover StartPage
|
||||
syn keyword mpDef StopCover StopPage SwapPageState innerenlarged
|
||||
syn keyword mpDef llEnlarged lrEnlarged outerenlarged ulEnlarged
|
||||
syn keyword mpDef urEnlarged
|
||||
syn keyword mpVardef BackPageHeight BackPageWidth BackSpace BaseLineSkip
|
||||
syn keyword mpVardef BodyFontSize BottomDistance BottomHeight
|
||||
syn keyword mpVardef BottomSpace CoverHeight CoverWidth CurrentColumn
|
||||
syn keyword mpVardef CurrentHeight CurrentWidth CutSpace EmWidth
|
||||
syn keyword mpVardef ExHeight FooterDistance FooterHeight
|
||||
syn keyword mpVardef FrontPageHeight FrontPageWidth HSize HeaderDistance
|
||||
syn keyword mpVardef HeaderHeight InPageBody InnerEdgeDistance
|
||||
syn keyword mpVardef InnerEdgeWidth InnerMarginDistance InnerMarginWidth
|
||||
syn keyword mpVardef InnerSpaceWidth LastPageNumber LayoutColumnDistance
|
||||
syn keyword mpVardef LayoutColumnWidth LayoutColumns LeftEdgeDistance
|
||||
syn keyword mpVardef LeftEdgeWidth LeftMarginDistance LeftMarginWidth
|
||||
syn keyword mpVardef LineHeight MakeupHeight MakeupWidth NOfColumns
|
||||
syn keyword mpVardef NOfPages OnOddPage OnRightPage OuterEdgeDistance
|
||||
syn keyword mpVardef OuterEdgeWidth OuterMarginDistance OuterMarginWidth
|
||||
syn keyword mpVardef OuterSpaceWidth OverlayDepth OverlayHeight
|
||||
syn keyword mpVardef OverlayLineWidth OverlayOffset OverlayWidth
|
||||
syn keyword mpVardef PageDepth PageFraction PageNumber PageOffset
|
||||
syn keyword mpVardef PaperBleed PaperHeight PaperWidth PrintPaperHeight
|
||||
syn keyword mpVardef PrintPaperWidth RealPageNumber RightEdgeDistance
|
||||
syn keyword mpVardef RightEdgeWidth RightMarginDistance RightMarginWidth
|
||||
syn keyword mpVardef SpineHeight SpineWidth StrutDepth StrutHeight
|
||||
syn keyword mpVardef TextHeight TextWidth TopDistance TopHeight TopSkip
|
||||
syn keyword mpVardef TopSpace VSize defaultcolormodel
|
||||
syn keyword mpVariable Area BackPage CoverPage CurrentLayout Field
|
||||
syn keyword mpVariable FrontPage HorPos Hsize Hstep Location Page
|
||||
syn keyword mpVariable PageStateAvailable RuleDepth RuleDirection
|
||||
syn keyword mpVariable RuleFactor RuleH RuleHeight RuleOffset RuleOption
|
||||
syn keyword mpVariable RuleThickness RuleV RuleWidth Spine VerPos Vsize
|
||||
syn keyword mpVariable Vstep
|
||||
syn keyword mpConstant context_page
|
||||
" mp-shap.mpiv
|
||||
syn keyword mpDef drawline drawshape some_shape
|
||||
syn keyword mpDef start_predefined_shape_definition
|
||||
syn keyword mpDef stop_predefined_shape_definition
|
||||
syn keyword mpVardef drawpredefinedline drawpredefinedshape
|
||||
syn keyword mpVardef some_shape_path
|
||||
syn keyword mpVariable predefined_shapes predefined_shapes_xradius
|
||||
syn keyword mpVariable predefined_shapes_xxradius
|
||||
syn keyword mpVariable predefined_shapes_yradius
|
||||
syn keyword mpVariable predefined_shapes_yyradius
|
||||
syn keyword mpConstant context_shap
|
||||
" mp-step.mpiv
|
||||
syn keyword mpDef initialize_step_variables midbottomboundary
|
||||
syn keyword mpDef midtopboundary step_begin_cell step_begin_chart
|
||||
syn keyword mpDef step_cell_ali step_cell_bot step_cell_top
|
||||
syn keyword mpDef step_cells step_end_cell step_end_chart
|
||||
syn keyword mpDef step_text_bot step_text_mid step_text_top
|
||||
syn keyword mpDef step_texts
|
||||
syn keyword mpVariable cell_distance_x cell_distance_y cell_fill_color
|
||||
syn keyword mpVariable cell_line_color cell_line_width cell_offset
|
||||
syn keyword mpVariable chart_align chart_category chart_vertical
|
||||
syn keyword mpVariable line_distance line_height line_line_color
|
||||
syn keyword mpVariable line_line_width line_offset nofcells
|
||||
syn keyword mpVariable text_distance_set text_fill_color text_line_color
|
||||
syn keyword mpVariable text_line_width text_offset
|
||||
syn keyword mpConstant context_cell
|
||||
" mp-symb.mpiv
|
||||
syn keyword mpDef finishglyph prepareglyph
|
||||
syn keyword mpConstant lefttriangle midbar onebar righttriangle sidebar
|
||||
syn keyword mpConstant sublefttriangle subrighttriangle twobar
|
||||
" mp-text.mpiv
|
||||
syn keyword mpDef build_parshape
|
||||
syn keyword mpVardef found_point
|
||||
syn keyword mpVariable trace_parshape
|
||||
syn keyword mpConstant context_text
|
||||
" mp-tool.mpiv
|
||||
syn keyword mpCommand dump
|
||||
syn keyword mpDef addbackground b_color beginglyph break centerarrow
|
||||
syn keyword mpDef clearxy condition data_mpd_file detaileddraw
|
||||
syn keyword mpDef detailpaths dowithpath draw drawboundary
|
||||
syn keyword mpDef drawboundingbox drawcontrollines drawcontrolpoints
|
||||
syn keyword mpDef drawfill draworigin drawpath drawpathonly
|
||||
syn keyword mpDef drawpathwithpoints drawpoint drawpointlabels
|
||||
syn keyword mpDef drawpoints drawticks drawwholepath drawxticks
|
||||
syn keyword mpDef drawyticks endglyph fill finishsavingdata g_color
|
||||
syn keyword mpDef inner_boundingbox job_name leftarrow loadmodule
|
||||
syn keyword mpDef midarrowhead naturalizepaths newboolean newcolor
|
||||
syn keyword mpDef newnumeric newpair newpath newpicture newstring
|
||||
syn keyword mpDef newtransform normalcolors normaldraw normalfill
|
||||
syn keyword mpDef normalwithcolor outer_boundingbox pop_boundingbox
|
||||
syn keyword mpDef popboundingbox popcurrentpicture push_boundingbox
|
||||
syn keyword mpDef pushboundingbox pushcurrentpicture r_color readfile
|
||||
syn keyword mpDef recolor redraw refill register_dirty_chars
|
||||
syn keyword mpDef remapcolor remapcolors remappedcolor reprocess
|
||||
syn keyword mpDef resetarrows resetcolormap resetdrawoptions
|
||||
syn keyword mpDef resolvedcolor restroke retext rightarrow savedata
|
||||
syn keyword mpDef saveoptions scale_currentpicture set_ahlength
|
||||
syn keyword mpDef set_grid showgrid startplaincompatibility
|
||||
syn keyword mpDef startsavingdata stopplaincompatibility
|
||||
syn keyword mpDef stopsavingdata stripe_path_a stripe_path_n undashed
|
||||
syn keyword mpDef undrawfill untext visualizeddraw visualizedfill
|
||||
syn keyword mpDef visualizepaths withcolor withgray
|
||||
syn keyword mpDef xscale_currentpicture xshifted
|
||||
syn keyword mpDef xyscale_currentpicture yscale_currentpicture
|
||||
syn keyword mpDef yshifted
|
||||
syn keyword mpVardef acos acosh anglebetween area arrowhead
|
||||
syn keyword mpVardef arrowheadonpath arrowpath asciistring asin asinh
|
||||
syn keyword mpVardef atan basiccolors bbheight bbwidth bcomponent
|
||||
syn keyword mpVardef blackcolor bottomboundary boundingbox c_phantom
|
||||
syn keyword mpVardef ccomponent center cleanstring colorcircle
|
||||
syn keyword mpVardef colordecimals colordecimalslist colorlike colorpart
|
||||
syn keyword mpVardef colortype complementary complemented copylist cos
|
||||
syn keyword mpVardef cosh cot cotd curved ddddecimal dddecimal ddecimal
|
||||
syn keyword mpVardef decorated drawarrowpath epsed exp freedotlabel
|
||||
syn keyword mpVardef freelabel gcomponent getunstringed grayed greyed
|
||||
syn keyword mpVardef hsvtorgb infinite innerboundingbox interpolated inv
|
||||
syn keyword mpVardef invcos inverted invsin invtan laddered leftboundary
|
||||
syn keyword mpVardef leftpath leftrightpath listsize listtocurves
|
||||
syn keyword mpVardef listtolines ln log mcomponent new_on_grid
|
||||
syn keyword mpVardef outerboundingbox paired pen_size penpoint phantom
|
||||
syn keyword mpVardef pointarrow pow punked rangepath rcomponent
|
||||
syn keyword mpVardef redecorated repathed rightboundary rightpath
|
||||
syn keyword mpVardef rotation roundedsquare set_inner_boundingbox
|
||||
syn keyword mpVardef set_outer_boundingbox setunstringed shapedlist
|
||||
syn keyword mpVardef simplified sin sinh sortlist sqr straightpath tan
|
||||
syn keyword mpVardef tand tanh tensecircle thefreelabel topboundary
|
||||
syn keyword mpVardef tripled undecorated unitvector unspiked unstringed
|
||||
syn keyword mpVardef whitecolor ycomponent
|
||||
syn keyword mpPrimaryDef along blownup bottomenlarged cornered crossed
|
||||
syn keyword mpPrimaryDef enlarged enlonged leftenlarged llenlarged llmoved
|
||||
syn keyword mpPrimaryDef lrenlarged lrmoved on paralleled randomized
|
||||
syn keyword mpPrimaryDef randomizedcontrols randomshifted rightenlarged
|
||||
syn keyword mpPrimaryDef shortened sized smoothed snapped softened squeezed
|
||||
syn keyword mpPrimaryDef stretched superellipsed topenlarged ulenlarged
|
||||
syn keyword mpPrimaryDef ulmoved uncolored urenlarged urmoved xsized
|
||||
syn keyword mpPrimaryDef xstretched xyscaled xysized ysized ystretched zmod
|
||||
syn keyword mpSecondaryDef anglestriped intersection_point numberstriped
|
||||
syn keyword mpSecondaryDef peepholed
|
||||
syn keyword mpTertiaryDef cutends
|
||||
syn keyword mpNewInternal ahdimple ahvariant anglelength anglemethod
|
||||
syn keyword mpNewInternal angleoffset charscale cmykcolormodel graycolormodel
|
||||
syn keyword mpNewInternal greycolormodel maxdimensions metapostversion
|
||||
syn keyword mpNewInternal nocolormodel rgbcolormodel striped_normal_inner
|
||||
syn keyword mpNewInternal striped_normal_outer striped_reverse_inner
|
||||
syn keyword mpNewInternal striped_reverse_outer
|
||||
syn keyword mpType grayscale greyscale quadruplet triplet
|
||||
syn keyword mpVariable ahfactor collapse_data color_map drawoptionsfactor
|
||||
syn keyword mpVariable freedotlabelsize freelabeloffset grid grid_full
|
||||
syn keyword mpVariable grid_h grid_left grid_nx grid_ny grid_w grid_x
|
||||
syn keyword mpVariable grid_y intersection_found originlength
|
||||
syn keyword mpVariable plain_compatibility_data pointlabelfont
|
||||
syn keyword mpVariable pointlabelscale refillbackground savingdata
|
||||
syn keyword mpVariable savingdatadone swappointlabels ticklength tickstep
|
||||
syn keyword mpConstant CRLF DQUOTE PERCENT SPACE bcircle context_tool crlf
|
||||
syn keyword mpConstant darkblue darkcyan darkgray darkgreen darkmagenta
|
||||
syn keyword mpConstant darkred darkyellow downtriangle dquote freesquare
|
||||
syn keyword mpConstant fulldiamond fullsquare fulltriangle lcircle
|
||||
syn keyword mpConstant lefttriangle lightgray llcircle lltriangle lrcircle
|
||||
syn keyword mpConstant lrtriangle mpversion nocolor noline oddly
|
||||
syn keyword mpConstant originpath percent rcircle righttriangle space
|
||||
syn keyword mpConstant tcircle triangle ulcircle ultriangle unitcircle
|
||||
syn keyword mpConstant unitdiamond unittriangle uptriangle urcircle
|
||||
syn keyword mpConstant urtriangle
|
||||
endif " MetaFun macros
|
||||
|
||||
" Define the default highlighting
|
||||
" Only when an item doesn't have highlighting yet
|
||||
|
||||
hi def link mpTeXinsert String
|
||||
hi def link mpTeXbegin Statement
|
||||
hi def link mpTeXend Statement
|
||||
hi def link mpInternal mfInternal
|
||||
hi def link mpMacro Macro
|
||||
|
||||
hi def link mpTeXdelim mpPrimitive
|
||||
hi def link mpBoolExp mfBoolExp
|
||||
hi def link mpNumExp mfNumExp
|
||||
hi def link mpPairExp mfPairExp
|
||||
hi def link mpPathExp mfPathExp
|
||||
hi def link mpPenExp mfPenExp
|
||||
hi def link mpPicExp mfPicExp
|
||||
hi def link mpStringExp mfStringExp
|
||||
hi def link mpInternal mfInternal
|
||||
hi def link mpCommand mfCommand
|
||||
hi def link mpType mfType
|
||||
hi def link mpPrimitive mfPrimitive
|
||||
hi def link mpDef mfDef
|
||||
hi def link mpVardef mpDef
|
||||
hi def link mpPrimaryDef mpDef
|
||||
hi def link mpSecondaryDef mpDef
|
||||
hi def link mpTertiaryDef mpDef
|
||||
hi def link mpNewInternal mpInternal
|
||||
hi def link mpVariable mfVariable
|
||||
hi def link mpConstant mfConstant
|
||||
hi def link mpOnOff mpPrimitive
|
||||
hi def link mpDash mpPrimitive
|
||||
|
||||
let b:current_syntax = "mp"
|
||||
|
||||
" vim: ts=8
|
||||
let &cpo = s:cpo_sav
|
||||
unlet! s:cpo_sav
|
||||
|
||||
" vim:sw=2
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
# DEBUG=yes Build debug version (for VC7 and maybe later)
|
||||
#
|
||||
|
||||
TARGETOS=BOTH
|
||||
TARGETOS=WINNT
|
||||
!ifndef APPVER
|
||||
APPVER=5.0
|
||||
!endif
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
// DBPrefsWindowController.m
|
||||
//
|
||||
|
||||
#import "MacVim.h"
|
||||
#import "DBPrefsWindowController.h"
|
||||
|
||||
|
||||
|
||||
@@ -1255,7 +1255,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>110</string>
|
||||
<string>113</string>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
* Some default NSApplication key input behavior is overridden here.
|
||||
*/
|
||||
|
||||
#import "MacVim.h"
|
||||
#import "MMApplication.h"
|
||||
|
||||
@implementation MMApplication
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
* changes were made to adapt the code to MacVim.
|
||||
*/
|
||||
|
||||
#import "MacVim.h"
|
||||
#import "MMCoreTextView.h"
|
||||
|
||||
|
||||
|
||||
@@ -35,6 +35,8 @@
|
||||
NSMutableDictionary *signImages;
|
||||
BOOL useMouseTime;
|
||||
NSDate *mouseDownTime;
|
||||
CGFloat scrollingDeltaX;
|
||||
CGFloat scrollingDeltaY;
|
||||
|
||||
// Input Manager
|
||||
NSRange imRange;
|
||||
|
||||
@@ -280,6 +280,38 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
|
||||
|
||||
- (void)scrollWheel:(NSEvent *)event
|
||||
{
|
||||
float dx = 0;
|
||||
float dy = 0;
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7
|
||||
if ([event hasPreciseScrollingDeltas]) {
|
||||
NSSize cellSize = [textView cellSize];
|
||||
float thresholdX = cellSize.width;
|
||||
float thresholdY = cellSize.height;
|
||||
scrollingDeltaX += [event scrollingDeltaX];
|
||||
if (fabs(scrollingDeltaX) > thresholdX) {
|
||||
dx = roundf(scrollingDeltaX / thresholdX);
|
||||
scrollingDeltaX -= thresholdX * dx;
|
||||
}
|
||||
scrollingDeltaY += [event scrollingDeltaY];
|
||||
if (fabs(scrollingDeltaY) > thresholdY) {
|
||||
dy = roundf(scrollingDeltaY / thresholdY);
|
||||
scrollingDeltaY -= thresholdY * dy;
|
||||
}
|
||||
} else {
|
||||
scrollingDeltaX = 0;
|
||||
scrollingDeltaY = 0;
|
||||
dx = [event scrollingDeltaX];
|
||||
dy = [event scrollingDeltaY];
|
||||
}
|
||||
#else
|
||||
dx = [event deltaX];
|
||||
dy = [event deltaY];
|
||||
#endif
|
||||
|
||||
if (dx == 0 && dy == 0)
|
||||
return;
|
||||
|
||||
if ([self hasMarkedText]) {
|
||||
// We must clear the marked text since the cursor may move if the
|
||||
// marked text moves outside the view as a result of scrolling.
|
||||
@@ -288,11 +320,6 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
|
||||
[[NSTextInputContext currentInputContext] discardMarkedText];
|
||||
}
|
||||
|
||||
float dx = [event deltaX];
|
||||
float dy = [event deltaY];
|
||||
if (dx == 0 && dy == 0)
|
||||
return;
|
||||
|
||||
int row, col;
|
||||
NSPoint pt = [textView convertPoint:[event locationInWindow] fromView:nil];
|
||||
if ([textView convertPoint:pt toRow:&row column:&col]) {
|
||||
|
||||
@@ -40,6 +40,8 @@
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12
|
||||
// Deprecated constants in 10.12 SDK
|
||||
# define NSAlertStyleCritical NSCriticalAlertStyle
|
||||
# define NSAlertStyleInformational NSInformationalAlertStyle
|
||||
# define NSAlertStyleWarning NSWarningAlertStyle
|
||||
# define NSCompositingOperationSourceOver NSCompositeSourceOver
|
||||
# define NSControlSizeRegular NSRegularControlSize
|
||||
|
||||
@@ -68,6 +68,7 @@
|
||||
52A364761C4A57C1005757EC /* Sparkle.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 52A364721C4A5789005757EC /* Sparkle.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
52B7ED9B1C4A4D6900AFFF15 /* dsa_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = 52B7ED9A1C4A4D6900AFFF15 /* dsa_pub.pem */; };
|
||||
52818B031C1C08CE00F59085 /* QLStephen.qlgenerator in Copy QuickLookPlugin */ = {isa = PBXBuildFile; fileRef = 52818AFF1C1C075300F59085 /* QLStephen.qlgenerator */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
|
||||
528DA66A1426D4F9003380F1 /* macvim-askpass in Copy Scripts */ = {isa = PBXBuildFile; fileRef = 528DA6691426D4EB003380F1 /* macvim-askpass */; };
|
||||
8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; };
|
||||
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
|
||||
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
|
||||
@@ -153,6 +154,17 @@
|
||||
name = "Copy QuickLookPlugin";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
528DA6671426D456003380F1 /* Copy Scripts */ = {
|
||||
isa = PBXCopyFilesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
dstPath = "";
|
||||
dstSubfolderSpec = 6;
|
||||
files = (
|
||||
528DA66A1426D4F9003380F1 /* macvim-askpass in Copy Scripts */,
|
||||
);
|
||||
name = "Copy Scripts";
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXCopyFilesBuildPhase section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
@@ -237,6 +249,7 @@
|
||||
29B97325FDCFA39411CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
|
||||
32CA4F630368D1EE00C91783 /* MacVim_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MacVim_Prefix.pch; sourceTree = "<group>"; };
|
||||
52818AFA1C1C075300F59085 /* QuickLookStephen.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = QuickLookStephen.xcodeproj; path = qlstephen/QuickLookStephen.xcodeproj; sourceTree = "<group>"; };
|
||||
528DA6691426D4EB003380F1 /* macvim-askpass */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "macvim-askpass"; sourceTree = "<group>"; };
|
||||
52A364721C4A5789005757EC /* Sparkle.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Sparkle.framework; sourceTree = "<group>"; };
|
||||
52B7ED9A1C4A4D6900AFFF15 /* dsa_pub.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = dsa_pub.pem; sourceTree = "<group>"; };
|
||||
8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
|
||||
@@ -454,6 +467,14 @@
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
528DA6681426D477003380F1 /* Scripts */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
528DA6691426D4EB003380F1 /* macvim-askpass */,
|
||||
);
|
||||
name = Scripts;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
@@ -469,6 +490,7 @@
|
||||
52818B021C1C088000F59085 /* Copy QuickLookPlugin */,
|
||||
1DE608B80C58807F0055263D /* Copy Vim Runtime Files */,
|
||||
1D1C31F00EFFBFD6003FE9A5 /* Make Document Icons */,
|
||||
528DA6671426D456003380F1 /* Copy Scripts */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
|
||||
@@ -1507,9 +1507,9 @@ gui_mch_dialog(
|
||||
// Ensure no data is on the output queue before presenting the dialog.
|
||||
gui_macvim_force_flush();
|
||||
|
||||
int style = NSInformationalAlertStyle;
|
||||
int style = NSAlertStyleInformational;
|
||||
if (VIM_WARNING == type) style = NSAlertStyleWarning;
|
||||
else if (VIM_ERROR == type) style = NSCriticalAlertStyle;
|
||||
else if (VIM_ERROR == type) style = NSAlertStyleCritical;
|
||||
|
||||
NSMutableDictionary *attr = [NSMutableDictionary
|
||||
dictionaryWithObject:[NSNumber numberWithInt:style]
|
||||
@@ -2263,7 +2263,7 @@ static int vimModMaskToEventModifierFlags(int mods)
|
||||
// -- Channel Support ------------------------------------------------------
|
||||
|
||||
void *
|
||||
gui_macvim_add_channel(channel_T *channel, int part)
|
||||
gui_macvim_add_channel(channel_T *channel, ch_part_T part)
|
||||
{
|
||||
dispatch_source_t s =
|
||||
dispatch_source_create(DISPATCH_SOURCE_TYPE_READ,
|
||||
|
||||
@@ -37,6 +37,10 @@ set guitablabel=%M%t
|
||||
" that is generated by :hardcopy.
|
||||
set printexpr=system('open\ -a\ Preview\ '.v:fname_in)\ +\ v:shell_error
|
||||
|
||||
" askpass
|
||||
let $SSH_ASKPASS = simplify($VIM . '/../../MacOS') . '/macvim-askpass'
|
||||
let $SUDO_ASKPASS = $SSH_ASKPASS
|
||||
|
||||
|
||||
" This is so that HIG Cmd and Option movement mappings can be disabled by
|
||||
" adding the line
|
||||
|
||||
Executable
+29
@@ -0,0 +1,29 @@
|
||||
#! /bin/sh
|
||||
|
||||
#
|
||||
# An SSH_ASKPASS command for MacOS X
|
||||
#
|
||||
# Author: Joseph Mocker, Sun Microsystems
|
||||
#
|
||||
# http://blog.retep.org/2009/04/09/ssh-askpass-on-osx-10-5/
|
||||
|
||||
#
|
||||
# To use this script:
|
||||
# setenv SSH_ASKPASS "macos-askpass"
|
||||
# setenv DISPLAY ":0"
|
||||
#
|
||||
|
||||
TITLE=${MACOS_ASKPASS_TITLE:-"SSH"}
|
||||
|
||||
DIALOG="display dialog \"$@\" default answer \"\" with title \"$TITLE\""
|
||||
DIALOG="$DIALOG with icon caution with hidden answer"
|
||||
|
||||
result=`osascript -e 'tell application "Finder"' -e "activate" -e "$DIALOG" -e "text returned of result" -e 'end tell'`
|
||||
osascript -e 'tell application "MacVim"' -e "activate" -e 'end tell'
|
||||
|
||||
if [ "$result" = "" ]; then
|
||||
exit 1
|
||||
else
|
||||
echo "$result"
|
||||
exit 0
|
||||
fi
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#import "QLSFileAttributes.h"
|
||||
|
||||
#define DEFAULT_MAX_FILE_SIZE 1024 * 100
|
||||
|
||||
// Generate a preview for the document with the given url
|
||||
OSStatus GeneratePreviewForURL(void *thisInterface,
|
||||
@@ -40,6 +41,38 @@ OSStatus GeneratePreviewForURL(void *thisInterface,
|
||||
(NSString *)kQLPreviewPropertyHeightKey : @800
|
||||
};
|
||||
|
||||
// Get size of current File
|
||||
NSFileManager *man = [NSFileManager defaultManager];
|
||||
NSURL *file_url = (__bridge NSURL *)(url);
|
||||
NSDictionary *attrs = [man attributesOfItemAtPath: [file_url path] error: NULL];
|
||||
|
||||
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
// the plugin is running as com.apple.quicklook.satellite therefore we need to load our own settings
|
||||
NSDictionary *defaults = [userDefaults persistentDomainForName:@"com.whomwah.quicklookstephen"];
|
||||
|
||||
long long maxFileSizeSetting = [[defaults valueForKey:@"maxFileSize"] longLongValue];
|
||||
unsigned long long maxFileSize = DEFAULT_MAX_FILE_SIZE;
|
||||
if(maxFileSizeSetting > 0) {
|
||||
maxFileSize = maxFileSizeSetting;
|
||||
}
|
||||
|
||||
// Display less data, if file is too big
|
||||
if(attrs.fileSize > maxFileSize) {
|
||||
NSFileHandle *myFile= [NSFileHandle fileHandleForReadingAtPath:[file_url path]];
|
||||
if(!myFile) {
|
||||
return noErr;
|
||||
}
|
||||
NSData *displayData = [myFile readDataOfLength:maxFileSize];
|
||||
[myFile closeFile];
|
||||
|
||||
QLPreviewRequestSetDataRepresentation(
|
||||
request,
|
||||
(__bridge CFDataRef)displayData,
|
||||
kUTTypePlainText,
|
||||
(__bridge CFDictionaryRef)previewProperties);
|
||||
return noErr;
|
||||
}
|
||||
QLPreviewRequestSetURLRepresentation(
|
||||
request,
|
||||
url,
|
||||
|
||||
@@ -3,11 +3,9 @@
|
||||
#include <QuickLook/QuickLook.h>
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "RegexKitLite.h"
|
||||
|
||||
#import "QLSFileAttributes.h"
|
||||
|
||||
|
||||
/**
|
||||
* This dictionary is used for a file with no extension. It maps the MIME type
|
||||
* (as returned by file(1)) onto an appropriate thumbnail badge.
|
||||
@@ -72,10 +70,11 @@ static NSString *ThumbnailBadgeForItemWithAttributes(
|
||||
// Does the filename match a known pattern? If so, use the appropriate badge.
|
||||
if (!badge && [fileExtension isEqualToString:@""]) {
|
||||
NSDictionary *map = filenameRegexToBadgeMap();
|
||||
|
||||
[map enumerateKeysAndObjectsUsingBlock:
|
||||
^(NSString *regex, NSString *candidateBadge, BOOL *stop) {
|
||||
if ([fileName rkl_isMatchedByRegex:regex]) {
|
||||
^(NSString *pattern, NSString *candidateBadge, BOOL *stop) {
|
||||
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:pattern options:0 error:nil];
|
||||
NSRange range = [regex rangeOfFirstMatchInString:fileName options:0 range:NSMakeRange(0, fileName.length)];
|
||||
if (range.location != NSNotFound) {
|
||||
badge = candidateBadge;
|
||||
*stop = true;
|
||||
}
|
||||
|
||||
@@ -32,9 +32,9 @@
|
||||
<key>CFBundleName</key>
|
||||
<string>QLStephen</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.4</string>
|
||||
<string>1.44</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.4.2</string>
|
||||
<string>1.4.4</string>
|
||||
<key>CFPlugInDynamicRegisterFunction</key>
|
||||
<string></string>
|
||||
<key>CFPlugInDynamicRegistration</key>
|
||||
@@ -54,7 +54,7 @@
|
||||
<key>CFPlugInUnloadFunction</key>
|
||||
<string></string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2013 Duncan Robertson. All rights reserved.</string>
|
||||
<string>Copyright © 2016 Duncan Robertson. All rights reserved.</string>
|
||||
<key>QLNeedsToBeRunInMainThread</key>
|
||||
<true/>
|
||||
<key>QLPreviewHeight</key>
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
//
|
||||
|
||||
#import "QLSFileAttributes.h"
|
||||
#import "RegexKitLite.h"
|
||||
|
||||
@interface QLSFileAttributes ()
|
||||
|
||||
@@ -19,18 +18,22 @@
|
||||
|
||||
@implementation QLSFileAttributes
|
||||
|
||||
+ (instancetype)attributesForItemAtURL:(NSURL *)aURL
|
||||
{
|
||||
NSString *magicString = [self magicStringForItemAtURL:aURL];
|
||||
+ (instancetype)attributesForItemAtURL:(NSURL *)aURL {
|
||||
if ([aURL.lastPathComponent isEqualToString:@".DS_Store"]) {
|
||||
NSLog(@"Ignore the .DS_Store file.");
|
||||
return nil;
|
||||
}
|
||||
|
||||
NSString *magicString = [self magicStringForItemAtURL:aURL usingLcALL:@"en_US.UTF-8"];
|
||||
if (!magicString) magicString = [self magicStringForItemAtURL:aURL usingLcALL:@"C"];
|
||||
if (!magicString) return nil;
|
||||
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"(\\S+/\\S+); charset=(\\S+)" options:0 error:nil];
|
||||
NSTextCheckingResult *match = [regex firstMatchInString:magicString options:0 range:NSMakeRange(0, magicString.length)];
|
||||
|
||||
NSArray *matches = [magicString rkl_captureComponentsMatchedByRegex:
|
||||
@"(\\S+/\\S+); charset=(\\S+)"];
|
||||
if (!match) return nil;
|
||||
|
||||
if (![matches count]) return nil;
|
||||
|
||||
NSString *mimeType = matches[1];
|
||||
NSString *charset = matches[2];
|
||||
NSString *mimeType = [magicString substringWithRange:[match rangeAtIndex:1]];
|
||||
NSString *charset = [magicString substringWithRange:[match rangeAtIndex:2]];
|
||||
|
||||
BOOL mimeTypeIsTextual = [self mimeTypeIsTextual:mimeType];
|
||||
|
||||
@@ -50,14 +53,13 @@
|
||||
// Private Methods
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
+ (NSString *)magicStringForItemAtURL:(NSURL *)aURL
|
||||
{
|
||||
+ (NSString *)magicStringForItemAtURL:(NSURL *)aURL usingLcALL:(NSString *)lcALL {
|
||||
NSString *path = [aURL path];
|
||||
NSParameterAssert(path);
|
||||
|
||||
NSMutableDictionary *environment =
|
||||
[NSProcessInfo.processInfo.environment mutableCopy];
|
||||
environment[@"LC_ALL"] = @"en_US.UTF-8";
|
||||
environment[@"LC_ALL"] = lcALL;
|
||||
|
||||
NSTask *task = [NSTask new];
|
||||
task.launchPath = @"/usr/bin/file";
|
||||
@@ -94,8 +96,7 @@
|
||||
* @return YES if mimeType contains "text", or if the mime type conforms to the
|
||||
* public.text UTI.
|
||||
*/
|
||||
+ (BOOL)mimeTypeIsTextual:(NSString *)mimeType
|
||||
{
|
||||
+ (BOOL)mimeTypeIsTextual:(NSString *)mimeType {
|
||||
NSArray *components = [mimeType componentsSeparatedByString:@"/"];
|
||||
if (components.count != 2)
|
||||
return NO;
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
0107ABFF15C76F2900C65F1A /* QLSFileAttributes.m in Sources */ = {isa = PBXBuildFile; fileRef = 0107ABFD15C76F2900C65F1A /* QLSFileAttributes.m */; };
|
||||
0149EB3B15F2E8E4003AB298 /* RegexKitLite.m in Sources */ = {isa = PBXBuildFile; fileRef = 0149EB3915F2E8E4003AB298 /* RegexKitLite.m */; settings = {COMPILER_FLAGS = "-fno-objc-arc"; }; };
|
||||
0149EB3E15F2E9A3003AB298 /* libicucore.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0149EB3D15F2E9A3003AB298 /* libicucore.dylib */; };
|
||||
2C05A19C06CAA52B00D84F6F /* GeneratePreviewForURL.m in Sources */ = {isa = PBXBuildFile; fileRef = 2C05A19B06CAA52B00D84F6F /* GeneratePreviewForURL.m */; };
|
||||
61E3BCFB0870B4F2002186A0 /* GenerateThumbnailForURL.m in Sources */ = {isa = PBXBuildFile; fileRef = 61E3BCFA0870B4F2002186A0 /* GenerateThumbnailForURL.m */; };
|
||||
@@ -23,9 +22,7 @@
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
0107ABFC15C76F2900C65F1A /* QLSFileAttributes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QLSFileAttributes.h; sourceTree = "<group>"; };
|
||||
0107ABFD15C76F2900C65F1A /* QLSFileAttributes.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QLSFileAttributes.m; sourceTree = "<group>"; };
|
||||
0149EB3815F2E8E4003AB298 /* RegexKitLite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegexKitLite.h; sourceTree = "<group>"; };
|
||||
0149EB3915F2E8E4003AB298 /* RegexKitLite.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RegexKitLite.m; sourceTree = "<group>"; };
|
||||
0107ABFD15C76F2900C65F1A /* QLSFileAttributes.m */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.c.objc; path = QLSFileAttributes.m; sourceTree = "<group>"; tabWidth = 2; usesTabs = 0; };
|
||||
0149EB3D15F2E9A3003AB298 /* libicucore.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicucore.dylib; path = usr/lib/libicucore.dylib; sourceTree = SDKROOT; };
|
||||
089C167EFE841241C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
08FB77B6FE84183AC02AAC07 /* main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = "<group>"; };
|
||||
@@ -57,19 +54,9 @@
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
0149EB3F15F2EC37003AB298 /* Third-Party */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0149EB3815F2E8E4003AB298 /* RegexKitLite.h */,
|
||||
0149EB3915F2E8E4003AB298 /* RegexKitLite.m */,
|
||||
);
|
||||
name = "Third-Party";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
089C166AFE841209C02AAC07 /* QuickLookStephen */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
0149EB3F15F2EC37003AB298 /* Third-Party */,
|
||||
08FB77AFFE84173DC02AAC07 /* Source */,
|
||||
089C167CFE841241C02AAC07 /* Resources */,
|
||||
089C1671FE841209C02AAC07 /* External Frameworks and Libraries */,
|
||||
@@ -130,6 +117,7 @@
|
||||
8D57630F048677EA00EA77CD /* Resources */,
|
||||
8D576311048677EA00EA77CD /* Sources */,
|
||||
8D576313048677EA00EA77CD /* Frameworks */,
|
||||
698210201CC62DD000504BBF /* ShellScript */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -146,7 +134,7 @@
|
||||
089C1669FE841209C02AAC07 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0720;
|
||||
LastUpgradeCheck = 0730;
|
||||
};
|
||||
buildConfigurationList = 2CA326220896AD4900168862 /* Build configuration list for PBXProject "QuickLookStephen" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
@@ -175,6 +163,22 @@
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */
|
||||
698210201CC62DD000504BBF /* ShellScript */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "qlmanage -r";
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
8D576311048677EA00EA77CD /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
@@ -184,7 +188,6 @@
|
||||
2C05A19C06CAA52B00D84F6F /* GeneratePreviewForURL.m in Sources */,
|
||||
61E3BCFB0870B4F2002186A0 /* GenerateThumbnailForURL.m in Sources */,
|
||||
0107ABFF15C76F2900C65F1A /* QLSFileAttributes.m in Sources */,
|
||||
0149EB3B15F2E8E4003AB298 /* RegexKitLite.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
||||
@@ -1,295 +0,0 @@
|
||||
//
|
||||
// RegexKitLite.h
|
||||
// http://regexkit.sourceforge.net/
|
||||
// Licensed under the terms of the BSD License, as specified below.
|
||||
//
|
||||
|
||||
/*
|
||||
Copyright (c) 2008-2010, John Engelhart
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the name of the Zang Industries nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifdef __OBJC__
|
||||
#import <Foundation/NSArray.h>
|
||||
#import <Foundation/NSError.h>
|
||||
#import <Foundation/NSObjCRuntime.h>
|
||||
#import <Foundation/NSRange.h>
|
||||
#import <Foundation/NSString.h>
|
||||
#endif // __OBJC__
|
||||
|
||||
#include <limits.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
#include <TargetConditionals.h>
|
||||
#include <AvailabilityMacros.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef REGEXKITLITE_VERSION_DEFINED
|
||||
#define REGEXKITLITE_VERSION_DEFINED
|
||||
|
||||
#define _RKL__STRINGIFY(b) #b
|
||||
#define _RKL_STRINGIFY(a) _RKL__STRINGIFY(a)
|
||||
#define _RKL_JOIN_VERSION(a,b) _RKL_STRINGIFY(a##.##b)
|
||||
#define _RKL_VERSION_STRING(a,b) _RKL_JOIN_VERSION(a,b)
|
||||
|
||||
#define REGEXKITLITE_VERSION_MAJOR 4
|
||||
#define REGEXKITLITE_VERSION_MINOR 0
|
||||
|
||||
#define REGEXKITLITE_VERSION_CSTRING _RKL_VERSION_STRING(REGEXKITLITE_VERSION_MAJOR, REGEXKITLITE_VERSION_MINOR)
|
||||
#define REGEXKITLITE_VERSION_NSSTRING @REGEXKITLITE_VERSION_CSTRING
|
||||
|
||||
#endif // REGEXKITLITE_VERSION_DEFINED
|
||||
|
||||
#if !defined(RKL_BLOCKS) && defined(NS_BLOCKS_AVAILABLE) && (NS_BLOCKS_AVAILABLE == 1)
|
||||
#define RKL_BLOCKS 1
|
||||
#endif
|
||||
|
||||
#if defined(RKL_BLOCKS) && (RKL_BLOCKS == 1)
|
||||
#define _RKL_BLOCKS_ENABLED 1
|
||||
#endif // defined(RKL_BLOCKS) && (RKL_BLOCKS == 1)
|
||||
|
||||
#if defined(_RKL_BLOCKS_ENABLED) && !defined(__BLOCKS__)
|
||||
#warning RegexKitLite support for Blocks is enabled, but __BLOCKS__ is not defined. This compiler may not support Blocks, in which case the behavior is undefined. This will probably cause numerous compiler errors.
|
||||
#endif // defined(_RKL_BLOCKS_ENABLED) && !defined(__BLOCKS__)
|
||||
|
||||
// For Mac OS X < 10.5.
|
||||
#ifndef NSINTEGER_DEFINED
|
||||
#define NSINTEGER_DEFINED
|
||||
#if defined(__LP64__) || defined(NS_BUILD_32_LIKE_64)
|
||||
typedef long NSInteger;
|
||||
typedef unsigned long NSUInteger;
|
||||
#define NSIntegerMin LONG_MIN
|
||||
#define NSIntegerMax LONG_MAX
|
||||
#define NSUIntegerMax ULONG_MAX
|
||||
#else // defined(__LP64__) || defined(NS_BUILD_32_LIKE_64)
|
||||
typedef int NSInteger;
|
||||
typedef unsigned int NSUInteger;
|
||||
#define NSIntegerMin INT_MIN
|
||||
#define NSIntegerMax INT_MAX
|
||||
#define NSUIntegerMax UINT_MAX
|
||||
#endif // defined(__LP64__) || defined(NS_BUILD_32_LIKE_64)
|
||||
#endif // NSINTEGER_DEFINED
|
||||
|
||||
#ifndef RKLREGEXOPTIONS_DEFINED
|
||||
#define RKLREGEXOPTIONS_DEFINED
|
||||
|
||||
// These must be identical to their ICU regex counterparts. See http://www.icu-project.org/userguide/regexp.html
|
||||
enum {
|
||||
RKLNoOptions = 0,
|
||||
RKLCaseless = 2,
|
||||
RKLComments = 4,
|
||||
RKLDotAll = 32,
|
||||
RKLMultiline = 8,
|
||||
RKLUnicodeWordBoundaries = 256
|
||||
};
|
||||
typedef uint32_t RKLRegexOptions; // This must be identical to the ICU 'flags' argument type.
|
||||
|
||||
#endif // RKLREGEXOPTIONS_DEFINED
|
||||
|
||||
#ifndef RKLREGEXENUMERATIONOPTIONS_DEFINED
|
||||
#define RKLREGEXENUMERATIONOPTIONS_DEFINED
|
||||
|
||||
enum {
|
||||
RKLRegexEnumerationNoOptions = 0UL,
|
||||
RKLRegexEnumerationCapturedStringsNotRequired = 1UL << 9,
|
||||
RKLRegexEnumerationReleaseStringReturnedByReplacementBlock = 1UL << 10,
|
||||
RKLRegexEnumerationFastCapturedStringsXXX = 1UL << 11,
|
||||
};
|
||||
typedef NSUInteger RKLRegexEnumerationOptions;
|
||||
|
||||
#endif // RKLREGEXENUMERATIONOPTIONS_DEFINED
|
||||
|
||||
#ifndef _REGEXKITLITE_H_
|
||||
#define _REGEXKITLITE_H_
|
||||
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(__APPLE_CC__) && (__APPLE_CC__ >= 5465)
|
||||
#define RKL_DEPRECATED_ATTRIBUTE __attribute__((deprecated))
|
||||
#else
|
||||
#define RKL_DEPRECATED_ATTRIBUTE
|
||||
#endif
|
||||
|
||||
#if defined(NS_REQUIRES_NIL_TERMINATION)
|
||||
#define RKL_REQUIRES_NIL_TERMINATION NS_REQUIRES_NIL_TERMINATION
|
||||
#else // defined(NS_REQUIRES_NIL_TERMINATION)
|
||||
#define RKL_REQUIRES_NIL_TERMINATION
|
||||
#endif // defined(NS_REQUIRES_NIL_TERMINATION)
|
||||
|
||||
// This requires a few levels of rewriting to get the desired results.
|
||||
#define _RKL_CONCAT_2(c,d) c ## d
|
||||
#define _RKL_CONCAT(a,b) _RKL_CONCAT_2(a,b)
|
||||
|
||||
#ifdef RKL_PREPEND_TO_METHODS
|
||||
#define RKL_METHOD_PREPEND(x) _RKL_CONCAT(RKL_PREPEND_TO_METHODS, x)
|
||||
#else // RKL_PREPEND_TO_METHODS
|
||||
#define RKL_METHOD_PREPEND(x) x
|
||||
#endif // RKL_PREPEND_TO_METHODS
|
||||
|
||||
// If it looks like low memory notifications might be available, add code to register and respond to them.
|
||||
// This is (should be) harmless if it turns out that this isn't the case, since the notification that we register for,
|
||||
// UIApplicationDidReceiveMemoryWarningNotification, is dynamically looked up via dlsym().
|
||||
#if ((defined(TARGET_OS_EMBEDDED) && (TARGET_OS_EMBEDDED != 0)) || (defined(TARGET_OS_IPHONE) && (TARGET_OS_IPHONE != 0))) && (!defined(RKL_REGISTER_FOR_IPHONE_LOWMEM_NOTIFICATIONS) || (RKL_REGISTER_FOR_IPHONE_LOWMEM_NOTIFICATIONS != 0))
|
||||
#define RKL_REGISTER_FOR_IPHONE_LOWMEM_NOTIFICATIONS 1
|
||||
#endif
|
||||
|
||||
#ifdef __OBJC__
|
||||
|
||||
// NSException exception name.
|
||||
extern NSString * const RKLICURegexException;
|
||||
|
||||
// NSError error domains and user info keys.
|
||||
extern NSString * const RKLICURegexErrorDomain;
|
||||
|
||||
extern NSString * const RKLICURegexEnumerationOptionsErrorKey;
|
||||
extern NSString * const RKLICURegexErrorCodeErrorKey;
|
||||
extern NSString * const RKLICURegexErrorNameErrorKey;
|
||||
extern NSString * const RKLICURegexLineErrorKey;
|
||||
extern NSString * const RKLICURegexOffsetErrorKey;
|
||||
extern NSString * const RKLICURegexPreContextErrorKey;
|
||||
extern NSString * const RKLICURegexPostContextErrorKey;
|
||||
extern NSString * const RKLICURegexRegexErrorKey;
|
||||
extern NSString * const RKLICURegexRegexOptionsErrorKey;
|
||||
extern NSString * const RKLICURegexReplacedCountErrorKey;
|
||||
extern NSString * const RKLICURegexReplacedStringErrorKey;
|
||||
extern NSString * const RKLICURegexReplacementStringErrorKey;
|
||||
extern NSString * const RKLICURegexSubjectRangeErrorKey;
|
||||
extern NSString * const RKLICURegexSubjectStringErrorKey;
|
||||
|
||||
@interface NSString (RegexKitLiteAdditions)
|
||||
|
||||
+ (void)RKL_METHOD_PREPEND(clearStringCache);
|
||||
|
||||
// Although these are marked as deprecated, a bug in GCC prevents a warning from being issues for + class methods. Filed bug with Apple, #6736857.
|
||||
+ (NSInteger)RKL_METHOD_PREPEND(captureCountForRegex):(NSString *)regex RKL_DEPRECATED_ATTRIBUTE;
|
||||
+ (NSInteger)RKL_METHOD_PREPEND(captureCountForRegex):(NSString *)regex options:(RKLRegexOptions)options error:(NSError **)error RKL_DEPRECATED_ATTRIBUTE;
|
||||
|
||||
- (NSArray *)RKL_METHOD_PREPEND(componentsSeparatedByRegex):(NSString *)regex;
|
||||
- (NSArray *)RKL_METHOD_PREPEND(componentsSeparatedByRegex):(NSString *)regex range:(NSRange)range;
|
||||
- (NSArray *)RKL_METHOD_PREPEND(componentsSeparatedByRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error;
|
||||
|
||||
- (BOOL)RKL_METHOD_PREPEND(isMatchedByRegex):(NSString *)regex;
|
||||
- (BOOL)RKL_METHOD_PREPEND(isMatchedByRegex):(NSString *)regex inRange:(NSRange)range;
|
||||
- (BOOL)RKL_METHOD_PREPEND(isMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error;
|
||||
|
||||
- (NSRange)RKL_METHOD_PREPEND(rangeOfRegex):(NSString *)regex;
|
||||
- (NSRange)RKL_METHOD_PREPEND(rangeOfRegex):(NSString *)regex capture:(NSInteger)capture;
|
||||
- (NSRange)RKL_METHOD_PREPEND(rangeOfRegex):(NSString *)regex inRange:(NSRange)range;
|
||||
- (NSRange)RKL_METHOD_PREPEND(rangeOfRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range capture:(NSInteger)capture error:(NSError **)error;
|
||||
|
||||
- (NSString *)RKL_METHOD_PREPEND(stringByMatching):(NSString *)regex;
|
||||
- (NSString *)RKL_METHOD_PREPEND(stringByMatching):(NSString *)regex capture:(NSInteger)capture;
|
||||
- (NSString *)RKL_METHOD_PREPEND(stringByMatching):(NSString *)regex inRange:(NSRange)range;
|
||||
- (NSString *)RKL_METHOD_PREPEND(stringByMatching):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range capture:(NSInteger)capture error:(NSError **)error;
|
||||
|
||||
- (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement;
|
||||
- (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement range:(NSRange)searchRange;
|
||||
- (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement options:(RKLRegexOptions)options range:(NSRange)searchRange error:(NSError **)error;
|
||||
|
||||
//// >= 3.0
|
||||
|
||||
- (NSInteger)RKL_METHOD_PREPEND(captureCount);
|
||||
- (NSInteger)RKL_METHOD_PREPEND(captureCountWithOptions):(RKLRegexOptions)options error:(NSError **)error;
|
||||
|
||||
- (BOOL)RKL_METHOD_PREPEND(isRegexValid);
|
||||
- (BOOL)RKL_METHOD_PREPEND(isRegexValidWithOptions):(RKLRegexOptions)options error:(NSError **)error;
|
||||
|
||||
- (void)RKL_METHOD_PREPEND(flushCachedRegexData);
|
||||
|
||||
- (NSArray *)RKL_METHOD_PREPEND(componentsMatchedByRegex):(NSString *)regex;
|
||||
- (NSArray *)RKL_METHOD_PREPEND(componentsMatchedByRegex):(NSString *)regex capture:(NSInteger)capture;
|
||||
- (NSArray *)RKL_METHOD_PREPEND(componentsMatchedByRegex):(NSString *)regex range:(NSRange)range;
|
||||
- (NSArray *)RKL_METHOD_PREPEND(componentsMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range capture:(NSInteger)capture error:(NSError **)error;
|
||||
|
||||
|
||||
- (NSArray *)RKL_METHOD_PREPEND(captureComponentsMatchedByRegex):(NSString *)regex;
|
||||
- (NSArray *)RKL_METHOD_PREPEND(captureComponentsMatchedByRegex):(NSString *)regex range:(NSRange)range;
|
||||
- (NSArray *)RKL_METHOD_PREPEND(captureComponentsMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error;
|
||||
|
||||
- (NSArray *)RKL_METHOD_PREPEND(arrayOfCaptureComponentsMatchedByRegex):(NSString *)regex;
|
||||
- (NSArray *)RKL_METHOD_PREPEND(arrayOfCaptureComponentsMatchedByRegex):(NSString *)regex range:(NSRange)range;
|
||||
- (NSArray *)RKL_METHOD_PREPEND(arrayOfCaptureComponentsMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error;
|
||||
|
||||
//// >= 4.0
|
||||
|
||||
- (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION;
|
||||
- (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex range:(NSRange)range withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION;
|
||||
- (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION;
|
||||
- (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withFirstKey:(id)firstKey arguments:(va_list)varArgsList;
|
||||
|
||||
- (NSArray *)RKL_METHOD_PREPEND(arrayOfDictionariesByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withKeys:(id *)keys forCaptures:(int *)captures count:(NSUInteger)count;
|
||||
|
||||
- (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION;
|
||||
- (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex range:(NSRange)range withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION;
|
||||
- (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withKeysAndCaptures:(id)firstKey, ... RKL_REQUIRES_NIL_TERMINATION;
|
||||
- (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withFirstKey:(id)firstKey arguments:(va_list)varArgsList;
|
||||
|
||||
- (NSDictionary *)RKL_METHOD_PREPEND(dictionaryByMatchingRegex):(NSString *)regex options:(RKLRegexOptions)options range:(NSRange)range error:(NSError **)error withKeys:(id *)keys forCaptures:(int *)captures count:(NSUInteger)count;
|
||||
|
||||
#ifdef _RKL_BLOCKS_ENABLED
|
||||
|
||||
- (BOOL)RKL_METHOD_PREPEND(enumerateStringsMatchedByRegex):(NSString *)regex usingBlock:(void (^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block;
|
||||
- (BOOL)RKL_METHOD_PREPEND(enumerateStringsMatchedByRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error enumerationOptions:(RKLRegexEnumerationOptions)enumerationOptions usingBlock:(void (^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block;
|
||||
|
||||
- (BOOL)RKL_METHOD_PREPEND(enumerateStringsSeparatedByRegex):(NSString *)regex usingBlock:(void (^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block;
|
||||
- (BOOL)RKL_METHOD_PREPEND(enumerateStringsSeparatedByRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error enumerationOptions:(RKLRegexEnumerationOptions)enumerationOptions usingBlock:(void (^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block;
|
||||
|
||||
- (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex usingBlock:(NSString *(^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block;
|
||||
- (NSString *)RKL_METHOD_PREPEND(stringByReplacingOccurrencesOfRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error enumerationOptions:(RKLRegexEnumerationOptions)enumerationOptions usingBlock:(NSString *(^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block;
|
||||
|
||||
#endif // _RKL_BLOCKS_ENABLED
|
||||
|
||||
@end
|
||||
|
||||
@interface NSMutableString (RegexKitLiteAdditions)
|
||||
|
||||
- (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement;
|
||||
- (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement range:(NSRange)searchRange;
|
||||
- (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex withString:(NSString *)replacement options:(RKLRegexOptions)options range:(NSRange)searchRange error:(NSError **)error;
|
||||
|
||||
//// >= 4.0
|
||||
|
||||
#ifdef _RKL_BLOCKS_ENABLED
|
||||
|
||||
- (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex usingBlock:(NSString *(^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block;
|
||||
- (NSInteger)RKL_METHOD_PREPEND(replaceOccurrencesOfRegex):(NSString *)regex options:(RKLRegexOptions)options inRange:(NSRange)range error:(NSError **)error enumerationOptions:(RKLRegexEnumerationOptions)enumerationOptions usingBlock:(NSString *(^)(NSInteger captureCount, NSString * const capturedStrings[captureCount], const NSRange capturedRanges[captureCount], volatile BOOL * const stop))block;
|
||||
|
||||
#endif // _RKL_BLOCKS_ENABLED
|
||||
|
||||
@end
|
||||
|
||||
#endif // __OBJC__
|
||||
|
||||
#endif // _REGEXKITLITE_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
+7
-13
@@ -1,7 +1,7 @@
|
||||
# Makefile for Vim on Win32 (Windows NT/2000/XP/2003 and Windows 95/98/Me)
|
||||
# and Win64, using the Microsoft Visual C++ compilers. Known to work with
|
||||
# VC5, VC6 (VS98), VC7.0 (VS2002), VC7.1 (VS2003), VC8 (VS2005),
|
||||
# VC9 (VS2008), VC10 (VS2010) and VC11 (VS2012)
|
||||
# Makefile for Vim on Win32 (Windows XP/2003/Vista/7/8/10) and Win64,
|
||||
# using the Microsoft Visual C++ compilers. Known to work with VC5, VC6 (VS98),
|
||||
# VC7.0 (VS2002), VC7.1 (VS2003), VC8 (VS2005), VC9 (VS2008), VC10 (VS2010),
|
||||
# VC11 (VS2012), VC12 (VS2013) and VC14 (VS2015)
|
||||
#
|
||||
# To build using other Windows compilers, see INSTALLpc.txt
|
||||
#
|
||||
@@ -119,7 +119,7 @@
|
||||
# yes: Write a normal mapfile.
|
||||
# lines: Write a mapfile with line numbers (only for VC6 and later)
|
||||
#
|
||||
# Static Code Analysis: ANALYZE=yes (works with VS2012 only)
|
||||
# Static Code Analysis: ANALYZE=yes (works with VS2012 or later)
|
||||
#
|
||||
# You can combine any of these interfaces
|
||||
#
|
||||
@@ -162,9 +162,9 @@
|
||||
# you can set DEFINES on the command line, e.g.,
|
||||
# nmake -f Make_mvc.mvc "DEFINES=-DEMACS_TAGS"
|
||||
|
||||
# Build on both Windows NT/XP and Windows 9x
|
||||
# Build on Windows NT/XP
|
||||
|
||||
TARGETOS = BOTH
|
||||
TARGETOS = WINNT
|
||||
|
||||
# Select one of eight object code directories, depends on GUI, OLE, DEBUG and
|
||||
# interfaces.
|
||||
@@ -436,13 +436,7 @@ CFLAGS = -c /W3 /nologo $(CVARS) -I. -Iproto -DHAVE_PATHDEF -DWIN32 \
|
||||
#>>>>> end of choices
|
||||
###########################################################################
|
||||
|
||||
!ifdef OS
|
||||
OS_TYPE = winnt
|
||||
DEL_TREE = rmdir /s /q
|
||||
!else
|
||||
OS_TYPE = win95
|
||||
DEL_TREE = deltree /y
|
||||
!endif
|
||||
|
||||
INTDIR=$(OBJDIR)
|
||||
OUTDIR=$(OBJDIR)
|
||||
|
||||
+2
-1
@@ -2064,7 +2064,7 @@ test1 \
|
||||
test40 test41 test42 test43 test44 test45 test48 test49 \
|
||||
test50 test51 test52 test53 test54 test55 test56 test57 test58 test59 \
|
||||
test60 test64 test65 test66 test67 test68 test69 \
|
||||
test70 test72 test73 test74 test75 test76 test77 test78 test79 \
|
||||
test70 test72 test73 test74 test75 test77 test78 test79 \
|
||||
test80 test82 test83 test84 test85 test86 test87 test88 test89 \
|
||||
test90 test91 test92 test93 test94 test95 test97 test98 test99 \
|
||||
test100 test101 test103 test104 test107 test108:
|
||||
@@ -2098,6 +2098,7 @@ test_arglist \
|
||||
test_farsi \
|
||||
test_feedkeys \
|
||||
test_file_perm \
|
||||
test_fileformat \
|
||||
test_filter_cmd \
|
||||
test_filter_map \
|
||||
test_fnameescape \
|
||||
|
||||
Vendored
+1
-1
@@ -12122,7 +12122,7 @@ for ac_func in bcmp fchdir fchown fsync getcwd getpseudotty \
|
||||
getpwent getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \
|
||||
memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \
|
||||
setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
|
||||
sigvec strcasecmp strerror strftime stricmp strncasecmp \
|
||||
sigprocmask sigvec strcasecmp strerror strftime stricmp strncasecmp \
|
||||
strnicmp strpbrk strtol tgetent towlower towupper iswupper \
|
||||
usleep utime utimes
|
||||
do :
|
||||
|
||||
+198
-166
@@ -55,7 +55,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef FEAT_GUI_MACVIM
|
||||
static void channel_read(channel_T *channel, int part, char *func);
|
||||
static void channel_read(channel_T *channel, ch_part_T part, char *func);
|
||||
#endif
|
||||
|
||||
/* Whether a redraw is needed for appending a line to a buffer. */
|
||||
@@ -311,7 +311,7 @@ static int next_ch_id = 0;
|
||||
channel_T *
|
||||
add_channel(void)
|
||||
{
|
||||
int part;
|
||||
ch_part_T part;
|
||||
channel_T *channel = (channel_T *)alloc_clear((int)sizeof(channel_T));
|
||||
|
||||
if (channel == NULL)
|
||||
@@ -320,7 +320,7 @@ add_channel(void)
|
||||
channel->ch_id = next_ch_id++;
|
||||
ch_log(channel, "Created channel");
|
||||
|
||||
for (part = PART_SOCK; part <= PART_IN; ++part)
|
||||
for (part = PART_SOCK; part < PART_COUNT; ++part)
|
||||
{
|
||||
channel->ch_part[part].ch_fd = INVALID_FD;
|
||||
#ifdef FEAT_GUI_X11
|
||||
@@ -426,9 +426,7 @@ channel_free(channel_T *channel)
|
||||
if (!in_free_unref_items)
|
||||
{
|
||||
if (safe_to_invoke_callback == 0)
|
||||
{
|
||||
channel->ch_to_be_freed = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
channel_free_contents(channel);
|
||||
@@ -516,7 +514,7 @@ free_unused_channels(int copyID, int mask)
|
||||
channel_read_fd(int fd)
|
||||
{
|
||||
channel_T *channel;
|
||||
int part;
|
||||
ch_part_T part;
|
||||
|
||||
channel = channel_fd2channel(fd, &part);
|
||||
if (channel == NULL)
|
||||
@@ -562,7 +560,7 @@ messageFromServer(gpointer clientData,
|
||||
#endif
|
||||
|
||||
static void
|
||||
channel_gui_register_one(channel_T *channel, int part)
|
||||
channel_gui_register_one(channel_T *channel, ch_part_T part)
|
||||
{
|
||||
if (!CH_HAS_GUI)
|
||||
return;
|
||||
@@ -640,7 +638,7 @@ channel_gui_register_all(void)
|
||||
}
|
||||
|
||||
static void
|
||||
channel_gui_unregister_one(channel_T *channel, int part)
|
||||
channel_gui_unregister_one(channel_T *channel, ch_part_T part)
|
||||
{
|
||||
# ifdef FEAT_GUI_X11
|
||||
if (channel->ch_part[part].ch_inputHandler != (XtInputId)NULL)
|
||||
@@ -674,7 +672,7 @@ channel_gui_unregister_one(channel_T *channel, int part)
|
||||
static void
|
||||
channel_gui_unregister(channel_T *channel)
|
||||
{
|
||||
int part;
|
||||
ch_part_T part;
|
||||
|
||||
for (part = PART_SOCK; part < PART_IN; ++part)
|
||||
channel_gui_unregister_one(channel, part);
|
||||
@@ -949,6 +947,7 @@ channel_open(
|
||||
channel->ch_nb_close_cb = nb_close_cb;
|
||||
channel->ch_hostname = (char *)vim_strsave((char_u *)hostname);
|
||||
channel->ch_port = port_in;
|
||||
channel->ch_to_be_closed |= (1 << PART_SOCK);
|
||||
|
||||
#ifdef FEAT_GUI
|
||||
channel_gui_register_one(channel, PART_SOCK);
|
||||
@@ -1019,12 +1018,19 @@ theend:
|
||||
}
|
||||
|
||||
static void
|
||||
may_close_part(sock_T *fd)
|
||||
ch_close_part(channel_T *channel, ch_part_T part)
|
||||
{
|
||||
sock_T *fd = &channel->ch_part[part].ch_fd;
|
||||
|
||||
if (*fd != INVALID_FD)
|
||||
{
|
||||
fd_close(*fd);
|
||||
if (part == PART_SOCK)
|
||||
sock_close(*fd);
|
||||
else
|
||||
fd_close(*fd);
|
||||
*fd = INVALID_FD;
|
||||
|
||||
channel->ch_to_be_closed &= ~(1 << part);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1033,7 +1039,7 @@ channel_set_pipes(channel_T *channel, sock_T in, sock_T out, sock_T err)
|
||||
{
|
||||
if (in != INVALID_FD)
|
||||
{
|
||||
may_close_part(&channel->CH_IN_FD);
|
||||
ch_close_part(channel, PART_IN);
|
||||
channel->CH_IN_FD = in;
|
||||
}
|
||||
if (out != INVALID_FD)
|
||||
@@ -1041,8 +1047,9 @@ channel_set_pipes(channel_T *channel, sock_T in, sock_T out, sock_T err)
|
||||
# if defined(FEAT_GUI)
|
||||
channel_gui_unregister_one(channel, PART_OUT);
|
||||
# endif
|
||||
may_close_part(&channel->CH_OUT_FD);
|
||||
ch_close_part(channel, PART_OUT);
|
||||
channel->CH_OUT_FD = out;
|
||||
channel->ch_to_be_closed |= (1 << PART_OUT);
|
||||
# if defined(FEAT_GUI)
|
||||
channel_gui_register_one(channel, PART_OUT);
|
||||
# endif
|
||||
@@ -1052,8 +1059,9 @@ channel_set_pipes(channel_T *channel, sock_T in, sock_T out, sock_T err)
|
||||
# if defined(FEAT_GUI)
|
||||
channel_gui_unregister_one(channel, PART_ERR);
|
||||
# endif
|
||||
may_close_part(&channel->CH_ERR_FD);
|
||||
ch_close_part(channel, PART_ERR);
|
||||
channel->CH_ERR_FD = err;
|
||||
channel->ch_to_be_closed |= (1 << PART_ERR);
|
||||
# if defined(FEAT_GUI)
|
||||
channel_gui_register_one(channel, PART_ERR);
|
||||
# endif
|
||||
@@ -1172,10 +1180,10 @@ set_callback(
|
||||
void
|
||||
channel_set_options(channel_T *channel, jobopt_T *opt)
|
||||
{
|
||||
int part;
|
||||
ch_part_T part;
|
||||
|
||||
if (opt->jo_set & JO_MODE)
|
||||
for (part = PART_SOCK; part <= PART_IN; ++part)
|
||||
for (part = PART_SOCK; part < PART_COUNT; ++part)
|
||||
channel->ch_part[part].ch_mode = opt->jo_mode;
|
||||
if (opt->jo_set & JO_IN_MODE)
|
||||
channel->ch_part[PART_IN].ch_mode = opt->jo_in_mode;
|
||||
@@ -1185,7 +1193,7 @@ channel_set_options(channel_T *channel, jobopt_T *opt)
|
||||
channel->ch_part[PART_ERR].ch_mode = opt->jo_err_mode;
|
||||
|
||||
if (opt->jo_set & JO_TIMEOUT)
|
||||
for (part = PART_SOCK; part <= PART_IN; ++part)
|
||||
for (part = PART_SOCK; part < PART_COUNT; ++part)
|
||||
channel->ch_part[part].ch_timeout = opt->jo_timeout;
|
||||
if (opt->jo_set & JO_OUT_TIMEOUT)
|
||||
channel->ch_part[PART_OUT].ch_timeout = opt->jo_out_timeout;
|
||||
@@ -1303,7 +1311,7 @@ channel_set_options(channel_T *channel, jobopt_T *opt)
|
||||
void
|
||||
channel_set_req_callback(
|
||||
channel_T *channel,
|
||||
int part,
|
||||
ch_part_T part,
|
||||
char_u *callback,
|
||||
partial_T *partial,
|
||||
int id)
|
||||
@@ -1469,7 +1477,7 @@ channel_write_in(channel_T *channel)
|
||||
ch_log(channel, "Finished writing all lines to channel");
|
||||
|
||||
/* Close the pipe/socket, so that the other side gets EOF. */
|
||||
may_close_part(&channel->CH_IN_FD);
|
||||
ch_close_part(channel, PART_IN);
|
||||
}
|
||||
else
|
||||
ch_logn(channel, "Still %d more lines to write",
|
||||
@@ -1483,10 +1491,10 @@ channel_write_in(channel_T *channel)
|
||||
channel_buffer_free(buf_T *buf)
|
||||
{
|
||||
channel_T *channel;
|
||||
int part;
|
||||
ch_part_T part;
|
||||
|
||||
for (channel = first_channel; channel != NULL; channel = channel->ch_next)
|
||||
for (part = PART_SOCK; part <= PART_IN; ++part)
|
||||
for (part = PART_SOCK; part < PART_COUNT; ++part)
|
||||
{
|
||||
chanpart_T *ch_part = &channel->ch_part[part];
|
||||
|
||||
@@ -1595,7 +1603,7 @@ invoke_callback(channel_T *channel, char_u *callback, partial_T *partial,
|
||||
* Returns NULL if there is nothing.
|
||||
*/
|
||||
readq_T *
|
||||
channel_peek(channel_T *channel, int part)
|
||||
channel_peek(channel_T *channel, ch_part_T part)
|
||||
{
|
||||
readq_T *head = &channel->ch_part[part].ch_head;
|
||||
|
||||
@@ -1625,7 +1633,7 @@ channel_first_nl(readq_T *node)
|
||||
* Returns NULL if there is nothing.
|
||||
*/
|
||||
char_u *
|
||||
channel_get(channel_T *channel, int part)
|
||||
channel_get(channel_T *channel, ch_part_T part)
|
||||
{
|
||||
readq_T *head = &channel->ch_part[part].ch_head;
|
||||
readq_T *node = head->rq_next;
|
||||
@@ -1649,7 +1657,7 @@ channel_get(channel_T *channel, int part)
|
||||
* Replaces NUL bytes with NL.
|
||||
*/
|
||||
static char_u *
|
||||
channel_get_all(channel_T *channel, int part)
|
||||
channel_get_all(channel_T *channel, ch_part_T part)
|
||||
{
|
||||
readq_T *head = &channel->ch_part[part].ch_head;
|
||||
readq_T *node = head->rq_next;
|
||||
@@ -1698,7 +1706,7 @@ channel_get_all(channel_T *channel, int part)
|
||||
* Caller must check these bytes are available.
|
||||
*/
|
||||
void
|
||||
channel_consume(channel_T *channel, int part, int len)
|
||||
channel_consume(channel_T *channel, ch_part_T part, int len)
|
||||
{
|
||||
readq_T *head = &channel->ch_part[part].ch_head;
|
||||
readq_T *node = head->rq_next;
|
||||
@@ -1714,7 +1722,7 @@ channel_consume(channel_T *channel, int part, int len)
|
||||
* When "want_nl" is TRUE collapse more buffers until a NL is found.
|
||||
*/
|
||||
int
|
||||
channel_collapse(channel_T *channel, int part, int want_nl)
|
||||
channel_collapse(channel_T *channel, ch_part_T part, int want_nl)
|
||||
{
|
||||
readq_T *head = &channel->ch_part[part].ch_head;
|
||||
readq_T *node = head->rq_next;
|
||||
@@ -1774,7 +1782,7 @@ channel_collapse(channel_T *channel, int part, int want_nl)
|
||||
* Returns OK or FAIL.
|
||||
*/
|
||||
static int
|
||||
channel_save(channel_T *channel, int part, char_u *buf, int len,
|
||||
channel_save(channel_T *channel, ch_part_T part, char_u *buf, int len,
|
||||
int prepend, char *lead)
|
||||
{
|
||||
readq_T *node;
|
||||
@@ -1849,7 +1857,7 @@ channel_save(channel_T *channel, int part, char_u *buf, int len,
|
||||
channel_fill(js_read_T *reader)
|
||||
{
|
||||
channel_T *channel = (channel_T *)reader->js_cookie;
|
||||
int part = reader->js_cookie_arg;
|
||||
ch_part_T part = reader->js_cookie_arg;
|
||||
char_u *next = channel_get(channel, part);
|
||||
int unused;
|
||||
int len;
|
||||
@@ -1887,7 +1895,7 @@ channel_fill(js_read_T *reader)
|
||||
* Return TRUE if there is more to read.
|
||||
*/
|
||||
static int
|
||||
channel_parse_json(channel_T *channel, int part)
|
||||
channel_parse_json(channel_T *channel, ch_part_T part)
|
||||
{
|
||||
js_read_T reader;
|
||||
typval_T listtv;
|
||||
@@ -2067,7 +2075,7 @@ remove_json_node(jsonq_T *head, jsonq_T *node)
|
||||
* Return FAIL otherwise.
|
||||
*/
|
||||
static int
|
||||
channel_get_json(channel_T *channel, int part, int id, typval_T **rettv)
|
||||
channel_get_json(channel_T *channel, ch_part_T part, int id, typval_T **rettv)
|
||||
{
|
||||
jsonq_T *head = &channel->ch_part[part].ch_json_head;
|
||||
jsonq_T *item = head->jq_next;
|
||||
@@ -2101,7 +2109,7 @@ channel_get_json(channel_T *channel, int part, int id, typval_T **rettv)
|
||||
* "argv[1]" etc. have further arguments, type is VAR_UNKNOWN if missing.
|
||||
*/
|
||||
static void
|
||||
channel_exe_cmd(channel_T *channel, int part, typval_T *argv)
|
||||
channel_exe_cmd(channel_T *channel, ch_part_T part, typval_T *argv)
|
||||
{
|
||||
char_u *cmd = argv[0].vval.v_string;
|
||||
char_u *arg;
|
||||
@@ -2258,7 +2266,7 @@ invoke_one_time_callback(
|
||||
}
|
||||
|
||||
static void
|
||||
append_to_buffer(buf_T *buffer, char_u *msg, channel_T *channel, int part)
|
||||
append_to_buffer(buf_T *buffer, char_u *msg, channel_T *channel, ch_part_T part)
|
||||
{
|
||||
buf_T *save_curbuf = curbuf;
|
||||
linenr_T lnum = buffer->b_ml.ml_line_count;
|
||||
@@ -2353,7 +2361,7 @@ append_to_buffer(buf_T *buffer, char_u *msg, channel_T *channel, int part)
|
||||
}
|
||||
|
||||
static void
|
||||
drop_messages(channel_T *channel, int part)
|
||||
drop_messages(channel_T *channel, ch_part_T part)
|
||||
{
|
||||
char_u *msg;
|
||||
|
||||
@@ -2370,14 +2378,15 @@ drop_messages(channel_T *channel, int part)
|
||||
* Return TRUE when a message was handled, there might be another one.
|
||||
*/
|
||||
static int
|
||||
may_invoke_callback(channel_T *channel, int part)
|
||||
may_invoke_callback(channel_T *channel, ch_part_T part)
|
||||
{
|
||||
char_u *msg = NULL;
|
||||
typval_T *listtv = NULL;
|
||||
typval_T argv[CH_JSON_MAX_ARGS];
|
||||
int seq_nr = -1;
|
||||
ch_mode_T ch_mode = channel->ch_part[part].ch_mode;
|
||||
cbq_T *cbhead = &channel->ch_part[part].ch_cb_head;
|
||||
chanpart_T *ch_part = &channel->ch_part[part];
|
||||
ch_mode_T ch_mode = ch_part->ch_mode;
|
||||
cbq_T *cbhead = &ch_part->ch_cb_head;
|
||||
cbq_T *cbitem;
|
||||
char_u *callback = NULL;
|
||||
partial_T *partial = NULL;
|
||||
@@ -2397,10 +2406,10 @@ may_invoke_callback(channel_T *channel, int part)
|
||||
callback = cbitem->cq_callback;
|
||||
partial = cbitem->cq_partial;
|
||||
}
|
||||
else if (channel->ch_part[part].ch_callback != NULL)
|
||||
else if (ch_part->ch_callback != NULL)
|
||||
{
|
||||
callback = channel->ch_part[part].ch_callback;
|
||||
partial = channel->ch_part[part].ch_partial;
|
||||
callback = ch_part->ch_callback;
|
||||
partial = ch_part->ch_partial;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -2408,11 +2417,11 @@ may_invoke_callback(channel_T *channel, int part)
|
||||
partial = channel->ch_partial;
|
||||
}
|
||||
|
||||
buffer = channel->ch_part[part].ch_bufref.br_buf;
|
||||
if (buffer != NULL && !bufref_valid(&channel->ch_part[part].ch_bufref))
|
||||
buffer = ch_part->ch_bufref.br_buf;
|
||||
if (buffer != NULL && !bufref_valid(&ch_part->ch_bufref))
|
||||
{
|
||||
/* buffer was wiped out */
|
||||
channel->ch_part[part].ch_bufref.br_buf = NULL;
|
||||
ch_part->ch_bufref.br_buf = NULL;
|
||||
buffer = NULL;
|
||||
}
|
||||
|
||||
@@ -2473,7 +2482,7 @@ may_invoke_callback(channel_T *channel, int part)
|
||||
|
||||
if (ch_mode == MODE_NL)
|
||||
{
|
||||
char_u *nl;
|
||||
char_u *nl = NULL;
|
||||
char_u *buf;
|
||||
readq_T *node;
|
||||
|
||||
@@ -2486,10 +2495,25 @@ may_invoke_callback(channel_T *channel, int part)
|
||||
if (nl != NULL)
|
||||
break;
|
||||
if (channel_collapse(channel, part, TRUE) == FAIL)
|
||||
{
|
||||
if (ch_part->ch_fd == INVALID_FD && node->rq_buflen > 0)
|
||||
break;
|
||||
return FALSE; /* incomplete message */
|
||||
}
|
||||
}
|
||||
buf = node->rq_buffer;
|
||||
|
||||
if (nl == NULL)
|
||||
{
|
||||
/* Flush remaining message that is missing a NL. */
|
||||
buf = vim_realloc(buf, node->rq_buflen + 1);
|
||||
if (buf == NULL)
|
||||
return FALSE;
|
||||
node->rq_buffer = buf;
|
||||
nl = buf + node->rq_buflen++;
|
||||
*nl = NUL;
|
||||
}
|
||||
|
||||
/* Convert NUL to NL, the internal representation. */
|
||||
for (p = buf; p < nl && p < buf + node->rq_buflen; ++p)
|
||||
if (*p == NUL)
|
||||
@@ -2601,7 +2625,7 @@ channel_is_open(channel_T *channel)
|
||||
* Return TRUE if "channel" has JSON or other typeahead.
|
||||
*/
|
||||
static int
|
||||
channel_has_readahead(channel_T *channel, int part)
|
||||
channel_has_readahead(channel_T *channel, ch_part_T part)
|
||||
{
|
||||
ch_mode_T ch_mode = channel->ch_part[part].ch_mode;
|
||||
|
||||
@@ -2622,7 +2646,7 @@ channel_has_readahead(channel_T *channel, int part)
|
||||
char *
|
||||
channel_status(channel_T *channel, int req_part)
|
||||
{
|
||||
int part;
|
||||
ch_part_T part;
|
||||
int has_readahead = FALSE;
|
||||
|
||||
if (channel == NULL)
|
||||
@@ -2645,7 +2669,7 @@ channel_status(channel_T *channel, int req_part)
|
||||
{
|
||||
if (channel_is_open(channel))
|
||||
return "open";
|
||||
for (part = PART_SOCK; part <= PART_ERR; ++part)
|
||||
for (part = PART_SOCK; part < PART_IN; ++part)
|
||||
if (channel_has_readahead(channel, part))
|
||||
{
|
||||
has_readahead = TRUE;
|
||||
@@ -2659,7 +2683,7 @@ channel_status(channel_T *channel, int req_part)
|
||||
}
|
||||
|
||||
static void
|
||||
channel_part_info(channel_T *channel, dict_T *dict, char *name, int part)
|
||||
channel_part_info(channel_T *channel, dict_T *dict, char *name, ch_part_T part)
|
||||
{
|
||||
chanpart_T *chanpart = &channel->ch_part[part];
|
||||
char namebuf[20]; /* longest is "sock_timeout" */
|
||||
@@ -2741,28 +2765,24 @@ channel_close(channel_T *channel, int invoke_close_cb)
|
||||
channel_gui_unregister(channel);
|
||||
#endif
|
||||
|
||||
if (channel->CH_SOCK_FD != INVALID_FD)
|
||||
{
|
||||
sock_close(channel->CH_SOCK_FD);
|
||||
channel->CH_SOCK_FD = INVALID_FD;
|
||||
}
|
||||
may_close_part(&channel->CH_IN_FD);
|
||||
may_close_part(&channel->CH_OUT_FD);
|
||||
may_close_part(&channel->CH_ERR_FD);
|
||||
ch_close_part(channel, PART_SOCK);
|
||||
ch_close_part(channel, PART_IN);
|
||||
ch_close_part(channel, PART_OUT);
|
||||
ch_close_part(channel, PART_ERR);
|
||||
|
||||
if (invoke_close_cb && channel->ch_close_cb != NULL)
|
||||
{
|
||||
typval_T argv[1];
|
||||
typval_T rettv;
|
||||
int dummy;
|
||||
int part;
|
||||
ch_part_T part;
|
||||
|
||||
/* Invoke callbacks before the close callback, since it's weird to
|
||||
* first invoke the close callback. Increment the refcount to avoid
|
||||
* the channel being freed halfway. */
|
||||
++channel->ch_refcount;
|
||||
ch_log(channel, "Invoking callbacks before closing");
|
||||
for (part = PART_SOCK; part <= PART_ERR; ++part)
|
||||
for (part = PART_SOCK; part < PART_IN; ++part)
|
||||
while (may_invoke_callback(channel, part))
|
||||
;
|
||||
|
||||
@@ -2794,7 +2814,7 @@ channel_close(channel_T *channel, int invoke_close_cb)
|
||||
}
|
||||
|
||||
/* any remaining messages are useless now */
|
||||
for (part = PART_SOCK; part <= PART_ERR; ++part)
|
||||
for (part = PART_SOCK; part < PART_IN; ++part)
|
||||
drop_messages(channel, part);
|
||||
}
|
||||
|
||||
@@ -2807,14 +2827,14 @@ channel_close(channel_T *channel, int invoke_close_cb)
|
||||
void
|
||||
channel_close_in(channel_T *channel)
|
||||
{
|
||||
may_close_part(&channel->CH_IN_FD);
|
||||
ch_close_part(channel, PART_IN);
|
||||
}
|
||||
|
||||
/*
|
||||
* Clear the read buffer on "channel"/"part".
|
||||
*/
|
||||
static void
|
||||
channel_clear_one(channel_T *channel, int part)
|
||||
channel_clear_one(channel_T *channel, ch_part_T part)
|
||||
{
|
||||
jsonq_T *json_head = &channel->ch_part[part].ch_json_head;
|
||||
cbq_T *cb_head = &channel->ch_part[part].ch_cb_head;
|
||||
@@ -3048,11 +3068,20 @@ channel_wait(channel_T *channel, sock_T fd, int timeout)
|
||||
}
|
||||
|
||||
static void
|
||||
channel_close_on_error(channel_T *channel, char *func)
|
||||
ch_close_part_on_error(
|
||||
channel_T *channel, ch_part_T part, int is_err, char *func)
|
||||
{
|
||||
/* Do not call emsg(), most likely the other end just exited. */
|
||||
ch_errors(channel, "%s(): Cannot read from channel, will close it soon",
|
||||
func);
|
||||
char msgbuf[80];
|
||||
|
||||
vim_snprintf(msgbuf, sizeof(msgbuf),
|
||||
"%%s(): Read %s from ch_part[%d], closing",
|
||||
(is_err ? "error" : "EOF"), part);
|
||||
|
||||
if (is_err)
|
||||
/* Do not call emsg(), most likely the other end just exited. */
|
||||
ch_errors(channel, msgbuf, func);
|
||||
else
|
||||
ch_logs(channel, msgbuf, func);
|
||||
|
||||
/* Queue a "DETACH" netbeans message in the command queue in order to
|
||||
* terminate the netbeans session later. Do not end the session here
|
||||
@@ -3066,24 +3095,23 @@ channel_close_on_error(channel_T *channel, char *func)
|
||||
* Only send "DETACH" for a netbeans channel.
|
||||
*/
|
||||
if (channel->ch_nb_close_cb != NULL)
|
||||
channel_save(channel, PART_OUT, (char_u *)DETACH_MSG_RAW,
|
||||
channel_save(channel, PART_SOCK, (char_u *)DETACH_MSG_RAW,
|
||||
(int)STRLEN(DETACH_MSG_RAW), FALSE, "PUT ");
|
||||
|
||||
/* When reading from stdout is not possible, assume the other side has
|
||||
* died. Don't close the channel right away, it may be the wrong moment
|
||||
* to invoke callbacks. */
|
||||
channel->ch_to_be_closed = TRUE;
|
||||
/* When reading is not possible close this part of the channel. Don't
|
||||
* close the channel yet, there may be something to read on another part. */
|
||||
ch_close_part(channel, part);
|
||||
|
||||
#ifdef FEAT_GUI
|
||||
/* Stop listening to GUI events right away. */
|
||||
channel_gui_unregister(channel);
|
||||
channel_gui_unregister_one(channel, part);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
channel_close_now(channel_T *channel)
|
||||
{
|
||||
ch_log(channel, "Closing channel because of previous read error");
|
||||
ch_log(channel, "Closing channel because all readable fds are closed");
|
||||
channel_close(channel, TRUE);
|
||||
if (channel->ch_nb_close_cb != NULL)
|
||||
(*channel->ch_nb_close_cb)();
|
||||
@@ -3099,7 +3127,7 @@ channel_close_now(channel_T *channel)
|
||||
#else
|
||||
void
|
||||
#endif
|
||||
channel_read(channel_T *channel, int part, char *func)
|
||||
channel_read(channel_T *channel, ch_part_T part, char *func)
|
||||
{
|
||||
static char_u *buf = NULL;
|
||||
int len = 0;
|
||||
@@ -3107,14 +3135,11 @@ channel_read(channel_T *channel, int part, char *func)
|
||||
sock_T fd;
|
||||
int use_socket = FALSE;
|
||||
|
||||
/* If we detected a read error don't try reading again. */
|
||||
if (channel->ch_to_be_closed)
|
||||
return;
|
||||
|
||||
fd = channel->ch_part[part].ch_fd;
|
||||
if (fd == INVALID_FD)
|
||||
{
|
||||
ch_error(channel, "channel_read() called while socket is closed");
|
||||
ch_errors(channel, "channel_read() called while %s part is closed",
|
||||
part_names[part]);
|
||||
return;
|
||||
}
|
||||
use_socket = fd == channel->CH_SOCK_FD;
|
||||
@@ -3150,7 +3175,7 @@ channel_read(channel_T *channel, int part, char *func)
|
||||
|
||||
/* Reading a disconnection (readlen == 0), or an error. */
|
||||
if (readlen <= 0)
|
||||
channel_close_on_error(channel, func);
|
||||
ch_close_part_on_error(channel, part, (len < 0), func);
|
||||
|
||||
#if defined(CH_HAS_GUI) && defined(FEAT_GUI_GTK)
|
||||
/* signal the main loop that there is something to read */
|
||||
@@ -3166,7 +3191,7 @@ channel_read(channel_T *channel, int part, char *func)
|
||||
* Returns NULL in case of error or timeout.
|
||||
*/
|
||||
char_u *
|
||||
channel_read_block(channel_T *channel, int part, int timeout)
|
||||
channel_read_block(channel_T *channel, ch_part_T part, int timeout)
|
||||
{
|
||||
char_u *buf;
|
||||
char_u *msg;
|
||||
@@ -3246,7 +3271,7 @@ channel_read_block(channel_T *channel, int part, int timeout)
|
||||
int
|
||||
channel_read_json_block(
|
||||
channel_T *channel,
|
||||
int part,
|
||||
ch_part_T part,
|
||||
int timeout_arg,
|
||||
int id,
|
||||
typval_T **rettv)
|
||||
@@ -3332,7 +3357,7 @@ channel_read_json_block(
|
||||
common_channel_read(typval_T *argvars, typval_T *rettv, int raw)
|
||||
{
|
||||
channel_T *channel;
|
||||
int part = -1;
|
||||
ch_part_T part = PART_COUNT;
|
||||
jobopt_T opt;
|
||||
int mode;
|
||||
int timeout;
|
||||
@@ -3353,7 +3378,7 @@ common_channel_read(typval_T *argvars, typval_T *rettv, int raw)
|
||||
channel = get_channel_arg(&argvars[0], TRUE, TRUE, part);
|
||||
if (channel != NULL)
|
||||
{
|
||||
if (part < 0)
|
||||
if (part == PART_COUNT)
|
||||
part = channel_part_read(channel);
|
||||
mode = channel_get_mode(channel, part);
|
||||
timeout = channel_get_timeout(channel, part);
|
||||
@@ -3391,10 +3416,10 @@ theend:
|
||||
* Returns NULL when the socket isn't found.
|
||||
*/
|
||||
channel_T *
|
||||
channel_fd2channel(sock_T fd, int *partp)
|
||||
channel_fd2channel(sock_T fd, ch_part_T *partp)
|
||||
{
|
||||
channel_T *channel;
|
||||
int part;
|
||||
ch_part_T part;
|
||||
|
||||
if (fd != INVALID_FD)
|
||||
for (channel = first_channel; channel != NULL;
|
||||
@@ -3420,17 +3445,13 @@ channel_fd2channel(sock_T fd, int *partp)
|
||||
channel_handle_events(void)
|
||||
{
|
||||
channel_T *channel;
|
||||
int part;
|
||||
ch_part_T part;
|
||||
sock_T fd;
|
||||
|
||||
for (channel = first_channel; channel != NULL; channel = channel->ch_next)
|
||||
{
|
||||
/* If we detected a read error don't try reading again. */
|
||||
if (channel->ch_to_be_closed)
|
||||
continue;
|
||||
|
||||
/* check the socket and pipes */
|
||||
for (part = PART_SOCK; part <= PART_ERR; ++part)
|
||||
for (part = PART_SOCK; part < PART_IN; ++part)
|
||||
{
|
||||
fd = channel->ch_part[part].ch_fd;
|
||||
if (fd != INVALID_FD)
|
||||
@@ -3440,7 +3461,8 @@ channel_handle_events(void)
|
||||
if (r == CW_READY)
|
||||
channel_read(channel, part, "channel_handle_events");
|
||||
else if (r == CW_ERROR)
|
||||
channel_close_on_error(channel, "channel_handle_events()");
|
||||
ch_close_part_on_error(channel, part, TRUE,
|
||||
"channel_handle_events");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3453,7 +3475,7 @@ channel_handle_events(void)
|
||||
* Return FAIL or OK.
|
||||
*/
|
||||
int
|
||||
channel_send(channel_T *channel, int part, char_u *buf, int len, char *fun)
|
||||
channel_send(channel_T *channel, ch_part_T part, char_u *buf, int len, char *fun)
|
||||
{
|
||||
int res;
|
||||
sock_T fd;
|
||||
@@ -3505,7 +3527,7 @@ channel_send(channel_T *channel, int part, char_u *buf, int len, char *fun)
|
||||
* Sets "part_read" to the read fd.
|
||||
* Otherwise returns NULL.
|
||||
*/
|
||||
channel_T *
|
||||
static channel_T *
|
||||
send_common(
|
||||
typval_T *argvars,
|
||||
char_u *text,
|
||||
@@ -3513,10 +3535,10 @@ send_common(
|
||||
int eval,
|
||||
jobopt_T *opt,
|
||||
char *fun,
|
||||
int *part_read)
|
||||
ch_part_T *part_read)
|
||||
{
|
||||
channel_T *channel;
|
||||
int part_send;
|
||||
ch_part_T part_send;
|
||||
|
||||
clear_job_options(opt);
|
||||
channel = get_channel_arg(&argvars[0], TRUE, FALSE, 0);
|
||||
@@ -3559,8 +3581,8 @@ ch_expr_common(typval_T *argvars, typval_T *rettv, int eval)
|
||||
channel_T *channel;
|
||||
int id;
|
||||
ch_mode_T ch_mode;
|
||||
int part_send;
|
||||
int part_read;
|
||||
ch_part_T part_send;
|
||||
ch_part_T part_read;
|
||||
jobopt_T opt;
|
||||
int timeout;
|
||||
|
||||
@@ -3619,7 +3641,7 @@ ch_raw_common(typval_T *argvars, typval_T *rettv, int eval)
|
||||
char_u buf[NUMBUFLEN];
|
||||
char_u *text;
|
||||
channel_T *channel;
|
||||
int part_read;
|
||||
ch_part_T part_read;
|
||||
jobopt_T opt;
|
||||
int timeout;
|
||||
|
||||
@@ -3653,7 +3675,7 @@ channel_poll_setup(int nfd_in, void *fds_in)
|
||||
int nfd = nfd_in;
|
||||
channel_T *channel;
|
||||
struct pollfd *fds = fds_in;
|
||||
int part;
|
||||
ch_part_T part;
|
||||
|
||||
for (channel = first_channel; channel != NULL; channel = channel->ch_next)
|
||||
{
|
||||
@@ -3687,7 +3709,7 @@ channel_poll_check(int ret_in, void *fds_in)
|
||||
int ret = ret_in;
|
||||
channel_T *channel;
|
||||
struct pollfd *fds = fds_in;
|
||||
int part;
|
||||
ch_part_T part;
|
||||
int idx;
|
||||
chanpart_T *in_part;
|
||||
|
||||
@@ -3734,7 +3756,7 @@ channel_select_setup(int maxfd_in, void *rfds_in, void *wfds_in)
|
||||
channel_T *channel;
|
||||
fd_set *rfds = rfds_in;
|
||||
fd_set *wfds = wfds_in;
|
||||
int part;
|
||||
ch_part_T part;
|
||||
|
||||
for (channel = first_channel; channel != NULL; channel = channel->ch_next)
|
||||
{
|
||||
@@ -3766,7 +3788,7 @@ channel_select_check(int ret_in, void *rfds_in, void *wfds_in)
|
||||
channel_T *channel;
|
||||
fd_set *rfds = rfds_in;
|
||||
fd_set *wfds = wfds_in;
|
||||
int part;
|
||||
ch_part_T part;
|
||||
chanpart_T *in_part;
|
||||
|
||||
for (channel = first_channel; channel != NULL; channel = channel->ch_next)
|
||||
@@ -3812,7 +3834,7 @@ channel_parse_messages(void)
|
||||
channel_T *channel = first_channel;
|
||||
int ret = FALSE;
|
||||
int r;
|
||||
int part = PART_SOCK;
|
||||
ch_part_T part = PART_SOCK;
|
||||
|
||||
++safe_to_invoke_callback;
|
||||
|
||||
@@ -3825,9 +3847,9 @@ channel_parse_messages(void)
|
||||
}
|
||||
while (channel != NULL)
|
||||
{
|
||||
if (channel->ch_to_be_closed)
|
||||
if (channel->ch_to_be_closed == 0)
|
||||
{
|
||||
channel->ch_to_be_closed = FALSE;
|
||||
channel->ch_to_be_closed = (1 << PART_COUNT);
|
||||
channel_close_now(channel);
|
||||
/* channel may have been freed, start over */
|
||||
channel = first_channel;
|
||||
@@ -3849,7 +3871,7 @@ channel_parse_messages(void)
|
||||
continue;
|
||||
}
|
||||
if (channel->ch_part[part].ch_fd != INVALID_FD
|
||||
|| channel_has_readahead(channel, part))
|
||||
|| channel_has_readahead(channel, part))
|
||||
{
|
||||
/* Increase the refcount, in case the handler causes the channel
|
||||
* to be unreferenced or closed. */
|
||||
@@ -3908,7 +3930,7 @@ set_ref_in_channel(int copyID)
|
||||
/*
|
||||
* Return the "part" to write to for "channel".
|
||||
*/
|
||||
int
|
||||
ch_part_T
|
||||
channel_part_send(channel_T *channel)
|
||||
{
|
||||
if (channel->CH_SOCK_FD == INVALID_FD)
|
||||
@@ -3919,7 +3941,7 @@ channel_part_send(channel_T *channel)
|
||||
/*
|
||||
* Return the default "part" to read from for "channel".
|
||||
*/
|
||||
int
|
||||
ch_part_T
|
||||
channel_part_read(channel_T *channel)
|
||||
{
|
||||
if (channel->CH_SOCK_FD == INVALID_FD)
|
||||
@@ -3932,7 +3954,7 @@ channel_part_read(channel_T *channel)
|
||||
* If "channel" is invalid returns MODE_JSON.
|
||||
*/
|
||||
ch_mode_T
|
||||
channel_get_mode(channel_T *channel, int part)
|
||||
channel_get_mode(channel_T *channel, ch_part_T part)
|
||||
{
|
||||
if (channel == NULL)
|
||||
return MODE_JSON;
|
||||
@@ -3943,7 +3965,7 @@ channel_get_mode(channel_T *channel, int part)
|
||||
* Return the timeout of "channel"/"part"
|
||||
*/
|
||||
int
|
||||
channel_get_timeout(channel_T *channel, int part)
|
||||
channel_get_timeout(channel_T *channel, ch_part_T part)
|
||||
{
|
||||
return channel->ch_part[part].ch_timeout;
|
||||
}
|
||||
@@ -3971,7 +3993,7 @@ handle_mode(typval_T *item, jobopt_T *opt, ch_mode_T *modep, int jo)
|
||||
}
|
||||
|
||||
static int
|
||||
handle_io(typval_T *item, int part, jobopt_T *opt)
|
||||
handle_io(typval_T *item, ch_part_T part, jobopt_T *opt)
|
||||
{
|
||||
char_u *val = get_tv_string(item);
|
||||
|
||||
@@ -4054,7 +4076,7 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported)
|
||||
dict_T *dict;
|
||||
int todo;
|
||||
hashitem_T *hi;
|
||||
int part;
|
||||
ch_part_T part;
|
||||
|
||||
opt->jo_set = 0;
|
||||
if (tv->v_type == VAR_UNKNOWN)
|
||||
@@ -4352,10 +4374,10 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported)
|
||||
* Returns NULL if the handle is invalid.
|
||||
* When "check_open" is TRUE check that the channel can be used.
|
||||
* When "reading" is TRUE "check_open" considers typeahead useful.
|
||||
* "part" is used to check typeahead, when -1 use the default part.
|
||||
* "part" is used to check typeahead, when PART_COUNT use the default part.
|
||||
*/
|
||||
channel_T *
|
||||
get_channel_arg(typval_T *tv, int check_open, int reading, int part)
|
||||
get_channel_arg(typval_T *tv, int check_open, int reading, ch_part_T part)
|
||||
{
|
||||
channel_T *channel = NULL;
|
||||
int has_readahead = FALSE;
|
||||
@@ -4376,7 +4398,7 @@ get_channel_arg(typval_T *tv, int check_open, int reading, int part)
|
||||
}
|
||||
if (channel != NULL && reading)
|
||||
has_readahead = channel_has_readahead(channel,
|
||||
part >= 0 ? part : channel_part_read(channel));
|
||||
part != PART_COUNT ? part : channel_part_read(channel));
|
||||
|
||||
if (check_open && (channel == NULL || (!channel_is_open(channel)
|
||||
&& !(reading && has_readahead))))
|
||||
@@ -4431,6 +4453,39 @@ job_free(job_T *job)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
job_cleanup(job_T *job)
|
||||
{
|
||||
if (job->jv_status != JOB_ENDED)
|
||||
return;
|
||||
|
||||
if (job->jv_exit_cb != NULL)
|
||||
{
|
||||
typval_T argv[3];
|
||||
typval_T rettv;
|
||||
int dummy;
|
||||
|
||||
/* invoke the exit callback; make sure the refcount is > 0 */
|
||||
++job->jv_refcount;
|
||||
argv[0].v_type = VAR_JOB;
|
||||
argv[0].vval.v_job = job;
|
||||
argv[1].v_type = VAR_NUMBER;
|
||||
argv[1].vval.v_number = job->jv_exitval;
|
||||
call_func(job->jv_exit_cb, (int)STRLEN(job->jv_exit_cb),
|
||||
&rettv, 2, argv, NULL, 0L, 0L, &dummy, TRUE,
|
||||
job->jv_exit_partial, NULL);
|
||||
clear_tv(&rettv);
|
||||
--job->jv_refcount;
|
||||
channel_need_redraw = TRUE;
|
||||
}
|
||||
if (job->jv_refcount == 0)
|
||||
{
|
||||
/* The job was already unreferenced, now that it ended it can be
|
||||
* freed. Careful: caller must not use "job" after this! */
|
||||
job_free(job);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(EXITFREE) || defined(PROTO)
|
||||
void
|
||||
job_free_all(void)
|
||||
@@ -4448,10 +4503,15 @@ job_free_all(void)
|
||||
static int
|
||||
job_still_useful(job_T *job)
|
||||
{
|
||||
return job->jv_status == JOB_STARTED
|
||||
&& (job->jv_stoponexit != NULL || job->jv_exit_cb != NULL
|
||||
|| (job->jv_channel != NULL
|
||||
&& channel_still_useful(job->jv_channel)));
|
||||
return (job->jv_stoponexit != NULL || job->jv_exit_cb != NULL
|
||||
|| (job->jv_channel != NULL
|
||||
&& channel_still_useful(job->jv_channel)));
|
||||
}
|
||||
|
||||
static int
|
||||
job_still_alive(job_T *job)
|
||||
{
|
||||
return (job->jv_status == JOB_STARTED) && job_still_useful(job);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -4465,7 +4525,7 @@ set_ref_in_job(int copyID)
|
||||
typval_T tv;
|
||||
|
||||
for (job = first_job; job != NULL; job = job->jv_next)
|
||||
if (job_still_useful(job))
|
||||
if (job_still_alive(job))
|
||||
{
|
||||
tv.v_type = VAR_JOB;
|
||||
tv.vval.v_job = job;
|
||||
@@ -4481,7 +4541,7 @@ job_unref(job_T *job)
|
||||
{
|
||||
/* Do not free the job when it has not ended yet and there is a
|
||||
* "stoponexit" flag or an exit callback. */
|
||||
if (!job_still_useful(job))
|
||||
if (!job_still_alive(job))
|
||||
{
|
||||
job_free(job);
|
||||
}
|
||||
@@ -4506,7 +4566,7 @@ free_unused_jobs_contents(int copyID, int mask)
|
||||
|
||||
for (job = first_job; job != NULL; job = job->jv_next)
|
||||
if ((job->jv_copyID & mask) != (copyID & mask)
|
||||
&& !job_still_useful(job))
|
||||
&& !job_still_alive(job))
|
||||
{
|
||||
/* Free the channel and ordinary items it contains, but don't
|
||||
* recurse into Lists, Dictionaries etc. */
|
||||
@@ -4526,7 +4586,7 @@ free_unused_jobs(int copyID, int mask)
|
||||
{
|
||||
job_next = job->jv_next;
|
||||
if ((job->jv_copyID & mask) != (copyID & mask)
|
||||
&& !job_still_useful(job))
|
||||
&& !job_still_alive(job))
|
||||
{
|
||||
/* Free the job struct itself. */
|
||||
job_free_job(job);
|
||||
@@ -4617,34 +4677,31 @@ has_pending_job(void)
|
||||
job_T *job;
|
||||
|
||||
for (job = first_job; job != NULL; job = job->jv_next)
|
||||
if (job->jv_status == JOB_STARTED && job_still_useful(job))
|
||||
if (job_still_alive(job))
|
||||
return TRUE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#define MAX_CHECK_ENDED 8
|
||||
|
||||
/*
|
||||
* Called once in a while: check if any jobs that seem useful have ended.
|
||||
*/
|
||||
void
|
||||
job_check_ended(void)
|
||||
{
|
||||
static time_t last_check = 0;
|
||||
time_t now;
|
||||
job_T *job;
|
||||
job_T *next;
|
||||
int i;
|
||||
|
||||
/* Only do this once in 10 seconds. */
|
||||
now = time(NULL);
|
||||
if (last_check + 10 < now)
|
||||
for (i = 0; i < MAX_CHECK_ENDED; ++i)
|
||||
{
|
||||
last_check = now;
|
||||
for (job = first_job; job != NULL; job = next)
|
||||
{
|
||||
next = job->jv_next;
|
||||
if (job->jv_status == JOB_STARTED && job_still_useful(job))
|
||||
job_status(job); /* may free "job" */
|
||||
}
|
||||
job_T *job = mch_detect_ended_job(first_job);
|
||||
|
||||
if (job == NULL)
|
||||
break;
|
||||
if (job_still_useful(job))
|
||||
job_cleanup(job); /* may free "job" */
|
||||
}
|
||||
|
||||
if (channel_need_redraw)
|
||||
{
|
||||
channel_need_redraw = FALSE;
|
||||
@@ -4668,7 +4725,7 @@ job_start(typval_T *argvars)
|
||||
garray_T ga;
|
||||
#endif
|
||||
jobopt_T opt;
|
||||
int part;
|
||||
ch_part_T part;
|
||||
|
||||
job = job_alloc();
|
||||
if (job == NULL)
|
||||
@@ -4688,7 +4745,7 @@ job_start(typval_T *argvars)
|
||||
goto theend;
|
||||
|
||||
/* Check that when io is "file" that there is a file name. */
|
||||
for (part = PART_OUT; part <= PART_IN; ++part)
|
||||
for (part = PART_OUT; part < PART_COUNT; ++part)
|
||||
if ((opt.jo_set & (JO_OUT_IO << (part - PART_OUT)))
|
||||
&& opt.jo_io[part] == JIO_FILE
|
||||
&& (!(opt.jo_set & (JO_OUT_NAME << (part - PART_OUT)))
|
||||
@@ -4865,32 +4922,7 @@ job_status(job_T *job)
|
||||
{
|
||||
result = mch_job_status(job);
|
||||
if (job->jv_status == JOB_ENDED)
|
||||
ch_log(job->jv_channel, "Job ended");
|
||||
if (job->jv_status == JOB_ENDED && job->jv_exit_cb != NULL)
|
||||
{
|
||||
typval_T argv[3];
|
||||
typval_T rettv;
|
||||
int dummy;
|
||||
|
||||
/* invoke the exit callback; make sure the refcount is > 0 */
|
||||
++job->jv_refcount;
|
||||
argv[0].v_type = VAR_JOB;
|
||||
argv[0].vval.v_job = job;
|
||||
argv[1].v_type = VAR_NUMBER;
|
||||
argv[1].vval.v_number = job->jv_exitval;
|
||||
call_func(job->jv_exit_cb, (int)STRLEN(job->jv_exit_cb),
|
||||
&rettv, 2, argv, NULL, 0L, 0L, &dummy, TRUE,
|
||||
job->jv_exit_partial, NULL);
|
||||
clear_tv(&rettv);
|
||||
--job->jv_refcount;
|
||||
channel_need_redraw = TRUE;
|
||||
}
|
||||
if (job->jv_status == JOB_ENDED && job->jv_refcount == 0)
|
||||
{
|
||||
/* The job was already unreferenced, now that it ended it can be
|
||||
* freed. Careful: caller must not use "job" after this! */
|
||||
job_free(job);
|
||||
}
|
||||
job_cleanup(job);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -190,6 +190,7 @@
|
||||
#undef HAVE_SIGSET
|
||||
#undef HAVE_SIGSETJMP
|
||||
#undef HAVE_SIGSTACK
|
||||
#undef HAVE_SIGPROCMASK
|
||||
#undef HAVE_SIGVEC
|
||||
#undef HAVE_SMACK
|
||||
#undef HAVE_STRCASECMP
|
||||
|
||||
+1
-1
@@ -3677,7 +3677,7 @@ AC_CHECK_FUNCS(bcmp fchdir fchown fsync getcwd getpseudotty \
|
||||
getpwent getpwnam getpwuid getrlimit gettimeofday getwd lstat memcmp \
|
||||
memset mkdtemp nanosleep opendir putenv qsort readlink select setenv \
|
||||
setpgid setsid sigaltstack sigstack sigset sigsetjmp sigaction \
|
||||
sigvec strcasecmp strerror strftime stricmp strncasecmp \
|
||||
sigprocmask sigvec strcasecmp strerror strftime stricmp strncasecmp \
|
||||
strnicmp strpbrk strtol tgetent towlower towupper iswupper \
|
||||
usleep utime utimes)
|
||||
AC_FUNC_FSEEKO
|
||||
|
||||
+32
-30
@@ -1100,10 +1100,7 @@ ex_diffsplit(exarg_T *eap)
|
||||
if (bufref_valid(&old_curbuf))
|
||||
/* Move the cursor position to that of the old window. */
|
||||
curwin->w_cursor.lnum = diff_get_corresponding_line(
|
||||
old_curbuf.br_buf,
|
||||
old_curwin->w_cursor.lnum,
|
||||
curbuf,
|
||||
curwin->w_cursor.lnum);
|
||||
old_curbuf.br_buf, old_curwin->w_cursor.lnum);
|
||||
}
|
||||
/* Now that lines are folded scroll to show the cursor at the same
|
||||
* relative position. */
|
||||
@@ -2524,21 +2521,22 @@ diff_move_to(int dir, long count)
|
||||
return OK;
|
||||
}
|
||||
|
||||
linenr_T
|
||||
diff_get_corresponding_line(
|
||||
/*
|
||||
* Return the line number in the current window that is closest to "lnum1" in
|
||||
* "buf1" in diff mode.
|
||||
*/
|
||||
static linenr_T
|
||||
diff_get_corresponding_line_int(
|
||||
buf_T *buf1,
|
||||
linenr_T lnum1,
|
||||
buf_T *buf2,
|
||||
linenr_T lnum3)
|
||||
linenr_T lnum1)
|
||||
{
|
||||
int idx1;
|
||||
int idx2;
|
||||
diff_T *dp;
|
||||
int baseline = 0;
|
||||
linenr_T lnum2;
|
||||
|
||||
idx1 = diff_buf_idx(buf1);
|
||||
idx2 = diff_buf_idx(buf2);
|
||||
idx2 = diff_buf_idx(curbuf);
|
||||
if (idx1 == DB_COUNT || idx2 == DB_COUNT || curtab->tp_first_diff == NULL)
|
||||
return lnum1;
|
||||
|
||||
@@ -2551,15 +2549,8 @@ diff_get_corresponding_line(
|
||||
for (dp = curtab->tp_first_diff; dp != NULL; dp = dp->df_next)
|
||||
{
|
||||
if (dp->df_lnum[idx1] > lnum1)
|
||||
{
|
||||
lnum2 = lnum1 - baseline;
|
||||
/* don't end up past the end of the file */
|
||||
if (lnum2 > buf2->b_ml.ml_line_count)
|
||||
lnum2 = buf2->b_ml.ml_line_count;
|
||||
|
||||
return lnum2;
|
||||
}
|
||||
else if ((dp->df_lnum[idx1] + dp->df_count[idx1]) > lnum1)
|
||||
return lnum1 - baseline;
|
||||
if ((dp->df_lnum[idx1] + dp->df_count[idx1]) > lnum1)
|
||||
{
|
||||
/* Inside the diffblock */
|
||||
baseline = lnum1 - dp->df_lnum[idx1];
|
||||
@@ -2568,10 +2559,11 @@ diff_get_corresponding_line(
|
||||
|
||||
return dp->df_lnum[idx2] + baseline;
|
||||
}
|
||||
else if ( (dp->df_lnum[idx1] == lnum1)
|
||||
&& (dp->df_count[idx1] == 0)
|
||||
&& (dp->df_lnum[idx2] <= lnum3)
|
||||
&& ((dp->df_lnum[idx2] + dp->df_count[idx2]) > lnum3))
|
||||
if ( (dp->df_lnum[idx1] == lnum1)
|
||||
&& (dp->df_count[idx1] == 0)
|
||||
&& (dp->df_lnum[idx2] <= curwin->w_cursor.lnum)
|
||||
&& ((dp->df_lnum[idx2] + dp->df_count[idx2])
|
||||
> curwin->w_cursor.lnum))
|
||||
/*
|
||||
* Special case: if the cursor is just after a zero-count
|
||||
* block (i.e. all filler) and the target cursor is already
|
||||
@@ -2579,18 +2571,28 @@ diff_get_corresponding_line(
|
||||
* unmoved. This makes repeated CTRL-W W operations work
|
||||
* as expected.
|
||||
*/
|
||||
return lnum3;
|
||||
return curwin->w_cursor.lnum;
|
||||
baseline = (dp->df_lnum[idx1] + dp->df_count[idx1])
|
||||
- (dp->df_lnum[idx2] + dp->df_count[idx2]);
|
||||
}
|
||||
|
||||
/* If we get here then the cursor is after the last diff */
|
||||
lnum2 = lnum1 - baseline;
|
||||
/* don't end up past the end of the file */
|
||||
if (lnum2 > buf2->b_ml.ml_line_count)
|
||||
lnum2 = buf2->b_ml.ml_line_count;
|
||||
return lnum1 - baseline;
|
||||
}
|
||||
|
||||
return lnum2;
|
||||
/*
|
||||
* Return the line number in the current window that is closest to "lnum1" in
|
||||
* "buf1" in diff mode. Checks the line number to be valid.
|
||||
*/
|
||||
linenr_T
|
||||
diff_get_corresponding_line(buf_T *buf1, linenr_T lnum1)
|
||||
{
|
||||
linenr_T lnum = diff_get_corresponding_line_int(buf1, lnum1);
|
||||
|
||||
/* don't end up past the end of the file */
|
||||
if (lnum > curbuf->b_ml.ml_line_count)
|
||||
return curbuf->b_ml.ml_line_count;
|
||||
return lnum;
|
||||
}
|
||||
|
||||
#if defined(FEAT_FOLDING) || defined(PROTO)
|
||||
|
||||
+39
-25
@@ -179,8 +179,8 @@ static void ins_compl_add_dict(dict_T *dict);
|
||||
#endif
|
||||
static int ins_compl_get_exp(pos_T *ini);
|
||||
static void ins_compl_delete(void);
|
||||
static void ins_compl_insert(void);
|
||||
static int ins_compl_next(int allow_get_expansion, int count, int insert_match);
|
||||
static void ins_compl_insert(int in_compl_func);
|
||||
static int ins_compl_next(int allow_get_expansion, int count, int insert_match, int in_compl_func);
|
||||
static int ins_compl_key2dir(int c);
|
||||
static int ins_compl_pum_key(int c);
|
||||
static int ins_compl_key2count(int c);
|
||||
@@ -857,11 +857,12 @@ edit(
|
||||
|
||||
/* Pressing CTRL-Y selects the current match. When
|
||||
* compl_enter_selects is set the Enter key does the same. */
|
||||
if (c == Ctrl_Y || (compl_enter_selects
|
||||
&& (c == CAR || c == K_KENTER || c == NL)))
|
||||
if ((c == Ctrl_Y || (compl_enter_selects
|
||||
&& (c == CAR || c == K_KENTER || c == NL)))
|
||||
&& stop_arrow() == OK)
|
||||
{
|
||||
ins_compl_delete();
|
||||
ins_compl_insert();
|
||||
ins_compl_insert(FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2808,9 +2809,6 @@ set_completion(colnr_T startcol, list_T *list)
|
||||
ins_compl_prep(' ');
|
||||
ins_compl_clear();
|
||||
|
||||
if (stop_arrow() == FAIL)
|
||||
return;
|
||||
|
||||
compl_direction = FORWARD;
|
||||
if (startcol > curwin->w_cursor.col)
|
||||
startcol = curwin->w_cursor.col;
|
||||
@@ -3306,7 +3304,7 @@ ins_compl_files(
|
||||
break;
|
||||
}
|
||||
line_breakcheck();
|
||||
ins_compl_check_keys(50);
|
||||
ins_compl_check_keys(50, FALSE);
|
||||
}
|
||||
fclose(fp);
|
||||
}
|
||||
@@ -3890,7 +3888,8 @@ ins_compl_prep(int c)
|
||||
/* put the cursor on the last char, for 'tw' formatting */
|
||||
if (prev_col > 0)
|
||||
dec_cursor();
|
||||
if (stop_arrow() == OK)
|
||||
/* only format when something was inserted */
|
||||
if (!arrow_used && !ins_need_undo)
|
||||
insertchar(NUL, 0, -1);
|
||||
if (prev_col > 0
|
||||
&& ml_get_curline()[curwin->w_cursor.col] != NUL)
|
||||
@@ -4050,8 +4049,6 @@ ins_compl_next_buf(buf_T *buf, int flag)
|
||||
}
|
||||
|
||||
#ifdef FEAT_COMPL_FUNC
|
||||
static void expand_by_function(int type, char_u *base);
|
||||
|
||||
/*
|
||||
* Execute user defined complete function 'completefunc' or 'omnifunc', and
|
||||
* get matches in "matches".
|
||||
@@ -4610,7 +4607,7 @@ ins_compl_get_exp(pos_T *ini)
|
||||
break;
|
||||
/* Fill the popup menu as soon as possible. */
|
||||
if (type != -1)
|
||||
ins_compl_check_keys(0);
|
||||
ins_compl_check_keys(0, FALSE);
|
||||
|
||||
if ((ctrl_x_mode != 0 && !CTRL_X_MODE_LINE_OR_EVAL(ctrl_x_mode))
|
||||
|| compl_interrupted)
|
||||
@@ -4651,14 +4648,19 @@ ins_compl_get_exp(pos_T *ini)
|
||||
static void
|
||||
ins_compl_delete(void)
|
||||
{
|
||||
int i;
|
||||
int col;
|
||||
|
||||
/*
|
||||
* In insert mode: Delete the typed part.
|
||||
* In replace mode: Put the old characters back, if any.
|
||||
*/
|
||||
i = compl_col + (compl_cont_status & CONT_ADDING ? compl_length : 0);
|
||||
backspace_until_column(i);
|
||||
col = compl_col + (compl_cont_status & CONT_ADDING ? compl_length : 0);
|
||||
if ((int)curwin->w_cursor.col > col)
|
||||
{
|
||||
if (stop_arrow() == FAIL)
|
||||
return;
|
||||
backspace_until_column(col);
|
||||
}
|
||||
|
||||
/* TODO: is this sufficient for redrawing? Redrawing everything causes
|
||||
* flicker, thus we can't do that. */
|
||||
@@ -4667,9 +4669,12 @@ ins_compl_delete(void)
|
||||
set_vim_var_dict(VV_COMPLETED_ITEM, dict_alloc());
|
||||
}
|
||||
|
||||
/* Insert the new text being completed. */
|
||||
/*
|
||||
* Insert the new text being completed.
|
||||
* "in_compl_func" is TRUE when called from complete_check().
|
||||
*/
|
||||
static void
|
||||
ins_compl_insert(void)
|
||||
ins_compl_insert(int in_compl_func)
|
||||
{
|
||||
dict_T *dict;
|
||||
|
||||
@@ -4696,7 +4701,8 @@ ins_compl_insert(void)
|
||||
EMPTY_IF_NULL(compl_shown_match->cp_text[CPT_INFO]));
|
||||
}
|
||||
set_vim_var_dict(VV_COMPLETED_ITEM, dict);
|
||||
compl_curr_match = compl_shown_match;
|
||||
if (!in_compl_func)
|
||||
compl_curr_match = compl_shown_match;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -4720,7 +4726,8 @@ ins_compl_next(
|
||||
int allow_get_expansion,
|
||||
int count, /* repeat completion this many times; should
|
||||
be at least 1 */
|
||||
int insert_match) /* Insert the newly selected match */
|
||||
int insert_match, /* Insert the newly selected match */
|
||||
int in_compl_func) /* called from complete_check() */
|
||||
{
|
||||
int num_matches = -1;
|
||||
int i;
|
||||
@@ -4870,7 +4877,7 @@ ins_compl_next(
|
||||
else if (insert_match)
|
||||
{
|
||||
if (!compl_get_longest || compl_used_match)
|
||||
ins_compl_insert();
|
||||
ins_compl_insert(in_compl_func);
|
||||
else
|
||||
ins_bytes(compl_leader + ins_compl_len());
|
||||
}
|
||||
@@ -4935,9 +4942,11 @@ ins_compl_next(
|
||||
* mode. Also, when compl_pending is not zero, show a completion as soon as
|
||||
* possible. -- webb
|
||||
* "frequency" specifies out of how many calls we actually check.
|
||||
* "in_compl_func" is TRUE when called from complete_check(), don't set
|
||||
* compl_curr_match.
|
||||
*/
|
||||
void
|
||||
ins_compl_check_keys(int frequency)
|
||||
ins_compl_check_keys(int frequency, int in_compl_func)
|
||||
{
|
||||
static int count = 0;
|
||||
|
||||
@@ -4963,7 +4972,7 @@ ins_compl_check_keys(int frequency)
|
||||
c = safe_vgetc(); /* Eat the character */
|
||||
compl_shows_dir = ins_compl_key2dir(c);
|
||||
(void)ins_compl_next(FALSE, ins_compl_key2count(c),
|
||||
c != K_UP && c != K_DOWN);
|
||||
c != K_UP && c != K_DOWN, in_compl_func);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4986,7 +4995,7 @@ ins_compl_check_keys(int frequency)
|
||||
int todo = compl_pending > 0 ? compl_pending : -compl_pending;
|
||||
|
||||
compl_pending = 0;
|
||||
(void)ins_compl_next(FALSE, todo, TRUE);
|
||||
(void)ins_compl_next(FALSE, todo, TRUE, in_compl_func);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5069,8 +5078,11 @@ ins_complete(int c, int enable_pum)
|
||||
colnr_T curs_col; /* cursor column */
|
||||
int n;
|
||||
int save_w_wrow;
|
||||
int insert_match;
|
||||
|
||||
compl_direction = ins_compl_key2dir(c);
|
||||
insert_match = ins_compl_use_match(c);
|
||||
|
||||
if (!compl_started)
|
||||
{
|
||||
/* First time we hit ^N or ^P (in a row, I mean) */
|
||||
@@ -5496,6 +5508,8 @@ ins_complete(int c, int enable_pum)
|
||||
edit_submode_extra = NULL;
|
||||
out_flush();
|
||||
}
|
||||
else if (insert_match && stop_arrow() == FAIL)
|
||||
return FAIL;
|
||||
|
||||
compl_shown_match = compl_curr_match;
|
||||
compl_shows_dir = compl_direction;
|
||||
@@ -5504,7 +5518,7 @@ ins_complete(int c, int enable_pum)
|
||||
* Find next match (and following matches).
|
||||
*/
|
||||
save_w_wrow = curwin->w_wrow;
|
||||
n = ins_compl_next(TRUE, ins_compl_key2count(c), ins_compl_use_match(c));
|
||||
n = ins_compl_next(TRUE, ins_compl_key2count(c), insert_match, FALSE);
|
||||
|
||||
/* may undisplay the popup menu */
|
||||
ins_compl_upd_pum();
|
||||
|
||||
+2
-2
@@ -5622,7 +5622,7 @@ set_ref_in_item(
|
||||
else if (tv->v_type == VAR_CHANNEL)
|
||||
{
|
||||
channel_T *ch =tv->vval.v_channel;
|
||||
int part;
|
||||
ch_part_T part;
|
||||
typval_T dtv;
|
||||
jsonq_T *jq;
|
||||
cbq_T *cq;
|
||||
@@ -5630,7 +5630,7 @@ set_ref_in_item(
|
||||
if (ch != NULL && ch->ch_copyID != copyID)
|
||||
{
|
||||
ch->ch_copyID = copyID;
|
||||
for (part = PART_SOCK; part <= PART_IN; ++part)
|
||||
for (part = PART_SOCK; part < PART_COUNT; ++part)
|
||||
{
|
||||
for (jq = ch->ch_part[part].ch_json_head.jq_next; jq != NULL;
|
||||
jq = jq->jq_next)
|
||||
|
||||
+2
-2
@@ -2175,7 +2175,7 @@ f_complete_check(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
int saved = RedrawingDisabled;
|
||||
|
||||
RedrawingDisabled = 0;
|
||||
ins_compl_check_keys(0);
|
||||
ins_compl_check_keys(0, TRUE);
|
||||
rettv->vval.v_number = compl_interrupted;
|
||||
RedrawingDisabled = saved;
|
||||
}
|
||||
@@ -6036,7 +6036,7 @@ f_has(typval_T *argvars, typval_T *rettv)
|
||||
#endif
|
||||
#if defined(WIN3264)
|
||||
else if (STRICMP(name, "win95") == 0)
|
||||
n = mch_windows95();
|
||||
n = FALSE; /* Win9x is no more supported. */
|
||||
#endif
|
||||
#ifdef FEAT_NETBEANS_INTG
|
||||
else if (STRICMP(name, "netbeans_enabled") == 0)
|
||||
|
||||
+2
-16
@@ -1175,14 +1175,6 @@ do_filter(
|
||||
if (*cmd == NUL) /* no filter command */
|
||||
return;
|
||||
|
||||
#ifdef WIN3264
|
||||
/*
|
||||
* Check if external commands are allowed now.
|
||||
*/
|
||||
if (can_end_termcap_mode(TRUE) == FALSE)
|
||||
return;
|
||||
#endif
|
||||
|
||||
cursor_save = curwin->w_cursor;
|
||||
linecount = line2 - line1 + 1;
|
||||
curwin->w_cursor.lnum = line1;
|
||||
@@ -1459,12 +1451,6 @@ do_shell(
|
||||
}
|
||||
|
||||
#ifdef MSWIN
|
||||
/*
|
||||
* Check if external commands are allowed now.
|
||||
*/
|
||||
if (can_end_termcap_mode(TRUE) == FALSE)
|
||||
return;
|
||||
|
||||
/*
|
||||
* Check if ":!start" is used.
|
||||
*/
|
||||
@@ -6922,7 +6908,7 @@ fix_help_buffer(void)
|
||||
continue;
|
||||
e1 = vim_strrchr(t1, '.');
|
||||
e2 = vim_strrchr(gettail(f2), '.');
|
||||
if (e1 == NUL || e2 == NUL)
|
||||
if (e1 == NULL || e2 == NULL)
|
||||
continue;
|
||||
if (fnamecmp(e1, ".txt") != 0
|
||||
&& fnamecmp(e1, fname + 4) != 0)
|
||||
@@ -8219,7 +8205,7 @@ set_context_in_sign_cmd(expand_T *xp, char_u *arg)
|
||||
/* :sign define {name} {args}... {last}=
|
||||
* | |
|
||||
* last p */
|
||||
if (p == NUL)
|
||||
if (p == NULL)
|
||||
{
|
||||
/* Expand last argument name (before equal sign). */
|
||||
xp->xp_pattern = last;
|
||||
|
||||
+2
-2
@@ -1093,11 +1093,11 @@ static long last_timer_id = 0;
|
||||
# ifdef WIN3264
|
||||
# define GET_TIMEDIFF(timer, now) \
|
||||
(long)(((double)(timer->tr_due.QuadPart - now.QuadPart) \
|
||||
/ (double)fr.QuadPart) * 1000);
|
||||
/ (double)fr.QuadPart) * 1000)
|
||||
# else
|
||||
# define GET_TIMEDIFF(timer, now) \
|
||||
(timer->tr_due.tv_sec - now.tv_sec) * 1000 \
|
||||
+ (timer->tr_due.tv_usec - now.tv_usec) / 1000;
|
||||
+ (timer->tr_due.tv_usec - now.tv_usec) / 1000
|
||||
# endif
|
||||
|
||||
/*
|
||||
|
||||
+19
-8
@@ -4291,6 +4291,11 @@ set_one_cmd_context(
|
||||
xp->xp_pattern = arg;
|
||||
break;
|
||||
|
||||
case CMD_messages:
|
||||
xp->xp_context = EXPAND_MESSAGES;
|
||||
xp->xp_pattern = arg;
|
||||
break;
|
||||
|
||||
#if defined(FEAT_CMDHIST)
|
||||
case CMD_history:
|
||||
xp->xp_context = EXPAND_HISTORY;
|
||||
@@ -5910,6 +5915,7 @@ static struct
|
||||
#endif
|
||||
{EXPAND_MAPPINGS, "mapping"},
|
||||
{EXPAND_MENUS, "menu"},
|
||||
{EXPAND_MESSAGES, "messages"},
|
||||
{EXPAND_OWNSYNTAX, "syntax"},
|
||||
#if defined(FEAT_PROFILE)
|
||||
{EXPAND_SYNTIME, "syntime"},
|
||||
@@ -7628,14 +7634,7 @@ ex_stop(exarg_T *eap)
|
||||
/*
|
||||
* Disallow suspending for "rvim".
|
||||
*/
|
||||
if (!check_restricted()
|
||||
#ifdef WIN3264
|
||||
/*
|
||||
* Check if external commands are allowed now.
|
||||
*/
|
||||
&& can_end_termcap_mode(TRUE)
|
||||
#endif
|
||||
)
|
||||
if (!check_restricted())
|
||||
{
|
||||
if (!eap->forceit)
|
||||
autowrite_all();
|
||||
@@ -11943,6 +11942,18 @@ get_behave_arg(expand_T *xp UNUSED, int idx)
|
||||
return (char_u *)"xterm";
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Function given to ExpandGeneric() to obtain the possible arguments of the
|
||||
* ":messages {clear}" command.
|
||||
*/
|
||||
char_u *
|
||||
get_messages_arg(expand_T *xp UNUSED, int idx)
|
||||
{
|
||||
if (idx == 0)
|
||||
return (char_u *)"clear";
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
|
||||
@@ -4843,6 +4843,7 @@ ExpandFromContext(
|
||||
{
|
||||
{EXPAND_COMMANDS, get_command_name, FALSE, TRUE},
|
||||
{EXPAND_BEHAVE, get_behave_arg, TRUE, TRUE},
|
||||
{EXPAND_MESSAGES, get_messages_arg, TRUE, TRUE},
|
||||
#ifdef FEAT_CMDHIST
|
||||
{EXPAND_HISTORY, get_history_arg, TRUE, TRUE},
|
||||
#endif
|
||||
|
||||
+145
-401
@@ -319,7 +319,7 @@ static int destroying = FALSE; /* call DestroyWindow() ourselves */
|
||||
#ifdef MSWIN_FIND_REPLACE
|
||||
static UINT s_findrep_msg = 0; /* set in gui_w[16/32].c */
|
||||
static FINDREPLACE s_findrep_struct;
|
||||
# if defined(FEAT_MBYTE) && defined(WIN3264)
|
||||
# ifdef FEAT_MBYTE
|
||||
static FINDREPLACEW s_findrep_struct_w;
|
||||
# endif
|
||||
static HWND s_findrep_hwnd = NULL;
|
||||
@@ -369,7 +369,7 @@ static int allow_scrollbar = FALSE;
|
||||
# define MyTranslateMessage(x) TranslateMessage(x)
|
||||
#endif
|
||||
|
||||
#if (defined(WIN3264) && defined(FEAT_MBYTE)) || defined(GLOBAL_IME)
|
||||
#if defined(FEAT_MBYTE) || defined(GLOBAL_IME)
|
||||
/* use of WindowProc depends on wide_WindowProc */
|
||||
# define MyWindowProc vim_WindowProc
|
||||
#else
|
||||
@@ -473,10 +473,6 @@ static UINT s_wait_timer = 0; /* Timer for get char from user */
|
||||
static int s_timed_out = FALSE;
|
||||
static int dead_key = 0; /* 0: no dead key, 1: dead key pressed */
|
||||
|
||||
#ifdef WIN3264
|
||||
static OSVERSIONINFO os_version; /* like it says. Init in gui_mch_init() */
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_BEVAL
|
||||
/* balloon-eval WM_NOTIFY_HANDLER */
|
||||
static void Handle_WM_Notify(HWND hwnd, LPNMHDR pnmh);
|
||||
@@ -695,61 +691,41 @@ char_to_string(int ch, char_u *string, int slen, int had_alt)
|
||||
WCHAR wstring[2];
|
||||
char_u *ws = NULL;
|
||||
|
||||
if (os_version.dwPlatformId != VER_PLATFORM_WIN32_NT)
|
||||
wstring[0] = ch;
|
||||
len = 1;
|
||||
|
||||
/* "ch" is a UTF-16 character. Convert it to a string of bytes. When
|
||||
* "enc_codepage" is non-zero use the standard Win32 function,
|
||||
* otherwise use our own conversion function (e.g., for UTF-8). */
|
||||
if (enc_codepage > 0)
|
||||
{
|
||||
/* On Windows 95/98 we apparently get the character in the active
|
||||
* codepage, not in UCS-2. If conversion is needed convert it to
|
||||
* UCS-2 first. */
|
||||
if ((int)GetACP() == enc_codepage)
|
||||
len = 0; /* no conversion required */
|
||||
else
|
||||
len = WideCharToMultiByte(enc_codepage, 0, wstring, len,
|
||||
(LPSTR)string, slen, 0, NULL);
|
||||
/* If we had included the ALT key into the character but now the
|
||||
* upper bit is no longer set, that probably means the conversion
|
||||
* failed. Convert the original character and set the upper bit
|
||||
* afterwards. */
|
||||
if (had_alt && len == 1 && ch >= 0x80 && string[0] < 0x80)
|
||||
{
|
||||
string[0] = ch;
|
||||
len = MultiByteToWideChar(GetACP(), 0, (LPCSTR)string,
|
||||
1, wstring, 2);
|
||||
wstring[0] = ch & 0x7f;
|
||||
len = WideCharToMultiByte(enc_codepage, 0, wstring, len,
|
||||
(LPSTR)string, slen, 0, NULL);
|
||||
if (len == 1) /* safety check */
|
||||
string[0] |= 0x80;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
wstring[0] = ch;
|
||||
len = 1;
|
||||
}
|
||||
|
||||
if (len > 0)
|
||||
{
|
||||
/* "ch" is a UTF-16 character. Convert it to a string of bytes. When
|
||||
* "enc_codepage" is non-zero use the standard Win32 function,
|
||||
* otherwise use our own conversion function (e.g., for UTF-8). */
|
||||
if (enc_codepage > 0)
|
||||
{
|
||||
len = WideCharToMultiByte(enc_codepage, 0, wstring, len,
|
||||
(LPSTR)string, slen, 0, NULL);
|
||||
/* If we had included the ALT key into the character but now the
|
||||
* upper bit is no longer set, that probably means the conversion
|
||||
* failed. Convert the original character and set the upper bit
|
||||
* afterwards. */
|
||||
if (had_alt && len == 1 && ch >= 0x80 && string[0] < 0x80)
|
||||
{
|
||||
wstring[0] = ch & 0x7f;
|
||||
len = WideCharToMultiByte(enc_codepage, 0, wstring, len,
|
||||
(LPSTR)string, slen, 0, NULL);
|
||||
if (len == 1) /* safety check */
|
||||
string[0] |= 0x80;
|
||||
}
|
||||
}
|
||||
ws = utf16_to_enc(wstring, &len);
|
||||
if (ws == NULL)
|
||||
len = 0;
|
||||
else
|
||||
{
|
||||
len = 1;
|
||||
ws = utf16_to_enc(wstring, &len);
|
||||
if (ws == NULL)
|
||||
len = 0;
|
||||
else
|
||||
{
|
||||
if (len > slen) /* just in case */
|
||||
len = slen;
|
||||
mch_memmove(string, ws, len);
|
||||
vim_free(ws);
|
||||
}
|
||||
if (len > slen) /* just in case */
|
||||
len = slen;
|
||||
mch_memmove(string, ws, len);
|
||||
vim_free(ws);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1079,7 +1055,7 @@ _OnMenu(
|
||||
#endif
|
||||
|
||||
#ifdef MSWIN_FIND_REPLACE
|
||||
# if defined(FEAT_MBYTE) && defined(WIN3264)
|
||||
# ifdef FEAT_MBYTE
|
||||
/*
|
||||
* copy useful data from structure LPFINDREPLACE to structure LPFINDREPLACEW
|
||||
*/
|
||||
@@ -1127,11 +1103,10 @@ _OnFindRepl(void)
|
||||
int flags = 0;
|
||||
int down;
|
||||
|
||||
# if defined(FEAT_MBYTE) && defined(WIN3264)
|
||||
# ifdef FEAT_MBYTE
|
||||
/* If the OS is Windows NT, and 'encoding' differs from active codepage:
|
||||
* convert text from wide string. */
|
||||
if (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT
|
||||
&& enc_codepage >= 0 && (int)GetACP() != enc_codepage)
|
||||
if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
|
||||
{
|
||||
findrep_wtoa(&s_findrep_struct, &s_findrep_struct_w);
|
||||
}
|
||||
@@ -1279,7 +1254,7 @@ _TextAreaWndProc(
|
||||
}
|
||||
}
|
||||
|
||||
#if (defined(WIN3264) && defined(FEAT_MBYTE)) \
|
||||
#if defined(FEAT_MBYTE) \
|
||||
|| defined(GLOBAL_IME) \
|
||||
|| defined(PROTO)
|
||||
# ifdef PROTO
|
||||
@@ -1586,10 +1561,9 @@ gui_mch_get_color(char_u *name)
|
||||
|
||||
static SysColorTable sys_table[] =
|
||||
{
|
||||
#ifdef WIN3264
|
||||
{"SYS_3DDKSHADOW", COLOR_3DDKSHADOW},
|
||||
{"SYS_3DHILIGHT", COLOR_3DHILIGHT},
|
||||
#ifndef __MINGW32__
|
||||
#ifdef COLOR_3DHIGHLIGHT
|
||||
{"SYS_3DHIGHLIGHT", COLOR_3DHIGHLIGHT},
|
||||
#endif
|
||||
{"SYS_BTNHILIGHT", COLOR_BTNHILIGHT},
|
||||
@@ -1600,7 +1574,6 @@ gui_mch_get_color(char_u *name)
|
||||
{"SYS_INFOBK", COLOR_INFOBK},
|
||||
{"SYS_INFOTEXT", COLOR_INFOTEXT},
|
||||
{"SYS_3DFACE", COLOR_3DFACE},
|
||||
#endif
|
||||
{"SYS_BTNFACE", COLOR_BTNFACE},
|
||||
{"SYS_BTNSHADOW", COLOR_BTNSHADOW},
|
||||
{"SYS_ACTIVEBORDER", COLOR_ACTIVEBORDER},
|
||||
@@ -2094,11 +2067,7 @@ gui_mch_wait_for_chars(int wtime)
|
||||
|
||||
if (s_need_activate)
|
||||
{
|
||||
#ifdef WIN32
|
||||
(void)SetForegroundWindow(s_hwnd);
|
||||
#else
|
||||
(void)SetActiveWindow(s_hwnd);
|
||||
#endif
|
||||
s_need_activate = FALSE;
|
||||
}
|
||||
|
||||
@@ -2421,7 +2390,6 @@ add_tabline_popup_menu_entry(HMENU pmenu, UINT item_id, char_u *item_text)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
WCHAR *wn = NULL;
|
||||
int n;
|
||||
|
||||
if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
|
||||
{
|
||||
@@ -2438,11 +2406,8 @@ add_tabline_popup_menu_entry(HMENU pmenu, UINT item_id, char_u *item_text)
|
||||
infow.fType = MFT_STRING;
|
||||
infow.dwTypeData = wn;
|
||||
infow.cch = (UINT)wcslen(wn);
|
||||
n = InsertMenuItemW(pmenu, item_id, FALSE, &infow);
|
||||
InsertMenuItemW(pmenu, item_id, FALSE, &infow);
|
||||
vim_free(wn);
|
||||
if (n == 0 && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
|
||||
/* Failed, try using non-wide function. */
|
||||
wn = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2563,7 +2528,7 @@ gui_mch_update_tabline(void)
|
||||
if (s_tabhwnd == NULL)
|
||||
return;
|
||||
|
||||
#if defined(FEAT_MBYTE)
|
||||
#ifdef FEAT_MBYTE
|
||||
# ifndef CCM_SETUNICODEFORMAT
|
||||
/* For older compilers. We assume this never changes. */
|
||||
# define CCM_SETUNICODEFORMAT 0x2005
|
||||
@@ -2708,18 +2673,15 @@ set_window_title(HWND hwnd, char *title)
|
||||
if (title != NULL && enc_codepage >= 0 && enc_codepage != (int)GetACP())
|
||||
{
|
||||
WCHAR *wbuf;
|
||||
int n;
|
||||
|
||||
/* Convert the title from 'encoding' to UTF-16. */
|
||||
wbuf = (WCHAR *)enc_to_utf16((char_u *)title, NULL);
|
||||
if (wbuf != NULL)
|
||||
{
|
||||
n = SetWindowTextW(hwnd, wbuf);
|
||||
SetWindowTextW(hwnd, wbuf);
|
||||
vim_free(wbuf);
|
||||
if (n != 0 || GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
|
||||
return;
|
||||
/* Retry with non-wide function (for Windows 98). */
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
(void)SetWindowText(hwnd, (LPCSTR)title);
|
||||
@@ -2737,11 +2699,10 @@ gui_mch_find_dialog(exarg_T *eap)
|
||||
if (!IsWindow(s_findrep_hwnd))
|
||||
{
|
||||
initialise_findrep(eap->arg);
|
||||
# if defined(FEAT_MBYTE) && defined(WIN3264)
|
||||
# ifdef FEAT_MBYTE
|
||||
/* If the OS is Windows NT, and 'encoding' differs from active
|
||||
* codepage: convert text and use wide function. */
|
||||
if (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT
|
||||
&& enc_codepage >= 0 && (int)GetACP() != enc_codepage)
|
||||
if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
|
||||
{
|
||||
findrep_atow(&s_findrep_struct_w, &s_findrep_struct);
|
||||
s_findrep_hwnd = FindTextW(
|
||||
@@ -2774,9 +2735,8 @@ gui_mch_replace_dialog(exarg_T *eap)
|
||||
if (!IsWindow(s_findrep_hwnd))
|
||||
{
|
||||
initialise_findrep(eap->arg);
|
||||
# if defined(FEAT_MBYTE) && defined(WIN3264)
|
||||
if (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT
|
||||
&& enc_codepage >= 0 && (int)GetACP() != enc_codepage)
|
||||
# ifdef FEAT_MBYTE
|
||||
if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
|
||||
{
|
||||
findrep_atow(&s_findrep_struct_w, &s_findrep_struct);
|
||||
s_findrep_hwnd = ReplaceTextW(
|
||||
@@ -3466,11 +3426,7 @@ static LPCSTR mshape_idcs[] =
|
||||
IDC_SIZEWE, /* leftright */
|
||||
IDC_SIZEWE, /* lrsizing */
|
||||
IDC_WAIT, /* busy */
|
||||
#ifdef WIN3264
|
||||
IDC_NO, /* no */
|
||||
#else
|
||||
IDC_ICON, /* no */
|
||||
#endif
|
||||
IDC_ARROW, /* crosshair */
|
||||
IDC_ARROW, /* hand1 */
|
||||
IDC_ARROW, /* hand2 */
|
||||
@@ -3497,11 +3453,7 @@ mch_set_mouse_shape(int shape)
|
||||
#ifdef SetClassLongPtr
|
||||
SetClassLongPtr(s_textArea, GCLP_HCURSOR, (__int3264)(LONG_PTR)LoadCursor(NULL, idc));
|
||||
#else
|
||||
# ifdef WIN32
|
||||
SetClassLong(s_textArea, GCL_HCURSOR, (long_u)LoadCursor(NULL, idc));
|
||||
# else /* Win16 */
|
||||
SetClassWord(s_textArea, GCW_HCURSOR, (WORD)LoadCursor(NULL, idc));
|
||||
# endif
|
||||
#endif
|
||||
if (!p_mh)
|
||||
{
|
||||
@@ -3523,7 +3475,7 @@ mch_set_mouse_shape(int shape)
|
||||
* Windows NT/2000/XP the "W" functions are used.
|
||||
*/
|
||||
|
||||
# if defined(FEAT_MBYTE) && defined(WIN3264)
|
||||
# ifdef FEAT_MBYTE
|
||||
/*
|
||||
* Wide version of convert_filter().
|
||||
*/
|
||||
@@ -3728,17 +3680,15 @@ gui_mch_browse(
|
||||
char_u *initdir,
|
||||
char_u *filter)
|
||||
{
|
||||
# ifdef FEAT_MBYTE
|
||||
return gui_mch_browseW(saving, title, dflt, ext, initdir, filter);
|
||||
# else
|
||||
OPENFILENAME fileStruct;
|
||||
char_u fileBuf[MAXPATHL];
|
||||
char_u *initdirp = NULL;
|
||||
char_u *filterp;
|
||||
char_u *p;
|
||||
|
||||
# if defined(FEAT_MBYTE) && defined(WIN3264)
|
||||
if (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT)
|
||||
return gui_mch_browseW(saving, title, dflt, ext, initdir, filter);
|
||||
# endif
|
||||
|
||||
if (dflt == NULL)
|
||||
fileBuf[0] = NUL;
|
||||
else
|
||||
@@ -3748,12 +3698,12 @@ gui_mch_browse(
|
||||
filterp = convert_filter(filter);
|
||||
|
||||
vim_memset(&fileStruct, 0, sizeof(OPENFILENAME));
|
||||
#ifdef OPENFILENAME_SIZE_VERSION_400
|
||||
# ifdef OPENFILENAME_SIZE_VERSION_400
|
||||
/* be compatible with Windows NT 4.0 */
|
||||
fileStruct.lStructSize = OPENFILENAME_SIZE_VERSION_400;
|
||||
#else
|
||||
# else
|
||||
fileStruct.lStructSize = sizeof(fileStruct);
|
||||
#endif
|
||||
# endif
|
||||
|
||||
fileStruct.lpstrTitle = (LPSTR)title;
|
||||
fileStruct.lpstrDefExt = (LPSTR)ext;
|
||||
@@ -3783,10 +3733,10 @@ gui_mch_browse(
|
||||
* Don't use OFN_OVERWRITEPROMPT, Vim has its own ":confirm" dialog.
|
||||
*/
|
||||
fileStruct.Flags = (OFN_NOCHANGEDIR | OFN_PATHMUSTEXIST | OFN_HIDEREADONLY);
|
||||
#ifdef FEAT_SHORTCUT
|
||||
# ifdef FEAT_SHORTCUT
|
||||
if (curbuf->b_p_bin)
|
||||
fileStruct.Flags |= OFN_NODEREFERENCELINKS;
|
||||
#endif
|
||||
# endif
|
||||
if (saving)
|
||||
{
|
||||
if (!GetSaveFileName(&fileStruct))
|
||||
@@ -3806,6 +3756,7 @@ gui_mch_browse(
|
||||
|
||||
/* Shorten the file name if possible */
|
||||
return vim_strsave(shorten_fname1((char_u *)fileBuf));
|
||||
# endif
|
||||
}
|
||||
#endif /* FEAT_BROWSE */
|
||||
|
||||
@@ -3816,16 +3767,11 @@ _OnDropFiles(
|
||||
HDROP hDrop)
|
||||
{
|
||||
#ifdef FEAT_WINDOWS
|
||||
#ifdef WIN3264
|
||||
# define BUFPATHLEN _MAX_PATH
|
||||
# define DRAGQVAL 0xFFFFFFFF
|
||||
#else
|
||||
# define BUFPATHLEN MAXPATHL
|
||||
# define DRAGQVAL 0xFFFF
|
||||
#endif
|
||||
#ifdef FEAT_MBYTE
|
||||
# ifdef FEAT_MBYTE
|
||||
WCHAR wszFile[BUFPATHLEN];
|
||||
#endif
|
||||
# endif
|
||||
char szFile[BUFPATHLEN];
|
||||
UINT cFiles = DragQueryFile(hDrop, DRAGQVAL, NULL, 0);
|
||||
UINT i;
|
||||
@@ -3846,11 +3792,11 @@ _OnDropFiles(
|
||||
if (fnames != NULL)
|
||||
for (i = 0; i < cFiles; ++i)
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
# ifdef FEAT_MBYTE
|
||||
if (DragQueryFileW(hDrop, i, wszFile, BUFPATHLEN) > 0)
|
||||
fnames[i] = utf16_to_enc(wszFile, NULL);
|
||||
else
|
||||
#endif
|
||||
# endif
|
||||
{
|
||||
DragQueryFile(hDrop, i, szFile, BUFPATHLEN);
|
||||
fnames[i] = vim_strsave((char_u *)szFile);
|
||||
@@ -3888,14 +3834,10 @@ _OnScroll(
|
||||
long val;
|
||||
int dragging = FALSE;
|
||||
int dont_scroll_save = dont_scroll;
|
||||
#ifndef WIN3264
|
||||
int nPos;
|
||||
#else
|
||||
SCROLLINFO si;
|
||||
|
||||
si.cbSize = sizeof(si);
|
||||
si.fMask = SIF_POS;
|
||||
#endif
|
||||
|
||||
sb = gui_mswin_find_scrollbar(hwndCtl);
|
||||
if (sb == NULL)
|
||||
@@ -3960,13 +3902,8 @@ _OnScroll(
|
||||
}
|
||||
prev_code = code;
|
||||
|
||||
#ifdef WIN3264
|
||||
si.nPos = (sb->scroll_shift > 0) ? val >> sb->scroll_shift : val;
|
||||
SetScrollInfo(hwndCtl, SB_CTL, &si, TRUE);
|
||||
#else
|
||||
nPos = (sb->scroll_shift > 0) ? val >> sb->scroll_shift : val;
|
||||
SetScrollPos(hwndCtl, SB_CTL, nPos, TRUE);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* When moving a vertical scrollbar, move the other vertical scrollbar too.
|
||||
@@ -3976,11 +3913,7 @@ _OnScroll(
|
||||
scrollbar_T *sba = sb->wp->w_scrollbars;
|
||||
HWND id = sba[ (sb == sba + SBAR_LEFT) ? SBAR_RIGHT : SBAR_LEFT].id;
|
||||
|
||||
#ifdef WIN3264
|
||||
SetScrollInfo(id, SB_CTL, &si, TRUE);
|
||||
#else
|
||||
SetScrollPos(id, SB_CTL, nPos, TRUE);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Don't let us be interrupted here by another message. */
|
||||
@@ -4448,7 +4381,6 @@ static int dialog_default_button = -1;
|
||||
|
||||
/* Intellimouse support */
|
||||
static int mouse_scroll_lines = 0;
|
||||
static UINT msh_msgmousewheel = 0;
|
||||
|
||||
static int s_usenewlook; /* emulate W95/NT4 non-bold dialogs */
|
||||
#ifdef FEAT_TOOLBAR
|
||||
@@ -4505,34 +4437,6 @@ static void dyn_imm_load(void);
|
||||
# define pImmSetConversionStatus ImmSetConversionStatus
|
||||
#endif
|
||||
|
||||
/* multi monitor support */
|
||||
typedef struct _MONITORINFOstruct
|
||||
{
|
||||
DWORD cbSize;
|
||||
RECT rcMonitor;
|
||||
RECT rcWork;
|
||||
DWORD dwFlags;
|
||||
} _MONITORINFO;
|
||||
|
||||
typedef HANDLE _HMONITOR;
|
||||
typedef _HMONITOR (WINAPI *TMonitorFromWindow)(HWND, DWORD);
|
||||
typedef BOOL (WINAPI *TGetMonitorInfo)(_HMONITOR, _MONITORINFO *);
|
||||
|
||||
static TMonitorFromWindow pMonitorFromWindow = NULL;
|
||||
static TGetMonitorInfo pGetMonitorInfo = NULL;
|
||||
static HANDLE user32_lib = NULL;
|
||||
/*
|
||||
* Return TRUE when running under Windows NT 3.x or Win32s, both of which have
|
||||
* less fancy GUI APIs.
|
||||
*/
|
||||
static int
|
||||
is_winnt_3(void)
|
||||
{
|
||||
return ((os_version.dwPlatformId == VER_PLATFORM_WIN32_NT
|
||||
&& os_version.dwMajorVersion == 3)
|
||||
|| (os_version.dwPlatformId == VER_PLATFORM_WIN32s));
|
||||
}
|
||||
|
||||
#ifdef FEAT_MENU
|
||||
/*
|
||||
* Figure out how high the menu bar is at the moment.
|
||||
@@ -4564,45 +4468,20 @@ gui_mswin_get_menu_height(
|
||||
}
|
||||
else
|
||||
{
|
||||
if (is_winnt_3()) /* for NT 3.xx */
|
||||
/*
|
||||
* In case 'lines' is set in _vimrc/_gvimrc window width doesn't
|
||||
* seem to have been set yet, so menu wraps in default window
|
||||
* width which is very narrow. Instead just return height of a
|
||||
* single menu item. Will still be wrong when the menu really
|
||||
* should wrap over more than one line.
|
||||
*/
|
||||
GetMenuItemRect(s_hwnd, s_menuBar, 0, &rc1);
|
||||
if (gui.starting)
|
||||
menu_height = rc1.bottom - rc1.top + 1;
|
||||
else
|
||||
{
|
||||
if (gui.starting)
|
||||
menu_height = GetSystemMetrics(SM_CYMENU);
|
||||
else
|
||||
{
|
||||
RECT r1, r2;
|
||||
int frameht = GetSystemMetrics(SM_CYFRAME);
|
||||
int capht = GetSystemMetrics(SM_CYCAPTION);
|
||||
|
||||
/* get window rect of s_hwnd
|
||||
* get client rect of s_hwnd
|
||||
* get cap height
|
||||
* subtract from window rect, the sum of client height,
|
||||
* (if not maximized)frame thickness, and caption height.
|
||||
*/
|
||||
GetWindowRect(s_hwnd, &r1);
|
||||
GetClientRect(s_hwnd, &r2);
|
||||
menu_height = r1.bottom - r1.top - (r2.bottom - r2.top
|
||||
+ 2 * frameht * (!IsZoomed(s_hwnd)) + capht);
|
||||
}
|
||||
}
|
||||
else /* win95 and variants (NT 4.0, I guess) */
|
||||
{
|
||||
/*
|
||||
* In case 'lines' is set in _vimrc/_gvimrc window width doesn't
|
||||
* seem to have been set yet, so menu wraps in default window
|
||||
* width which is very narrow. Instead just return height of a
|
||||
* single menu item. Will still be wrong when the menu really
|
||||
* should wrap over more than one line.
|
||||
*/
|
||||
GetMenuItemRect(s_hwnd, s_menuBar, 0, &rc1);
|
||||
if (gui.starting)
|
||||
menu_height = rc1.bottom - rc1.top + 1;
|
||||
else
|
||||
{
|
||||
GetMenuItemRect(s_hwnd, s_menuBar, num - 1, &rc2);
|
||||
menu_height = rc2.bottom - rc1.top + 1;
|
||||
}
|
||||
GetMenuItemRect(s_hwnd, s_menuBar, num - 1, &rc2);
|
||||
menu_height = rc2.bottom - rc1.top + 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4636,42 +4515,11 @@ init_mouse_wheel(void)
|
||||
#define VMSH_MOUSEWHEEL "MSWHEEL_ROLLMSG"
|
||||
#define VMSH_SCROLL_LINES "MSH_SCROLL_LINES_MSG"
|
||||
|
||||
HWND hdl_mswheel;
|
||||
UINT msh_msgscrolllines;
|
||||
|
||||
msh_msgmousewheel = 0;
|
||||
mouse_scroll_lines = 3; /* reasonable default */
|
||||
|
||||
if ((os_version.dwPlatformId == VER_PLATFORM_WIN32_NT
|
||||
&& os_version.dwMajorVersion >= 4)
|
||||
|| (os_version.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS
|
||||
&& ((os_version.dwMajorVersion == 4
|
||||
&& os_version.dwMinorVersion >= 10)
|
||||
|| os_version.dwMajorVersion >= 5)))
|
||||
{
|
||||
/* if NT 4.0+ (or Win98) get scroll lines directly from system */
|
||||
SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0,
|
||||
&mouse_scroll_lines, 0);
|
||||
}
|
||||
else if (os_version.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS
|
||||
|| (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT
|
||||
&& os_version.dwMajorVersion < 4))
|
||||
{ /*
|
||||
* If Win95 or NT 3.51,
|
||||
* try to find the hidden point32 window.
|
||||
*/
|
||||
hdl_mswheel = FindWindow(VMOUSEZ_CLASSNAME, VMOUSEZ_TITLE);
|
||||
if (hdl_mswheel)
|
||||
{
|
||||
msh_msgscrolllines = RegisterWindowMessage(VMSH_SCROLL_LINES);
|
||||
if (msh_msgscrolllines)
|
||||
{
|
||||
mouse_scroll_lines = (int)SendMessage(hdl_mswheel,
|
||||
msh_msgscrolllines, 0, 0);
|
||||
msh_msgmousewheel = RegisterWindowMessage(VMSH_MOUSEWHEEL);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* if NT 4.0+ (or Win98) get scroll lines directly from system */
|
||||
SystemParametersInfo(SPI_GETWHEELSCROLLLINES, 0,
|
||||
&mouse_scroll_lines, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -5210,13 +5058,8 @@ _WndProc(
|
||||
#endif
|
||||
|
||||
default:
|
||||
if (uMsg == msh_msgmousewheel && msh_msgmousewheel != 0)
|
||||
{ /* handle MSH_MOUSEWHEEL messages for Intellimouse */
|
||||
_OnMouseWheel(hwnd, HIWORD(wParam));
|
||||
return 0L;
|
||||
}
|
||||
#ifdef MSWIN_FIND_REPLACE
|
||||
else if (uMsg == s_findrep_msg && s_findrep_msg != 0)
|
||||
if (uMsg == s_findrep_msg && s_findrep_msg != 0)
|
||||
{
|
||||
_OnFindRepl();
|
||||
}
|
||||
@@ -5376,42 +5219,6 @@ gui_mch_prepare(int *argc, char **argv)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* get the OS version info */
|
||||
os_version.dwOSVersionInfoSize = sizeof(os_version);
|
||||
GetVersionEx(&os_version); /* this call works on Win32s, Win95 and WinNT */
|
||||
|
||||
/* try and load the user32.dll library and get the entry points for
|
||||
* multi-monitor-support. */
|
||||
if ((user32_lib = vimLoadLib("User32.dll")) != NULL)
|
||||
{
|
||||
pMonitorFromWindow = (TMonitorFromWindow)GetProcAddress(user32_lib,
|
||||
"MonitorFromWindow");
|
||||
|
||||
/* there are ...A and ...W version of GetMonitorInfo - looking at
|
||||
* winuser.h, they have exactly the same declaration. */
|
||||
pGetMonitorInfo = (TGetMonitorInfo)GetProcAddress(user32_lib,
|
||||
"GetMonitorInfoA");
|
||||
}
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
/* If the OS is Windows NT, use wide functions;
|
||||
* this enables common dialogs input unicode from IME. */
|
||||
if (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT)
|
||||
{
|
||||
pDispatchMessage = DispatchMessageW;
|
||||
pGetMessage = GetMessageW;
|
||||
pIsDialogMessage = IsDialogMessageW;
|
||||
pPeekMessage = PeekMessageW;
|
||||
}
|
||||
else
|
||||
{
|
||||
pDispatchMessage = DispatchMessageA;
|
||||
pGetMessage = GetMessageA;
|
||||
pIsDialogMessage = IsDialogMessageA;
|
||||
pPeekMessage = PeekMessageA;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -5475,12 +5282,7 @@ gui_mch_init(void)
|
||||
atom =
|
||||
#endif
|
||||
RegisterClassW(&wndclassw)) == 0)
|
||||
{
|
||||
if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
|
||||
return FAIL;
|
||||
|
||||
/* Must be Windows 98, fall back to non-wide function. */
|
||||
}
|
||||
return FAIL;
|
||||
else
|
||||
wide_WindowProc = TRUE;
|
||||
}
|
||||
@@ -5710,7 +5512,7 @@ gui_mch_init(void)
|
||||
s_findrep_struct.lpstrReplaceWith[0] = NUL;
|
||||
s_findrep_struct.wFindWhatLen = MSWIN_FR_BUFSIZE;
|
||||
s_findrep_struct.wReplaceWithLen = MSWIN_FR_BUFSIZE;
|
||||
# if defined(FEAT_MBYTE) && defined(WIN3264)
|
||||
# ifdef FEAT_MBYTE
|
||||
s_findrep_struct_w.lStructSize = sizeof(s_findrep_struct_w);
|
||||
s_findrep_struct_w.lpstrFindWhat =
|
||||
(LPWSTR)alloc(MSWIN_FR_BUFSIZE * sizeof(WCHAR));
|
||||
@@ -5753,22 +5555,18 @@ theend:
|
||||
static void
|
||||
get_work_area(RECT *spi_rect)
|
||||
{
|
||||
_HMONITOR mon;
|
||||
_MONITORINFO moninfo;
|
||||
HMONITOR mon;
|
||||
MONITORINFO moninfo;
|
||||
|
||||
/* use these functions only if available */
|
||||
if (pMonitorFromWindow != NULL && pGetMonitorInfo != NULL)
|
||||
/* work out which monitor the window is on, and get *it's* work area */
|
||||
mon = MonitorFromWindow(s_hwnd, 1 /*MONITOR_DEFAULTTOPRIMARY*/);
|
||||
if (mon != NULL)
|
||||
{
|
||||
/* work out which monitor the window is on, and get *it's* work area */
|
||||
mon = pMonitorFromWindow(s_hwnd, 1 /*MONITOR_DEFAULTTOPRIMARY*/);
|
||||
if (mon != NULL)
|
||||
moninfo.cbSize = sizeof(MONITORINFO);
|
||||
if (GetMonitorInfo(mon, &moninfo))
|
||||
{
|
||||
moninfo.cbSize = sizeof(_MONITORINFO);
|
||||
if (pGetMonitorInfo(mon, &moninfo))
|
||||
{
|
||||
*spi_rect = moninfo.rcWork;
|
||||
return;
|
||||
}
|
||||
*spi_rect = moninfo.rcWork;
|
||||
return;
|
||||
}
|
||||
}
|
||||
/* this is the old method... */
|
||||
@@ -6307,29 +6105,10 @@ RevOut( HDC s_hdc,
|
||||
CONST INT *padding)
|
||||
{
|
||||
int ix;
|
||||
static int special = -1;
|
||||
|
||||
if (special == -1)
|
||||
{
|
||||
/* Check windows version: special treatment is needed if it is NT 5 or
|
||||
* Win98 or higher. */
|
||||
if ((os_version.dwPlatformId == VER_PLATFORM_WIN32_NT
|
||||
&& os_version.dwMajorVersion >= 5)
|
||||
|| (os_version.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS
|
||||
&& (os_version.dwMajorVersion > 4
|
||||
|| (os_version.dwMajorVersion == 4
|
||||
&& os_version.dwMinorVersion > 0))))
|
||||
special = 1;
|
||||
else
|
||||
special = 0;
|
||||
}
|
||||
|
||||
if (special)
|
||||
for (ix = 0; ix < (int)len; ++ix)
|
||||
ExtTextOut(s_hdc, col + TEXT_X(ix), row, foptions,
|
||||
pcliprect, text + ix, 1, padding);
|
||||
else
|
||||
ExtTextOut(s_hdc, col, row, foptions, pcliprect, text, len, padding);
|
||||
for (ix = 0; ix < (int)len; ++ix)
|
||||
ExtTextOut(s_hdc, col + TEXT_X(ix), row, foptions,
|
||||
pcliprect, text + ix, 1, padding);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -6718,63 +6497,50 @@ gui_mch_add_menu(
|
||||
|
||||
if (menu_is_menubar(menu->name))
|
||||
{
|
||||
if (is_winnt_3())
|
||||
{
|
||||
InsertMenu((parent == NULL) ? s_menuBar : parent->submenu_id,
|
||||
(UINT)pos, MF_POPUP | MF_STRING | MF_BYPOSITION,
|
||||
(long_u)menu->submenu_id, (LPCTSTR) menu->name);
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
WCHAR *wn = NULL;
|
||||
int n;
|
||||
WCHAR *wn = NULL;
|
||||
|
||||
if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
|
||||
if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
|
||||
{
|
||||
/* 'encoding' differs from active codepage: convert menu name
|
||||
* and use wide function */
|
||||
wn = enc_to_utf16(menu->name, NULL);
|
||||
if (wn != NULL)
|
||||
{
|
||||
/* 'encoding' differs from active codepage: convert menu name
|
||||
* and use wide function */
|
||||
wn = enc_to_utf16(menu->name, NULL);
|
||||
if (wn != NULL)
|
||||
{
|
||||
MENUITEMINFOW infow;
|
||||
MENUITEMINFOW infow;
|
||||
|
||||
infow.cbSize = sizeof(infow);
|
||||
infow.fMask = MIIM_DATA | MIIM_TYPE | MIIM_ID
|
||||
| MIIM_SUBMENU;
|
||||
infow.dwItemData = (long_u)menu;
|
||||
infow.wID = menu->id;
|
||||
infow.fType = MFT_STRING;
|
||||
infow.dwTypeData = wn;
|
||||
infow.cch = (UINT)wcslen(wn);
|
||||
infow.hSubMenu = menu->submenu_id;
|
||||
n = InsertMenuItemW((parent == NULL)
|
||||
? s_menuBar : parent->submenu_id,
|
||||
(UINT)pos, TRUE, &infow);
|
||||
vim_free(wn);
|
||||
if (n == 0 && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
|
||||
/* Failed, try using non-wide function. */
|
||||
wn = NULL;
|
||||
}
|
||||
infow.cbSize = sizeof(infow);
|
||||
infow.fMask = MIIM_DATA | MIIM_TYPE | MIIM_ID
|
||||
| MIIM_SUBMENU;
|
||||
infow.dwItemData = (long_u)menu;
|
||||
infow.wID = menu->id;
|
||||
infow.fType = MFT_STRING;
|
||||
infow.dwTypeData = wn;
|
||||
infow.cch = (UINT)wcslen(wn);
|
||||
infow.hSubMenu = menu->submenu_id;
|
||||
InsertMenuItemW((parent == NULL)
|
||||
? s_menuBar : parent->submenu_id,
|
||||
(UINT)pos, TRUE, &infow);
|
||||
vim_free(wn);
|
||||
}
|
||||
}
|
||||
|
||||
if (wn == NULL)
|
||||
if (wn == NULL)
|
||||
#endif
|
||||
{
|
||||
MENUITEMINFO info;
|
||||
{
|
||||
MENUITEMINFO info;
|
||||
|
||||
info.cbSize = sizeof(info);
|
||||
info.fMask = MIIM_DATA | MIIM_TYPE | MIIM_ID | MIIM_SUBMENU;
|
||||
info.dwItemData = (long_u)menu;
|
||||
info.wID = menu->id;
|
||||
info.fType = MFT_STRING;
|
||||
info.dwTypeData = (LPTSTR)menu->name;
|
||||
info.cch = (UINT)STRLEN(menu->name);
|
||||
info.hSubMenu = menu->submenu_id;
|
||||
InsertMenuItem((parent == NULL)
|
||||
? s_menuBar : parent->submenu_id,
|
||||
(UINT)pos, TRUE, &info);
|
||||
}
|
||||
info.cbSize = sizeof(info);
|
||||
info.fMask = MIIM_DATA | MIIM_TYPE | MIIM_ID | MIIM_SUBMENU;
|
||||
info.dwItemData = (long_u)menu;
|
||||
info.wID = menu->id;
|
||||
info.fType = MFT_STRING;
|
||||
info.dwTypeData = (LPTSTR)menu->name;
|
||||
info.cch = (UINT)STRLEN(menu->name);
|
||||
info.hSubMenu = menu->submenu_id;
|
||||
InsertMenuItem((parent == NULL)
|
||||
? s_menuBar : parent->submenu_id,
|
||||
(UINT)pos, TRUE, &info);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6890,7 +6656,6 @@ gui_mch_add_menu_item(
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
WCHAR *wn = NULL;
|
||||
int n;
|
||||
|
||||
if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
|
||||
{
|
||||
@@ -6899,14 +6664,11 @@ gui_mch_add_menu_item(
|
||||
wn = enc_to_utf16(menu->name, NULL);
|
||||
if (wn != NULL)
|
||||
{
|
||||
n = InsertMenuW(parent->submenu_id, (UINT)idx,
|
||||
InsertMenuW(parent->submenu_id, (UINT)idx,
|
||||
(menu_is_separator(menu->name)
|
||||
? MF_SEPARATOR : MF_STRING) | MF_BYPOSITION,
|
||||
(UINT)menu->id, wn);
|
||||
vim_free(wn);
|
||||
if (n == 0 && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
|
||||
/* Failed, try using non-wide function. */
|
||||
wn = NULL;
|
||||
}
|
||||
}
|
||||
if (wn == NULL)
|
||||
@@ -7105,11 +6867,10 @@ dialog_callback(
|
||||
/* If the edit box exists, copy the string. */
|
||||
if (s_textfield != NULL)
|
||||
{
|
||||
# if defined(FEAT_MBYTE) && defined(WIN3264)
|
||||
# ifdef FEAT_MBYTE
|
||||
/* If the OS is Windows NT, and 'encoding' differs from active
|
||||
* codepage: use wide function and convert text. */
|
||||
if (os_version.dwPlatformId == VER_PLATFORM_WIN32_NT
|
||||
&& enc_codepage >= 0 && (int)GetACP() != enc_codepage)
|
||||
if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
|
||||
{
|
||||
WCHAR *wp = (WCHAR *)alloc(IOSIZE * sizeof(WCHAR));
|
||||
char_u *p;
|
||||
@@ -7866,38 +7627,31 @@ get_dialog_font_metrics(void)
|
||||
|
||||
s_usenewlook = FALSE;
|
||||
|
||||
/*
|
||||
* For NT3.51 and Win32s, we stick with the old look
|
||||
* because it matches everything else.
|
||||
*/
|
||||
if (!is_winnt_3())
|
||||
{
|
||||
#ifdef USE_SYSMENU_FONT
|
||||
if (gui_w32_get_menu_font(&lfSysmenu) == OK)
|
||||
hfontTools = CreateFontIndirect(&lfSysmenu);
|
||||
else
|
||||
if (gui_w32_get_menu_font(&lfSysmenu) == OK)
|
||||
hfontTools = CreateFontIndirect(&lfSysmenu);
|
||||
else
|
||||
#endif
|
||||
hfontTools = CreateFont(-DLG_FONT_POINT_SIZE, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, 0, 0, 0, VARIABLE_PITCH , DLG_FONT_NAME);
|
||||
|
||||
if (hfontTools)
|
||||
{
|
||||
hdc = GetDC(s_hwnd);
|
||||
SelectObject(hdc, hfontTools);
|
||||
/*
|
||||
* GetTextMetrics() doesn't return the right value in
|
||||
* tmAveCharWidth, so we have to figure out the dialog base units
|
||||
* ourselves.
|
||||
*/
|
||||
GetTextExtentPoint(hdc,
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
|
||||
52, &size);
|
||||
ReleaseDC(s_hwnd, hdc);
|
||||
if (hfontTools)
|
||||
{
|
||||
hdc = GetDC(s_hwnd);
|
||||
SelectObject(hdc, hfontTools);
|
||||
/*
|
||||
* GetTextMetrics() doesn't return the right value in
|
||||
* tmAveCharWidth, so we have to figure out the dialog base units
|
||||
* ourselves.
|
||||
*/
|
||||
GetTextExtentPoint(hdc,
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",
|
||||
52, &size);
|
||||
ReleaseDC(s_hwnd, hdc);
|
||||
|
||||
s_dlgfntwidth = (WORD)((size.cx / 26 + 1) / 2);
|
||||
s_dlgfntheight = (WORD)size.cy;
|
||||
s_usenewlook = TRUE;
|
||||
}
|
||||
s_dlgfntwidth = (WORD)((size.cx / 26 + 1) / 2);
|
||||
s_dlgfntheight = (WORD)size.cy;
|
||||
s_usenewlook = TRUE;
|
||||
}
|
||||
|
||||
if (!s_usenewlook)
|
||||
@@ -8044,10 +7798,6 @@ gui_mch_tearoff(
|
||||
dlgwidth = textWidth;
|
||||
dlgwidth += 2 * TEAROFF_PADDING_X + TEAROFF_BUTTON_PAD_X;
|
||||
|
||||
/* W95 can't do thin dialogs, they look v. weird! */
|
||||
if (mch_windows95() && dlgwidth < TEAROFF_MIN_WIDTH)
|
||||
dlgwidth = TEAROFF_MIN_WIDTH;
|
||||
|
||||
/* start to fill in the dlgtemplate information. addressing by WORDs */
|
||||
if (s_usenewlook)
|
||||
lStyle = DS_MODALFRAME | WS_CAPTION| WS_SYSMENU |DS_SETFONT| WS_VISIBLE;
|
||||
@@ -8299,7 +8049,7 @@ get_toolbar_bitmap(vimmenu_T *menu)
|
||||
/*
|
||||
* Check user bitmaps first, unless builtin is specified.
|
||||
*/
|
||||
if (!is_winnt_3() && !menu->icon_builtin)
|
||||
if (!menu->icon_builtin)
|
||||
{
|
||||
char_u fname[MAXPATHL];
|
||||
HANDLE hbitmap = NULL;
|
||||
@@ -8556,12 +8306,6 @@ gui_mch_register_sign(char_u *signfile)
|
||||
signicon_t sign, *psign;
|
||||
char_u *ext;
|
||||
|
||||
if (is_winnt_3())
|
||||
{
|
||||
EMSG(_(e_signdata));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
sign.hImage = NULL;
|
||||
ext = signfile + STRLEN(signfile) - 4; /* get extension */
|
||||
if (ext > signfile)
|
||||
|
||||
+6
-15
@@ -839,14 +839,10 @@ cs_create_connection(int i)
|
||||
HANDLE stdin_rd, stdout_rd;
|
||||
HANDLE stdout_wr, stdin_wr;
|
||||
BOOL created;
|
||||
# ifdef __BORLANDC__
|
||||
# define OPEN_OH_ARGTYPE long
|
||||
# if (defined(_MSC_VER) && (_MSC_VER >= 1300)) || defined(__MINGW32__)
|
||||
# define OPEN_OH_ARGTYPE intptr_t
|
||||
# else
|
||||
# if (_MSC_VER >= 1300) || defined(__MINGW32__)
|
||||
# define OPEN_OH_ARGTYPE intptr_t
|
||||
# else
|
||||
# define OPEN_OH_ARGTYPE long
|
||||
# endif
|
||||
# define OPEN_OH_ARGTYPE long
|
||||
# endif
|
||||
#endif
|
||||
|
||||
@@ -1427,11 +1423,8 @@ cs_insert_filelist(
|
||||
#ifndef UNIX
|
||||
BY_HANDLE_FILE_INFORMATION bhfi;
|
||||
|
||||
/* On windows 9x GetFileInformationByHandle doesn't work, so skip it */
|
||||
if (!mch_windows95())
|
||||
switch (win32_fileinfo((char_u *)fname, &bhfi))
|
||||
{
|
||||
switch (win32_fileinfo((char_u *)fname, &bhfi))
|
||||
{
|
||||
case FILEINFO_ENC_FAIL: /* enc_to_utf16() failed */
|
||||
case FILEINFO_READ_FAIL: /* CreateFile() failed */
|
||||
if (p_csverbose)
|
||||
@@ -1454,7 +1447,6 @@ cs_insert_filelist(
|
||||
if (p_csverbose)
|
||||
(void)EMSG(_("E626: cannot get cscope database information"));
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1468,9 +1460,8 @@ cs_insert_filelist(
|
||||
/* compare pathnames first */
|
||||
&& ((fullpathcmp((char_u *)csinfo[j].fname,
|
||||
(char_u *)fname, FALSE) & FPC_SAME)
|
||||
/* if not Windows 9x, test index file attributes too */
|
||||
|| (!mch_windows95()
|
||||
&& csinfo[j].nVolume == bhfi.dwVolumeSerialNumber
|
||||
/* test index file attributes too */
|
||||
|| (csinfo[j].nVolume == bhfi.dwVolumeSerialNumber
|
||||
&& csinfo[j].nIndexHigh == bhfi.nFileIndexHigh
|
||||
&& csinfo[j].nIndexLow == bhfi.nFileIndexLow))
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -861,7 +861,7 @@ json_decode_item(js_read_T *reader, typval_T *res, int options)
|
||||
break;
|
||||
}
|
||||
|
||||
if (res != NUL)
|
||||
if (res != NULL)
|
||||
{
|
||||
res->v_type = VAR_SPECIAL;
|
||||
res->vval.v_number = VVAL_NONE;
|
||||
|
||||
+2
-1
@@ -1597,7 +1597,8 @@ handle_viminfo_mark(garray_T *values, int force)
|
||||
|
||||
if (fm != NULL)
|
||||
{
|
||||
if (vi_namedfm != NULL || fm->time_set < timestamp || force)
|
||||
if (vi_namedfm != NULL || fm->fmark.mark.lnum == 0
|
||||
|| fm->time_set < timestamp || force)
|
||||
{
|
||||
fm->fmark.mark.lnum = lnum;
|
||||
fm->fmark.mark.col = col;
|
||||
|
||||
+1
-4
@@ -9456,10 +9456,7 @@ prepare_to_exit(void)
|
||||
* screen (if there are two screens).
|
||||
*/
|
||||
settmode(TMODE_COOK);
|
||||
#ifdef WIN3264
|
||||
if (can_end_termcap_mode(FALSE) == TRUE)
|
||||
#endif
|
||||
stoptermcap();
|
||||
stoptermcap();
|
||||
out_flush();
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -1420,7 +1420,7 @@ vim_strsave_shellescape(char_u *string, int do_special, int do_newline)
|
||||
length = (unsigned)STRLEN(string) + 3; /* two quotes and a trailing NUL */
|
||||
for (p = string; *p != NUL; mb_ptr_adv(p))
|
||||
{
|
||||
# if defined(WIN32) || defined(DOS)
|
||||
# ifdef WIN32
|
||||
if (!p_ssl)
|
||||
{
|
||||
if (*p == '"')
|
||||
@@ -1451,7 +1451,7 @@ vim_strsave_shellescape(char_u *string, int do_special, int do_newline)
|
||||
d = escaped_string;
|
||||
|
||||
/* add opening quote */
|
||||
# if defined(WIN32) || defined(DOS)
|
||||
# ifdef WIN32
|
||||
if (!p_ssl)
|
||||
*d++ = '"';
|
||||
else
|
||||
@@ -1460,7 +1460,7 @@ vim_strsave_shellescape(char_u *string, int do_special, int do_newline)
|
||||
|
||||
for (p = string; *p != NUL; )
|
||||
{
|
||||
# if defined(WIN32) || defined(DOS)
|
||||
# ifdef WIN32
|
||||
if (!p_ssl)
|
||||
{
|
||||
if (*p == '"')
|
||||
@@ -1503,7 +1503,7 @@ vim_strsave_shellescape(char_u *string, int do_special, int do_newline)
|
||||
}
|
||||
|
||||
/* add terminating quote and finish with a NUL */
|
||||
# if defined(WIN32) || defined(DOS)
|
||||
# ifdef WIN32
|
||||
if (!p_ssl)
|
||||
*d++ = '"';
|
||||
else
|
||||
|
||||
+2
-5
@@ -2853,11 +2853,8 @@ do_check_cursorbind(void)
|
||||
{
|
||||
# ifdef FEAT_DIFF
|
||||
if (curwin->w_p_diff)
|
||||
curwin->w_cursor.lnum
|
||||
= diff_get_corresponding_line(old_curbuf,
|
||||
line,
|
||||
curbuf,
|
||||
curwin->w_cursor.lnum);
|
||||
curwin->w_cursor.lnum =
|
||||
diff_get_corresponding_line(old_curbuf, line);
|
||||
else
|
||||
# endif
|
||||
curwin->w_cursor.lnum = line;
|
||||
|
||||
+75
-7
@@ -4244,6 +4244,52 @@ nv_gd(
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE if line[offset] is not inside a C-style comment or string, FALSE
|
||||
* otherwise.
|
||||
*/
|
||||
static int
|
||||
is_ident(char_u *line, int offset)
|
||||
{
|
||||
int i;
|
||||
int incomment = FALSE;
|
||||
int instring = 0;
|
||||
int prev = 0;
|
||||
|
||||
for (i = 0; i < offset && line[i] != NUL; i++)
|
||||
{
|
||||
if (instring != 0)
|
||||
{
|
||||
if (prev != '\\' && line[i] == instring)
|
||||
instring = 0;
|
||||
}
|
||||
else if ((line[i] == '"' || line[i] == '\'') && !incomment)
|
||||
{
|
||||
instring = line[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (incomment)
|
||||
{
|
||||
if (prev == '*' && line[i] == '/')
|
||||
incomment = FALSE;
|
||||
}
|
||||
else if (prev == '/' && line[i] == '*')
|
||||
{
|
||||
incomment = TRUE;
|
||||
}
|
||||
else if (prev == '/' && line[i] == '/')
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
prev = line[i];
|
||||
}
|
||||
|
||||
return incomment == FALSE && instring == 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Search for variable declaration of "ptr[len]".
|
||||
* When "locally" is TRUE in the current function ("gd"), otherwise in the
|
||||
@@ -4269,6 +4315,7 @@ find_decl(
|
||||
int retval = OK;
|
||||
int incll;
|
||||
int searchflags = flags_arg;
|
||||
int valid;
|
||||
|
||||
if ((pat = alloc(len + 7)) == NULL)
|
||||
return FAIL;
|
||||
@@ -4306,6 +4353,7 @@ find_decl(
|
||||
clearpos(&found_pos);
|
||||
for (;;)
|
||||
{
|
||||
valid = FALSE;
|
||||
t = searchit(curwin, curbuf, &curwin->w_cursor, FORWARD,
|
||||
pat, 1L, searchflags, RE_LAST, (linenr_T)0, NULL);
|
||||
if (curwin->w_cursor.lnum >= old_pos.lnum)
|
||||
@@ -4342,9 +4390,20 @@ find_decl(
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
if (!locally) /* global search: use first match found */
|
||||
valid = is_ident(ml_get_curline(), curwin->w_cursor.col);
|
||||
|
||||
/* If the current position is not a valid identifier and a previous
|
||||
* match is present, favor that one instead. */
|
||||
if (!valid && found_pos.lnum != 0)
|
||||
{
|
||||
curwin->w_cursor = found_pos;
|
||||
break;
|
||||
if (curwin->w_cursor.lnum >= par_pos.lnum)
|
||||
}
|
||||
|
||||
/* Global search: use first valid match found */
|
||||
if (valid && !locally)
|
||||
break;
|
||||
if (valid && curwin->w_cursor.lnum >= par_pos.lnum)
|
||||
{
|
||||
/* If we previously found a valid position, use it. */
|
||||
if (found_pos.lnum != 0)
|
||||
@@ -4352,11 +4411,20 @@ find_decl(
|
||||
break;
|
||||
}
|
||||
|
||||
/* For finding a local variable and the match is before the "{" search
|
||||
* to find a later match. For K&R style function declarations this
|
||||
* skips the function header without types. Remove SEARCH_START from
|
||||
* flags to avoid getting stuck at one position. */
|
||||
found_pos = curwin->w_cursor;
|
||||
/* For finding a local variable and the match is before the "{" or
|
||||
* inside a comment, continue searching. For K&R style function
|
||||
* declarations this skips the function header without types. */
|
||||
if (!valid)
|
||||
{
|
||||
/* Braces needed due to macro expansion of clearpos. */
|
||||
clearpos(&found_pos);
|
||||
}
|
||||
else
|
||||
{
|
||||
found_pos = curwin->w_cursor;
|
||||
}
|
||||
/* Remove SEARCH_START from flags to avoid getting stuck at one
|
||||
* position. */
|
||||
searchflags &= ~SEARCH_START;
|
||||
}
|
||||
|
||||
|
||||
+15
-9
@@ -22,7 +22,7 @@
|
||||
* - If it's a list of flags, add some code in do_set(), search for WW_ALL.
|
||||
* - When adding an option with expansion (P_EXPAND), but with a different
|
||||
* default for Vi and Vim (no P_VI_DEF), add some code at VIMEXP.
|
||||
* - Add documentation! One line in doc/help.txt, full description in
|
||||
* - Add documentation! One line in doc/quickref.txt, full description in
|
||||
* options.txt, and any other related places.
|
||||
* - Add an entry in runtime/optwin.vim.
|
||||
* When making changes:
|
||||
@@ -10119,13 +10119,7 @@ clear_termoptions(void)
|
||||
if (gui.starting)
|
||||
clear_xterm_clip();
|
||||
#endif
|
||||
#ifdef WIN3264
|
||||
/*
|
||||
* Check if this is allowed now.
|
||||
*/
|
||||
if (can_end_termcap_mode(FALSE) == TRUE)
|
||||
#endif
|
||||
stoptermcap(); /* stop termcap mode */
|
||||
stoptermcap(); /* stop termcap mode */
|
||||
|
||||
free_termoptions();
|
||||
}
|
||||
@@ -10913,7 +10907,19 @@ buf_copy_options(buf_T *buf, int flags)
|
||||
#ifdef FEAT_MBYTE
|
||||
buf->b_p_fenc = vim_strsave(p_fenc);
|
||||
#endif
|
||||
buf->b_p_ff = vim_strsave(p_ff);
|
||||
switch (*p_ffs)
|
||||
{
|
||||
case 'm':
|
||||
buf->b_p_ff = vim_strsave((char_u *)FF_MAC); break;
|
||||
case 'd':
|
||||
buf->b_p_ff = vim_strsave((char_u *)FF_DOS); break;
|
||||
case 'u':
|
||||
buf->b_p_ff = vim_strsave((char_u *)FF_UNIX); break;
|
||||
default:
|
||||
buf->b_p_ff = vim_strsave(p_ff);
|
||||
}
|
||||
if (buf->b_p_ff != NULL)
|
||||
buf->b_start_ffc = *buf->b_p_ff;
|
||||
#if defined(FEAT_QUICKFIX)
|
||||
buf->b_p_bh = empty_option;
|
||||
buf->b_p_bt = empty_option;
|
||||
|
||||
+11
-79
@@ -38,11 +38,7 @@
|
||||
|
||||
# if defined(FEAT_PRINTER) && !defined(FEAT_POSTSCRIPT)
|
||||
# include <dlgs.h>
|
||||
# ifdef WIN3264
|
||||
# include <winspool.h>
|
||||
# else
|
||||
# include <print.h>
|
||||
# endif
|
||||
# include <winspool.h>
|
||||
# include <commdlg.h>
|
||||
#endif
|
||||
|
||||
@@ -130,10 +126,6 @@ typedef void VOID;
|
||||
FILE* fdDump = NULL;
|
||||
#endif
|
||||
|
||||
#ifdef WIN3264
|
||||
extern DWORD g_PlatformId;
|
||||
#endif
|
||||
|
||||
#ifndef FEAT_GUI_MSWIN
|
||||
extern char g_szOrigTitle[];
|
||||
#endif
|
||||
@@ -248,20 +240,13 @@ mch_early_init(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
#ifdef WIN3264
|
||||
PlatformId();
|
||||
#endif
|
||||
|
||||
/* Init the tables for toupper() and tolower() */
|
||||
for (i = 0; i < 256; ++i)
|
||||
toupper_tab[i] = tolower_tab[i] = i;
|
||||
#ifdef WIN3264
|
||||
CharUpperBuff((LPSTR)toupper_tab, 256);
|
||||
CharLowerBuff((LPSTR)tolower_tab, 256);
|
||||
#else
|
||||
AnsiUpperBuff((LPSTR)toupper_tab, 256);
|
||||
AnsiLowerBuff((LPSTR)tolower_tab, 256);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -299,14 +284,12 @@ mch_settitle(
|
||||
{
|
||||
/* Convert the title from 'encoding' to the active codepage. */
|
||||
WCHAR *wp = enc_to_utf16(title, NULL);
|
||||
int n;
|
||||
|
||||
if (wp != NULL)
|
||||
{
|
||||
n = SetConsoleTitleW(wp);
|
||||
SetConsoleTitleW(wp);
|
||||
vim_free(wp);
|
||||
if (n != 0 || GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
|
||||
return;
|
||||
return;
|
||||
}
|
||||
}
|
||||
# endif
|
||||
@@ -379,12 +362,7 @@ mch_FullName(
|
||||
#endif
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
if (enc_codepage >= 0 && (int)GetACP() != enc_codepage
|
||||
# ifdef __BORLANDC__
|
||||
/* Wide functions of Borland C 5.5 do not work on Windows 98. */
|
||||
&& g_PlatformId == VER_PLATFORM_WIN32_NT
|
||||
# endif
|
||||
)
|
||||
if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
|
||||
{
|
||||
WCHAR *wname;
|
||||
WCHAR wbuf[MAX_PATH];
|
||||
@@ -641,12 +619,7 @@ vim_stat(const char *name, stat_T *stp)
|
||||
}
|
||||
}
|
||||
#ifdef FEAT_MBYTE
|
||||
if (enc_codepage >= 0 && (int)GetACP() != enc_codepage
|
||||
# ifdef __BORLANDC__
|
||||
/* Wide functions of Borland C 5.5 do not work on Windows 98. */
|
||||
&& g_PlatformId == VER_PLATFORM_WIN32_NT
|
||||
# endif
|
||||
)
|
||||
if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
|
||||
{
|
||||
WCHAR *wp = enc_to_utf16(buf, NULL);
|
||||
int n;
|
||||
@@ -655,11 +628,7 @@ vim_stat(const char *name, stat_T *stp)
|
||||
{
|
||||
n = wstat_symlink_aware(wp, stp);
|
||||
vim_free(wp);
|
||||
if (n >= 0 || g_PlatformId == VER_PLATFORM_WIN32_NT)
|
||||
return n;
|
||||
/* Retry with non-wide function (for Windows 98). Can't use
|
||||
* GetLastError() here and it's unclear what errno gets set to if
|
||||
* the _wstat() fails for missing wide functions. */
|
||||
return n;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -823,9 +792,7 @@ mch_chdir(char *path)
|
||||
{
|
||||
n = _wchdir(p);
|
||||
vim_free(p);
|
||||
if (n == 0 || g_PlatformId == VER_PLATFORM_WIN32_NT)
|
||||
return n;
|
||||
/* Retry with non-wide function (for Windows 98). */
|
||||
return n;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -834,27 +801,6 @@ mch_chdir(char *path)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Switching off termcap mode is only allowed when Columns is 80, otherwise a
|
||||
* crash may result. It's always allowed on NT or when running the GUI.
|
||||
*/
|
||||
/*ARGSUSED*/
|
||||
int
|
||||
can_end_termcap_mode(
|
||||
int give_msg)
|
||||
{
|
||||
#ifdef FEAT_GUI_MSWIN
|
||||
return TRUE; /* GUI starts a new console anyway */
|
||||
#else
|
||||
if (g_PlatformId == VER_PLATFORM_WIN32_NT || Columns == 80)
|
||||
return TRUE;
|
||||
if (give_msg)
|
||||
msg((char_u *)
|
||||
_("'columns' is not 80, cannot execute external commands"));
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef FEAT_GUI_MSWIN
|
||||
/*
|
||||
* return non-zero if a character is available
|
||||
@@ -887,17 +833,10 @@ mch_screenmode(
|
||||
* and returns an allocated string.
|
||||
* Return OK if it worked, FAIL if not.
|
||||
*/
|
||||
# ifdef WIN3264
|
||||
typedef LPTSTR (*MYSTRPROCSTR)(LPTSTR);
|
||||
typedef LPTSTR (*MYINTPROCSTR)(int);
|
||||
typedef int (*MYSTRPROCINT)(LPTSTR);
|
||||
typedef int (*MYINTPROCINT)(int);
|
||||
# else
|
||||
typedef LPSTR (*MYSTRPROCSTR)(LPSTR);
|
||||
typedef LPSTR (*MYINTPROCSTR)(int);
|
||||
typedef int (*MYSTRPROCINT)(LPSTR);
|
||||
typedef int (*MYINTPROCINT)(int);
|
||||
# endif
|
||||
|
||||
/*
|
||||
* Check if a pointer points to a valid NUL terminated string.
|
||||
@@ -1093,7 +1032,7 @@ Trace(
|
||||
#endif //_DEBUG
|
||||
|
||||
#if !defined(FEAT_GUI) || defined(PROTO)
|
||||
# if defined(FEAT_TITLE) && defined(WIN3264)
|
||||
# ifdef FEAT_TITLE
|
||||
extern HWND g_hWnd; /* This is in os_win32.c. */
|
||||
# endif
|
||||
|
||||
@@ -1114,7 +1053,7 @@ GetConsoleHwnd(void)
|
||||
if (s_hwnd != 0)
|
||||
return;
|
||||
|
||||
# if defined(FEAT_TITLE) && defined(WIN3264)
|
||||
# ifdef FEAT_TITLE
|
||||
/* Window handle may have been found by init code (Windows NT only) */
|
||||
if (g_hWnd != 0)
|
||||
{
|
||||
@@ -1539,7 +1478,6 @@ mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit)
|
||||
)
|
||||
{
|
||||
prt_dlg.Flags |= PD_RETURNDEFAULT;
|
||||
#ifdef WIN3264
|
||||
/*
|
||||
* MSDN suggests setting the first parameter to WINSPOOL for
|
||||
* NT, but NULL appears to work just as well.
|
||||
@@ -1547,7 +1485,6 @@ mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit)
|
||||
if (*p_pdev != NUL)
|
||||
prt_dlg.hDC = CreateDC(NULL, (LPCSTR)p_pdev, NULL, NULL);
|
||||
else
|
||||
#endif
|
||||
{
|
||||
prt_dlg.Flags |= PD_RETURNDEFAULT;
|
||||
if (PrintDlg(&prt_dlg) == 0)
|
||||
@@ -1593,10 +1530,8 @@ mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit)
|
||||
mem = (DEVMODE *)GlobalLock(prt_dlg.hDevMode);
|
||||
if (mem != NULL)
|
||||
{
|
||||
#ifdef WIN3264
|
||||
if (mem->dmCopies != 1)
|
||||
stored_nCopies = mem->dmCopies;
|
||||
#endif
|
||||
if ((mem->dmFields & DM_DUPLEX) && (mem->dmDuplex & ~DMDUP_SIMPLEX))
|
||||
psettings->duplex = TRUE;
|
||||
if ((mem->dmFields & DM_COLOR) && (mem->dmColor & DMCOLOR_COLOR))
|
||||
@@ -1953,7 +1888,7 @@ shortcut_errorw:
|
||||
goto shortcut_end;
|
||||
}
|
||||
}
|
||||
/* Retry with non-wide function (for Windows 98). */
|
||||
goto shortcut_end;
|
||||
}
|
||||
# endif
|
||||
// create a link manager object and request its interface
|
||||
@@ -2681,7 +2616,6 @@ charset_pairs[] =
|
||||
{"OEM", OEM_CHARSET},
|
||||
{"SHIFTJIS", SHIFTJIS_CHARSET},
|
||||
{"SYMBOL", SYMBOL_CHARSET},
|
||||
#ifdef WIN3264
|
||||
{"ARABIC", ARABIC_CHARSET},
|
||||
{"BALTIC", BALTIC_CHARSET},
|
||||
{"EASTEUROPE", EASTEUROPE_CHARSET},
|
||||
@@ -2693,10 +2627,8 @@ charset_pairs[] =
|
||||
{"RUSSIAN", RUSSIAN_CHARSET},
|
||||
{"THAI", THAI_CHARSET},
|
||||
{"TURKISH", TURKISH_CHARSET},
|
||||
# if (!defined(_MSC_VER) || (_MSC_VER > 1010)) \
|
||||
&& (!defined(__BORLANDC__) || (__BORLANDC__ > 0x0500))
|
||||
#ifdef VIETNAMESE_CHARSET
|
||||
{"VIETNAMESE", VIETNAMESE_CHARSET},
|
||||
# endif
|
||||
#endif
|
||||
{NULL, 0}
|
||||
};
|
||||
|
||||
+104
-9
@@ -211,6 +211,15 @@ static RETSIGTYPE deathtrap SIGPROTOARG;
|
||||
static void catch_int_signal(void);
|
||||
static void set_signals(void);
|
||||
static void catch_signals(RETSIGTYPE (*func_deadly)(), RETSIGTYPE (*func_other)());
|
||||
#ifdef HAVE_SIGPROCMASK
|
||||
# define SIGSET_DECL(set) sigset_t set;
|
||||
# define BLOCK_SIGNALS(set) block_signals(set)
|
||||
# define UNBLOCK_SIGNALS(set) unblock_signals(set)
|
||||
#else
|
||||
# define SIGSET_DECL(set)
|
||||
# define BLOCK_SIGNALS(set) do { /**/ } while (0)
|
||||
# define UNBLOCK_SIGNALS(set) do { /**/ } while (0)
|
||||
#endif
|
||||
static int have_wildcard(int, char_u **);
|
||||
static int have_dollars(int, char_u **);
|
||||
|
||||
@@ -1468,6 +1477,33 @@ catch_signals(
|
||||
signal(signal_info[i].sig, func_other);
|
||||
}
|
||||
|
||||
#ifdef HAVE_SIGPROCMASK
|
||||
static void
|
||||
block_signals(sigset_t *set)
|
||||
{
|
||||
sigset_t newset;
|
||||
int i;
|
||||
|
||||
sigemptyset(&newset);
|
||||
|
||||
for (i = 0; signal_info[i].sig != -1; i++)
|
||||
sigaddset(&newset, signal_info[i].sig);
|
||||
|
||||
# if defined(_REENTRANT) && defined(SIGCONT)
|
||||
/* SIGCONT isn't in the list, because its default action is ignore */
|
||||
sigaddset(&newset, SIGCONT);
|
||||
# endif
|
||||
|
||||
sigprocmask(SIG_BLOCK, &newset, set);
|
||||
}
|
||||
|
||||
static void
|
||||
unblock_signals(sigset_t *set)
|
||||
{
|
||||
sigprocmask(SIG_SETMASK, set, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Handling of SIGHUP, SIGQUIT and SIGTERM:
|
||||
* "when" == a signal: when busy, postpone and return FALSE, otherwise
|
||||
@@ -2263,6 +2299,7 @@ use_xterm_like_mouse(char_u *name)
|
||||
return (name != NULL
|
||||
&& (term_is_xterm
|
||||
|| STRNICMP(name, "screen", 6) == 0
|
||||
|| STRNICMP(name, "tmux", 4) == 0
|
||||
|| STRICMP(name, "st") == 0
|
||||
|| STRNICMP(name, "st-", 3) == 0
|
||||
|| STRNICMP(name, "stterm", 6) == 0));
|
||||
@@ -2326,6 +2363,7 @@ vim_is_fastterm(char_u *name)
|
||||
return ( STRNICMP(name, "hpterm", 6) == 0
|
||||
|| STRNICMP(name, "sun-cmd", 7) == 0
|
||||
|| STRNICMP(name, "screen", 6) == 0
|
||||
|| STRNICMP(name, "tmux", 4) == 0
|
||||
|| STRNICMP(name, "dtterm", 6) == 0);
|
||||
}
|
||||
|
||||
@@ -4299,12 +4337,18 @@ mch_call_shell(
|
||||
|
||||
if (!pipe_error) /* pty or pipe opened or not used */
|
||||
{
|
||||
SIGSET_DECL(curset)
|
||||
|
||||
# ifdef __BEOS__
|
||||
beos_cleanup_read_thread();
|
||||
# endif
|
||||
|
||||
if ((pid = fork()) == -1) /* maybe we should use vfork() */
|
||||
BLOCK_SIGNALS(&curset);
|
||||
pid = fork(); /* maybe we should use vfork() */
|
||||
if (pid == -1)
|
||||
{
|
||||
UNBLOCK_SIGNALS(&curset);
|
||||
|
||||
MSG_PUTS(_("\nCannot fork\n"));
|
||||
if ((options & (SHELL_READ|SHELL_WRITE))
|
||||
# ifdef FEAT_GUI
|
||||
@@ -4331,6 +4375,7 @@ mch_call_shell(
|
||||
else if (pid == 0) /* child */
|
||||
{
|
||||
reset_signals(); /* handle signals normally */
|
||||
UNBLOCK_SIGNALS(&curset);
|
||||
|
||||
if (!show_shell_mess || (options & SHELL_EXPAND))
|
||||
{
|
||||
@@ -4474,6 +4519,7 @@ mch_call_shell(
|
||||
*/
|
||||
catch_signals(SIG_IGN, SIG_ERR);
|
||||
catch_int_signal();
|
||||
UNBLOCK_SIGNALS(&curset);
|
||||
|
||||
/*
|
||||
* For the GUI we redirect stdin, stdout and stderr to our window.
|
||||
@@ -5089,6 +5135,7 @@ mch_start_job(char **argv, job_T *job, jobopt_T *options UNUSED)
|
||||
int use_file_for_out = options->jo_io[PART_OUT] == JIO_FILE;
|
||||
int use_file_for_err = options->jo_io[PART_ERR] == JIO_FILE;
|
||||
int use_out_for_err = options->jo_io[PART_ERR] == JIO_OUT;
|
||||
SIGSET_DECL(curset)
|
||||
|
||||
if (use_out_for_err && use_null_for_out)
|
||||
use_null_for_err = TRUE;
|
||||
@@ -5160,13 +5207,14 @@ mch_start_job(char **argv, job_T *job, jobopt_T *options UNUSED)
|
||||
goto failed;
|
||||
}
|
||||
|
||||
BLOCK_SIGNALS(&curset);
|
||||
pid = fork(); /* maybe we should use vfork() */
|
||||
if (pid == -1)
|
||||
if (pid == -1)
|
||||
{
|
||||
/* failed to fork */
|
||||
UNBLOCK_SIGNALS(&curset);
|
||||
goto failed;
|
||||
}
|
||||
|
||||
if (pid == 0)
|
||||
{
|
||||
int null_fd = -1;
|
||||
@@ -5174,6 +5222,7 @@ mch_start_job(char **argv, job_T *job, jobopt_T *options UNUSED)
|
||||
|
||||
/* child */
|
||||
reset_signals(); /* handle signals normally */
|
||||
UNBLOCK_SIGNALS(&curset);
|
||||
|
||||
# ifdef HAVE_SETSID
|
||||
/* Create our own process group, so that the child and all its
|
||||
@@ -5254,6 +5303,8 @@ mch_start_job(char **argv, job_T *job, jobopt_T *options UNUSED)
|
||||
}
|
||||
|
||||
/* parent */
|
||||
UNBLOCK_SIGNALS(&curset);
|
||||
|
||||
job->jv_pid = pid;
|
||||
job->jv_status = JOB_STARTED;
|
||||
job->jv_channel = channel; /* ch_refcount was set above */
|
||||
@@ -5314,8 +5365,7 @@ mch_job_status(job_T *job)
|
||||
if (wait_pid == -1)
|
||||
{
|
||||
/* process must have exited */
|
||||
job->jv_status = JOB_ENDED;
|
||||
return "dead";
|
||||
goto return_dead;
|
||||
}
|
||||
if (wait_pid == 0)
|
||||
return "run";
|
||||
@@ -5323,16 +5373,61 @@ mch_job_status(job_T *job)
|
||||
{
|
||||
/* LINTED avoid "bitwise operation on signed value" */
|
||||
job->jv_exitval = WEXITSTATUS(status);
|
||||
job->jv_status = JOB_ENDED;
|
||||
return "dead";
|
||||
goto return_dead;
|
||||
}
|
||||
if (WIFSIGNALED(status))
|
||||
{
|
||||
job->jv_exitval = -1;
|
||||
job->jv_status = JOB_ENDED;
|
||||
return "dead";
|
||||
goto return_dead;
|
||||
}
|
||||
return "run";
|
||||
|
||||
return_dead:
|
||||
if (job->jv_status != JOB_ENDED)
|
||||
{
|
||||
ch_log(job->jv_channel, "Job ended");
|
||||
job->jv_status = JOB_ENDED;
|
||||
}
|
||||
return "dead";
|
||||
}
|
||||
|
||||
job_T *
|
||||
mch_detect_ended_job(job_T *job_list)
|
||||
{
|
||||
# ifdef HAVE_UNION_WAIT
|
||||
union wait status;
|
||||
# else
|
||||
int status = -1;
|
||||
# endif
|
||||
pid_t wait_pid = 0;
|
||||
job_T *job;
|
||||
|
||||
# ifdef __NeXT__
|
||||
wait_pid = wait4(-1, &status, WNOHANG, (struct rusage *)0);
|
||||
# else
|
||||
wait_pid = waitpid(-1, &status, WNOHANG);
|
||||
# endif
|
||||
if (wait_pid <= 0)
|
||||
/* no process ended */
|
||||
return NULL;
|
||||
for (job = job_list; job != NULL; job = job->jv_next)
|
||||
{
|
||||
if (job->jv_pid == wait_pid)
|
||||
{
|
||||
if (WIFEXITED(status))
|
||||
/* LINTED avoid "bitwise operation on signed value" */
|
||||
job->jv_exitval = WEXITSTATUS(status);
|
||||
else if (WIFSIGNALED(status))
|
||||
job->jv_exitval = -1;
|
||||
if (job->jv_status != JOB_ENDED)
|
||||
{
|
||||
ch_log(job->jv_channel, "Job ended");
|
||||
job->jv_status = JOB_ENDED;
|
||||
}
|
||||
return job;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
+205
-545
File diff suppressed because it is too large
Load Diff
+4
-9
@@ -210,20 +210,15 @@ Trace(char *pszFormat, ...);
|
||||
# define vim_mkdir(x, y) mch_mkdir(x)
|
||||
#endif
|
||||
|
||||
#ifndef PROTO
|
||||
|
||||
/* Enable common dialogs input unicode from IME if possible. */
|
||||
#ifdef FEAT_MBYTE
|
||||
/* The variables are defined in os_win32.c. */
|
||||
extern LRESULT (WINAPI *pDispatchMessage)(CONST MSG *);
|
||||
extern BOOL (WINAPI *pGetMessage)(LPMSG, HWND, UINT, UINT);
|
||||
extern BOOL (WINAPI *pIsDialogMessage)(HWND, LPMSG);
|
||||
extern BOOL (WINAPI *pPeekMessage)(LPMSG, HWND, UINT, UINT, UINT);
|
||||
# define pDispatchMessage DispatchMessageW
|
||||
# define pGetMessage GetMessageW
|
||||
# define pIsDialogMessage IsDialogMessageW
|
||||
# define pPeekMessage PeekMessageW
|
||||
#else
|
||||
# define pDispatchMessage DispatchMessage
|
||||
# define pGetMessage GetMessage
|
||||
# define pIsDialogMessage IsDialogMessage
|
||||
# define pPeekMessage PeekMessage
|
||||
#endif
|
||||
|
||||
#endif /* PROTO */
|
||||
|
||||
+15
-16
@@ -14,15 +14,15 @@ channel_T *channel_open_func(typval_T *argvars);
|
||||
void channel_set_pipes(channel_T *channel, sock_T in, sock_T out, sock_T err);
|
||||
void channel_set_job(channel_T *channel, job_T *job, jobopt_T *options);
|
||||
void channel_set_options(channel_T *channel, jobopt_T *opt);
|
||||
void channel_set_req_callback(channel_T *channel, int part, char_u *callback, partial_T *partial, int id);
|
||||
void channel_set_req_callback(channel_T *channel, ch_part_T part, char_u *callback, partial_T *partial, int id);
|
||||
void channel_buffer_free(buf_T *buf);
|
||||
void channel_write_any_lines(void);
|
||||
void channel_write_new_lines(buf_T *buf);
|
||||
readq_T *channel_peek(channel_T *channel, int part);
|
||||
readq_T *channel_peek(channel_T *channel, ch_part_T part);
|
||||
char_u *channel_first_nl(readq_T *node);
|
||||
char_u *channel_get(channel_T *channel, int part);
|
||||
void channel_consume(channel_T *channel, int part, int len);
|
||||
int channel_collapse(channel_T *channel, int part, int want_nl);
|
||||
char_u *channel_get(channel_T *channel, ch_part_T part);
|
||||
void channel_consume(channel_T *channel, ch_part_T part, int len);
|
||||
int channel_collapse(channel_T *channel, ch_part_T part, int want_nl);
|
||||
int channel_can_write_to(channel_T *channel);
|
||||
int channel_is_open(channel_T *channel);
|
||||
char *channel_status(channel_T *channel, int req_part);
|
||||
@@ -31,13 +31,12 @@ 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, int part, int timeout);
|
||||
int channel_read_json_block(channel_T *channel, int part, int timeout_arg, int id, typval_T **rettv);
|
||||
char_u *channel_read_block(channel_T *channel, ch_part_T part, int timeout);
|
||||
int channel_read_json_block(channel_T *channel, ch_part_T part, int timeout_arg, int id, typval_T **rettv);
|
||||
void common_channel_read(typval_T *argvars, typval_T *rettv, int raw);
|
||||
channel_T *channel_fd2channel(sock_T fd, int *partp);
|
||||
channel_T *channel_fd2channel(sock_T fd, ch_part_T *partp);
|
||||
void channel_handle_events(void);
|
||||
int channel_send(channel_T *channel, int part, char_u *buf, int len, char *fun);
|
||||
channel_T *send_common(typval_T *argvars, char_u *text, int id, int eval, jobopt_T *opt, char *fun, int *part_read);
|
||||
int channel_send(channel_T *channel, ch_part_T part, char_u *buf, int len, char *fun);
|
||||
void ch_expr_common(typval_T *argvars, typval_T *rettv, int eval);
|
||||
void ch_raw_common(typval_T *argvars, typval_T *rettv, int eval);
|
||||
int channel_poll_setup(int nfd_in, void *fds_in);
|
||||
@@ -46,14 +45,14 @@ int channel_select_setup(int maxfd_in, void *rfds_in, void *wfds_in);
|
||||
int channel_select_check(int ret_in, void *rfds_in, void *wfds_in);
|
||||
int channel_parse_messages(void);
|
||||
int set_ref_in_channel(int copyID);
|
||||
int channel_part_send(channel_T *channel);
|
||||
int channel_part_read(channel_T *channel);
|
||||
ch_mode_T channel_get_mode(channel_T *channel, int part);
|
||||
int channel_get_timeout(channel_T *channel, int part);
|
||||
ch_part_T channel_part_send(channel_T *channel);
|
||||
ch_part_T channel_part_read(channel_T *channel);
|
||||
ch_mode_T channel_get_mode(channel_T *channel, ch_part_T part);
|
||||
int channel_get_timeout(channel_T *channel, ch_part_T part);
|
||||
void clear_job_options(jobopt_T *opt);
|
||||
void free_job_options(jobopt_T *opt);
|
||||
int get_job_options(typval_T *tv, jobopt_T *opt, int supported);
|
||||
channel_T *get_channel_arg(typval_T *tv, int check_open, int reading, int part);
|
||||
channel_T *get_channel_arg(typval_T *tv, int check_open, int reading, ch_part_T part);
|
||||
void job_free_all(void);
|
||||
int set_ref_in_job(int copyID);
|
||||
void job_unref(job_T *job);
|
||||
@@ -68,6 +67,6 @@ char *job_status(job_T *job);
|
||||
void job_info(job_T *job, dict_T *dict);
|
||||
int job_stop(job_T *job, typval_T *argvars);
|
||||
#ifdef FEAT_GUI_MACVIM
|
||||
void channel_read(channel_T *channel, int part, char *func);
|
||||
void channel_read(channel_T *channel, ch_part_T part, char *func);
|
||||
#endif
|
||||
/* vim: set ft=c : */
|
||||
|
||||
+1
-1
@@ -22,6 +22,6 @@ void nv_diffgetput(int put, long count);
|
||||
void ex_diffgetput(exarg_T *eap);
|
||||
int diff_mode_buf(buf_T *buf);
|
||||
int diff_move_to(int dir, long count);
|
||||
linenr_T diff_get_corresponding_line(buf_T *buf1, linenr_T lnum1, buf_T *buf2, linenr_T lnum3);
|
||||
linenr_T diff_get_corresponding_line(buf_T *buf1, linenr_T lnum1);
|
||||
linenr_T diff_lnum_win(linenr_T lnum, win_T *wp);
|
||||
/* vim: set ft=c : */
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ char_u *find_word_start(char_u *ptr);
|
||||
char_u *find_word_end(char_u *ptr);
|
||||
int ins_compl_active(void);
|
||||
int ins_compl_add_tv(typval_T *tv, int dir);
|
||||
void ins_compl_check_keys(int frequency);
|
||||
void ins_compl_check_keys(int frequency, int in_compl_func);
|
||||
int get_literal(void);
|
||||
void insertchar(int c, int flags, int second_indent);
|
||||
void auto_format(int trailblank, int prev_line);
|
||||
|
||||
@@ -61,4 +61,5 @@ int put_eol(FILE *fd);
|
||||
int put_line(FILE *fd, char *s);
|
||||
void dialog_msg(char_u *buff, char *format, char_u *fname);
|
||||
char_u *get_behave_arg(expand_T *xp, int idx);
|
||||
char_u *get_messages_arg(expand_T *xp, int idx);
|
||||
/* vim: set ft=c : */
|
||||
|
||||
@@ -233,7 +233,7 @@ gui_mch_replace_dialog(exarg_T *eap);
|
||||
im_set_control(int enable);
|
||||
|
||||
void *
|
||||
gui_macvim_add_channel(channel_T *channel, int part);
|
||||
gui_macvim_add_channel(channel_T *channel, ch_part_T part);
|
||||
void
|
||||
gui_macvim_remove_channel(void *cookie);
|
||||
|
||||
|
||||
@@ -19,7 +19,6 @@ void display_errors(void);
|
||||
int mch_has_exp_wildcard(char_u *p);
|
||||
int mch_has_wildcard(char_u *p);
|
||||
int mch_chdir(char *path);
|
||||
int can_end_termcap_mode(int give_msg);
|
||||
int mch_screenmode(char_u *arg);
|
||||
int mch_icon_load(HANDLE *iconp);
|
||||
int mch_libcall(char_u *libname, char_u *funcname, char_u *argstring, int argint, char_u **string_result, int *number_result);
|
||||
|
||||
@@ -59,6 +59,7 @@ int mch_parse_cmd(char_u *cmd, int use_shcf, char ***argv, int *argc);
|
||||
int mch_call_shell(char_u *cmd, int options);
|
||||
void mch_start_job(char **argv, job_T *job, jobopt_T *options);
|
||||
char *mch_job_status(job_T *job);
|
||||
job_T *mch_detect_ended_job(job_T *job_list);
|
||||
int mch_stop_job(job_T *job, char_u *how);
|
||||
void mch_clear_job(job_T *job);
|
||||
void mch_breakcheck(int force);
|
||||
|
||||
@@ -3,7 +3,6 @@ HINSTANCE vimLoadLib(char *name);
|
||||
int dyn_libintl_init(void);
|
||||
void dyn_libintl_end(void);
|
||||
void PlatformId(void);
|
||||
int mch_windows95(void);
|
||||
void mch_setmouse(int on);
|
||||
void mch_update_cursor(void);
|
||||
int mch_char_avail(void);
|
||||
@@ -42,6 +41,7 @@ void mch_set_winsize_now(void);
|
||||
int mch_call_shell(char_u *cmd, int options);
|
||||
void mch_start_job(char *cmd, job_T *job, jobopt_T *options);
|
||||
char *mch_job_status(job_T *job);
|
||||
job_T *mch_detect_ended_job(job_T *job_list);
|
||||
int mch_stop_job(job_T *job, char_u *how);
|
||||
void mch_clear_job(job_T *job);
|
||||
void mch_set_normal_colors(void);
|
||||
|
||||
+35
-32
@@ -1010,39 +1010,42 @@ restofline:
|
||||
}
|
||||
else if (vim_strchr((char_u *)"CZ", idx) != NULL)
|
||||
{ /* continuation of multi-line msg */
|
||||
qfline_T *qfprev = qi->qf_lists[qi->qf_curlist].qf_last;
|
||||
|
||||
if (qfprev == NULL)
|
||||
return QF_FAIL;
|
||||
if (*fields->errmsg && !qi->qf_multiignore)
|
||||
if (!qi->qf_multiignore)
|
||||
{
|
||||
len = (int)STRLEN(qfprev->qf_text);
|
||||
if ((ptr = alloc((unsigned)(len + STRLEN(fields->errmsg) + 2)))
|
||||
== NULL)
|
||||
return QF_FAIL;
|
||||
STRCPY(ptr, qfprev->qf_text);
|
||||
vim_free(qfprev->qf_text);
|
||||
qfprev->qf_text = ptr;
|
||||
*(ptr += len) = '\n';
|
||||
STRCPY(++ptr, fields->errmsg);
|
||||
}
|
||||
if (qfprev->qf_nr == -1)
|
||||
qfprev->qf_nr = fields->enr;
|
||||
if (vim_isprintc(fields->type) && !qfprev->qf_type)
|
||||
/* only printable chars allowed */
|
||||
qfprev->qf_type = fields->type;
|
||||
qfline_T *qfprev = qi->qf_lists[qi->qf_curlist].qf_last;
|
||||
|
||||
if (!qfprev->qf_lnum)
|
||||
qfprev->qf_lnum = fields->lnum;
|
||||
if (!qfprev->qf_col)
|
||||
qfprev->qf_col = fields->col;
|
||||
qfprev->qf_viscol = fields->use_viscol;
|
||||
if (!qfprev->qf_fnum)
|
||||
qfprev->qf_fnum = qf_get_fnum(qi, qi->qf_directory,
|
||||
*fields->namebuf || qi->qf_directory != NULL
|
||||
? fields->namebuf
|
||||
: qi->qf_currfile != NULL && fields->valid
|
||||
? qi->qf_currfile : 0);
|
||||
if (qfprev == NULL)
|
||||
return QF_FAIL;
|
||||
if (*fields->errmsg && !qi->qf_multiignore)
|
||||
{
|
||||
len = (int)STRLEN(qfprev->qf_text);
|
||||
if ((ptr = alloc((unsigned)(len + STRLEN(fields->errmsg) + 2)))
|
||||
== NULL)
|
||||
return QF_FAIL;
|
||||
STRCPY(ptr, qfprev->qf_text);
|
||||
vim_free(qfprev->qf_text);
|
||||
qfprev->qf_text = ptr;
|
||||
*(ptr += len) = '\n';
|
||||
STRCPY(++ptr, fields->errmsg);
|
||||
}
|
||||
if (qfprev->qf_nr == -1)
|
||||
qfprev->qf_nr = fields->enr;
|
||||
if (vim_isprintc(fields->type) && !qfprev->qf_type)
|
||||
/* only printable chars allowed */
|
||||
qfprev->qf_type = fields->type;
|
||||
|
||||
if (!qfprev->qf_lnum)
|
||||
qfprev->qf_lnum = fields->lnum;
|
||||
if (!qfprev->qf_col)
|
||||
qfprev->qf_col = fields->col;
|
||||
qfprev->qf_viscol = fields->use_viscol;
|
||||
if (!qfprev->qf_fnum)
|
||||
qfprev->qf_fnum = qf_get_fnum(qi, qi->qf_directory,
|
||||
*fields->namebuf || qi->qf_directory != NULL
|
||||
? fields->namebuf
|
||||
: qi->qf_currfile != NULL && fields->valid
|
||||
? qi->qf_currfile : 0);
|
||||
}
|
||||
if (idx == 'Z')
|
||||
qi->qf_multiline = qi->qf_multiignore = FALSE;
|
||||
line_breakcheck();
|
||||
@@ -2263,7 +2266,7 @@ win_found:
|
||||
|
||||
ok = buflist_getfile(qf_ptr->qf_fnum,
|
||||
(linenr_T)1, GETF_SETMARK | GETF_SWITCH, forceit);
|
||||
if (qi != &ql_info && !win_valid(oldwin))
|
||||
if (qi != &ql_info && !win_valid_any_tab(oldwin))
|
||||
{
|
||||
EMSG(_("E924: Current window was closed"));
|
||||
is_abort = TRUE;
|
||||
|
||||
+357
-305
File diff suppressed because it is too large
Load Diff
+95
-94
@@ -5432,7 +5432,7 @@ skip_to_start(int c, colnr_T *colp)
|
||||
char_u *s;
|
||||
|
||||
/* Used often, do some work to avoid call overhead. */
|
||||
if (!ireg_ic
|
||||
if (!rex.reg_ic
|
||||
#ifdef FEAT_MBYTE
|
||||
&& !has_mbyte
|
||||
#endif
|
||||
@@ -5467,7 +5467,7 @@ find_match_text(colnr_T startcol, int regstart, char_u *match_text)
|
||||
{
|
||||
c1 = PTR2CHAR(match_text + len1);
|
||||
c2 = PTR2CHAR(regline + col + len2);
|
||||
if (c1 != c2 && (!ireg_ic || MB_TOLOWER(c1) != MB_TOLOWER(c2)))
|
||||
if (c1 != c2 && (!rex.reg_ic || MB_TOLOWER(c1) != MB_TOLOWER(c2)))
|
||||
{
|
||||
match = FALSE;
|
||||
break;
|
||||
@@ -5485,15 +5485,15 @@ find_match_text(colnr_T startcol, int regstart, char_u *match_text)
|
||||
cleanup_subexpr();
|
||||
if (REG_MULTI)
|
||||
{
|
||||
reg_startpos[0].lnum = reglnum;
|
||||
reg_startpos[0].col = col;
|
||||
reg_endpos[0].lnum = reglnum;
|
||||
reg_endpos[0].col = col + len2;
|
||||
rex.reg_startpos[0].lnum = reglnum;
|
||||
rex.reg_startpos[0].col = col;
|
||||
rex.reg_endpos[0].lnum = reglnum;
|
||||
rex.reg_endpos[0].col = col + len2;
|
||||
}
|
||||
else
|
||||
{
|
||||
reg_startp[0] = regline + col;
|
||||
reg_endp[0] = regline + col + len2;
|
||||
rex.reg_startp[0] = regline + col;
|
||||
rex.reg_endp[0] = regline + col + len2;
|
||||
}
|
||||
return 1L;
|
||||
}
|
||||
@@ -5728,8 +5728,8 @@ nfa_regmatch(
|
||||
{
|
||||
#ifdef FEAT_MBYTE
|
||||
/* If the match ends before a composing characters and
|
||||
* ireg_icombine is not set, that is not really a match. */
|
||||
if (enc_utf8 && !ireg_icombine && utf_iscomposing(curc))
|
||||
* rex.reg_icombine is not set, that is not really a match. */
|
||||
if (enc_utf8 && !rex.reg_icombine && utf_iscomposing(curc))
|
||||
break;
|
||||
#endif
|
||||
nfa_match = TRUE;
|
||||
@@ -6048,16 +6048,16 @@ nfa_regmatch(
|
||||
int this_class;
|
||||
|
||||
/* Get class of current and previous char (if it exists). */
|
||||
this_class = mb_get_class_buf(reginput, reg_buf);
|
||||
this_class = mb_get_class_buf(reginput, rex.reg_buf);
|
||||
if (this_class <= 1)
|
||||
result = FALSE;
|
||||
else if (reg_prev_class() == this_class)
|
||||
result = FALSE;
|
||||
}
|
||||
#endif
|
||||
else if (!vim_iswordc_buf(curc, reg_buf)
|
||||
else if (!vim_iswordc_buf(curc, rex.reg_buf)
|
||||
|| (reginput > regline
|
||||
&& vim_iswordc_buf(reginput[-1], reg_buf)))
|
||||
&& vim_iswordc_buf(reginput[-1], rex.reg_buf)))
|
||||
result = FALSE;
|
||||
if (result)
|
||||
{
|
||||
@@ -6076,16 +6076,16 @@ nfa_regmatch(
|
||||
int this_class, prev_class;
|
||||
|
||||
/* Get class of current and previous char (if it exists). */
|
||||
this_class = mb_get_class_buf(reginput, reg_buf);
|
||||
this_class = mb_get_class_buf(reginput, rex.reg_buf);
|
||||
prev_class = reg_prev_class();
|
||||
if (this_class == prev_class
|
||||
|| prev_class == 0 || prev_class == 1)
|
||||
result = FALSE;
|
||||
}
|
||||
#endif
|
||||
else if (!vim_iswordc_buf(reginput[-1], reg_buf)
|
||||
else if (!vim_iswordc_buf(reginput[-1], rex.reg_buf)
|
||||
|| (reginput[0] != NUL
|
||||
&& vim_iswordc_buf(curc, reg_buf)))
|
||||
&& vim_iswordc_buf(curc, rex.reg_buf)))
|
||||
result = FALSE;
|
||||
if (result)
|
||||
{
|
||||
@@ -6096,7 +6096,7 @@ nfa_regmatch(
|
||||
|
||||
case NFA_BOF:
|
||||
if (reglnum == 0 && reginput == regline
|
||||
&& (!REG_MULTI || reg_firstlnum == 1))
|
||||
&& (!REG_MULTI || rex.reg_firstlnum == 1))
|
||||
{
|
||||
add_here = TRUE;
|
||||
add_state = t->state->out;
|
||||
@@ -6104,7 +6104,7 @@ nfa_regmatch(
|
||||
break;
|
||||
|
||||
case NFA_EOF:
|
||||
if (reglnum == reg_maxline && curc == NUL)
|
||||
if (reglnum == rex.reg_maxline && curc == NUL)
|
||||
{
|
||||
add_here = TRUE;
|
||||
add_state = t->state->out;
|
||||
@@ -6131,7 +6131,7 @@ nfa_regmatch(
|
||||
* (no preceding character). */
|
||||
len += mb_char2len(mc);
|
||||
}
|
||||
if (ireg_icombine && len == 0)
|
||||
if (rex.reg_icombine && len == 0)
|
||||
{
|
||||
/* If \Z was present, then ignore composing characters.
|
||||
* When ignoring the base character this always matches. */
|
||||
@@ -6190,8 +6190,8 @@ nfa_regmatch(
|
||||
#endif
|
||||
|
||||
case NFA_NEWL:
|
||||
if (curc == NUL && !reg_line_lbr && REG_MULTI
|
||||
&& reglnum <= reg_maxline)
|
||||
if (curc == NUL && !rex.reg_line_lbr && REG_MULTI
|
||||
&& reglnum <= rex.reg_maxline)
|
||||
{
|
||||
go_to_nextline = TRUE;
|
||||
/* Pass -1 for the offset, which means taking the position
|
||||
@@ -6199,7 +6199,7 @@ nfa_regmatch(
|
||||
add_state = t->state->out;
|
||||
add_off = -1;
|
||||
}
|
||||
else if (curc == '\n' && reg_line_lbr)
|
||||
else if (curc == '\n' && rex.reg_line_lbr)
|
||||
{
|
||||
/* match \n as if it is an ordinary character */
|
||||
add_state = t->state->out;
|
||||
@@ -6244,7 +6244,7 @@ nfa_regmatch(
|
||||
result = result_if_matched;
|
||||
break;
|
||||
}
|
||||
if (ireg_ic)
|
||||
if (rex.reg_ic)
|
||||
{
|
||||
int curc_low = MB_TOLOWER(curc);
|
||||
int done = FALSE;
|
||||
@@ -6262,7 +6262,7 @@ nfa_regmatch(
|
||||
}
|
||||
else if (state->c < 0 ? check_char_class(state->c, curc)
|
||||
: (curc == state->c
|
||||
|| (ireg_ic && MB_TOLOWER(curc)
|
||||
|| (rex.reg_ic && MB_TOLOWER(curc)
|
||||
== MB_TOLOWER(state->c))))
|
||||
{
|
||||
result = result_if_matched;
|
||||
@@ -6320,13 +6320,13 @@ nfa_regmatch(
|
||||
break;
|
||||
|
||||
case NFA_KWORD: /* \k */
|
||||
result = vim_iswordp_buf(reginput, reg_buf);
|
||||
result = vim_iswordp_buf(reginput, rex.reg_buf);
|
||||
ADD_STATE_IF_MATCH(t->state);
|
||||
break;
|
||||
|
||||
case NFA_SKWORD: /* \K */
|
||||
result = !VIM_ISDIGIT(curc)
|
||||
&& vim_iswordp_buf(reginput, reg_buf);
|
||||
&& vim_iswordp_buf(reginput, rex.reg_buf);
|
||||
ADD_STATE_IF_MATCH(t->state);
|
||||
break;
|
||||
|
||||
@@ -6441,24 +6441,24 @@ nfa_regmatch(
|
||||
break;
|
||||
|
||||
case NFA_LOWER_IC: /* [a-z] */
|
||||
result = ri_lower(curc) || (ireg_ic && ri_upper(curc));
|
||||
result = ri_lower(curc) || (rex.reg_ic && ri_upper(curc));
|
||||
ADD_STATE_IF_MATCH(t->state);
|
||||
break;
|
||||
|
||||
case NFA_NLOWER_IC: /* [^a-z] */
|
||||
result = curc != NUL
|
||||
&& !(ri_lower(curc) || (ireg_ic && ri_upper(curc)));
|
||||
&& !(ri_lower(curc) || (rex.reg_ic && ri_upper(curc)));
|
||||
ADD_STATE_IF_MATCH(t->state);
|
||||
break;
|
||||
|
||||
case NFA_UPPER_IC: /* [A-Z] */
|
||||
result = ri_upper(curc) || (ireg_ic && ri_lower(curc));
|
||||
result = ri_upper(curc) || (rex.reg_ic && ri_lower(curc));
|
||||
ADD_STATE_IF_MATCH(t->state);
|
||||
break;
|
||||
|
||||
case NFA_NUPPER_IC: /* ^[A-Z] */
|
||||
result = curc != NUL
|
||||
&& !(ri_upper(curc) || (ireg_ic && ri_lower(curc)));
|
||||
&& !(ri_upper(curc) || (rex.reg_ic && ri_lower(curc)));
|
||||
ADD_STATE_IF_MATCH(t->state);
|
||||
break;
|
||||
|
||||
@@ -6549,7 +6549,7 @@ nfa_regmatch(
|
||||
case NFA_LNUM_LT:
|
||||
result = (REG_MULTI &&
|
||||
nfa_re_num_cmp(t->state->val, t->state->c - NFA_LNUM,
|
||||
(long_u)(reglnum + reg_firstlnum)));
|
||||
(long_u)(reglnum + rex.reg_firstlnum)));
|
||||
if (result)
|
||||
{
|
||||
add_here = TRUE;
|
||||
@@ -6575,7 +6575,7 @@ nfa_regmatch(
|
||||
{
|
||||
int op = t->state->c - NFA_VCOL;
|
||||
colnr_T col = (colnr_T)(reginput - regline);
|
||||
win_T *wp = reg_win == NULL ? curwin : reg_win;
|
||||
win_T *wp = rex.reg_win == NULL ? curwin : rex.reg_win;
|
||||
|
||||
/* Bail out quickly when there can't be a match, avoid the
|
||||
* overhead of win_linetabsize() on long lines. */
|
||||
@@ -6611,18 +6611,18 @@ nfa_regmatch(
|
||||
case NFA_MARK_GT:
|
||||
case NFA_MARK_LT:
|
||||
{
|
||||
pos_T *pos = getmark_buf(reg_buf, t->state->val, FALSE);
|
||||
pos_T *pos = getmark_buf(rex.reg_buf, t->state->val, FALSE);
|
||||
|
||||
/* Compare the mark position to the match position. */
|
||||
result = (pos != NULL /* mark doesn't exist */
|
||||
&& pos->lnum > 0 /* mark isn't set in reg_buf */
|
||||
&& (pos->lnum == reglnum + reg_firstlnum
|
||||
&& (pos->lnum == reglnum + rex.reg_firstlnum
|
||||
? (pos->col == (colnr_T)(reginput - regline)
|
||||
? t->state->c == NFA_MARK
|
||||
: (pos->col < (colnr_T)(reginput - regline)
|
||||
? t->state->c == NFA_MARK_GT
|
||||
: t->state->c == NFA_MARK_LT))
|
||||
: (pos->lnum < reglnum + reg_firstlnum
|
||||
: (pos->lnum < reglnum + rex.reg_firstlnum
|
||||
? t->state->c == NFA_MARK_GT
|
||||
: t->state->c == NFA_MARK_LT)));
|
||||
if (result)
|
||||
@@ -6634,10 +6634,11 @@ nfa_regmatch(
|
||||
}
|
||||
|
||||
case NFA_CURSOR:
|
||||
result = (reg_win != NULL
|
||||
&& (reglnum + reg_firstlnum == reg_win->w_cursor.lnum)
|
||||
result = (rex.reg_win != NULL
|
||||
&& (reglnum + rex.reg_firstlnum
|
||||
== rex.reg_win->w_cursor.lnum)
|
||||
&& ((colnr_T)(reginput - regline)
|
||||
== reg_win->w_cursor.col));
|
||||
== rex.reg_win->w_cursor.col));
|
||||
if (result)
|
||||
{
|
||||
add_here = TRUE;
|
||||
@@ -6691,12 +6692,12 @@ nfa_regmatch(
|
||||
#endif
|
||||
result = (c == curc);
|
||||
|
||||
if (!result && ireg_ic)
|
||||
if (!result && rex.reg_ic)
|
||||
result = MB_TOLOWER(c) == MB_TOLOWER(curc);
|
||||
#ifdef FEAT_MBYTE
|
||||
/* If ireg_icombine is not set only skip over the character
|
||||
/* If rex.reg_icombine is not set only skip over the character
|
||||
* itself. When it is set skip over composing characters. */
|
||||
if (result && enc_utf8 && !ireg_icombine)
|
||||
if (result && enc_utf8 && !rex.reg_icombine)
|
||||
clen = utf_ptr2len(reginput);
|
||||
#endif
|
||||
ADD_STATE_IF_MATCH(t->state);
|
||||
@@ -6815,8 +6816,8 @@ nfa_regmatch(
|
||||
&& ((toplevel
|
||||
&& reglnum == 0
|
||||
&& clen != 0
|
||||
&& (ireg_maxcol == 0
|
||||
|| (colnr_T)(reginput - regline) < ireg_maxcol))
|
||||
&& (rex.reg_maxcol == 0
|
||||
|| (colnr_T)(reginput - regline) < rex.reg_maxcol))
|
||||
|| (nfa_endp != NULL
|
||||
&& (REG_MULTI
|
||||
? (reglnum < nfa_endp->se_u.pos.lnum
|
||||
@@ -6856,8 +6857,8 @@ nfa_regmatch(
|
||||
/* Checking if the required start character matches is
|
||||
* cheaper than adding a state that won't match. */
|
||||
c = PTR2CHAR(reginput + clen);
|
||||
if (c != prog->regstart && (!ireg_ic || MB_TOLOWER(c)
|
||||
!= MB_TOLOWER(prog->regstart)))
|
||||
if (c != prog->regstart && (!rex.reg_ic
|
||||
|| MB_TOLOWER(c) != MB_TOLOWER(prog->regstart)))
|
||||
{
|
||||
#ifdef ENABLE_LOG
|
||||
fprintf(log_fd, " Skipping start state, regstart does not match\n");
|
||||
@@ -6997,40 +6998,40 @@ nfa_regtry(
|
||||
{
|
||||
for (i = 0; i < subs.norm.in_use; i++)
|
||||
{
|
||||
reg_startpos[i].lnum = subs.norm.list.multi[i].start_lnum;
|
||||
reg_startpos[i].col = subs.norm.list.multi[i].start_col;
|
||||
rex.reg_startpos[i].lnum = subs.norm.list.multi[i].start_lnum;
|
||||
rex.reg_startpos[i].col = subs.norm.list.multi[i].start_col;
|
||||
|
||||
reg_endpos[i].lnum = subs.norm.list.multi[i].end_lnum;
|
||||
reg_endpos[i].col = subs.norm.list.multi[i].end_col;
|
||||
rex.reg_endpos[i].lnum = subs.norm.list.multi[i].end_lnum;
|
||||
rex.reg_endpos[i].col = subs.norm.list.multi[i].end_col;
|
||||
}
|
||||
|
||||
if (reg_startpos[0].lnum < 0)
|
||||
if (rex.reg_startpos[0].lnum < 0)
|
||||
{
|
||||
reg_startpos[0].lnum = 0;
|
||||
reg_startpos[0].col = col;
|
||||
rex.reg_startpos[0].lnum = 0;
|
||||
rex.reg_startpos[0].col = col;
|
||||
}
|
||||
if (reg_endpos[0].lnum < 0)
|
||||
if (rex.reg_endpos[0].lnum < 0)
|
||||
{
|
||||
/* pattern has a \ze but it didn't match, use current end */
|
||||
reg_endpos[0].lnum = reglnum;
|
||||
reg_endpos[0].col = (int)(reginput - regline);
|
||||
rex.reg_endpos[0].lnum = reglnum;
|
||||
rex.reg_endpos[0].col = (int)(reginput - regline);
|
||||
}
|
||||
else
|
||||
/* Use line number of "\ze". */
|
||||
reglnum = reg_endpos[0].lnum;
|
||||
reglnum = rex.reg_endpos[0].lnum;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (i = 0; i < subs.norm.in_use; i++)
|
||||
{
|
||||
reg_startp[i] = subs.norm.list.line[i].start;
|
||||
reg_endp[i] = subs.norm.list.line[i].end;
|
||||
rex.reg_startp[i] = subs.norm.list.line[i].start;
|
||||
rex.reg_endp[i] = subs.norm.list.line[i].end;
|
||||
}
|
||||
|
||||
if (reg_startp[0] == NULL)
|
||||
reg_startp[0] = regline + col;
|
||||
if (reg_endp[0] == NULL)
|
||||
reg_endp[0] = reginput;
|
||||
if (rex.reg_startp[0] == NULL)
|
||||
rex.reg_startp[0] = regline + col;
|
||||
if (rex.reg_endp[0] == NULL)
|
||||
rex.reg_endp[0] = reginput;
|
||||
}
|
||||
|
||||
#ifdef FEAT_SYN_HL
|
||||
@@ -7093,16 +7094,16 @@ nfa_regexec_both(
|
||||
|
||||
if (REG_MULTI)
|
||||
{
|
||||
prog = (nfa_regprog_T *)reg_mmatch->regprog;
|
||||
prog = (nfa_regprog_T *)rex.reg_mmatch->regprog;
|
||||
line = reg_getline((linenr_T)0); /* relative to the cursor */
|
||||
reg_startpos = reg_mmatch->startpos;
|
||||
reg_endpos = reg_mmatch->endpos;
|
||||
rex.reg_startpos = rex.reg_mmatch->startpos;
|
||||
rex.reg_endpos = rex.reg_mmatch->endpos;
|
||||
}
|
||||
else
|
||||
{
|
||||
prog = (nfa_regprog_T *)reg_match->regprog;
|
||||
reg_startp = reg_match->startp;
|
||||
reg_endp = reg_match->endp;
|
||||
prog = (nfa_regprog_T *)rex.reg_match->regprog;
|
||||
rex.reg_startp = rex.reg_match->startp;
|
||||
rex.reg_endp = rex.reg_match->endp;
|
||||
}
|
||||
|
||||
/* Be paranoid... */
|
||||
@@ -7112,16 +7113,16 @@ nfa_regexec_both(
|
||||
goto theend;
|
||||
}
|
||||
|
||||
/* If pattern contains "\c" or "\C": overrule value of ireg_ic */
|
||||
/* If pattern contains "\c" or "\C": overrule value of rex.reg_ic */
|
||||
if (prog->regflags & RF_ICASE)
|
||||
ireg_ic = TRUE;
|
||||
rex.reg_ic = TRUE;
|
||||
else if (prog->regflags & RF_NOICASE)
|
||||
ireg_ic = FALSE;
|
||||
rex.reg_ic = FALSE;
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
/* If pattern contains "\Z" overrule value of ireg_icombine */
|
||||
/* If pattern contains "\Z" overrule value of rex.reg_icombine */
|
||||
if (prog->regflags & RF_ICOMBINE)
|
||||
ireg_icombine = TRUE;
|
||||
rex.reg_icombine = TRUE;
|
||||
#endif
|
||||
|
||||
regline = line;
|
||||
@@ -7160,14 +7161,14 @@ nfa_regexec_both(
|
||||
* Nothing else to try. Doesn't handle combining chars well. */
|
||||
if (prog->match_text != NULL
|
||||
#ifdef FEAT_MBYTE
|
||||
&& !ireg_icombine
|
||||
&& !rex.reg_icombine
|
||||
#endif
|
||||
)
|
||||
return find_match_text(col, prog->regstart, prog->match_text);
|
||||
}
|
||||
|
||||
/* If the start column is past the maximum column: no need to try. */
|
||||
if (ireg_maxcol > 0 && col >= ireg_maxcol)
|
||||
if (rex.reg_maxcol > 0 && col >= rex.reg_maxcol)
|
||||
goto theend;
|
||||
|
||||
nstate = prog->nstate;
|
||||
@@ -7326,17 +7327,17 @@ nfa_regexec_nl(
|
||||
colnr_T col, /* column to start looking for match */
|
||||
int line_lbr)
|
||||
{
|
||||
reg_match = rmp;
|
||||
reg_mmatch = NULL;
|
||||
reg_maxline = 0;
|
||||
reg_line_lbr = line_lbr;
|
||||
reg_buf = curbuf;
|
||||
reg_win = NULL;
|
||||
ireg_ic = rmp->rm_ic;
|
||||
rex.reg_match = rmp;
|
||||
rex.reg_mmatch = NULL;
|
||||
rex.reg_maxline = 0;
|
||||
rex.reg_line_lbr = line_lbr;
|
||||
rex.reg_buf = curbuf;
|
||||
rex.reg_win = NULL;
|
||||
rex.reg_ic = rmp->rm_ic;
|
||||
#ifdef FEAT_MBYTE
|
||||
ireg_icombine = FALSE;
|
||||
rex.reg_icombine = FALSE;
|
||||
#endif
|
||||
ireg_maxcol = 0;
|
||||
rex.reg_maxcol = 0;
|
||||
return nfa_regexec_both(line, col, NULL);
|
||||
}
|
||||
|
||||
@@ -7375,18 +7376,18 @@ nfa_regexec_multi(
|
||||
colnr_T col, /* column to start looking for match */
|
||||
proftime_T *tm) /* timeout limit or NULL */
|
||||
{
|
||||
reg_match = NULL;
|
||||
reg_mmatch = rmp;
|
||||
reg_buf = buf;
|
||||
reg_win = win;
|
||||
reg_firstlnum = lnum;
|
||||
reg_maxline = reg_buf->b_ml.ml_line_count - lnum;
|
||||
reg_line_lbr = FALSE;
|
||||
ireg_ic = rmp->rmm_ic;
|
||||
rex.reg_match = NULL;
|
||||
rex.reg_mmatch = rmp;
|
||||
rex.reg_buf = buf;
|
||||
rex.reg_win = win;
|
||||
rex.reg_firstlnum = lnum;
|
||||
rex.reg_maxline = rex.reg_buf->b_ml.ml_line_count - lnum;
|
||||
rex.reg_line_lbr = FALSE;
|
||||
rex.reg_ic = rmp->rmm_ic;
|
||||
#ifdef FEAT_MBYTE
|
||||
ireg_icombine = FALSE;
|
||||
rex.reg_icombine = FALSE;
|
||||
#endif
|
||||
ireg_maxcol = rmp->rmm_maxcol;
|
||||
rex.reg_maxcol = rmp->rmm_maxcol;
|
||||
|
||||
return nfa_regexec_both(NULL, col, tm);
|
||||
}
|
||||
|
||||
+35
-29
@@ -765,6 +765,9 @@ update_screen(int type)
|
||||
* uses that. */
|
||||
gui.col = gui_cursor_col;
|
||||
gui.row = gui_cursor_row;
|
||||
# ifdef FEAT_MBYTE
|
||||
gui.col = mb_fix_col(gui.col, gui.row);
|
||||
# endif
|
||||
gui_update_cursor(FALSE, FALSE);
|
||||
screen_cur_col = gui.col;
|
||||
screen_cur_row = gui.row;
|
||||
@@ -7783,6 +7786,10 @@ next_search_hl(
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* If there is a match fill "shl" and return one.
|
||||
* Return zero otherwise.
|
||||
*/
|
||||
static int
|
||||
next_search_hl_pos(
|
||||
match_T *shl, /* points to a match */
|
||||
@@ -7791,53 +7798,52 @@ next_search_hl_pos(
|
||||
colnr_T mincol) /* minimal column for a match */
|
||||
{
|
||||
int i;
|
||||
int bot = -1;
|
||||
int found = -1;
|
||||
|
||||
shl->lnum = 0;
|
||||
for (i = posmatch->cur; i < MAXPOSMATCH; i++)
|
||||
{
|
||||
if (posmatch->pos[i].lnum == 0)
|
||||
break;
|
||||
if (posmatch->pos[i].col < mincol)
|
||||
continue;
|
||||
if (posmatch->pos[i].lnum == lnum)
|
||||
{
|
||||
if (shl->lnum == lnum)
|
||||
{
|
||||
/* partially sort positions by column numbers
|
||||
* on the same line */
|
||||
if (posmatch->pos[i].col < posmatch->pos[bot].col)
|
||||
{
|
||||
llpos_T tmp = posmatch->pos[i];
|
||||
llpos_T *pos = &posmatch->pos[i];
|
||||
|
||||
posmatch->pos[i] = posmatch->pos[bot];
|
||||
posmatch->pos[bot] = tmp;
|
||||
if (pos->lnum == 0)
|
||||
break;
|
||||
if (pos->len == 0 && pos->col < mincol)
|
||||
continue;
|
||||
if (pos->lnum == lnum)
|
||||
{
|
||||
if (found >= 0)
|
||||
{
|
||||
/* if this match comes before the one at "found" then swap
|
||||
* them */
|
||||
if (pos->col < posmatch->pos[found].col)
|
||||
{
|
||||
llpos_T tmp = *pos;
|
||||
|
||||
*pos = posmatch->pos[found];
|
||||
posmatch->pos[found] = tmp;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bot = i;
|
||||
shl->lnum = lnum;
|
||||
}
|
||||
found = i;
|
||||
}
|
||||
}
|
||||
posmatch->cur = 0;
|
||||
if (shl->lnum == lnum && bot >= 0)
|
||||
if (found >= 0)
|
||||
{
|
||||
colnr_T start = posmatch->pos[bot].col == 0
|
||||
? 0 : posmatch->pos[bot].col - 1;
|
||||
colnr_T end = posmatch->pos[bot].col == 0
|
||||
? MAXCOL : start + posmatch->pos[bot].len;
|
||||
colnr_T start = posmatch->pos[found].col == 0
|
||||
? 0 : posmatch->pos[found].col - 1;
|
||||
colnr_T end = posmatch->pos[found].col == 0
|
||||
? MAXCOL : start + posmatch->pos[found].len;
|
||||
|
||||
shl->lnum = lnum;
|
||||
shl->rm.startpos[0].lnum = 0;
|
||||
shl->rm.startpos[0].col = start;
|
||||
shl->rm.endpos[0].lnum = 0;
|
||||
shl->rm.endpos[0].col = end;
|
||||
shl->is_addpos = TRUE;
|
||||
posmatch->cur = bot + 1;
|
||||
return TRUE;
|
||||
posmatch->cur = found + 1;
|
||||
return 1;
|
||||
}
|
||||
return FALSE;
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
+1
-1
@@ -5444,7 +5444,7 @@ exit_matched:
|
||||
#endif
|
||||
#ifdef FEAT_INS_EXPAND
|
||||
if (action == ACTION_EXPAND)
|
||||
ins_compl_check_keys(30);
|
||||
ins_compl_check_keys(30, FALSE);
|
||||
if (got_int || compl_interrupted)
|
||||
#else
|
||||
if (got_int)
|
||||
|
||||
+1
-1
@@ -8694,7 +8694,7 @@ spell_dump_compl(
|
||||
/* Done all bytes at this node, go up one level. */
|
||||
--depth;
|
||||
line_breakcheck();
|
||||
ins_compl_check_keys(50);
|
||||
ins_compl_check_keys(50, FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+13
-11
@@ -1499,19 +1499,21 @@ typedef enum {
|
||||
|
||||
/* Ordering matters, it is used in for loops: IN is last, only SOCK/OUT/ERR
|
||||
* are polled. */
|
||||
#define PART_SOCK 0
|
||||
typedef enum {
|
||||
PART_SOCK = 0,
|
||||
#define CH_SOCK_FD ch_part[PART_SOCK].ch_fd
|
||||
|
||||
#ifdef FEAT_JOB_CHANNEL
|
||||
# define INVALID_FD (-1)
|
||||
|
||||
# define PART_OUT 1
|
||||
# define PART_ERR 2
|
||||
# define PART_IN 3
|
||||
PART_OUT,
|
||||
# define CH_OUT_FD ch_part[PART_OUT].ch_fd
|
||||
PART_ERR,
|
||||
# define CH_ERR_FD ch_part[PART_ERR].ch_fd
|
||||
PART_IN,
|
||||
# define CH_IN_FD ch_part[PART_IN].ch_fd
|
||||
#endif
|
||||
PART_COUNT
|
||||
} ch_part_T;
|
||||
|
||||
#define INVALID_FD (-1)
|
||||
|
||||
/* The per-fd info for a channel. */
|
||||
typedef struct {
|
||||
@@ -1569,14 +1571,14 @@ struct channel_S {
|
||||
int ch_id; /* ID of the channel */
|
||||
int ch_last_msg_id; /* ID of the last message */
|
||||
|
||||
chanpart_T ch_part[4]; /* info for socket, out, err and in */
|
||||
chanpart_T ch_part[PART_COUNT]; /* info for socket, out, err and in */
|
||||
|
||||
char *ch_hostname; /* only for socket, allocated */
|
||||
int ch_port; /* only for socket */
|
||||
|
||||
int ch_to_be_closed; /* When TRUE reading or writing failed and
|
||||
* the channel must be closed when it's safe
|
||||
* to invoke callbacks. */
|
||||
int ch_to_be_closed; /* bitset of readable fds to be closed.
|
||||
* When all readable fds have been closed,
|
||||
* set to (1 << PART_COUNT). */
|
||||
int ch_to_be_freed; /* When TRUE channel must be freed when it's
|
||||
* safe to invoke callbacks. */
|
||||
int ch_error; /* When TRUE an error was reported. Avoids
|
||||
|
||||
@@ -1587,7 +1587,7 @@ find_tags(
|
||||
fast_breakcheck();
|
||||
#ifdef FEAT_INS_EXPAND
|
||||
if ((flags & TAG_INS_COMP)) /* Double brackets for gcc */
|
||||
ins_compl_check_keys(30);
|
||||
ins_compl_check_keys(30, FALSE);
|
||||
if (got_int || compl_interrupted)
|
||||
#else
|
||||
if (got_int)
|
||||
|
||||
@@ -55,7 +55,6 @@ SCRIPTS_ALL = \
|
||||
test70.out \
|
||||
test73.out \
|
||||
test75.out \
|
||||
test76.out \
|
||||
test77.out \
|
||||
test79.out \
|
||||
test80.out \
|
||||
|
||||
@@ -24,7 +24,7 @@ STARTTEST
|
||||
:hi Crash term='asdf
|
||||
:redir END
|
||||
:" filter ctermfg and ctermbg, the numbers depend on the terminal
|
||||
:e test.out
|
||||
:e! test.out
|
||||
:%s/ctermfg=\d*/ctermfg=2/
|
||||
:%s/ctermbg=\d*/ctermbg=3/
|
||||
:" filter out possibly translated error message
|
||||
|
||||
@@ -24,7 +24,7 @@ STARTTEST
|
||||
:call add(results, "#BufEnter#<buffer>: " . exists("#BufEnter#<buffer>"))
|
||||
:edit testfile2.test
|
||||
:call add(results, "#BufEnter#<buffer>: " . exists("#BufEnter#<buffer>"))
|
||||
:e test.out
|
||||
:e! test.out
|
||||
:call append(0, results)
|
||||
:$d
|
||||
:w
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
Tests for completefunc/omnifunc. vim: set ft=vim :
|
||||
|
||||
STARTTEST
|
||||
:"Test that nothing happens if the 'completefunc' opens
|
||||
:"a new window (no completion, no crash)
|
||||
:so small.vim
|
||||
:function! DummyCompleteOne(findstart, base)
|
||||
: if a:findstart
|
||||
: return 0
|
||||
: else
|
||||
: wincmd n
|
||||
: return ['onedef', 'oneDEF']
|
||||
: endif
|
||||
:endfunction
|
||||
:setlocal completefunc=DummyCompleteOne
|
||||
/^one
|
||||
A:q!
|
||||
:function! DummyCompleteTwo(findstart, base)
|
||||
: if a:findstart
|
||||
: wincmd n
|
||||
: return 0
|
||||
: else
|
||||
: return ['twodef', 'twoDEF']
|
||||
: endif
|
||||
:endfunction
|
||||
:setlocal completefunc=DummyCompleteTwo
|
||||
/^two
|
||||
A:q!
|
||||
:"Test that 'completefunc' works when it's OK.
|
||||
:function! DummyCompleteThree(findstart, base)
|
||||
: if a:findstart
|
||||
: return 0
|
||||
: else
|
||||
: return ['threedef', 'threeDEF']
|
||||
: endif
|
||||
:endfunction
|
||||
:setlocal completefunc=DummyCompleteThree
|
||||
/^three
|
||||
A:/^+++/,/^three/w! test.out
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
+++
|
||||
one
|
||||
two
|
||||
three
|
||||
@@ -1,4 +0,0 @@
|
||||
+++
|
||||
|
||||
two
|
||||
threeDEF
|
||||
@@ -7,7 +7,7 @@ STARTTEST
|
||||
:set shell=doesnotexist
|
||||
:" consistent sorting of file names
|
||||
:set nofileignorecase
|
||||
:e test.out
|
||||
:e! test.out
|
||||
:$put =glob('Xxx\{')
|
||||
:$put =glob('Xxx\$')
|
||||
:w! Xxx{
|
||||
|
||||
@@ -12,10 +12,11 @@ source test_expand.vim
|
||||
source test_expr.vim
|
||||
source test_expand_dllpath.vim
|
||||
source test_feedkeys.vim
|
||||
source test_fnamemodify.vim
|
||||
source test_file_perm.vim
|
||||
source test_fileformat.vim
|
||||
source test_filter_cmd.vim
|
||||
source test_filter_map.vim
|
||||
source test_fnamemodify.vim
|
||||
source test_glob2regpat.vim
|
||||
source test_goto.vim
|
||||
source test_help_tagjump.vim
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user