mirror of
https://github.com/zoriya/vim.git
synced 2025-12-29 02:18:22 +00:00
Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
552ac13d55 | ||
|
|
0faaeb826e | ||
|
|
d25ad65a97 | ||
|
|
f5876f147a | ||
|
|
91856270df | ||
|
|
4336cdf318 | ||
|
|
7f29f7a2f4 | ||
|
|
011a34d77d | ||
|
|
52379eadfb | ||
|
|
b549a731fb | ||
|
|
7282bc3e7e | ||
|
|
58437e0409 | ||
|
|
5f1e3e4473 | ||
|
|
db7207e6e5 | ||
|
|
84a4c334e1 | ||
|
|
ee7d100091 | ||
|
|
42ec656524 | ||
|
|
fb7df7be2f | ||
|
|
6b707b4b82 | ||
|
|
f66b3fcf6c | ||
|
|
034b115568 | ||
|
|
5dc6252d33 |
@@ -1,16 +1,31 @@
|
||||
" Vim OMNI completion script for SQL
|
||||
" Language: SQL
|
||||
" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>
|
||||
" Version: 10.0
|
||||
" Last Change: 2010 Jun 11
|
||||
" Version: 12.0
|
||||
" Last Change: 2012 Feb 08
|
||||
" Usage: For detailed help
|
||||
" ":help sql.txt"
|
||||
" or ":help ft-sql-omni"
|
||||
" ":help sql.txt"
|
||||
" or ":help ft-sql-omni"
|
||||
" or read $VIMRUNTIME/doc/sql.txt
|
||||
|
||||
" History
|
||||
" Version 12.0
|
||||
" - Partial column name completion did not work when a table
|
||||
" name or table alias was provided (Jonas Enberg).
|
||||
" - Improved the handling of column completion. First we match any
|
||||
" columns from a previous completion. If not matches are found, we
|
||||
" consider the partial name to be a table or table alias for the
|
||||
" query and attempt to match on it.
|
||||
"
|
||||
" Version 11.0
|
||||
" Added g:omni_sql_default_compl_type variable
|
||||
" - You can specify which type of completion to default to
|
||||
" when pressing <C-X><C-O>. The entire list of available
|
||||
" choices can be found in the calls to sqlcomplete#Map in:
|
||||
" ftplugin/sql.vim
|
||||
"
|
||||
" Version 10.0
|
||||
" Updated PreCacheSyntax()
|
||||
" Updated PreCacheSyntax()
|
||||
" - Now returns a List of the syntax items it finds.
|
||||
" This allows other plugins / scripts to use this list for their own
|
||||
" purposes. In this case XPTemplate can use them for a Choose list.
|
||||
@@ -18,22 +33,22 @@
|
||||
" warning if not.
|
||||
" - Verifies the parameters are the correct type and displays a
|
||||
" warning if not.
|
||||
" Updated SQLCWarningMsg()
|
||||
" Updated SQLCWarningMsg()
|
||||
" - Prepends warning message with SQLComplete so you know who issued
|
||||
" the warning.
|
||||
" Updated SQLCErrorMsg()
|
||||
" Updated SQLCErrorMsg()
|
||||
" - Prepends error message with SQLComplete so you know who issued
|
||||
" the error.
|
||||
"
|
||||
"
|
||||
" Version 9.0
|
||||
" This change removes some of the support for tables with spaces in their
|
||||
" names in order to simplify the regexes used to pull out query table
|
||||
" names in order to simplify the regexes used to pull out query table
|
||||
" aliases for more robust table name and column name code completion.
|
||||
" Full support for "table names with spaces" can be added in again
|
||||
" after 7.3.
|
||||
"
|
||||
" Version 8.0
|
||||
" Incorrectly re-executed the g:ftplugin_sql_omni_key_right and g:ftplugin_sql_omni_key_left
|
||||
" Incorrectly re-executed the g:ftplugin_sql_omni_key_right and g:ftplugin_sql_omni_key_left
|
||||
" when drilling in and out of a column list for a table.
|
||||
"
|
||||
" Version 7.0
|
||||
@@ -44,7 +59,7 @@
|
||||
"
|
||||
" Set completion with CTRL-X CTRL-O to autoloaded function.
|
||||
" This check is in place in case this script is
|
||||
" sourced directly instead of using the autoload feature.
|
||||
" sourced directly instead of using the autoload feature.
|
||||
if exists('&omnifunc')
|
||||
" Do not set the option if already set since this
|
||||
" results in an E117 warning.
|
||||
@@ -54,9 +69,9 @@ if exists('&omnifunc')
|
||||
endif
|
||||
|
||||
if exists('g:loaded_sql_completion')
|
||||
finish
|
||||
finish
|
||||
endif
|
||||
let g:loaded_sql_completion = 100
|
||||
let g:loaded_sql_completion = 120
|
||||
|
||||
" Maintains filename of dictionary
|
||||
let s:sql_file_table = ""
|
||||
@@ -69,7 +84,7 @@ let s:tbl_alias = []
|
||||
let s:tbl_cols = []
|
||||
let s:syn_list = []
|
||||
let s:syn_value = []
|
||||
|
||||
|
||||
" Used in conjunction with the syntaxcomplete plugin
|
||||
let s:save_inc = ""
|
||||
let s:save_exc = ""
|
||||
@@ -79,7 +94,7 @@ endif
|
||||
if exists('g:omni_syntax_group_exclude_sql')
|
||||
let s:save_exc = g:omni_syntax_group_exclude_sql
|
||||
endif
|
||||
|
||||
|
||||
" Used with the column list
|
||||
let s:save_prev_table = ""
|
||||
|
||||
@@ -110,12 +125,16 @@ if !exists('g:omni_sql_include_owner')
|
||||
if g:loaded_dbext >= 300
|
||||
" New to dbext 3.00, by default the table lists include the owner
|
||||
" name of the table. This is used when determining how much of
|
||||
" whatever has been typed should be replaced as part of the
|
||||
" whatever has been typed should be replaced as part of the
|
||||
" code replacement.
|
||||
let g:omni_sql_include_owner = 1
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
" Default type of completion used when <C-X><C-O> is pressed
|
||||
if !exists('g:omni_sql_default_compl_type')
|
||||
let g:omni_sql_default_compl_type = 'table'
|
||||
endif
|
||||
|
||||
" This function is used for the 'omnifunc' option.
|
||||
function! sqlcomplete#Complete(findstart, base)
|
||||
@@ -140,7 +159,7 @@ function! sqlcomplete#Complete(findstart, base)
|
||||
let begindot = 1
|
||||
endif
|
||||
while start > 0
|
||||
" Additional code was required to handle objects which
|
||||
" Additional code was required to handle objects which
|
||||
" can contain spaces like "my table name".
|
||||
if line[start - 1] !~ '\(\w\|\.\)'
|
||||
" If the previous character is not a period or word character
|
||||
@@ -150,7 +169,7 @@ function! sqlcomplete#Complete(findstart, base)
|
||||
elseif line[start - 1] =~ '\w'
|
||||
" If the previous character is word character continue back
|
||||
let start -= 1
|
||||
elseif line[start - 1] =~ '\.' &&
|
||||
elseif line[start - 1] =~ '\.' &&
|
||||
\ compl_type =~ 'column\|table\|view\|procedure'
|
||||
" If the previous character is a period and we are completing
|
||||
" an object which can be specified with a period like this:
|
||||
@@ -160,7 +179,7 @@ function! sqlcomplete#Complete(findstart, base)
|
||||
" If lastword has already been set for column completion
|
||||
" break from the loop, since we do not also want to pickup
|
||||
" a table name if it was also supplied.
|
||||
if lastword != -1 && compl_type == 'column'
|
||||
if lastword != -1 && compl_type == 'column'
|
||||
break
|
||||
endif
|
||||
" If column completion was specified stop at the "." if
|
||||
@@ -171,8 +190,8 @@ function! sqlcomplete#Complete(findstart, base)
|
||||
endif
|
||||
" If omni_sql_include_owner = 0, do not include the table
|
||||
" name as part of the substitution, so break here
|
||||
if lastword == -1 &&
|
||||
\ compl_type =~ 'table\|view\|procedure\column_csv' &&
|
||||
if lastword == -1 &&
|
||||
\ compl_type =~ 'table\|view\|procedure\column_csv' &&
|
||||
\ g:omni_sql_include_owner == 0
|
||||
let lastword = start
|
||||
break
|
||||
@@ -202,7 +221,7 @@ function! sqlcomplete#Complete(findstart, base)
|
||||
let compl_list = []
|
||||
|
||||
" Default to table name completion
|
||||
let compl_type = 'table'
|
||||
let compl_type = g:omni_sql_default_compl_type
|
||||
" Allow maps to specify what type of object completion they want
|
||||
if exists('b:sql_compl_type')
|
||||
let compl_type = b:sql_compl_type
|
||||
@@ -216,7 +235,7 @@ function! sqlcomplete#Complete(findstart, base)
|
||||
|
||||
if compl_type == 'table' ||
|
||||
\ compl_type == 'procedure' ||
|
||||
\ compl_type == 'view'
|
||||
\ compl_type == 'view'
|
||||
|
||||
" This type of completion relies upon the dbext.vim plugin
|
||||
if s:SQLCCheck4dbext() == -1
|
||||
@@ -254,7 +273,7 @@ function! sqlcomplete#Complete(findstart, base)
|
||||
|
||||
if base == ""
|
||||
" The last time we displayed a column list we stored
|
||||
" the table name. If the user selects a column list
|
||||
" the table name. If the user selects a column list
|
||||
" without a table name of alias present, assume they want
|
||||
" the previous column list displayed.
|
||||
let base = s:save_prev_table
|
||||
@@ -273,16 +292,16 @@ function! sqlcomplete#Complete(findstart, base)
|
||||
" has entered:
|
||||
" owner.table
|
||||
" table.column_prefix
|
||||
" So there are a couple of things we can do to mitigate
|
||||
" So there are a couple of things we can do to mitigate
|
||||
" this issue.
|
||||
" 1. Check if the dbext plugin has the option turned
|
||||
" on to even allow owners
|
||||
" 2. Based on 1, if the user is showing a table list
|
||||
" and the DrillIntoTable (using <Right>) then
|
||||
" and the DrillIntoTable (using <Right>) then
|
||||
" this will be owner.table. In this case, we can
|
||||
" check to see the table.column exists in the
|
||||
" check to see the table.column exists in the
|
||||
" cached table list. If it does, then we have
|
||||
" determined the user has actually chosen
|
||||
" determined the user has actually chosen
|
||||
" owner.table, not table.column_prefix.
|
||||
let found = -1
|
||||
if g:omni_sql_include_owner == 1 && owner == ''
|
||||
@@ -297,17 +316,46 @@ function! sqlcomplete#Complete(findstart, base)
|
||||
" If the user has indicated not to use table owners at all and
|
||||
" the base ends in a '.' we know they are not providing a column
|
||||
" name, so we can shift the items appropriately.
|
||||
if found != -1 || (g:omni_sql_include_owner == 0 && base !~ '\.$')
|
||||
let owner = table
|
||||
let table = column
|
||||
let column = ''
|
||||
endif
|
||||
" if found != -1 || (g:omni_sql_include_owner == 0 && base !~ '\.$')
|
||||
" let owner = table
|
||||
" let table = column
|
||||
" let column = ''
|
||||
" endif
|
||||
else
|
||||
" If no "." was provided and the user asked for
|
||||
" column level completion, first attempt the match
|
||||
" on any previous column lists. If the user asked
|
||||
" for a list of columns comma separated, continue as usual.
|
||||
if compl_type == 'column' && s:save_prev_table != ''
|
||||
" The last time we displayed a column list we stored
|
||||
" the table name. If the user selects a column list
|
||||
" without a table name of alias present, assume they want
|
||||
" the previous column list displayed.
|
||||
let table = s:save_prev_table
|
||||
let list_type = ''
|
||||
|
||||
let compl_list = s:SQLCGetColumns(table, list_type)
|
||||
if ! empty(compl_list)
|
||||
" If no column prefix has been provided and the table
|
||||
" name was provided, append it to each of the items
|
||||
" returned.
|
||||
let compl_list = filter(deepcopy(compl_list), 'v:val=~"^'.base.'"' )
|
||||
|
||||
" If not empty, we have a match on columns
|
||||
" return the list
|
||||
if ! empty(compl_list)
|
||||
return compl_list
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
" Since no columns were found to match the base supplied
|
||||
" assume the user is trying to complete the column list
|
||||
" for a table (and or an alias to a table).
|
||||
let table = base
|
||||
endif
|
||||
|
||||
" Get anything after the . and consider this the table name
|
||||
" If an owner has been specified, then we must consider the
|
||||
" If an owner has been specified, then we must consider the
|
||||
" base to be a partial column name
|
||||
" let base = matchstr( base, '^\(.*\.\)\?\zs.*' )
|
||||
|
||||
@@ -327,11 +375,11 @@ function! sqlcomplete#Complete(findstart, base)
|
||||
" If no column prefix has been provided and the table
|
||||
" name was provided, append it to each of the items
|
||||
" returned.
|
||||
let compl_list = map(compl_list, "table.'.'.v:val")
|
||||
let compl_list = map(compl_list, 'table.".".v:val')
|
||||
if owner != ''
|
||||
" If an owner has been provided append it to each of the
|
||||
" items returned.
|
||||
let compl_list = map(compl_list, "owner.'.'.v:val")
|
||||
let compl_list = map(compl_list, 'owner.".".v:val')
|
||||
endif
|
||||
else
|
||||
let base = ''
|
||||
@@ -361,11 +409,15 @@ function! sqlcomplete#Complete(findstart, base)
|
||||
|
||||
if base != ''
|
||||
" Filter the list based on the first few characters the user entered.
|
||||
" Check if the text matches at the beginning
|
||||
" or
|
||||
" Check if the text matches at the beginning
|
||||
" \\(^.base.'\\)
|
||||
" or
|
||||
" Match to a owner.table or alias.column type match
|
||||
" ^\\(\\w\\+\\.\\)\\?'.base.'\\)
|
||||
" or
|
||||
" Handle names with spaces "my table name"
|
||||
" "\\(^'.base.'\\|^\\(\\w\\+\\.\\)\\?'.base.'\\)"'
|
||||
"
|
||||
let expr = 'v:val '.(g:omni_sql_ignorecase==1?'=~?':'=~#').' "\\(^'.base.'\\|^\\(\\w\\+\\.\\)\\?'.base.'\\)"'
|
||||
" let expr = 'v:val '.(g:omni_sql_ignorecase==1?'=~?':'=~#').' "\\(^'.base.'\\)"'
|
||||
" let expr = 'v:val '.(g:omni_sql_ignorecase==1?'=~?':'=~#').' "\\(^'.base.'\\|\\(\\.\\)\\?'.base.'\\)"'
|
||||
@@ -384,7 +436,7 @@ function! sqlcomplete#PreCacheSyntax(...)
|
||||
let syn_group_arr = []
|
||||
let syn_items = []
|
||||
|
||||
if a:0 > 0
|
||||
if a:0 > 0
|
||||
if type(a:1) != 3
|
||||
call s:SQLCWarningMsg("Parameter is not a list. Example:['syntaxGroup1', 'syntaxGroup2']")
|
||||
return ''
|
||||
@@ -407,7 +459,7 @@ endfunction
|
||||
function! sqlcomplete#ResetCacheSyntax(...)
|
||||
let syn_group_arr = []
|
||||
|
||||
if a:0 > 0
|
||||
if a:0 > 0
|
||||
if type(a:1) != 3
|
||||
call s:SQLCWarningMsg("Parameter is not a list. Example:['syntaxGroup1', 'syntaxGroup2']")
|
||||
return ''
|
||||
@@ -458,7 +510,7 @@ function! sqlcomplete#DrillIntoTable()
|
||||
" If the popup is not visible, simple perform the normal
|
||||
" key behaviour.
|
||||
" Must use exec since they key must be preceeded by "\"
|
||||
" or feedkeys will simply push each character of the string
|
||||
" or feedkeys will simply push each character of the string
|
||||
" rather than the "key press".
|
||||
exec 'call feedkeys("\'.g:ftplugin_sql_omni_key_right.'", "n")'
|
||||
endif
|
||||
@@ -475,7 +527,7 @@ function! sqlcomplete#DrillOutOfColumns()
|
||||
" If the popup is not visible, simple perform the normal
|
||||
" key behaviour.
|
||||
" Must use exec since they key must be preceeded by "\"
|
||||
" or feedkeys will simply push each character of the string
|
||||
" or feedkeys will simply push each character of the string
|
||||
" rather than the "key press".
|
||||
exec 'call feedkeys("\'.g:ftplugin_sql_omni_key_left.'", "n")'
|
||||
endif
|
||||
@@ -484,16 +536,16 @@ endfunction
|
||||
|
||||
function! s:SQLCWarningMsg(msg)
|
||||
echohl WarningMsg
|
||||
echomsg 'SQLComplete:'.a:msg
|
||||
echomsg 'SQLComplete:'.a:msg
|
||||
echohl None
|
||||
endfunction
|
||||
|
||||
|
||||
function! s:SQLCErrorMsg(msg)
|
||||
echohl ErrorMsg
|
||||
echomsg 'SQLComplete:'.a:msg
|
||||
echomsg 'SQLComplete:'.a:msg
|
||||
echohl None
|
||||
endfunction
|
||||
|
||||
|
||||
function! s:SQLCGetSyntaxList(syn_group)
|
||||
let syn_group = a:syn_group
|
||||
let compl_list = []
|
||||
@@ -504,7 +556,7 @@ function! s:SQLCGetSyntaxList(syn_group)
|
||||
" Return previously cached value
|
||||
let compl_list = s:syn_value[list_idx]
|
||||
else
|
||||
" Request the syntax list items from the
|
||||
" Request the syntax list items from the
|
||||
" syntax completion plugin
|
||||
if syn_group == 'syntax'
|
||||
" Handle this special case. This allows the user
|
||||
@@ -552,7 +604,7 @@ function! s:SQLCAddAlias(table_name, table_alias, cols)
|
||||
let table_alias = a:table_alias
|
||||
let cols = a:cols
|
||||
|
||||
if g:omni_sql_use_tbl_alias != 'n'
|
||||
if g:omni_sql_use_tbl_alias != 'n'
|
||||
if table_alias == ''
|
||||
if 'da' =~? g:omni_sql_use_tbl_alias
|
||||
if table_name =~ '_'
|
||||
@@ -562,13 +614,13 @@ function! s:SQLCAddAlias(table_name, table_alias, cols)
|
||||
setlocal iskeyword-=_
|
||||
|
||||
" Get the first letter of each word
|
||||
" [[:alpha:]] is used instead of \w
|
||||
" [[:alpha:]] is used instead of \w
|
||||
" to catch extended accented characters
|
||||
"
|
||||
let table_alias = substitute(
|
||||
\ table_name,
|
||||
\ '\<[[:alpha:]]\+\>_\?',
|
||||
\ '\=strpart(submatch(0), 0, 1)',
|
||||
let table_alias = substitute(
|
||||
\ table_name,
|
||||
\ '\<[[:alpha:]]\+\>_\?',
|
||||
\ '\=strpart(submatch(0), 0, 1)',
|
||||
\ 'g'
|
||||
\ )
|
||||
" Restore original value
|
||||
@@ -596,7 +648,7 @@ function! s:SQLCAddAlias(table_name, table_alias, cols)
|
||||
return cols
|
||||
endfunction
|
||||
|
||||
function! s:SQLCGetObjectOwner(object)
|
||||
function! s:SQLCGetObjectOwner(object)
|
||||
" The owner regex matches a word at the start of the string which is
|
||||
" followed by a dot, but doesn't include the dot in the result.
|
||||
" ^ - from beginning of line
|
||||
@@ -609,7 +661,7 @@ function! s:SQLCGetObjectOwner(object)
|
||||
" let owner = matchstr( a:object, '^\s*\zs.*\ze\.' )
|
||||
let owner = matchstr( a:object, '^\("\|\[\)\?\zs\.\{-}\ze\("\|\]\)\?\.' )
|
||||
return owner
|
||||
endfunction
|
||||
endfunction
|
||||
|
||||
function! s:SQLCGetColumns(table_name, list_type)
|
||||
" Check if the table name was provided as part of the column name
|
||||
@@ -636,7 +688,7 @@ function! s:SQLCGetColumns(table_name, list_type)
|
||||
if list_idx > -1
|
||||
let table_cols = split(s:tbl_cols[list_idx], '\n')
|
||||
else
|
||||
" Check if we have already cached the column list for this table
|
||||
" Check if we have already cached the column list for this table
|
||||
" by its alias, assuming the table_name provided was actually
|
||||
" the alias for the table instead
|
||||
" select *
|
||||
@@ -654,7 +706,7 @@ function! s:SQLCGetColumns(table_name, list_type)
|
||||
" And the table ends in a "." or we are looking for a column list
|
||||
" if list_idx == -1 && (a:table_name =~ '\.' || b:sql_compl_type =~ 'column')
|
||||
" if list_idx == -1 && (a:table_name =~ '\.' || a:list_type =~ 'csv')
|
||||
if list_idx == -1
|
||||
if list_idx == -1
|
||||
let saveY = @y
|
||||
let saveSearch = @/
|
||||
let saveWScan = &wrapscan
|
||||
@@ -665,7 +717,7 @@ function! s:SQLCGetColumns(table_name, list_type)
|
||||
setlocal nowrapscan
|
||||
" If . was entered, look at the word just before the .
|
||||
" We are looking for something like this:
|
||||
" select *
|
||||
" select *
|
||||
" from customer c
|
||||
" where c.
|
||||
" So when . is pressed, we need to find 'c'
|
||||
@@ -692,15 +744,15 @@ function! s:SQLCGetColumns(table_name, list_type)
|
||||
" if query =~? '^\c\(select\)'
|
||||
if query =~? '^\(select\|update\|delete\)'
|
||||
let found = 1
|
||||
" \(\(\<\w\+\>\)\.\)\? -
|
||||
" \(\(\<\w\+\>\)\.\)\? -
|
||||
" '\c\(from\|join\|,\).\{-}' - Starting at the from clause (case insensitive)
|
||||
" '\zs\(\(\<\w\+\>\)\.\)\?' - Get the owner name (optional)
|
||||
" '\<\w\+\>\ze' - Get the table name
|
||||
" '\<\w\+\>\ze' - Get the table name
|
||||
" '\s\+\<'.table_name.'\>' - Followed by the alias
|
||||
" '\s*\.\@!.*' - Cannot be followed by a .
|
||||
" '\(\<where\>\|$\)' - Must be followed by a WHERE clause
|
||||
" '.*' - Exclude the rest of the line in the match
|
||||
" let table_name_new = matchstr(@y,
|
||||
" let table_name_new = matchstr(@y,
|
||||
" \ '\c\(from\|join\|,\).\{-}'.
|
||||
" \ '\zs\(\("\|\[\)\?.\{-}\("\|\]\)\.\)\?'.
|
||||
" \ '\("\|\[\)\?.\{-}\("\|\]\)\?\ze'.
|
||||
@@ -711,7 +763,16 @@ function! s:SQLCGetColumns(table_name, list_type)
|
||||
" \ '\(\<where\>\|$\)'.
|
||||
" \ '.*'
|
||||
" \ )
|
||||
let table_name_new = matchstr(@y,
|
||||
"
|
||||
"
|
||||
" ''\c\(\<from\>\|\<join\>\|,\)\s*' - Starting at the from clause (case insensitive)
|
||||
" '\zs\(\("\|\[\)\?\w\+\("\|\]\)\?\.\)\?' - Get the owner name (optional)
|
||||
" '\("\|\[\)\?\w\+\("\|\]\)\?\ze' - Get the table name
|
||||
" '\s\+\%(as\s\+\)\?\<'.matchstr(table_name, '.\{-}\ze\.\?$').'\>' - Followed by the alias
|
||||
" '\s*\.\@!.*' - Cannot be followed by a .
|
||||
" '\(\<where\>\|$\)' - Must be followed by a WHERE clause
|
||||
" '.*' - Exclude the rest of the line in the match
|
||||
let table_name_new = matchstr(@y,
|
||||
\ '\c\(\<from\>\|\<join\>\|,\)\s*'.
|
||||
\ '\zs\(\("\|\[\)\?\w\+\("\|\]\)\?\.\)\?'.
|
||||
\ '\("\|\[\)\?\w\+\("\|\]\)\?\ze'.
|
||||
@@ -753,7 +814,7 @@ function! s:SQLCGetColumns(table_name, list_type)
|
||||
|
||||
" Return to previous location
|
||||
call cursor(curline, curcol)
|
||||
|
||||
|
||||
if found == 0
|
||||
if g:loaded_dbext > 300
|
||||
exec 'DBSetOption use_tbl_alias='.saveSettingAlias
|
||||
@@ -762,7 +823,7 @@ function! s:SQLCGetColumns(table_name, list_type)
|
||||
" Not a SQL statement, do not display a list
|
||||
return []
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
if empty(table_cols)
|
||||
" Specify silent mode, no messages to the user (tbl, 1)
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
" Vim compiler file
|
||||
" Compiler: Erlang
|
||||
" Maintainer: none, please volunteer!
|
||||
" Last Change: 2012 Jan 20
|
||||
" Compiler: Erlang
|
||||
" Maintainer: Dmitry Vasiliev <dima at hlabs dot org>
|
||||
" Last Change: 2012-02-13
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "erlang"
|
||||
|
||||
" TODO
|
||||
CompilerSet makeprg=erlc\ -Wall\ %
|
||||
|
||||
CompilerSet errorformat=%f:%l:\ %m
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*autocmd.txt* For Vim version 7.3. Last change: 2012 Jan 20
|
||||
*autocmd.txt* For Vim version 7.3. Last change: 2012 Feb 22
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -33,7 +33,7 @@ files matching *.c. You can also use autocommands to implement advanced
|
||||
features, such as editing compressed files (see |gzip-example|). The usual
|
||||
place to put autocommands is in your .vimrc or .exrc file.
|
||||
|
||||
*E203* *E204* *E143*
|
||||
*E203* *E204* *E143* *E855*
|
||||
WARNING: Using autocommands is very powerful, and may lead to unexpected side
|
||||
effects. Be careful not to destroy your text.
|
||||
- It's a good idea to do some testing on an expendable copy of a file first.
|
||||
@@ -1053,7 +1053,7 @@ Note that the 'eventignore' option applies here too. Events listed in this
|
||||
option will not cause any commands to be executed.
|
||||
|
||||
*:do* *:doau* *:doautocmd* *E217*
|
||||
:do[autocmd] [group] {event} [fname]
|
||||
:do[autocmd] [<nomodeline>] [group] {event} [fname]
|
||||
Apply the autocommands matching [fname] (default:
|
||||
current file name) for {event} to the current buffer.
|
||||
You can use this when the current file name does not
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*cmdline.txt* For Vim version 7.3. Last change: 2011 Mar 27
|
||||
*cmdline.txt* For Vim version 7.3. Last change: 2012 Feb 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -426,6 +426,8 @@ a previous version <Esc> was used). In the pattern standard wildcards '*' and
|
||||
'?' are accepted when matching file names. '*' matches any string, '?'
|
||||
matches exactly one character.
|
||||
|
||||
The 'wildignorecase' option can be set to ignore case in filenames.
|
||||
|
||||
If you like tcsh's autolist completion, you can use this mapping:
|
||||
:cnoremap X <C-L><C-D>
|
||||
(Where X is the command key to use, <C-L> is CTRL-L and <C-D> is CTRL-D)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*debug.txt* For Vim version 7.3. Last change: 2010 Dec 22
|
||||
*debug.txt* For Vim version 7.3. Last change: 2012 Feb 11
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -15,7 +15,7 @@ For debugging Vim scripts, functions, etc. see |debug-scripts|
|
||||
|
||||
==============================================================================
|
||||
|
||||
1. Location of a crash, using gcc and gdb *debug-gcc*
|
||||
1. Location of a crash, using gcc and gdb *debug-gcc* *gdb*
|
||||
|
||||
When Vim crashes in one of the test files, and you are using gcc for
|
||||
compilation, here is what you can do to find out exactly where Vim crashes.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 7.3. Last change: 2012 Jan 13
|
||||
*options.txt* For Vim version 7.3. Last change: 2012 Feb 22
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -5899,8 +5899,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
security reasons.
|
||||
|
||||
*'shellcmdflag'* *'shcf'*
|
||||
'shellcmdflag' 'shcf' string (default: "-c", MS-DOS and Win32, when 'shell'
|
||||
does not contain "sh" somewhere: "/c")
|
||||
'shellcmdflag' 'shcf' string (default: "-c";
|
||||
MS-DOS and Win32, when 'shell' does not
|
||||
contain "sh" somewhere: "/c")
|
||||
global
|
||||
{not in Vi}
|
||||
Flag passed to the shell to execute "!" and ":!" commands; e.g.,
|
||||
@@ -6039,10 +6040,20 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
0 and 2: use "shell 'shellcmdflag' cmd" to start external commands
|
||||
1 and 3: use "shell cmd" to start external commands
|
||||
|
||||
*'shellxescape'* *'sxe'*
|
||||
'shellxescape' 'sxe' string (default: "";
|
||||
for MS-DOS and MS-Windows: "\"&|<>()@^")
|
||||
global
|
||||
{not in Vi}
|
||||
When 'shellxquote' is set to "(" then the characters listed in this
|
||||
option will be escaped with a '^' character. This makes it possible
|
||||
to execute most external commands with cmd.exe.
|
||||
|
||||
*'shellxquote'* *'sxq'*
|
||||
'shellxquote' 'sxq' string (default: "";
|
||||
for Win32, when 'shell' is cmd.exe or
|
||||
contains "sh" somewhere: "\""
|
||||
for Win32, when 'shell' is cmd.exe: "("
|
||||
for Win32, when 'shell' contains "sh"
|
||||
somewhere: "\""
|
||||
for Unix, when using system(): "\"")
|
||||
global
|
||||
{not in Vi}
|
||||
@@ -6050,6 +6061,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
the "!" and ":!" commands. Includes the redirection. See
|
||||
'shellquote' to exclude the redirection. It's probably not useful
|
||||
to set both options.
|
||||
When the value is '(' then ')' is appended. When the value is '"('
|
||||
then ')"' is appended.
|
||||
When the value is '(' then also see 'shellxescape'.
|
||||
This is an empty string by default on most systems, but is known to be
|
||||
useful for on Win32 version, either for cmd.exe which automatically
|
||||
strips off the first and last quote on a command, or 3rd-party shells
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*quickref.txt* For Vim version 7.3. Last change: 2011 Jun 12
|
||||
*quickref.txt* For Vim version 7.3. Last change: 2012 Feb 22
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -851,6 +851,7 @@ Short explanation of each option: *option-list*
|
||||
'shellslash' 'ssl' use forward slash for shell file names
|
||||
'shelltemp' 'stmp' whether to use a temp file for shell commands
|
||||
'shelltype' 'st' Amiga: influences how to use a shell
|
||||
'shellxescape' 'sxe' characters to escape when 'shellxquote' is (
|
||||
'shellxquote' 'sxq' like 'shellquote', but include redirection
|
||||
'shiftround' 'sr' round indent to multiple of shiftwidth
|
||||
'shiftwidth' 'sw' number of spaces to use for (auto)indent step
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*syntax.txt* For Vim version 7.3. Last change: 2012 Jan 20
|
||||
*syntax.txt* For Vim version 7.3. Last change: 2012 Feb 11
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -986,9 +986,9 @@ Example: >
|
||||
or >
|
||||
// vim:syntax=c.doxygen
|
||||
|
||||
It can also be done automatically for C, C++, C# and IDL files by setting the
|
||||
global or buffer-local variable load_doxygen_syntax. This is done by adding
|
||||
the following to your .vimrc. >
|
||||
It can also be done automatically for C, C++, C#, IDL and PHP files by setting
|
||||
the global or buffer-local variable load_doxygen_syntax. This is done by
|
||||
adding the following to your .vimrc. >
|
||||
:let g:load_doxygen_syntax=1
|
||||
|
||||
There are a couple of variables that have an effect on syntax highlighting, and
|
||||
@@ -1742,19 +1742,10 @@ instead, and the name of your source file should be *.pike
|
||||
|
||||
LUA *lua.vim* *ft-lua-syntax*
|
||||
|
||||
This syntax file may be used for Lua 4.0, Lua 5.0 or Lua 5.1 (the latter is
|
||||
The Lua syntax file can be used for versions 4.0, 5.0, 5.1 and 5.2 (5.2 is
|
||||
the default). You can select one of these versions using the global variables
|
||||
lua_version and lua_subversion. For example, to activate Lua
|
||||
4.0 syntax highlighting, use this command: >
|
||||
|
||||
:let lua_version = 4
|
||||
|
||||
If you are using Lua 5.0, use these commands: >
|
||||
|
||||
:let lua_version = 5
|
||||
:let lua_subversion = 0
|
||||
|
||||
To restore highlighting for Lua 5.1: >
|
||||
5.1 syntax highlighting, set the variables like this:
|
||||
|
||||
:let lua_version = 5
|
||||
:let lua_subversion = 1
|
||||
|
||||
@@ -783,6 +783,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
|
||||
'shellslash' options.txt /*'shellslash'*
|
||||
'shelltemp' options.txt /*'shelltemp'*
|
||||
'shelltype' options.txt /*'shelltype'*
|
||||
'shellxescape' options.txt /*'shellxescape'*
|
||||
'shellxquote' options.txt /*'shellxquote'*
|
||||
'shiftround' options.txt /*'shiftround'*
|
||||
'shiftwidth' options.txt /*'shiftwidth'*
|
||||
@@ -852,6 +853,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
|
||||
'swf' options.txt /*'swf'*
|
||||
'switchbuf' options.txt /*'switchbuf'*
|
||||
'sws' options.txt /*'sws'*
|
||||
'sxe' options.txt /*'sxe'*
|
||||
'sxq' options.txt /*'sxq'*
|
||||
'syn' options.txt /*'syn'*
|
||||
'synmaxcol' options.txt /*'synmaxcol'*
|
||||
@@ -3206,6 +3208,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
|
||||
<line1> map.txt /*<line1>*
|
||||
<line2> map.txt /*<line2>*
|
||||
<lt> intro.txt /*<lt>*
|
||||
<nomodeline> autocmd.txt /*<nomodeline>*
|
||||
<q-args> map.txt /*<q-args>*
|
||||
<reg> map.txt /*<reg>*
|
||||
<register> map.txt /*<register>*
|
||||
@@ -4240,6 +4243,7 @@ E851 gui_x11.txt /*E851*
|
||||
E852 gui_x11.txt /*E852*
|
||||
E853 eval.txt /*E853*
|
||||
E854 options.txt /*E854*
|
||||
E855 autocmd.txt /*E855*
|
||||
E86 windows.txt /*E86*
|
||||
E87 windows.txt /*E87*
|
||||
E88 windows.txt /*E88*
|
||||
@@ -5948,6 +5952,7 @@ g`a motion.txt /*g`a*
|
||||
ga various.txt /*ga*
|
||||
garbagecollect() eval.txt /*garbagecollect()*
|
||||
gd pattern.txt /*gd*
|
||||
gdb debug.txt /*gdb*
|
||||
ge motion.txt /*ge*
|
||||
get() eval.txt /*get()*
|
||||
get-ms-debuggers debug.txt /*get-ms-debuggers*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 7.3. Last change: 2012 Feb 04
|
||||
*todo.txt* For Vim version 7.3. Last change: 2012 Feb 22
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -38,63 +38,23 @@ Go through more coverity reports.
|
||||
|
||||
Discussion about canonicalization of Hebrew. (Ron Aaron, 2011 April 10)
|
||||
|
||||
Stack trace of crash: http://vpaste.net/GBt9S
|
||||
(Alexandre Provencio)
|
||||
|
||||
Once syntax and other runtime files have been fixed: add "set cp" to
|
||||
check.vim. Use a function to run both with 'cp' and 'nocp'.
|
||||
|
||||
Repeating search history entries. (Edwin Steiner, 2012 Jan 17)
|
||||
Jan 18: Caused by patch 7.3.265?
|
||||
Undo broken when pasting close to the last line. (Andrey Radev, 2012 Feb 14)
|
||||
Patch by Christian Brabandt, 2012 Feb 14.
|
||||
|
||||
Patch for '$' not being displayed for a change when 'cpoptions' contains "$".
|
||||
(Yasuhiro Matsumoto, 2012 Jan 28, patch by Hideki EIRAKU and Hirohito Higashi)
|
||||
|
||||
Patch to speed up readfile(). (John Little, 2012 Feb 1)
|
||||
Adjustment by Charles Peacech, Feb 3.
|
||||
8 When editing a file with extremely long lines (e.g., an executable), the
|
||||
"linerest" in readfile() is allocated twice to be able to copy what was
|
||||
read so far. Use realloc() instead? Or split the line when allocating
|
||||
memory fails and "linerest" is big (> 100000)?
|
||||
|
||||
Patch to fix a crash when an xpm file is invalid. (Dave Bodenstab, 2012 Jan
|
||||
27)
|
||||
|
||||
Hang in using VimEnter. (Alex Efros, 2012 Jan 14)
|
||||
|
||||
Patch for behavior of "." in compatible mode. (Yasuhiro Matsumoto, patch by
|
||||
Hideki EIRAKU, 2012 Jan 28)
|
||||
|
||||
":cd" doesn't work when current directory path contains wildcards.
|
||||
finddir() has the same problem. (Yukihiro Nakadaira, 2012 Jan 10)
|
||||
GTK: problem with 'L' in 'guioptions' changing the window width.
|
||||
(Aaron Cornelius, 2012 Feb 6)
|
||||
|
||||
Win32: When a directory name contains an exclamation mark, completion doesn't
|
||||
complete the contents of the directory. No escaping for the "!"? (Jan
|
||||
Stocker, 2012 Jan 5)
|
||||
|
||||
Patch to add support for Solaris ZFS ACLs. (Danek Duvall, 2012 Jan 13)
|
||||
|
||||
Patch to make continued lines work faster. (Yasuhiro Matsumoto, 2012 Jan 11)
|
||||
|
||||
Also an idea to make join() faster. (Yasuhiro Matsumoto, 2012 Jan 11)
|
||||
Another one from Taro Muraoka, 2012 Jan 12.
|
||||
|
||||
":doau" says it triggers modeline. Should this only happen for events used
|
||||
when loading a buffer? (Kana Natsuno, 2011 Nov 7)
|
||||
|
||||
Patch for compiler warnings in if_perl. (James McCoy, 2011 Jan 30)
|
||||
|
||||
Patch for X selection conversion. (Alex Efros, 2012 Jan 24)
|
||||
|
||||
Patch to make 'shcf' default work better. (Benjamin Fritz, 2011 Nov 18)
|
||||
Win32: When 'shell' is cmd.exe this command fails:
|
||||
echo system('"c:/path/echo.exe" "foo bar"')
|
||||
Should we set the default for 'shellxquote' to a double quote, when 'shell'
|
||||
contains "cmd" in the tail? (Benjamin Fritz, 2008 Oct 13)
|
||||
Also set 'shellcmdflag' to include /s.
|
||||
|
||||
Other way to start Mzscheme. Tim Brown, 2011 Oct 5: change main call.
|
||||
Later patch by Sergey Khorev, 2011 Oct 9.
|
||||
|
||||
Patch to allow ! for :all and :sall, as documented. (Hirohito Higashi, 2012
|
||||
Jan 30)
|
||||
Patch to speed up ga_grow(). (Dominique Pelle, 2012 Feb 13)
|
||||
|
||||
Patch for "tab drop hoge" moving current window. (Higashi, 2012 Jan 31)
|
||||
":tab drop buffer.c" always opens a new tab, also if buffer.c is already in an
|
||||
@@ -127,6 +87,9 @@ URXVT:
|
||||
Patch for using QuickFixCmdPre for more commands. (Marcin Szamotulski, 2012
|
||||
Feb 1, update Feb 2)
|
||||
|
||||
Patch for pasting in the Ex command line is slow. (Dominique Pelle, 2012 Feb
|
||||
19)
|
||||
|
||||
When running Vim in silent ex mode, an existing swapfile causes Vim to wait
|
||||
for a user action without a prompt. (Maarten Billemont, 2012 Feb 3)
|
||||
Do give the prompt? Quit with an error?
|
||||
@@ -135,6 +98,10 @@ When exiting with unsaved changes, selecting an existing file in the file
|
||||
dialog, there is no dialog to ask whether the existing file should be
|
||||
overwritten. (Felipe G. Nievinski, 2011 Dec 22)
|
||||
|
||||
Patch for improved ":qa" behavior. (Hirohito Higashi, 2012 Feb 18)
|
||||
|
||||
Recognize objcpp. (Austin Ziegler, 2012 Feb 15)
|
||||
|
||||
7 Setting an option always sets "w_set_curswant", while this is only
|
||||
required for a few options. Only do it for those options to avoid the
|
||||
side effect.
|
||||
@@ -146,13 +113,15 @@ Carvalho merged the patch: New version 2012 Jan 19.
|
||||
|
||||
Patch for option in 'cino' to specify more indent for continued conditions.
|
||||
(Lech Lorens, 2011 Nov 27)
|
||||
Isn't this already possible?
|
||||
Isn't this already possible? Update 2012 Feb 15.
|
||||
|
||||
Patch for using objcpp file type for headers files. Issue 44.
|
||||
|
||||
Docs fix for v:register. (Ingo Karkat, 2011 Sep 26, 27)
|
||||
v:register doesn't work exactly as expected. (David Fishburn, 2011 Sep 20)
|
||||
|
||||
Patch for: vimgrep fails when 'autochdir' is set. (Ben Fritz, 2012 Feb 4)
|
||||
|
||||
Patch for: (Christian Brabandt, 2011 Aug 22)
|
||||
- Make it possible to enter "r<C-E>" and "r<C-Y>" (get character from line
|
||||
below/above).
|
||||
@@ -177,6 +146,10 @@ Patch Sep 18.
|
||||
Patch for has('unnamedplus') docs. (Tony Mechelynck, 2011 Sep 27)
|
||||
And one for gui_x11.txt.
|
||||
|
||||
":cd" doesn't work when current directory path contains "**".
|
||||
finddir() has the same problem. (Yukihiro Nakadaira, 2012 Jan 10)
|
||||
Requires a rewrite of the file_file_in_path code.
|
||||
|
||||
Problem with l: dictionary being locked in a function. (ZyX, 2011 Jul 21)
|
||||
|
||||
Issue 48: foldopen error can't be caught by try/catch
|
||||
@@ -184,6 +157,8 @@ Issue 48: foldopen error can't be caught by try/catch
|
||||
Patch to sort functions starting with '<' after others. Omit dict functions,
|
||||
they can't be called. (Yasuhiro Matsumoto, 2011 Oct 11)
|
||||
|
||||
Patch to pass list to or(), and() and xor(). (Yasuhiro Matsumoto, 2012 Feb 8)
|
||||
|
||||
Patch to improve "it" and "at" text object matching. (Christian Brabandt, 2011
|
||||
Nov 20)
|
||||
|
||||
@@ -195,6 +170,9 @@ Plugin for Modeleasy. (Massimiliano Tripoli, 2011 Nov 29)
|
||||
Updated syntax file for ssh_config, maintainer doesn't respond.
|
||||
(Leonard Ehrenfried, 2011 Sep 26)
|
||||
|
||||
BufWinLeave triggers too late when quitting last window in a tab page. (Lech
|
||||
Lorens, 2012 Feb 21)
|
||||
|
||||
"fC" doesn't position the cursor correctly when there are concealed
|
||||
characters. Patch by Christian Brabandt, 2011 Oct 11)
|
||||
|
||||
@@ -628,6 +606,8 @@ Win32: Expanding 'path' runs into a maximum size limit. (bgold12, 2009 Nov 15)
|
||||
Win32: Patch for enabling quick edit mode in console. (Craig Barkhouse, 2010
|
||||
Sep 1)
|
||||
|
||||
Win32: Patch for using .png files for icons. (Charles Peacech, 2012 Feb 5)
|
||||
|
||||
Putting a Visual block while 'visualedit' is "all" does not leave the cursor
|
||||
on the first character. (John Beckett, 2010 Aug 7)
|
||||
|
||||
@@ -997,6 +977,7 @@ Performance tests:
|
||||
- ~/vim/test/slowsearch
|
||||
- ~/vim/test/rgb.vim
|
||||
- ~/vim/text/FeiqCfg.xml (file from Netjune)
|
||||
- ~/vim/text/edl.svg (also XML)
|
||||
- search for a.*e*exn in the vim executable. Go to last line to use
|
||||
'hlsearch'.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim support file to detect file types
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2012 Feb 03
|
||||
" Last Change: 2012 Feb 05
|
||||
|
||||
" Listen very carefully, I will say this only once
|
||||
if exists("did_load_filetypes")
|
||||
@@ -2546,7 +2546,7 @@ au BufNewFile,BufRead *.txt,*.text setf text
|
||||
runtime! ftdetect/*.vim
|
||||
|
||||
" NOTE: The above command could have ended the filetypedetect autocmd group
|
||||
" and started another one. Let's make sure it has ended to get to a consistant
|
||||
" and started another one. Let's make sure it has ended to get to a consistent
|
||||
" state.
|
||||
augroup END
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
" Vim ftplugin file
|
||||
" Language: Erlang
|
||||
" Author: Oscar Hellström <oscar@oscarh.net>
|
||||
" Contributors: Ricardo Catalinas Jiménez <jimenezrick@gmail.com>
|
||||
" Author: Oscar Hellstr<EFBFBD>m <oscar@oscarh.net>
|
||||
" Contributors: Ricardo Catalinas Jim<EFBFBD>nez <jimenezrick@gmail.com>
|
||||
" Eduardo Lopez (http://github.com/tapichu)
|
||||
" License: Vim license
|
||||
" Version: 2011/11/21
|
||||
" Version: 2012/01/25
|
||||
|
||||
if exists('b:did_ftplugin')
|
||||
finish
|
||||
@@ -27,13 +27,10 @@ if !exists('g:erlang_folding')
|
||||
let g:erlang_folding = 0
|
||||
endif
|
||||
|
||||
" Local settings
|
||||
function s:SetErlangOptions()
|
||||
compiler erlang
|
||||
if version >= 700
|
||||
setlocal omnifunc=erlang_complete#Complete
|
||||
endif
|
||||
let s:erlang_fun_begin = '^\a\w*(.*$'
|
||||
let s:erlang_fun_end = '^[^%]*\.\s*\(%.*\)\?$'
|
||||
|
||||
function s:SetErlangOptions()
|
||||
if g:erlang_folding
|
||||
setlocal foldmethod=expr
|
||||
setlocal foldexpr=GetErlangFold(v:lnum)
|
||||
@@ -47,104 +44,35 @@ function s:SetErlangOptions()
|
||||
let &l:keywordprg = g:erlang_keywordprg
|
||||
endfunction
|
||||
|
||||
" Define folding functions
|
||||
if !exists('*GetErlangFold')
|
||||
" Folding params
|
||||
let s:erlang_fun_begin = '^\a\w*(.*$'
|
||||
let s:erlang_fun_end = '^[^%]*\.\s*\(%.*\)\?$'
|
||||
let s:erlang_blank_line = '^\s*\(%.*\)\?$'
|
||||
function GetErlangFold(lnum)
|
||||
let lnum = a:lnum
|
||||
let line = getline(lnum)
|
||||
|
||||
" Auxiliary fold functions
|
||||
function s:GetNextNonBlank(lnum)
|
||||
let lnum = nextnonblank(a:lnum + 1)
|
||||
let line = getline(lnum)
|
||||
while line =~ s:erlang_blank_line && 0 != lnum
|
||||
let lnum = nextnonblank(lnum + 1)
|
||||
let line = getline(lnum)
|
||||
endwhile
|
||||
return lnum
|
||||
endfunction
|
||||
if line =~ s:erlang_fun_end
|
||||
return '<1'
|
||||
endif
|
||||
|
||||
function s:GetFunName(str)
|
||||
return matchstr(a:str, '^\a\w*(\@=')
|
||||
endfunction
|
||||
if line =~ s:erlang_fun_begin && foldlevel(lnum - 1) == 1
|
||||
return '1'
|
||||
endif
|
||||
|
||||
function s:GetFunArgs(str, lnum)
|
||||
let str = a:str
|
||||
let lnum = a:lnum
|
||||
while str !~ '->\s*\(%.*\)\?$'
|
||||
let lnum = s:GetNextNonBlank(lnum)
|
||||
if 0 == lnum " EOF
|
||||
return ''
|
||||
endif
|
||||
let str .= getline(lnum)
|
||||
endwhile
|
||||
return matchstr(str,
|
||||
\ '\(^(\s*\)\@<=.*\(\s*)\(\s\+when\s\+.*\)\?\s\+->\s*\(%.*\)\?$\)\@=')
|
||||
endfunction
|
||||
if line =~ s:erlang_fun_begin
|
||||
return '>1'
|
||||
endif
|
||||
|
||||
function s:CountFunArgs(arguments)
|
||||
let pos = 0
|
||||
let ac = 0 " arg count
|
||||
let arguments = a:arguments
|
||||
|
||||
" Change list / tuples into just one A(rgument)
|
||||
let erlang_tuple = '{\([A-Za-z_,|=\-\[\]]\|\s\)*}'
|
||||
let erlang_list = '\[\([A-Za-z_,|=\-{}]\|\s\)*\]'
|
||||
return '='
|
||||
endfunction
|
||||
|
||||
" FIXME: Use searchpair?
|
||||
while arguments =~ erlang_tuple
|
||||
let arguments = substitute(arguments, erlang_tuple, 'A', 'g')
|
||||
endwhile
|
||||
" FIXME: Use searchpair?
|
||||
while arguments =~ erlang_list
|
||||
let arguments = substitute(arguments, erlang_list, 'A', 'g')
|
||||
endwhile
|
||||
|
||||
let len = strlen(arguments)
|
||||
while pos < len && pos > -1
|
||||
let ac += 1
|
||||
let pos = matchend(arguments, ',\s*', pos)
|
||||
endwhile
|
||||
return ac
|
||||
endfunction
|
||||
function ErlangFoldText()
|
||||
let line = getline(v:foldstart)
|
||||
let foldlen = v:foldend - v:foldstart + 1
|
||||
let lines = ' ' . foldlen . ' lines: ' . substitute(line, "[\ \t]*", '', '')
|
||||
if foldlen < 10
|
||||
let lines = ' ' . lines
|
||||
endif
|
||||
let retval = '+' . v:folddashes . lines
|
||||
|
||||
" Main fold function
|
||||
function GetErlangFold(lnum)
|
||||
let lnum = a:lnum
|
||||
let line = getline(lnum)
|
||||
|
||||
if line =~ s:erlang_fun_end
|
||||
return '<1'
|
||||
endif
|
||||
|
||||
if line =~ s:erlang_fun_begin && foldlevel(lnum - 1) == 1
|
||||
return '1'
|
||||
endif
|
||||
|
||||
if line =~ s:erlang_fun_begin
|
||||
return '>1'
|
||||
endif
|
||||
|
||||
return '='
|
||||
endfunction
|
||||
|
||||
" Erlang fold description (foldtext function)
|
||||
function ErlangFoldText()
|
||||
let foldlen = v:foldend - v:foldstart
|
||||
if 1 < foldlen
|
||||
let lines = 'lines'
|
||||
else
|
||||
let lines = 'line'
|
||||
endif
|
||||
let line = getline(v:foldstart)
|
||||
let name = s:GetFunName(line)
|
||||
let arguments = s:GetFunArgs(strpart(line, strlen(name)), v:foldstart)
|
||||
let argcount = s:CountFunArgs(arguments)
|
||||
let retval = '+' . v:folddashes . ' ' . name . '/' . argcount
|
||||
let retval .= ' (' . foldlen . ' ' . lines . ')'
|
||||
return retval
|
||||
endfunction
|
||||
endif
|
||||
return retval
|
||||
endfunction
|
||||
|
||||
call s:SetErlangOptions()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" These commands create the option window.
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2011 Jun 13
|
||||
" Last Change: 2012 Feb 22
|
||||
|
||||
" If there already is an option window, jump to that one.
|
||||
if bufwinnr("option-window") > 0
|
||||
@@ -1064,6 +1064,8 @@ call append("$", "shellquote\tcharacter(s) to enclose a shell command in")
|
||||
call <SID>OptionG("shq", &shq)
|
||||
call append("$", "shellxquote\tlike 'shellquote' but include the redirection")
|
||||
call <SID>OptionG("sxq", &sxq)
|
||||
call append("$", "shellxescape\tcharacters to escape when 'shellxquote' is (")
|
||||
call <SID>OptionG("sxe", &sxe)
|
||||
call append("$", "shellcmdflag\targument for 'shell' to execute a command")
|
||||
call <SID>OptionG("shcf", &shcf)
|
||||
call append("$", "shellredir\tused to redirect command output to a file")
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
" Vim syntax file
|
||||
" Language: Bazaar (bzr) commit file
|
||||
" Maintainer: Dmitry Vasiliev <dima at hlabs dot spb dot ru>
|
||||
" URL: http://www.hlabs.spb.ru/vim/bzr.vim
|
||||
" Last Change: 2009-01-27
|
||||
" Maintainer: Dmitry Vasiliev <dima at hlabs dot org>
|
||||
" URL: https://github.com/hdima/vim-scripts/blob/master/syntax/bzr.vim
|
||||
" Last Change: 2012-02-11
|
||||
" Filenames: bzr_log.*
|
||||
" Version: 1.2.1
|
||||
" Version: 1.2.2
|
||||
"
|
||||
" Thanks:
|
||||
"
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
" Vim syntax file
|
||||
" Language: Flat Assembler (FASM)
|
||||
" Maintainer: Ron Aaron <ron@ronware.org>
|
||||
" Last Change: 2004 May 16
|
||||
" Last Change: 2012/02/13
|
||||
" Vim URL: http://www.vim.org/lang.html
|
||||
" FASM Home: http://flatassembler.net/
|
||||
" FASM Version: 1.52
|
||||
" FASM Version: 1.56
|
||||
|
||||
if version < 600
|
||||
syntax clear
|
||||
@@ -12,6 +12,9 @@ elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
setlocal iskeyword=a-z,A-Z,48-57,.,_
|
||||
setlocal isident=a-z,A-Z,48-57,.,_
|
||||
syn case ignore
|
||||
@@ -97,7 +100,7 @@ syn keyword fasmDirective align binary code coff console discardable display dl
|
||||
syn keyword fasmDirective elf entry executable export extern far fixups format gui
|
||||
syn keyword fasmDirective import label ms mz native near notpageable pe public readable
|
||||
syn keyword fasmDirective repeat resource section segment shareable stack times
|
||||
syn keyword fasmDirective use16 use32 virtual wdm writeable
|
||||
syn keyword fasmDirective use16 use32 virtual wdm writable writeable
|
||||
syn keyword fasmOperator as at defined eq eqtype from mod on ptr rva used
|
||||
|
||||
syn match fasmNumericOperator "[+-/*]"
|
||||
@@ -142,4 +145,8 @@ hi def link fasmInstr keyword
|
||||
hi def link fasmLabel label
|
||||
hi def link fasmPrefix preproc
|
||||
let b:current_syntax = "fasm"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: ts=8 sw=8 :
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" Language: Lua 4.0, Lua 5.0, Lua 5.1 and Lua 5.2
|
||||
" Maintainer: Marcus Aurelius Farias <masserahguard-lua 'at' yahoo com>
|
||||
" First Author: Carlos Augusto Teixeira Mendes <cmendes 'at' inf puc-rio br>
|
||||
" Last Change: 2011 Dec 20
|
||||
" Last Change: 2012 Feb 07
|
||||
" Options: lua_version = 4 or 5
|
||||
" lua_subversion = 0 (4.0, 5.0) or 1 (5.1) or 2 (5.2)
|
||||
" default 5.2
|
||||
@@ -15,6 +15,9 @@ elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
if !exists("lua_version")
|
||||
" Default is lua 5.2
|
||||
let lua_version = 5
|
||||
@@ -358,4 +361,6 @@ endif
|
||||
|
||||
let b:current_syntax = "lua"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
" vim: et ts=8 sw=2
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: MS IDL (Microsoft dialect of Interface Description Language)
|
||||
" Maintainer: Vadim Zeitlin <vadim@wxwindows.org>
|
||||
" Last Change: 2003 May 11
|
||||
" Last Change: 2012 Feb 12 by Thilo Six
|
||||
|
||||
" For version 5.x: Clear all syntax items
|
||||
" For version 6.x: Quit when a syntax file was already loaded
|
||||
@@ -11,6 +11,9 @@ elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" Misc basic
|
||||
syn match msidlId "[a-zA-Z][a-zA-Z0-9_]*"
|
||||
syn match msidlUUID "{\?[[:xdigit:]]\{8}-\([[:xdigit:]]\{4}-\)\{3}[[:xdigit:]]\{12}}\?"
|
||||
@@ -89,4 +92,6 @@ endif
|
||||
|
||||
let b:current_syntax = "msidl"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
" vi: set ts=8 sw=4:
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
" Maintainer: Andriy Sokolov <andriy145@gmail.com>
|
||||
" Original Author: Manuel M.H. Stol <Manuel.Stol@allieddata.nl>
|
||||
" Former Maintainer: Manuel M.H. Stol <Manuel.Stol@allieddata.nl>
|
||||
" Last Change: 2010 Sep 24
|
||||
" Last Change: 2012 Feb 7
|
||||
" NASM Home: http://www.nasm.us/
|
||||
|
||||
|
||||
@@ -48,14 +48,14 @@ syn cluster nasmGrpComments contains=@nasmGrpInComments,nasmComment,nasmSpecialC
|
||||
" in NASM: 'Everything is a Label'
|
||||
" Definition Label = label defined by %[i]define or %[i]assign
|
||||
" Identifier Label = label defined as first non-keyword on a line or %[i]macro
|
||||
syn match nasmLabelError "$\=\(\d\+\K\|[#\.@]\|\$\$\k\)\k*\>"
|
||||
syn match nasmLabelError "$\=\(\d\+\K\|[#.@]\|\$\$\k\)\k*\>"
|
||||
syn match nasmLabel "\<\(\h\|[?@]\)\k*\>"
|
||||
syn match nasmLabel "[\$\~]\(\h\|[?@]\)\k*\>"lc=1
|
||||
" Labels starting with one or two '.' are special
|
||||
syn match nasmLocalLabel "\<\.\(\w\|[#$?@~]\)\k*\>"
|
||||
syn match nasmLocalLabel "\<\$\.\(\w\|[#$?@~]\)\k*\>"ms=s+1
|
||||
if !exists("nasm_no_warn")
|
||||
syn match nasmLabelWarn "\<\~\=\$\=[_\.][_\.\~]*\>"
|
||||
syn match nasmLabelWarn "\<\~\=\$\=[_.][_.\~]*\>"
|
||||
endif
|
||||
if exists("nasm_loose_syntax")
|
||||
syn match nasmSpecialLabel "\<\.\.@\k\+\>"
|
||||
@@ -92,7 +92,6 @@ syn keyword nasmFltNumber Inf Infinity Indefinite NaN SNaN QNaN
|
||||
syn match nasmNumberError "\<\~\s*\d\+\.\d*\(e[+-]\=\d\+\)\=\>"
|
||||
|
||||
|
||||
|
||||
" Netwide Assembler Storage Directives:
|
||||
" Storage types
|
||||
syn keyword nasmTypeError DF EXTRN FWORD RESF TBYTE
|
||||
@@ -181,7 +180,7 @@ if exists("nasm_ctx_outside_macro")
|
||||
syn region nasmPreConditDef transparent matchgroup=nasmCtxPreCondit start="^\s*%ifnctx\>"hs=e-6 start="^\s*%ifctx\>"hs=e-5 end="%endif\>" contains=@nasmGrpCntnPreCon
|
||||
syn match nasmCtxPreProc "^\s*%pop\>"hs=e-3
|
||||
if exists("nasm_loose_syntax")
|
||||
syn match nasmCtxLocLabel "%$\+\(\w\|[#\.?@~]\)\k*\>"
|
||||
syn match nasmCtxLocLabel "%$\+\(\w\|[#.?@~]\)\k*\>"
|
||||
else
|
||||
syn match nasmCtxLocLabel "%$\+\(\h\|[?@]\)\k*\>"
|
||||
endif
|
||||
@@ -249,10 +248,10 @@ syn match nasmRegisterError "\<X\=MM[8-9]\>"
|
||||
syn match nasmRegisterError "\<ST\((\d)\|[8-9]\>\)"
|
||||
syn match nasmRegisterError "\<E\([A-D][HL]\|[C-GS]S\)\>"
|
||||
" Memory reference operand (address):
|
||||
syn match nasmMemRefError "[\[\]]"
|
||||
syn match nasmMemRefError "[[\]]"
|
||||
syn cluster nasmGrpCntnMemRef contains=ALLBUT,@nasmGrpComments,@nasmGrpPreProcs,@nasmGrpInStrucs,nasmMemReference,nasmMemRefError
|
||||
syn match nasmInMacMemRef contained "\[[^;\[\]]\{-}\]" contains=@nasmGrpCntnMemRef,nasmPreProcError,nasmInMacLabel,nasmInMacLblWarn,nasmInMacParam
|
||||
syn match nasmMemReference "\[[^;\[\]]\{-}\]" contains=@nasmGrpCntnMemRef,nasmPreProcError,nasmCtxLocLabel
|
||||
syn match nasmInMacMemRef contained "\[[^;[\]]\{-}\]" contains=@nasmGrpCntnMemRef,nasmPreProcError,nasmInMacLabel,nasmInMacLblWarn,nasmInMacParam
|
||||
syn match nasmMemReference "\[[^;[\]]\{-}\]" contains=@nasmGrpCntnMemRef,nasmPreProcError,nasmCtxLocLabel
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
" Vim syntax file
|
||||
"
|
||||
" Language: NATURAL
|
||||
" Version: 2.1.0.3
|
||||
" Version: 2.1.0.5
|
||||
" Maintainer: Marko von Oppen <marko@von-oppen.com>
|
||||
" Last Changed: 2008-07-29 01:40:52
|
||||
" Last Changed: 2012-02-05 18:50:43
|
||||
" Support: http://www.von-oppen.com/
|
||||
|
||||
" For version 5.x: Clear all syntax items
|
||||
@@ -17,6 +17,9 @@ else
|
||||
setlocal iskeyword+=-,*,#,+,_,/
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" NATURAL is case insensitive
|
||||
syntax case ignore
|
||||
|
||||
@@ -206,4 +209,7 @@ endif
|
||||
|
||||
let b:current_syntax = "natural"
|
||||
|
||||
" vim:set ts=8 sw=8 noet ft=vim:
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim:set ts=8 sw=8 noet ft=vim list:
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
" Vim syntax file
|
||||
" Language: RCS file
|
||||
" Maintainer: Dmitry Vasiliev <dima at hlabs dot spb dot ru>
|
||||
" URL: http://www.hlabs.spb.ru/vim/rcs.vim
|
||||
" Revision: $Id: rcs.vim,v 1.2 2006/03/27 16:41:00 vimboss Exp $
|
||||
" Maintainer: Dmitry Vasiliev <dima at hlabs dot org>
|
||||
" URL: https://github.com/hdima/vim-scripts/blob/master/syntax/rcs.vim
|
||||
" Last Change: 2012-02-11
|
||||
" Filenames: *,v
|
||||
" Version: 1.11
|
||||
" Version: 1.12
|
||||
|
||||
" Options:
|
||||
" rcs_folding = 1 For folding strings
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
" Vim syntax file
|
||||
" Language: resolver configuration file
|
||||
" Maintainer: David Ne\v{c}as (Yeti) <yeti@physics.muni.cz>
|
||||
" Maintainer: David Necas (Yeti) <yeti@physics.muni.cz>
|
||||
" Original Maintaner: Radu Dineiu <littledragon@altern.org>
|
||||
" License: This file can be redistribued and/or modified under the same terms
|
||||
" as Vim itself.
|
||||
" URL: http://trific.ath.cx/Ftp/vim/syntax/resolv.vim
|
||||
" Last Change: 2006-04-16
|
||||
" Last Change: 2012-02-21
|
||||
|
||||
if version < 600
|
||||
syntax clear
|
||||
@@ -26,7 +25,8 @@ syn match resolvIPSpecial /\%(127\.\d\{1,3}\.\d\{1,3}\.\d\{1,3}\)/ contained
|
||||
" General
|
||||
syn match resolvIP contained /\%(\d\{1,4}\.\)\{3}\d\{1,4}/ contains=@resolvIPCluster
|
||||
syn match resolvIPNetmask contained /\%(\d\{1,4}\.\)\{3}\d\{1,4}\%(\/\%(\%(\d\{1,4}\.\)\{,3}\d\{1,4}\)\)\?/ contains=resolvOperator,@resolvIPCluster
|
||||
syn match resolvHostname contained /\w\{-}\.[-0-9A-Za-z_\.]*/
|
||||
syn match resolvHostname contained /\w\{-}\.[-0-9A-Za-z_.]*/
|
||||
syn match resolvDomainname contained /[-0-9A-Za-z_.]\+/
|
||||
|
||||
" Particular
|
||||
syn match resolvIPNameserver contained /\%(\%(\d\{1,4}\.\)\{3}\d\{1,4}\%(\s\|$\)\)\+/ contains=@resolvIPCluster
|
||||
@@ -36,7 +36,7 @@ syn match resolvIPNetmaskSortList contained /\%(\%(\d\{1,4}\.\)\{3}\d\{1,4}\%(\/
|
||||
" Identifiers
|
||||
syn match resolvNameserver /^\s*nameserver\>/ nextgroup=resolvIPNameserver skipwhite
|
||||
syn match resolvLwserver /^\s*lwserver\>/ nextgroup=resolvIPNameserver skipwhite
|
||||
syn match resolvDomain /^\s*domain\>/ nextgroup=resolvHostname skipwhite
|
||||
syn match resolvDomain /^\s*domain\>/ nextgroup=resolvDomainname skipwhite
|
||||
syn match resolvSearch /^\s*search\>/ nextgroup=resolvHostnameSearch skipwhite
|
||||
syn match resolvSortList /^\s*sortlist\>/ nextgroup=resolvIPNetmaskSortList skipwhite
|
||||
syn match resolvOptions /^\s*options\>/ nextgroup=resolvOption skipwhite
|
||||
@@ -61,6 +61,7 @@ if version >= 508 || !exists("did_config_syntax_inits")
|
||||
HiLink resolvIP Number
|
||||
HiLink resolvIPNetmask Number
|
||||
HiLink resolvHostname String
|
||||
HiLink resolvDomainname String
|
||||
HiLink resolvOption String
|
||||
|
||||
HiLink resolvIPNameserver Number
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
" Vim syntax file
|
||||
" Language: Reva Forth
|
||||
" Version: 7.1
|
||||
" Last Change: 2008/01/11
|
||||
" Version: 2011.2
|
||||
" Last Change: 2012/02/13
|
||||
" Maintainer: Ron Aaron <ron@ronware.org>
|
||||
" URL: http://ronware.org/reva/
|
||||
" Filetypes: *.rf *.frt
|
||||
" Filetypes: *.rf *.frt
|
||||
" NOTE: You should also have the ftplugin/reva.vim file to set 'isk'
|
||||
|
||||
" For version 5.x: Clear all syntax items and don't load
|
||||
@@ -17,10 +17,13 @@ elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
syn clear
|
||||
|
||||
" Synchronization method
|
||||
syn sync ccomment
|
||||
syn sync ccomment
|
||||
syn sync maxlines=100
|
||||
|
||||
|
||||
@@ -39,7 +42,7 @@ syn region revaEOF start='\<|||\>' end='{$}' contains=revaHelpStuff
|
||||
syn case match
|
||||
" basic mathematical and logical operators
|
||||
syn keyword revaoperators + - * / mod /mod negate abs min max umin umax
|
||||
syn keyword revaoperators and or xor not invert 1+ 1-
|
||||
syn keyword revaoperators and or xor not invert 1+ 1-
|
||||
syn keyword revaoperators m+ */ */mod m* um* m*/ um/mod fm/mod sm/rem
|
||||
syn keyword revaoperators d+ d- dnegate dabs dmin dmax > < = >> << u< <>
|
||||
|
||||
@@ -53,10 +56,10 @@ syn keyword revastack >r r> r@ rdrop
|
||||
" address operations
|
||||
syn keyword revamemory @ ! +! c@ c! 2@ 2! align aligned allot allocate here free resize
|
||||
syn keyword revaadrarith chars char+ cells cell+ cell cell- 2cell+ 2cell- 3cell+ 4cell+
|
||||
syn keyword revamemblks move fill
|
||||
syn keyword revamemblks move fill
|
||||
|
||||
" conditionals
|
||||
syn keyword revacond if else then =if >if <if <>if if0 ;; catch throw
|
||||
syn keyword revacond if else then =if >if <if <>if if0 ;; catch throw
|
||||
|
||||
" iterations
|
||||
syn keyword revaloop while repeat until again
|
||||
@@ -66,18 +69,18 @@ syn keyword revaloop do loop i j leave unloop skip more
|
||||
syn match revaColonDef '\<noname:\|\<:\s+' contains=revaComment
|
||||
syn keyword revaEndOfColonDef ; ;inline
|
||||
syn keyword revadefine constant constant, variable create variable,
|
||||
syn keyword revadefine user value to +to defer! defer@ defer is does> immediate
|
||||
syn keyword revadefine user value to +to defer! defer@ defer is does> immediate
|
||||
syn keyword revadefine compile literal ' [']
|
||||
|
||||
" Built in words
|
||||
com! -nargs=+ Builtin syn keyword revaBuiltin <args>
|
||||
Builtin execute ahead interp bye >body here pad words make
|
||||
Builtin accept close cr creat delete ekey emit fsize ioerr key?
|
||||
Builtin mtime open/r open/rw read rename seek space spaces stat
|
||||
Builtin mtime open/r open/rw read rename seek space spaces stat
|
||||
Builtin tell type type_ write (seek) (argv) (save) 0; 0drop;
|
||||
Builtin >class >lz >name >xt alias alias: appname argc asciiz, asciizl,
|
||||
Builtin body> clamp depth disassemble findprev fnvhash getenv here,
|
||||
Builtin iterate last! last@ later link lz> lzmax os parse/ peek
|
||||
Builtin iterate last! last@ later link lz> lzmax os parse/ peek
|
||||
Builtin peek-n pop prior push put rp@ rpick save setenv slurp
|
||||
Builtin stack-empty? stack-iterate stack-size stack: THROW_BADFUNC
|
||||
Builtin THROW_BADLIB THROW_GENERIC used xt>size z,
|
||||
@@ -88,21 +91,21 @@ Builtin chdir g32 k32 u32 getcwd getpid hinst osname stdin stdout
|
||||
Builtin (-lib) (bye) (call) (else) (find) (func) (here) (if (lib) (s0) (s^)
|
||||
Builtin (to~) (while) >in >rel ?literal appstart cold compiling? context? d0 default_class
|
||||
Builtin defer? dict dolstr dostr find-word h0 if) interp isa onexit
|
||||
Builtin onstartup pdoes pop>ebx prompt rel> rp0 s0 src srcstr state str0 then,> then> tib
|
||||
Builtin onstartup pdoes pop>ebx prompt rel> rp0 s0 src srcstr state str0 then,> then> tib
|
||||
Builtin tp vector vector! word? xt? .ver revaver revaver# && '' 'constant 'context
|
||||
Builtin 'create 'defer 'does 'forth 'inline 'macro 'macront 'notail 'value 'variable
|
||||
Builtin (.r) (context) (create) (header) (hide) (inline) (p.r) (words~) (xfind)
|
||||
Builtin ++ -- , -2drop -2nip -link -swap . .2x .classes .contexts .funcs .libs .needs .r
|
||||
Builtin .rs .x 00; 0do 0if 1, 2, 3, 2* 2/ 2constant 2variable 3dup 4dup ;then >base >defer
|
||||
Builtin >rr ? ?do @execute @rem appdir argv as back base base! between chain cleanup-libs
|
||||
Builtin cmove> context?? ctrl-c ctx>name data: defer: defer@def dictgone do_cr eleave
|
||||
Builtin endcase endof eval exception exec false find func: header heapgone help help/
|
||||
Builtin cmove> context?? ctrl-c ctx>name data: defer: defer@def dictgone do_cr eleave
|
||||
Builtin endcase endof eval exception exec false find func: header heapgone help help/
|
||||
Builtin hex# hide inline{ last lastxt lib libdir literal, makeexename mnotail ms ms@
|
||||
Builtin newclass noop nosavedict notail nul of off on p: padchar parse parseln
|
||||
Builtin parsews rangeof rdepth remains reset reva revaused rol8 rr> scratch setclass sp
|
||||
Builtin newclass noop nosavedict notail nul of off on p: padchar parse parseln
|
||||
Builtin parsews rangeof rdepth remains reset reva revaused rol8 rr> scratch setclass sp
|
||||
Builtin strof super> temp time&date true turnkey? undo vfunc: w! w@
|
||||
Builtin xchg xchg2 xfind xt>name xwords { {{ }} } _+ _1+ _1- pathsep case \||
|
||||
" p[ [''] [ [']
|
||||
" p[ [''] [ [']
|
||||
|
||||
|
||||
" debugging
|
||||
@@ -116,11 +119,11 @@ syn keyword revadebug .s dump see
|
||||
" syn region revaCharOps start=+."\s+ skip=+\\"+ end=+"+
|
||||
|
||||
" char-number conversion
|
||||
syn keyword revaconversion s>d >digit digit> >single >double >number >float
|
||||
syn keyword revaconversion s>d >digit digit> >single >double >number >float
|
||||
|
||||
" contexts
|
||||
syn keyword revavocs forth macro inline
|
||||
syn keyword revavocs context:
|
||||
syn keyword revavocs forth macro inline
|
||||
syn keyword revavocs context:
|
||||
syn match revavocs /\<\~[^~ ]*/
|
||||
syn match revavocs /[^~ ]*\~\>/
|
||||
|
||||
@@ -135,7 +138,7 @@ syn match revainteger "\<'.\>"
|
||||
|
||||
" Strings
|
||||
" syn region revaString start=+\.\?\"+ end=+"+ end=+$+
|
||||
syn region revaString start=/"/ skip=/\\"/ end=/"/
|
||||
syn region revaString start=/"/ skip=/\\"/ end=/"/
|
||||
|
||||
" Comments
|
||||
syn region revaComment start='\\S\s' end='.*' contains=revaTodo
|
||||
@@ -187,5 +190,7 @@ if !exists("did_reva_syntax_inits")
|
||||
endif
|
||||
|
||||
let b:current_syntax = "reva"
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: ts=8:sw=4:nocindent:smartindent:
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
" Vim syntax file
|
||||
" Language: Scheme (R5RS + some R6RS extras)
|
||||
" Last Change: 2009 Nov 27
|
||||
" Last Change: 2012 Feb 04
|
||||
" Maintainer: Sergey Khorev <sergey.khorev@gmail.com>
|
||||
" Original author: Dirk van Deun <dirk@igwe.vub.ac.be>
|
||||
|
||||
" This script incorrectly recognizes some junk input as numerals:
|
||||
" parsing the complete system of Scheme numerals using the pattern
|
||||
" language is practically impossible: I did a lax approximation.
|
||||
|
||||
|
||||
" MzScheme extensions can be activated with setting is_mzscheme variable
|
||||
|
||||
" Suggestions and bug reports are solicited by the author.
|
||||
@@ -22,6 +22,9 @@ elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
syn case ignore
|
||||
|
||||
" Fascist highlighting: everything that doesn't fit the rules is an error...
|
||||
@@ -117,7 +120,7 @@ syn keyword schemeFunc hashtable? hashtable-size hashtable-ref hashtable-set!
|
||||
syn keyword schemeFunc hashtable-delete! hashtable-contains? hashtable-update!
|
||||
syn keyword schemeFunc hashtable-copy hashtable-clear! hashtable-keys
|
||||
syn keyword schemeFunc hashtable-entries hashtable-equivalence-function hashtable-hash-function
|
||||
syn keyword schemeFunc hashtable-mutable? equal-hash string-hash string-ci-hash symbol-hash
|
||||
syn keyword schemeFunc hashtable-mutable? equal-hash string-hash string-ci-hash symbol-hash
|
||||
syn keyword schemeFunc find for-all exists filter partition fold-left fold-right
|
||||
syn keyword schemeFunc remp remove remv remq memp assp cons*
|
||||
|
||||
@@ -207,7 +210,7 @@ if exists("b:is_mzscheme") || exists("is_mzscheme")
|
||||
syn keyword schemeExtSyntax free-identifier=? bound-identifier=? module-identifier=? syntax-object->datum
|
||||
syn keyword schemeExtSyntax datum->syntax-object
|
||||
syn keyword schemeExtSyntax let-values let*-values letrec-values set!-values fluid-let parameterize begin0
|
||||
syn keyword schemeExtSyntax error raise opt-lambda define-values unit unit/sig define-signature
|
||||
syn keyword schemeExtSyntax error raise opt-lambda define-values unit unit/sig define-signature
|
||||
syn keyword schemeExtSyntax invoke-unit/sig define-values/invoke-unit/sig compound-unit/sig import export
|
||||
syn keyword schemeExtSyntax link syntax quasisyntax unsyntax with-syntax
|
||||
|
||||
@@ -231,7 +234,7 @@ if exists("b:is_mzscheme") || exists("is_mzscheme")
|
||||
syn keyword schemeExtFunc exn:i/o:tcp? exn:i/o:udp? exn:misc? exn:misc:application? exn:misc:unsupported? exn:module? exn:read? exn:read:non-char?
|
||||
syn keyword schemeExtFunc exn:special-comment? exn:syntax? exn:thread? exn:user? exn:variable? exn:application:mismatch?
|
||||
" Command-line parsing
|
||||
syn keyword schemeExtFunc command-line current-command-line-arguments once-any help-labels multi once-each
|
||||
syn keyword schemeExtFunc command-line current-command-line-arguments once-any help-labels multi once-each
|
||||
|
||||
" syntax quoting, unquoting and quasiquotation
|
||||
syn region schemeUnquote matchgroup=Delimiter start="#," end=![ \t\[\]()";]!me=e-1 contains=ALL
|
||||
@@ -263,7 +266,7 @@ if exists("b:is_chicken") || exists("is_chicken")
|
||||
|
||||
" here-string
|
||||
syn region schemeString start=+#<<\s*\z(.*\)+ end=+^\z1$+
|
||||
|
||||
|
||||
if filereadable(expand("<sfile>:p:h")."/cpp.vim")
|
||||
unlet! b:current_syntax
|
||||
syn include @ChickenC <sfile>:p:h/cpp.vim
|
||||
@@ -282,7 +285,7 @@ if exists("b:is_chicken") || exists("is_chicken")
|
||||
|
||||
" suggested by Alex Queiroz
|
||||
syn match schemeExtSyntax "#![-a-z!$%&*/:<=>?^_~0-9+.@#%]\+"
|
||||
syn region schemeString start=+#<#\s*\z(.*\)+ end=+^\z1$+
|
||||
syn region schemeString start=+#<#\s*\z(.*\)+ end=+^\z1$+
|
||||
endif
|
||||
|
||||
" Synchronization and the wrapping up...
|
||||
@@ -322,3 +325,6 @@ if version >= 508 || !exists("did_scheme_syntax_inits")
|
||||
endif
|
||||
|
||||
let b:current_syntax = "scheme"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
"SiSU Vim syntax file
|
||||
"SiSU Maintainer: Ralph Amissah <ralph@amissah.com>
|
||||
"SiSU Markup: SiSU (sisu-2.0.1, 2010-03-17)
|
||||
" SiSU Vim syntax file
|
||||
" SiSU Maintainer: Ralph Amissah <ralph@amissah.com>
|
||||
" SiSU Markup: SiSU (sisu-3.1.0)
|
||||
" Last Change: 2011-10-03
|
||||
" URL: <http://git.sisudoc.org/?p=code/sisu.git;a=blob;f=data/sisu/v3/conf/editor-syntax-etc/vim/syntax/sisu.vim;hb=HEAD>
|
||||
"(originally looked at Ruby Vim by Mirko Nasato)
|
||||
|
||||
if version < 600
|
||||
@@ -9,15 +11,23 @@ elseif exists("b:current_syntax")
|
||||
finish
|
||||
else
|
||||
endif
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" Errors:
|
||||
"% "Errors:
|
||||
syn match sisu_error contains=sisu_link,sisu_error_wspace "<![^ei]\S\+!>"
|
||||
|
||||
" Markers Identifiers:
|
||||
"% "Markers Identifiers:
|
||||
if !exists("sisu_no_identifiers")
|
||||
syn match sisu_mark_endnote "\~^"
|
||||
syn match sisu_break contains=@NoSpell " \\\\\( \|$\)"
|
||||
syn match sisu_break contains=@NoSpell "<br>\|<br />"
|
||||
syn match sisu_control contains=@NoSpell "<:p[bn]>"
|
||||
syn match sisu_control contains=@NoSpell "^<:p[bn]>\s*$"
|
||||
"syn match sisu_control contains=@NoSpell "^<\(br\)\?:\(pg\|pgn\|pn\)>\s*$"
|
||||
"syn match sisu_control contains=@NoSpell "^\[\(br\)\?:\(pg\|pgn\|pn\)\]\s*$"
|
||||
syn match sisu_control contains=@NoSpell "^<:\(bo\|---\)>\s*$"
|
||||
"syn match sisu_control contains=@NoSpell "^<\(br\)\?:\(pr\|o\)>\s*$"
|
||||
"syn match sisu_control contains=@NoSpell "^\[\(br\)\?:\(pr\|o\)\]\s*$"
|
||||
syn match sisu_marktail "[~-]#"
|
||||
syn match sisu_control "\""
|
||||
syn match sisu_underline "\(^\| \)_[a-zA-Z0-9]\+_\([ .,]\|$\)"
|
||||
@@ -28,14 +38,18 @@ if !exists("sisu_no_identifiers")
|
||||
syn match sisu_require contains=@NoSpell "^<<\s*[a-zA-Z0-9^._-]\+\.ss[it]$"
|
||||
syn match sisu_require contains=@NoSpell "^<<{[a-zA-Z0-9^._-]\+\.ss[it]}$"
|
||||
syn match sisu_structure "^:A\~$"
|
||||
syn match sisu_sub_header_title "^\s\+:\(subtitle\|short\|edition\|language\|note\):\s" "group=sisu_header_content
|
||||
syn match sisu_sub_header_creator "^\s\+:\(author\|translator\|illustrator\|photographer\|audio\|digitized_by\|prepared_by\):\s"
|
||||
syn match sisu_sub_header_rights "^\s\+:\(copyright\|text\|translation\|illustrations\|photographs\|audio\|digitization\|license\|all\):\s" "access_rights license
|
||||
syn match sisu_sub_header_classify "^\s\+:\(type\|subject\|topic_register\|keywords\|coverage\|relation\|format\|identifier\|isbn\|dewey\|loc\|pg\):\s"
|
||||
syn match sisu_sub_header_dates "^\s\+:\(published\|available\|created\|issued\|valid\|modified\|added_to_site\|translated\|original_publication\):\s"
|
||||
syn match sisu_sub_header_original "^\s\+:\(publisher\|date\|language\|institution\|nationality\|source\):\s"
|
||||
syn match sisu_sub_header_make "^\s\+:\(headings\|num_top\|breaks\|italics\|bold\|skin\|stamp\|promo\|ad\|manpage\):\s"
|
||||
syn match sisu_sub_header_notes "^\s\+:\(comment\|abstract\|description\|history\|prefix\|prefix_[ab]\):\s"
|
||||
|
||||
"% "Document Sub Headers:
|
||||
syn match sisu_sub_header_title "^\s\+:\(subtitle\|short\|edition\|language\|lang_char\|note\):\s" "group=sisu_header_content
|
||||
syn match sisu_sub_header_creator "^\s\+:\(author\|editor\|contributor\|illustrator\|photographer\|translator\|digitized_by\|prepared_by\|audio\|video\):\s" " &hon &institution
|
||||
syn match sisu_sub_header_rights "^\s\+:\(copyright\|text\|translation\|illustrations\|photographs\|preparation\|digitization\|audio\|video\|license\|all\):\s" " access_rights license
|
||||
syn match sisu_sub_header_classify "^\s\+:\(topic_register\|coverage\|format\|identifier\|keywords\|relation\|subject\|type\|dewey\|loc\|oclc\|pg\|isbn\):\s"
|
||||
syn match sisu_sub_header_date "^\s\+:\(added_to_site\|available\|created\|issued\|modified\|published\|valid\|translated\|original_publication\):\s"
|
||||
syn match sisu_sub_header_original "^\s\+:\(publisher\|date\|language\|lang_char\|institution\|nationality\|source\):\s"
|
||||
syn match sisu_sub_header_make "^\s\+:\(headings\|num_top\|breaks\|language\|italics\|bold\|emphasis\|plaintext_wrap\|texpdf_font_mono\|texpdf_font\|skin\|stamp\|promo\|ad\|manpage\):\s"
|
||||
syn match sisu_sub_header_notes "^\s\+:\(abstract\|comment\|description\|history\|prefix\|prefix_[ab]\|suffix\):\s"
|
||||
|
||||
"% "semantic markers: (ignore)
|
||||
syn match sisu_sem_marker ";{\|};[a-z._]*[a-z]"
|
||||
syn match sisu_sem_marker_block "\([a-z][a-z._]*\|\):{\|}:[a-z._]*[a-z]"
|
||||
syn match sisu_sem_ex_marker ";\[\|\];[a-z._]*[a-z]"
|
||||
@@ -46,80 +60,126 @@ if !exists("sisu_no_identifiers")
|
||||
syn match sisu_sem_ex_content contains=sisu_error,sisu_error_wspace,sisu_content_alt,sisu_link,sisu_linked,sisu_break,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker ";\[[^}].\{-}\];[a-z]\+"
|
||||
endif
|
||||
|
||||
"URLs Numbers And ASCII Codes:
|
||||
"% "URLs Numbers And ASCII Codes:
|
||||
syn match sisu_number "\<\(0x\x\+\|0b[01]\+\|0\o\+\|0\.\d\+\|0\|[1-9][\.0-9_]*\)\>"
|
||||
syn match sisu_number "?\(\\M-\\C-\|\\c\|\\C-\|\\M-\)\=\(\\\o\{3}\|\\x\x\{2}\|\\\=\w\)"
|
||||
|
||||
"Tuned Error: (is error if not already matched)
|
||||
"% "Tuned Error: (is error if not already matched)
|
||||
syn match sisu_error contains=sisu_error "[\~/\*!_]{\|}[\~/\*!_]"
|
||||
syn match sisu_error contains=sisu_error "<a href\|</a>]"
|
||||
|
||||
"Simple Paired Enclosed Markup:
|
||||
"% "Simple Paired Enclosed Markup:
|
||||
"url/link
|
||||
syn region sisu_link contains=sisu_error,sisu_error_wspace matchgroup=sisu_action start="^<<\s*|[a-zA-Z0-9^._-]\+|@|[a-zA-Z0-9^._-]\+|"rs=s+2 end="$"
|
||||
"header
|
||||
|
||||
"% "Document Header:
|
||||
" title
|
||||
syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_title matchgroup=sisu_header start="^[@]title:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$"
|
||||
" creator
|
||||
syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_creator matchgroup=sisu_header start="^[@]creator:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$"
|
||||
syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_rights matchgroup=sisu_header start="^[@]rights:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$"
|
||||
syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_classify matchgroup=sisu_header start="^[@]classify:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$"
|
||||
syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_dates matchgroup=sisu_header start="^[@]date:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$"
|
||||
syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_make matchgroup=sisu_header start="^[@]make:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$"
|
||||
" dates
|
||||
syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_date matchgroup=sisu_header start="^[@]date:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$"
|
||||
" publisher
|
||||
syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_publisher matchgroup=sisu_header start="^[@]publisher:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$"
|
||||
syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_notes matchgroup=sisu_header start="^[@]notes:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$"
|
||||
" rights
|
||||
syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_rights matchgroup=sisu_header start="^[@]rights:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$"
|
||||
" classify document
|
||||
syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_classify matchgroup=sisu_header start="^[@]classify:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$"
|
||||
" original language (depreciated)
|
||||
syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_original matchgroup=sisu_header start="^[@]original:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$"
|
||||
syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_source matchgroup=sisu_header start="^[@]source:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$"
|
||||
" notes
|
||||
syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_notes matchgroup=sisu_header start="^[@]notes:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$"
|
||||
" links of interest
|
||||
syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_linked,sisu_sub_header_links matchgroup=sisu_header start="^[@]links:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$"
|
||||
"headings
|
||||
syn region sisu_heading contains=sisu_mark_endnote,sisu_content_endnote,sisu_marktail,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_ocn,sisu_error,sisu_error_wspace matchgroup=sisu_structure start="^\([1-8]\|:\?[A-C]\)\~\(\S\+\|[^-]\)" end="$"
|
||||
"grouped text
|
||||
syn region sisu_content_alt contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^table{.\+" end="}table"
|
||||
syn region sisu_content_alt contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^{\(t\|table\)\(\~h\)\?\(\sc[0-9]\+;\)\?[0-9; ]*}" end="\n$"
|
||||
syn region sisu_content_alt contains=sisu_mark_endnote,sisu_content_endnote,sisu_link,sisu_mark,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^\(alt\|group\|poem\){" end="^}\(alt\|group\|poem\)"
|
||||
" make, processing instructions
|
||||
syn region sisu_header_content contains=sisu_error,sisu_comment,sisu_break,sisu_link,sisu_sub_header_make matchgroup=sisu_header start="^[@]make:[+-]\?\(\s\|\n\)"rs=e-1 end="\n$"
|
||||
|
||||
"% "Headings:
|
||||
syn region sisu_heading contains=sisu_mark_endnote,sisu_content_endnote,sisu_marktail,sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_ocn,sisu_error,sisu_error_wspace matchgroup=sisu_structure start="^\([1-8]\|:\?[A-C]\)\~\(\S\+\|[^-]\)" end="$"
|
||||
|
||||
"% "Block Group Text:
|
||||
" table
|
||||
syn region sisu_content_alt contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^table{.\+" end="}table"
|
||||
" table
|
||||
syn region sisu_content_alt contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^{\(t\|table\)\(\~h\)\?\(\sc[0-9]\+;\)\?[0-9; ]*}" end="\n$"
|
||||
" block, group, poem, alt
|
||||
syn region sisu_content_alt contains=sisu_mark_endnote,sisu_content_endnote,sisu_link,sisu_mark,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_contain start="^\(block\|group\|poem\|alt\){" end="^}\(block\|group\|poem\|alt\)"
|
||||
" code
|
||||
syn region sisu_content_alt contains=sisu_error matchgroup=sisu_contain start="^code{" end="^}code"
|
||||
"endnotes
|
||||
syn region sisu_content_endnote contains=sisu_link,sisu_strikeout,sisu_underline,sisu_number,sisu_control,sisu_identifier,sisu_error,sisu_error_wspace,sisu_mark,sisu_break,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker matchgroup=sisu_mark_endnote start="\~{[*+]*" end="}\~" skip="\n"
|
||||
syn region sisu_content_endnote contains=sisu_link,sisu_strikeout,sisu_underline,sisu_number,sisu_control,sisu_identifier,sisu_error,sisu_error_wspace,sisu_mark,sisu_break,sisu_sem_block,sisu_sem_content,sisu_sem_marker matchgroup=sisu_mark_endnote start="\~\[[*+]*" end="\]\~" skip="\n"
|
||||
syn region sisu_content_endnote contains=sisu_strikeout,sisu_number,sisu_control,sisu_link,sisu_identifier,sisu_error,sisu_error_wspace,sisu_mark,sisu_break matchgroup=sisu_mark_endnote start="\^\~" end="\n$"
|
||||
"links and images
|
||||
syn region sisu_linked contains=sisu_fontface,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker,sisu_sem_block,sisu_error matchgroup=sisu_link start="{\(\~^\s\)\?" end="}\(https\?:/\/\|\.\./\)\S\+" oneline
|
||||
syn region sisu_linked contains=sisu_fontface,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker,sisu_sem_block,sisu_error matchgroup=sisu_link start="{\(\~^\s\)\?" end="\[[1-5][sS]*\]}\S\+\.ss[tm]" oneline
|
||||
syn region sisu_linked contains=sisu_fontface,sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_link start="{" end="}image" oneline
|
||||
"some line operations
|
||||
syn region sisu_control contains=sisu_strikeout,sisu_identifier,sisu_content_endnote,sisu_mark_endnote,sisu_error,sisu_error_wspace matchgroup=sisu_control start="\(\(^\| \)!_ \|<:b>\)" end="$"
|
||||
syn region sisu_normal contains=sisu_strikeout,sisu_identifier,sisu_content_endnote,sisu_mark_endnote,sisu_link,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker,sisu_linked,sisu_error,sisu_error_wspace matchgroup=sisu_markpara start="^_\([1-9*]\|[1-9]\*\) " end="$"
|
||||
|
||||
"% "Endnotes:
|
||||
" regular endnote or asterisk or plus sign endnote
|
||||
syn region sisu_content_endnote contains=sisu_link,sisu_strikeout,sisu_underline,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error,sisu_error_wspace,sisu_mark,sisu_break,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker matchgroup=sisu_mark_endnote start="\~{[*+]*" end="}\~" skip="\n"
|
||||
" numbered asterisk or plus sign endnote
|
||||
syn region sisu_content_endnote contains=sisu_link,sisu_strikeout,sisu_underline,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error,sisu_error_wspace,sisu_mark,sisu_break,sisu_sem_block,sisu_sem_content,sisu_sem_marker matchgroup=sisu_mark_endnote start="\~\[[*+]*" end="\]\~" skip="\n"
|
||||
" endnote content marker (for binary content marking)
|
||||
syn region sisu_content_endnote contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_link,sisu_identifier,sisu_error,sisu_error_wspace,sisu_mark,sisu_break matchgroup=sisu_mark_endnote start="\^\~" end="\n$"
|
||||
|
||||
"% "Links And Images:
|
||||
" image with url link (and possibly footnote of url)
|
||||
syn region sisu_linked contains=sisu_fontface,sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker,sisu_sem_block,sisu_error matchgroup=sisu_link start="{\(\~^\s\)\?" end="}\(https\?:/\/\|:\|\.\.\/\|#\)\S\+" oneline
|
||||
" sisu outputs, short notation
|
||||
syn region sisu_linked contains=sisu_fontface,sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker,sisu_sem_block,sisu_error matchgroup=sisu_link start="{\(\~^\s\)\?" end="\[[1-5][sS]*\]}\S\+\.ss[tm]" oneline
|
||||
" image
|
||||
syn region sisu_linked contains=sisu_fontface,sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_link start="{" end="}image" oneline
|
||||
|
||||
"% "Some Line Operations:
|
||||
" bold line
|
||||
syn region sisu_bold contains=sisu_strikeout,sisu_identifier,sisu_content_endnote,sisu_mark_endnote,sisu_error,sisu_error_wspace matchgroup=sisu_markpara start="^!_ " end=" \\\\\|$"
|
||||
" indent and bullet paragraph
|
||||
syn region sisu_normal contains=sisu_fontface,sisu_bold,sisu_control,sisu_identifier,sisu_content_endnote,sisu_mark_endnote,sisu_link,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker,sisu_linked,sisu_error,sisu_error_wspace matchgroup=sisu_markpara start="^_\([1-9*]\|[1-9]\*\) " end="$"
|
||||
" indent and bullet (bold start) paragraph
|
||||
syn region sisu_bold contains=sisu_fontface,sisu_bold,sisu_control,sisu_identifier,sisu_content_endnote,sisu_mark_endnote,sisu_link,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker,sisu_linked,sisu_error,sisu_error_wspace matchgroup=sisu_markpara start="^_\([1-9*]\|[1-9]\*\)!_\? " end=" \\\\\|$"
|
||||
" hanging indent paragraph [proposed]
|
||||
syn region sisu_normal contains=sisu_fontface,sisu_bold,sisu_control,sisu_identifier,sisu_content_endnote,sisu_mark_endnote,sisu_link,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker,sisu_linked,sisu_error,sisu_error_wspace matchgroup=sisu_markpara start="^_[0-9]\?_[0-9] " end="$"
|
||||
" hanging indent (bold start/ definition) paragraph [proposed]
|
||||
syn region sisu_bold contains=sisu_fontface,sisu_bold,sisu_control,sisu_identifier,sisu_content_endnote,sisu_mark_endnote,sisu_link,sisu_sem_block,sisu_sem_content,sisu_sem_marker_block,sisu_sem_marker,sisu_sem_ex_marker_block,sisu_sem_ex_marker,sisu_linked,sisu_error,sisu_error_wspace matchgroup=sisu_markpara start="^_[0-9]\?_[0-9]!_\? " end=" \\\\\|$"
|
||||
" list numbering
|
||||
syn region sisu_normal contains=sisu_strikeout,sisu_identifier,sisu_content_endnote,sisu_mark_endnote,sisu_link,sisu_linked,sisu_error,sisu_error_wspace matchgroup=sisu_markpara start="^\(#[ 1]\|_# \)" end="$"
|
||||
"font face curly brackets
|
||||
|
||||
"% "Font Face Curly Brackets:
|
||||
"syn region sisu_identifier contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_sem start="\S\+:{" end="}:[^<>,.!?:; ]\+" oneline
|
||||
" book index:
|
||||
syn region sisu_index matchgroup=sisu_index_block start="^={" end="}"
|
||||
syn region sisu_control contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="\*{" end="}\*"
|
||||
syn region sisu_control contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="!{" end="}!"
|
||||
syn region sisu_underline contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="_{" end="}_"
|
||||
syn region sisu_identifier contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="/{" end="}/"
|
||||
syn region sisu_underline contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="+{" end="}+"
|
||||
syn region sisu_identifier contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="\^{" end="}\^"
|
||||
syn region sisu_identifier contains=sisu_strikeout,sisu_number,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start=",{" end="},"
|
||||
" emphasis:
|
||||
syn region sisu_bold contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="\*{" end="}\*"
|
||||
" bold:
|
||||
syn region sisu_bold contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="!{" end="}!"
|
||||
" underscore:
|
||||
syn region sisu_underline contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="_{" end="}_"
|
||||
" italics:
|
||||
syn region sisu_identifier contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="/{" end="}/"
|
||||
" added:
|
||||
syn region sisu_underline contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="+{" end="}+"
|
||||
" superscript:
|
||||
syn region sisu_identifier contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="\^{" end="}\^"
|
||||
" subscript:
|
||||
syn region sisu_identifier contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start=",{" end="},"
|
||||
" monospace:
|
||||
syn region sisu_identifier contains=sisu_strikeout,sisu_number,sisu_bold,sisu_control,sisu_identifier,sisu_error matchgroup=sisu_fontface start="#{" end="}#"
|
||||
" strikethrough:
|
||||
syn region sisu_strikeout contains=sisu_error matchgroup=sisu_fontface start="-{" end="}-"
|
||||
syn region sisu_html contains=sisu_error contains=sisu_strikeout matchgroup=sisu_contain start="<a href=\".\{-}\">" end="</a>" oneline
|
||||
"single words bold italicise etc. "workon
|
||||
syn region sisu_control contains=sisu_error matchgroup=sisu_control start="\([ (]\|^\)\*[^\|{\n\~\\]"hs=e-1 end="\*"he=e-0 skip="[a-zA-Z0-9']" oneline
|
||||
|
||||
"% "Single Words Bold Italicise Etc: (depreciated)
|
||||
syn region sisu_bold contains=sisu_error matchgroup=sisu_bold start="\([ (]\|^\)\*[^\|{\n\~\\]"hs=e-1 end="\*"he=e-0 skip="[a-zA-Z0-9']" oneline
|
||||
syn region sisu_identifier contains=sisu_error matchgroup=sisu_content_alt start="\([ ]\|^\)/[^{ \|\n\\]"hs=e-1 end="/\[ \.\]" skip="[a-zA-Z0-9']" oneline
|
||||
"misc
|
||||
syn region sisu_identifier contains=sisu_error matchgroup=sisu_fontface start="\^[^ {\|\n\\]"rs=s+1 end="\^[ ,.;:'})\\\n]" skip="[a-zA-Z0-9']" oneline
|
||||
|
||||
"Expensive Mode:
|
||||
"% "Expensive Mode:
|
||||
if !exists("sisu_no_expensive")
|
||||
else " not Expensive
|
||||
syn region sisu_content_alt matchgroup=sisu_control start="^\s*def\s" matchgroup=NONE end="[?!]\|\>" skip="\.\|\(::\)" oneline
|
||||
endif " Expensive?
|
||||
|
||||
"Headers And Headings: (Document Instructions)
|
||||
"% "Headers And Headings: (Document Instructions)
|
||||
syn match sisu_control contains=sisu_error,sisu_error_wspace "4\~! \S\+"
|
||||
syn region sisu_markpara contains=sisu_error,sisu_error_wspace start="^=begin" end="^=end.*$"
|
||||
|
||||
"Errors:
|
||||
"% "Errors:
|
||||
syn match sisu_error_wspace contains=sisu_error_wspace "^\s\+[^:]"
|
||||
syn match sisu_error_wspace contains=sisu_error_wspace "\s\s\+"
|
||||
syn match sisu_error_wspace contains=sisu_error_wspace " \s*$"
|
||||
syn match sisu_error_wspace contains=sisu_error_wspace "\s\+$"
|
||||
syn match sisu_error contains=sisu_error_wspace "\t\+"
|
||||
syn match sisu_error contains=sisu_error,sisu_error_wspace "\([^ (][_\\]\||[^ (}]\)https\?:\S\+"
|
||||
syn match sisu_error contains=sisu_error "_\?https\?:\S\+[}><]"
|
||||
@@ -140,37 +200,37 @@ syn match sisu_error contains=sisu_error "<dir>"
|
||||
syn match sisu_error contains=sisu_error,sisu_match,sisu_strikeout,sisu_contain,sisu_content_alt,sisu_mark,sisu_break,sisu_number "<[a-zA-Z\/]\+>"
|
||||
syn match sisu_error "/\?<\([biu]\)>[^(</\1>)]\{-}\n$"
|
||||
|
||||
"Error Exceptions:
|
||||
"% "Error Exceptions:
|
||||
syn match sisu_control "\n$" "contains=ALL
|
||||
syn match sisu_control " //"
|
||||
"syn match sisu_control " //"
|
||||
syn match sisu_error "%{"
|
||||
syn match sisu_error "<br>_\?https\?:\S\+\|_\?https\?:\S\+<br>"
|
||||
syn match sisu_error "[><]_\?https\?:\S\+\|_\?https\?:\S\+[><]"
|
||||
syn match sisu_comment "^%\{1,2\}.\+"
|
||||
|
||||
"Definitions Default Highlighting:
|
||||
"% "Definitions Default Highlighting:
|
||||
hi def link sisu_normal Normal
|
||||
hi def link sisu_bold Statement
|
||||
hi def link sisu_header PreProc
|
||||
hi def link sisu_header_content Normal
|
||||
hi def link sisu_sub_header_title Statement
|
||||
hi def link sisu_sub_header_creator Statement
|
||||
hi def link sisu_sub_header_date Statement
|
||||
hi def link sisu_sub_header_publisher Statement
|
||||
hi def link sisu_sub_header_rights Statement
|
||||
hi def link sisu_sub_header_classify Statement
|
||||
hi def link sisu_sub_header_dates Statement
|
||||
hi def link sisu_sub_header_make Statement
|
||||
hi def link sisu_sub_header_links Statement
|
||||
hi def link sisu_sub_header_publisher Statement
|
||||
hi def link sisu_sub_header_notes Statement
|
||||
hi def link sisu_sub_header_original Statement
|
||||
hi def link sisu_sub_header_source Statement
|
||||
hi def link sisu_sub_header_links Statement
|
||||
hi def link sisu_sub_header_notes Statement
|
||||
hi def link sisu_sub_header_make Statement
|
||||
hi def link sisu_heading Title
|
||||
hi def link sisu_structure Operator
|
||||
hi def link sisu_contain Include
|
||||
hi def link sisu_mark_endnote Include
|
||||
hi def link sisu_mark_endnote Delimiter
|
||||
hi def link sisu_require NonText
|
||||
hi def link sisu_link NonText
|
||||
hi def link sisu_linked String
|
||||
hi def link sisu_fontface Include
|
||||
hi def link sisu_fontface Delimiter
|
||||
hi def link sisu_strikeout DiffDelete
|
||||
hi def link sisu_content_alt Special
|
||||
hi def link sisu_sem_content SpecialKey
|
||||
@@ -186,7 +246,7 @@ hi def link sisu_sem_ex_block Comment
|
||||
hi def link sisu_index SpecialKey
|
||||
hi def link sisu_index_block Visual
|
||||
hi def link sisu_content_endnote Special
|
||||
hi def link sisu_control Define
|
||||
hi def link sisu_control Delimiter
|
||||
hi def link sisu_ocn Include
|
||||
hi def link sisu_number Number
|
||||
hi def link sisu_identifier Function
|
||||
@@ -202,3 +262,5 @@ hi def link sisu_error_sem_marker Error
|
||||
hi def link sisu_error_wspace Error
|
||||
hi def link sisu_error Error
|
||||
let b:current_syntax = "sisu"
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
@@ -2,9 +2,7 @@
|
||||
" Language: OpenSSH client configuration file (ssh_config)
|
||||
" Author: David Necas (Yeti)
|
||||
" Maintainer: Leonard Ehrenfried <leonard.ehrenfried@web.de>
|
||||
" Modified By: Thilo Six
|
||||
" Originally: 2009-07-09
|
||||
" Last Change: 2011 Oct 31
|
||||
" Last Change: 2012 Feb 19
|
||||
" SSH Version: 5.9p1
|
||||
"
|
||||
|
||||
@@ -92,7 +90,8 @@ syn match sshconfigNumber "\d\+"
|
||||
syn match sshconfigHostPort "\<\(\d\{1,3}\.\)\{3}\d\{1,3}\(:\d\+\)\?\>"
|
||||
syn match sshconfigHostPort "\<\([-a-zA-Z0-9]\+\.\)\+[-a-zA-Z0-9]\{2,}\(:\d\+\)\?\>"
|
||||
syn match sshconfigHostPort "\<\(\x\{,4}:\)\+\x\{,4}[:/]\d\+\>"
|
||||
|
||||
syn match sshconfigHostPort "\(Host \)\@<=.\+"
|
||||
syn match sshconfigHostPort "\(HostName \)\@<=.\+"
|
||||
|
||||
" case off
|
||||
syn case ignore
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: Smalltalk
|
||||
" Maintainer: Arndt Hesse <hesse@self.de>
|
||||
" Last Change: 2001 May 09
|
||||
" Last Change: 2012 Feb 12 by Thilo Six
|
||||
|
||||
" For version 5.x: Clear all syntax items
|
||||
" For version 6.x: Quit when a syntax file was already loaded
|
||||
@@ -11,6 +11,9 @@ elseif exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
" some Smalltalk keywords and standard methods
|
||||
syn keyword stKeyword super self class true false new not
|
||||
syn keyword stKeyword notNil isNil inspect out nil
|
||||
@@ -100,3 +103,6 @@ if version >= 508 || !exists("did_st_syntax_inits")
|
||||
endif
|
||||
|
||||
let b:current_syntax = "st"
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
" Vim syntax file
|
||||
" Language: Subversion (svn) commit file
|
||||
" Maintainer: Dmitry Vasiliev <dima at hlabs dot spb dot ru>
|
||||
" URL: http://www.hlabs.spb.ru/vim/svn.vim
|
||||
" Revision: $Id: svn.vim 683 2008-07-30 11:52:38Z hdima $
|
||||
" Maintainer: Dmitry Vasiliev <dima at hlabs dot org>
|
||||
" URL: https://github.com/hdima/vim-scripts/blob/master/syntax/svn.vim
|
||||
" Last Change: 2012-02-11
|
||||
" Filenames: svn-commit*.tmp
|
||||
" Version: 1.6
|
||||
" Version: 1.7
|
||||
|
||||
" Contributors:
|
||||
" Stefano Zacchiroli
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
" Vim syntax support file
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2010 Aug 08
|
||||
" Last Change: 2012 Feb 11
|
||||
|
||||
" This file sets up for syntax highlighting.
|
||||
" It is loaded from "syntax.vim" and "manual.vim".
|
||||
@@ -59,7 +59,7 @@ endfun
|
||||
|
||||
|
||||
" Handle adding doxygen to other languages (C, C++, C#, IDL)
|
||||
au Syntax c,cpp,cs,idl
|
||||
au Syntax c,cpp,cs,idl,php
|
||||
\ if (exists('b:load_doxygen_syntax') && b:load_doxygen_syntax)
|
||||
\ || (exists('g:load_doxygen_syntax') && g:load_doxygen_syntax)
|
||||
\ | runtime! syntax/doxygen.vim
|
||||
|
||||
@@ -239,6 +239,12 @@ If you are dismayed by how big the EXE is, I strongly recommend you get 'UPX'
|
||||
found at
|
||||
http://www.upx.org/
|
||||
|
||||
As of 2011, UPX still does not support compressing 64-bit EXE's; if you have
|
||||
built a 64-bit vim then an alternative to UPX is 'MPRESS'. MPRESS can be found
|
||||
at:
|
||||
http://www.matcode.com/mpress.htm
|
||||
|
||||
|
||||
ADDITION: NLS support with MinGW
|
||||
|
||||
(by Eduardo F. Amatria <eferna1@platea.pntic.mec.es>)
|
||||
|
||||
@@ -14,9 +14,11 @@
|
||||
# it's just run out of memory or something. Run again, and it will continue
|
||||
# with 'xxd'.
|
||||
#
|
||||
# "make upx" makes *compressed* versions of the GUI and console EXEs, using the
|
||||
# excellent UPX compressor:
|
||||
# "make upx" makes *compressed* versions of the 32 bit GUI and console EXEs,
|
||||
# using the excellent UPX compressor:
|
||||
# http://upx.sourceforge.net/
|
||||
# "make mpress" uses the MPRESS compressor for 32- and 64-bit EXEs:
|
||||
# http://www.matcode.com/mpress.htm
|
||||
#
|
||||
# Maintained by Ron Aaron <ronaharon@yahoo.com>
|
||||
# updated 2003 Jan 20
|
||||
@@ -640,6 +642,10 @@ upx: exes
|
||||
upx gvim.exe
|
||||
upx vim.exe
|
||||
|
||||
mpress: exes
|
||||
mpress gvim.exe
|
||||
mpress vim.exe
|
||||
|
||||
xxd/xxd.exe: xxd/xxd.c
|
||||
$(MAKE) -C xxd -f Make_ming.mak CC=$(CC)
|
||||
|
||||
|
||||
@@ -616,7 +616,7 @@ CFLAGS = $(CFLAGS) -DFEAT_TCL -DDYNAMIC_TCL -DDYNAMIC_TCL_DLL=\"$(TCL_DLL)\" \
|
||||
-DDYNAMIC_TCL_VER=\"$(TCL_VER_LONG)\"
|
||||
TCL_OBJ = $(OUTDIR)\if_tcl.obj
|
||||
TCL_INC = /I "$(TCL)\Include" /I "$(TCL)"
|
||||
TCL_LIB = $(TCL)\lib\tclstub$(TCL_VER).lib
|
||||
TCL_LIB = "$(TCL)\lib\tclstub$(TCL_VER).lib"
|
||||
!else
|
||||
CFLAGS = $(CFLAGS) -DFEAT_TCL
|
||||
TCL_OBJ = $(OUTDIR)\if_tcl.obj
|
||||
|
||||
128
src/buffer.c
128
src/buffer.c
@@ -64,6 +64,9 @@ static void buf_delete_signs __ARGS((buf_T *buf));
|
||||
static char *msg_loclist = N_("[Location List]");
|
||||
static char *msg_qflist = N_("[Quickfix List]");
|
||||
#endif
|
||||
#ifdef FEAT_AUTOCMD
|
||||
static char *e_auabort = N_("E855: Autocommands caused command to abort");
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Open current buffer, that is: open the memfile and read the file into
|
||||
@@ -96,7 +99,7 @@ open_buffer(read_stdin, eap, flags)
|
||||
* There MUST be a memfile, otherwise we can't do anything
|
||||
* If we can't create one for the current buffer, take another buffer
|
||||
*/
|
||||
close_buffer(NULL, curbuf, 0);
|
||||
close_buffer(NULL, curbuf, 0, FALSE);
|
||||
for (curbuf = firstbuf; curbuf != NULL; curbuf = curbuf->b_next)
|
||||
if (curbuf->b_ml.ml_mfp != NULL)
|
||||
break;
|
||||
@@ -316,12 +319,17 @@ buf_valid(buf)
|
||||
* get a new buffer very soon!
|
||||
*
|
||||
* The 'bufhidden' option can force freeing and deleting.
|
||||
*
|
||||
* When "abort_if_last" is TRUE then do not close the buffer if autocommands
|
||||
* cause there to be only one window with this buffer. e.g. when ":quit" is
|
||||
* supposed to close the window but autocommands close all other windows.
|
||||
*/
|
||||
void
|
||||
close_buffer(win, buf, action)
|
||||
close_buffer(win, buf, action, abort_if_last)
|
||||
win_T *win; /* if not NULL, set b_last_cursor */
|
||||
buf_T *buf;
|
||||
int action;
|
||||
int abort_if_last;
|
||||
{
|
||||
#ifdef FEAT_AUTOCMD
|
||||
int is_curbuf;
|
||||
@@ -371,8 +379,12 @@ close_buffer(win, buf, action)
|
||||
{
|
||||
apply_autocmds(EVENT_BUFWINLEAVE, buf->b_fname, buf->b_fname,
|
||||
FALSE, buf);
|
||||
if (!buf_valid(buf)) /* autocommands may delete the buffer */
|
||||
/* Return if autocommands deleted the buffer or made it the only one. */
|
||||
if (!buf_valid(buf) || (abort_if_last && one_window()))
|
||||
{
|
||||
EMSG(_(e_auabort));
|
||||
return;
|
||||
}
|
||||
|
||||
/* When the buffer becomes hidden, but is not unloaded, trigger
|
||||
* BufHidden */
|
||||
@@ -380,8 +392,13 @@ close_buffer(win, buf, action)
|
||||
{
|
||||
apply_autocmds(EVENT_BUFHIDDEN, buf->b_fname, buf->b_fname,
|
||||
FALSE, buf);
|
||||
if (!buf_valid(buf)) /* autocmds may delete the buffer */
|
||||
/* Return if autocommands deleted the buffer or made it the only
|
||||
* one. */
|
||||
if (!buf_valid(buf) || (abort_if_last && one_window()))
|
||||
{
|
||||
EMSG(_(e_auabort));
|
||||
return;
|
||||
}
|
||||
}
|
||||
# ifdef FEAT_EVAL
|
||||
if (aborting()) /* autocmds may abort script processing */
|
||||
@@ -775,7 +792,7 @@ handle_swap_exists(old_curbuf)
|
||||
* open a new, empty buffer. */
|
||||
swap_exists_action = SEA_NONE; /* don't want it again */
|
||||
swap_exists_did_quit = TRUE;
|
||||
close_buffer(curwin, curbuf, DOBUF_UNLOAD);
|
||||
close_buffer(curwin, curbuf, DOBUF_UNLOAD, FALSE);
|
||||
if (!buf_valid(old_curbuf) || old_curbuf == curbuf)
|
||||
old_curbuf = buflist_new(NULL, NULL, 1L, BLN_CURBUF | BLN_LISTED);
|
||||
if (old_curbuf != NULL)
|
||||
@@ -1122,7 +1139,7 @@ do_buffer(action, start, dir, count, forceit)
|
||||
* if the buffer still exists.
|
||||
*/
|
||||
if (buf != curbuf && buf_valid(buf) && buf->b_nwindows == 0)
|
||||
close_buffer(NULL, buf, action);
|
||||
close_buffer(NULL, buf, action, FALSE);
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -1146,7 +1163,7 @@ do_buffer(action, start, dir, count, forceit)
|
||||
close_windows(buf, FALSE);
|
||||
#endif
|
||||
if (buf != curbuf && buf_valid(buf) && buf->b_nwindows <= 0)
|
||||
close_buffer(NULL, buf, action);
|
||||
close_buffer(NULL, buf, action, FALSE);
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -1378,7 +1395,7 @@ set_curbuf(buf, action)
|
||||
close_buffer(prevbuf == curwin->w_buffer ? curwin : NULL, prevbuf,
|
||||
unload ? action : (action == DOBUF_GOTO
|
||||
&& !P_HID(prevbuf)
|
||||
&& !bufIsChanged(prevbuf)) ? DOBUF_UNLOAD : 0);
|
||||
&& !bufIsChanged(prevbuf)) ? DOBUF_UNLOAD : 0, FALSE);
|
||||
}
|
||||
}
|
||||
#ifdef FEAT_AUTOCMD
|
||||
@@ -2708,7 +2725,8 @@ setfname(buf, ffname, sfname, message)
|
||||
vim_free(ffname);
|
||||
return FAIL;
|
||||
}
|
||||
close_buffer(NULL, obuf, DOBUF_WIPE); /* delete from the list */
|
||||
/* delete from the list */
|
||||
close_buffer(NULL, obuf, DOBUF_WIPE, FALSE);
|
||||
}
|
||||
sfname = vim_strsave(sfname);
|
||||
if (ffname == NULL || sfname == NULL)
|
||||
@@ -4387,7 +4405,12 @@ do_arg_all(count, forceit, keep_tabs)
|
||||
{
|
||||
int i;
|
||||
win_T *wp, *wpnext;
|
||||
char_u *opened; /* array of flags for which args are open */
|
||||
char_u *opened; /* Array of weight for which args are open:
|
||||
* 0: not opened
|
||||
* 1: opened in other tab
|
||||
* 2: opened in curtab
|
||||
* 3: opened in curtab and curwin
|
||||
*/
|
||||
int opened_len; /* length of opened[] */
|
||||
int use_firstwin = FALSE; /* use first window for arglist */
|
||||
int split_ret = OK;
|
||||
@@ -4396,6 +4419,8 @@ do_arg_all(count, forceit, keep_tabs)
|
||||
buf_T *buf;
|
||||
tabpage_T *tpnext;
|
||||
int had_tab = cmdmod.tab;
|
||||
win_T *old_curwin, *last_curwin;
|
||||
tabpage_T *old_curtab, *last_curtab;
|
||||
win_T *new_curwin = NULL;
|
||||
tabpage_T *new_curtab = NULL;
|
||||
|
||||
@@ -4412,6 +4437,15 @@ do_arg_all(count, forceit, keep_tabs)
|
||||
if (opened == NULL)
|
||||
return;
|
||||
|
||||
/* Autocommands may do anything to the argument list. Make sure it's not
|
||||
* freed while we are working here by "locking" it. We still have to
|
||||
* watch out for its size to be changed. */
|
||||
alist = curwin->w_alist;
|
||||
++alist->al_refcount;
|
||||
|
||||
old_curwin = curwin;
|
||||
old_curtab = curtab;
|
||||
|
||||
#ifdef FEAT_GUI
|
||||
need_mouse_correct = TRUE;
|
||||
#endif
|
||||
@@ -4433,36 +4467,51 @@ do_arg_all(count, forceit, keep_tabs)
|
||||
wpnext = wp->w_next;
|
||||
buf = wp->w_buffer;
|
||||
if (buf->b_ffname == NULL
|
||||
|| buf->b_nwindows > 1
|
||||
|| (!keep_tabs && buf->b_nwindows > 1)
|
||||
#ifdef FEAT_VERTSPLIT
|
||||
|| wp->w_width != Columns
|
||||
#endif
|
||||
)
|
||||
i = ARGCOUNT;
|
||||
i = opened_len;
|
||||
else
|
||||
{
|
||||
/* check if the buffer in this window is in the arglist */
|
||||
for (i = 0; i < ARGCOUNT; ++i)
|
||||
for (i = 0; i < opened_len; ++i)
|
||||
{
|
||||
if (ARGLIST[i].ae_fnum == buf->b_fnum
|
||||
|| fullpathcmp(alist_name(&ARGLIST[i]),
|
||||
buf->b_ffname, TRUE) & FPC_SAME)
|
||||
if (i < alist->al_ga.ga_len
|
||||
&& (AARGLIST(alist)[i].ae_fnum == buf->b_fnum
|
||||
|| fullpathcmp(alist_name(&AARGLIST(alist)[i]),
|
||||
buf->b_ffname, TRUE) & FPC_SAME))
|
||||
{
|
||||
if (i < opened_len)
|
||||
int weight = 1;
|
||||
|
||||
if (old_curtab == curtab)
|
||||
{
|
||||
opened[i] = TRUE;
|
||||
++weight;
|
||||
if (old_curwin == wp)
|
||||
++weight;
|
||||
}
|
||||
|
||||
if (weight > (int)opened[i])
|
||||
{
|
||||
opened[i] = (char_u)weight;
|
||||
if (i == 0)
|
||||
{
|
||||
if (new_curwin != NULL)
|
||||
new_curwin->w_arg_idx = opened_len;
|
||||
new_curwin = wp;
|
||||
new_curtab = curtab;
|
||||
}
|
||||
}
|
||||
if (wp->w_alist != curwin->w_alist)
|
||||
else if (keep_tabs)
|
||||
i = opened_len;
|
||||
|
||||
if (wp->w_alist != alist)
|
||||
{
|
||||
/* Use the current argument list for all windows
|
||||
* containing a file from it. */
|
||||
alist_unlink(wp->w_alist);
|
||||
wp->w_alist = curwin->w_alist;
|
||||
wp->w_alist = alist;
|
||||
++wp->w_alist->al_refcount;
|
||||
}
|
||||
break;
|
||||
@@ -4471,7 +4520,7 @@ do_arg_all(count, forceit, keep_tabs)
|
||||
}
|
||||
wp->w_arg_idx = i;
|
||||
|
||||
if (i == ARGCOUNT && !keep_tabs) /* close this window */
|
||||
if (i == opened_len && !keep_tabs)/* close this window */
|
||||
{
|
||||
if (P_HID(buf) || forceit || buf->b_nwindows > 1
|
||||
|| !bufIsChanged(buf))
|
||||
@@ -4493,7 +4542,8 @@ do_arg_all(count, forceit, keep_tabs)
|
||||
}
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* don't close last window */
|
||||
if (firstwin == lastwin && first_tabpage->tp_next == NULL)
|
||||
if (firstwin == lastwin
|
||||
&& (first_tabpage->tp_next == NULL || !had_tab))
|
||||
#endif
|
||||
use_firstwin = TRUE;
|
||||
#ifdef FEAT_WINDOWS
|
||||
@@ -4527,20 +4577,16 @@ do_arg_all(count, forceit, keep_tabs)
|
||||
* Open a window for files in the argument list that don't have one.
|
||||
* ARGCOUNT may change while doing this, because of autocommands.
|
||||
*/
|
||||
if (count > ARGCOUNT || count <= 0)
|
||||
count = ARGCOUNT;
|
||||
|
||||
/* Autocommands may do anything to the argument list. Make sure it's not
|
||||
* freed while we are working here by "locking" it. We still have to
|
||||
* watch out for its size to be changed. */
|
||||
alist = curwin->w_alist;
|
||||
++alist->al_refcount;
|
||||
if (count > opened_len || count <= 0)
|
||||
count = opened_len;
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
/* Don't execute Win/Buf Enter/Leave autocommands here. */
|
||||
++autocmd_no_enter;
|
||||
++autocmd_no_leave;
|
||||
#endif
|
||||
last_curwin = curwin;
|
||||
last_curtab = curtab;
|
||||
win_enter(lastwin, FALSE);
|
||||
#ifdef FEAT_WINDOWS
|
||||
/* ":drop all" should re-use an empty window to avoid "--remote-tab"
|
||||
@@ -4550,11 +4596,11 @@ do_arg_all(count, forceit, keep_tabs)
|
||||
use_firstwin = TRUE;
|
||||
#endif
|
||||
|
||||
for (i = 0; i < count && i < alist->al_ga.ga_len && !got_int; ++i)
|
||||
for (i = 0; i < count && i < opened_len && !got_int; ++i)
|
||||
{
|
||||
if (alist == &global_alist && i == global_alist.al_ga.ga_len - 1)
|
||||
arg_had_last = TRUE;
|
||||
if (i < opened_len && opened[i])
|
||||
if (opened[i] > 0)
|
||||
{
|
||||
/* Move the already present window to below the current window */
|
||||
if (curwin->w_arg_idx != i)
|
||||
@@ -4563,7 +4609,13 @@ do_arg_all(count, forceit, keep_tabs)
|
||||
{
|
||||
if (wpnext->w_arg_idx == i)
|
||||
{
|
||||
win_move_after(wpnext, curwin);
|
||||
if (keep_tabs)
|
||||
{
|
||||
new_curwin = wpnext;
|
||||
new_curtab = curtab;
|
||||
}
|
||||
else
|
||||
win_move_after(wpnext, curwin);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -4618,6 +4670,14 @@ do_arg_all(count, forceit, keep_tabs)
|
||||
#ifdef FEAT_AUTOCMD
|
||||
--autocmd_no_enter;
|
||||
#endif
|
||||
/* restore last referenced tabpage's curwin */
|
||||
if (last_curtab != new_curtab)
|
||||
{
|
||||
if (valid_tabpage(last_curtab))
|
||||
goto_tabpage_tp(last_curtab);
|
||||
if (win_valid(last_curwin))
|
||||
win_enter(last_curwin, FALSE);
|
||||
}
|
||||
/* to window with first arg */
|
||||
if (valid_tabpage(new_curtab))
|
||||
goto_tabpage_tp(new_curtab);
|
||||
@@ -5638,7 +5698,7 @@ wipe_buffer(buf, aucmd)
|
||||
if (!aucmd) /* Don't trigger BufDelete autocommands here. */
|
||||
block_autocmds();
|
||||
#endif
|
||||
close_buffer(NULL, buf, DOBUF_WIPE);
|
||||
close_buffer(NULL, buf, DOBUF_WIPE, FALSE);
|
||||
#ifdef FEAT_AUTOCMD
|
||||
if (!aucmd)
|
||||
unblock_autocmds();
|
||||
|
||||
97
src/edit.c
97
src/edit.c
@@ -259,6 +259,9 @@ static int ins_ctrl_ey __ARGS((int tc));
|
||||
static void ins_try_si __ARGS((int c));
|
||||
#endif
|
||||
static colnr_T get_nolist_virtcol __ARGS((void));
|
||||
#ifdef FEAT_AUTOCMD
|
||||
static char_u *do_insert_char_pre __ARGS((int c));
|
||||
#endif
|
||||
|
||||
static colnr_T Insstart_textlen; /* length of line when insert started */
|
||||
static colnr_T Insstart_blank_vcol; /* vcol for first inserted blank */
|
||||
@@ -784,7 +787,20 @@ edit(cmdchar, startln, count)
|
||||
* completion: Add to "compl_leader". */
|
||||
if (ins_compl_accept_char(c))
|
||||
{
|
||||
ins_compl_addleader(c);
|
||||
#ifdef FEAT_AUTOCMD
|
||||
/* Trigger InsertCharPre. */
|
||||
char_u *str = do_insert_char_pre(c);
|
||||
char_u *p;
|
||||
|
||||
if (str != NULL)
|
||||
{
|
||||
for (p = str; *p != NUL; mb_ptr_adv(p))
|
||||
ins_compl_addleader(PTR2CHAR(p));
|
||||
vim_free(str);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
ins_compl_addleader(c);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1393,34 +1409,31 @@ normalchar:
|
||||
#ifdef FEAT_AUTOCMD
|
||||
if (!p_paste)
|
||||
{
|
||||
/* Trigger the InsertCharPre event. Lock the text to avoid
|
||||
* weird things from happening. */
|
||||
set_vim_var_char(c);
|
||||
++textlock;
|
||||
if (apply_autocmds(EVENT_INSERTCHARPRE, NULL, NULL,
|
||||
FALSE, curbuf))
|
||||
/* Trigger InsertCharPre. */
|
||||
char_u *str = do_insert_char_pre(c);
|
||||
char_u *p;
|
||||
|
||||
if (str != NULL)
|
||||
{
|
||||
/* Get the new value of v:char. If it is more than one
|
||||
* character insert it literally. */
|
||||
char_u *s = get_vim_var_str(VV_CHAR);
|
||||
if (MB_CHARLEN(s) > 1)
|
||||
if (*str != NUL && stop_arrow() != FAIL)
|
||||
{
|
||||
if (stop_arrow() != FAIL)
|
||||
/* Insert the new value of v:char literally. */
|
||||
for (p = str; *p != NUL; mb_ptr_adv(p))
|
||||
{
|
||||
ins_str(s);
|
||||
AppendToRedobuffLit(s, -1);
|
||||
c = PTR2CHAR(p);
|
||||
if (c == CAR || c == K_KENTER || c == NL)
|
||||
ins_eol(c);
|
||||
else
|
||||
ins_char(c);
|
||||
}
|
||||
c = NUL;
|
||||
AppendToRedobuffLit(str, -1);
|
||||
}
|
||||
else
|
||||
c = PTR2CHAR(s);
|
||||
vim_free(str);
|
||||
c = NUL;
|
||||
}
|
||||
|
||||
set_vim_var_string(VV_CHAR, NULL, -1);
|
||||
--textlock;
|
||||
|
||||
/* If the new value is an empty string then don't insert a
|
||||
* char. */
|
||||
/* If the new value is already inserted or an empty string
|
||||
* then don't insert any character. */
|
||||
if (c == NUL)
|
||||
break;
|
||||
}
|
||||
@@ -5883,6 +5896,8 @@ insertchar(c, flags, second_indent)
|
||||
* Don't do this when 'cindent' or 'indentexpr' is set, because we might
|
||||
* need to re-indent at a ':', or any other character (but not what
|
||||
* 'paste' is set)..
|
||||
* Don't do this when there an InsertCharPre autocommand is defined,
|
||||
* because we need to fire the event for every character.
|
||||
*/
|
||||
#ifdef USE_ON_FLY_SCROLL
|
||||
dont_scroll = FALSE; /* allow scrolling here */
|
||||
@@ -5899,6 +5914,9 @@ insertchar(c, flags, second_indent)
|
||||
#endif
|
||||
#ifdef FEAT_RIGHTLEFT
|
||||
&& !p_ri
|
||||
#endif
|
||||
#ifdef FEAT_AUTOCMD
|
||||
&& !has_insertcharpre()
|
||||
#endif
|
||||
)
|
||||
{
|
||||
@@ -10068,3 +10086,38 @@ get_nolist_virtcol()
|
||||
validate_virtcol();
|
||||
return curwin->w_virtcol;
|
||||
}
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
/*
|
||||
* Handle the InsertCharPre autocommand.
|
||||
* "c" is the character that was typed.
|
||||
* Return a pointer to allocated memory with the replacement string.
|
||||
* Return NULL to continue inserting "c".
|
||||
*/
|
||||
static char_u *
|
||||
do_insert_char_pre(c)
|
||||
int c;
|
||||
{
|
||||
char_u *res;
|
||||
|
||||
/* Return quickly when there is nothing to do. */
|
||||
if (!has_insertcharpre())
|
||||
return NULL;
|
||||
|
||||
/* Lock the text to avoid weird things from happening. */
|
||||
++textlock;
|
||||
set_vim_var_char(c); /* set v:char */
|
||||
|
||||
if (apply_autocmds(EVENT_INSERTCHARPRE, NULL, NULL, FALSE, curbuf))
|
||||
/* Get the new value of v:char. It may be empty or more than one
|
||||
* character. */
|
||||
res = vim_strsave(get_vim_var_str(VV_CHAR));
|
||||
else
|
||||
res = NULL;
|
||||
|
||||
set_vim_var_string(VV_CHAR, NULL, -1); /* clear v:char */
|
||||
--textlock;
|
||||
|
||||
return res;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -3387,7 +3387,7 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags, oldwin)
|
||||
/* close the link to the current buffer */
|
||||
u_sync(FALSE);
|
||||
close_buffer(oldwin, curbuf,
|
||||
(flags & ECMD_HIDE) ? 0 : DOBUF_UNLOAD);
|
||||
(flags & ECMD_HIDE) ? 0 : DOBUF_UNLOAD, FALSE);
|
||||
|
||||
#ifdef FEAT_AUTOCMD
|
||||
/* Autocommands may open a new window and leave oldwin open
|
||||
@@ -5151,10 +5151,13 @@ outofmem:
|
||||
|
||||
if (!global_busy)
|
||||
{
|
||||
if (endcolumn)
|
||||
coladvance((colnr_T)MAXCOL);
|
||||
else
|
||||
beginline(BL_WHITE | BL_FIX);
|
||||
if (!do_ask) /* when interactive leave cursor on the match */
|
||||
{
|
||||
if (endcolumn)
|
||||
coladvance((colnr_T)MAXCOL);
|
||||
else
|
||||
beginline(BL_WHITE | BL_FIX);
|
||||
}
|
||||
if (!do_sub_msg(do_count) && do_ask)
|
||||
MSG("");
|
||||
}
|
||||
|
||||
@@ -3448,7 +3448,7 @@ getsourceline(c, cookie, indent)
|
||||
{
|
||||
garray_T ga;
|
||||
|
||||
ga_init2(&ga, (int)sizeof(char_u), 200);
|
||||
ga_init2(&ga, (int)sizeof(char_u), 400);
|
||||
ga_concat(&ga, line);
|
||||
ga_concat(&ga, p + 1);
|
||||
for (;;)
|
||||
@@ -3460,6 +3460,15 @@ getsourceline(c, cookie, indent)
|
||||
p = skipwhite(sp->nextline);
|
||||
if (*p != '\\')
|
||||
break;
|
||||
/* Adjust the growsize to the current length to speed up
|
||||
* concatenating many lines. */
|
||||
if (ga.ga_len > 400)
|
||||
{
|
||||
if (ga.ga_len > 8000)
|
||||
ga.ga_growsize = 8000;
|
||||
else
|
||||
ga.ga_growsize = ga.ga_len;
|
||||
}
|
||||
ga_concat(&ga, p + 1);
|
||||
}
|
||||
ga_append(&ga, NUL);
|
||||
|
||||
@@ -1852,8 +1852,11 @@ cmdline_changed:
|
||||
# endif
|
||||
)
|
||||
/* Always redraw the whole command line to fix shaping and
|
||||
* right-left typing. Not efficient, but it works. */
|
||||
redrawcmd();
|
||||
* right-left typing. Not efficient, but it works.
|
||||
* Do it only when there are no characters left to read
|
||||
* to avoid useless intermediate redraws. */
|
||||
if (vpeekc() == NUL)
|
||||
redrawcmd();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -6443,7 +6446,7 @@ ex_window()
|
||||
/* win_close() may have already wiped the buffer when 'bh' is
|
||||
* set to 'wipe' */
|
||||
if (buf_valid(bp))
|
||||
close_buffer(NULL, bp, DOBUF_WIPE);
|
||||
close_buffer(NULL, bp, DOBUF_WIPE, FALSE);
|
||||
|
||||
/* Restore window sizes. */
|
||||
win_size_restore(&winsizes);
|
||||
|
||||
@@ -9116,6 +9116,15 @@ has_cursormovedI()
|
||||
return (first_autopat[(int)EVENT_CURSORMOVEDI] != NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE when there is an InsertCharPre autocommand defined.
|
||||
*/
|
||||
int
|
||||
has_insertcharpre()
|
||||
{
|
||||
return (first_autopat[(int)EVENT_INSERTCHARPRE] != NULL);
|
||||
}
|
||||
|
||||
static int
|
||||
apply_autocmds_group(event, fname, fname_io, force, group, buf, eap)
|
||||
event_T event;
|
||||
|
||||
58
src/fold.c
58
src/fold.c
@@ -3292,7 +3292,8 @@ foldlevelSyntax(flp)
|
||||
/* put_folds() {{{2 */
|
||||
#if defined(FEAT_SESSION) || defined(PROTO)
|
||||
static int put_folds_recurse __ARGS((FILE *fd, garray_T *gap, linenr_T off));
|
||||
static int put_foldopen_recurse __ARGS((FILE *fd, garray_T *gap, linenr_T off));
|
||||
static int put_foldopen_recurse __ARGS((FILE *fd, win_T *wp, garray_T *gap, linenr_T off));
|
||||
static int put_fold_open_close __ARGS((FILE *fd, fold_T *fp, linenr_T off));
|
||||
|
||||
/*
|
||||
* Write commands to "fd" to restore the manual folds in window "wp".
|
||||
@@ -3312,7 +3313,7 @@ put_folds(fd, wp)
|
||||
|
||||
/* If some folds are manually opened/closed, need to restore that. */
|
||||
if (wp->w_fold_manual)
|
||||
return put_foldopen_recurse(fd, &wp->w_folds, (linenr_T)0);
|
||||
return put_foldopen_recurse(fd, wp, &wp->w_folds, (linenr_T)0);
|
||||
|
||||
return OK;
|
||||
}
|
||||
@@ -3352,12 +3353,14 @@ put_folds_recurse(fd, gap, off)
|
||||
* Returns FAIL when writing failed.
|
||||
*/
|
||||
static int
|
||||
put_foldopen_recurse(fd, gap, off)
|
||||
put_foldopen_recurse(fd, wp, gap, off)
|
||||
FILE *fd;
|
||||
win_T *wp;
|
||||
garray_T *gap;
|
||||
linenr_T off;
|
||||
{
|
||||
int i;
|
||||
int level;
|
||||
fold_T *fp;
|
||||
|
||||
fp = (fold_T *)gap->ga_data;
|
||||
@@ -3367,27 +3370,60 @@ put_foldopen_recurse(fd, gap, off)
|
||||
{
|
||||
if (fp->fd_nested.ga_len > 0)
|
||||
{
|
||||
/* open/close nested folds while this fold is open */
|
||||
/* open nested folds while this fold is open */
|
||||
if (fprintf(fd, "%ld", fp->fd_top + off) < 0
|
||||
|| put_eol(fd) == FAIL
|
||||
|| put_line(fd, "normal zo") == FAIL)
|
||||
return FAIL;
|
||||
if (put_foldopen_recurse(fd, &fp->fd_nested, off + fp->fd_top)
|
||||
if (put_foldopen_recurse(fd, wp, &fp->fd_nested,
|
||||
off + fp->fd_top)
|
||||
== FAIL)
|
||||
return FAIL;
|
||||
/* close the parent when needed */
|
||||
if (fp->fd_flags == FD_CLOSED)
|
||||
{
|
||||
if (put_fold_open_close(fd, fp, off) == FAIL)
|
||||
return FAIL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Open or close the leaf according to the window foldlevel.
|
||||
* Do not close a leaf that is already closed, as it will close
|
||||
* the parent. */
|
||||
level = foldLevelWin(wp, off + fp->fd_top);
|
||||
if ((fp->fd_flags == FD_CLOSED && wp->w_p_fdl >= level)
|
||||
|| (fp->fd_flags != FD_CLOSED && wp->w_p_fdl < level))
|
||||
if (put_fold_open_close(fd, fp, off) == FAIL)
|
||||
return FAIL;
|
||||
}
|
||||
if (fprintf(fd, "%ld", fp->fd_top + off) < 0
|
||||
|| put_eol(fd) == FAIL
|
||||
|| fprintf(fd, "normal z%c",
|
||||
fp->fd_flags == FD_CLOSED ? 'c' : 'o') < 0
|
||||
|| put_eol(fd) == FAIL)
|
||||
return FAIL;
|
||||
}
|
||||
++fp;
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
/* put_fold_open_close() {{{2 */
|
||||
/*
|
||||
* Write the open or close command to "fd".
|
||||
* Returns FAIL when writing failed.
|
||||
*/
|
||||
static int
|
||||
put_fold_open_close(fd, fp, off)
|
||||
FILE *fd;
|
||||
fold_T *fp;
|
||||
linenr_T off;
|
||||
{
|
||||
if (fprintf(fd, "%ld", fp->fd_top + off) < 0
|
||||
|| put_eol(fd) == FAIL
|
||||
|| fprintf(fd, "normal z%c",
|
||||
fp->fd_flags == FD_CLOSED ? 'c' : 'o') < 0
|
||||
|| put_eol(fd) == FAIL)
|
||||
return FAIL;
|
||||
|
||||
return OK;
|
||||
}
|
||||
#endif /* FEAT_SESSION */
|
||||
|
||||
/* }}}1 */
|
||||
|
||||
123
src/if_tcl.c
123
src/if_tcl.c
@@ -79,12 +79,13 @@ TODO:
|
||||
typedef struct
|
||||
{
|
||||
Tcl_Interp *interp;
|
||||
int exitvalue;
|
||||
int range_start, range_end;
|
||||
int lbase;
|
||||
char *curbuf, *curwin;
|
||||
} tcl_info;
|
||||
|
||||
static tcl_info tclinfo = { NULL, 0, 0, 0, NULL, NULL };
|
||||
static tcl_info tclinfo = { NULL, 0, 0, 0, 0, NULL, NULL };
|
||||
|
||||
#define VAR_RANGE1 "::vim::range(start)"
|
||||
#define VAR_RANGE2 "::vim::range(begin)"
|
||||
@@ -279,16 +280,19 @@ tcl_end()
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Replace standard "exit" and "catch" commands.
|
||||
* Replace standard "exit" command.
|
||||
*
|
||||
* This is a design flaw in Tcl - the standard "exit" command just calls
|
||||
* exit() and kills the application. It should return TCL_EXIT to the
|
||||
* app, which then decides if it wants to terminate or not. In our case,
|
||||
* we just delete the Tcl interpreter (and create a new one with the next
|
||||
* :tcl command).
|
||||
* Delete the Tcl interpreter; a new one will be created with the next
|
||||
* :tcl command). The exit code is saved (and retrieved in tclexit()).
|
||||
* Since Tcl's exit is never expected to return and this replacement
|
||||
* does, then (except for a trivial case) additional Tcl commands will
|
||||
* be run. Since the interpreter is now marked as deleted, an error
|
||||
* will be returned -- typically "attempt to call eval in deleted
|
||||
* interpreter". Hopefully, at this point, checks for TCL_ERROR take
|
||||
* place and control percolates back up to Vim -- but with this new error
|
||||
* string in the interpreter's result value. Therefore it would be
|
||||
* useless for this routine to return the exit code via Tcl_SetResult().
|
||||
*/
|
||||
#define TCL_EXIT 5
|
||||
|
||||
static int
|
||||
exitcmd(dummy, interp, objc, objv)
|
||||
ClientData dummy UNUSED;
|
||||
@@ -305,51 +309,16 @@ exitcmd(dummy, interp, objc, objv)
|
||||
break;
|
||||
/* FALLTHROUGH */
|
||||
case 1:
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(value));
|
||||
return TCL_EXIT;
|
||||
tclinfo.exitvalue = value;
|
||||
|
||||
Tcl_DeleteInterp(interp);
|
||||
break;
|
||||
default:
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "?returnCode?");
|
||||
}
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
static int
|
||||
catchcmd(dummy, interp, objc, objv)
|
||||
ClientData dummy UNUSED;
|
||||
Tcl_Interp *interp;
|
||||
int objc;
|
||||
Tcl_Obj *CONST objv[];
|
||||
{
|
||||
char *varname = NULL;
|
||||
int result;
|
||||
|
||||
switch (objc)
|
||||
{
|
||||
case 3:
|
||||
varname = Tcl_GetStringFromObj(objv[2], NULL);
|
||||
/* fallthrough */
|
||||
case 2:
|
||||
Tcl_ResetResult(interp);
|
||||
Tcl_AllowExceptions(interp);
|
||||
result = Tcl_EvalObj(interp, objv[1]);
|
||||
if (result == TCL_EXIT)
|
||||
return result;
|
||||
if (varname)
|
||||
{
|
||||
if (Tcl_SetVar(interp, varname, Tcl_GetStringResult(interp), 0) == NULL)
|
||||
{
|
||||
Tcl_SetResult(interp, "couldn't save command result in variable", TCL_STATIC);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
}
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(result));
|
||||
return TCL_OK;
|
||||
default:
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "command ?varName?");
|
||||
}
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
/*
|
||||
* "::vim::beep" - what Vi[m] does best :-)
|
||||
*/
|
||||
@@ -372,6 +341,7 @@ beepcmd(dummy, interp, objc, objv)
|
||||
/*
|
||||
* "::vim::buffer list" - create a list of buffer commands.
|
||||
* "::vim::buffer {N}" - create buffer command for buffer N.
|
||||
* "::vim::buffer exists {N}" - test if buffer N exists.
|
||||
* "::vim::buffer new" - create a new buffer (not implemented)
|
||||
*/
|
||||
static int
|
||||
@@ -1663,7 +1633,7 @@ channel_gethandle(instance, direction, handleptr)
|
||||
static Tcl_ChannelType channel_type =
|
||||
{
|
||||
"vimmessage", /* typeName */
|
||||
NULL, /* version */
|
||||
TCL_CHANNEL_VERSION_2, /* version */
|
||||
channel_close, /* closeProc */
|
||||
channel_input, /* inputProc */
|
||||
channel_output, /* outputProc */
|
||||
@@ -1678,6 +1648,8 @@ static Tcl_ChannelType channel_type =
|
||||
NULL, /* flushProc */
|
||||
NULL, /* handlerProc */
|
||||
#endif
|
||||
/* The following should not be necessary since TCL_CHANNEL_VERSION_2 was
|
||||
* set above */
|
||||
#ifdef TCL_CHANNEL_VERSION_3
|
||||
NULL, /* wideSeekProc */
|
||||
#endif
|
||||
@@ -1741,7 +1713,9 @@ tclinit(eap)
|
||||
Tcl_Interp *interp;
|
||||
static Tcl_Channel ch1, ch2;
|
||||
|
||||
/* replace stdout and stderr */
|
||||
/* Create replacement channels for stdout and stderr; this has to be
|
||||
* done each time an interpreter is created since the channels are closed
|
||||
* when the interpreter is deleted */
|
||||
ch1 = Tcl_CreateChannel(&channel_type, "vimout", VIMOUT, TCL_WRITABLE);
|
||||
ch2 = Tcl_CreateChannel(&channel_type, "vimerr", VIMERR, TCL_WRITABLE);
|
||||
Tcl_SetStdChannel(ch1, TCL_STDOUT);
|
||||
@@ -1761,15 +1735,18 @@ tclinit(eap)
|
||||
#endif
|
||||
|
||||
Tcl_SetChannelOption(interp, ch1, "-buffering", "line");
|
||||
#ifdef WIN3264
|
||||
Tcl_SetChannelOption(interp, ch1, "-translation", "lf");
|
||||
#endif
|
||||
Tcl_SetChannelOption(interp, ch2, "-buffering", "line");
|
||||
#ifdef WIN3264
|
||||
Tcl_SetChannelOption(interp, ch2, "-translation", "lf");
|
||||
#endif
|
||||
|
||||
/* replace some standard Tcl commands */
|
||||
/* replace standard Tcl exit command */
|
||||
Tcl_DeleteCommand(interp, "exit");
|
||||
Tcl_CreateObjCommand(interp, "exit", exitcmd,
|
||||
(ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
|
||||
Tcl_DeleteCommand(interp, "catch");
|
||||
Tcl_CreateObjCommand(interp, "catch", catchcmd,
|
||||
(ClientData)NULL, (Tcl_CmdDeleteProc *)NULL);
|
||||
|
||||
/* new commands, in ::vim namespace */
|
||||
Tcl_CreateObjCommand(interp, "::vim::buffer", buffercmd,
|
||||
@@ -1821,6 +1798,8 @@ tclinit(eap)
|
||||
tclinfo.range_end = row2tcl(eap->line2);
|
||||
tclupdatevars();
|
||||
}
|
||||
|
||||
tclinfo.exitvalue = 0;
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -1884,30 +1863,23 @@ tclexit(error)
|
||||
{
|
||||
int newerr = OK;
|
||||
|
||||
if (error == TCL_EXIT)
|
||||
if (Tcl_InterpDeleted(tclinfo.interp) /* True if we intercepted Tcl's exit command */
|
||||
#if (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION >= 5) || TCL_MAJOR_VERSION > 8
|
||||
|| Tcl_LimitExceeded(tclinfo.interp) /* True if the interpreter cannot continue */
|
||||
#endif
|
||||
)
|
||||
{
|
||||
int retval;
|
||||
char buf[50];
|
||||
Tcl_Obj *robj;
|
||||
|
||||
robj = Tcl_GetObjResult(tclinfo.interp);
|
||||
if (Tcl_GetIntFromObj(tclinfo.interp, robj, &retval) != TCL_OK)
|
||||
sprintf(buf, _("E572: exit code %d"), tclinfo.exitvalue);
|
||||
tclerrmsg(buf);
|
||||
if (tclinfo.exitvalue == 0)
|
||||
{
|
||||
EMSG(_("E281: TCL ERROR: exit code is not int!? Please report this to vim-dev@vim.org"));
|
||||
newerr = FAIL;
|
||||
did_emsg = 0;
|
||||
newerr = OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(buf, _("E572: exit code %d"), retval);
|
||||
tclerrmsg(buf);
|
||||
if (retval == 0)
|
||||
{
|
||||
did_emsg = 0;
|
||||
newerr = OK;
|
||||
}
|
||||
else
|
||||
newerr = FAIL;
|
||||
}
|
||||
newerr = FAIL;
|
||||
|
||||
tcldelthisinterp();
|
||||
}
|
||||
@@ -2021,7 +1993,12 @@ ex_tcldo(eap)
|
||||
Tcl_SetVar(tclinfo.interp, var_line, line, 0);
|
||||
Tcl_AllowExceptions(tclinfo.interp);
|
||||
err = Tcl_Eval(tclinfo.interp, script);
|
||||
if (err != TCL_OK)
|
||||
if (err != TCL_OK
|
||||
|| Tcl_InterpDeleted(tclinfo.interp)
|
||||
#if (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION >= 5) || TCL_MAJOR_VERSION > 8
|
||||
|| Tcl_LimitExceeded(tclinfo.interp)
|
||||
#endif
|
||||
)
|
||||
break;
|
||||
line = (char *)Tcl_GetVar(tclinfo.interp, var_line, 0);
|
||||
if (line)
|
||||
|
||||
27
src/misc1.c
27
src/misc1.c
@@ -4133,17 +4133,6 @@ vim_getenv(name, mustfree)
|
||||
{
|
||||
vim_setenv((char_u *)"VIMRUNTIME", p);
|
||||
didset_vimruntime = TRUE;
|
||||
#ifdef FEAT_GETTEXT
|
||||
{
|
||||
char_u *buf = concat_str(p, (char_u *)"/lang");
|
||||
|
||||
if (buf != NULL)
|
||||
{
|
||||
bindtextdomain(VIMPACKAGE, (char *)buf);
|
||||
vim_free(buf);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -4221,6 +4210,22 @@ vim_setenv(name, val)
|
||||
putenv((char *)envbuf);
|
||||
}
|
||||
#endif
|
||||
#ifdef FEAT_GETTEXT
|
||||
/*
|
||||
* When setting $VIMRUNTIME adjust the directory to find message
|
||||
* translations to $VIMRUNTIME/lang.
|
||||
*/
|
||||
if (*val != NUL && STRICMP(name, "VIMRUNTIME") == 0)
|
||||
{
|
||||
char_u *buf = concat_str(val, (char_u *)"/lang");
|
||||
|
||||
if (buf != NULL)
|
||||
{
|
||||
bindtextdomain(VIMPACKAGE, (char *)buf);
|
||||
vim_free(buf);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
||||
|
||||
38
src/misc2.c
38
src/misc2.c
@@ -1173,7 +1173,7 @@ free_all_mem()
|
||||
for (buf = firstbuf; buf != NULL; )
|
||||
{
|
||||
nextbuf = buf->b_next;
|
||||
close_buffer(NULL, buf, DOBUF_WIPE);
|
||||
close_buffer(NULL, buf, DOBUF_WIPE, FALSE);
|
||||
if (buf_valid(buf))
|
||||
buf = nextbuf; /* didn't work, try next one */
|
||||
else
|
||||
@@ -2064,24 +2064,22 @@ ga_grow(gap, n)
|
||||
garray_T *gap;
|
||||
int n;
|
||||
{
|
||||
size_t len;
|
||||
size_t old_len;
|
||||
size_t new_len;
|
||||
char_u *pp;
|
||||
|
||||
if (gap->ga_maxlen - gap->ga_len < n)
|
||||
{
|
||||
if (n < gap->ga_growsize)
|
||||
n = gap->ga_growsize;
|
||||
len = gap->ga_itemsize * (gap->ga_len + n);
|
||||
pp = alloc_clear((unsigned)len);
|
||||
new_len = gap->ga_itemsize * (gap->ga_len + n);
|
||||
pp = (gap->ga_data == NULL)
|
||||
? alloc((unsigned)new_len) : vim_realloc(gap->ga_data, new_len);
|
||||
if (pp == NULL)
|
||||
return FAIL;
|
||||
old_len = gap->ga_itemsize * gap->ga_maxlen;
|
||||
vim_memset(pp + old_len, 0, new_len - old_len);
|
||||
gap->ga_maxlen = gap->ga_len + n;
|
||||
if (gap->ga_data != NULL)
|
||||
{
|
||||
mch_memmove(pp, gap->ga_data,
|
||||
(size_t)(gap->ga_itemsize * gap->ga_len));
|
||||
vim_free(gap->ga_data);
|
||||
}
|
||||
gap->ga_data = pp;
|
||||
}
|
||||
return OK;
|
||||
@@ -3225,17 +3223,31 @@ call_shell(cmd, opt)
|
||||
retval = mch_call_shell(cmd, opt);
|
||||
else
|
||||
{
|
||||
ncmd = alloc((unsigned)(STRLEN(cmd) + STRLEN(p_sxq) * 2 + 1));
|
||||
char_u *ecmd = cmd;
|
||||
|
||||
if (*p_sxe != NUL && STRCMP(p_sxq, "(") == 0)
|
||||
{
|
||||
ecmd = vim_strsave_escaped_ext(cmd, p_sxe, '^', FALSE);
|
||||
if (ecmd == NULL)
|
||||
ecmd = cmd;
|
||||
}
|
||||
ncmd = alloc((unsigned)(STRLEN(ecmd) + STRLEN(p_sxq) * 2 + 1));
|
||||
if (ncmd != NULL)
|
||||
{
|
||||
STRCPY(ncmd, p_sxq);
|
||||
STRCAT(ncmd, cmd);
|
||||
STRCAT(ncmd, p_sxq);
|
||||
STRCAT(ncmd, ecmd);
|
||||
/* When 'shellxquote' is ( append ).
|
||||
* When 'shellxquote' is "( append )". */
|
||||
STRCAT(ncmd, STRCMP(p_sxq, "(") == 0 ? (char_u *)")"
|
||||
: STRCMP(p_sxq, "\"(") == 0 ? (char_u *)")\""
|
||||
: p_sxq);
|
||||
retval = mch_call_shell(ncmd, opt);
|
||||
vim_free(ncmd);
|
||||
}
|
||||
else
|
||||
retval = -1;
|
||||
if (ecmd != cmd)
|
||||
vim_free(ecmd);
|
||||
}
|
||||
#ifdef FEAT_GUI
|
||||
--hold_gui_events;
|
||||
|
||||
@@ -1943,12 +1943,14 @@ op_delete(oap)
|
||||
else /* delete characters between lines */
|
||||
{
|
||||
pos_T curpos;
|
||||
int delete_last_line;
|
||||
|
||||
/* save deleted and changed lines for undo */
|
||||
if (u_save((linenr_T)(curwin->w_cursor.lnum - 1),
|
||||
(linenr_T)(curwin->w_cursor.lnum + oap->line_count)) == FAIL)
|
||||
return FAIL;
|
||||
|
||||
delete_last_line = (oap->end.lnum == curbuf->b_ml.ml_line_count);
|
||||
truncate_line(TRUE); /* delete from cursor to end of line */
|
||||
|
||||
curpos = curwin->w_cursor; /* remember curwin->w_cursor */
|
||||
@@ -1956,7 +1958,7 @@ op_delete(oap)
|
||||
del_lines((long)(oap->line_count - 2), FALSE);
|
||||
|
||||
n = (oap->end.col + 1 - !oap->inclusive);
|
||||
if (oap->inclusive && oap->end.lnum == curbuf->b_ml.ml_line_count
|
||||
if (oap->inclusive && delete_last_line
|
||||
&& n > (int)STRLEN(ml_get(oap->end.lnum)))
|
||||
{
|
||||
/* Special case: gH<Del> deletes the last line. */
|
||||
|
||||
29
src/option.c
29
src/option.c
@@ -2271,6 +2271,15 @@ static struct vimoption
|
||||
(char_u *)"\"",
|
||||
#else
|
||||
(char_u *)"",
|
||||
#endif
|
||||
(char_u *)0L} SCRIPTID_INIT},
|
||||
{"shellxescape", "sxe", P_STRING|P_VI_DEF|P_SECURE,
|
||||
(char_u *)&p_sxe, PV_NONE,
|
||||
{
|
||||
#if defined(MSDOS) || defined(WIN16) || defined(WIN3264)
|
||||
(char_u *)"\"&|<>()@^",
|
||||
#else
|
||||
(char_u *)"",
|
||||
#endif
|
||||
(char_u *)0L} SCRIPTID_INIT},
|
||||
{"shiftround", "sr", P_BOOL|P_VI_DEF|P_VIM,
|
||||
@@ -3933,27 +3942,22 @@ set_init_3()
|
||||
* my path/to/echo" "my args to echo
|
||||
* when executed.
|
||||
*
|
||||
* To avoid this, use the /s argument in addition to /c to force the
|
||||
* stripping behavior, and also set shellxquote to automatically
|
||||
* surround the entire command in quotes (which get stripped as
|
||||
* noted).
|
||||
* To avoid this, set shellxquote to surround the command in
|
||||
* parenthesis. This appears to make most commands work, without
|
||||
* breaking commands that worked previously, such as
|
||||
* '"path with spaces/cmd" "a&b"'.
|
||||
*/
|
||||
|
||||
/* Set shellxquote default to add the quotes to be stripped. */
|
||||
idx3 = findoption((char_u *)"sxq");
|
||||
if (idx3 >= 0 && !(options[idx3].flags & P_WAS_SET))
|
||||
{
|
||||
p_sxq = (char_u *)"\"";
|
||||
p_sxq = (char_u *)"(";
|
||||
options[idx3].def_val[VI_DEFAULT] = p_sxq;
|
||||
}
|
||||
|
||||
/* Set shellcmdflag default to always strip the quotes, note the order
|
||||
* between /s and /c is important or cmd.exe will treat the /s as part
|
||||
* of the command to be executed. */
|
||||
idx3 = findoption((char_u *)"shcf");
|
||||
if (idx3 >= 0 && !(options[idx3].flags & P_WAS_SET))
|
||||
{
|
||||
p_shcf = (char_u *)"/s /c";
|
||||
p_shcf = (char_u *)"/c";
|
||||
options[idx3].def_val[VI_DEFAULT] = p_shcf;
|
||||
}
|
||||
}
|
||||
@@ -10980,7 +10984,8 @@ has_format_option(x)
|
||||
shortmess(x)
|
||||
int x;
|
||||
{
|
||||
return ( vim_strchr(p_shm, x) != NULL
|
||||
return p_shm != NULL &&
|
||||
( vim_strchr(p_shm, x) != NULL
|
||||
|| (vim_strchr(p_shm, 'a') != NULL
|
||||
&& vim_strchr((char_u *)SHM_A, x) != NULL));
|
||||
}
|
||||
|
||||
@@ -712,6 +712,7 @@ EXTERN char_u *p_sp; /* 'shellpipe' */
|
||||
#endif
|
||||
EXTERN char_u *p_shq; /* 'shellquote' */
|
||||
EXTERN char_u *p_sxq; /* 'shellxquote' */
|
||||
EXTERN char_u *p_sxe; /* 'shellxescape' */
|
||||
EXTERN char_u *p_srr; /* 'shellredir' */
|
||||
#ifdef AMIGA
|
||||
EXTERN long p_st; /* 'shelltype' */
|
||||
|
||||
270
src/os_win32.c
270
src/os_win32.c
@@ -258,6 +258,29 @@ get_exe_name(void)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Unescape characters in "p" that appear in "escaped".
|
||||
*/
|
||||
static void
|
||||
unescape_shellxquote(char_u *p, char_u *escaped)
|
||||
{
|
||||
int l = (int)STRLEN(p);
|
||||
int n;
|
||||
|
||||
while (*p != NUL)
|
||||
{
|
||||
if (*p == '^' && vim_strchr(escaped, p[1]) != NULL)
|
||||
mch_memmove(p, p + 1, l--);
|
||||
#ifdef FEAT_MBYTE
|
||||
n = (*mb_ptr2len)(p);
|
||||
#else
|
||||
n = 1;
|
||||
#endif
|
||||
p += n;
|
||||
l -= n;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Load library "name".
|
||||
*/
|
||||
@@ -3559,6 +3582,7 @@ mch_system_piped(char *cmd, int options)
|
||||
garray_T ga;
|
||||
int delay = 1;
|
||||
DWORD buffer_off = 0; /* valid bytes in buffer[] */
|
||||
char *p = NULL;
|
||||
|
||||
SECURITY_ATTRIBUTES saAttr;
|
||||
|
||||
@@ -3599,9 +3623,18 @@ mch_system_piped(char *cmd, int options)
|
||||
if (options & SHELL_READ)
|
||||
ga_init2(&ga, 1, BUFLEN);
|
||||
|
||||
if (cmd != NULL)
|
||||
{
|
||||
p = (char *)vim_strsave((char_u *)cmd);
|
||||
if (p != NULL)
|
||||
unescape_shellxquote((char_u *)p, p_sxe);
|
||||
else
|
||||
p = cmd;
|
||||
}
|
||||
|
||||
/* Now, run the command */
|
||||
CreateProcess(NULL, /* Executable name */
|
||||
cmd, /* Command to execute */
|
||||
p, /* Command to execute */
|
||||
NULL, /* Process security attributes */
|
||||
NULL, /* Thread security attributes */
|
||||
|
||||
@@ -3616,6 +3649,8 @@ mch_system_piped(char *cmd, int options)
|
||||
&si, /* Startup information */
|
||||
&pi); /* Process information */
|
||||
|
||||
if (p != cmd)
|
||||
vim_free(p);
|
||||
|
||||
/* Close our unused side of the pipes */
|
||||
CloseHandle(g_hChildStd_IN_Rd);
|
||||
@@ -3898,106 +3933,147 @@ mch_call_shell(
|
||||
else
|
||||
{
|
||||
/* we use "command" or "cmd" to start the shell; slow but easy */
|
||||
char_u *newcmd;
|
||||
long_u cmdlen = (
|
||||
char_u *newcmd = NULL;
|
||||
char_u *cmdbase = cmd;
|
||||
long_u cmdlen;
|
||||
|
||||
/* Skip a leading ", ( and "(. */
|
||||
if (*cmdbase == '"' )
|
||||
++cmdbase;
|
||||
if (*cmdbase == '(')
|
||||
++cmdbase;
|
||||
|
||||
if ((STRNICMP(cmdbase, "start", 5) == 0) && vim_iswhite(cmdbase[5]))
|
||||
{
|
||||
STARTUPINFO si;
|
||||
PROCESS_INFORMATION pi;
|
||||
DWORD flags = CREATE_NEW_CONSOLE;
|
||||
char_u *p;
|
||||
|
||||
si.cb = sizeof(si);
|
||||
si.lpReserved = NULL;
|
||||
si.lpDesktop = NULL;
|
||||
si.lpTitle = NULL;
|
||||
si.dwFlags = 0;
|
||||
si.cbReserved2 = 0;
|
||||
si.lpReserved2 = NULL;
|
||||
|
||||
cmdbase = skipwhite(cmdbase + 5);
|
||||
if ((STRNICMP(cmdbase, "/min", 4) == 0)
|
||||
&& vim_iswhite(cmdbase[4]))
|
||||
{
|
||||
cmdbase = skipwhite(cmdbase + 4);
|
||||
si.dwFlags = STARTF_USESHOWWINDOW;
|
||||
si.wShowWindow = SW_SHOWMINNOACTIVE;
|
||||
}
|
||||
else if ((STRNICMP(cmdbase, "/b", 2) == 0)
|
||||
&& vim_iswhite(cmdbase[2]))
|
||||
{
|
||||
cmdbase = skipwhite(cmdbase + 2);
|
||||
flags = CREATE_NO_WINDOW;
|
||||
si.dwFlags = STARTF_USESTDHANDLES;
|
||||
si.hStdInput = CreateFile("\\\\.\\NUL", // File name
|
||||
GENERIC_READ, // Access flags
|
||||
0, // Share flags
|
||||
NULL, // Security att.
|
||||
OPEN_EXISTING, // Open flags
|
||||
FILE_ATTRIBUTE_NORMAL, // File att.
|
||||
NULL); // Temp file
|
||||
si.hStdOutput = si.hStdInput;
|
||||
si.hStdError = si.hStdInput;
|
||||
}
|
||||
|
||||
/* Remove a trailing ", ) and )" if they have a match
|
||||
* at the start of the command. */
|
||||
if (cmdbase > cmd)
|
||||
{
|
||||
p = cmdbase + STRLEN(cmdbase);
|
||||
if (p > cmdbase && p[-1] == '"' && *cmd == '"')
|
||||
*--p = NUL;
|
||||
if (p > cmdbase && p[-1] == ')'
|
||||
&& (*cmd =='(' || cmd[1] == '('))
|
||||
*--p = NUL;
|
||||
}
|
||||
|
||||
newcmd = cmdbase;
|
||||
unescape_shellxquote(cmdbase, p_sxe);
|
||||
|
||||
/*
|
||||
* If creating new console, arguments are passed to the
|
||||
* 'cmd.exe' as-is. If it's not, arguments are not treated
|
||||
* correctly for current 'cmd.exe'. So unescape characters in
|
||||
* shellxescape except '|' for avoiding to be treated as
|
||||
* argument to them. Pass the arguments to sub-shell.
|
||||
*/
|
||||
if (flags != CREATE_NEW_CONSOLE)
|
||||
{
|
||||
char_u *subcmd;
|
||||
char_u *cmd_shell = mch_getenv("COMSPEC");
|
||||
|
||||
if (cmd_shell == NULL || *cmd_shell == NUL)
|
||||
cmd_shell = default_shell();
|
||||
|
||||
subcmd = vim_strsave_escaped_ext(cmdbase, "|", '^', FALSE);
|
||||
if (subcmd != NULL)
|
||||
{
|
||||
/* make "cmd.exe /c arguments" */
|
||||
cmdlen = STRLEN(cmd_shell) + STRLEN(subcmd) + 5;
|
||||
newcmd = lalloc(cmdlen, TRUE);
|
||||
if (newcmd != NULL)
|
||||
vim_snprintf((char *)newcmd, cmdlen, "%s /c %s",
|
||||
cmd_shell, subcmd);
|
||||
else
|
||||
newcmd = cmdbase;
|
||||
vim_free(subcmd);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Now, start the command as a process, so that it doesn't
|
||||
* inherit our handles which causes unpleasant dangling swap
|
||||
* files if we exit before the spawned process
|
||||
*/
|
||||
if (CreateProcess(NULL, // Executable name
|
||||
newcmd, // Command to execute
|
||||
NULL, // Process security attributes
|
||||
NULL, // Thread security attributes
|
||||
FALSE, // Inherit handles
|
||||
flags, // Creation flags
|
||||
NULL, // Environment
|
||||
NULL, // Current directory
|
||||
&si, // Startup information
|
||||
&pi)) // Process information
|
||||
x = 0;
|
||||
else
|
||||
{
|
||||
x = -1;
|
||||
#ifdef FEAT_GUI_W32
|
||||
EMSG(_("E371: Command not found"));
|
||||
#endif
|
||||
}
|
||||
|
||||
if (newcmd != cmdbase)
|
||||
vim_free(newcmd);
|
||||
|
||||
if (si.hStdInput != NULL)
|
||||
{
|
||||
/* Close the handle to \\.\NUL */
|
||||
CloseHandle(si.hStdInput);
|
||||
}
|
||||
/* Close the handles to the subprocess, so that it goes away */
|
||||
CloseHandle(pi.hThread);
|
||||
CloseHandle(pi.hProcess);
|
||||
}
|
||||
else
|
||||
{
|
||||
cmdlen = (
|
||||
#ifdef FEAT_GUI_W32
|
||||
(allowPiping && !p_stmp ? 0 : STRLEN(vimrun_path)) +
|
||||
#endif
|
||||
STRLEN(p_sh) + STRLEN(p_shcf) + STRLEN(cmd) + 10);
|
||||
|
||||
newcmd = lalloc(cmdlen, TRUE);
|
||||
if (newcmd != NULL)
|
||||
{
|
||||
char_u *cmdbase = (*cmd == '"' ? cmd + 1 : cmd);
|
||||
|
||||
if ((STRNICMP(cmdbase, "start", 5) == 0) && vim_iswhite(cmdbase[5]))
|
||||
{
|
||||
STARTUPINFO si;
|
||||
PROCESS_INFORMATION pi;
|
||||
DWORD flags = CREATE_NEW_CONSOLE;
|
||||
|
||||
si.cb = sizeof(si);
|
||||
si.lpReserved = NULL;
|
||||
si.lpDesktop = NULL;
|
||||
si.lpTitle = NULL;
|
||||
si.dwFlags = 0;
|
||||
si.cbReserved2 = 0;
|
||||
si.lpReserved2 = NULL;
|
||||
|
||||
cmdbase = skipwhite(cmdbase + 5);
|
||||
if ((STRNICMP(cmdbase, "/min", 4) == 0)
|
||||
&& vim_iswhite(cmdbase[4]))
|
||||
{
|
||||
cmdbase = skipwhite(cmdbase + 4);
|
||||
si.dwFlags = STARTF_USESHOWWINDOW;
|
||||
si.wShowWindow = SW_SHOWMINNOACTIVE;
|
||||
}
|
||||
else if ((STRNICMP(cmdbase, "/b", 2) == 0)
|
||||
&& vim_iswhite(cmdbase[2]))
|
||||
{
|
||||
cmdbase = skipwhite(cmdbase + 2);
|
||||
flags = CREATE_NO_WINDOW;
|
||||
si.dwFlags = STARTF_USESTDHANDLES;
|
||||
si.hStdInput = CreateFile("\\\\.\\NUL", // File name
|
||||
GENERIC_READ, // Access flags
|
||||
0, // Share flags
|
||||
NULL, // Security att.
|
||||
OPEN_EXISTING, // Open flags
|
||||
FILE_ATTRIBUTE_NORMAL, // File att.
|
||||
NULL); // Temp file
|
||||
si.hStdOutput = si.hStdInput;
|
||||
si.hStdError = si.hStdInput;
|
||||
}
|
||||
|
||||
/* When the command is in double quotes, but 'shellxquote' is
|
||||
* empty, keep the double quotes around the command.
|
||||
* Otherwise remove the double quotes, they aren't needed
|
||||
* here, because we don't use a shell to run the command. */
|
||||
if (*cmd == '"' && *p_sxq == NUL)
|
||||
{
|
||||
newcmd[0] = '"';
|
||||
STRCPY(newcmd + 1, cmdbase);
|
||||
}
|
||||
else
|
||||
{
|
||||
STRCPY(newcmd, cmdbase);
|
||||
if (*cmd == '"' && *newcmd != NUL)
|
||||
newcmd[STRLEN(newcmd) - 1] = NUL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Now, start the command as a process, so that it doesn't
|
||||
* inherit our handles which causes unpleasant dangling swap
|
||||
* files if we exit before the spawned process
|
||||
*/
|
||||
if (CreateProcess (NULL, // Executable name
|
||||
newcmd, // Command to execute
|
||||
NULL, // Process security attributes
|
||||
NULL, // Thread security attributes
|
||||
FALSE, // Inherit handles
|
||||
flags, // Creation flags
|
||||
NULL, // Environment
|
||||
NULL, // Current directory
|
||||
&si, // Startup information
|
||||
&pi)) // Process information
|
||||
x = 0;
|
||||
else
|
||||
{
|
||||
x = -1;
|
||||
#ifdef FEAT_GUI_W32
|
||||
EMSG(_("E371: Command not found"));
|
||||
#endif
|
||||
}
|
||||
if (si.hStdInput != NULL)
|
||||
{
|
||||
/* Close the handle to \\.\NUL */
|
||||
CloseHandle(si.hStdInput);
|
||||
}
|
||||
/* Close the handles to the subprocess, so that it goes away */
|
||||
CloseHandle(pi.hThread);
|
||||
CloseHandle(pi.hProcess);
|
||||
}
|
||||
else
|
||||
newcmd = lalloc(cmdlen, TRUE);
|
||||
if (newcmd != NULL)
|
||||
{
|
||||
#if defined(FEAT_GUI_W32)
|
||||
if (need_vimrun_warning)
|
||||
@@ -4023,8 +4099,8 @@ mch_call_shell(
|
||||
vim_snprintf((char *)newcmd, cmdlen, "%s %s %s",
|
||||
p_sh, p_shcf, cmd);
|
||||
x = mch_system((char *)newcmd, options);
|
||||
vim_free(newcmd);
|
||||
}
|
||||
vim_free(newcmd);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* buffer.c */
|
||||
int open_buffer __ARGS((int read_stdin, exarg_T *eap, int flags));
|
||||
int buf_valid __ARGS((buf_T *buf));
|
||||
void close_buffer __ARGS((win_T *win, buf_T *buf, int action));
|
||||
void close_buffer __ARGS((win_T *win, buf_T *buf, int action, int abort_if_last));
|
||||
void buf_clear_file __ARGS((buf_T *buf));
|
||||
void buf_freeall __ARGS((buf_T *buf, int flags));
|
||||
void goto_buffer __ARGS((exarg_T *eap, int start, int dir, int count));
|
||||
|
||||
@@ -44,6 +44,7 @@ int has_cursorhold __ARGS((void));
|
||||
int trigger_cursorhold __ARGS((void));
|
||||
int has_cursormoved __ARGS((void));
|
||||
int has_cursormovedI __ARGS((void));
|
||||
int has_insertcharpre __ARGS((void));
|
||||
void block_autocmds __ARGS((void));
|
||||
void unblock_autocmds __ARGS((void));
|
||||
int has_autocmd __ARGS((event_T event, char_u *sfname, buf_T *buf));
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
/* window.c */
|
||||
void do_window __ARGS((int nchar, long Prenum, int xchar));
|
||||
int win_split __ARGS((int size, int flags));
|
||||
int win_split_ins __ARGS((int size, int flags, win_T *newwin, int dir));
|
||||
int win_split_ins __ARGS((int size, int flags, win_T *new_wp, int dir));
|
||||
int win_valid __ARGS((win_T *win));
|
||||
int win_count __ARGS((void));
|
||||
int make_windows __ARGS((int count, int vertical));
|
||||
void win_move_after __ARGS((win_T *win1, win_T *win2));
|
||||
void win_equal __ARGS((win_T *next_curwin, int current, int dir));
|
||||
void close_windows __ARGS((buf_T *buf, int keep_curwin));
|
||||
int one_window __ARGS((void));
|
||||
void win_close __ARGS((win_T *win, int free_buf));
|
||||
void win_close_othertab __ARGS((win_T *win, int free_buf, tabpage_T *tp));
|
||||
void win_free_all __ARGS((void));
|
||||
|
||||
@@ -3565,7 +3565,7 @@ unload_dummy_buffer(buf)
|
||||
buf_T *buf;
|
||||
{
|
||||
if (curbuf != buf) /* safety check */
|
||||
close_buffer(NULL, buf, DOBUF_UNLOAD);
|
||||
close_buffer(NULL, buf, DOBUF_UNLOAD, FALSE);
|
||||
}
|
||||
|
||||
#if defined(FEAT_EVAL) || defined(PROTO)
|
||||
|
||||
@@ -50,6 +50,43 @@ STARTTEST
|
||||
:call append(line('$'), test_status)
|
||||
:"
|
||||
:"
|
||||
:" Test for ":tab drop exist-file" to keep current window.
|
||||
:sp test1
|
||||
:tab drop test1
|
||||
:let test_status = 'tab drop 1: fail'
|
||||
:if tabpagenr('$') == 1 && winnr('$') == 2 && winnr() == 1
|
||||
: let test_status = 'tab drop 1: pass'
|
||||
:endif
|
||||
:close
|
||||
:call append(line('$'), test_status)
|
||||
:"
|
||||
:"
|
||||
:" Test for ":tab drop new-file" to keep current window of tabpage 1.
|
||||
:split
|
||||
:tab drop newfile
|
||||
:let test_status = 'tab drop 2: fail'
|
||||
:if tabpagenr('$') == 2 && tabpagewinnr(1, '$') == 2 && tabpagewinnr(1) == 1
|
||||
: let test_status = 'tab drop 2: pass'
|
||||
:endif
|
||||
:tabclose
|
||||
:q
|
||||
:call append(line('$'), test_status)
|
||||
:"
|
||||
:"
|
||||
:" Test for ":tab drop multi-opend-file" to keep current tabpage and window.
|
||||
:new test1
|
||||
:tabnew
|
||||
:new test1
|
||||
:tab drop test1
|
||||
:let test_status = 'tab drop 3: fail'
|
||||
:if tabpagenr() == 2 && tabpagewinnr(2, '$') == 2 && tabpagewinnr(2) == 1
|
||||
: let test_status = 'tab drop 3: pass'
|
||||
:endif
|
||||
:tabclose
|
||||
:q
|
||||
:call append(line('$'), test_status)
|
||||
:"
|
||||
:"
|
||||
:/^Results/,$w! test.out
|
||||
:qa!
|
||||
ENDTEST
|
||||
|
||||
@@ -5,3 +5,6 @@ this is tab page 1
|
||||
this is tab page 4
|
||||
gettabvar: pass
|
||||
settabvar: pass
|
||||
tab drop 1: pass
|
||||
tab drop 2: pass
|
||||
tab drop 3: pass
|
||||
|
||||
@@ -714,6 +714,48 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
464,
|
||||
/**/
|
||||
464,
|
||||
/**/
|
||||
463,
|
||||
/**/
|
||||
462,
|
||||
/**/
|
||||
461,
|
||||
/**/
|
||||
460,
|
||||
/**/
|
||||
459,
|
||||
/**/
|
||||
458,
|
||||
/**/
|
||||
457,
|
||||
/**/
|
||||
456,
|
||||
/**/
|
||||
455,
|
||||
/**/
|
||||
454,
|
||||
/**/
|
||||
453,
|
||||
/**/
|
||||
452,
|
||||
/**/
|
||||
451,
|
||||
/**/
|
||||
450,
|
||||
/**/
|
||||
449,
|
||||
/**/
|
||||
448,
|
||||
/**/
|
||||
447,
|
||||
/**/
|
||||
446,
|
||||
/**/
|
||||
445,
|
||||
/**/
|
||||
444,
|
||||
/**/
|
||||
@@ -2149,12 +2191,9 @@ do_intro_line(row, mesg, add_version, attr)
|
||||
/* Check for 9.9x or 9.9xx, alpha/beta version */
|
||||
if (isalpha((int)vers[3]))
|
||||
{
|
||||
if (isalpha((int)vers[4]))
|
||||
sprintf((char *)vers + 5, ".%d%s", highest_patch(),
|
||||
mediumVersion + 5);
|
||||
else
|
||||
sprintf((char *)vers + 4, ".%d%s", highest_patch(),
|
||||
mediumVersion + 4);
|
||||
int len = (isalpha((int)vers[4])) ? 5 : 4;
|
||||
sprintf((char *)vers + len, ".%d%s", highest_patch(),
|
||||
mediumVersion + len);
|
||||
}
|
||||
else
|
||||
sprintf((char *)vers + 3, ".%d", highest_patch());
|
||||
|
||||
@@ -23,7 +23,6 @@ static void win_rotate __ARGS((int, int));
|
||||
static void win_totop __ARGS((int size, int flags));
|
||||
static void win_equal_rec __ARGS((win_T *next_curwin, int current, frame_T *topfr, int dir, int col, int row, int width, int height));
|
||||
static int last_window __ARGS((void));
|
||||
static int one_window __ARGS((void));
|
||||
static win_T *win_free_mem __ARGS((win_T *win, int *dirp, tabpage_T *tp));
|
||||
static frame_T *win_altframe __ARGS((win_T *win, tabpage_T *tp));
|
||||
static tabpage_T *alt_tabpage __ARGS((void));
|
||||
@@ -2083,7 +2082,7 @@ last_window()
|
||||
* Return TRUE if there is only one window other than "aucmd_win" in the
|
||||
* current tab page.
|
||||
*/
|
||||
static int
|
||||
int
|
||||
one_window()
|
||||
{
|
||||
#ifdef FEAT_AUTOCMD
|
||||
@@ -2109,7 +2108,7 @@ one_window()
|
||||
* Close window "win". Only works for the current tab page.
|
||||
* If "free_buf" is TRUE related buffer may be unloaded.
|
||||
*
|
||||
* called by :quit, :close, :xit, :wq and findtag()
|
||||
* Called by :quit, :close, :xit, :wq and findtag().
|
||||
*/
|
||||
void
|
||||
win_close(win, free_buf)
|
||||
@@ -2222,7 +2221,7 @@ win_close(win, free_buf)
|
||||
* Close the link to the buffer.
|
||||
*/
|
||||
if (win->w_buffer != NULL)
|
||||
close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0);
|
||||
close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0, TRUE);
|
||||
|
||||
/* Autocommands may have closed the window already, or closed the only
|
||||
* other window or moved to another tab page. */
|
||||
@@ -2328,7 +2327,7 @@ win_close_othertab(win, free_buf, tp)
|
||||
int free_tp = FALSE;
|
||||
|
||||
/* Close the link to the buffer. */
|
||||
close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0);
|
||||
close_buffer(win, win->w_buffer, free_buf ? DOBUF_UNLOAD : 0, FALSE);
|
||||
|
||||
/* Careful: Autocommands may have closed the tab page or made it the
|
||||
* current tab page. */
|
||||
|
||||
Reference in New Issue
Block a user