0
0
mirror of https://github.com/vim/vim.git synced 2025-07-04 23:07:33 -04:00

updated for version 7.0e06

This commit is contained in:
Bram Moolenaar 2006-04-22 22:33:57 +00:00
parent 57657d85c6
commit eb3593b38b
49 changed files with 729 additions and 365 deletions

View File

@ -10,6 +10,7 @@
" Ruby IRB/Complete author: Keiju ISHITSUKA(keiju@ishitsuka.com) " Ruby IRB/Complete author: Keiju ISHITSUKA(keiju@ishitsuka.com)
" ---------------------------------------------------------------------------- " ----------------------------------------------------------------------------
" {{{ requirement checks
if !has('ruby') if !has('ruby')
echohl ErrorMsg echohl ErrorMsg
echo "Error: Required vim compiled with +ruby" echo "Error: Required vim compiled with +ruby"
@ -23,8 +24,17 @@ if version < 700
echohl None echohl None
finish finish
endif endif
" }}} requirement checks
if !exists("g:rubycomplete_rails")
let g:rubycomplete_rails = 0
endif
if !exists("g:rubycomplete_classes_in_global")
let g:rubycomplete_classes_in_global = 0
endif
" {{{ vim-side support functions
function! GetBufferRubyModule(name) function! GetBufferRubyModule(name)
let [snum,enum] = GetBufferRubyEntity(a:name, "module") let [snum,enum] = GetBufferRubyEntity(a:name, "module")
return snum . '..' . enum return snum . '..' . enum
@ -103,6 +113,8 @@ function! GetRubyVarType(v)
return '' return ''
endfunction endfunction
"}}} vim-side support functions
function! rubycomplete#Complete(findstart, base) function! rubycomplete#Complete(findstart, base)
"findstart = 1 when we need to get the text length "findstart = 1 when we need to get the text length
if a:findstart if a:findstart
@ -133,6 +145,7 @@ endfunction
function! s:DefRuby() function! s:DefRuby()
ruby << RUBYEOF ruby << RUBYEOF
# {{{ ruby completion
RailsWords = [ RailsWords = [
"has_many", "has_one", "has_many", "has_one",
"belongs_to", "belongs_to",
@ -164,11 +177,11 @@ Operators = [ "%", "&", "*", "**", "+", "-", "/",
def load_requires def load_requires
@buf = VIM::Buffer.current buf = VIM::Buffer.current
enum = @buf.line_number enum = buf.line_number
nums = Range.new( 1, enum ) nums = Range.new( 1, enum )
nums.each do |x| nums.each do |x|
ln = @buf[x] ln = buf[x]
begin begin
eval( "require %s" % $1 ) if /.*require\s*(.*)$/.match( ln ) eval( "require %s" % $1 ) if /.*require\s*(.*)$/.match( ln )
rescue Exception rescue Exception
@ -198,7 +211,7 @@ def load_buffer_module(name)
end end
def get_buffer_entity(name, vimfun) def get_buffer_entity(name, vimfun)
@buf = VIM::Buffer.current buf = VIM::Buffer.current
nums = eval( VIM::evaluate( vimfun % name ) ) nums = eval( VIM::evaluate( vimfun % name ) )
return nil if nums == nil return nil if nums == nil
return nil if nums.min == nums.max && nums.min == 0 return nil if nums.min == nums.max && nums.min == 0
@ -207,7 +220,7 @@ def get_buffer_entity(name, vimfun)
classdef = "" classdef = ""
nums.each do |x| nums.each do |x|
if x != cur_line if x != cur_line
ln = @buf[x] ln = buf[x]
classdef += "%s\n" % ln classdef += "%s\n" % ln
end end
end end
@ -215,6 +228,25 @@ def get_buffer_entity(name, vimfun)
return classdef return classdef
end end
def get_buffer_classes()
# this will be a little expensive.
allow_aggressive_load = VIM::evaluate('g:rubycomplete_classes_in_global')
return [] if allow_aggressive_load != '1'
buf = VIM::Buffer.current
eob = buf.length
ret = []
rg = 1..eob
rg.each do |x|
if /^\s*class\s*([A-Za-z0-9_-]*)(\s*<\s*([A-Za-z0-9_:-]*))?\s*/.match( buf[x] )
ret.push $1
end
end
return ret
end
def load_rails() def load_rails()
allow_rails = VIM::evaluate('g:rubycomplete_rails') allow_rails = VIM::evaluate('g:rubycomplete_rails')
return if allow_rails != '1' return if allow_rails != '1'
@ -233,13 +265,19 @@ def load_rails()
break break
end end
end end
return if pok == nil
bootfile = pok + "/boot.rb" bootfile = pok + "/boot.rb"
require bootfile if pok != nil && File.exists?( bootfile ) if File.exists?( bootfile )
require bootfile
VIM::evaluate('let g:rubycomplete_rails_loaded = 1')
end
end end
def get_rails_helpers def get_rails_helpers
allow_rails = VIM::evaluate('g:rubycomplete_rails') allow_rails = VIM::evaluate('g:rubycomplete_rails')
return [] if allow_rails != '1' rails_loaded = VIM::evaluate('g:rubycomplete_rails_loaded')
return [] if allow_rails != '1' || rails_loaded != '1'
return RailsWords return RailsWords
end end
@ -404,14 +442,21 @@ def get_completions(base)
receiver = $1 receiver = $1
message = input message = input
load_buffer_class( receiver ) load_buffer_class( receiver )
candidates = eval( "#{receiver}.instance_methods" ) begin
candidates += get_rails_helpers candidates = eval( "#{receiver}.instance_methods" )
select_message(receiver, message, candidates) candidates += get_rails_helpers
select_message(receiver, message, candidates)
rescue Exception
found = nil
end
end end
end end
if inclass == nil || found == nil if inclass == nil || found == nil
candidates = eval("self.class.constants") candidates = eval("self.class.constants")
candidates += get_buffer_classes
candidates.uniq!
candidates.sort!
(candidates|ReservedWords).grep(/^#{Regexp.quote(input)}/) (candidates|ReservedWords).grep(/^#{Regexp.quote(input)}/)
end end
end end
@ -459,10 +504,12 @@ def select_message(receiver, message, candidates)
candidates.uniq! candidates.uniq!
candidates.sort! candidates.sort!
end end
# }}} ruby completion
RUBYEOF RUBYEOF
endfunction endfunction
let g:rubycomplete_rails_loaded = 0
let g:rubycomplete_rails = 0
call s:DefRuby() call s:DefRuby()
" vim: set et ts=4: " vim:tw=78:sw=4:ts=8:ft=vim:norl:

View File

@ -1,8 +1,8 @@
" Vim completion script " Vim completion script
" Language: SQL " Language: SQL
" Maintainer: David Fishburn <fishburn@ianywhere.com> " Maintainer: David Fishburn <fishburn@ianywhere.com>
" Version: 2.0 " Version: 3.0
" Last Change: Mon Apr 03 2006 10:21:36 PM " Last Change: Thu Apr 20 2006 8:47:12 PM
" Set completion with CTRL-X CTRL-O to autoloaded function. " Set completion with CTRL-X CTRL-O to autoloaded function.
" This check is in place in case this script is " This check is in place in case this script is
@ -18,7 +18,7 @@ endif
if exists('g:loaded_sql_completion') if exists('g:loaded_sql_completion')
finish finish
endif endif
let g:loaded_sql_completion = 1 let g:loaded_sql_completion = 30
" Maintains filename of dictionary " Maintains filename of dictionary
let s:sql_file_table = "" let s:sql_file_table = ""
@ -60,6 +60,24 @@ if !exists('g:omni_sql_precache_syntax_groups')
\ 'sqlStatement' \ 'sqlStatement'
\ ] \ ]
endif endif
" Set ignorecase to the ftplugin standard
if !exists('g:omni_sql_ignorecase')
let g:omni_sql_ignorecase = &ignorecase
endif
" During table completion, should the table list also
" include the owner name
if !exists('g:omni_sql_include_owner')
let g:omni_sql_include_owner = 0
if exists('g:loaded_dbext')
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
" code replacement.
let g:omni_sql_include_owner = 1
endif
endif
endif
" This function is used for the 'omnifunc' option. " This function is used for the 'omnifunc' option.
function! sqlcomplete#Complete(findstart, base) function! sqlcomplete#Complete(findstart, base)
@ -81,15 +99,27 @@ function! sqlcomplete#Complete(findstart, base)
while start > 0 while start > 0
if line[start - 1] =~ '\w' if line[start - 1] =~ '\w'
let start -= 1 let start -= 1
elseif line[start - 1] =~ '\.' && compl_type =~ 'column' elseif line[start - 1] =~ '\.' &&
" If the completion type is column then assume we are looking \ compl_type =~ 'column\|table\|view\|procedure'
" for column completion column_type can be either " If lastword has already been set for column completion
" 'column' or 'column_csv' " break from the loop, since we do not also want to pickup
if lastword == -1 && compl_type == 'column' " a table name if it was also supplied.
" Do not replace the table name prefix or alias if lastword != -1 && compl_type =~ 'column'
" if completing only a single column name break
endif
" Assume we are looking for column completion
" column_type can be either 'column' or 'column_csv'
if lastword == -1 && compl_type =~ 'column'
let lastword = start let lastword = start
endif 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' &&
\ g:omni_sql_include_owner == 0
let lastword = start
break
endif
let start -= 1 let start -= 1
else else
break break
@ -144,6 +174,14 @@ function! sqlcomplete#Complete(findstart, base)
if s:sql_file_{compl_type} != "" if s:sql_file_{compl_type} != ""
if filereadable(s:sql_file_{compl_type}) if filereadable(s:sql_file_{compl_type})
let compl_list = readfile(s:sql_file_{compl_type}) let compl_list = readfile(s:sql_file_{compl_type})
" let dic_list = readfile(s:sql_file_{compl_type})
" if !empty(dic_list)
" for elem in dic_list
" let kind = (compl_type=='table'?'m':(compl_type=='procedure'?'f':'v'))
" let item = {'word':elem, 'menu':elem, 'kind':kind, 'info':compl_type}
" let compl_list += [item]
" endfor
" endif
endif endif
endif endif
elseif compl_type == 'column' elseif compl_type == 'column'
@ -203,8 +241,8 @@ function! sqlcomplete#Complete(findstart, base)
if base != '' if base != ''
" Filter the list based on the first few characters the user " Filter the list based on the first few characters the user
" entered " entered
let expr = 'v:val =~ "^'.base.'"' let expr = 'v:val '.(g:omni_sql_ignorecase==1?'=~?':'=~#').' "^'.base.'"'
let compl_list = filter(copy(compl_list), expr) let compl_list = filter(deepcopy(compl_list), expr)
endif endif
if exists('b:sql_compl_savefunc') && b:sql_compl_savefunc != "" if exists('b:sql_compl_savefunc') && b:sql_compl_savefunc != ""
@ -297,8 +335,8 @@ function! s:SQLCCheck4dbext()
" Leave time for the user to read the error message " Leave time for the user to read the error message
:sleep 2 :sleep 2
return -1 return -1
elseif g:loaded_dbext < 210 elseif g:loaded_dbext < 300
let msg = "The dbext plugin must be at least version 2.10 " . let msg = "The dbext plugin must be at least version 3.00 " .
\ " for dynamic SQL completion" \ " for dynamic SQL completion"
call s:SQLCErrorMsg(msg) call s:SQLCErrorMsg(msg)
" Leave time for the user to read the error message " Leave time for the user to read the error message
@ -363,7 +401,7 @@ function! s:SQLCGetColumns(table_name, list_type)
let table_alias = '' let table_alias = ''
let move_to_top = 1 let move_to_top = 1
if g:loaded_dbext >= 210 if g:loaded_dbext >= 300
let saveSettingAlias = DB_listOption('use_tbl_alias') let saveSettingAlias = DB_listOption('use_tbl_alias')
exec 'DBSetOption use_tbl_alias=n' exec 'DBSetOption use_tbl_alias=n'
endif endif
@ -479,7 +517,7 @@ function! s:SQLCGetColumns(table_name, list_type)
call cursor(curline, curcol) call cursor(curline, curcol)
if found == 0 if found == 0
if g:loaded_dbext > 201 if g:loaded_dbext > 300
exec 'DBSetOption use_tbl_alias='.saveSettingAlias exec 'DBSetOption use_tbl_alias='.saveSettingAlias
endif endif
@ -502,7 +540,7 @@ function! s:SQLCGetColumns(table_name, list_type)
endif endif
if g:loaded_dbext > 201 if g:loaded_dbext > 300
exec 'DBSetOption use_tbl_alias='.saveSettingAlias exec 'DBSetOption use_tbl_alias='.saveSettingAlias
endif endif

View File

@ -1,4 +1,4 @@
*motion.txt* For Vim version 7.0e. Last change: 2006 Apr 18 *motion.txt* For Vim version 7.0e. Last change: 2006 Apr 22
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -769,6 +769,7 @@ g'{mark} g`{mark}
*:marks* *:marks*
:marks List all the current marks (not a motion command). :marks List all the current marks (not a motion command).
The |'(|, |')|, |'{| and |'}| marks are not listed. The |'(|, |')|, |'{| and |'}| marks are not listed.
The first column is number zero.
{not in Vi} {not in Vi}
*E283* *E283*
:marks {arg} List the marks that are mentioned in {arg} (not a :marks {arg} List the marks that are mentioned in {arg} (not a

View File

@ -1,4 +1,4 @@
*pattern.txt* For Vim version 7.0e. Last change: 2006 Apr 02 *pattern.txt* For Vim version 7.0e. Last change: 2006 Apr 22
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -341,6 +341,50 @@ For starters, read chapter 27 of the user manual |usr_27.txt|.
or \z( pattern \) |/\z(| or \z( pattern \) |/\z(|
==============================================================================
3. Magic */magic*
Some characters in the pattern are taken literally. They match with the same
character in the text. When preceded with a backslash however, these
characters get a special meaning.
Other characters have a special meaning without a backslash. They need to be
preceded with a backslash to match literally.
If a character is taken literally or not depends on the 'magic' option and the
items mentioned next.
*/\m* */\M*
Use of "\m" makes the pattern after it be interpreted as if 'magic' is set,
ignoring the actual value of the 'magic' option.
Use of "\M" makes the pattern after it be interpreted as if 'nomagic' is used.
*/\v* */\V*
Use of "\v" means that in the pattern after it all ASCII characters except
'0'-'9', 'a'-'z', 'A'-'Z' and '_' have a special meaning. "very magic"
Use of "\V" means that in the pattern after it only the backslash has a
special meaning. "very nomagic"
Examples:
after: \v \m \M \V matches ~
'magic' 'nomagic'
$ $ $ \$ matches end-of-line
. . \. \. matches any character
* * \* \* any number of the previous atom
() \(\) \(\) \(\) grouping into an atom
| \| \| \| separating alternatives
\a \a \a \a alphabetic character
\\ \\ \\ \\ literal backslash
\. \. . . literal dot
\{ { { { literal '{'
a a a a literal 'a'
{only Vim supports \m, \M, \v and \V}
It is recommended to always keep the 'magic' option at the default setting,
which is 'magic'. This avoids portability problems. To make a pattern immune
to the 'magic' option being set or not, put "\m" or "\M" at the start of the
pattern.
============================================================================== ==============================================================================
4. Overview of pattern items *pattern-overview* 4. Overview of pattern items *pattern-overview*
@ -485,51 +529,6 @@ cat\Z Both "cat" and "càt" ("a" followed by 0x0300)
though it may look the same. though it may look the same.
==============================================================================
3. Magic */magic*
Some characters in the pattern are taken literally. They match with the same
character in the text. When preceded with a backslash however, these
characters get a special meaning.
Other characters have a special meaning without a backslash. They need to be
preceded with a backslash to match literally.
If a character is taken literally or not depends on the 'magic' option and the
items mentioned next.
*/\m* */\M*
Use of "\m" makes the pattern after it be interpreted as if 'magic' is set,
ignoring the actual value of the 'magic' option.
Use of "\M" makes the pattern after it be interpreted as if 'nomagic' is used.
*/\v* */\V*
Use of "\v" means that in the pattern after it all ASCII characters except
'0'-'9', 'a'-'z', 'A'-'Z' and '_' have a special meaning. "very magic"
Use of "\V" means that in the pattern after it only the backslash has a
special meaning. "very nomagic"
Examples:
after: \v \m \M \V matches ~
'magic' 'nomagic'
$ $ $ \$ matches end-of-line
. . \. \. matches any character
* * \* \* any number of the previous atom
() \(\) \(\) \(\) grouping into an atom
| \| \| \| separating alternatives
\a \a \a \a alphabetic character
\\ \\ \\ \\ literal backslash
\. \. . . literal dot
\{ { { { literal '{'
a a a a literal 'a'
{only Vim supports \m, \M, \v and \V}
It is recommended to always keep the 'magic' option at the default setting,
which is 'magic'. This avoids portability problems. To make a pattern immune
to the 'magic' option being set or not, put "\m" or "\M" at the start of the
pattern.
============================================================================== ==============================================================================
5. Multi items *pattern-multi-items* 5. Multi items *pattern-multi-items*

View File

@ -1,4 +1,4 @@
*tar.txt* For Vim version 7.0e. Last change: 2006 Mar 24 *pi_tar.txt* For Vim version 7.0e. Last change: 2006 Apr 22
+====================+ +====================+
| Tar File Interface | | Tar File Interface |

View File

@ -1,4 +1,4 @@
*zip.txt* For Vim version 7.0e. Last change: 2006 Apr 10 *pi_zip.txt* For Vim version 7.0e. Last change: 2006 Apr 22
+====================+ +====================+
| Zip File Interface | | Zip File Interface |

View File

@ -1,4 +1,4 @@
*sql.txt* For Vim version 7.0e. Last change: Mon Apr 03 2006 10:34:00 PM *sql.txt* For Vim version 7.0e. Last change: Fri Apr 21 2006 10:39:11 PM
by David Fishburn by David Fishburn
@ -82,7 +82,7 @@ The following keywords are supported: >
create[ or replace] procedure|function|event create[ or replace] procedure|function|event
returns returns
<
1.2 Text Object Motions *sql-object-motions* 1.2 Text Object Motions *sql-object-motions*
----------------------- -----------------------
@ -96,7 +96,7 @@ file): >
[[ move backwards to the previous 'begin' [[ move backwards to the previous 'begin'
][ move forward to the next 'end' ][ move forward to the next 'end'
[] move backwards to the previous 'end' [] move backwards to the previous 'end'
<
1.3 Predefined Object Motions *sql-predefined-objects* 1.3 Predefined Object Motions *sql-predefined-objects*
----------------------------- -----------------------------
@ -111,7 +111,7 @@ flexible as possible, you can override the list of objects from within your
let g:ftplugin_sql_objects = 'function,procedure,event,table,trigger' . let g:ftplugin_sql_objects = 'function,procedure,event,table,trigger' .
\ ',schema,service,publication,database,datatype,domain' . \ ',schema,service,publication,database,datatype,domain' .
\ ',index,subscription,synchronization,view,variable' \ ',index,subscription,synchronization,view,variable'
<
The following |Normal| mode and |Visual| mode maps have been created which use The following |Normal| mode and |Visual| mode maps have been created which use
the above list: > the above list: >
]} move forward to the next 'create <object name>' ]} move forward to the next 'create <object name>'
@ -128,14 +128,14 @@ Repeatedly pressing ]} will cycle through each of these create statements: >
end; end;
create index i1 on t1 (c1); create index i1 on t1 (c1);
<
The default setting for g:ftplugin_sql_objects is: > The default setting for g:ftplugin_sql_objects is: >
let g:ftplugin_sql_objects = 'function,procedure,event,' . let g:ftplugin_sql_objects = 'function,procedure,event,' .
\ '\\(existing\\\\|global\\s\\+temporary\\s\\+\\)\\\{,1}' . \ '\\(existing\\\\|global\\s\\+temporary\\s\\+\\)\\\{,1}' .
\ 'table,trigger' . \ 'table,trigger' .
\ ',schema,service,publication,database,datatype,domain' . \ ',schema,service,publication,database,datatype,domain' .
\ ',index,subscription,synchronization,view,variable' \ ',index,subscription,synchronization,view,variable'
<
The above will also handle these cases: > The above will also handle these cases: >
create table t1 ( create table t1 (
... ...
@ -146,7 +146,7 @@ The above will also handle these cases: >
create global temporary table t3 ( create global temporary table t3 (
... ...
); );
<
By default, the ftplugin only searches for CREATE statements. You can also By default, the ftplugin only searches for CREATE statements. You can also
override this via your |vimrc| with the following: > override this via your |vimrc| with the following: >
let g:ftplugin_sql_statements = 'create,alter' let g:ftplugin_sql_statements = 'create,alter'
@ -157,7 +157,7 @@ The filetype plugin defines three types of comments: >
3. /* 3. /*
* *
*/ */
<
The following |Normal| mode and |Visual| mode maps have been created to work The following |Normal| mode and |Visual| mode maps have been created to work
with comments: > with comments: >
]" move forward to the beginning of a comment ]" move forward to the beginning of a comment
@ -170,7 +170,7 @@ with comments: >
Vim's feature to find macro definitions, |'define'|, is supported using this Vim's feature to find macro definitions, |'define'|, is supported using this
regular expression: > regular expression: >
\c\<\(VARIABLE\|DECLARE\|IN\|OUT\|INOUT\)\> \c\<\(VARIABLE\|DECLARE\|IN\|OUT\|INOUT\)\>
<
This addresses the following code: > This addresses the following code: >
CREATE VARIABLE myVar1 INTEGER; CREATE VARIABLE myVar1 INTEGER;
@ -187,11 +187,11 @@ This addresses the following code: >
FROM T1 FROM T1
WHERE c4 = myVar1; WHERE c4 = myVar1;
END; END;
<
Place your cursor on "myVar1" on this line: > Place your cursor on "myVar1" on this line: >
WHERE c4 = myVar1; WHERE c4 = myVar1;
^ ^
<
Press any of the following keys: > Press any of the following keys: >
[d [d
[D [D
@ -235,7 +235,7 @@ For the people that work with many different databases, it would be nice to be
able to flip between the various vendors rules (indent, syntax) on a per able to flip between the various vendors rules (indent, syntax) on a per
buffer basis, at any time. The ftplugin/sql.vim file defines this function: > buffer basis, at any time. The ftplugin/sql.vim file defines this function: >
SQLSetType SQLSetType
<
Executing this function without any parameters will set the indent and syntax Executing this function without any parameters will set the indent and syntax
scripts back to their defaults, see |sql-type-default|. If you have turned scripts back to their defaults, see |sql-type-default|. If you have turned
off Vi's compatibility mode, |'compatible'|, you can use the <Tab> key to off Vi's compatibility mode, |'compatible'|, you can use the <Tab> key to
@ -252,12 +252,12 @@ examples: >
:SQLSetType sqlanywhere :SQLSetType sqlanywhere
:SQLSetType sqlinformix :SQLSetType sqlinformix
:SQLSetType mysql :SQLSetType mysql
<
The easiest approach is to the use <Tab> character which will first complete The easiest approach is to the use <Tab> character which will first complete
the command name (SQLSetType), after a space and another <Tab>, display a list the command name (SQLSetType), after a space and another <Tab>, display a list
of available Vim script names: > of available Vim script names: >
:SQL<Tab><space><Tab> :SQL<Tab><space><Tab>
<
2.2 SQL Dialect Default *sql-type-default* 2.2 SQL Dialect Default *sql-type-default*
----------------------- -----------------------
@ -267,10 +267,10 @@ your |vimrc|: >
let g:sql_type_default = 'sqlanywhere' let g:sql_type_default = 'sqlanywhere'
let g:sql_type_default = 'sqlinformix' let g:sql_type_default = 'sqlinformix'
let g:sql_type_default = 'mysql' let g:sql_type_default = 'mysql'
<
If you added the following to your |vimrc|: > If you added the following to your |vimrc|: >
let g:sql_type_default = 'sqlinformix' let g:sql_type_default = 'sqlinformix'
<
The next time edit a SQL file the following scripts will be automatically The next time edit a SQL file the following scripts will be automatically
loaded by Vim: > loaded by Vim: >
ftplugin/sql.vim ftplugin/sql.vim
@ -299,7 +299,7 @@ can create any of the following: >
Windows Windows
$VIM/vimfiles/syntax/sqlite.vim $VIM/vimfiles/syntax/sqlite.vim
$VIM/vimfiles/indent/sqlite.vim $VIM/vimfiles/indent/sqlite.vim
<
No changes are necessary to the SQLSetType function. It will automatically No changes are necessary to the SQLSetType function. It will automatically
pickup the new SQL files and load them when you issue the SQLSetType command. pickup the new SQL files and load them when you issue the SQLSetType command.
@ -330,11 +330,11 @@ The defaults static maps are: >
imap <buffer> <C-C>o <C-\><C-O>:call sqlcomplete#Map('sqlOption')<CR><C-X><C-O> imap <buffer> <C-C>o <C-\><C-O>:call sqlcomplete#Map('sqlOption')<CR><C-X><C-O>
imap <buffer> <C-C>T <C-\><C-O>:call sqlcomplete#Map('sqlType')<CR><C-X><C-O> imap <buffer> <C-C>T <C-\><C-O>:call sqlcomplete#Map('sqlType')<CR><C-X><C-O>
imap <buffer> <C-C>s <C-\><C-O>:call sqlcomplete#Map('sqlStatement')<CR><C-X><C-O> imap <buffer> <C-C>s <C-\><C-O>:call sqlcomplete#Map('sqlStatement')<CR><C-X><C-O>
<
The static maps (which are based on the syntax highlight groups) follow this The static maps (which are based on the syntax highlight groups) follow this
format: > format: >
imap <buffer> <C-C>k <C-\><C-O>:call sqlcomplete#Map('sqlKeyword')<CR><C-X><C-O> imap <buffer> <C-C>k <C-\><C-O>:call sqlcomplete#Map('sqlKeyword')<CR><C-X><C-O>
<
This command breaks down as: > This command breaks down as: >
imap - Create an insert map imap - Create an insert map
<buffer> - Only for this buffer <buffer> - Only for this buffer
@ -362,7 +362,7 @@ This command breaks down as: >
plugin will also cache this result until Vim is plugin will also cache this result until Vim is
restarted. The syntax list is retrieved using restarted. The syntax list is retrieved using
the syntaxcomplete plugin. the syntaxcomplete plugin.
<
Using the 'syntax' keyword is a special case. This instructs the Using the 'syntax' keyword is a special case. This instructs the
syntaxcomplete plugin to retrieve all syntax items. So this will effectively syntaxcomplete plugin to retrieve all syntax items. So this will effectively
work for any of Vim's SQL syntax files. At the time of writing this includes work for any of Vim's SQL syntax files. At the time of writing this includes
@ -382,7 +382,7 @@ Here are some examples of the entries which are pulled from the syntax files: >
- Isolation_level, On_error, Qualify_owners, Fire_triggers, ... - Isolation_level, On_error, Qualify_owners, Fire_triggers, ...
Types Types
- Integer, Char, Varchar, Date, DateTime, Timestamp, ... - Integer, Char, Varchar, Date, DateTime, Timestamp, ...
<
4.2 Dynamic Mode *sql-completion-dynamic* 4.2 Dynamic Mode *sql-completion-dynamic*
---------------- ----------------
@ -402,7 +402,7 @@ to display a list of tables, procedures, views and columns. >
- All stored procedures for all schema owners - All stored procedures for all schema owners
Column List Column List
- For the selected table, the columns that are part of the table - For the selected table, the columns that are part of the table
<
To enable the popup, while in INSERT mode, use the following key combinations To enable the popup, while in INSERT mode, use the following key combinations
for each group (where <C-C> means hold the CTRL key down while pressing for each group (where <C-C> means hold the CTRL key down while pressing
the space bar): the space bar):
@ -425,7 +425,7 @@ the popup window. This makes the re-displaying of these lists very
fast. If new tables or columns are added to the database it may become fast. If new tables or columns are added to the database it may become
necessary to clear the plugins cache. The default map for this is: > necessary to clear the plugins cache. The default map for this is: >
imap <buffer> <C-C>R <C-\><C-O>:call sqlcomplete#Map('ResetCache')<CR><C-X><C-O> imap <buffer> <C-C>R <C-\><C-O>:call sqlcomplete#Map('ResetCache')<CR><C-X><C-O>
<
4.3 SQL Tutorial *sql-completion-tutorial* 4.3 SQL Tutorial *sql-completion-tutorial*
---------------- ----------------
@ -436,10 +436,10 @@ completion plugin so that: >
b) You are introduced to some of the more common features b) You are introduced to some of the more common features
c) Show how to customize it to your preferences c) Show how to customize it to your preferences
d) Demonstrate "Best of Use" of the plugin (easiest way to configure). d) Demonstrate "Best of Use" of the plugin (easiest way to configure).
<
First, create a new buffer: > First, create a new buffer: >
:e tutorial.sql :e tutorial.sql
<
Static features Static features
--------------- ---------------
@ -461,7 +461,7 @@ depending on the syntax file you are using. The SQL Anywhere syntax file
(sqlanywhere.vim) has support for this: > (sqlanywhere.vim) has support for this: >
BEGIN BEGIN
DECLARE customer_id <C-C>T <-- Choose a type from the list DECLARE customer_id <C-C>T <-- Choose a type from the list
<
Dynamic features Dynamic features
---------------- ----------------
@ -484,7 +484,7 @@ list. After the list is displayed press <C-W>. This will remove both the
popup window and the table name already chosen when the list became active. > popup window and the table name already chosen when the list became active. >
4.3.1 Table Completion: *sql-completion-tables* 4.3.1 Table Completion: *sql-completion-tables*
<
Press <C-C>t to display a list of tables from within the database you Press <C-C>t to display a list of tables from within the database you
have connected via the dbext plugin. have connected via the dbext plugin.
NOTE: All of the SQL completion popups support typing a prefix before pressing NOTE: All of the SQL completion popups support typing a prefix before pressing
@ -492,7 +492,7 @@ the key map. This will limit the contents of the popup window to just items
beginning with those characters. > beginning with those characters. >
4.3.2 Column Completion: *sql-completion-columns* 4.3.2 Column Completion: *sql-completion-columns*
<
The SQL completion plugin can also display a list of columns for particular The SQL completion plugin can also display a list of columns for particular
tables. The column completion is trigger via <C-C>c. tables. The column completion is trigger via <C-C>c.
@ -503,7 +503,7 @@ together. If you wish to enable this functionality on a *nix platform choose
a key and create this mapping (see |sql-completion-maps| for further a key and create this mapping (see |sql-completion-maps| for further
details on where to create this imap): > details on where to create this imap): >
imap <buffer> <your_keystroke> <CR><C-\><C-O>:call sqlcomplete#Map('column')<CR><C-X><C-O> imap <buffer> <your_keystroke> <CR><C-\><C-O>:call sqlcomplete#Map('column')<CR><C-X><C-O>
<
Example of using column completion: Example of using column completion:
- Press <C-C>t again to display the list of tables. - Press <C-C>t again to display the list of tables.
- When the list is displayed in the completion window, press <C-Right>, - When the list is displayed in the completion window, press <C-Right>,
@ -561,7 +561,7 @@ following statement: >
employee e, employee e,
site_options so site_options so
where c. where c.
<
In INSERT mode after typing the final "c." which is an alias for the In INSERT mode after typing the final "c." which is an alias for the
"customer" table, you can press either <C-C>c or <C-X><C-O>. This will "customer" table, you can press either <C-C>c or <C-X><C-O>. This will
popup a list of columns for the customer table. It does this by looking back popup a list of columns for the customer table. It does this by looking back
@ -572,12 +572,12 @@ keyword is also supported, "customer AS c". >
4.3.3 Procedure Completion: *sql-completion-procedures* 4.3.3 Procedure Completion: *sql-completion-procedures*
<
Similar to the table list, <C-C>p, will display a list of stored Similar to the table list, <C-C>p, will display a list of stored
procedures stored within the database. > procedures stored within the database. >
4.3.4 View Completion: *sql-completion-views* 4.3.4 View Completion: *sql-completion-views*
<
Similar to the table list, <C-C>v, will display a list of views in the Similar to the table list, <C-C>v, will display a list of views in the
database. database.
@ -615,7 +615,32 @@ your |vimrc|: >
use mixed case then the first letter of the table is used: > use mixed case then the first letter of the table is used: >
mytablename --> m mytablename --> m
MYTABLENAME --> M MYTABLENAME --> M
<
omni_sql_ignorecase
< - Default: Current setting for|ignorecase|
- Valid settings are 0 or 1.
- When entering a few letters before initiating completion, the list
will be filtered to display only the entries which begin with the
list of characters. When this option is set to 0, the list will be
filtered using case sensitivity. >
omni_sql_include_owner
< - Default: 0, unless dbext.vim 3.00 has been installed
- Valid settings are 0 or 1.
- When completing tables, procedure or views and using dbext.vim 3.00
or higher the list of objects will also include the owner name.
When completing these objects and omni_sql_include_owner is enabled
the owner name will be be replaced. >
omni_sql_precache_syntax_groups
< - Default:
['syntax','sqlKeyword','sqlFunction','sqlOption','sqlType','sqlStatement']
- sqlcomplete can be used in conjunction with other completion
plugins. This is outlined at |sql-completion-filetypes|. When the
filetype is changed temporarily to SQL, the sqlcompletion plugin
will cache the syntax groups listed in the List specified in this
option.
>
4.5 SQL Maps *sql-completion-maps* 4.5 SQL Maps *sql-completion-maps*
------------ ------------
@ -642,7 +667,8 @@ highlighting rules. >
Dynamic Maps Dynamic Maps
------------ ------------
These are maps which use populate the completion list using the dbext.vim plugin. > These are maps which use populate the completion list using the dbext.vim
plugin. >
<C-C>t <C-C>t
< - Displays a list of tables. > < - Displays a list of tables. >
<C-C>p <C-C>p
@ -683,7 +709,7 @@ If you do not wish the default maps created or the key choices do not work on
your platform (often a case on *nix) you define the following variable in your platform (often a case on *nix) you define the following variable in
your |vimrc|: > your |vimrc|: >
let g:omni_sql_no_default_maps = 1 let g:omni_sql_no_default_maps = 1
<
Do no edit ftplugin/sql.vim directly! If you change this file your changes Do no edit ftplugin/sql.vim directly! If you change this file your changes
will be over written on future updates. Vim has a special directory structure will be over written on future updates. Vim has a special directory structure
which allows you to make customizations without changing the files that are which allows you to make customizations without changing the files that are

View File

@ -259,6 +259,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
'grepformat' options.txt /*'grepformat'* 'grepformat' options.txt /*'grepformat'*
'grepprg' options.txt /*'grepprg'* 'grepprg' options.txt /*'grepprg'*
'gtl' options.txt /*'gtl'* 'gtl' options.txt /*'gtl'*
'gtt' options.txt /*'gtt'*
'guicursor' options.txt /*'guicursor'* 'guicursor' options.txt /*'guicursor'*
'guifont' options.txt /*'guifont'* 'guifont' options.txt /*'guifont'*
'guifontset' options.txt /*'guifontset'* 'guifontset' options.txt /*'guifontset'*
@ -267,6 +268,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
'guioptions' options.txt /*'guioptions'* 'guioptions' options.txt /*'guioptions'*
'guipty' options.txt /*'guipty'* 'guipty' options.txt /*'guipty'*
'guitablabel' options.txt /*'guitablabel'* 'guitablabel' options.txt /*'guitablabel'*
'guitabtooltip' options.txt /*'guitabtooltip'*
'hardtabs' vi_diff.txt /*'hardtabs'* 'hardtabs' vi_diff.txt /*'hardtabs'*
'helpfile' options.txt /*'helpfile'* 'helpfile' options.txt /*'helpfile'*
'helpheight' options.txt /*'helpheight'* 'helpheight' options.txt /*'helpheight'*
@ -3198,6 +3200,7 @@ CTRL-W_bar windows.txt /*CTRL-W_bar*
CTRL-W_c windows.txt /*CTRL-W_c* CTRL-W_c windows.txt /*CTRL-W_c*
CTRL-W_d tagsrch.txt /*CTRL-W_d* CTRL-W_d tagsrch.txt /*CTRL-W_d*
CTRL-W_f windows.txt /*CTRL-W_f* CTRL-W_f windows.txt /*CTRL-W_f*
CTRL-W_gF windows.txt /*CTRL-W_gF*
CTRL-W_g] windows.txt /*CTRL-W_g]* CTRL-W_g] windows.txt /*CTRL-W_g]*
CTRL-W_g_CTRL-] windows.txt /*CTRL-W_g_CTRL-]* CTRL-W_g_CTRL-] windows.txt /*CTRL-W_g_CTRL-]*
CTRL-W_gf windows.txt /*CTRL-W_gf* CTRL-W_gf windows.txt /*CTRL-W_gf*
@ -4006,6 +4009,8 @@ E787 diff.txt /*E787*
E788 autocmd.txt /*E788* E788 autocmd.txt /*E788*
E789 syntax.txt /*E789* E789 syntax.txt /*E789*
E79 message.txt /*E79* E79 message.txt /*E79*
E790 undo.txt /*E790*
E791 mbyte.txt /*E791*
E80 message.txt /*E80* E80 message.txt /*E80*
E800 arabic.txt /*E800* E800 arabic.txt /*E800*
E81 map.txt /*E81* E81 map.txt /*E81*
@ -6298,6 +6303,7 @@ netrw-settings pi_netrw.txt /*netrw-settings*
netrw-sexplore pi_netrw.txt /*netrw-sexplore* netrw-sexplore pi_netrw.txt /*netrw-sexplore*
netrw-sort pi_netrw.txt /*netrw-sort* netrw-sort pi_netrw.txt /*netrw-sort*
netrw-sortsequence pi_netrw.txt /*netrw-sortsequence* netrw-sortsequence pi_netrw.txt /*netrw-sortsequence*
netrw-starpat pi_netrw.txt /*netrw-starpat*
netrw-starstar pi_netrw.txt /*netrw-starstar* netrw-starstar pi_netrw.txt /*netrw-starstar*
netrw-start pi_netrw.txt /*netrw-start* netrw-start pi_netrw.txt /*netrw-start*
netrw-transparent pi_netrw.txt /*netrw-transparent* netrw-transparent pi_netrw.txt /*netrw-transparent*
@ -6504,6 +6510,8 @@ pi_gzip.txt pi_gzip.txt /*pi_gzip.txt*
pi_netrw.txt pi_netrw.txt /*pi_netrw.txt* pi_netrw.txt pi_netrw.txt /*pi_netrw.txt*
pi_paren.txt pi_paren.txt /*pi_paren.txt* pi_paren.txt pi_paren.txt /*pi_paren.txt*
pi_spec.txt pi_spec.txt /*pi_spec.txt* pi_spec.txt pi_spec.txt /*pi_spec.txt*
pi_tar.txt pi_tar.txt /*pi_tar.txt*
pi_zip.txt pi_zip.txt /*pi_zip.txt*
plaintex.vim syntax.txt /*plaintex.vim* plaintex.vim syntax.txt /*plaintex.vim*
plsql sql.txt /*plsql* plsql sql.txt /*plsql*
plugin usr_05.txt /*plugin* plugin usr_05.txt /*plugin*
@ -7246,7 +7254,6 @@ tar-history pi_tar.txt /*tar-history*
tar-manual pi_tar.txt /*tar-manual* tar-manual pi_tar.txt /*tar-manual*
tar-options pi_tar.txt /*tar-options* tar-options pi_tar.txt /*tar-options*
tar-usage pi_tar.txt /*tar-usage* tar-usage pi_tar.txt /*tar-usage*
tar.txt pi_tar.txt /*tar.txt*
tcl if_tcl.txt /*tcl* tcl if_tcl.txt /*tcl*
tcl-beep if_tcl.txt /*tcl-beep* tcl-beep if_tcl.txt /*tcl-beep*
tcl-buffer if_tcl.txt /*tcl-buffer* tcl-buffer if_tcl.txt /*tcl-buffer*
@ -7858,7 +7865,6 @@ zip-copyright pi_zip.txt /*zip-copyright*
zip-history pi_zip.txt /*zip-history* zip-history pi_zip.txt /*zip-history*
zip-manual pi_zip.txt /*zip-manual* zip-manual pi_zip.txt /*zip-manual*
zip-usage pi_zip.txt /*zip-usage* zip-usage pi_zip.txt /*zip-usage*
zip.txt pi_zip.txt /*zip.txt*
zj fold.txt /*zj* zj fold.txt /*zj*
zk fold.txt /*zk* zk fold.txt /*zk*
zl scroll.txt /*zl* zl scroll.txt /*zl*

View File

@ -1,4 +1,4 @@
*todo.txt* For Vim version 7.0e. Last change: 2006 Apr 21 *todo.txt* For Vim version 7.0e. Last change: 2006 Apr 22
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -30,16 +30,11 @@ be worked on, but only if you sponsor Vim development. See |sponsor|.
*known-bugs* *known-bugs*
-------------------- Known bugs and current work ----------------------- -------------------- Known bugs and current work -----------------------
Win32: Crash when adding many menu entries. (Karl Waedt)
Crash in "z=" when the change triggers checking out the file, FileChangedRO Crash in "z=" when the change triggers checking out the file, FileChangedRO
event. Problem in move_lines()? FileChangedShell also involved? (Neil Bird) event. Problem in move_lines()? FileChangedShell also involved? (Neil Bird)
Added a few checks for valid buffer, did that help? Added a few checks for valid buffer, did that help?
Fix coverity false positives?
Add more tests for all new functionality in Vim 7. Especially new functions. Add more tests for all new functionality in Vim 7. Especially new functions.
:undojoin
Win32: Describe how to do debugging. (George Reilly) Win32: Describe how to do debugging. (George Reilly)
@ -209,6 +204,10 @@ GTK+ GUI known bugs:
8 GTK 2: Combining UTF-8 characters not displayed properly in menus (Mikolaj 8 GTK 2: Combining UTF-8 characters not displayed properly in menus (Mikolaj
Machowski) They are displayed as separate characters. Problem in Machowski) They are displayed as separate characters. Problem in
creating a label? creating a label?
8 GTK2: selecting button in confirm dialog with keys and hitting Enter
doesn't select that button. (Steve Hall)
It's possible to set the default button but it's not clear how to obtain
the currently selected (highlighted) button.
8 GTK 2: Combining UTF-8 characters are sometimes not drawn properly. 8 GTK 2: Combining UTF-8 characters are sometimes not drawn properly.
Depends on the font size, "monospace 13" has the problem. Vim seems to do Depends on the font size, "monospace 13" has the problem. Vim seems to do
everything right, must be a GTK bug. Is there a way to work around it? everything right, must be a GTK bug. Is there a way to work around it?

View File

@ -1,4 +1,4 @@
*various.txt* For Vim version 7.0e. Last change: 2006 Mar 25 *various.txt* For Vim version 7.0e. Last change: 2006 Apr 22
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -819,7 +819,7 @@ Hints for translators:
languages in the specified directory. languages in the specified directory.
============================================================================== ==============================================================================
4. Using Vim like less or more *less* 3. Using Vim like less or more *less*
If you use the less or more program to view a file, you don't get syntax If you use the less or more program to view a file, you don't get syntax
highlighting. Thus you would like to use Vim instead. You can do this by highlighting. Thus you would like to use Vim instead. You can do this by

View File

@ -1,4 +1,4 @@
*version7.txt* For Vim version 7.0e. Last change: 2006 Apr 21 *version7.txt* For Vim version 7.0e. Last change: 2006 Apr 22
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -2572,7 +2572,7 @@ Completion could hang when 'lines' is 6 and a preview window was opened.
Added CTRL-W gF: open file under cursor in new tab page and jump to the line Added CTRL-W gF: open file under cursor in new tab page and jump to the line
number following the file name. number following the file name.
Added 'guitabtooltip', but it's not implemented anywhere yet. Added 'guitabtooltip'. Implemented for Win32 (Yegappan Lakshmanan).
Added "throw" to 'debug' option: thow an exception for error messages even Added "throw" to 'debug' option: thow an exception for error messages even
whey they would otherwise be ignored. whey they would otherwise be ignored.
@ -2582,5 +2582,17 @@ mapping found" warning instead of a proper error message.
Motif: default to using XpmAttributes instead of XpmAttributes_21. Motif: default to using XpmAttributes instead of XpmAttributes_21.
A few more changes for 64 bit MS-Windows. (George Reilly)
Got ml_get errors when doing "o" and selecting in other window where there are
less line shorter than the cursor position in the other window. ins_mouse()
was using position in wrong window.
Win32 GUI: Crash when giving a lot of messages during startup. Allocate twice
as much memory for the dialog template.
Fixed a few leaks and wrong pointer use reported by coverity.
When showing menus the mode character was sometimes wrong.
vim:tw=78:ts=8:ft=help:norl: vim:tw=78:ts=8:ft=help:norl:

View File

@ -1,8 +1,8 @@
" Vim indent file " Vim indent file
" Language: Fortran95 (and Fortran90, Fortran77, F and elf90) " Language: Fortran95 (and Fortran90, Fortran77, F and elf90)
" Version: 0.36 " Version: 0.37
" URL: http://www.unb.ca/chem/ajit/indent/fortran.vim " URL: http://www.unb.ca/chem/ajit/indent/fortran.vim
" Last Change: 2006 Apr. 02 " Last Change: 2006 Apr. 22
" Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www.unb.ca/chem/ajit/> " Maintainer: Ajit J. Thakkar <ajit@unb.ca>; <http://www.unb.ca/chem/ajit/>
" Usage: Do :help fortran-indent from Vim " Usage: Do :help fortran-indent from Vim
@ -14,6 +14,7 @@ let b:did_indent = 1
setlocal indentkeys+==~end,=~case,=~if,=~else,=~do,=~where,=~elsewhere,=~select setlocal indentkeys+==~end,=~case,=~if,=~else,=~do,=~where,=~elsewhere,=~select
setlocal indentkeys+==~endif,=~enddo,=~endwhere,=~endselect setlocal indentkeys+==~endif,=~enddo,=~endwhere,=~endselect
setlocal indentkeys+==~type,=~interface
" Determine whether this is a fixed or free format source file " Determine whether this is a fixed or free format source file
" if this hasn't been done yet " if this hasn't been done yet
@ -81,20 +82,25 @@ function FortranGetIndent(lnum)
endif endif
"Add a shiftwidth to statements following if, else, case, "Add a shiftwidth to statements following if, else, case,
"where and elsewhere statements "where, elsewhere, type and interface statements
if prevstat =~? '^\s*\(\d\+\s\)\=\s*\(else\|case\|where\|elsewhere\)\>' if prevstat =~? '^\s*\(\d\+\s\)\=\s*\(else\|case\|where\|elsewhere\)\>'
\ ||prevstat =~? '^\s*\(\d\+\s\)\=\s*\(type\|interface\)\>'
\ || prevstat =~? '^\s*\(\d\+\s\)\=\s*\(\a\w*\s*:\)\=\s*if\>' \ || prevstat =~? '^\s*\(\d\+\s\)\=\s*\(\a\w*\s*:\)\=\s*if\>'
let ind = ind + &sw let ind = ind + &sw
" Remove unwanted indent after logical and arithmetic ifs " Remove unwanted indent after logical and arithmetic ifs
if prevstat =~? '\<if\>' && prevstat !~? '\<then\>' if prevstat =~? '\<if\>' && prevstat !~? '\<then\>'
let ind = ind - &sw let ind = ind - &sw
endif endif
" Remove unwanted indent after type( statements
if prevstat =~? '\<type\s*('
let ind = ind - &sw
endif
endif endif
"Subtract a shiftwidth from else, elsewhere, case, end if, "Subtract a shiftwidth from else, elsewhere, case, end if,
" end where and end select statements " end where, end select, end interface and end type statements
if getline(v:lnum) =~? '^\s*\(\d\+\s\)\=\s*' if getline(v:lnum) =~? '^\s*\(\d\+\s\)\=\s*'
\. '\(else\|elsewhere\|case\|end\s*\(if\|where\|select\)\)\>' \. '\(else\|elsewhere\|case\|end\s*\(if\|where\|select\|interface\|type\)\)\>'
let ind = ind - &sw let ind = ind - &sw
" Fix indent for case statement immediately after select " Fix indent for case statement immediately after select
if prevstat =~? '\<select\>' if prevstat =~? '\<select\>'

View File

@ -2,7 +2,7 @@
" Language: Python " Language: Python
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Original Author: David Bustos <bustos@caltech.edu> " Original Author: David Bustos <bustos@caltech.edu>
" Last Change: 2006 Apr 21 " Last Change: 2006 Apr 22
" Only load this indent file when no other was loaded. " Only load this indent file when no other was loaded.
if exists("b:did_indent") if exists("b:did_indent")

View File

@ -185,11 +185,20 @@ try
syn region doxygenVerbatimRegion contained matchgroup=doxygenOther start=+\<verbatim\>+ matchgroup=doxygenOther end=+[\\@]\@<=\<endverbatim\>+ contains=doxygenVerbatimRegionSpecial,doxygenContinueComment,doxygenErrorComment syn region doxygenVerbatimRegion contained matchgroup=doxygenOther start=+\<verbatim\>+ matchgroup=doxygenOther end=+[\\@]\@<=\<endverbatim\>+ contains=doxygenVerbatimRegionSpecial,doxygenContinueComment,doxygenErrorComment
syn match doxygenVerbatimRegionSpecial contained +[\\@]\(endverbatim\>\)\@=+ syn match doxygenVerbatimRegionSpecial contained +[\\@]\(endverbatim\>\)\@=+
let b:doxygen_syntax_save=b:current_syntax if exists('b:current_syntax')
unlet b:current_syntax let b:doxygen_syntax_save=b:current_syntax
unlet b:current_syntax
endif
syn include @Dotx syntax/dot.vim syn include @Dotx syntax/dot.vim
let b:current_syntax=b:doxygen_syntax_save
unlet b:doxygen_syntax_save if exists('b:doxygen_syntax_save')
let b:current_syntax=b:doxygen_syntax_save
unlet b:doxygen_syntax_save
else
unlet b:current_syntax
endif
syn region doxygenDotRegion contained matchgroup=doxygenOther start=+\<dot\>+ matchgroup=doxygenOther end=+[\\@]\@<=\<enddot\>+ contains=doxygenDotRegionSpecial,doxygenErrorComment,doxygenContinueComment,@Dotx syn region doxygenDotRegion contained matchgroup=doxygenOther start=+\<dot\>+ matchgroup=doxygenOther end=+[\\@]\@<=\<enddot\>+ contains=doxygenDotRegionSpecial,doxygenErrorComment,doxygenContinueComment,@Dotx
syn match doxygenDotRegionSpecial contained +[\\@]\(enddot\>\)\@=+ syn match doxygenDotRegionSpecial contained +[\\@]\(enddot\>\)\@=+

View File

@ -1,8 +1,8 @@
" Vim syntax file " Vim syntax file
" Language: Fortran95 (and Fortran90, Fortran77, F and elf90) " Language: Fortran95 (and Fortran90, Fortran77, F and elf90)
" Version: 0.87 " Version: 0.88
" URL: http://www.unb.ca/chem/ajit/syntax/fortran.vim " URL: http://www.unb.ca/chem/ajit/syntax/fortran.vim
" Last Change: 2006 Apr. 04 " Last Change: 2006 Apr. 22
" Maintainer: Ajit J. Thakkar (ajit AT unb.ca); <http://www.unb.ca/chem/ajit/> " Maintainer: Ajit J. Thakkar (ajit AT unb.ca); <http://www.unb.ca/chem/ajit/>
" Usage: Do :help fortran-syntax from Vim " Usage: Do :help fortran-syntax from Vim
" Credits: " Credits:
@ -279,7 +279,7 @@ syn keyword fortran77IntrinsicR dble dprod
syn match fortran77OperatorR "\.\s*[gl][et]\s*\." syn match fortran77OperatorR "\.\s*[gl][et]\s*\."
syn match fortran77OperatorR "\.\s*\(eq\|ne\)\s*\." syn match fortran77OperatorR "\.\s*\(eq\|ne\)\s*\."
if b:fortran_dialect == "f95" if b:fortran_dialect == "f95" || b:fortran_dialect == "F"
syn keyword fortranRepeat forall syn keyword fortranRepeat forall
syn match fortranRepeat "\<end\s*forall" syn match fortranRepeat "\<end\s*forall"
syn keyword fortran95Intrinsic null cpu_time syn keyword fortran95Intrinsic null cpu_time

View File

@ -1,9 +1,8 @@
# Makefile for Vim on Win32 (Windows NT and Windows 95), using the # Makefile for Vim on Win32 (Windows NT/2000/XP/2003 and Windows 95/98/Me)
# Microsoft Visual C++ 2.x and MSVC 4.x compilers (or newer). # and Win64, using the Microsoft Visual C++ compilers. Known to work with
# It builds on Windows 95 and all four NT platforms: i386, Alpha, MIPS, and # VC5, VC6 (VS98), VC7.0 (VS2002), VC7.1 (VS2003), and VC8 (VS2005).
# PowerPC. The NT/i386 binary and the Windows 95 binary are identical.
# #
# To build using Borland C++, use Make_bc3.mak or Make_bc5.mak. # To build using other Windows compilers, see INSTALLpc.txt
# #
# This makefile can build the console, GUI, OLE-enable, Perl-enabled and # This makefile can build the console, GUI, OLE-enable, Perl-enabled and
# Python-enabled versions of vim for Win32 platforms. # Python-enabled versions of vim for Win32 platforms.
@ -172,8 +171,11 @@ OBJDIR = $(OBJDIR)d
!ifdef PROCESSOR_ARCHITECTURE !ifdef PROCESSOR_ARCHITECTURE
# We're on Windows NT or using VC 6+ # We're on Windows NT or using VC 6+
! ifndef CPU ! ifdef CPU
ASSEMBLY_ARCHITECTURE=$(CPU)
! else
CPU = $(PROCESSOR_ARCHITECTURE) CPU = $(PROCESSOR_ARCHITECTURE)
ASSEMBLY_ARCHITECTURE = $(PROCESSOR_ARCHITECTURE)
! if ("$(CPU)" == "x86") || ("$(CPU)" == "X86") ! if ("$(CPU)" == "x86") || ("$(CPU)" == "X86")
CPU = i386 CPU = i386
! endif ! endif
@ -183,6 +185,9 @@ CPU = i386
CPU = i386 CPU = i386
!endif # !PROCESSOR_ARCHITECTURE !endif # !PROCESSOR_ARCHITECTURE
!if ("$(CPU)" == "AMD64") || ("$(CPU)" == "IA64")
DEFINES=$(DEFINES) /Wp64
!endif
# Build a retail version by default # Build a retail version by default
@ -752,6 +757,7 @@ clean:
- if exist $(VIM).pdb del $(VIM).pdb - if exist $(VIM).pdb del $(VIM).pdb
- if exist $(VIM).map del $(VIM).map - if exist $(VIM).map del $(VIM).map
- if exist $(VIM).ncb del $(VIM).ncb - if exist $(VIM).ncb del $(VIM).ncb
- if exist gvim.exe.mnf del gvim.exe.mnf
- if exist vimrun.exe del vimrun.exe - if exist vimrun.exe del vimrun.exe
- if exist install.exe del install.exe - if exist install.exe del install.exe
- if exist uninstal.exe del uninstal.exe - if exist uninstal.exe del uninstal.exe
@ -933,7 +939,7 @@ $(OUTDIR)/window.obj: $(OUTDIR) window.c $(INCL)
$(OUTDIR)/xpm_w32.obj: $(OUTDIR) xpm_w32.c $(OUTDIR)/xpm_w32.obj: $(OUTDIR) xpm_w32.c
$(CC) $(CFLAGS) $(XPM_INC) xpm_w32.c $(CC) $(CFLAGS) $(XPM_INC) xpm_w32.c
$(OUTDIR)/vim.res: $(OUTDIR) vim.rc version.h tools.bmp tearoff.bmp \ $(OUTDIR)/vim.res: $(OUTDIR) gvim.exe.mnf vim.rc version.h tools.bmp tearoff.bmp \
vim.ico vim_error.ico vim_alert.ico vim_info.ico vim_quest.ico vim.ico vim_error.ico vim_alert.ico vim_info.ico vim_quest.ico
$(RC) /l 0x409 /Fo$(OUTDIR)/vim.res $(RCFLAGS) vim.rc $(RC) /l 0x409 /Fo$(OUTDIR)/vim.res $(RCFLAGS) vim.rc
@ -963,6 +969,30 @@ $(PATHDEF_SRC): auto
@echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> $(PATHDEF_SRC) @echo char_u *compiled_user = (char_u *)"$(USERNAME)"; >> $(PATHDEF_SRC)
@echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> $(PATHDEF_SRC) @echo char_u *compiled_sys = (char_u *)"$(USERDOMAIN)"; >> $(PATHDEF_SRC)
gvim.exe.mnf: auto
@echo ^<?xml version="1.0" encoding="UTF-8" standalone="yes"?^> >$@
@echo ^<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"^> >>$@
@echo ^<assemblyIdentity >>$@
@echo processorArchitecture="$(ASSEMBLY_ARCHITECTURE)" >>$@
@echo version="7.0.0.0" >>$@
@echo type="win32" >>$@
@echo name="Vim" >>$@
@echo /^> >>$@
@echo ^<description^>Vi Improved - A Text Editor^</description^> >>$@
@echo ^<dependency^> >>$@
@echo ^<dependentAssembly^> >>$@
@echo ^<assemblyIdentity >>$@
@echo type="win32" >>$@
@echo name="Microsoft.Windows.Common-Controls" >>$@
@echo version="6.0.0.0" >>$@
@echo publicKeyToken="6595b64144ccf1df" >>$@
@echo language="*" >>$@
@echo processorArchitecture="$(ASSEMBLY_ARCHITECTURE)" >>$@
@echo /^> >>$@
@echo ^</dependentAssembly^> >>$@
@echo ^</dependency^> >>$@
@echo ^</assembly^> >>$@
auto: auto:
if not exist auto/nul mkdir auto if not exist auto/nul mkdir auto

View File

@ -1330,7 +1330,7 @@ diff_read(idx_orig, idx_new, fname)
/* Allocate a new diffblock. */ /* Allocate a new diffblock. */
dp = diff_alloc_new(curtab, dprev, dp); dp = diff_alloc_new(curtab, dprev, dp);
if (dp == NULL) if (dp == NULL)
return; goto done;
dp->df_lnum[idx_orig] = lnum_orig; dp->df_lnum[idx_orig] = lnum_orig;
dp->df_count[idx_orig] = count_orig; dp->df_count[idx_orig] = count_orig;
@ -1357,6 +1357,7 @@ diff_read(idx_orig, idx_new, fname)
notset = TRUE; notset = TRUE;
} }
done:
fclose(fd); fclose(fd);
} }

View File

@ -178,7 +178,9 @@ static int spell_bad_len = 0; /* length of located bad word */
#endif #endif
static void stop_insert __ARGS((pos_T *end_insert_pos, int esc)); static void stop_insert __ARGS((pos_T *end_insert_pos, int esc));
static int echeck_abbr __ARGS((int)); static int echeck_abbr __ARGS((int));
#if 0
static void replace_push_off __ARGS((int c)); static void replace_push_off __ARGS((int c));
#endif
static int replace_pop __ARGS((void)); static int replace_pop __ARGS((void));
static void replace_join __ARGS((int off)); static void replace_join __ARGS((int off));
static void replace_pop_ins __ARGS((void)); static void replace_pop_ins __ARGS((void));
@ -5823,7 +5825,7 @@ redo_literal(c)
*/ */
static void static void
start_arrow(end_insert_pos) start_arrow(end_insert_pos)
pos_T *end_insert_pos; pos_T *end_insert_pos; /* can be NULL */
{ {
if (!arrow_used) /* something has been inserted */ if (!arrow_used) /* something has been inserted */
{ {
@ -5912,11 +5914,13 @@ stop_arrow()
} }
/* /*
* do a few things to stop inserting * Do a few things to stop inserting.
* "end_insert_pos" is where insert ended. It is NULL when we already jumped
* to another window/buffer.
*/ */
static void static void
stop_insert(end_insert_pos, esc) stop_insert(end_insert_pos, esc)
pos_T *end_insert_pos; /* where insert ended */ pos_T *end_insert_pos;
int esc; /* called by ins_esc() */ int esc; /* called by ins_esc() */
{ {
int cc; int cc;
@ -5941,7 +5945,7 @@ stop_insert(end_insert_pos, esc)
else else
vim_free(ptr); vim_free(ptr);
if (!arrow_used) if (!arrow_used && end_insert_pos != NULL)
{ {
/* Auto-format now. It may seem strange to do this when stopping an /* Auto-format now. It may seem strange to do this when stopping an
* insertion (or moving the cursor), but it's required when appending * insertion (or moving the cursor), but it's required when appending
@ -5987,7 +5991,7 @@ stop_insert(end_insert_pos, esc)
* of the line, and put the cursor back. * of the line, and put the cursor back.
* Do this when ESC was used or moving the cursor up/down. */ * Do this when ESC was used or moving the cursor up/down. */
if (did_ai && (esc || (vim_strchr(p_cpo, CPO_INDENT) == NULL if (did_ai && (esc || (vim_strchr(p_cpo, CPO_INDENT) == NULL
&& curwin->w_cursor.lnum != end_insert_pos->lnum))) && curwin->w_cursor.lnum != end_insert_pos->lnum)))
{ {
pos_T tpos = curwin->w_cursor; pos_T tpos = curwin->w_cursor;
@ -6030,9 +6034,13 @@ stop_insert(end_insert_pos, esc)
can_si_back = FALSE; can_si_back = FALSE;
#endif #endif
/* set '[ and '] to the inserted text */ /* Set '[ and '] to the inserted text. When end_insert_pos is NULL we are
curbuf->b_op_start = Insstart; * now in a different buffer. */
curbuf->b_op_end = *end_insert_pos; if (end_insert_pos != NULL)
{
curbuf->b_op_start = Insstart;
curbuf->b_op_end = *end_insert_pos;
}
} }
/* /*
@ -6563,6 +6571,7 @@ replace_push(c)
++replace_stack_nr; ++replace_stack_nr;
} }
#if 0
/* /*
* call replace_push(c) with replace_offset set to the first NUL. * call replace_push(c) with replace_offset set to the first NUL.
*/ */
@ -6580,6 +6589,7 @@ replace_push_off(c)
replace_push(c); replace_push(c);
replace_offset = 0; replace_offset = 0;
} }
#endif
/* /*
* Pop one item from the replace stack. * Pop one item from the replace stack.
@ -8023,7 +8033,9 @@ ins_bs(c, mode, inserted_space_p)
int ts; int ts;
colnr_T vcol; colnr_T vcol;
colnr_T want_vcol; colnr_T want_vcol;
#if 0
int extra = 0; int extra = 0;
#endif
*inserted_space_p = FALSE; *inserted_space_p = FALSE;
if (p_sta && in_indent) if (p_sta && in_indent)
@ -8082,15 +8094,19 @@ ins_bs(c, mode, inserted_space_p)
#endif #endif
{ {
ins_str((char_u *)" "); ins_str((char_u *)" ");
if ((State & REPLACE_FLAG) && extra <= 1) if ((State & REPLACE_FLAG) /* && extra <= 1 */)
{ {
#if 0
if (extra) if (extra)
replace_push_off(NUL); replace_push_off(NUL);
else else
#endif
replace_push(NUL); replace_push(NUL);
} }
#if 0
if (extra == 2) if (extra == 2)
extra = 1; extra = 1;
#endif
} }
getvcol(curwin, &curwin->w_cursor, &vcol, NULL, NULL); getvcol(curwin, &curwin->w_cursor, &vcol, NULL, NULL);
} }
@ -8205,6 +8221,7 @@ ins_mouse(c)
int c; int c;
{ {
pos_T tpos; pos_T tpos;
win_T *old_curwin = curwin;
# ifdef FEAT_GUI # ifdef FEAT_GUI
/* When GUI is active, also move/paste when 'mouse' is empty */ /* When GUI is active, also move/paste when 'mouse' is empty */
@ -8217,7 +8234,25 @@ ins_mouse(c)
tpos = curwin->w_cursor; tpos = curwin->w_cursor;
if (do_mouse(NULL, c, BACKWARD, 1L, 0)) if (do_mouse(NULL, c, BACKWARD, 1L, 0))
{ {
start_arrow(&tpos); #ifdef FEAT_WINDOWS
win_T *new_curwin = curwin;
if (curwin != old_curwin && win_valid(old_curwin))
{
/* Mouse took us to another window. We need to go back to the
* previous one to stop insert there properly. */
curwin = old_curwin;
curbuf = curwin->w_buffer;
}
#endif
start_arrow(curwin == old_curwin ? &tpos : NULL);
#ifdef FEAT_WINDOWS
if (curwin != new_curwin && win_valid(new_curwin))
{
curwin = new_curwin;
curbuf = curwin->w_buffer;
}
#endif
# ifdef FEAT_CINDENT # ifdef FEAT_CINDENT
can_cindent = TRUE; can_cindent = TRUE;
# endif # endif

View File

@ -1413,7 +1413,7 @@ call_vim_function(func, argc, argv, safe, rettv)
void *save_funccalp = NULL; void *save_funccalp = NULL;
int ret; int ret;
argvars = (typval_T *)alloc((unsigned)(argc * sizeof(typval_T))); argvars = (typval_T *)alloc((unsigned)((argc + 1) * sizeof(typval_T)));
if (argvars == NULL) if (argvars == NULL)
return FAIL; return FAIL;
@ -7318,7 +7318,7 @@ get_func_tv(name, len, rettv, arg, firstline, lastline, doesrange,
{ {
char_u *argp; char_u *argp;
int ret = OK; int ret = OK;
typval_T argvars[MAX_FUNC_ARGS]; /* vars for arguments */ typval_T argvars[MAX_FUNC_ARGS + 1]; /* vars for arguments */
int argcount = 0; /* number of arguments found */ int argcount = 0; /* number of arguments found */
/* /*
@ -7375,7 +7375,8 @@ call_func(name, len, rettv, argcount, argvars, firstline, lastline,
int len; /* length of "name" */ int len; /* length of "name" */
typval_T *rettv; /* return value goes here */ typval_T *rettv; /* return value goes here */
int argcount; /* number of "argvars" */ int argcount; /* number of "argvars" */
typval_T *argvars; /* vars for arguments */ typval_T *argvars; /* vars for arguments, must have "argcount"
PLUS ONE elements! */
linenr_T firstline; /* first line of range */ linenr_T firstline; /* first line of range */
linenr_T lastline; /* last line of range */ linenr_T lastline; /* last line of range */
int *doesrange; /* return: function handled range */ int *doesrange; /* return: function handled range */
@ -8064,7 +8065,7 @@ f_call(argvars, rettv)
typval_T *rettv; typval_T *rettv;
{ {
char_u *func; char_u *func;
typval_T argv[MAX_FUNC_ARGS]; typval_T argv[MAX_FUNC_ARGS + 1];
int argc = 0; int argc = 0;
listitem_T *item; listitem_T *item;
int dummy; int dummy;
@ -8943,7 +8944,7 @@ f_extend(argvars, rettv)
break; break;
if (i == 3) if (i == 3)
{ {
EMSGN(_(e_invarg2), action); EMSG2(_(e_invarg2), action);
return; return;
} }
} }
@ -12997,7 +12998,7 @@ remote_common(argvars, rettv, expr)
char_u str[30]; char_u str[30];
char_u *idvar; char_u *idvar;
sprintf((char *)str, "0x%x", (unsigned int)w); sprintf((char *)str, PRINTF_HEX_LONG_U, (long_u)w);
v.di_tv.v_type = VAR_STRING; v.di_tv.v_type = VAR_STRING;
v.di_tv.vval.v_string = vim_strsave(str); v.di_tv.vval.v_string = vim_strsave(str);
idvar = get_tv_string_chk(&argvars[2]); idvar = get_tv_string_chk(&argvars[2]);
@ -13064,7 +13065,7 @@ f_remote_peek(argvars, rettv)
dictitem_T v; dictitem_T v;
char_u *s = NULL; char_u *s = NULL;
# ifdef WIN32 # ifdef WIN32
int n = 0; long_u n = 0;
# endif # endif
char_u *serverid; char_u *serverid;
@ -13080,7 +13081,7 @@ f_remote_peek(argvars, rettv)
return; /* type error; errmsg already given */ return; /* type error; errmsg already given */
} }
# ifdef WIN32 # ifdef WIN32
sscanf(serverid, "%x", &n); sscanf(serverid, SCANF_HEX_LONG_U, &n);
if (n == 0) if (n == 0)
rettv->vval.v_number = -1; rettv->vval.v_number = -1;
else else
@ -13128,9 +13129,9 @@ f_remote_read(argvars, rettv)
{ {
# ifdef WIN32 # ifdef WIN32
/* The server's HWND is encoded in the 'id' parameter */ /* The server's HWND is encoded in the 'id' parameter */
int n = 0; long_u n = 0;
sscanf(serverid, "%x", &n); sscanf(serverid, SCANF_HEX_LONG_U, &n);
if (n != 0) if (n != 0)
r = serverGetReply((HWND)n, FALSE, TRUE, TRUE); r = serverGetReply((HWND)n, FALSE, TRUE, TRUE);
if (r == NULL) if (r == NULL)
@ -14585,7 +14586,7 @@ item_compare2(s1, s2)
{ {
int res; int res;
typval_T rettv; typval_T rettv;
typval_T argv[2]; typval_T argv[3];
int dummy; int dummy;
/* shortcut after failure in previous call; compare all items equal */ /* shortcut after failure in previous call; compare all items equal */
@ -15133,11 +15134,12 @@ f_strridx(argvars, rettv)
needle = get_tv_string_chk(&argvars[1]); needle = get_tv_string_chk(&argvars[1]);
haystack = get_tv_string_buf_chk(&argvars[0], buf); haystack = get_tv_string_buf_chk(&argvars[0], buf);
haystack_len = (int)STRLEN(haystack);
rettv->vval.v_number = -1; rettv->vval.v_number = -1;
if (needle == NULL || haystack == NULL) if (needle == NULL || haystack == NULL)
return; /* type error; errmsg already given */ return; /* type error; errmsg already given */
haystack_len = (int)STRLEN(haystack);
if (argvars[2].v_type != VAR_UNKNOWN) if (argvars[2].v_type != VAR_UNKNOWN)
{ {
/* Third argument: upper limit for index */ /* Third argument: upper limit for index */
@ -15398,7 +15400,10 @@ f_system(argvars, rettv)
} }
p = get_tv_string_buf_chk(&argvars[1], buf); p = get_tv_string_buf_chk(&argvars[1], buf);
if (p == NULL) if (p == NULL)
{
fclose(fd);
goto done; /* type error; errmsg already given */ goto done; /* type error; errmsg already given */
}
if (fwrite(p, STRLEN(p), 1, fd) != 1) if (fwrite(p, STRLEN(p), 1, fd) != 1)
err = TRUE; err = TRUE;
if (fclose(fd) != 0) if (fclose(fd) != 0)

View File

@ -1778,6 +1778,7 @@ write_viminfo(file, forceit)
tt = msg_didany; tt = msg_didany;
EMSG2(_("E137: Viminfo file is not writable: %s"), fname); EMSG2(_("E137: Viminfo file is not writable: %s"), fname);
msg_didany = tt; msg_didany = tt;
fclose(fp_in);
goto end; goto end;
} }
#endif #endif

View File

@ -9438,7 +9438,8 @@ eval_vars(src, usedlen, lnump, errormsg, srcstart)
break; break;
#if defined(FEAT_CLIENTSERVER) #if defined(FEAT_CLIENTSERVER)
case SPEC_CLIENT: /* Source of last submitted input */ case SPEC_CLIENT: /* Source of last submitted input */
sprintf((char *)strbuf, "0x%x", (unsigned int)clientWindow); sprintf((char *)strbuf, PRINTF_HEX_LONG_U,
(long_u)clientWindow);
result = strbuf; result = strbuf;
break; break;
#endif #endif

View File

@ -1136,7 +1136,7 @@ ex_continue(eap)
* next). Therefor, inactivate all conditionals except the ":while" * next). Therefor, inactivate all conditionals except the ":while"
* itself (if reached). */ * itself (if reached). */
idx = cleanup_conditionals(cstack, CSF_WHILE | CSF_FOR, FALSE); idx = cleanup_conditionals(cstack, CSF_WHILE | CSF_FOR, FALSE);
if ((cstack->cs_flags[idx] & (CSF_WHILE | CSF_FOR))) if (idx >= 0 && (cstack->cs_flags[idx] & (CSF_WHILE | CSF_FOR)))
{ {
rewind_conditionals(cstack, idx, CSF_TRY, &cstack->cs_trylevel); rewind_conditionals(cstack, idx, CSF_TRY, &cstack->cs_trylevel);
@ -1175,7 +1175,7 @@ ex_break(eap)
* executed next) is found. In the latter case, make the ":break" * executed next) is found. In the latter case, make the ":break"
* pending for execution at the ":endtry". */ * pending for execution at the ":endtry". */
idx = cleanup_conditionals(cstack, CSF_WHILE | CSF_FOR, TRUE); idx = cleanup_conditionals(cstack, CSF_WHILE | CSF_FOR, TRUE);
if (!(cstack->cs_flags[idx] & (CSF_WHILE | CSF_FOR))) if (idx >= 0 && !(cstack->cs_flags[idx] & (CSF_WHILE | CSF_FOR)))
{ {
cstack->cs_pending[idx] = CSTP_BREAK; cstack->cs_pending[idx] = CSTP_BREAK;
report_make_pending(CSTP_BREAK, NULL); report_make_pending(CSTP_BREAK, NULL);
@ -1861,7 +1861,7 @@ ex_endtry(eap)
* after errors except when this ":endtry" is not within a ":try". * after errors except when this ":endtry" is not within a ":try".
* Restore "emsg_silent" if it has been reset by this try conditional. * Restore "emsg_silent" if it has been reset by this try conditional.
*/ */
cleanup_conditionals(cstack, CSF_TRY | CSF_SILENT, TRUE); (void)cleanup_conditionals(cstack, CSF_TRY | CSF_SILENT, TRUE);
--cstack->cs_idx; --cstack->cs_idx;
--cstack->cs_trylevel; --cstack->cs_trylevel;

View File

@ -2594,8 +2594,9 @@ foldUpdateIEMSRecurse(gap, level, startlnum, flp, getlevel, bot, topflags)
/* /*
* The fold includes the line "flp->lnum" and "flp->lnum_save". * The fold includes the line "flp->lnum" and "flp->lnum_save".
* Check "fp" for safety.
*/ */
if (lvl > level) if (lvl > level && fp != NULL)
{ {
/* /*
* There is a nested fold, handle it recursively. * There is a nested fold, handle it recursively.

View File

@ -4053,14 +4053,19 @@ ExpandMappings(regmatch, num_file, file)
} }
} /* for (round) */ } /* for (round) */
/* Sort the matches */ if (count > 1)
sort_strings(*file, count);
/* Remove multiple entries */
{ {
char_u **ptr1 = *file; char_u **ptr1;
char_u **ptr2 = ptr1 + 1; char_u **ptr2;
char_u **ptr3 = ptr1 + count; char_u **ptr3;
/* Sort the matches */
sort_strings(*file, count);
/* Remove multiple entries */
ptr1 = *file;
ptr2 = ptr1 + 1;
ptr3 = ptr1 + count;
while (ptr2 < ptr3) while (ptr2 < ptr3)
{ {

View File

@ -787,12 +787,12 @@ gui_mch_add_menu_item(vimmenu_T *menu, int idx)
# endif /* FEAT_TOOLBAR */ # endif /* FEAT_TOOLBAR */
{ {
/* No parent, must be a non-menubar menu */ /* No parent, must be a non-menubar menu */
if (parent->submenu_id == NULL) if (parent == NULL || parent->submenu_id == NULL)
return; return;
/* Make place for the possible tearoff handle item. Not in the popup /* Make place for the possible tearoff handle item. Not in the popup
* menu, it doesn't have a tearoff item. */ * menu, it doesn't have a tearoff item. */
if (parent != NULL && !menu_is_popup(parent->name)) if (!menu_is_popup(parent->name))
++idx; ++idx;
if (menu_is_separator(menu->name)) if (menu_is_separator(menu->name))

View File

@ -2024,6 +2024,8 @@ drag_handle_uri_list(GdkDragContext *context,
gui_handle_drop(x, y, modifiers, fnames, nfiles); gui_handle_drop(x, y, modifiers, fnames, nfiles);
} }
else
vim_free(fnames);
} }
static void static void
@ -4707,7 +4709,7 @@ gui_mch_font_dialog(char_u *oldval)
* that, because in 'guifont' it separates names. */ * that, because in 'guifont' it separates names. */
p = vim_strsave_escaped((char_u *)name, (char_u *)","); p = vim_strsave_escaped((char_u *)name, (char_u *)",");
g_free(name); g_free(name);
if (input_conv.vc_type != CONV_NONE) if (p != NULL && input_conv.vc_type != CONV_NONE)
{ {
fontname = string_convert(&input_conv, p, NULL); fontname = string_convert(&input_conv, p, NULL);
vim_free(p); vim_free(p);
@ -6870,7 +6872,7 @@ mch_set_mouse_shape(int shape)
else else
id &= ~1; /* they are always even (why?) */ id &= ~1; /* they are always even (why?) */
} }
else else if (shape < sizeof(mshape_ids) / sizeof(int))
id = mshape_ids[shape]; id = mshape_ids[shape];
# ifdef HAVE_GTK_MULTIHEAD # ifdef HAVE_GTK_MULTIHEAD
c = gdk_cursor_new_for_display( c = gdk_cursor_new_for_display(

View File

@ -181,13 +181,14 @@
# define ID_BEVAL_TOOLTIP 200 # define ID_BEVAL_TOOLTIP 200
# define BEVAL_TEXT_LEN MAXPATHL # define BEVAL_TEXT_LEN MAXPATHL
static void make_tooltip __ARGS((BalloonEval *beval, char *text, POINT pt));
static void delete_tooltip __ARGS((BalloonEval *beval));
static VOID CALLBACK BevalTimerProc __ARGS((HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime));
#ifndef UINT_PTR #ifndef UINT_PTR
# define UINT_PTR UINT # define UINT_PTR UINT
#endif #endif
static void make_tooltip __ARGS((BalloonEval *beval, char *text, POINT pt));
static void delete_tooltip __ARGS((BalloonEval *beval));
static VOID CALLBACK BevalTimerProc __ARGS((HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime));
static BalloonEval *cur_beval = NULL; static BalloonEval *cur_beval = NULL;
static UINT_PTR BevalTimerId = 0; static UINT_PTR BevalTimerId = 0;
static DWORD LastActivity = 0; static DWORD LastActivity = 0;
@ -811,9 +812,102 @@ _WndProc(
case WM_NOTIFY: case WM_NOTIFY:
switch (((LPNMHDR) lParam)->code) switch (((LPNMHDR) lParam)->code)
{ {
# ifdef FEAT_TOOLBAR # ifdef FEAT_MBYTE
case TTN_GETDISPINFOW:
# endif
case TTN_NEEDTEXT: case TTN_NEEDTEXT:
# ifdef FEAT_GUI_TABLINE
if (gui_mch_showing_tabline()
&& ((LPNMHDR)lParam)->hwndFrom ==
TabCtrl_GetToolTips(s_tabhwnd))
{ {
LPNMTTDISPINFO lpdi;
POINT pt;
static char *tt_text = NULL;
static int tt_text_len = 0;
/*
* Mouse is over the GUI tabline. Display the tooltip
* for the tab under the cursor
*/
lpdi = (LPNMTTDISPINFO)lParam;
lpdi->hinst = NULL;
lpdi->szText[0] = '\0';
/*
* Get the cursor position within the tab control
*/
GetCursorPos(&pt);
if (ScreenToClient(s_tabhwnd, &pt) != 0)
{
TCHITTESTINFO htinfo;
int idx;
/*
* Get the tab under the cursor
*/
htinfo.pt.x = pt.x;
htinfo.pt.y = pt.y;
idx = TabCtrl_HitTest(s_tabhwnd, &htinfo);
if (idx != -1)
{
tabpage_T *tp;
tp = find_tabpage(idx + 1);
if (tp != NULL)
{
# ifdef FEAT_MBYTE
WCHAR *wstr = NULL;
# endif
get_tabline_label(tp, TRUE);
# ifdef FEAT_MBYTE
if (enc_codepage >= 0
&& (int)GetACP() != enc_codepage)
{
wstr = enc_to_ucs2(NameBuff, NULL);
if (wstr != NULL)
{
int wlen;
wlen = (wcslen(wstr) + 1)
* sizeof(WCHAR);
if (tt_text_len < wlen)
{
tt_text = vim_realloc(tt_text,
wlen);
if (tt_text != NULL)
tt_text_len = wlen;
}
if (tt_text != NULL)
wcscpy((WCHAR *)tt_text, wstr);
lpdi->lpszText = tt_text;
vim_free(wstr);
}
}
if (wstr == NULL)
# endif
{
int len;
len = STRLEN(NameBuff) + 1;
if (tt_text_len < len)
{
tt_text = vim_realloc(tt_text, len);
if (tt_text != NULL)
tt_text_len = len;
}
if (tt_text != NULL)
STRCPY(tt_text, NameBuff);
lpdi->lpszText = tt_text;
}
}
}
}
}
else
# endif
{
# ifdef FEAT_TOOLBAR
LPTOOLTIPTEXT lpttt; LPTOOLTIPTEXT lpttt;
UINT idButton; UINT idButton;
int idx; int idx;
@ -831,9 +925,9 @@ _WndProc(
lpttt->lpszText = pMenu->strings[idx]; lpttt->lpszText = pMenu->strings[idx];
} }
} }
# endif
} }
break; break;
# endif
# ifdef FEAT_GUI_TABLINE # ifdef FEAT_GUI_TABLINE
case TCN_SELCHANGE: case TCN_SELCHANGE:
if (gui_mch_showing_tabline() if (gui_mch_showing_tabline()
@ -2341,7 +2435,7 @@ gui_mch_add_menu(
{ {
InsertMenu((parent == NULL) ? s_menuBar : parent->submenu_id, InsertMenu((parent == NULL) ? s_menuBar : parent->submenu_id,
(UINT)pos, MF_POPUP | MF_STRING | MF_BYPOSITION, (UINT)pos, MF_POPUP | MF_STRING | MF_BYPOSITION,
(UINT)menu->submenu_id, (LPCTSTR) menu->name); (long_u)menu->submenu_id, (LPCTSTR) menu->name);
} }
else else
{ {
@ -2361,7 +2455,7 @@ gui_mch_add_menu(
infow.cbSize = sizeof(infow); infow.cbSize = sizeof(infow);
infow.fMask = MIIM_DATA | MIIM_TYPE | MIIM_ID infow.fMask = MIIM_DATA | MIIM_TYPE | MIIM_ID
| MIIM_SUBMENU; | MIIM_SUBMENU;
infow.dwItemData = (DWORD)menu; infow.dwItemData = (long_u)menu;
infow.wID = menu->id; infow.wID = menu->id;
infow.fType = MFT_STRING; infow.fType = MFT_STRING;
infow.dwTypeData = wn; infow.dwTypeData = wn;
@ -2384,7 +2478,7 @@ gui_mch_add_menu(
info.cbSize = sizeof(info); info.cbSize = sizeof(info);
info.fMask = MIIM_DATA | MIIM_TYPE | MIIM_ID | MIIM_SUBMENU; info.fMask = MIIM_DATA | MIIM_TYPE | MIIM_ID | MIIM_SUBMENU;
info.dwItemData = (DWORD)menu; info.dwItemData = (long_u)menu;
info.wID = menu->id; info.wID = menu->id;
info.fType = MFT_STRING; info.fType = MFT_STRING;
info.dwTypeData = (LPTSTR)menu->name; info.dwTypeData = (LPTSTR)menu->name;
@ -2661,7 +2755,7 @@ gui_mch_menu_grey(
if (menu->children == NULL) if (menu->children == NULL)
menuID = (WORD)(menu->id); menuID = (WORD)(menu->id);
else else
menuID = (WORD)((DWORD)(menu->submenu_id) | (DWORD)0x8000); menuID = (WORD)((long_u)(menu->submenu_id) | (DWORD)0x8000);
menuHandle = GetDlgItem(menu->parent->tearoff_handle, menuID); menuHandle = GetDlgItem(menu->parent->tearoff_handle, menuID);
if (menuHandle) if (menuHandle)
EnableWindow(menuHandle, !grey); EnableWindow(menuHandle, !grey);
@ -2860,7 +2954,7 @@ gui_mch_dialog(
/* allocate some memory for dialog template */ /* allocate some memory for dialog template */
/* TODO should compute this really */ /* TODO should compute this really */
pdlgtemplate = p = (PWORD)LocalAlloc(LPTR, pdlgtemplate = p = (PWORD)LocalAlloc(LPTR,
DLG_ALLOC_SIZE + STRLEN(message)); DLG_ALLOC_SIZE + STRLEN(message) * 2);
if (p == NULL) if (p == NULL)
return -1; return -1;
@ -3281,6 +3375,7 @@ gui_mch_dialog(
} }
#endif /* FEAT_GUI_DIALOG */ #endif /* FEAT_GUI_DIALOG */
/* /*
* Put a simple element (basic class) onto a dialog template in memory. * Put a simple element (basic class) onto a dialog template in memory.
* return a pointer to where the next item should be added. * return a pointer to where the next item should be added.
@ -3344,9 +3439,9 @@ add_dialog_element(
lpwAlign( lpwAlign(
LPWORD lpIn) LPWORD lpIn)
{ {
ULONG ul; long_u ul;
ul = (ULONG)lpIn; ul = (long_u)lpIn;
ul += 3; ul += 3;
ul >>= 2; ul >>= 2;
ul <<= 2; ul <<= 2;
@ -3435,7 +3530,7 @@ tearoff_callback(
if (GetCursorPos(&mp) && GetWindowRect(hwnd, &rect)) if (GetCursorPos(&mp) && GetWindowRect(hwnd, &rect))
{ {
(void)TrackPopupMenu( (void)TrackPopupMenu(
(HMENU)(LOWORD(wParam) ^ 0x8000), (HMENU)(long_u)(LOWORD(wParam) ^ 0x8000),
TPM_LEFTALIGN | TPM_LEFTBUTTON, TPM_LEFTALIGN | TPM_LEFTBUTTON,
(int)rect.right - 8, (int)rect.right - 8,
(int)mp.y, (int)mp.y,
@ -3794,7 +3889,7 @@ gui_mch_tearoff(
else else
{ {
len += (int)STRLEN(TEAROFF_SUBMENU_LABEL); len += (int)STRLEN(TEAROFF_SUBMENU_LABEL);
menuID = (WORD)((DWORD)(menu->submenu_id) | (DWORD)0x8000); menuID = (WORD)((long_u)(menu->submenu_id) | (DWORD)0x8000);
} }
/* Allocate menu label and fill it in */ /* Allocate menu label and fill it in */
@ -3953,7 +4048,7 @@ get_toolbar_bitmap(vimmenu_T *menu)
TBADDBITMAP tbAddBitmap; TBADDBITMAP tbAddBitmap;
tbAddBitmap.hInst = NULL; tbAddBitmap.hInst = NULL;
tbAddBitmap.nID = (UINT)hbitmap; tbAddBitmap.nID = (long_u)hbitmap;
i = (int)SendMessage(s_toolbarhwnd, TB_ADDBITMAP, i = (int)SendMessage(s_toolbarhwnd, TB_ADDBITMAP,
(WPARAM)1, (LPARAM)&tbAddBitmap); (WPARAM)1, (LPARAM)&tbAddBitmap);
@ -3978,7 +4073,7 @@ initialise_tabline(void)
InitCommonControls(); InitCommonControls();
s_tabhwnd = CreateWindow(WC_TABCONTROL, "Vim tabline", s_tabhwnd = CreateWindow(WC_TABCONTROL, "Vim tabline",
WS_CHILD|TCS_FOCUSNEVER, WS_CHILD|TCS_FOCUSNEVER|TCS_TOOLTIPS,
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, s_hwnd, NULL, s_hinst, NULL); CW_USEDEFAULT, s_hwnd, NULL, s_hinst, NULL);
@ -4404,7 +4499,7 @@ delete_tooltip(beval)
BevalTimerProc(hwnd, uMsg, idEvent, dwTime) BevalTimerProc(hwnd, uMsg, idEvent, dwTime)
HWND hwnd; HWND hwnd;
UINT uMsg; UINT uMsg;
UINT idEvent; UINT_PTR idEvent;
DWORD dwTime; DWORD dwTime;
{ {
POINT pt; POINT pt;

View File

@ -2538,12 +2538,11 @@ mch_print_init(psettings, jobname, forceit)
/* Build CMap name - will be same for all multi-byte fonts used */ /* Build CMap name - will be same for all multi-byte fonts used */
prt_cmap[0] = NUL; prt_cmap[0] = NUL;
prt_custom_cmap = prt_out_mbyte && p_mbchar == NULL; prt_custom_cmap = (p_mbchar == NULL);
if (!prt_custom_cmap) if (!prt_custom_cmap)
{ {
/* Check encoding and character set are compatible */ /* Check encoding and character set are compatible */
if ((p_mbenc->needs_charset&p_mbchar->has_charset) == 0) if ((p_mbenc->needs_charset & p_mbchar->has_charset) == 0)
{ {
EMSG(_("E673: Incompatible multi-byte encoding and character set.")); EMSG(_("E673: Incompatible multi-byte encoding and character set."));
return FALSE; return FALSE;
@ -2862,6 +2861,7 @@ mch_print_begin(psettings)
struct prt_ps_resource_S res_encoding; struct prt_ps_resource_S res_encoding;
char buffer[256]; char buffer[256];
char_u *p_encoding; char_u *p_encoding;
char_u *p;
#ifdef FEAT_MBYTE #ifdef FEAT_MBYTE
struct prt_ps_resource_S res_cidfont; struct prt_ps_resource_S res_cidfont;
struct prt_ps_resource_S res_cmap; struct prt_ps_resource_S res_cmap;
@ -2880,7 +2880,9 @@ mch_print_begin(psettings)
now = time(NULL); now = time(NULL);
p_time = ctime(&now); p_time = ctime(&now);
/* Note: ctime() adds a \n so we have to remove it :-( */ /* Note: ctime() adds a \n so we have to remove it :-( */
*(vim_strchr((char_u *)p_time, '\n')) = '\0'; p = vim_strchr((char_u *)p_time, '\n');
if (p != NULL)
*p = NUL;
prt_dsc_textline("CreationDate", p_time); prt_dsc_textline("CreationDate", p_time);
prt_dsc_textline("DocumentData", "Clean8Bit"); prt_dsc_textline("DocumentData", "Clean8Bit");
prt_dsc_textline("Orientation", "Portrait"); prt_dsc_textline("Orientation", "Portrait");

View File

@ -3100,7 +3100,7 @@ enc_locale()
else else
s = p + 1; s = p + 1;
} }
for (i = 0; s[i] != NUL && i < sizeof(buf) - 1; ++i) for (i = 0; s[i] != NUL && s + i < buf + sizeof(buf) - 1; ++i)
{ {
if (s[i] == '_' || s[i] == '-') if (s[i] == '_' || s[i] == '-')
buf[i] = '-'; buf[i] = '-';

View File

@ -59,7 +59,7 @@ static char_u *menutrans_lookup __ARGS((char_u *name, int len));
#endif #endif
/* The character for each menu mode */ /* The character for each menu mode */
static char_u menu_mode_chars[] = {'n', 'v', 'o', 'i', 'c', 't'}; static char_u menu_mode_chars[] = {'n', 'v', 's', 'o', 'i', 'c', 't'};
static char_u e_notsubmenu[] = N_("E327: Part of menu-item path is not sub-menu"); static char_u e_notsubmenu[] = N_("E327: Part of menu-item path is not sub-menu");
static char_u e_othermode[] = N_("E328: Menu only exists in another mode"); static char_u e_othermode[] = N_("E328: Menu only exists in another mode");
@ -1293,6 +1293,7 @@ set_context_in_menu_cmd(xp, cmd, arg, forceit)
name = p; name = p;
menu = menu->children; menu = menu->children;
} }
vim_free(path_name);
xp->xp_context = expand_menus ? EXPAND_MENUNAMES : EXPAND_MENUS; xp->xp_context = expand_menus ? EXPAND_MENUNAMES : EXPAND_MENUS;
xp->xp_pattern = after_dot; xp->xp_pattern = after_dot;

View File

@ -528,6 +528,25 @@ msg_source(attr)
--no_wait_return; --no_wait_return;
} }
/*
* Return TRUE if not giving error messages right now:
* If "emsg_off" is set: no error messages at the moment.
* If "msg" is in 'debug': do error message but without side effects.
* If "emsg_skip" is set: never do error messages.
*/
int
emsg_not_now()
{
if ((emsg_off > 0 && vim_strchr(p_debug, 'm') == NULL
&& vim_strchr(p_debug, 't') == NULL)
#ifdef FEAT_EVAL
|| emsg_skip > 0
#endif
)
return TRUE;
return FALSE;
}
/* /*
* emsg() - display an error message * emsg() - display an error message
* *
@ -559,17 +578,8 @@ emsg(s)
emsg_severe = FALSE; emsg_severe = FALSE;
#endif #endif
/* /* Skip this if not giving error messages at the moment. */
* If "emsg_off" is set: no error messages at the moment. if (emsg_not_now())
* If "msg" is in 'debug': do error message but without side effects.
* If "emsg_skip" is set: never do error messages.
*/
if ((emsg_off > 0 && vim_strchr(p_debug, 'm') == NULL
&& vim_strchr(p_debug, 't') == NULL)
#ifdef FEAT_EVAL
|| emsg_skip > 0
#endif
)
return TRUE; return TRUE;
if (!emsg_off || vim_strchr(p_debug, 't') != NULL) if (!emsg_off || vim_strchr(p_debug, 't') != NULL)

View File

@ -321,7 +321,7 @@ copy_indent(size, src)
++ind_done; ++ind_done;
} }
++ind_len; ++ind_len;
if (round == 2) if (p != NULL)
*p++ = *s; *p++ = *s;
++s; ++s;
} }
@ -332,7 +332,7 @@ copy_indent(size, src)
{ {
todo -= tab_pad; todo -= tab_pad;
++ind_len; ++ind_len;
if (round == 2) if (p != NULL)
*p++ = TAB; *p++ = TAB;
} }
@ -341,7 +341,7 @@ copy_indent(size, src)
{ {
todo -= (int)curbuf->b_p_ts; todo -= (int)curbuf->b_p_ts;
++ind_len; ++ind_len;
if (round == 2) if (p != NULL)
*p++ = TAB; *p++ = TAB;
} }
@ -350,11 +350,11 @@ copy_indent(size, src)
{ {
--todo; --todo;
++ind_len; ++ind_len;
if (round == 2) if (p != NULL)
*p++ = ' '; *p++ = ' ';
} }
if (round == 1) if (p == NULL)
{ {
/* Allocate memory for the result: the copied indent, new indent /* Allocate memory for the result: the copied indent, new indent
* and the rest of the line. */ * and the rest of the line. */

View File

@ -270,14 +270,15 @@ coladvance2(pos, addspaces, finetune, wcol)
/* Break a tab */ /* Break a tab */
int linelen = (int)STRLEN(line); int linelen = (int)STRLEN(line);
int correct = wcol - col - csize + 1; /* negative!! */ int correct = wcol - col - csize + 1; /* negative!! */
char_u *newline = alloc(linelen + csize); char_u *newline;
int t, s = 0; int t, s = 0;
int v; int v;
/* if (-correct > csize)
* break a tab return FAIL;
*/
if (newline == NULL || -correct > csize) newline = alloc(linelen + csize);
if (newline == NULL)
return FAIL; return FAIL;
for (t = 0; t < linelen; t++) for (t = 0; t < linelen; t++)
@ -5816,14 +5817,9 @@ filewritable(fname)
emsg3(s, a1, a2) emsg3(s, a1, a2)
char_u *s, *a1, *a2; char_u *s, *a1, *a2;
{ {
if ((emsg_off > 0 && vim_strchr(p_debug, 'm') == NULL if (emsg_not_now())
&& vim_strchr(p_debug, 't') == NULL)
#ifdef FEAT_EVAL
|| emsg_skip > 0
#endif
)
return TRUE; /* no error messages at the moment */ return TRUE; /* no error messages at the moment */
vim_snprintf((char *)IObuff, IOSIZE, (char *)s, (long)a1, (long)a2); vim_snprintf((char *)IObuff, IOSIZE, (char *)s, (long_u)a1, (long_u)a2);
return emsg(IObuff); return emsg(IObuff);
} }
@ -5836,14 +5832,8 @@ emsgn(s, n)
char_u *s; char_u *s;
long n; long n;
{ {
if ((emsg_off > 0 && vim_strchr(p_debug, 'm') == NULL if (emsg_not_now())
&& vim_strchr(p_debug, 't') == NULL)
#ifdef FEAT_EVAL
|| emsg_skip > 0
#endif
)
return TRUE; /* no error messages at the moment */ return TRUE; /* no error messages at the moment */
vim_snprintf((char *)IObuff, IOSIZE, (char *)s, n); vim_snprintf((char *)IObuff, IOSIZE, (char *)s, n);
return emsg(IObuff); return emsg(IObuff);
} }

View File

@ -1641,17 +1641,30 @@ nb_do_cmd(
} }
else if (streq((char *)cmd, "insertDone")) else if (streq((char *)cmd, "insertDone"))
{ {
buf->bufp->b_start_eol = *args == 'T'; if (buf == NULL || buf->bufp == NULL)
buf->insertDone = TRUE; {
args += 2; nbdebug((" null bufp in insertDone"));
buf->bufp->b_p_ro = *args == 'T'; }
print_read_msg(buf); else
{
buf->bufp->b_start_eol = *args == 'T';
buf->insertDone = TRUE;
args += 2;
buf->bufp->b_p_ro = *args == 'T';
print_read_msg(buf);
}
/* =====================================================================*/ /* =====================================================================*/
} }
else if (streq((char *)cmd, "saveDone")) else if (streq((char *)cmd, "saveDone"))
{ {
long savedChars = atol((char *) args); long savedChars = atol((char *)args);
print_save_msg(buf, savedChars);
if (buf == NULL || buf->bufp == NULL)
{
nbdebug((" null bufp in saveDone"));
}
else
print_save_msg(buf, savedChars);
/* =====================================================================*/ /* =====================================================================*/
} }
else if (streq((char *)cmd, "startDocumentListen")) else if (streq((char *)cmd, "startDocumentListen"))
@ -1856,12 +1869,17 @@ nb_do_cmd(
} }
else if (streq((char *)cmd, "setModtime")) else if (streq((char *)cmd, "setModtime"))
{ {
buf->bufp->b_mtime = atoi((char *) args); if (buf == NULL || buf->bufp == NULL)
nbdebug((" null bufp in setModtime"));
else
buf->bufp->b_mtime = atoi((char *)args);
/* =====================================================================*/ /* =====================================================================*/
} }
else if (streq((char *)cmd, "setReadOnly")) else if (streq((char *)cmd, "setReadOnly"))
{ {
if (streq((char *)args, "T")) if (buf == NULL || buf->bufp == NULL)
nbdebug((" null bufp in setReadOnly"));
else if (streq((char *)args, "T"))
buf->bufp->b_p_ro = TRUE; buf->bufp->b_p_ro = TRUE;
else else
buf->bufp->b_p_ro = FALSE; buf->bufp->b_p_ro = FALSE;
@ -2637,7 +2655,7 @@ netbeans_file_activated(buf_T *bufp)
return; return;
q = nb_quote(bufp->b_ffname); q = nb_quote(bufp->b_ffname);
if (q == NULL || bp == NULL || bufp == NULL) if (q == NULL || bp == NULL)
return; return;
vim_snprintf(buffer, sizeof(buffer), "%d:fileOpened=%d \"%s\" %s %s\n", vim_snprintf(buffer, sizeof(buffer), "%d:fileOpened=%d \"%s\" %s %s\n",

View File

@ -831,6 +831,12 @@ getcount:
{ {
unshift_special(&ca); unshift_special(&ca);
idx = find_command(ca.cmdchar); idx = find_command(ca.cmdchar);
if (idx < 0)
{
/* Just in case */
clearopbeep(oap);
goto normal_end;
}
} }
else if ((nv_cmds[idx].cmd_flags & NV_SSS) else if ((nv_cmds[idx].cmd_flags & NV_SSS)
&& (mod_mask & MOD_MASK_SHIFT)) && (mod_mask & MOD_MASK_SHIFT))

View File

@ -3723,11 +3723,10 @@ error:
end: end:
if (allocated) if (allocated)
{
vim_free(insert_string); vim_free(insert_string);
if (regname == '=') if (regname == '=')
vim_free(y_array); vim_free(y_array);
}
/* If the cursor is past the end of the line put it at the end. */ /* If the cursor is past the end of the line put it at the end. */
if (gchar_cursor() == NUL if (gchar_cursor() == NUL
&& curwin->w_cursor.col > 0 && curwin->w_cursor.col > 0
@ -4967,10 +4966,6 @@ do_addsub(command, Prenum1)
--col; --col;
} }
/* truncate to max length of a number */
if (length >= NUMBUFLEN - 1)
length = NUMBUFLEN - 2;
/* /*
* If a number was found, and saving for undo works, replace the number. * If a number was found, and saving for undo works, replace the number.
*/ */

View File

@ -3396,7 +3396,7 @@ set_option_default(opt_idx, opt_flags, compatible)
win_comp_scroll(curwin); win_comp_scroll(curwin);
else else
{ {
*(long *)varp = (long)options[opt_idx].def_val[dvi]; *(long *)varp = (long)(long_i)options[opt_idx].def_val[dvi];
/* May also set global value for local option. */ /* May also set global value for local option. */
if (both) if (both)
*(long *)get_varp_scope(&(options[opt_idx]), OPT_GLOBAL) = *(long *)get_varp_scope(&(options[opt_idx]), OPT_GLOBAL) =
@ -3405,8 +3405,9 @@ set_option_default(opt_idx, opt_flags, compatible)
} }
else /* P_BOOL */ else /* P_BOOL */
{ {
/* the cast to long is required for Manx C */ /* the cast to long is required for Manx C, long_i is needed for
*(int *)varp = (int)(long)options[opt_idx].def_val[dvi]; * MSVC */
*(int *)varp = (int)(long)(long_i)options[opt_idx].def_val[dvi];
/* May also set global value for local option. */ /* May also set global value for local option. */
if (both) if (both)
*(int *)get_varp_scope(&(options[opt_idx]), OPT_GLOBAL) = *(int *)get_varp_scope(&(options[opt_idx]), OPT_GLOBAL) =
@ -3488,7 +3489,7 @@ set_number_default(name, val)
opt_idx = findoption((char_u *)name); opt_idx = findoption((char_u *)name);
if (opt_idx >= 0) if (opt_idx >= 0)
options[opt_idx].def_val[VI_DEFAULT] = (char_u *)val; options[opt_idx].def_val[VI_DEFAULT] = (char_u *)(long_i)val;
} }
#if defined(EXITFREE) || defined(PROTO) #if defined(EXITFREE) || defined(PROTO)
@ -3858,7 +3859,7 @@ set_title_defaults()
else else
#endif #endif
val = mch_can_restore_title(); val = mch_can_restore_title();
options[idx1].def_val[VI_DEFAULT] = (char_u *)val; options[idx1].def_val[VI_DEFAULT] = (char_u *)(long_i)val;
p_title = val; p_title = val;
} }
idx1 = findoption((char_u *)"icon"); idx1 = findoption((char_u *)"icon");
@ -3870,7 +3871,7 @@ set_title_defaults()
else else
#endif #endif
val = mch_can_restore_icon(); val = mch_can_restore_icon();
options[idx1].def_val[VI_DEFAULT] = (char_u *)val; options[idx1].def_val[VI_DEFAULT] = (char_u *)(long_i)val;
p_icon = val; p_icon = val;
} }
} }
@ -4206,7 +4207,7 @@ do_set(arg, opt_flags)
if (nextchar == '!') if (nextchar == '!')
value = *(int *)(varp) ^ 1; value = *(int *)(varp) ^ 1;
else if (nextchar == '&') else if (nextchar == '&')
value = (int)(long)options[opt_idx].def_val[ value = (int)(long)(long_i)options[opt_idx].def_val[
((flags & P_VI_DEF) || cp_val) ((flags & P_VI_DEF) || cp_val)
? VI_DEFAULT : VIM_DEFAULT]; ? VI_DEFAULT : VIM_DEFAULT];
else if (nextchar == '<') else if (nextchar == '<')
@ -4261,7 +4262,7 @@ do_set(arg, opt_flags)
*/ */
++arg; ++arg;
if (nextchar == '&') if (nextchar == '&')
value = (long)options[opt_idx].def_val[ value = (long)(long_i)options[opt_idx].def_val[
((flags & P_VI_DEF) || cp_val) ((flags & P_VI_DEF) || cp_val)
? VI_DEFAULT : VIM_DEFAULT]; ? VI_DEFAULT : VIM_DEFAULT];
else if (nextchar == '<') else if (nextchar == '<')
@ -8401,10 +8402,11 @@ optval_default(p, varp)
return TRUE; /* hidden option is always at default */ return TRUE; /* hidden option is always at default */
dvi = ((p->flags & P_VI_DEF) || p_cp) ? VI_DEFAULT : VIM_DEFAULT; dvi = ((p->flags & P_VI_DEF) || p_cp) ? VI_DEFAULT : VIM_DEFAULT;
if (p->flags & P_NUM) if (p->flags & P_NUM)
return (*(long *)varp == (long)p->def_val[dvi]); return (*(long *)varp == (long)(long_i)p->def_val[dvi]);
if (p->flags & P_BOOL) if (p->flags & P_BOOL)
/* the cast to long is required for Manx C */ /* the cast to long is required for Manx C, long_i is
return (*(int *)varp == (int)(long)p->def_val[dvi]); * needed for MSVC */
return (*(int *)varp == (int)(long)(long_i)p->def_val[dvi]);
/* P_STRING */ /* P_STRING */
return (STRCMP(*(char_u **)varp, p->def_val[dvi]) == 0); return (STRCMP(*(char_u **)varp, p->def_val[dvi]) == 0);
} }
@ -9993,7 +9995,7 @@ option_value2string(opp, opt_flags)
NameBuff[0] = NUL; NameBuff[0] = NUL;
#ifdef FEAT_CRYPT #ifdef FEAT_CRYPT
/* don't show the actual value of 'key', only that it's set */ /* don't show the actual value of 'key', only that it's set */
if (opp->var == (char_u *)&p_key && *varp) else if (opp->var == (char_u *)&p_key && *varp)
STRCPY(NameBuff, "*****"); STRCPY(NameBuff, "*****");
#endif #endif
else if (opp->flags & P_EXPAND) else if (opp->flags & P_EXPAND)

View File

@ -770,14 +770,14 @@ check_str_len(char_u *str)
if (VirtualQuery(str, &mbi, sizeof(mbi))) if (VirtualQuery(str, &mbi, sizeof(mbi)))
{ {
/* pre cast these (typing savers) */ /* pre cast these (typing savers) */
DWORD dwStr = (DWORD)str; long_u dwStr = (long_u)str;
DWORD dwBaseAddress = (DWORD)mbi.BaseAddress; long_u dwBaseAddress = (long_u)mbi.BaseAddress;
/* get start address of page that str is on */ /* get start address of page that str is on */
DWORD strPage = dwStr - (dwStr - dwBaseAddress) % si.dwPageSize; long_u strPage = dwStr - (dwStr - dwBaseAddress) % si.dwPageSize;
/* get length from str to end of page */ /* get length from str to end of page */
DWORD pageLength = si.dwPageSize - (dwStr - strPage); long_u pageLength = si.dwPageSize - (dwStr - strPage);
for (p = str; !IsBadReadPtr(p, pageLength); for (p = str; !IsBadReadPtr(p, pageLength);
p += pageLength, pageLength = si.dwPageSize) p += pageLength, pageLength = si.dwPageSize)
@ -2625,7 +2625,7 @@ Messaging_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
#ifdef FEAT_AUTOCMD #ifdef FEAT_AUTOCMD
else if (data->dwData == COPYDATA_REPLY) else if (data->dwData == COPYDATA_REPLY)
{ {
sprintf((char *)winstr, "0x%x", (unsigned)sender); sprintf((char *)winstr, PRINTF_HEX_LONG_U, (long_u)sender);
apply_autocmds(EVENT_REMOTEREPLY, winstr, str, apply_autocmds(EVENT_REMOTEREPLY, winstr, str,
TRUE, curbuf); TRUE, curbuf);
} }
@ -2834,13 +2834,13 @@ serverSendReply(name, reply)
{ {
HWND target; HWND target;
COPYDATASTRUCT data; COPYDATASTRUCT data;
int n = 0; long_u n = 0;
/* The "name" argument is a magic cookie obtained from expand("<client>"). /* The "name" argument is a magic cookie obtained from expand("<client>").
* It should be of the form 0xXXXXX - i.e. a C hex literal, which is the * It should be of the form 0xXXXXX - i.e. a C hex literal, which is the
* value of the client's message window HWND. * value of the client's message window HWND.
*/ */
sscanf((char *)name, "%x", &n); sscanf((char *)name, SCANF_HEX_LONG_U, &n);
if (n == 0) if (n == 0)
return -1; return -1;
@ -3130,7 +3130,7 @@ int current_font_height = -12; /* also used in gui_w48.c */
* calculation is for a vertical (height) size or a horizontal (width) one. * calculation is for a vertical (height) size or a horizontal (width) one.
*/ */
static int static int
points_to_pixels(char_u *str, char_u **end, int vertical, int pprinter_dc) points_to_pixels(char_u *str, char_u **end, int vertical, long_i pprinter_dc)
{ {
int pixels; int pixels;
int points = 0; int points = 0;
@ -3338,10 +3338,10 @@ get_logfont(
switch (*p++) switch (*p++)
{ {
case 'h': case 'h':
lf->lfHeight = - points_to_pixels(p, &p, TRUE, (int)printer_dc); lf->lfHeight = - points_to_pixels(p, &p, TRUE, (long_i)printer_dc);
break; break;
case 'w': case 'w':
lf->lfWidth = points_to_pixels(p, &p, FALSE, (int)printer_dc); lf->lfWidth = points_to_pixels(p, &p, FALSE, (long_i)printer_dc);
break; break;
case 'b': case 'b':
#ifndef MSWIN16_FASTTEXT #ifndef MSWIN16_FASTTEXT

View File

@ -3602,7 +3602,7 @@ mch_call_shell(cmd, options)
*p++ = NUL; *p++ = NUL;
p = skipwhite(p); p = skipwhite(p);
} }
if (i == 0) if (argv == NULL)
{ {
argv = (char **)alloc((unsigned)((argc + 4) * sizeof(char *))); argv = (char **)alloc((unsigned)((argc + 4) * sizeof(char *)));
if (argv == NULL) /* out of memory */ if (argv == NULL) /* out of memory */

View File

@ -1288,7 +1288,7 @@ create_conin(void)
g_hConIn = CreateFile("CONIN$", GENERIC_READ|GENERIC_WRITE, g_hConIn = CreateFile("CONIN$", GENERIC_READ|GENERIC_WRITE,
FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE,
(LPSECURITY_ATTRIBUTES) NULL, (LPSECURITY_ATTRIBUTES) NULL,
OPEN_EXISTING, (DWORD)NULL, (HANDLE)NULL); OPEN_EXISTING, 0, (HANDLE)NULL);
did_create_conin = TRUE; did_create_conin = TRUE;
} }

View File

@ -1,70 +1,71 @@
/* message.c */ /* message.c */
extern int msg __ARGS((char_u *s)); int msg __ARGS((char_u *s));
extern int verb_msg __ARGS((char_u *s)); int verb_msg __ARGS((char_u *s));
extern int msg_attr __ARGS((char_u *s, int attr)); int msg_attr __ARGS((char_u *s, int attr));
extern int msg_attr_keep __ARGS((char_u *s, int attr, int keep)); int msg_attr_keep __ARGS((char_u *s, int attr, int keep));
extern char_u *msg_strtrunc __ARGS((char_u *s, int force)); char_u *msg_strtrunc __ARGS((char_u *s, int force));
extern void trunc_string __ARGS((char_u *s, char_u *buf, int room)); void trunc_string __ARGS((char_u *s, char_u *buf, int room));
extern void reset_last_sourcing __ARGS((void)); void reset_last_sourcing __ARGS((void));
extern void msg_source __ARGS((int attr)); void msg_source __ARGS((int attr));
extern int emsg __ARGS((char_u *s)); int emsg_not_now __ARGS((void));
extern int emsg2 __ARGS((char_u *s, char_u *a1)); int emsg __ARGS((char_u *s));
extern void emsg_invreg __ARGS((int name)); int emsg2 __ARGS((char_u *s, char_u *a1));
extern char_u *msg_trunc_attr __ARGS((char_u *s, int force, int attr)); void emsg_invreg __ARGS((int name));
extern char_u *msg_may_trunc __ARGS((int force, char_u *s)); char_u *msg_trunc_attr __ARGS((char_u *s, int force, int attr));
extern int delete_first_msg __ARGS((void)); char_u *msg_may_trunc __ARGS((int force, char_u *s));
extern void ex_messages __ARGS((exarg_T *eap)); int delete_first_msg __ARGS((void));
extern void msg_end_prompt __ARGS((void)); void ex_messages __ARGS((exarg_T *eap));
extern void wait_return __ARGS((int redraw)); void msg_end_prompt __ARGS((void));
extern void set_keep_msg __ARGS((char_u *s, int attr)); void wait_return __ARGS((int redraw));
extern void set_keep_msg_from_hist __ARGS((void)); void set_keep_msg __ARGS((char_u *s, int attr));
extern void msg_start __ARGS((void)); void set_keep_msg_from_hist __ARGS((void));
extern void msg_starthere __ARGS((void)); void msg_start __ARGS((void));
extern void msg_putchar __ARGS((int c)); void msg_starthere __ARGS((void));
extern void msg_putchar_attr __ARGS((int c, int attr)); void msg_putchar __ARGS((int c));
extern void msg_outnum __ARGS((long n)); void msg_putchar_attr __ARGS((int c, int attr));
extern void msg_home_replace __ARGS((char_u *fname)); void msg_outnum __ARGS((long n));
extern void msg_home_replace_hl __ARGS((char_u *fname)); void msg_home_replace __ARGS((char_u *fname));
extern int msg_outtrans __ARGS((char_u *str)); void msg_home_replace_hl __ARGS((char_u *fname));
extern int msg_outtrans_attr __ARGS((char_u *str, int attr)); int msg_outtrans __ARGS((char_u *str));
extern int msg_outtrans_len __ARGS((char_u *str, int len)); int msg_outtrans_attr __ARGS((char_u *str, int attr));
extern char_u *msg_outtrans_one __ARGS((char_u *p, int attr)); int msg_outtrans_len __ARGS((char_u *str, int len));
extern int msg_outtrans_len_attr __ARGS((char_u *msgstr, int len, int attr)); char_u *msg_outtrans_one __ARGS((char_u *p, int attr));
extern void msg_make __ARGS((char_u *arg)); int msg_outtrans_len_attr __ARGS((char_u *msgstr, int len, int attr));
extern int msg_outtrans_special __ARGS((char_u *strstart, int from)); void msg_make __ARGS((char_u *arg));
extern char_u *str2special __ARGS((char_u **sp, int from)); int msg_outtrans_special __ARGS((char_u *strstart, int from));
extern void str2specialbuf __ARGS((char_u *sp, char_u *buf, int len)); char_u *str2special __ARGS((char_u **sp, int from));
extern void msg_prt_line __ARGS((char_u *s, int list)); void str2specialbuf __ARGS((char_u *sp, char_u *buf, int len));
extern void msg_puts __ARGS((char_u *s)); void msg_prt_line __ARGS((char_u *s, int list));
extern void msg_puts_title __ARGS((char_u *s)); void msg_puts __ARGS((char_u *s));
extern void msg_puts_long_attr __ARGS((char_u *longstr, int attr)); void msg_puts_title __ARGS((char_u *s));
extern void msg_puts_long_len_attr __ARGS((char_u *longstr, int len, int attr)); void msg_puts_long_attr __ARGS((char_u *longstr, int attr));
extern void msg_puts_attr __ARGS((char_u *s, int attr)); void msg_puts_long_len_attr __ARGS((char_u *longstr, int len, int attr));
extern void may_clear_sb_text __ARGS((void)); void msg_puts_attr __ARGS((char_u *s, int attr));
extern void clear_sb_text __ARGS((void)); void may_clear_sb_text __ARGS((void));
extern void show_sb_text __ARGS((void)); void clear_sb_text __ARGS((void));
extern int msg_use_printf __ARGS((void)); void show_sb_text __ARGS((void));
extern void mch_errmsg __ARGS((char *str)); int msg_use_printf __ARGS((void));
extern void mch_msg __ARGS((char *str)); void mch_errmsg __ARGS((char *str));
extern void msg_moremsg __ARGS((int full)); void mch_msg __ARGS((char *str));
extern void repeat_message __ARGS((void)); void msg_moremsg __ARGS((int full));
extern void msg_clr_eos __ARGS((void)); void repeat_message __ARGS((void));
extern void msg_clr_eos_force __ARGS((void)); void msg_clr_eos __ARGS((void));
extern void msg_clr_cmdline __ARGS((void)); void msg_clr_eos_force __ARGS((void));
extern int msg_end __ARGS((void)); void msg_clr_cmdline __ARGS((void));
extern void msg_check __ARGS((void)); int msg_end __ARGS((void));
extern void verbose_enter __ARGS((void)); void msg_check __ARGS((void));
extern void verbose_leave __ARGS((void)); void verbose_enter __ARGS((void));
extern void verbose_enter_scroll __ARGS((void)); void verbose_leave __ARGS((void));
extern void verbose_leave_scroll __ARGS((void)); void verbose_enter_scroll __ARGS((void));
extern void verbose_stop __ARGS((void)); void verbose_leave_scroll __ARGS((void));
extern int verbose_open __ARGS((void)); void verbose_stop __ARGS((void));
extern void give_warning __ARGS((char_u *message, int hl)); int verbose_open __ARGS((void));
extern void msg_advance __ARGS((int col)); void give_warning __ARGS((char_u *message, int hl));
extern int do_dialog __ARGS((int type, char_u *title, char_u *message, char_u *buttons, int dfltbutton, char_u *textfield)); void msg_advance __ARGS((int col));
extern void display_confirm_msg __ARGS((void)); int do_dialog __ARGS((int type, char_u *title, char_u *message, char_u *buttons, int dfltbutton, char_u *textfield));
extern int vim_dialog_yesno __ARGS((int type, char_u *title, char_u *message, int dflt)); void display_confirm_msg __ARGS((void));
extern int vim_dialog_yesnocancel __ARGS((int type, char_u *title, char_u *message, int dflt)); int vim_dialog_yesno __ARGS((int type, char_u *title, char_u *message, int dflt));
extern int vim_dialog_yesnoallcancel __ARGS((int type, char_u *title, char_u *message, int dflt)); int vim_dialog_yesnocancel __ARGS((int type, char_u *title, char_u *message, int dflt));
extern char_u *do_browse __ARGS((int flags, char_u *title, char_u *dflt, char_u *ext, char_u *initdir, char_u *filter, buf_T *buf)); int vim_dialog_yesnoallcancel __ARGS((int type, char_u *title, char_u *message, int dflt));
char_u *do_browse __ARGS((int flags, char_u *title, char_u *dflt, char_u *ext, char_u *initdir, char_u *filter, buf_T *buf));
/* vim: set ft=c : */ /* vim: set ft=c : */

View File

@ -7054,7 +7054,7 @@ reg_submatch(no)
int round; int round;
linenr_T lnum; linenr_T lnum;
if (!can_f_submatch) if (!can_f_submatch || no < 0)
return NULL; return NULL;
if (submatch_match == NULL) if (submatch_match == NULL)
@ -7112,10 +7112,10 @@ reg_submatch(no)
++len; ++len;
} }
if (round == 1) if (retval == NULL)
{ {
retval = lalloc((long_u)len, TRUE); retval = lalloc((long_u)len, TRUE);
if (s == NULL) if (retval == NULL)
return NULL; return NULL;
} }
} }

View File

@ -5102,7 +5102,10 @@ spell_read_aff(spin, fname)
*/ */
aff = (afffile_T *)getroom(spin, sizeof(afffile_T), TRUE); aff = (afffile_T *)getroom(spin, sizeof(afffile_T), TRUE);
if (aff == NULL) if (aff == NULL)
{
fclose(fd);
return NULL; return NULL;
}
hash_init(&aff->af_pref); hash_init(&aff->af_pref);
hash_init(&aff->af_suff); hash_init(&aff->af_suff);
hash_init(&aff->af_comp); hash_init(&aff->af_comp);
@ -7361,7 +7364,8 @@ tree_add_word(spin, word, root, flags, region, affixID)
/* Link the new node in the list, there will be one ref. */ /* Link the new node in the list, there will be one ref. */
np->wn_refs = 1; np->wn_refs = 1;
*copyprev = np; if (copyprev != NULL)
*copyprev = np;
copyprev = &np->wn_sibling; copyprev = &np->wn_sibling;
/* Let "node" point to the head of the copied list. */ /* Let "node" point to the head of the copied list. */
@ -15464,7 +15468,7 @@ spell_dump_compl(buf, pat, ic, dir, dumpflags_arg)
if (pat != NULL && slang->sl_pbyts == NULL) if (pat != NULL && slang->sl_pbyts == NULL)
patlen = (int)STRLEN(pat); patlen = (int)STRLEN(pat);
else else
patlen = 0; patlen = -1;
/* round 1: case-folded tree /* round 1: case-folded tree
* round 2: keep-case tree */ * round 2: keep-case tree */

View File

@ -1371,7 +1371,8 @@ store_current_state(sp)
for (p = syn_buf->b_sst_first; p != NULL; p = p->sst_next) for (p = syn_buf->b_sst_first; p != NULL; p = p->sst_next)
if (p->sst_next == sp) if (p->sst_next == sp)
break; break;
p->sst_next = sp->sst_next; if (p != NULL) /* just in case */
p->sst_next = sp->sst_next;
} }
syn_stack_free_entry(syn_buf, sp); syn_stack_free_entry(syn_buf, sp);
sp = NULL; sp = NULL;

View File

@ -43,6 +43,13 @@ Ac:set ul=100
:.w >>test.out :.w >>test.out
:later 1h :later 1h
:.w >>test.out :.w >>test.out
:"
:" test undojoin
Goaaaa:set ul=100
obbbbu:.w >>test.out
obbbb:set ul=100
:undojoin
occccu:.w >>test.out
:qa! :qa!
ENDTEST ENDTEST

View File

@ -20,3 +20,5 @@
123456789 123456789
123456 123456
123456abc 123456abc
aaaa
aaaa

View File

@ -35,6 +35,6 @@
*/ */
#define VIM_VERSION_NODOT "vim70e" #define VIM_VERSION_NODOT "vim70e"
#define VIM_VERSION_SHORT "7.0e" #define VIM_VERSION_SHORT "7.0e"
#define VIM_VERSION_MEDIUM "7.0e05 BETA" #define VIM_VERSION_MEDIUM "7.0e06 BETA"
#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0e05 BETA (2006 Apr 21)" #define VIM_VERSION_LONG "VIM - Vi IMproved 7.0e06 BETA (2006 Apr 22)"
#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0e05 BETA (2006 Apr 21, compiled " #define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0e06 BETA (2006 Apr 22, compiled "

View File

@ -342,14 +342,19 @@
typedef unsigned char char_u; typedef unsigned char char_u;
typedef unsigned short short_u; typedef unsigned short short_u;
typedef unsigned int int_u; typedef unsigned int int_u;
/* Make sure long_u is big enough to hold a pointer. On Win64 longs are 32 /* Make sure long_u is big enough to hold a pointer.
* bit and pointers 64 bit. */ * On Win64 longs are 32 bit and pointers 64 bit.
* For printf() and scanf() we need to take care of long_u specifically. */
#ifdef _WIN64 #ifdef _WIN64
typedef unsigned __int64 long_u; typedef unsigned __int64 long_u;
typedef __int64 long_i; typedef __int64 long_i;
# define SCANF_HEX_LONG_U "%Ix"
# define PRINTF_HEX_LONG_U "0x%Ix"
#else #else
typedef unsigned long long_u; typedef unsigned long long_u;
typedef long long_i; typedef long long_i;
# define SCANF_HEX_LONG_U "%lx"
# define PRINTF_HEX_LONG_U "0x%lx"
#endif #endif
/* /*
@ -1382,6 +1387,7 @@ typedef enum
#define EMSG2(s, p) emsg2((char_u *)(s), (char_u *)(p)) #define EMSG2(s, p) emsg2((char_u *)(s), (char_u *)(p))
#define EMSG3(s, p, q) emsg3((char_u *)(s), (char_u *)(p), (char_u *)(q)) #define EMSG3(s, p, q) emsg3((char_u *)(s), (char_u *)(p), (char_u *)(q))
#define EMSGN(s, n) emsgn((char_u *)(s), (long)(n)) #define EMSGN(s, n) emsgn((char_u *)(s), (long)(n))
#define EMSGU(s, n) emsgu((char_u *)(s), (long_u)(n))
#define OUT_STR(s) out_str((char_u *)(s)) #define OUT_STR(s) out_str((char_u *)(s))
#define OUT_STR_NF(s) out_str_nf((char_u *)(s)) #define OUT_STR_NF(s) out_str_nf((char_u *)(s))
#define MSG_PUTS(s) msg_puts((char_u *)(s)) #define MSG_PUTS(s) msg_puts((char_u *)(s))

View File

@ -5077,7 +5077,7 @@ win_drag_vsep_line(dragwin, offset)
int n; int n;
fr = dragwin->w_frame; fr = dragwin->w_frame;
if (fr == topframe) /* only one window (cannot happe?) */ if (fr == topframe) /* only one window (cannot happen?) */
return; return;
curfr = fr; curfr = fr;
fr = fr->fr_parent; fr = fr->fr_parent;