mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-07 15:37:14 +02:00
Compare commits
57 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 89be02e06e | |||
| eb4d05a87a | |||
| 60d5a30b3b | |||
| a6a61ecb87 | |||
| 106dc393f4 | |||
| 35a1f59d63 | |||
| 77f2a92caf | |||
| 14207f487c | |||
| 01688ad545 | |||
| 2f97912800 | |||
| 6d5ad4c411 | |||
| a350bab042 | |||
| 50e5376926 | |||
| 5a07be6ed4 | |||
| 46fceaaa8d | |||
| 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 |
@@ -0,0 +1,184 @@
|
||||
" Language: ConTeXt typesetting engine
|
||||
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
|
||||
" Latest Revision: 2016 Oct 21
|
||||
|
||||
let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
|
||||
" Helper functions {{{
|
||||
function! s:context_echo(message, mode)
|
||||
redraw
|
||||
echo "\r"
|
||||
execute 'echohl' a:mode
|
||||
echomsg '[ConTeXt]' a:message
|
||||
echohl None
|
||||
endf
|
||||
|
||||
function! s:sh()
|
||||
return has('win32') || has('win64') || has('win16') || has('win95')
|
||||
\ ? ['cmd.exe', '/C']
|
||||
\ : ['/bin/sh', '-c']
|
||||
endfunction
|
||||
|
||||
" For backward compatibility
|
||||
if exists('*win_getid')
|
||||
|
||||
function! s:win_getid()
|
||||
return win_getid()
|
||||
endf
|
||||
|
||||
function! s:win_id2win(winid)
|
||||
return win_id2win(a:winid)
|
||||
endf
|
||||
|
||||
else
|
||||
|
||||
function! s:win_getid()
|
||||
return winnr()
|
||||
endf
|
||||
|
||||
function! s:win_id2win(winnr)
|
||||
return a:winnr
|
||||
endf
|
||||
|
||||
endif
|
||||
" }}}
|
||||
|
||||
" ConTeXt jobs {{{
|
||||
if has('job')
|
||||
|
||||
let g:context_jobs = []
|
||||
|
||||
" Print the status of ConTeXt jobs
|
||||
function! context#job_status()
|
||||
let l:jobs = filter(g:context_jobs, 'job_status(v:val) == "run"')
|
||||
let l:n = len(l:jobs)
|
||||
call s:context_echo(
|
||||
\ 'There '.(l:n == 1 ? 'is' : 'are').' '.(l:n == 0 ? 'no' : l:n)
|
||||
\ .' job'.(l:n == 1 ? '' : 's').' running'
|
||||
\ .(l:n == 0 ? '.' : ' (' . join(l:jobs, ', ').').'),
|
||||
\ 'ModeMsg')
|
||||
endfunction
|
||||
|
||||
" Stop all ConTeXt jobs
|
||||
function! context#stop_jobs()
|
||||
let l:jobs = filter(g:context_jobs, 'job_status(v:val) == "run"')
|
||||
for job in l:jobs
|
||||
call job_stop(job)
|
||||
endfor
|
||||
sleep 1
|
||||
let l:tmp = []
|
||||
for job in l:jobs
|
||||
if job_status(job) == "run"
|
||||
call add(l:tmp, job)
|
||||
endif
|
||||
endfor
|
||||
let g:context_jobs = l:tmp
|
||||
if empty(g:context_jobs)
|
||||
call s:context_echo('Done. No jobs running.', 'ModeMsg')
|
||||
else
|
||||
call s:context_echo('There are still some jobs running. Please try again.', 'WarningMsg')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! context#callback(path, job, status)
|
||||
if index(g:context_jobs, a:job) != -1 && job_status(a:job) != 'run' " just in case
|
||||
call remove(g:context_jobs, index(g:context_jobs, a:job))
|
||||
endif
|
||||
call s:callback(a:path, a:job, a:status)
|
||||
endfunction
|
||||
|
||||
function! context#close_cb(channel)
|
||||
call job_status(ch_getjob(a:channel)) " Trigger exit_cb's callback for faster feedback
|
||||
endfunction
|
||||
|
||||
function! s:typeset(path)
|
||||
call add(g:context_jobs,
|
||||
\ job_start(add(s:sh(), context#command() . ' ' . shellescape(fnamemodify(a:path, ":t"))), {
|
||||
\ 'close_cb' : 'context#close_cb',
|
||||
\ 'exit_cb' : function(get(b:, 'context_callback', get(g:, 'context_callback', 'context#callback')),
|
||||
\ [a:path]),
|
||||
\ 'in_io' : 'null'
|
||||
\ }))
|
||||
endfunction
|
||||
|
||||
else " No jobs
|
||||
|
||||
function! context#job_status()
|
||||
call s:context_echo('Not implemented', 'WarningMsg')
|
||||
endfunction!
|
||||
|
||||
function! context#stop_jobs()
|
||||
call s:context_echo('Not implemented', 'WarningMsg')
|
||||
endfunction
|
||||
|
||||
function! context#callback(path, job, status)
|
||||
call s:callback(a:path, a:job, a:status)
|
||||
endfunction
|
||||
|
||||
function! s:typeset(path)
|
||||
execute '!' . context#command() . ' ' . shellescape(fnamemodify(a:path, ":t"))
|
||||
call call(get(b:, 'context_callback', get(g:, 'context_callback', 'context#callback')),
|
||||
\ [a:path, 0, v:shell_error])
|
||||
endfunction
|
||||
|
||||
endif " has('job')
|
||||
|
||||
function! s:callback(path, job, status) abort
|
||||
if a:status < 0 " Assume the job was terminated
|
||||
return
|
||||
endif
|
||||
" Get info about the current window
|
||||
let l:winid = s:win_getid() " Save window id
|
||||
let l:efm = &l:errorformat " Save local errorformat
|
||||
let l:cwd = fnamemodify(getcwd(), ":p") " Save local working directory
|
||||
" Set errorformat to parse ConTeXt errors
|
||||
execute 'setl efm=' . escape(b:context_errorformat, ' ')
|
||||
try " Set cwd to expand error file correctly
|
||||
execute 'lcd' fnameescape(fnamemodify(a:path, ':h'))
|
||||
catch /.*/
|
||||
execute 'setl efm=' . escape(l:efm, ' ')
|
||||
throw v:exception
|
||||
endtry
|
||||
try
|
||||
execute 'cgetfile' fnameescape(fnamemodify(a:path, ':r') . '.log')
|
||||
botright cwindow
|
||||
finally " Restore cwd and errorformat
|
||||
execute s:win_id2win(l:winid) . 'wincmd w'
|
||||
execute 'lcd ' . fnameescape(l:cwd)
|
||||
execute 'setl efm=' . escape(l:efm, ' ')
|
||||
endtry
|
||||
if a:status == 0
|
||||
call s:context_echo('Success!', 'ModeMsg')
|
||||
else
|
||||
call s:context_echo('There are errors. ', 'ErrorMsg')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! context#command()
|
||||
return get(b:, 'context_mtxrun', get(g:, 'context_mtxrun', 'mtxrun'))
|
||||
\ . ' --script context --autogenerate --nonstopmode'
|
||||
\ . ' --synctex=' . (get(b:, 'context_synctex', get(g:, 'context_synctex', 0)) ? '1' : '0')
|
||||
\ . ' ' . get(b:, 'context_extra_options', get(g:, 'context_extra_options', ''))
|
||||
endfunction
|
||||
|
||||
" Accepts an optional path (useful for big projects, when the file you are
|
||||
" editing is not the project's root document). If no argument is given, uses
|
||||
" the path of the current buffer.
|
||||
function! context#typeset(...) abort
|
||||
let l:path = fnamemodify(strlen(a:000[0]) > 0 ? a:1 : expand("%"), ":p")
|
||||
let l:cwd = fnamemodify(getcwd(), ":p") " Save local working directory
|
||||
call s:context_echo('Typesetting...', 'ModeMsg')
|
||||
execute 'lcd' fnameescape(fnamemodify(l:path, ":h"))
|
||||
try
|
||||
call s:typeset(l:path)
|
||||
finally " Restore local working directory
|
||||
execute 'lcd ' . fnameescape(l:cwd)
|
||||
endtry
|
||||
endfunction!
|
||||
"}}}
|
||||
|
||||
let &cpo = s:keepcpo
|
||||
unlet s:keepcpo
|
||||
|
||||
" vim: sw=2 fdm=marker
|
||||
@@ -0,0 +1,25 @@
|
||||
" Language: ConTeXt typesetting engine
|
||||
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
|
||||
" Latest Revision: 2016 Oct 15
|
||||
|
||||
let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
|
||||
" Complete keywords in MetaPost blocks
|
||||
function! contextcomplete#Complete(findstart, base)
|
||||
if a:findstart == 1
|
||||
if len(synstack(line('.'), 1)) > 0 &&
|
||||
\ synIDattr(synstack(line('.'), 1)[0], "name") ==# 'contextMPGraphic'
|
||||
return syntaxcomplete#Complete(a:findstart, a:base)
|
||||
else
|
||||
return -3
|
||||
endif
|
||||
else
|
||||
return syntaxcomplete#Complete(a:findstart, a:base)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
let &cpo = s:keepcpo
|
||||
unlet s:keepcpo
|
||||
|
||||
" vim: sw=2 fdm=marker
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
" Vim compiler file
|
||||
" Compiler: ConTeXt typesetting engine
|
||||
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
|
||||
" Last Change: 2016 Oct 21
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
|
||||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
" If makefile exists and we are not asked to ignore it, we use standard make
|
||||
" (do not redefine makeprg)
|
||||
if get(b:, 'context_ignore_makefile', get(g:, 'context_ignore_makefile', 0)) ||
|
||||
\ (!filereadable('Makefile') && !filereadable('makefile'))
|
||||
let current_compiler = 'context'
|
||||
" The following assumes that the current working directory is set to the
|
||||
" directory of the file to be typeset
|
||||
let &l:makeprg = get(b:, 'context_mtxrun', get(g:, 'context_mtxrun', 'mtxrun'))
|
||||
\ . ' --script context --autogenerate --nonstopmode --synctex='
|
||||
\ . (get(b:, 'context_synctex', get(g:, 'context_synctex', 0)) ? '1' : '0')
|
||||
\ . ' ' . get(b:, 'context_extra_options', get(g:, 'context_extra_options', ''))
|
||||
\ . ' ' . shellescape(expand('%:p:t'))
|
||||
else
|
||||
let current_compiler = 'make'
|
||||
endif
|
||||
|
||||
let b:context_errorformat = ''
|
||||
\ . '%-Popen source%.%#> %f,'
|
||||
\ . '%-Qclose source%.%#> %f,'
|
||||
\ . "%-Popen source%.%#name '%f',"
|
||||
\ . "%-Qclose source%.%#name '%f',"
|
||||
\ . '%Etex %trror%.%#mp error on line %l in file %f:%.%#,'
|
||||
\ . 'tex %trror%.%#error on line %l in file %f: %m,'
|
||||
\ . '%Elua %trror%.%#error on line %l in file %f:,'
|
||||
\ . '%+Emetapost %#> error: %#,'
|
||||
\ . '! error: %#%m,'
|
||||
\ . '%-C %#,'
|
||||
\ . '%C! %m,'
|
||||
\ . '%Z[ctxlua]%m,'
|
||||
\ . '%+C<*> %.%#,'
|
||||
\ . '%-C%.%#,'
|
||||
\ . '%Z...%m,'
|
||||
\ . '%-Zno-error,'
|
||||
\ . '%-G%.%#' " Skip remaining lines
|
||||
|
||||
execute 'CompilerSet errorformat=' . escape(b:context_errorformat, ' ')
|
||||
|
||||
let &cpo = s:keepcpo
|
||||
unlet s:keepcpo
|
||||
@@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 8.0. Last change: 2016 Oct 02
|
||||
*eval.txt* For Vim version 8.0. Last change: 2016 Oct 15
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -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'|
|
||||
@@ -8212,7 +8214,7 @@ writefile({list}, {fname} [, {flags}])
|
||||
end does cause the last line in the file to end in a NL.
|
||||
|
||||
When {flags} contains "a" then append mode is used, lines are
|
||||
append to the file: >
|
||||
appended to the file: >
|
||||
:call writefile(["foo"], "event.log", "a")
|
||||
:call writefile(["bar"], "event.log", "a")
|
||||
>
|
||||
|
||||
+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
|
||||
|
||||
+2
-1
@@ -1,4 +1,4 @@
|
||||
*map.txt* For Vim version 8.0. Last change: 2016 Aug 26
|
||||
*map.txt* For Vim version 8.0. Last change: 2016 Oct 15
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 8.0. Last change: 2016 Oct 01
|
||||
*options.txt* For Vim version 8.0. Last change: 2016 Oct 12
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -4441,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
|
||||
@@ -8132,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
|
||||
|
||||
+17
-19
@@ -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~
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*tabpage.txt* For Vim version 8.0. Last change: 2016 Sep 09
|
||||
*tabpage.txt* For Vim version 8.0. Last change: 2016 Oct 20
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -58,6 +58,8 @@ clicking right of the labels.
|
||||
In the GUI tab pages line you can use the right mouse button to open menu.
|
||||
|tabline-menu|.
|
||||
|
||||
For the related autocommands see |tabnew-autocmd|.
|
||||
|
||||
:[count]tabe[dit] *:tabe* *:tabedit* *:tabnew*
|
||||
:[count]tabnew
|
||||
Open a new tab page with an empty window, after the current
|
||||
@@ -287,6 +289,7 @@ Variables local to a tab page start with "t:". |tabpage-variable|
|
||||
|
||||
Currently there is only one option local to a tab page: 'cmdheight'.
|
||||
|
||||
*tabnew-autocmd*
|
||||
The TabLeave and TabEnter autocommand events can be used to do something when
|
||||
switching from one tab page to another. The exact order depends on what you
|
||||
are doing. When creating a new tab page this works as if you create a new
|
||||
|
||||
+7
-4
@@ -6085,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*
|
||||
@@ -6145,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*
|
||||
@@ -6398,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*
|
||||
@@ -6615,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*
|
||||
@@ -7355,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*
|
||||
@@ -8696,6 +8695,7 @@ tab-page-commands tabpage.txt /*tab-page-commands*
|
||||
tab-page-intro tabpage.txt /*tab-page-intro*
|
||||
tab-page-other tabpage.txt /*tab-page-other*
|
||||
tabline-menu tabpage.txt /*tabline-menu*
|
||||
tabnew-autocmd tabpage.txt /*tabnew-autocmd*
|
||||
tabpage tabpage.txt /*tabpage*
|
||||
tabpage-variable eval.txt /*tabpage-variable*
|
||||
tabpage.txt tabpage.txt /*tabpage.txt*
|
||||
@@ -9329,6 +9329,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()*
|
||||
@@ -9358,6 +9359,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()*
|
||||
|
||||
+59
-28
@@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 8.0. Last change: 2016 Oct 01
|
||||
*todo.txt* For Vim version 8.0. Last change: 2016 Oct 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -34,14 +34,12 @@ not be repeated below, unless there is extra information.
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
After 8.0 is released:
|
||||
- Drop support for older MS-Windows systems, before XP.
|
||||
Patch from Ken Takata, updated 2016 Sep 12.
|
||||
|
||||
+channel:
|
||||
- Check for job cleanup more often? Patch from Ozaki Kiichi, 2016 Oct 22.
|
||||
- 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?
|
||||
@@ -62,9 +60,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
|
||||
@@ -80,6 +75,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,
|
||||
@@ -105,23 +101,44 @@ Regexp problems:
|
||||
json_encode(): should convert to utf-8. (Nikolai Pavlov, 2016 Jan 23)
|
||||
What if there is an invalid character?
|
||||
|
||||
Bug: Json with same key should not give internal error. (Lcd, 2016 Oct 26)
|
||||
Make dict_add give a duplicate key error.
|
||||
|
||||
Should json_encode()/json_decode() restrict recursiveness?
|
||||
Or avoid recursiveness.
|
||||
|
||||
Allow using json with empty key? Dict already has it.
|
||||
|
||||
Json string with trailing \u should be an error. (Lcd)
|
||||
|
||||
Patch to fix conceal mode. (Christian Brabandt, 2016 Oct 23, close #1092)
|
||||
|
||||
Patch to reset ex_exitvalue after catch. (Christian Brabandt, 2016 Oct 23)
|
||||
|
||||
Patch to deal with changed configure events in GTK 3. (Jan Alexander Steffens,
|
||||
2016 Oct 23 #1193)
|
||||
|
||||
Wrong diff highlighting with three files. (2016 Oct 20, #1186)
|
||||
Also get E749 on exit.
|
||||
|
||||
Patch for better explanation of 'compatible' side effects.
|
||||
https://github.com/vim/vim/pull/1161/files
|
||||
|
||||
Error in test_startup_utf8 on Solaris. (Danek Duvall, 2016 Aug 17)
|
||||
|
||||
Patch to recognize tmux. (Michael Henry, 2016 Sep 29)
|
||||
Screen updated delayed when using CTRL-O u in Insert mode.
|
||||
(Barlik, #1191) Perhaps because status message?
|
||||
|
||||
Patch for restoring wide characters in the console buffer.
|
||||
(Ken Takata, 2016 Jun 7)
|
||||
|
||||
Patch to fix escaping of job arguments. (Yasuhiro Matsumoto, 2016 Oct 5)
|
||||
Update Oct 14: https://gist.github.com/mattn/d47e7d3bfe5ade4be86062b565a4bfca
|
||||
|
||||
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?
|
||||
|
||||
@@ -137,20 +154,32 @@ E.g. deepcopy(test_null_list())
|
||||
Patch to make it possible to extend a list with itself.
|
||||
(Nikolai Pavlov, 2016 Sep 23)
|
||||
|
||||
Patch to add Zstandard compressed file support. (Nick Terrell, 2016 Oct 24)
|
||||
|
||||
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)
|
||||
Adjust the documentation instead? Do include the test.
|
||||
Add an argument to choose binary or non-binary (like readfile()), when omitted
|
||||
use the current behavior.
|
||||
Include the test.
|
||||
|
||||
When 'keywordprg' starts with ":" the argument is still escaped as a shell
|
||||
command argument. (Romain Lafourcade, 2016 Oct 16, #1175)
|
||||
|
||||
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.
|
||||
@@ -158,10 +187,15 @@ 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)
|
||||
|
||||
Patch to order results from taglist(). (Duncan McDougall, 2016 Oct 25)
|
||||
|
||||
Patch for :pyx, run python commands depending on the supported version.
|
||||
(Marc Weber, update from Ken Takata, 2016 Sep 19)
|
||||
|
||||
@@ -179,9 +213,15 @@ Also with latest version.
|
||||
|
||||
Cannot delete a file with square brackets with delete(). (#696)
|
||||
|
||||
Patch to add ":syn foldlevel" to use fold level further down the line.
|
||||
(Brad King, 2016 Oct 19)
|
||||
|
||||
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
|
||||
@@ -215,9 +255,6 @@ Patch to improve map documentation. Issue #799.
|
||||
|
||||
Patch for syntax folding optimization. (Shougo, 2016 Sep 6, #1045)
|
||||
|
||||
Patch for restoring wide characters in the console buffer.
|
||||
(Ken Takata, 2016 Jun 7)
|
||||
|
||||
Patch for drag&drop reordering of GUI tab pages reordering.
|
||||
(Ken Takata, 2013 Nov 22, second one, also by Masamichi Abe)
|
||||
Now on Git: https://gist.github.com/nocd5/165286495c782b815b94
|
||||
@@ -228,9 +265,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 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.
|
||||
|
||||
@@ -331,6 +365,9 @@ 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.
|
||||
|
||||
Feature request: add the "al" text object, to manipulate a screen line.
|
||||
Especially useful when using 'linebreak'
|
||||
|
||||
Access to uninitialized memory in match_backref() regexp_nda.c:4882
|
||||
(Dominique Pelle, 2015 Nov 6)
|
||||
|
||||
@@ -1799,10 +1836,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)
|
||||
|
||||
@@ -2408,8 +2441,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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*windows.txt* For Vim version 8.0. Last change: 2016 Aug 23
|
||||
*windows.txt* For Vim version 8.0. Last change: 2016 Oct 21
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -295,8 +295,8 @@ CTRL-W CTRL-Q *CTRL-W_CTRL-Q*
|
||||
:1quit " quit the first window
|
||||
:$quit " quit the last window
|
||||
:9quit " quit the last window
|
||||
" if there are less than 9 windows opened
|
||||
:-quit " quit the previews window
|
||||
" if there are fewer than 9 windows opened
|
||||
:-quit " quit the previous window
|
||||
:+quit " quit the next window
|
||||
:+2quit " quit the second next window
|
||||
<
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim support file to detect file types
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2016 Sep 22
|
||||
" Last Change: 2016 Oct 15
|
||||
|
||||
" Listen very carefully, I will say this only once
|
||||
if exists("did_load_filetypes")
|
||||
@@ -2254,7 +2254,7 @@ func! s:FTtex()
|
||||
endfunc
|
||||
|
||||
" ConTeXt
|
||||
au BufNewFile,BufRead tex/context/*/*.tex,*.mkii,*.mkiv setf context
|
||||
au BufNewFile,BufRead tex/context/*/*.tex,*.mkii,*.mkiv,*.mkvi setf context
|
||||
|
||||
" Texinfo
|
||||
au BufNewFile,BufRead *.texinfo,*.texi,*.txi setf texinfo
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: ConTeXt typesetting engine
|
||||
" Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2008-07-09
|
||||
" Language: ConTeXt typesetting engine
|
||||
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
|
||||
" Former Maintainers: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2016 Oct 14
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
@@ -11,16 +12,26 @@ let b:did_ftplugin = 1
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
let b:undo_ftplugin = "setl com< cms< def< inc< sua< fo<"
|
||||
if !exists('current_compiler')
|
||||
compiler context
|
||||
endif
|
||||
|
||||
setlocal comments=b:%D,b:%C,b:%M,:% commentstring=%\ %s formatoptions+=tcroql
|
||||
let b:undo_ftplugin = "setl com< cms< def< inc< sua< fo< ofu<"
|
||||
\ . "| unlet! b:match_ignorecase b:match_words b:match_skip"
|
||||
|
||||
setlocal comments=b:%D,b:%C,b:%M,:% commentstring=%\ %s formatoptions+=tjcroql2
|
||||
if get(b:, 'context_metapost', get(g:, 'context_metapost', 1))
|
||||
setlocal omnifunc=context#complete
|
||||
let g:omni_syntax_group_include_context = 'mf\w\+,mp\w\+'
|
||||
let g:omni_syntax_group_exclude_context = 'mfTodoComment'
|
||||
endif
|
||||
|
||||
let &l:define='\\\%([egx]\|char\|mathchar\|count\|dimen\|muskip\|skip\|toks\)\='
|
||||
\ . 'def\|\\font\|\\\%(future\)\=let'
|
||||
\ . '\|\\new\%(count\|dimen\|skip\|muskip\|box\|toks\|read\|write'
|
||||
\ . '\|fam\|insert\|if\)'
|
||||
|
||||
let &l:include = '^\s*\%(input\|component\)'
|
||||
let &l:include = '^\s*\\\%(input\|component\|product\|project\|environment\)'
|
||||
|
||||
setlocal suffixesadd=.tex
|
||||
|
||||
@@ -31,5 +42,61 @@ if exists("loaded_matchit")
|
||||
\ '\\start\(\a\+\):\\stop\1'
|
||||
endif
|
||||
|
||||
let s:context_regex = {
|
||||
\ 'beginsection' : '\\\%(start\)\=\%(\%(sub\)*section\|\%(sub\)*subject\|chapter\|part\|component\|product\|title\)\>',
|
||||
\ 'endsection' : '\\\%(stop\)\=\%(\%(sub\)*section\|\%(sub\)*subject\|chapter\|part\|component\|product\|title\)\>',
|
||||
\ 'beginblock' : '\\\%(start\|setup\|define\)',
|
||||
\ 'endblock' : '\\\%(stop\|setup\|define\)'
|
||||
\ }
|
||||
|
||||
function! s:move_around(count, what, flags, visual)
|
||||
if a:visual
|
||||
exe "normal! gv"
|
||||
endif
|
||||
call search(s:context_regex[a:what], a:flags.'s') " 's' sets previous context mark
|
||||
call map(range(2, a:count), 'search(s:context_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>
|
||||
|
||||
" Other useful mappings
|
||||
if get(g:, 'context_mappings', 1)
|
||||
let s:tp_regex = '?^$\|^\s*\\\(item\|start\|stop\|blank\|\%(sub\)*section\|chapter\|\%(sub\)*subject\|title\|part\)'
|
||||
|
||||
fun! s:tp()
|
||||
call cursor(search(s:tp_regex, 'bcW') + 1, 1)
|
||||
normal! V
|
||||
call cursor(search(s:tp_regex, 'W') - 1, 1)
|
||||
endf
|
||||
|
||||
" Reflow paragraphs with commands like gqtp ("gq TeX paragraph")
|
||||
onoremap <silent><buffer> tp :<c-u>call <sid>tp()<cr>
|
||||
" Select TeX paragraph
|
||||
vnoremap <silent><buffer> tp <esc>:<c-u>call <sid>tp()<cr>
|
||||
|
||||
" $...$ text object
|
||||
onoremap <silent><buffer> i$ :<c-u>normal! T$vt$<cr>
|
||||
onoremap <silent><buffer> a$ :<c-u>normal! F$vf$<cr>
|
||||
vnoremap <buffer> i$ T$ot$
|
||||
vnoremap <buffer> a$ F$of$
|
||||
endif
|
||||
|
||||
" Commands for asynchronous typesetting
|
||||
command! -buffer -nargs=? -complete=file ConTeXt call context#typeset(<q-args>)
|
||||
command! -nargs=0 ConTeXtJobStatus call context#job_status()
|
||||
command! -nargs=0 ConTeXtStopJobs call context#stop_jobs()
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" Language: METAFONT
|
||||
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
|
||||
" Former Maintainers: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2016 Oct 1
|
||||
" Latest Revision: 2016 Oct 2
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
@@ -25,7 +25,7 @@ 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\|endlogochar\)\>',
|
||||
\ 'endsection' : '^\s*\%(enddef\|endchar\)\>',
|
||||
\ 'beginblock' : '^\s*\%(begingroup\|if\|for\%(\|suffixes\|ever\)\)\>',
|
||||
\ 'endblock' : '^\s*\%(endgroup\|fi\|endfor\)\>'
|
||||
\ }
|
||||
@@ -35,9 +35,7 @@ function! s:move_around(count, what, flags, visual)
|
||||
exe "normal! gv"
|
||||
endif
|
||||
call search(s:mp_regex[a:what], a:flags.'s') " 's' sets previous context mark
|
||||
for i in range(2, a:count)
|
||||
call search(s:mp_regex[a:what], a:flags)
|
||||
endfor
|
||||
call map(range(2, a:count), 'search(s:mp_regex[a:what], a:flags)')
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -62,8 +60,7 @@ if exists("loaded_matchit")
|
||||
\ '\<for\%(\|suffixes\|ever\)\>:\<exit\%(if\|unless\)\>:\<endfor\>,' .
|
||||
\ '\<\%(\|var\|primary\|secondary\|tertiary\)def\>:\<enddef\>,' .
|
||||
\ '\<begingroup\>:\<endgroup\>,' .
|
||||
\ '\<beginchar\>:\<endchar\>' .
|
||||
\ '\<beginlogochar\>:\<endlogochar\>'
|
||||
\ '\<begin\%(logo\)\?char\>:\<endchar\>'
|
||||
" Ignore comments and strings
|
||||
let b:match_skip = 'synIDattr(synID(line("."), col("."), 1), "name")
|
||||
\ =~# "mf\\(Comment\\|String\\)$"'
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" Language: MetaPost
|
||||
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
|
||||
" Former Maintainers: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2016 Oct 1
|
||||
" Latest Revision: 2016 Oct 2
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
@@ -34,7 +34,7 @@ endif
|
||||
|
||||
let s:mp_regex = {
|
||||
\ 'beginsection' : '^\s*\%(\%(\|var\|primary\|secondary\|tertiary\)def\|begin\%(fig\|char\|logochar\|glyph\|graph\)\)\>',
|
||||
\ 'endsection' : '^\s*\%(enddef\|end\%(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\)\>'
|
||||
\ }
|
||||
@@ -44,9 +44,7 @@ function! s:move_around(count, what, flags, visual)
|
||||
exe "normal! gv"
|
||||
endif
|
||||
call search(s:mp_regex[a:what], a:flags.'s') " 's' sets previous context mark
|
||||
for i in range(2, a:count)
|
||||
call search(s:mp_regex[a:what], a:flags)
|
||||
endfor
|
||||
call map(range(2, a:count), 'search(s:mp_regex[a:what], a:flags)')
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -72,9 +70,8 @@ if exists("loaded_matchit")
|
||||
\ '\<\%(\|var\|primary\|secondary\|tertiary\)def\>:\<enddef\>,' .
|
||||
\ '\<beginfig\>:\<endfig\>,' .
|
||||
\ '\<begingroup\>:\<endgroup\>,' .
|
||||
\ '\<beginchar\>:\<endchar\>' .
|
||||
\ '\<beginlogochar\>:\<endlogochar\>' .
|
||||
\ '\<beginglyph\>:\<endglyph\>' .
|
||||
\ '\<begin\%(logo\)\?char\>:\<endchar\>,' .
|
||||
\ '\<beginglyph\>:\<endglyph\>,' .
|
||||
\ '\<begingraph\>:\<endgraph\>'
|
||||
" Ignore comments and strings
|
||||
let b:match_skip = 'synIDattr(synID(line("."), col("."), 1), "name")
|
||||
|
||||
@@ -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>"
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
" ConTeXt indent file
|
||||
" Language: ConTeXt typesetting engine
|
||||
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
|
||||
" Last Change: 2016 Oct 15
|
||||
|
||||
if exists("b:did_indent")
|
||||
finish
|
||||
endif
|
||||
|
||||
if !get(b:, 'context_metapost', get(g:, 'context_metapost', 1))
|
||||
finish
|
||||
endif
|
||||
|
||||
" Load MetaPost indentation script
|
||||
runtime! indent/mp.vim
|
||||
|
||||
let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
|
||||
setlocal indentexpr=GetConTeXtIndent()
|
||||
|
||||
let b:undo_indent = "setl indentexpr<"
|
||||
|
||||
function! GetConTeXtIndent()
|
||||
" Use MetaPost rules inside MetaPost graphic environments
|
||||
if len(synstack(v:lnum, 1)) > 0 &&
|
||||
\ synIDattr(synstack(v:lnum, 1)[0], "name") ==# 'contextMPGraphic'
|
||||
return GetMetaPostIndent()
|
||||
endif
|
||||
return -1
|
||||
endfunc
|
||||
|
||||
let &cpo = s:keepcpo
|
||||
unlet s:keepcpo
|
||||
|
||||
" vim:sw=2
|
||||
+20
-15
@@ -2,7 +2,7 @@
|
||||
" Language: MetaPost
|
||||
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
|
||||
" Former Maintainers: Eugene Minkovskii <emin@mccme.ru>
|
||||
" Last Change: 2016 Oct 01
|
||||
" Last Change: 2016 Oct 2, 4:13pm
|
||||
" Version: 0.2
|
||||
|
||||
if exists("b:did_indent")
|
||||
@@ -57,7 +57,7 @@ let g:mp_open_tag = ''
|
||||
let g:mp_close_tag = ''
|
||||
\ . '\<fi\>'
|
||||
\ . '\|\<else\%[if]\>'
|
||||
\ . '\|\<end\%(\|for\|group\|def\|fig\|char\|logochar\|glyph\|graph\)\>'
|
||||
\ . '\|\<end\%(\|for\|group\|def\|fig\|char\|glyph\|graph\)\>'
|
||||
\ . '\|[)\]}]'
|
||||
|
||||
" Statements that may span multiple lines and are ended by a semicolon. To
|
||||
@@ -118,12 +118,10 @@ function! s:CommentOrString(line, pos)
|
||||
return in_string || (c >= 0 && c <= a:pos)
|
||||
endfunction
|
||||
|
||||
" Find the first non-comment non-blank line before the current line. Skip also
|
||||
" verbatimtex/btex... etex blocks.
|
||||
" 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*%' ||
|
||||
\ synIDattr(synID(a:lnum, 1, 1), "name") =~# '^mpTeXinsert$\|^tex\|^Delimiter'
|
||||
while getline(l:lnum) =~# '^\s*%'
|
||||
let l:lnum = prevnonblank(l:lnum - 1)
|
||||
endwhile
|
||||
return l:lnum
|
||||
@@ -220,25 +218,32 @@ endfunction
|
||||
"
|
||||
" Example:
|
||||
"
|
||||
" shiftwidth=4
|
||||
" def foo =
|
||||
" makepen(subpath(T-n,t) of r %>
|
||||
" shifted .5down %>
|
||||
" --subpath(t,T) of r shifted .5up -- cycle) %<<
|
||||
" 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)
|
||||
" 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
|
||||
|
||||
" This is the reference line relative to which the current line is indented
|
||||
" (but see below).
|
||||
@@ -327,8 +332,8 @@ function! GetMetaPostIndentIntern()
|
||||
"
|
||||
" for i = 1 upto 3: % <-- Current line: this gets the same indent as `draw ...`
|
||||
"
|
||||
" NOTE: we get here if and only if L does not contain a statement (among
|
||||
" those listed in g:mp_statement).
|
||||
" 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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
" Vim Keymap file for kazakh characters, layout 'jcuken', classical variant
|
||||
|
||||
" Derived from russian-jcuken.vim by Artem Chuprina <ran@ran.pp.ru>
|
||||
" Maintainer: Darkhan Kubigenov <darkhanu@gmail.com>
|
||||
" Last Changed: 2016 Oct 25
|
||||
|
||||
" All characters are given literally, conversion to another encoding (e.g.,
|
||||
" UTF-8) should work.
|
||||
scriptencoding utf-8
|
||||
|
||||
let b:keymap_name = "kk"
|
||||
|
||||
loadkeymap
|
||||
~ ) CYRILLIC CAPITAL LETTER IO
|
||||
` ( CYRILLIC SMALL LETTER IO
|
||||
F А CYRILLIC CAPITAL LETTER A
|
||||
< Б CYRILLIC CAPITAL LETTER BE
|
||||
D В CYRILLIC CAPITAL LETTER VE
|
||||
U Г CYRILLIC CAPITAL LETTER GHE
|
||||
L Д CYRILLIC CAPITAL LETTER DE
|
||||
T Е CYRILLIC CAPITAL LETTER IE
|
||||
: Ж CYRILLIC CAPITAL LETTER ZHE
|
||||
P З CYRILLIC CAPITAL LETTER ZE
|
||||
B И CYRILLIC CAPITAL LETTER I
|
||||
Q Й CYRILLIC CAPITAL LETTER SHORT I
|
||||
R К CYRILLIC CAPITAL LETTER KA
|
||||
K Л CYRILLIC CAPITAL LETTER EL
|
||||
V М CYRILLIC CAPITAL LETTER EM
|
||||
Y Н CYRILLIC CAPITAL LETTER EN
|
||||
J О CYRILLIC CAPITAL LETTER O
|
||||
G П CYRILLIC CAPITAL LETTER PE
|
||||
H Р CYRILLIC CAPITAL LETTER ER
|
||||
C С CYRILLIC CAPITAL LETTER ES
|
||||
N Т CYRILLIC CAPITAL LETTER TE
|
||||
E У CYRILLIC CAPITAL LETTER U
|
||||
A Ф CYRILLIC CAPITAL LETTER EF
|
||||
{ Х CYRILLIC CAPITAL LETTER HA
|
||||
W Ц CYRILLIC CAPITAL LETTER TSE
|
||||
X Ч CYRILLIC CAPITAL LETTER CHE
|
||||
I Ш CYRILLIC CAPITAL LETTER SHA
|
||||
O Щ CYRILLIC CAPITAL LETTER SHCHA
|
||||
} Ъ CYRILLIC CAPITAL LETTER HARD SIGN
|
||||
S Ы CYRILLIC CAPITAL LETTER YERU
|
||||
M Ь CYRILLIC CAPITAL LETTER SOFT SIGN
|
||||
\" Э CYRILLIC CAPITAL LETTER E
|
||||
> Ю CYRILLIC CAPITAL LETTER YU
|
||||
Z Я CYRILLIC CAPITAL LETTER YA
|
||||
f а CYRILLIC SMALL LETTER A
|
||||
, б CYRILLIC SMALL LETTER BE
|
||||
d в CYRILLIC SMALL LETTER VE
|
||||
u г CYRILLIC SMALL LETTER GHE
|
||||
l д CYRILLIC SMALL LETTER DE
|
||||
t е CYRILLIC SMALL LETTER IE
|
||||
; ж CYRILLIC SMALL LETTER ZHE
|
||||
p з CYRILLIC SMALL LETTER ZE
|
||||
b и CYRILLIC SMALL LETTER I
|
||||
q й CYRILLIC SMALL LETTER SHORT I
|
||||
r к CYRILLIC SMALL LETTER KA
|
||||
k л CYRILLIC SMALL LETTER EL
|
||||
v м CYRILLIC SMALL LETTER EM
|
||||
y н CYRILLIC SMALL LETTER EN
|
||||
j о CYRILLIC SMALL LETTER O
|
||||
g п CYRILLIC SMALL LETTER PE
|
||||
h р CYRILLIC SMALL LETTER ER
|
||||
c с CYRILLIC SMALL LETTER ES
|
||||
n т CYRILLIC SMALL LETTER TE
|
||||
e у CYRILLIC SMALL LETTER U
|
||||
a ф CYRILLIC SMALL LETTER EF
|
||||
[ х CYRILLIC SMALL LETTER HA
|
||||
w ц CYRILLIC SMALL LETTER TSE
|
||||
x ч CYRILLIC SMALL LETTER CHE
|
||||
i ш CYRILLIC SMALL LETTER SHA
|
||||
o щ CYRILLIC SMALL LETTER SHCHA
|
||||
] ъ CYRILLIC SMALL LETTER HARD SIGN
|
||||
s ы CYRILLIC SMALL LETTER YERU
|
||||
m ь CYRILLIC SMALL LETTER SOFT SIGN
|
||||
' э CYRILLIC SMALL LETTER E
|
||||
. ю CYRILLIC SMALL LETTER YU
|
||||
z я CYRILLIC SMALL LETTER YA
|
||||
@ Ә CYRILLIC CAPITAL LETTER SCHWA
|
||||
# І CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
|
||||
$ Ң CYRILLIC CAPITAL LETTER EN WITH DESCENDER
|
||||
% Ғ CYRILLIC CAPITAL LETTER GHE WITH STROKE
|
||||
^ ;
|
||||
& :
|
||||
* Ү CYRILLIC CAPITAL LETTER STRAIGHT U
|
||||
( Ұ CYRILLIC CAPITAL LETTER STRAIGHT U WITH STROKE
|
||||
) Қ CYRILLIC CAPITAL LETTER KA WITH DESCENDER
|
||||
_ Ө CYRILLIC CAPITAL LETTER BARRED O
|
||||
+ Һ CYRILLIC CAPITAL LETTER SHHA
|
||||
1 "
|
||||
2 ә CYRILLIC SMALL LETTER SCHWA
|
||||
3 і CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
|
||||
4 ң CYRILLIC SMALL LETTER EN WITH DESCENDER
|
||||
5 ғ CYRILLIC SMALL LETTER GHE WITH STROKE
|
||||
6 ,
|
||||
7 .
|
||||
8 ү CYRILLIC SMALL LETTER STRAIGHT U
|
||||
9 ұ CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE
|
||||
0 қ CYRILLIC SMALL LETTER KA WITH DESCENDER
|
||||
- ө CYRILLIC SMALL LETTER BARRED O
|
||||
= һ CYRILLIC SMALL LETTER SHHA
|
||||
@@ -1,7 +1,7 @@
|
||||
" Menu Translations: Slovenian / Slovensko
|
||||
" Maintainer: Mojca Miklavec <mojca.miklavec.lists@gmail.com>
|
||||
" Originally By: Mojca Miklavec <mojca.miklavec.lists@gmail.com>
|
||||
" Last Change: Sat, 17 Jun 2006
|
||||
" Last Change: 2016 Oct 17
|
||||
" vim:set foldmethod=marker tabstop=8:
|
||||
|
||||
" TODO: add/check all '&'s
|
||||
@@ -31,7 +31,7 @@ menutrans E&xit<Tab>:qa &Izhod<Tab>:qa
|
||||
|
||||
if has("diff")
|
||||
menutrans Split\ &Diff\ with\.\.\. Primerjaj\ z\ (di&ff)\ \.\.\.
|
||||
menutrans Split\ Patched\ &By\.\.\. &Popravi\ z\ (patch)\ \.\.\.
|
||||
menutrans Split\ Patched\ &By\.\.\. &Popravi\ s\ (patch)\ \.\.\.
|
||||
endif
|
||||
" }}} FILE / DATOTEKA
|
||||
|
||||
@@ -96,12 +96,12 @@ menutrans Soft\ &Tabstop
|
||||
menutrans Te&xt\ Width\.\.\. Širina\ besedila\ \.\.\.
|
||||
menutrans &File\ Format\.\.\. Format\ &datoteke\ \.\.\.
|
||||
menutrans C&olor\ Scheme &Barvna\ shema\ \.\.\.
|
||||
menutrans &Keymap &Keymap
|
||||
menutrans &Keymap Razporeditev\ tip&k
|
||||
menutrans Select\ Fo&nt\.\.\. Pisava\ \.\.\.
|
||||
" }}} EDIT / UREDI
|
||||
|
||||
" {{{ TOOLS / ORODJA
|
||||
menutrans &Tools &Orodja
|
||||
menutrans &Tools O&rodja
|
||||
menutrans &Jump\ to\ this\ tag<Tab>g^] &Skoèi\ k\ tej\ znaèki<Tab>g^]
|
||||
menutrans Jump\ &back<Tab>^T Skoèi\ Na&zaj<Tab>^T
|
||||
menutrans Build\ &Tags\ File Napravi\ datoteke\ z\ znaèkami\ (tag)
|
||||
@@ -175,7 +175,7 @@ menutrans &Set\ Compiler Nastavi\ &prevajalnik
|
||||
menutrans Se&T\ Compiler Nastavi\ &prevajalnik " bug in original translation?
|
||||
|
||||
menutrans &Convert\ to\ HEX<Tab>:%!xxd Pretvori\ v\ HE&X<Tab>:%!xxd
|
||||
menutrans Conve&rt\ back<Tab>:%!xxd\ -r Pretvori\ nazaj<Tab>:%!xxd\ -r
|
||||
menutrans Conve&rt\ back<Tab>:%!xxd\ -r Povrni\ pretvo&rbo<Tab>:%!xxd\ -r
|
||||
" }}} TOOLS / ORODJA
|
||||
|
||||
" {{{ SYNTAX / BARVANJE KODE
|
||||
@@ -242,7 +242,7 @@ menutrans &About &O\ programu
|
||||
" {{{ POPUP
|
||||
menutrans &Undo &Razveljavi
|
||||
menutrans Cu&t &Izreži
|
||||
menutrans &Copy &Kopieraj
|
||||
menutrans &Copy &Kopiraj
|
||||
menutrans &Paste &Prilepi
|
||||
menutrans &Delete &Zbriši
|
||||
menutrans Select\ Blockwise Izbiraj\ po\ blokih
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Menu Translations: Slovenian / Slovensko
|
||||
" Maintainer: Mojca Miklavec <mojca.miklavec.lists@gmail.com>
|
||||
" Originally By: Mojca Miklavec <mojca.miklavec.lists@gmail.com>
|
||||
" Last Change: Mon, 12 Jun 2006 00:00:00 CEST
|
||||
" Last Change: 2016 Oct 17
|
||||
" vim:set foldmethod=marker tabstop=8:
|
||||
|
||||
" TODO: add/check all '&'s
|
||||
@@ -31,7 +31,7 @@ menutrans E&xit<Tab>:qa &Izhod<Tab>:qa
|
||||
|
||||
if has("diff")
|
||||
menutrans Split\ &Diff\ with\.\.\. Primerjaj\ z\ (di&ff)\ \.\.\.
|
||||
menutrans Split\ Patched\ &By\.\.\. &Popravi\ z\ (patch)\ \.\.\.
|
||||
menutrans Split\ Patched\ &By\.\.\. &Popravi\ s\ (patch)\ \.\.\.
|
||||
endif
|
||||
" }}} FILE / DATOTEKA
|
||||
|
||||
@@ -96,12 +96,12 @@ menutrans Soft\ &Tabstop
|
||||
menutrans Te&xt\ Width\.\.\. ©irina\ besedila\ \.\.\.
|
||||
menutrans &File\ Format\.\.\. Format\ &datoteke\ \.\.\.
|
||||
menutrans C&olor\ Scheme &Barvna\ shema\ \.\.\.
|
||||
menutrans &Keymap &Keymap
|
||||
menutrans &Keymap Razporeditev\ tip&k
|
||||
menutrans Select\ Fo&nt\.\.\. Pisava\ \.\.\.
|
||||
" }}} EDIT / UREDI
|
||||
|
||||
" {{{ TOOLS / ORODJA
|
||||
menutrans &Tools &Orodja
|
||||
menutrans &Tools O&rodja
|
||||
menutrans &Jump\ to\ this\ tag<Tab>g^] &Skoèi\ k\ tej\ znaèki<Tab>g^]
|
||||
menutrans Jump\ &back<Tab>^T Skoèi\ Na&zaj<Tab>^T
|
||||
menutrans Build\ &Tags\ File Napravi\ datoteke\ z\ znaèkami\ (tag)
|
||||
@@ -175,7 +175,7 @@ menutrans &Set\ Compiler Nastavi\ &prevajalnik
|
||||
menutrans Se&T\ Compiler Nastavi\ &prevajalnik " bug in original translation?
|
||||
|
||||
menutrans &Convert\ to\ HEX<Tab>:%!xxd Pretvori\ v\ HE&X<Tab>:%!xxd
|
||||
menutrans Conve&rt\ back<Tab>:%!xxd\ -r Pretvori\ nazaj<Tab>:%!xxd\ -r
|
||||
menutrans Conve&rt\ back<Tab>:%!xxd\ -r Povrni\ pretvo&rbo<Tab>:%!xxd\ -r
|
||||
" }}} TOOLS / ORODJA
|
||||
|
||||
" {{{ SYNTAX / BARVANJE KODE
|
||||
@@ -242,7 +242,7 @@ menutrans &About &O\ programu
|
||||
" {{{ POPUP
|
||||
menutrans &Undo &Razveljavi
|
||||
menutrans Cu&t &Izre¾i
|
||||
menutrans &Copy &Kopieraj
|
||||
menutrans &Copy &Kopiraj
|
||||
menutrans &Paste &Prilepi
|
||||
menutrans &Delete &Zbri¹i
|
||||
menutrans Select\ Blockwise Izbiraj\ po\ blokih
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Menu Translations: Slovenian / Slovensko
|
||||
" Maintainer: Mojca Miklavec <mojca.miklavec.lists@gmail.com>
|
||||
" Originally By: Mojca Miklavec <mojca.miklavec.lists@gmail.com>
|
||||
" Last Change: Sat, 17 Jun 2006
|
||||
" Last Change: 2016 Oct 17
|
||||
" vim:set foldmethod=marker tabstop=8:
|
||||
|
||||
" TODO: add/check all '&'s
|
||||
@@ -31,7 +31,7 @@ menutrans E&xit<Tab>:qa &Izhod<Tab>:qa
|
||||
|
||||
if has("diff")
|
||||
menutrans Split\ &Diff\ with\.\.\. Primerjaj\ z\ (di&ff)\ \.\.\.
|
||||
menutrans Split\ Patched\ &By\.\.\. &Popravi\ z\ (patch)\ \.\.\.
|
||||
menutrans Split\ Patched\ &By\.\.\. &Popravi\ s\ (patch)\ \.\.\.
|
||||
endif
|
||||
" }}} FILE / DATOTEKA
|
||||
|
||||
@@ -96,12 +96,12 @@ menutrans Soft\ &Tabstop Širina\ &tabulatorja
|
||||
menutrans Te&xt\ Width\.\.\. Širina\ besedila\ \.\.\.
|
||||
menutrans &File\ Format\.\.\. Format\ &datoteke\ \.\.\.
|
||||
menutrans C&olor\ Scheme &Barvna\ shema\ \.\.\.
|
||||
menutrans &Keymap &Keymap
|
||||
menutrans &Keymap Razporeditev\ tip&k
|
||||
menutrans Select\ Fo&nt\.\.\. Pisava\ \.\.\.
|
||||
" }}} EDIT / UREDI
|
||||
|
||||
" {{{ TOOLS / ORODJA
|
||||
menutrans &Tools &Orodja
|
||||
menutrans &Tools O&rodja
|
||||
menutrans &Jump\ to\ this\ tag<Tab>g^] &Skoči\ k\ tej\ znački<Tab>g^]
|
||||
menutrans Jump\ &back<Tab>^T Skoči\ Na&zaj<Tab>^T
|
||||
menutrans Build\ &Tags\ File Napravi\ datoteke\ z\ značkami\ (tag)
|
||||
@@ -175,7 +175,7 @@ menutrans &Set\ Compiler Nastavi\ &prevajalnik
|
||||
menutrans Se&T\ Compiler Nastavi\ &prevajalnik " bug in original translation?
|
||||
|
||||
menutrans &Convert\ to\ HEX<Tab>:%!xxd Pretvori\ v\ HE&X<Tab>:%!xxd
|
||||
menutrans Conve&rt\ back<Tab>:%!xxd\ -r Pretvori\ nazaj<Tab>:%!xxd\ -r
|
||||
menutrans Conve&rt\ back<Tab>:%!xxd\ -r Povrni\ pretvo&rbo<Tab>:%!xxd\ -r
|
||||
" }}} TOOLS / ORODJA
|
||||
|
||||
" {{{ SYNTAX / BARVANJE KODE
|
||||
@@ -242,7 +242,7 @@ menutrans &About &O\ programu
|
||||
" {{{ POPUP
|
||||
menutrans &Undo &Razveljavi
|
||||
menutrans Cu&t &Izreži
|
||||
menutrans &Copy &Kopieraj
|
||||
menutrans &Copy &Kopiraj
|
||||
menutrans &Paste &Prilepi
|
||||
menutrans &Delete &Zbriši
|
||||
menutrans Select\ Blockwise Izbiraj\ po\ blokih
|
||||
|
||||
+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
|
||||
|
||||
+25
-25
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: C
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2016 Jul 07
|
||||
" Last Change: 2016 Oct 27
|
||||
|
||||
" Quit when a (custom) syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
@@ -358,36 +358,36 @@ if !exists("c_no_c99") " ISO C99
|
||||
endif
|
||||
|
||||
" Accept %: for # (C99)
|
||||
syn region cPreCondit start="^\s*\(%:\|#\)\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" keepend contains=cComment,cCommentL,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError
|
||||
syn match cPreConditMatch display "^\s*\(%:\|#\)\s*\(else\|endif\)\>"
|
||||
syn region cPreCondit start="^\s*\zs\(%:\|#\)\s*\(if\|ifdef\|ifndef\|elif\)\>" skip="\\$" end="$" keepend contains=cComment,cCommentL,cCppString,cCharacter,cCppParen,cParenError,cNumbers,cCommentError,cSpaceError
|
||||
syn match cPreConditMatch display "^\s*\zs\(%:\|#\)\s*\(else\|endif\)\>"
|
||||
if !exists("c_no_if0")
|
||||
syn cluster cCppOutInGroup contains=cCppInIf,cCppInElse,cCppInElse2,cCppOutIf,cCppOutIf2,cCppOutElse,cCppInSkip,cCppOutSkip
|
||||
syn region cCppOutWrapper start="^\s*\(%:\|#\)\s*if\s\+0\+\s*\($\|//\|/\*\|&\)" end=".\@=\|$" contains=cCppOutIf,cCppOutElse,@NoSpell fold
|
||||
syn region cCppOutIf contained start="0\+" matchgroup=cCppOutWrapper end="^\s*\(%:\|#\)\s*endif\>" contains=cCppOutIf2,cCppOutElse
|
||||
syn region cCppOutWrapper start="^\s*\zs\(%:\|#\)\s*if\s\+0\+\s*\($\|//\|/\*\|&\)" end=".\@=\|$" contains=cCppOutIf,cCppOutElse,@NoSpell fold
|
||||
syn region cCppOutIf contained start="0\+" matchgroup=cCppOutWrapper end="^\s*\zs\(%:\|#\)\s*endif\>" contains=cCppOutIf2,cCppOutElse
|
||||
if !exists("c_no_if0_fold")
|
||||
syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell fold
|
||||
syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\zs\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell fold
|
||||
else
|
||||
syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell
|
||||
endif
|
||||
syn region cCppOutElse contained matchgroup=cCppOutWrapper start="^\s*\(%:\|#\)\s*\(else\|elif\)" end="^\s*\(%:\|#\)\s*endif\>"me=s-1 contains=TOP,cPreCondit
|
||||
syn region cCppInWrapper start="^\s*\(%:\|#\)\s*if\s\+0*[1-9]\d*\s*\($\|//\|/\*\||\)" end=".\@=\|$" contains=cCppInIf,cCppInElse fold
|
||||
syn region cCppInIf contained matchgroup=cCppInWrapper start="\d\+" end="^\s*\(%:\|#\)\s*endif\>" contains=TOP,cPreCondit
|
||||
syn region cCppOutElse contained matchgroup=cCppOutWrapper start="^\s*\zs\(%:\|#\)\s*\(else\|elif\)" end="^\s*\zs\(%:\|#\)\s*endif\>"me=s-1 contains=TOP,cPreCondit
|
||||
syn region cCppInWrapper start="^\s*\zs\(%:\|#\)\s*if\s\+0*[1-9]\d*\s*\($\|//\|/\*\||\)" end=".\@=\|$" contains=cCppInIf,cCppInElse fold
|
||||
syn region cCppInIf contained matchgroup=cCppInWrapper start="\d\+" end="^\s*\zs\(%:\|#\)\s*endif\>" contains=TOP,cPreCondit
|
||||
if !exists("c_no_if0_fold")
|
||||
syn region cCppInElse contained start="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 fold
|
||||
syn region cCppInElse contained start="^\s*\zs\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 fold
|
||||
else
|
||||
syn region cCppInElse contained start="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2
|
||||
syn region cCppInElse contained start="^\s*\zs\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2
|
||||
endif
|
||||
syn region cCppInElse2 contained matchgroup=cCppInWrapper start="^\s*\(%:\|#\)\s*\(else\|elif\)\([^/]\|/[^/*]\)*" end="^\s*\(%:\|#\)\s*endif\>"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell
|
||||
syn region cCppOutSkip contained start="^\s*\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppOutSkip
|
||||
syn region cCppInSkip contained matchgroup=cCppInWrapper start="^\s*\(%:\|#\)\s*\(if\s\+\(\d\+\s*\($\|//\|/\*\||\|&\)\)\@!\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\(%:\|#\)\s*endif\>" containedin=cCppOutElse,cCppInIf,cCppInSkip contains=TOP,cPreProc
|
||||
syn region cCppInElse2 contained matchgroup=cCppInWrapper start="^\s*\zs\(%:\|#\)\s*\(else\|elif\)\([^/]\|/[^/*]\)*" end="^\s*\zs\(%:\|#\)\s*endif\>"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell
|
||||
syn region cCppOutSkip contained start="^\s*\zs\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\zs\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppOutSkip
|
||||
syn region cCppInSkip contained matchgroup=cCppInWrapper start="^\s*\zs\(%:\|#\)\s*\(if\s\+\(\d\+\s*\($\|//\|/\*\||\|&\)\)\@!\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\zs\(%:\|#\)\s*endif\>" containedin=cCppOutElse,cCppInIf,cCppInSkip contains=TOP,cPreProc
|
||||
endif
|
||||
syn region cIncluded display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
|
||||
syn match cIncluded display contained "<[^>]*>"
|
||||
syn match cInclude display "^\s*\(%:\|#\)\s*include\>\s*["<]" contains=cIncluded
|
||||
syn match cInclude display "^\s*\zs\(%:\|#\)\s*include\>\s*["<]" contains=cIncluded
|
||||
"syn match cLineSkip "\\$"
|
||||
syn cluster cPreProcGroup contains=cPreCondit,cIncluded,cInclude,cDefine,cErrInParen,cErrInBracket,cUserLabel,cSpecial,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cString,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cParen,cBracket,cMulti,cBadBlock
|
||||
syn region cDefine start="^\s*\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell
|
||||
syn region cPreProc start="^\s*\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell
|
||||
syn region cDefine start="^\s*\zs\(%:\|#\)\s*\(define\|undef\)\>" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell
|
||||
syn region cPreProc start="^\s*\zs\(%:\|#\)\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" keepend contains=ALLBUT,@cPreProcGroup,@Spell
|
||||
|
||||
" Highlight User Labels
|
||||
syn cluster cMultiGroup contains=cIncluded,cSpecial,cCommentSkip,cCommentString,cComment2String,@cCommentGroup,cCommentStartError,cUserCont,cUserLabel,cBitField,cOctalZero,cCppOutWrapper,cCppInWrapper,@cCppOutInGroup,cFormat,cNumber,cFloat,cOctal,cOctalError,cNumbersCom,cCppParen,cCppBracket,cCppString
|
||||
@@ -396,21 +396,21 @@ if s:ft ==# 'c' || exists("cpp_no_cpp11")
|
||||
endif
|
||||
" Avoid matching foo::bar() in C++ by requiring that the next char is not ':'
|
||||
syn cluster cLabelGroup contains=cUserLabel
|
||||
syn match cUserCont display "^\s*\I\i*\s*:$" contains=@cLabelGroup
|
||||
syn match cUserCont display ";\s*\I\i*\s*:$" contains=@cLabelGroup
|
||||
syn match cUserCont display "^\s*\zs\I\i*\s*:$" contains=@cLabelGroup
|
||||
syn match cUserCont display ";\s*\zs\I\i*\s*:$" contains=@cLabelGroup
|
||||
if s:ft ==# 'cpp'
|
||||
syn match cUserCont display "^\s*\%(class\|struct\|enum\)\@!\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
|
||||
syn match cUserCont display ";\s*\%(class\|struct\|enum\)\@!\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
|
||||
syn match cUserCont display "^\s*\zs\%(class\|struct\|enum\)\@!\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
|
||||
syn match cUserCont display ";\s*\zs\%(class\|struct\|enum\)\@!\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
|
||||
else
|
||||
syn match cUserCont display "^\s*\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
|
||||
syn match cUserCont display ";\s*\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
|
||||
syn match cUserCont display "^\s*\zs\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
|
||||
syn match cUserCont display ";\s*\zs\I\i*\s*:[^:]"me=e-1 contains=@cLabelGroup
|
||||
endif
|
||||
|
||||
syn match cUserLabel display "\I\i*" contained
|
||||
|
||||
" Avoid recognizing most bitfields as labels
|
||||
syn match cBitField display "^\s*\I\i*\s*:\s*[1-9]"me=e-1 contains=cType
|
||||
syn match cBitField display ";\s*\I\i*\s*:\s*[1-9]"me=e-1 contains=cType
|
||||
syn match cBitField display "^\s*\zs\I\i*\s*:\s*[1-9]"me=e-1 contains=cType
|
||||
syn match cBitField display ";\s*\zs\I\i*\s*:\s*[1-9]"me=e-1 contains=cType
|
||||
|
||||
if exists("c_minlines")
|
||||
let b:c_minlines = c_minlines
|
||||
|
||||
+74
-41
@@ -1,7 +1,8 @@
|
||||
" Vim syntax file
|
||||
" Language: ConTeXt typesetting engine
|
||||
" Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2006-08-10
|
||||
" Language: ConTeXt typesetting engine
|
||||
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
|
||||
" Former Maintainers: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2016 Oct 16
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
@@ -13,65 +14,93 @@ unlet b:current_syntax
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if !exists('g:context_include')
|
||||
let g:context_include = ['mp', 'javascript', 'xml']
|
||||
" Dictionary of (filetype, group) pairs to highlight between \startGROUP \stopGROUP.
|
||||
let s:context_include = get(b:, 'context_include', get(g:, 'context_include', {'xml': 'XML'}))
|
||||
|
||||
" For backward compatibility (g:context_include used to be a List)
|
||||
if type(s:context_include) ==# type([])
|
||||
let g:context_metapost = (index(s:context_include, 'mp') != -1)
|
||||
let s:context_include = filter(
|
||||
\ {'c': 'C', 'javascript': 'JS', 'ruby': 'Ruby', 'xml': 'XML'},
|
||||
\ { k,_ -> index(s:context_include, k) != -1 }
|
||||
\ )
|
||||
endif
|
||||
|
||||
syn iskeyword @,48-57,a-z,A-Z,192-255
|
||||
|
||||
syn spell toplevel
|
||||
|
||||
syn match contextBlockDelim display '\\\%(start\|stop\)\a\+'
|
||||
\ contains=@NoSpell
|
||||
" ConTeXt options, i.e., [...] blocks
|
||||
syn region contextOptions matchgroup=contextDelimiter start='\[' end=']\|\ze\\stop' skip='\\\[\|\\\]' contains=ALLBUT,contextBeginEndLua,@Spell
|
||||
|
||||
syn region contextEscaped display matchgroup=contextPreProc
|
||||
\ start='\\type\z(\A\)' end='\z1'
|
||||
syn region contextEscaped display matchgroup=contextPreProc
|
||||
\ start='\\type\={' end='}'
|
||||
syn region contextEscaped display matchgroup=contextPreProc
|
||||
\ start='\\type\=<<' end='>>'
|
||||
" Highlight braces
|
||||
syn match contextDelimiter '[{}]'
|
||||
|
||||
" Comments
|
||||
syn match contextComment '\\\@<!\%(\\\\\)*\zs%.*$' display contains=initexTodo
|
||||
syn match contextComment '^\s*%[CDM].*$' display contains=initexTodo
|
||||
|
||||
syn match contextBlockDelim '\\\%(start\|stop\)\a\+' contains=@NoSpell
|
||||
|
||||
syn region contextEscaped matchgroup=contextPreProc start='\\type\%(\s*\|\n\)*\z([^A-Za-z%]\)' end='\z1'
|
||||
syn region contextEscaped matchgroup=contextPreProc start='\\type\=\%(\s\|\n\)*{' end='}'
|
||||
syn region contextEscaped matchgroup=contextPreProc start='\\type\=\%(\s*\|\n\)*<<' end='>>'
|
||||
syn region contextEscaped matchgroup=contextPreProc
|
||||
\ start='\\start\z(\a*\%(typing\|typen\)\)'
|
||||
\ end='\\stop\z1' contains=plaintexComment keepend
|
||||
syn region contextEscaped display matchgroup=contextPreProc
|
||||
\ start='\\\h\+Type{' end='}'
|
||||
syn region contextEscaped display matchgroup=contextPreProc
|
||||
\ start='\\Typed\h\+{' end='}'
|
||||
syn region contextEscaped matchgroup=contextPreProc start='\\\h\+Type\%(\s\|\n\)*{' end='}'
|
||||
syn region contextEscaped matchgroup=contextPreProc start='\\Typed\h\+\%(\s\|\n\)*{' end='}'
|
||||
|
||||
syn match contextBuiltin display contains=@NoSpell
|
||||
\ '\\\%(unprotect\|protect\|unexpanded\)'
|
||||
\ '\\\%(unprotect\|protect\|unexpanded\)\>'
|
||||
|
||||
syn match contextPreProc '^\s*\\\%(start\|stop\)\=\%(component\|environment\|project\|product\).*$'
|
||||
syn match contextPreProc '^\s*\\\%(start\|stop\)\=\%(component\|environment\|project\|product\)\>'
|
||||
\ contains=@NoSpell
|
||||
|
||||
if index(g:context_include, 'mp') != -1
|
||||
if get(b:, 'context_metapost', get(g:, 'context_metapost', 1))
|
||||
let b:mp_metafun_macros = 1 " Highlight MetaFun keywords
|
||||
syn include @mpTop syntax/mp.vim
|
||||
unlet b:current_syntax
|
||||
|
||||
syn region contextMPGraphic transparent matchgroup=contextBlockDelim
|
||||
\ start='\\start\z(\a*MPgraphic\|MP\%(page\|inclusions\|run\)\).*'
|
||||
syn region contextMPGraphic matchgroup=contextBlockDelim
|
||||
\ start='\\start\z(MP\%(clip\|code\|definitions\|drawing\|environment\|extensions\|inclusions\|initializations\|page\|\)\)\>.*$'
|
||||
\ end='\\stop\z1'
|
||||
\ contains=@mpTop
|
||||
\ contains=@mpTop,@NoSpell
|
||||
syn region contextMPGraphic matchgroup=contextBlockDelim
|
||||
\ start='\\start\z(\%(\%[re]usable\|use\|unique\|static\)MPgraphic\|staticMPfigure\|uniqueMPpagegraphic\)\>.*$'
|
||||
\ end='\\stop\z1'
|
||||
\ contains=@mpTop,@NoSpell
|
||||
endif
|
||||
|
||||
" TODO: also need to implement this for \\typeC or something along those
|
||||
" lines.
|
||||
function! s:include_syntax(name, group)
|
||||
if index(g:context_include, a:name) != -1
|
||||
execute 'syn include @' . a:name . 'Top' 'syntax/' . a:name . '.vim'
|
||||
unlet b:current_syntax
|
||||
execute 'syn region context' . a:group . 'Code'
|
||||
\ 'transparent matchgroup=contextBlockDelim'
|
||||
\ 'start=+\\start' . a:group . '+ end=+\\stop' . a:group . '+'
|
||||
\ 'contains=@' . a:name . 'Top'
|
||||
endif
|
||||
endfunction
|
||||
if get(b:, 'context_lua', get(g:, 'context_lua', 1))
|
||||
syn include @luaTop syntax/lua.vim
|
||||
unlet b:current_syntax
|
||||
|
||||
call s:include_syntax('c', 'C')
|
||||
call s:include_syntax('ruby', 'Ruby')
|
||||
call s:include_syntax('javascript', 'JS')
|
||||
call s:include_syntax('xml', 'XML')
|
||||
syn region contextLuaCode matchgroup=contextBlockDelim
|
||||
\ start='\\startluacode\>'
|
||||
\ end='\\stopluacode\>' keepend
|
||||
\ contains=@luaTop,@NoSpell
|
||||
|
||||
syn match contextSectioning '\\chapter\>' contains=@NoSpell
|
||||
syn match contextSectioning '\\\%(sub\)*section\>' contains=@NoSpell
|
||||
syn match contextDirectLua "\\\%(directlua\|ctxlua\)\>\%(\s*%.*$\)\="
|
||||
\ nextgroup=contextBeginEndLua skipwhite skipempty
|
||||
\ contains=initexComment
|
||||
syn region contextBeginEndLua matchgroup=contextSpecial
|
||||
\ start="{" end="}" skip="\\[{}]"
|
||||
\ contained contains=@luaTop,@NoSpell
|
||||
endif
|
||||
|
||||
for synname in keys(s:context_include)
|
||||
execute 'syn include @' . synname . 'Top' 'syntax/' . synname . '.vim'
|
||||
unlet b:current_syntax
|
||||
execute 'syn region context' . s:context_include[synname] . 'Code'
|
||||
\ 'matchgroup=contextBlockDelim'
|
||||
\ 'start=+\\start' . s:context_include[synname] . '+'
|
||||
\ 'end=+\\stop' . s:context_include[synname] . '+'
|
||||
\ 'contains=@' . synname . 'Top,@NoSpell'
|
||||
endfor
|
||||
|
||||
syn match contextSectioning '\\\%(start\|stop\)\=\%(\%(sub\)*section\|\%(sub\)*subject\|chapter\|part\|component\|product\|title\)\>'
|
||||
\ contains=@NoSpell
|
||||
|
||||
syn match contextSpecial '\\crlf\>\|\\par\>\|-\{2,3}\||[<>/]\=|'
|
||||
\ contains=@NoSpell
|
||||
@@ -92,15 +121,19 @@ syn match contextFont '\\\%(vi\{1,3}\|ix\|xi\{0,2}\)\>'
|
||||
syn match contextFont '\\\%(tf\|b[si]\|s[cl]\|os\)\%(xx\|[xabcd]\)\=\>'
|
||||
\ contains=@NoSpell
|
||||
|
||||
hi def link contextOptions Typedef
|
||||
hi def link contextComment Comment
|
||||
hi def link contextBlockDelim Keyword
|
||||
hi def link contextBuiltin Keyword
|
||||
hi def link contextDelimiter Delimiter
|
||||
hi def link contextEscaped String
|
||||
hi def link contextPreProc PreProc
|
||||
hi def link contextSectioning PreProc
|
||||
hi def link contextSpecial Special
|
||||
hi def link contextType Type
|
||||
hi def link contextStyle contextType
|
||||
hi def link contextFont contextType
|
||||
hi def link contextDirectLua Keyword
|
||||
|
||||
let b:current_syntax = "context"
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" Language: MetaPost
|
||||
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
|
||||
" Former Maintainers: Andreas Scherer <andreas.scherer@pobox.com>
|
||||
" Last Change: 2016 Oct 01
|
||||
" Last Change: 2016 Oct 14
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
@@ -233,7 +233,10 @@ if get(g:, "other_mp_macros", 1)
|
||||
endif
|
||||
|
||||
" Up to date as of 23-Sep-2016.
|
||||
if get(g:, "mp_metafun_macros", 0)
|
||||
if get(b:, 'mp_metafun_macros', get(g:, 'mp_metafun_macros', 0))
|
||||
" Highlight TeX keywords (for use in ConTeXt documents)
|
||||
syn match mpTeXKeyword '\\[a-zA-Z@]\+'
|
||||
|
||||
" These keywords have been added manually.
|
||||
syn keyword mpPrimitive runscript
|
||||
|
||||
@@ -756,6 +759,7 @@ hi def link mpVariable mfVariable
|
||||
hi def link mpConstant mfConstant
|
||||
hi def link mpOnOff mpPrimitive
|
||||
hi def link mpDash mpPrimitive
|
||||
hi def link mpTeXKeyword Identifier
|
||||
|
||||
let b:current_syntax = "mp"
|
||||
|
||||
|
||||
+10
-6
@@ -2,8 +2,8 @@
|
||||
" Language: shell (sh) Korn shell (ksh) bash (sh)
|
||||
" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
|
||||
" Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int>
|
||||
" Last Change: Aug 31, 2016
|
||||
" Version: 162
|
||||
" Last Change: Sep 22, 2016
|
||||
" Version: 165
|
||||
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH
|
||||
" For options and settings, please use: :help ft-sh-syntax
|
||||
" This file includes many ideas from Eric Brunet (eric.brunet@ens.fr)
|
||||
@@ -170,7 +170,7 @@ if exists("b:is_kornshell") || exists("b:is_bash")
|
||||
|
||||
" Touch: {{{1
|
||||
" =====
|
||||
syn match shTouch '\<touch\>[^;#]*' skipwhite nextgroup=shComment contains=shTouchCmd
|
||||
syn match shTouch '\<touch\>[^;#]*' skipwhite nextgroup=shComment contains=shTouchCmd,shDoubleQuote,shSingleQuote,shDeref,shDerefSimple
|
||||
syn match shTouchCmd '\<touch\>' contained
|
||||
endif
|
||||
|
||||
@@ -220,7 +220,7 @@ syn region shSubSh transparent matchgroup=shSubShRegion start="[^(]\zs(" end=")"
|
||||
"=======
|
||||
syn region shExpr matchgroup=shRange start="\[" skip=+\\\\\|\\$\|\[+ end="\]" contains=@shTestList,shSpecial
|
||||
syn region shTest transparent matchgroup=shStatement start="\<test\s" skip=+\\\\\|\\$+ matchgroup=NONE end="[;&|]"me=e-1 end="$" contains=@shExprList1
|
||||
syn region shNoQuote start='\S' skip='\%(\\\\\)*\\.' end='\ze\s' contained
|
||||
syn region shNoQuote start='\S' skip='\%(\\\\\)*\\.' end='\ze\s' contained contains=shDerefSimple,shDeref
|
||||
syn match shAstQuote contained '\*\ze"' nextgroup=shString
|
||||
syn match shTestOpr contained '[^-+/%]\zs=' skipwhite nextgroup=shTestDoubleQuote,shTestSingleQuote,shTestPattern
|
||||
syn match shTestOpr contained "<=\|>=\|!=\|==\|=\~\|-.\>\|-\(nt\|ot\|ef\|eq\|ne\|lt\|le\|gt\|ge\)\>\|[!<>]"
|
||||
@@ -355,7 +355,11 @@ syn region shBkslshDblQuote contained matchgroup=shQuote start=+"+ skip=+\\"+ e
|
||||
" Comments: {{{1
|
||||
"==========
|
||||
syn cluster shCommentGroup contains=shTodo,@Spell
|
||||
syn keyword shTodo contained COMBAK FIXME TODO XXX
|
||||
if exists("b:is_bash")
|
||||
syn match shTodo contained "\<\%(COMBAK\|FIXME\|TODO\|XXX\)\ze:\=\>"
|
||||
else
|
||||
syn keyword shTodo contained COMBAK FIXME TODO XXX
|
||||
endif
|
||||
syn match shComment "^\s*\zs#.*$" contains=@shCommentGroup
|
||||
syn match shComment "\s\zs#.*$" contains=@shCommentGroup
|
||||
syn match shComment contained "#.*$" contains=@shCommentGroup
|
||||
@@ -381,7 +385,7 @@ ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<-\s*\\\z([^ \
|
||||
|
||||
" Here Strings: {{{1
|
||||
" =============
|
||||
" available for: bash; ksh (really should be ksh93 only) but not if it's a posix
|
||||
" available for: bash; ksh (really should be ksh93 only) but not if its a posix
|
||||
if exists("b:is_bash") || (exists("b:is_kornshell") && !exists("g:is_posix"))
|
||||
syn match shHereString "<<<" skipwhite nextgroup=shCmdParenRegion
|
||||
endif
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
" Vim syntax file
|
||||
" Language: sendmail
|
||||
" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
|
||||
" Last Change: Oct 23, 2014
|
||||
" Version: 7
|
||||
" Last Change: Oct 25, 2016
|
||||
" Version: 8
|
||||
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SM
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
@@ -62,10 +61,10 @@ hi def link smClause Special
|
||||
hi def link smClauseError Error
|
||||
hi def link smComment Comment
|
||||
hi def link smDefine Statement
|
||||
hi def link smElse Delimiter
|
||||
hi def link smElse Delimiter
|
||||
hi def link smHeader Statement
|
||||
hi def link smHeaderSep String
|
||||
hi def link smMesg Special
|
||||
hi def link smMesg Special
|
||||
hi def link smPrecedence Number
|
||||
hi def link smRewrite Statement
|
||||
hi def link smRewriteComment Comment
|
||||
@@ -76,7 +75,6 @@ hi def link smRuleset Preproc
|
||||
hi def link smTrusted Special
|
||||
hi def link smVar String
|
||||
|
||||
|
||||
let b:current_syntax = "sm"
|
||||
|
||||
" vim: ts=18
|
||||
|
||||
+14
-18
@@ -1,7 +1,7 @@
|
||||
" Language: tags
|
||||
" Maintainer: Charles E. Campbell <NdrOchip@PcampbellAfamily.Mbiz>
|
||||
" Last Change: Aug 31, 2016
|
||||
" Version: 6
|
||||
" Last Change: Oct 26, 2016
|
||||
" Version: 7
|
||||
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TAGS
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
@@ -9,27 +9,23 @@ if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
syn match tagName "^[^\t]\+" skipwhite nextgroup=tagPath
|
||||
syn match tagPath "[^\t]\+" contained skipwhite nextgroup=tagAddr contains=tagBaseFile
|
||||
syn match tagName "^[^\t]\+" skipwhite nextgroup=tagPath
|
||||
syn match tagPath "[^\t]\+" contained skipwhite nextgroup=tagAddr contains=tagBaseFile
|
||||
syn match tagBaseFile "[a-zA-Z_]\+[\.a-zA-Z_0-9]*\t"me=e-1 contained
|
||||
syn match tagAddr "\d*" contained skipwhite nextgroup=tagComment
|
||||
syn region tagAddr matchgroup=tagDelim start="/" skip="\(\\\\\)*\\/" matchgroup=tagDelim end="$\|/" oneline contained skipwhite nextgroup=tagComment
|
||||
syn match tagComment ";.*$" contained contains=tagField
|
||||
syn match tagAddr "\d*" contained skipwhite nextgroup=tagComment
|
||||
syn region tagAddr matchgroup=tagDelim start="/" skip="\(\\\\\)*\\/" matchgroup=tagDelim end="$\|/" oneline contained skipwhite nextgroup=tagComment
|
||||
syn match tagComment ";.*$" contained contains=tagField
|
||||
syn match tagComment "^!_TAG_.*$"
|
||||
syn match tagField contained "[a-z]*:"
|
||||
syn match tagField contained "[a-z]*:"
|
||||
|
||||
" Define the default highlighting.
|
||||
if !exists("skip_drchip_tags_inits")
|
||||
|
||||
hi def link tagBaseFile PreProc
|
||||
hi def link tagComment Comment
|
||||
hi def link tagDelim Delimiter
|
||||
hi def link tagField Number
|
||||
hi def link tagName Identifier
|
||||
hi def link tagPath PreProc
|
||||
|
||||
hi def link tagBaseFile PreProc
|
||||
hi def link tagComment Comment
|
||||
hi def link tagDelim Delimiter
|
||||
hi def link tagField Number
|
||||
hi def link tagName Identifier
|
||||
hi def link tagPath PreProc
|
||||
endif
|
||||
|
||||
let b:current_syntax = "tags"
|
||||
|
||||
" vim: ts=12
|
||||
|
||||
+44
-38
@@ -1,8 +1,8 @@
|
||||
" Vim syntax file
|
||||
" Language: TeX
|
||||
" Maintainer: Charles E. Campbell <NdrchipO@ScampbellPfamily.AbizM>
|
||||
" Last Change: Aug 31, 2016
|
||||
" Version: 100
|
||||
" Last Change: Sep 20, 2016
|
||||
" Version: 101
|
||||
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TEX
|
||||
"
|
||||
" Notes: {{{1
|
||||
@@ -160,15 +160,17 @@ syn cluster texBoldGroup contains=texAccent,texBadMath,texComment,texDefCmd,tex
|
||||
syn cluster texItalGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texInputFile,texLength,texLigature,texMatcher,texMathZoneV,texMathZoneW,texMathZoneX,texMathZoneY,texMathZoneZ,texNewCmd,texNewEnv,texOnlyMath,texOption,texParen,texRefZone,texSection,texBeginEnd,texSectionZone,texSpaceCode,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,@texMathZones,texTitle,texAbstract,texItalStyle,texItalBoldStyle,texNoSpell
|
||||
if !s:tex_nospell
|
||||
syn cluster texMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,@Spell
|
||||
syn cluster texMatchNMGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcherNM,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,@Spell
|
||||
syn cluster texStyleGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,texStyleStatement,@Spell,texStyleMatcher
|
||||
else
|
||||
syn cluster texMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption
|
||||
syn cluster texMatchNMGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcherNM,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption
|
||||
syn cluster texStyleGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,texStyleStatement,texStyleMatcher
|
||||
endif
|
||||
syn cluster texPreambleMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTitle,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,texMathZoneZ
|
||||
syn cluster texPreambleMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcherNM,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTitle,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,texMathZoneZ
|
||||
syn cluster texRefGroup contains=texMatcher,texComment,texDelimiter
|
||||
if !exists("g:tex_no_math")
|
||||
syn cluster texPreambleMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcher,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTitle,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,texMathZoneZ
|
||||
syn cluster texPreambleMatchGroup contains=texAccent,texBadMath,texComment,texDefCmd,texDelimiter,texDocType,texInput,texLength,texLigature,texMatcherNM,texNewCmd,texNewEnv,texOnlyMath,texParen,texRefZone,texSection,texSpecialChar,texStatement,texString,texTitle,texTypeSize,texTypeStyle,texZone,texInputFile,texOption,texMathZoneZ
|
||||
syn cluster texMathZones contains=texMathZoneV,texMathZoneW,texMathZoneX,texMathZoneY,texMathZoneZ
|
||||
syn cluster texMatchGroup add=@texMathZones
|
||||
syn cluster texMathDelimGroup contains=texMathDelimBad,texMathDelimKey,texMathDelimSet1,texMathDelimSet2
|
||||
@@ -199,9 +201,13 @@ if s:tex_fast =~# 'm'
|
||||
if !s:tex_no_error
|
||||
syn region texMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" transparent contains=@texMatchGroup,texError
|
||||
syn region texMatcher matchgroup=Delimiter start="\[" end="]" transparent contains=@texMatchGroup,texError,@NoSpell
|
||||
syn region texMatcherNM matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" transparent contains=@texMatchNMGroup,texError
|
||||
syn region texMatcherNM matchgroup=Delimiter start="\[" end="]" transparent contains=@texMatchNMGroup,texError,@NoSpell
|
||||
else
|
||||
syn region texMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" transparent contains=@texMatchGroup
|
||||
syn region texMatcher matchgroup=Delimiter start="\[" end="]" transparent contains=@texMatchGroup
|
||||
syn region texMatcherNM matchgroup=Delimiter start="{" skip="\\\\\|\\[{}]" end="}" transparent contains=@texMatchNMGroup
|
||||
syn region texMatcherNM matchgroup=Delimiter start="\[" end="]" transparent contains=@texMatchNMGroup
|
||||
endif
|
||||
if !s:tex_nospell
|
||||
syn region texParen start="(" end=")" transparent contains=@texMatchGroup,@Spell
|
||||
@@ -399,7 +405,7 @@ if !exists("g:tex_no_math")
|
||||
" TexNewMathZone: function creates a mathzone with the given suffix and mathzone name. {{{2
|
||||
" Starred forms are created if starform is true. Starred
|
||||
" forms have syntax group and synchronization groups with a
|
||||
" "S" appended. Handles: cluster, syntax, sync, and hi link.
|
||||
" "S" appended. Handles: cluster, syntax, sync, and highlighting.
|
||||
fun! TexNewMathZone(sfx,mathzone,starform)
|
||||
let grpname = "texMathZone".a:sfx
|
||||
let syncname = "texSyncMathZone".a:sfx
|
||||
@@ -1262,13 +1268,13 @@ if !exists("skip_tex_syntax_inits")
|
||||
if !exists("g:tex_no_error")
|
||||
if !exists("g:tex_no_math")
|
||||
hi def link texBadMath texError
|
||||
hi def link texMathDelimBad texError
|
||||
hi def link texMathDelimBad texError
|
||||
hi def link texMathError texError
|
||||
if !b:tex_stylish
|
||||
hi def link texOnlyMath texError
|
||||
hi def link texOnlyMath texError
|
||||
endif
|
||||
endif
|
||||
hi def link texError Error
|
||||
hi def link texError Error
|
||||
endif
|
||||
|
||||
hi texBoldStyle gui=bold cterm=bold
|
||||
@@ -1277,59 +1283,59 @@ if !exists("skip_tex_syntax_inits")
|
||||
hi texItalBoldStyle gui=bold,italic cterm=bold,italic
|
||||
hi def link texCite texRefZone
|
||||
hi def link texDefCmd texDef
|
||||
hi def link texDefName texDef
|
||||
hi def link texDocType texCmdName
|
||||
hi def link texDocTypeArgs texCmdArgs
|
||||
hi def link texDefName texDef
|
||||
hi def link texDocType texCmdName
|
||||
hi def link texDocTypeArgs texCmdArgs
|
||||
hi def link texInputFileOpt texCmdArgs
|
||||
hi def link texInputCurlies texDelimiter
|
||||
hi def link texLigature texSpecialChar
|
||||
hi def link texLigature texSpecialChar
|
||||
if !exists("g:tex_no_math")
|
||||
hi def link texMathDelimSet1 texMathDelim
|
||||
hi def link texMathDelimSet2 texMathDelim
|
||||
hi def link texMathDelimKey texMathDelim
|
||||
hi def link texMathMatcher texMath
|
||||
hi def link texAccent texStatement
|
||||
hi def link texAccent texStatement
|
||||
hi def link texGreek texStatement
|
||||
hi def link texSuperscript texStatement
|
||||
hi def link texSubscript texStatement
|
||||
hi def link texSubscript texStatement
|
||||
hi def link texSuperscripts texSuperscript
|
||||
hi def link texSubscripts texSubscript
|
||||
hi def link texMathSymbol texStatement
|
||||
hi def link texMathZoneV texMath
|
||||
hi def link texMathZoneW texMath
|
||||
hi def link texMathZoneX texMath
|
||||
hi def link texMathZoneY texMath
|
||||
hi def link texMathZoneV texMath
|
||||
hi def link texMathZoneZ texMath
|
||||
hi def link texMathSymbol texStatement
|
||||
hi def link texMathZoneV texMath
|
||||
hi def link texMathZoneW texMath
|
||||
hi def link texMathZoneX texMath
|
||||
hi def link texMathZoneY texMath
|
||||
hi def link texMathZoneV texMath
|
||||
hi def link texMathZoneZ texMath
|
||||
endif
|
||||
hi def link texBeginEnd texCmdName
|
||||
hi def link texBeginEnd texCmdName
|
||||
hi def link texBeginEndName texSection
|
||||
hi def link texSpaceCode texStatement
|
||||
hi def link texSpaceCode texStatement
|
||||
hi def link texStyleStatement texStatement
|
||||
hi def link texTypeSize texType
|
||||
hi def link texTypeStyle texType
|
||||
hi def link texTypeSize texType
|
||||
hi def link texTypeStyle texType
|
||||
|
||||
" Basic TeX highlighting groups
|
||||
hi def link texCmdArgs Number
|
||||
hi def link texCmdName Statement
|
||||
hi def link texComment Comment
|
||||
hi def link texDef Statement
|
||||
hi def link texDefParm Special
|
||||
hi def link texDelimiter Delimiter
|
||||
hi def link texCmdArgs Number
|
||||
hi def link texCmdName Statement
|
||||
hi def link texComment Comment
|
||||
hi def link texDef Statement
|
||||
hi def link texDefParm Special
|
||||
hi def link texDelimiter Delimiter
|
||||
hi def link texInput Special
|
||||
hi def link texInputFile Special
|
||||
hi def link texInputFile Special
|
||||
hi def link texLength Number
|
||||
hi def link texMath Special
|
||||
hi def link texMathDelim Statement
|
||||
hi def link texMathOper Operator
|
||||
hi def link texMathDelim Statement
|
||||
hi def link texMathOper Operator
|
||||
hi def link texNewCmd Statement
|
||||
hi def link texNewEnv Statement
|
||||
hi def link texOption Number
|
||||
hi def link texRefZone Special
|
||||
hi def link texSection PreCondit
|
||||
hi def link texRefZone Special
|
||||
hi def link texSection PreCondit
|
||||
hi def link texSpaceCodeChar Special
|
||||
hi def link texSpecialChar SpecialChar
|
||||
hi def link texStatement Statement
|
||||
hi def link texSpecialChar SpecialChar
|
||||
hi def link texStatement Statement
|
||||
hi def link texString String
|
||||
hi def link texTodo Todo
|
||||
hi def link texType Type
|
||||
|
||||
+21
-20
@@ -1,8 +1,9 @@
|
||||
" Vim syntax file
|
||||
" Language: Vim 7.4 script
|
||||
" Language: Vim 8.0 script
|
||||
" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
|
||||
" Last Change: September 06, 2016
|
||||
" Version: 7.4-54
|
||||
" Last Change: September 29, 2016
|
||||
" Version: 8.0-01
|
||||
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM
|
||||
" Automatically generated keyword lists: {{{1
|
||||
|
||||
" Quit when a syntax file was already loaded {{{2
|
||||
@@ -18,12 +19,12 @@ syn keyword vimTodo contained COMBAK FIXME TODO XXX
|
||||
syn cluster vimCommentGroup contains=vimTodo,@Spell
|
||||
|
||||
" regular vim commands {{{2
|
||||
syn keyword vimCommand contained a arga[dd] argu[ment] bad[d] bn[ext] breakd[el] bw[ipeout] cadde[xpr] cc cf[ile] changes cla[st] cnf[ile] comp[iler] cq[uit] cw[indow] delep dell diffg[et] dig[raphs] doau ea el[se] endt[ry] f[ile] fina[lly] foldd[oopen] go[to] ha[rdcopy] hid[e] ij[ump] isp[lit] keepa l[ist] lat lcl[ose] lex[pr] lgetb[uffer] lhi[story] lmapc[lear] loadk lop[en] lt[ag] lvimgrepa[dd] marks mk[exrc] mod[e] nbc[lose] noautocmd nu[mber] opt[ions] pc[lose] popu[p] prof[ile] ptN[ext] ptn[ext] pw[d] pyf[ile] r[ead] redraws[tatus] rew[ind] rubyd[o] sIc sIp san[dbox] sbf[irst] sbr[ewind] sci scs setl[ocal] sgc sgp sie sin sm[agic] sn[ext] sor[t] spellr[epall] srI srl star[tinsert] sts[elect] sv[iew] syncbind tab tabf[ind] tabnew tags tf[irst] tn[ext] ts[elect] undol[ist] up[date] vi[sual] vmapc[lear] wa[ll] winp[os] ws[verb] xmapc[lear] xprop
|
||||
syn keyword vimCommand contained ab argd[elete] as[cii] bd[elete] bo[tright] breakl[ist] cN[ext] caddf[ile] ccl[ose] cfdo chd[ir] cle[arjumps] co[py] con[tinue] cr[ewind] d[elete] deletel delm[arks] diffo[ff] dir dp earlier elsei[f] endw[hile] files fini[sh] folddoc[losed] gr[ep] helpc[lose] his[tory] il[ist] iuna[bbrev] keepalt la[st] later lcs lf[ile] lgete[xpr] ll lne[xt] loadkeymap lp[revious] lua lw[indow] mat[ch] mks[ession] mz[scheme] nbs[tart] noh[lsearch] o[pen] ownsyntax pe[rl] pp[op] profd[el] pta[g] ptp[revious] py3 python3 rec[over] reg[isters] ri[ght] rubyf[ile] sIe sIr sav[eas] sbl[ast] sc scl scscope sf[ind] sge sgr sig sip sm[ap] sno[magic] sp[lit] spellu[ndo] src srn startg[replace] sun[hide] sw[apname] syntime tabN[ext] tabfir[st] tabo[nly] tc[l] th[row] to[pleft] tu[nmenu] unh[ide] v vie[w] vne[w] wh[ile] wn[ext] wundo xme xunme
|
||||
syn keyword vimCommand contained abc[lear] argdo au bel[owright] bp[revious] bro[wse] cNf[ile] cal[l] cd cfir[st] che[ckpath] clo[se] col[der] conf[irm] cs debug deletep delp diffp[atch] dj[ump] dr[op] ec em[enu] ene[w] filet fir[st] foldo[pen] grepa[dd] helpf[ind] i imapc[lear] j[oin] keepj[umps] lad[dexpr] lb[uffer] lcscope lfdo lgr[ep] lla[st] lnew[er] loc[kmarks] lpf[ile] luado m[ove] menut[ranslate] mksp[ell] mzf[ile] new nor ol[dfiles] p[rint] ped[it] pre[serve] promptf[ind] ptf[irst] ptr[ewind] py3do q[uit] red[o] res[ize] rightb[elow] rundo sIg sN[ext] sbN[ext] sbm[odified] scI scp se[t] sfir[st] sgi sh[ell] sign sir sme snoreme spe[llgood] spellw[rong] sre[wind] srp startr[eplace] sunme sy t tabc[lose] tabl[ast] tabp[revious] tcld[o] tj[ump] tp[revious] u[ndo] unl ve[rsion] vim[grep] vs[plit] win[size] wp[revious] wv[iminfo] xmenu xunmenu
|
||||
syn keyword vimCommand contained abo[veleft] arge[dit] bN[ext] bf[irst] br[ewind] bufdo c[hange] cat[ch] cdo cg[etfile] checkt[ime] cmapc[lear] colo[rscheme] cope[n] cscope debugg[reedy] deletl dep diffpu[t] dl ds[earch] echoe[rr] en[dif] ex filetype fix[del] for gui helpg[rep] ia in ju[mps] keepp[atterns] laddb[uffer] lbo[ttom] ld[o] lfir[st] lgrepa[dd] lli[st] lnf[ile] lockv[ar] lr[ewind] luafile ma[rk] mes mkv[imrc] n[ext] nmapc[lear] nore omapc[lear] pa[ckadd] perld[o] prev[ious] promptr[epl] ptj[ump] pts[elect] py[thon] qa[ll] redi[r] ret[ab] ru[ntime] rv[iminfo] sIl sa[rgument] sb[uffer] sbn[ext] sce scr[iptnames] setf[iletype] sg sgl si sil[ent] sl[eep] smenu snoremenu spelld[ump] spr[evious] srg st[op] stj[ump] sunmenu syn tN[ext] tabd[o] tabm[ove] tabr[ewind] tclf[ile] tl[ast] tr[ewind] una[bbreviate] unlo[ckvar] verb[ose] vimgrepa[dd] wN[ext] winc[md] wq x[it] xnoreme xwininfo
|
||||
syn keyword vimCommand contained al[l] argg[lobal] b[uffer] bl[ast] brea[k] buffers cabc[lear] cb[uffer] ce[nter] cgetb[uffer] chi[story] cn[ext] com cp[revious] cstag delc[ommand] deletp di[splay] diffs[plit] dli[st] dsp[lit] echom[sg] endf[unction] exi[t] filt[er] fo[ld] fu[nction] gvim helpt[ags] iabc[lear] intro k lN[ext] laddf[ile] lc[d] le[ft] lg[etfile] lh[elpgrep] lmak[e] lo[adview] lol[der] ls lv[imgrep] mak[e] messages mkvie[w] nb[key] noa nos[wapfile] on[ly] packl[oadall] po[p] pro ps[earch] ptl[ast] pu[t] pydo quita[ll] redr[aw] retu[rn] rub[y] sI sIn sal[l] sba[ll] sbp[revious] scg scripte[ncoding] setg[lobal] sgI sgn sic sim[alt] sla[st] smile so[urce] spelli[nfo] sr sri sta[g] stopi[nsert] sus[pend] sync ta[g] tabe[dit] tabn[ext] tabs te[aroff] tm[enu] try undoj[oin] uns[ilent] vert[ical] viu[sage] w[rite] windo wqa[ll] xa[ll] xnoremenu y[ank]
|
||||
syn keyword vimCommand contained ar[gs] argl[ocal] ba[ll] bm[odified] breaka[dd] bun[load] cad[dbuffer] cbo[ttom] cex[pr] cgete[xpr] cl[ist] cnew[er] comc[lear] cpf[ile] cuna[bbrev] delel delf[unction] dif[fupdate] difft[his] do e[dit] echon endfo[r] exu[sage] fin[d] foldc[lose] g h[elp] hi if is[earch] kee[pmarks] lNf[ile] lan[guage] lch[dir] lefta[bove]
|
||||
syn keyword vimCommand contained a argd[elete] as[cii] bd[elete] bo[tright] breakl[ist] cN[ext] caddf[ile] ccl[ose] cfdo chd[ir] cle[arjumps] co[py] con[tinue] cr[ewind] d[elete] deletel delm[arks] diffo[ff] dir dp earlier em[enu] ene[w] filet fir[st] foldo[pen] grepa[dd] helpf[ind] i in ju[mps] keepp[atterns] lad[dexpr] later lcl[ose] lefta[bove] lg[etfile] lh[elpgrep] lmak[e] lo[adview] lol[der] ls lv[imgrep] mak[e] messages mkvie[w] nb[key] noa nos[wapfile] on[ly] packl[oadall] po[p] pro ps[earch] ptl[ast] pu[t] pydo quita[ll] redr[aw] retu[rn] rub[y] sI sIn sal[l] sba[ll] sbp[revious] scg scripte[ncoding] setg[lobal] sgI sgn sic sim[alt] sla[st] smile so[urce] spelli[nfo] sr sri sta[g] stopi[nsert] sus[pend] sync ta[g] tabe[dit] tabn[ext] tabs te[aroff] tm[enu] try undoj[oin] up[date] vi[sual] vmapc[lear] wa[ll] winp[os] ws[verb] xmapc[lear] xprop
|
||||
syn keyword vimCommand contained abc[lear] argdo au bel[owright] bp[revious] bro[wse] cNf[ile] cal[l] cd cfir[st] che[ckpath] clo[se] col[der] conf[irm] cs debug deletep delp diffp[atch] dj[ump] dr[op] echoe[rr] en[dif] ex filetype fix[del] for gui helpg[rep] iabc[lear] intro k lN[ext] laddb[uffer] lb[uffer] lcs lex[pr] lgetb[uffer] lhi[story] lmapc[lear] loadk lop[en] lt[ag] lvimgrepa[dd] marks mk[exrc] mod[e] nbc[lose] noautocmd nu[mber] opt[ions] pc[lose] popu[p] prof[ile] ptN[ext] ptn[ext] pw[d] pyf[ile] r[ead] redraws[tatus] rew[ind] rubyd[o] sIc sIp san[dbox] sbf[irst] sbr[ewind] sci scs setl[ocal] sgc sgp sie sin sm[agic] sn[ext] sor[t] spellr[epall] srI srl star[tinsert] sts[elect] sv[iew] syncbind tab tabf[ind] tabnew tags tf[irst] tn[ext] ts[elect] undol[ist] v vie[w] vne[w] wh[ile] wn[ext] wundo xme xunme
|
||||
syn keyword vimCommand contained abo[veleft] arge[dit] bN[ext] bf[irst] br[ewind] bufdo c[hange] cat[ch] cdo cg[etfile] checkt[ime] cmapc[lear] colo[rscheme] cope[n] cscope debugg[reedy] deletl dep diffpu[t] dl ds[earch] echom[sg] endf[unction] exi[t] filt[er] fo[ld] fu[nction] gvim helpt[ags] if is[earch] kee[pmarks] lNf[ile] laddf[ile] lbo[ttom] lcscope lf[ile] lgete[xpr] ll lne[xt] loadkeymap lp[revious] lua lw[indow] mat[ch] mks[ession] mz[scheme] nbs[tart] noh[lsearch] o[pen] ownsyntax pe[rl] pp[op] profd[el] pta[g] ptp[revious] py3 python3 rec[over] reg[isters] ri[ght] rubyf[ile] sIe sIr sav[eas] sbl[ast] sc scl scscope sf[ind] sge sgr sig sip sm[ap] sno[magic] sp[lit] spellu[ndo] src srn startg[replace] sun[hide] sw[apname] syntime tabN[ext] tabfir[st] tabo[nly] tc[l] th[row] to[pleft] tu[nmenu] unh[ide] ve[rsion] vim[grep] vs[plit] win[size] wp[revious] wv[iminfo] xmenu xunmenu
|
||||
syn keyword vimCommand contained al[l] argg[lobal] b[uffer] bl[ast] brea[k] buffers cabc[lear] cb[uffer] ce[nter] cgetb[uffer] chi[story] cn[ext] com cp[revious] cstag delc[ommand] deletp di[splay] diffs[plit] dli[st] dsp[lit] echon endfo[r] exu[sage] fin[d] foldc[lose] g h[elp] hi ij[ump] isp[lit] keepa l[ist] lan[guage] lc[d] ld[o] lfdo lgr[ep] lla[st] lnew[er] loc[kmarks] lpf[ile] luado m[ove] menut[ranslate] mksp[ell] mzf[ile] new nor ol[dfiles] p[rint] ped[it] pre[serve] promptf[ind] ptf[irst] ptr[ewind] py3do q[uit] red[o] res[ize] rightb[elow] rundo sIg sN[ext] sbN[ext] sbm[odified] scI scp se[t] sfir[st] sgi sh[ell] sign sir sme snoreme spe[llgood] spellw[rong] sre[wind] srp startr[eplace] sunme sy t tabc[lose] tabl[ast] tabp[revious] tcld[o] tj[ump] tp[revious] u[ndo] unlo[ckvar] verb[ose] vimgrepa[dd] wN[ext] winc[md] wq x[it] xnoreme xwininfo
|
||||
syn keyword vimCommand contained ar[gs] argl[ocal] ba[ll] bm[odified] breaka[dd] bun[load] cad[dbuffer] cbo[ttom] cex[pr] cgete[xpr] cl[ist] cnew[er] comc[lear] cpf[ile] cuna[bbrev] delel delf[unction] dif[fupdate] difft[his] do e[dit] el[se] endt[ry] f[ile] fina[lly] foldd[oopen] go[to] ha[rdcopy] hid[e] il[ist] iuna[bbrev] keepalt la[st] lat lch[dir] le[ft] lfir[st] lgrepa[dd] lli[st] lnf[ile] lockv[ar] lr[ewind] luafile ma[rk] mes mkv[imrc] n[ext] nmapc[lear] nore omapc[lear] pa[ckadd] perld[o] prev[ious] promptr[epl] ptj[ump] pts[elect] py[thon] qa[ll] redi[r] ret[ab] ru[ntime] rv[iminfo] sIl sa[rgument] sb[uffer] sbn[ext] sce scr[iptnames] setf[iletype] sg sgl si sil[ent] sl[eep] smenu snoremenu spelld[ump] spr[evious] srg st[op] stj[ump] sunmenu syn tN[ext] tabd[o] tabm[ove] tabr[ewind] tclf[ile] tl[ast] tr[ewind] una[bbreviate] uns[ilent] vert[ical] viu[sage] w[rite] windo wqa[ll] xa[ll] xnoremenu y[ank]
|
||||
syn keyword vimCommand contained arga[dd] argu[ment] bad[d] bn[ext] breakd[el] bw[ipeout] cadde[xpr] cc cf[ile] changes cla[st] cnf[ile] comp[iler] cq[uit] cw[indow] delep dell diffg[et] dig[raphs] doau ea elsei[f] endw[hile] files fini[sh] folddoc[losed] gr[ep] helpc[lose] his[tory] imapc[lear] j[oin] keepj[umps]
|
||||
syn match vimCommand contained "\<z[-+^.=]\=\>"
|
||||
syn keyword vimStdPlugin contained DiffOrig Man N[ext] P[rint] S TOhtml XMLent XMLns
|
||||
|
||||
@@ -48,15 +49,15 @@ syn keyword vimOption contained invai invaltkeymap invar invarabicshape invautoc
|
||||
syn keyword vimOption contained invakm invanti invarab invari invautoindent invautowriteall invbackup invbin invbl invbri invci invcompatible invcp invcscopetag invcst invcul invcursorline invdg invea invedcompatible invemoji invequalalways invet invexrc invfileignorecase invfk invfs invgdefault invhidden invhkmapp invhlsearch invignorecase invimcmdline invincsearch invinsertmode invjs
|
||||
|
||||
" termcap codes (which can also be set) {{{2
|
||||
syn keyword vimOption contained t_8b t_AB t_al t_bc t_ce t_cl t_Co t_Cs t_CV t_db t_DL t_F1 t_F2 t_F3 t_F4 t_F5 t_F6 t_F7 t_F8 t_F9 t_fs t_IE t_IS t_k1 t_K1 t_k2 t_k3 t_K3 t_k4 t_K4 t_k5 t_K5 t_k6 t_K6 t_k7 t_K7 t_k8 t_K8 t_k9 t_K9 t_KA t_kb t_kB t_KB t_KC t_kd t_kD t_KD t_ke t_KE t_KF t_KG t_kh t_KH t_kI t_KI t_KJ t_KK t_kl t_KL t_kN t_kP t_kr t_ks t_ku t_le t_mb t_md t_me t_mr t_ms t_nd t_op t_RB t_RI t_RV t_Sb t_se t_Sf t_SI t_so t_sr t_SR t_te t_ti t_ts t_u7 t_ue t_us t_ut t_vb t_ve t_vi t_vs t_WP t_WS t_xn t_xs t_ZH t_ZR
|
||||
syn keyword vimOption contained t_8f t_AF t_AL t_cd t_Ce t_cm t_cs t_CS t_da t_dl t_EI
|
||||
syn match vimOption contained "t_%1"
|
||||
syn keyword vimOption contained t_8b t_AB t_AL t_CV t_Co t_DL t_F1 t_F3 t_F5 t_F7 t_F9 t_IS t_K1 t_K3 t_K4 t_K5 t_K6 t_K7 t_K8 t_K9 t_KA t_KB t_KC t_KD t_KE t_KF t_KG t_KH t_KI t_KJ t_KK t_KL t_RB t_RI t_RV t_SI t_SR t_Sb t_Sf t_WP t_WS t_ZH t_ZR t_al t_bc t_cd t_ce t_cl t_cm t_cs t_da t_db t_dl t_fs t_k1 t_k2 t_k3 t_k4 t_k5 t_k6 t_k7 t_k8 t_k9 t_kB t_kD t_kI t_kN t_kP t_kb t_kd t_ke t_kh t_kl t_kr t_ks t_ku t_le t_mb t_md t_me t_mr t_ms t_nd t_op t_se t_so t_sr t_te t_ti t_ts t_u7 t_ue t_us t_ut t_vb t_ve t_vi t_vs t_xn t_xs
|
||||
syn keyword vimOption contained t_8f t_AF t_CS t_Ce t_Cs t_EI t_F2 t_F4 t_F6 t_F8 t_IE
|
||||
syn match vimOption contained "t_#2"
|
||||
syn match vimOption contained "t_#4"
|
||||
syn match vimOption contained "t_@7"
|
||||
syn match vimOption contained "t_*7"
|
||||
syn match vimOption contained "t_&8"
|
||||
syn match vimOption contained "t_%1"
|
||||
syn match vimOption contained "t_%i"
|
||||
syn match vimOption contained "t_&8"
|
||||
syn match vimOption contained "t_*7"
|
||||
syn match vimOption contained "t_@7"
|
||||
syn match vimOption contained "t_k;"
|
||||
|
||||
" unsupported settings: some were supported by vi but don't do anything in vim {{{2
|
||||
@@ -76,10 +77,10 @@ syn match vimHLGroup contained "Conceal"
|
||||
syn case match
|
||||
|
||||
" Function Names {{{2
|
||||
syn keyword vimFuncName contained abs append argv assert_fails assert_notequal atan2 buflisted bufwinid byteidxcomp char2nr ch_evalraw ch_log ch_readraw ch_status complete copy cscope_connection did_filetype escape execute expand filewritable float2nr fnamemodify foldtext function getbufline getcharsearch getcmdwintype getfontname getftype getpid getregtype getwininfo glob has_key histdel hlID index inputrestore invert items job_start js_decode json_encode libcall line2byte log map match matcharg matchlist max mode nr2char perleval printf pyeval reltime remote_expr remote_read rename reverse screenchar search searchpairpos serverlist setcmdpos setloclist setqflist settabwinvar shellescape sin soundfold split str2nr strdisplaywidth stridx strpart strwidth synconcealed synIDtrans systemlist tabpagewinnr tan test_alloc_fail test_garbagecollect_now test_null_job test_null_string timer_pause timer_stopall tr undofile values wildmenumode win_findbuf winheight winline winrestview wordcount
|
||||
syn keyword vimFuncName contained acos argc asin assert_false assert_notmatch browse bufloaded bufwinnr call ch_close ch_getbufnr ch_logfile ch_sendexpr cindent complete_add cos cursor diff_filler eval exepath extend filter floor foldclosed foldtextresult garbagecollect getbufvar getcmdline getcompletion getfperm getline getpos gettabinfo getwinposx glob2regpat haslocaldir histget hostname input inputsave isdirectory job_getchannel job_status js_encode keys libcallnr lispindent log10 maparg matchadd matchdelete matchstr min mzeval or pow pumvisible range reltimefloat remote_foreground remote_send repeat round screencol searchdecl searchpos setbufvar setfperm setmatches setreg setwinvar shiftwidth sinh spellbadword sqrt strcharpart strftime string strridx submatch synID synstack tabpagebuflist tagfiles tanh test_autochdir test_null_channel test_null_list test_settime timer_start tolower trunc undotree virtcol winbufnr win_getid win_id2tabwin winnr winsaveview writefile
|
||||
syn keyword vimFuncName contained add argidx assert_equal assert_inrange assert_true browsedir bufname byte2line ceil ch_close_in ch_getjob ch_open ch_sendraw clearmatches complete_check cosh deepcopy diff_hlID eventhandler exists feedkeys finddir fmod foldclosedend foreground get getchar getcmdpos getcurpos getfsize getloclist getqflist gettabvar getwinposy globpath hasmapto histnr iconv inputdialog inputsecret islocked job_info job_stop json_decode len line localtime luaeval mapcheck matchaddpos matchend matchstrpos mkdir nextnonblank pathshorten prevnonblank py3eval readfile reltimestr remote_peek remove resolve screenattr screenrow searchpair server2client setcharsearch setline setpos settabvar sha256 simplify sort spellsuggest str2float strchars strgetchar strlen strtrans substitute synIDattr system tabpagenr taglist tempname test_disable_char_avail test_null_dict test_null_partial timer_info timer_stop toupper type uniq visualmode wincol win_gotoid win_id2win winrestcmd winwidth xor
|
||||
syn keyword vimFuncName contained and arglistid assert_exception assert_match atan bufexists bufnr byteidx changenr ch_evalexpr ch_info ch_read ch_setoptions col confirm count delete empty executable exp filereadable findfile fnameescape foldlevel funcref getbufinfo getcharmod getcmdtype getcwd getftime getmatches getreg gettabwinvar getwinvar has histadd hlexists indent inputlist insert isnan job_setoptions join
|
||||
syn keyword vimFuncName contained abs append argv assert_fails assert_notequal atan2 buflisted bufwinid byteidxcomp ch_close_in ch_getjob ch_open ch_sendraw char2nr complete copy cscope_connection did_filetype escape execute expand filewritable float2nr fnamemodify foldtext function getbufline getcharsearch getcmdwintype getfontname getftype getpid getregtype getwininfo glob has_key histdel hlexists index inputrestore invert items job_start js_decode json_encode libcall line2byte log map match matcharg matchlist max mode nr2char perleval printf pyeval reltime remote_expr remote_read rename reverse screenchar search searchpairpos serverlist setcmdpos setloclist setqflist settabwinvar shellescape sin soundfold split str2nr strdisplaywidth stridx strpart strwidth synID synconcealed systemlist tabpagewinnr tan test_alloc_fail test_garbagecollect_now test_null_job test_null_string timer_pause timer_stopall tr undofile values wildmenumode win_gotoid winbufnr winline winrestview wordcount
|
||||
syn keyword vimFuncName contained acos argc asin assert_false assert_notmatch browse bufloaded bufwinnr call ch_evalexpr ch_info ch_read ch_setoptions cindent complete_add cos cursor diff_filler eval exepath extend filter floor foldclosed foldtextresult garbagecollect getbufvar getcmdline getcompletion getfperm getline getpos gettabinfo getwinposx glob2regpat haslocaldir histget hostname input inputsave isdirectory job_getchannel job_status js_encode keys libcallnr lispindent log10 maparg matchadd matchdelete matchstr min mzeval or pow pumvisible range reltimefloat remote_foreground remote_send repeat round screencol searchdecl searchpos setbufvar setfperm setmatches setreg setwinvar shiftwidth sinh spellbadword sqrt strcharpart strftime string strridx submatch synIDattr synstack tabpagebuflist tagfiles tanh test_autochdir test_null_channel test_null_list test_settime timer_start tolower trunc undotree virtcol win_findbuf win_id2tabwin wincol winnr winsaveview writefile
|
||||
syn keyword vimFuncName contained add argidx assert_equal assert_inrange assert_true browsedir bufname byte2line ceil ch_evalraw ch_log ch_readraw ch_status clearmatches complete_check cosh deepcopy diff_hlID eventhandler exists feedkeys finddir fmod foldclosedend foreground get getchar getcmdpos getcurpos getfsize getloclist getqflist gettabvar getwinposy globpath hasmapto histnr iconv inputdialog inputsecret islocked job_info job_stop json_decode len line localtime luaeval mapcheck matchaddpos matchend matchstrpos mkdir nextnonblank pathshorten prevnonblank py3eval readfile reltimestr remote_peek remove resolve screenattr screenrow searchpair server2client setcharsearch setline setpos settabvar sha256 simplify sort spellsuggest str2float strchars strgetchar strlen strtrans substitute synIDtrans system tabpagenr taglist tempname test_disable_char_avail test_null_dict test_null_partial timer_info timer_stop toupper type uniq visualmode win_getid win_id2win winheight winrestcmd winwidth xor
|
||||
syn keyword vimFuncName contained and arglistid assert_exception assert_match atan bufexists bufnr byteidx ch_close ch_getbufnr ch_logfile ch_sendexpr changenr col confirm count delete empty executable exp filereadable findfile fnameescape foldlevel funcref getbufinfo getcharmod getcmdtype getcwd getftime getmatches getreg gettabwinvar getwinvar has histadd hlID indent inputlist insert isnan job_setoptions join
|
||||
|
||||
"--- syntax here and above generated by mkvimvim ---
|
||||
" Special Vim Highlighting (not automatic) {{{1
|
||||
@@ -498,7 +499,7 @@ syn cluster vimFuncBodyList add=vimSynType
|
||||
syn cluster vimSynMtchGroup contains=vimMtchComment,vimSynContains,vimSynError,vimSynMtchOpt,vimSynNextgroup,vimSynRegPat,vimNotation
|
||||
syn keyword vimSynType contained match skipwhite nextgroup=vimSynMatchRegion
|
||||
syn region vimSynMatchRegion contained keepend matchgroup=vimGroupName start="\h\w*" matchgroup=vimSep end="|\|$" contains=@vimSynMtchGroup
|
||||
syn match vimSynMtchOpt contained "\<\(conceal\|transparent\|contained\|excludenl\|skipempty\|skipwhite\|display\|extend\|skipnl\|fold\)\>"
|
||||
syn match vimSynMtchOpt contained "\<\(conceal\|transparent\|contained\|excludenl\|keepend\|skipempty\|skipwhite\|display\|extend\|skipnl\|fold\)\>"
|
||||
if has("conceal")
|
||||
syn match vimSynMtchOpt contained "\<cchar=" nextgroup=vimSynMtchCchar
|
||||
syn match vimSynMtchCchar contained "\S"
|
||||
|
||||
@@ -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>111</string>
|
||||
<string>114</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]) {
|
||||
|
||||
+24
-5
@@ -30,13 +30,15 @@
|
||||
# define MAC_OS_X_VERSION_10_12 101200
|
||||
#endif
|
||||
|
||||
// Needed for pre-10.11 SDK
|
||||
#ifndef NSAppKitVersionNumber10_10
|
||||
# define NSAppKitVersionNumber10_10 1343
|
||||
#endif
|
||||
#ifndef NSAppKitVersionNumber10_10_Max
|
||||
# define NSAppKitVersionNumber10_10_Max 1349
|
||||
#endif
|
||||
#ifndef NSAppKitVersionNumber10_12
|
||||
# define NSAppKitVersionNumber10_12 1504
|
||||
#endif
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12
|
||||
// Deprecated constants in 10.12 SDK
|
||||
@@ -70,8 +72,8 @@
|
||||
# define NSWindowStyleMaskUnifiedTitleAndToolbar NSUnifiedTitleAndToolbarWindowMask
|
||||
#endif
|
||||
|
||||
#import <asl.h>
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12
|
||||
# import <asl.h>
|
||||
# define MM_USE_ASL
|
||||
#else
|
||||
# import <os/log.h>
|
||||
@@ -425,9 +427,26 @@ void ASLInit();
|
||||
# define MM_ASL_LEVEL_DEFAULT OS_LOG_TYPE_DEFAULT
|
||||
# define ASLog(level, fmt, ...) \
|
||||
if (level <= ASLogLevel) { \
|
||||
os_log_with_type(OS_LOG_DEFAULT, level, "%s@%d: %s", \
|
||||
__PRETTY_FUNCTION__, __LINE__, \
|
||||
[[NSString stringWithFormat:fmt, ##__VA_ARGS__] UTF8String]); \
|
||||
if (floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_12) { \
|
||||
os_log_with_type(OS_LOG_DEFAULT, level, "%s@%d: %s", \
|
||||
__PRETTY_FUNCTION__, __LINE__, \
|
||||
[[NSString stringWithFormat:fmt, ##__VA_ARGS__] UTF8String]); \
|
||||
} else { \
|
||||
int logLevel; \
|
||||
switch (level) { \
|
||||
case OS_LOG_TYPE_FAULT: logLevel = ASL_LEVEL_CRIT; break; \
|
||||
case OS_LOG_TYPE_ERROR: logLevel = ASL_LEVEL_ERR; break; \
|
||||
case OS_LOG_TYPE_INFO: logLevel = ASL_LEVEL_INFO; break; \
|
||||
case OS_LOG_TYPE_DEBUG: logLevel = ASL_LEVEL_DEBUG; break; \
|
||||
default: logLevel = ASL_LEVEL_NOTICE; break; \
|
||||
} \
|
||||
_Pragma("clang diagnostic push") \
|
||||
_Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") \
|
||||
asl_log(NULL, NULL, logLevel, "%s@%d: %s", \
|
||||
__PRETTY_FUNCTION__, __LINE__, \
|
||||
[[NSString stringWithFormat:fmt, ##__VA_ARGS__] UTF8String]); \
|
||||
_Pragma("clang diagnostic pop") \
|
||||
} \
|
||||
}
|
||||
|
||||
# define ASLogCrit(fmt, ...) ASLog(OS_LOG_TYPE_FAULT, fmt, ##__VA_ARGS__)
|
||||
|
||||
@@ -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 = (
|
||||
);
|
||||
|
||||
@@ -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 :
|
||||
|
||||
+65
-51
@@ -4453,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)
|
||||
@@ -4470,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);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -4487,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;
|
||||
@@ -4503,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);
|
||||
}
|
||||
@@ -4528,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. */
|
||||
@@ -4548,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);
|
||||
@@ -4630,8 +4668,8 @@ job_stop_on_exit(void)
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE when there is any job that might exit, which means
|
||||
* job_check_ended() should be called once in a while.
|
||||
* Return TRUE when there is any job that has an exit callback and might exit,
|
||||
* which means job_check_ended() should be called more often.
|
||||
*/
|
||||
int
|
||||
has_pending_job(void)
|
||||
@@ -4639,34 +4677,35 @@ 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))
|
||||
/* Only should check if the channel has been closed, if the channel is
|
||||
* open the job won't exit. */
|
||||
if (job->jv_status == JOB_STARTED && job->jv_exit_cb != NULL
|
||||
&& (job->jv_channel == NULL
|
||||
|| !channel_still_useful(job->jv_channel)))
|
||||
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;
|
||||
@@ -4887,32 +4926,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
@@ -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;
|
||||
|
||||
+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}
|
||||
};
|
||||
|
||||
+197
-120
@@ -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 **);
|
||||
|
||||
@@ -395,139 +404,121 @@ mch_inchar(
|
||||
{
|
||||
int len;
|
||||
int interrupted = FALSE;
|
||||
int did_start_blocking = FALSE;
|
||||
long wait_time;
|
||||
long elapsed_time = 0;
|
||||
#if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
|
||||
struct timeval start_tv;
|
||||
|
||||
gettimeofday(&start_tv, NULL);
|
||||
#endif
|
||||
|
||||
#ifdef MESSAGE_QUEUE
|
||||
parse_queued_messages();
|
||||
#endif
|
||||
|
||||
/* Check if window changed size while we were busy, perhaps the ":set
|
||||
* columns=99" command was used. */
|
||||
while (do_resize)
|
||||
handle_resize();
|
||||
|
||||
/* repeat until we got a character or waited long enough */
|
||||
for (;;)
|
||||
{
|
||||
if (wtime >= 0)
|
||||
wait_time = wtime;
|
||||
else
|
||||
wait_time = p_ut;
|
||||
#if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
|
||||
wait_time -= elapsed(&start_tv);
|
||||
if (wait_time >= 0)
|
||||
{
|
||||
#endif
|
||||
if (WaitForChar(wait_time, &interrupted))
|
||||
break;
|
||||
|
||||
/* no character available */
|
||||
if (do_resize)
|
||||
{
|
||||
handle_resize();
|
||||
continue;
|
||||
}
|
||||
#if defined(FEAT_CLIENTSERVER) && !defined(MAC_CLIENTSERVER)
|
||||
if (server_waiting())
|
||||
{
|
||||
parse_queued_messages();
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
#ifdef MESSAGE_QUEUE
|
||||
if (interrupted)
|
||||
{
|
||||
parse_queued_messages();
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
#if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
|
||||
}
|
||||
#endif
|
||||
if (wtime >= 0)
|
||||
/* no character available within "wtime" */
|
||||
return 0;
|
||||
|
||||
/* wtime == -1: no character available within 'updatetime' */
|
||||
#ifdef FEAT_AUTOCMD
|
||||
if (trigger_cursorhold() && maxlen >= 3
|
||||
&& !typebuf_changed(tb_change_cnt))
|
||||
{
|
||||
buf[0] = K_SPECIAL;
|
||||
buf[1] = KS_EXTRA;
|
||||
buf[2] = (int)KE_CURSORHOLD;
|
||||
return 3;
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* If there is no character available within 'updatetime' seconds
|
||||
* flush all the swap files to disk.
|
||||
* Also done when interrupted by SIGWINCH.
|
||||
*/
|
||||
before_blocking();
|
||||
break;
|
||||
}
|
||||
|
||||
/* repeat until we got a character */
|
||||
for (;;)
|
||||
{
|
||||
long wtime_now = -1L;
|
||||
|
||||
while (do_resize) /* window changed size */
|
||||
/* Check if window changed size while we were busy, perhaps the ":set
|
||||
* columns=99" command was used. */
|
||||
while (do_resize)
|
||||
handle_resize();
|
||||
|
||||
#ifdef MESSAGE_QUEUE
|
||||
parse_queued_messages();
|
||||
|
||||
# ifdef FEAT_JOB_CHANNEL
|
||||
if (has_pending_job())
|
||||
{
|
||||
/* Don't wait longer than a few seconds, checking for a finished
|
||||
* job requires polling. */
|
||||
if (p_ut > 9000L)
|
||||
wtime_now = 1000L;
|
||||
else
|
||||
wtime_now = 10000L - p_ut;
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
if (wtime < 0 && did_start_blocking)
|
||||
/* blocking and already waited for p_ut */
|
||||
wait_time = -1;
|
||||
else
|
||||
{
|
||||
if (wtime >= 0)
|
||||
wait_time = wtime;
|
||||
else
|
||||
/* going to block after p_ut */
|
||||
wait_time = p_ut;
|
||||
#if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)
|
||||
elapsed_time = elapsed(&start_tv);
|
||||
#endif
|
||||
wait_time -= elapsed_time;
|
||||
if (wait_time < 0)
|
||||
{
|
||||
if (wtime >= 0)
|
||||
/* no character available within "wtime" */
|
||||
return 0;
|
||||
|
||||
if (wtime < 0)
|
||||
{
|
||||
/* no character available within 'updatetime' */
|
||||
did_start_blocking = TRUE;
|
||||
#ifdef FEAT_AUTOCMD
|
||||
if (trigger_cursorhold() && maxlen >= 3
|
||||
&& !typebuf_changed(tb_change_cnt))
|
||||
{
|
||||
buf[0] = K_SPECIAL;
|
||||
buf[1] = KS_EXTRA;
|
||||
buf[2] = (int)KE_CURSORHOLD;
|
||||
return 3;
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* If there is no character available within 'updatetime'
|
||||
* seconds flush all the swap files to disk.
|
||||
* Also done when interrupted by SIGWINCH.
|
||||
*/
|
||||
before_blocking();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef FEAT_JOB_CHANNEL
|
||||
/* Checking if a job ended requires polling. Do this every 100 msec. */
|
||||
if (has_pending_job() && (wait_time < 0 || wait_time > 100L))
|
||||
wait_time = 100L;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* We want to be interrupted by the winch signal
|
||||
* or by an event on the monitored file descriptors.
|
||||
*/
|
||||
if (!WaitForChar(wtime_now, &interrupted))
|
||||
if (WaitForChar(wait_time, &interrupted))
|
||||
{
|
||||
if (do_resize) /* interrupted by SIGWINCH signal */
|
||||
continue;
|
||||
#ifdef MESSAGE_QUEUE
|
||||
if (interrupted || wtime_now > 0)
|
||||
{
|
||||
parse_queued_messages();
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
/* If input was put directly in typeahead buffer bail out here. */
|
||||
if (typebuf_changed(tb_change_cnt))
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* For some terminals we only get one character at a time.
|
||||
* We want the get all available characters, so we could keep on
|
||||
* trying until none is available
|
||||
* For some other terminals this is quite slow, that's why we don't
|
||||
* do it.
|
||||
*/
|
||||
len = read_from_input_buf(buf, (long)maxlen);
|
||||
if (len > 0)
|
||||
return len;
|
||||
continue;
|
||||
}
|
||||
|
||||
/* If input was put directly in typeahead buffer bail out here. */
|
||||
if (typebuf_changed(tb_change_cnt))
|
||||
return 0;
|
||||
/* no character available */
|
||||
#if !(defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H))
|
||||
/* estimate the elapsed time */
|
||||
elapsed += wait_time;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* For some terminals we only get one character at a time.
|
||||
* We want the get all available characters, so we could keep on
|
||||
* trying until none is available
|
||||
* For some other terminals this is quite slow, that's why we don't do
|
||||
* it.
|
||||
*/
|
||||
len = read_from_input_buf(buf, (long)maxlen);
|
||||
if (len > 0)
|
||||
return len;
|
||||
if (do_resize /* interrupted by SIGWINCH signal */
|
||||
#if defined(FEAT_CLIENTSERVER) && !defined(MAC_CLIENTSERVER)
|
||||
|| server_waiting()
|
||||
#endif
|
||||
#ifdef MESSAGE_QUEUE
|
||||
|| interrupted
|
||||
#endif
|
||||
|| wait_time > 0
|
||||
|| !did_start_blocking)
|
||||
continue;
|
||||
|
||||
/* no character available or interrupted */
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1468,6 +1459,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 +2281,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 +2345,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 +4319,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 +4357,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 +4501,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 +5117,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 +5189,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 +5204,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 +5285,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 +5347,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 +5355,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
|
||||
@@ -5861,7 +5938,7 @@ select_eintr:
|
||||
if (finished || msec == 0)
|
||||
break;
|
||||
|
||||
# ifdef FEAT_CLIENTSERVER
|
||||
# if defined(FEAT_CLIENTSERVER) && !defined(MAC_CLIENTSERVER)
|
||||
if (server_waiting())
|
||||
break;
|
||||
# endif
|
||||
|
||||
+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 */
|
||||
|
||||
+853
-561
File diff suppressed because it is too large
Load Diff
+3
-1
@@ -582,7 +582,9 @@ pum_set_selected(int n, int repeat)
|
||||
|
||||
if (curwin->w_p_pvw)
|
||||
{
|
||||
if (curbuf->b_fname == NULL
|
||||
if (!resized
|
||||
&& curbuf->b_nwindows == 1
|
||||
&& curbuf->b_fname == NULL
|
||||
&& curbuf->b_p_bt[0] == 'n' && curbuf->b_p_bt[2] == 'f'
|
||||
&& curbuf->b_p_bh[0] == 'w')
|
||||
{
|
||||
|
||||
+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 : */
|
||||
|
||||
@@ -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);
|
||||
|
||||
+1
-1
@@ -2266,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;
|
||||
|
||||
+32
-32
@@ -3981,9 +3981,6 @@ win_line(
|
||||
else if (v == (long)shl->endcol)
|
||||
{
|
||||
shl->attr_cur = 0;
|
||||
#ifdef FEAT_CONCEAL
|
||||
prev_syntax_id = 0;
|
||||
#endif
|
||||
next_search_hl(wp, shl, lnum, (colnr_T)v,
|
||||
shl == &search_hl ? NULL : cur);
|
||||
pos_inprogress = cur == NULL || cur->pos.cur == 0
|
||||
@@ -7786,6 +7783,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 */
|
||||
@@ -7794,53 +7795,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
|
||||
{
|
||||
|
||||
@@ -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 \
|
||||
|
||||
@@ -136,6 +136,34 @@ func WaitFor(expr)
|
||||
return 1000
|
||||
endfunc
|
||||
|
||||
" Wait for up to a given milliseconds.
|
||||
" With the +timers feature this waits for key-input by getchar(), Resume()
|
||||
" feeds key-input and resumes process. Return time waited in milliseconds.
|
||||
" Without +timers it uses simply :sleep.
|
||||
func Standby(msec)
|
||||
if has('timers')
|
||||
let start = reltime()
|
||||
let g:_standby_timer = timer_start(a:msec, function('s:feedkeys'))
|
||||
call getchar()
|
||||
return float2nr(reltimefloat(reltime(start)) * 1000)
|
||||
else
|
||||
execute 'sleep ' a:msec . 'm'
|
||||
return a:msec
|
||||
endif
|
||||
endfunc
|
||||
|
||||
func Resume()
|
||||
if exists('g:_standby_timer')
|
||||
call timer_stop(g:_standby_timer)
|
||||
call s:feedkeys(0)
|
||||
unlet g:_standby_timer
|
||||
endif
|
||||
endfunc
|
||||
|
||||
func s:feedkeys(timer)
|
||||
call feedkeys('x', 'nt')
|
||||
endfunc
|
||||
|
||||
" Run Vim, using the "vimcmd" file and "-u NORC".
|
||||
" "before" is a list of Vim commands to be executed before loading plugins.
|
||||
" "after" is a list of Vim commands to be executed after loading plugins.
|
||||
|
||||
@@ -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
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user