Compare commits

...

20 Commits

Author SHA1 Message Date
Bram Moolenaar
b429cdeb6e updated for version 7.3.508
Problem:    Default for v:register is not set.
Solution:   Init v:register in eval_init(). Correct for 'clipboard' before the
            main loop. (Ingo Karkat)
2012-04-25 18:24:29 +02:00
Bram Moolenaar
8218f60b61 updated for version 7.3.507
Problem:    When exiting with unsaved changes, selecting an existing file in
            the file dialog, there is no dialog to ask whether the existing
            file should be overwritten. (Felipe G. Nievinski)
Solution:   Call check_overwrite() before writing. (Christian Brabandt)
2012-04-25 17:32:18 +02:00
Bram Moolenaar
68fb5dcd13 updated for version 7.3.506
Problem:    GTK gives an error when selecting a non-existent file.
Solution:   Add a handler to avoid the error. (Christian Brabandt)
2012-04-25 17:10:16 +02:00
Bram Moolenaar
68a33fc704 updated for version 7.3.505
Problem:    Test 11 fails on MS-Windows in some versions.
Solution:   Fix #ifdefs for whether filtering through a pipe is possible. Move
            setting b_no_eol_lnum back to where it was before patch 7.3.124.
            (David Pope)
2012-04-25 16:50:48 +02:00
Bram Moolenaar
720ce53af0 updated for version 7.3.504
Problem:    Commands in help files are not highlighted.
Solution:   Allow for commands in backticks.  Adjust CTRL-] to remove the
            backticks.
2012-04-25 12:57:28 +02:00
Bram Moolenaar
6217cdcec3 updated for version 7.3.503
Problem:    Warning for unused argument.
Solution:   Add UNUSED.
2012-04-25 12:28:09 +02:00
Bram Moolenaar
e436528e04 updated for version 7.3.502
Problem:    Netbeans insert halfway a line actually appends to the line.
Solution:   Insert halfway the line. (Brian Victor)
2012-04-20 19:47:05 +02:00
Bram Moolenaar
35df7d2d99 updated for version 7.3.501
Problem:    Error for "flush" not being defined when using Ruby command.
Solution:   Defined "flush" as a no-op method. (Kent Sibilev)
2012-04-20 18:05:47 +02:00
Bram Moolenaar
a6cdc99152 updated for version 7.3.500
Problem:    Ming makefile unconditionally sets WINVER.
Solution:   Only defined when not already defined. (Yasuhiro Matsumoto)
2012-04-20 16:13:25 +02:00
Bram Moolenaar
6be120e7f5 updated for version 7.3.499
Problem:    When using any interface language when Vim is waiting for a child
            process it gets confused by a child process started through the
            interface.
Solution:   Always used waitpid() instead of wait(). (Yasuhiro Matsumoto)
2012-04-20 15:55:16 +02:00
Bram Moolenaar
84298db3a4 updated for version 7.3.498
Problem:    The behavior of the "- register changes depending on value of
            the 'clipboard' option. (Szamotulski)
Solution:   Also set the "- register when the register is "*" or "+".
            (Christian Brabandt)
2012-04-20 13:46:08 +02:00
Bram Moolenaar
b830f0c7df updated for version 7.3.497
Problem:    Crash when doing ":python print" and compiled with gcc and
            the optimizer enabled.
Solution:   Avoid the crash, doesn't really fix the problem. (Christian
            Brabandt)
2012-04-20 13:31:21 +02:00
Bram Moolenaar
53bfca22f1 Updated runtime files. 2012-04-13 23:04:47 +02:00
Bram Moolenaar
09210ac93c updated for version 7.3.496
Problem:    MS-DOS: When "diff" trips over difference in line separators some
            tests fail.
Solution:   Make some .ok files use unix line separators. (David Pope)
2012-04-13 19:11:20 +02:00
Bram Moolenaar
b345d49e06 updated for version 7.3.495
Problem:    Compiler warnings.
Solution:   Add function declaration.  Remove "offset" argument.
2012-04-09 20:42:26 +02:00
Bram Moolenaar
bd2f3c3ec6 updated for version 7.3.494
Problem:    Can't compile with Lua 9.1 or dynamic Lua.
Solution:   Fix dll_ methods. Fix luado(). (Muraoka Taro, Luis Carvalho)
2012-04-06 14:31:00 +02:00
Bram Moolenaar
b0d7a15d3a updated for version 7.3.493
Problem:    Two unused variables.
Solution:   Remove them. (Hong Xu)
2012-04-06 13:56:04 +02:00
Bram Moolenaar
5b435d671e Updated runtime files. 2012-04-05 17:33:26 +02:00
Bram Moolenaar
3675fa09a7 updated for version 7.3.492
Problem:    Can't indent conditions separately from function arguments.
Solution:   Add the 'k' flag in 'cino. (Lech Lorens)
2012-04-05 17:17:42 +02:00
Bram Moolenaar
98411e57ab updated for version 7.3.491
Problem:    No tests for Lua.
Solution:   Add some simple tests for Lua. (Luis Carvalho)
2012-04-05 16:56:52 +02:00
50 changed files with 1509 additions and 1322 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,9 @@
" netrwFileHandlers: contains various extension-based file handlers for
" netrw's browsers' x command ("eXecute launcher")
" Author: Charles E. Campbell, Jr.
" Date: Sep 30, 2008
" Version: 10
" Copyright: Copyright (C) 1999-2008 Charles E. Campbell, Jr. {{{1
" Date: Mar 14, 2012
" Version: 11a
" Copyright: Copyright (C) 1999-2012 Charles E. Campbell, Jr. {{{1
" Permission is hereby granted to use and distribute this code,
" with or without modifications, provided that this copyright
" notice is copied with it. Like anything else that's free,
@@ -20,7 +20,7 @@
if exists("g:loaded_netrwFileHandlers") || &cp
finish
endif
let g:loaded_netrwFileHandlers= "v10"
let g:loaded_netrwFileHandlers= "v11a"
if v:version < 702
echohl WarningMsg
echo "***warning*** this version of netrwFileHandlers needs vim 7.2"
@@ -64,7 +64,7 @@ fun! netrwFileHandlers#Invoke(exten,fname)
" call Decho("let ret= netrwFileHandlers#NFH_".a:exten.'("'.fname.'")')
exe "let ret= s:NFH_".a:exten.'("'.fname.'")'
endif
" call Dret("netrwFileHandlers#Invoke 0 : ret=".ret)
return 0
endfun
@@ -356,6 +356,7 @@ fun! s:NFH_obj(obj)
endfun
let &cpo= s:keepcpo
unlet s:keepcpo
" ---------------------------------------------------------------------
" Modelines: {{{1
" vim: fdm=marker

View File

@@ -1,4 +1,4 @@
*editing.txt* For Vim version 7.3. Last change: 2012 Mar 23
*editing.txt* For Vim version 7.3. Last change: 2012 Apr 03
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1641,6 +1641,6 @@ There are three different types of searching:
Note that completion for ":find", ":sfind", and ":tabfind" commands do not
currently work with 'path' items that contain a url or use the double star
(/usr/**2) or upward search (;) notations. >
with depth limiter (/usr/**2) or upward search (;) notations.
vim:tw=78:ts=8:ft=help:norl:

View File

@@ -1,4 +1,4 @@
*eval.txt* For Vim version 7.3. Last change: 2012 Mar 28
*eval.txt* For Vim version 7.3. Last change: 2012 Apr 13
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -3229,7 +3229,8 @@ getcmdpos() *getcmdpos()*
Return the position of the cursor in the command line as a
byte count. The first column is 1.
Only works when editing the command line, thus requires use of
|c_CTRL-\_e| or |c_CTRL-R_=|. Returns 0 otherwise.
|c_CTRL-\_e| or |c_CTRL-R_=| or an expression mapping.
Returns 0 otherwise.
Also see |getcmdtype()|, |setcmdpos()| and |getcmdline()|.
getcmdtype() *getcmdtype()*
@@ -3242,8 +3243,8 @@ getcmdtype() *getcmdtype()*
@ |input()| command
- |:insert| or |:append| command
Only works when editing the command line, thus requires use of
|c_CTRL-\_e| or |c_CTRL-R_=|. Returns an empty string
otherwise.
|c_CTRL-\_e| or |c_CTRL-R_=| or an expression mapping.
Returns an empty string otherwise.
Also see |getcmdpos()|, |setcmdpos()| and |getcmdline()|.
*getcwd()*
@@ -5091,7 +5092,7 @@ setline({lnum}, {text}) *setline()*
will be set to the items in the list. Example: >
:call setline(5, ['aaa', 'bbb', 'ccc'])
< This is equivalent to: >
:for [n, l] in [[5, 6, 7], ['aaa', 'bbb', 'ccc']]
:for [n, l] in [[5, 'aaa'], [6, 'bbb'], [7, 'ccc']]
: call setline(n, l)
:endfor
< Note: The '[ and '] marks are not set.

View File

@@ -59,13 +59,14 @@ Example:
<
*:luado*
:[range]luado {body} Execute Lua function "function (line) {body} end" for
each line in the [range], with the function argument
being set to the text of each line in turn, without a
trailing <EOL>. If the value returned by the function
is a string it becomes the text of the line in the
current turn. The default for [range] is the whole
file: "1,$". {not in Vi}
:[range]luado {body} Execute Lua function "function (line, linenr) {body}
end" for each line in the [range], with the function
argument being set to the text of each line in turn,
without a trailing <EOL>, and the current line number.
If the value returned by the function is a string it
becomes the text of the line in the current turn. The
default for [range] is the whole file: "1,$".
{not in Vi}
Examples:
>

View File

@@ -459,6 +459,22 @@ The examples below assume a 'shiftwidth' of 4.
argument); argument);
a_short_line(argument, a_short_line(argument,
argument); argument);
<
*cino-k*
kN When in unclosed parentheses which follow "if", "for" or
"while" and N is non-zero, overrides the behaviour defined by
"(N": causes the indent to be N characters relative to the outer
context (i.e. the line where "if", "for" or "while" is). Has
no effect on deeper levels of nesting. Affects flags like "wN"
only for the "if", "for" and "while" conditions. If 0, defaults
to behaviour defined by the "(N" flag. (default: 0).
cino=(0 cino=(0,ks >
if (condition1 if (condition1
&& condition2) && condition2)
action(); action();
function(argument1 function(argument1
&& argument2); && argument2);
<
*cino-m*
mN When N is non-zero, line up a line starting with a closing
@@ -530,14 +546,14 @@ The examples below assume a 'shiftwidth' of 4.
*cino-#*
#N When N is non-zero recognize shell/Perl comments, starting with
'#'. Default N is zero: don't recognizes '#' comments. Note
'#'. Default N is zero: don't recognize '#' comments. Note
that lines starting with # will still be seen as preprocessor
lines.
The defaults, spelled out in full, are:
cinoptions=>s,e0,n0,f0,{0,}0,^0,L-1,:s,=s,l0,b0,gs,hs,N0,ps,ts,is,+s,
c3,C0,/0,(2s,us,U0,w0,W0,m0,j0,J0,)20,*70,#0
c3,C0,/0,(2s,us,U0,w0,W0,k0,m0,j0,J0,)20,*70,#0
Vim puts a line in column 1 if:
- It starts with '#' (preprocessor directives), if 'cinkeys' contains '#'.

View File

@@ -1,4 +1,4 @@
*insert.txt* For Vim version 7.3. Last change: 2012 Jan 26
*insert.txt* For Vim version 7.3. Last change: 2012 Apr 05
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -398,7 +398,12 @@ An example for using CTRL-G u: >
This redefines the backspace key to start a new undo sequence. You can now
undo the effect of the backspace key, without changing what you typed before
that, with CTRL-O u.
that, with CTRL-O u. Another example: >
:inoremap <CR> <C-]><C-G>u<CR>
This breaks undo at each line break. It also expands abbreviations before
this.
Using CTRL-O splits undo: the text typed before and after it is undone
separately. If you want to avoid this (e.g., in a mapping) you might be able

View File

@@ -1,4 +1,4 @@
*map.txt* For Vim version 7.3. Last change: 2012 Feb 02
*map.txt* For Vim version 7.3. Last change: 2012 Apr 13
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1188,7 +1188,7 @@ reported if any are supplied). However, it is possible to specify that the
command can take arguments, using the -nargs attribute. Valid cases are:
-nargs=0 No arguments are allowed (the default)
-nargs=1 Exactly one argument is require, it includes spaces
-nargs=1 Exactly one argument is required, it includes spaces
-nargs=* Any number of arguments are allowed (0, 1, or many),
separated by white space
-nargs=? 0 or 1 arguments are allowed

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
*syntax.txt* For Vim version 7.3. Last change: 2012 Mar 28
*syntax.txt* For Vim version 7.3. Last change: 2012 Apr 06
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2836,6 +2836,18 @@ following sets of characters: >
By leaving one or more of these out, the associated conceal-character
substitution will not be made.
*g:tex_isk*
Tex: Controlling What's In A Keyword~
(La)Tex keywords normally use the characters 0-9,a-z,A-Z,192-255 only
but the "_" is the only one that causes problems. So, by default,
syntax/tex.vim overrides the usual |'iskeyword'| setting (using |:setlocal|)
with one that works for LaTeX.
However, one may override this iskeyword re-setting by setting the
variable, g:tex_isk, in one's .vimrc to whatever one wishes and
it will be used instead.
TF *tf.vim* *ft-tf-syntax*

View File

@@ -3630,9 +3630,6 @@ E287 mbyte.txt /*E287*
E288 mbyte.txt /*E288*
E289 mbyte.txt /*E289*
E29 change.txt /*E29*
E290 mbyte.txt /*E290*
E291 mbyte.txt /*E291*
E292 mbyte.txt /*E292*
E293 message.txt /*E293*
E294 message.txt /*E294*
E295 message.txt /*E295*
@@ -4995,6 +4992,7 @@ cino-g indent.txt /*cino-g*
cino-h indent.txt /*cino-h*
cino-i indent.txt /*cino-i*
cino-j indent.txt /*cino-j*
cino-k indent.txt /*cino-k*
cino-l indent.txt /*cino-l*
cino-m indent.txt /*cino-m*
cino-n indent.txt /*cino-n*
@@ -5829,6 +5827,7 @@ g:netrw_cygwin pi_netrw.txt /*g:netrw_cygwin*
g:netrw_dav_cmd pi_netrw.txt /*g:netrw_dav_cmd*
g:netrw_decompress pi_netrw.txt /*g:netrw_decompress*
g:netrw_dirhistmax pi_netrw.txt /*g:netrw_dirhistmax*
g:netrw_errorlvl pi_netrw.txt /*g:netrw_errorlvl*
g:netrw_fastbrowse pi_netrw.txt /*g:netrw_fastbrowse*
g:netrw_fetch_cmd pi_netrw.txt /*g:netrw_fetch_cmd*
g:netrw_fname_escape pi_netrw.txt /*g:netrw_fname_escape*
@@ -5836,6 +5835,7 @@ g:netrw_ftp pi_netrw.txt /*g:netrw_ftp*
g:netrw_ftp_browse_reject pi_netrw.txt /*g:netrw_ftp_browse_reject*
g:netrw_ftp_cmd pi_netrw.txt /*g:netrw_ftp_cmd*
g:netrw_ftp_list_cmd pi_netrw.txt /*g:netrw_ftp_list_cmd*
g:netrw_ftp_options pi_netrw.txt /*g:netrw_ftp_options*
g:netrw_ftp_sizelist_cmd pi_netrw.txt /*g:netrw_ftp_sizelist_cmd*
g:netrw_ftp_timelist_cmd pi_netrw.txt /*g:netrw_ftp_timelist_cmd*
g:netrw_ftpextracmd pi_netrw.txt /*g:netrw_ftpextracmd*
@@ -5850,10 +5850,10 @@ g:netrw_keepdir pi_netrw.txt /*g:netrw_keepdir*
g:netrw_list_cmd pi_netrw.txt /*g:netrw_list_cmd*
g:netrw_list_hide pi_netrw.txt /*g:netrw_list_hide*
g:netrw_liststyle pi_netrw.txt /*g:netrw_liststyle*
g:netrw_local_mkdir pi_netrw.txt /*g:netrw_local_mkdir*
g:netrw_local_rmdir pi_netrw.txt /*g:netrw_local_rmdir*
g:netrw_localcopycmd pi_netrw.txt /*g:netrw_localcopycmd*
g:netrw_localmkdir pi_netrw.txt /*g:netrw_localmkdir*
g:netrw_localmovecmd pi_netrw.txt /*g:netrw_localmovecmd*
g:netrw_localrmdir pi_netrw.txt /*g:netrw_localrmdir*
g:netrw_maxfilenamelen pi_netrw.txt /*g:netrw_maxfilenamelen*
g:netrw_menu pi_netrw.txt /*g:netrw_menu*
g:netrw_mkdir_cmd pi_netrw.txt /*g:netrw_mkdir_cmd*
@@ -5902,6 +5902,7 @@ g:tar_readoptions pi_tar.txt /*g:tar_readoptions*
g:tar_secure pi_tar.txt /*g:tar_secure*
g:tar_writeoptions pi_tar.txt /*g:tar_writeoptions*
g:tex_conceal syntax.txt /*g:tex_conceal*
g:tex_isk syntax.txt /*g:tex_isk*
g:var eval.txt /*g:var*
g:vimball_home pi_vimball.txt /*g:vimball_home*
g:vimball_mkdir pi_vimball.txt /*g:vimball_mkdir*
@@ -6183,6 +6184,7 @@ hl-Cursor syntax.txt /*hl-Cursor*
hl-CursorColumn syntax.txt /*hl-CursorColumn*
hl-CursorIM syntax.txt /*hl-CursorIM*
hl-CursorLine syntax.txt /*hl-CursorLine*
hl-CursorLineNr syntax.txt /*hl-CursorLineNr*
hl-DiffAdd syntax.txt /*hl-DiffAdd*
hl-DiffChange syntax.txt /*hl-DiffChange*
hl-DiffDelete syntax.txt /*hl-DiffDelete*
@@ -6559,6 +6561,9 @@ lpc.vim syntax.txt /*lpc.vim*
lua if_lua.txt /*lua*
lua-buffer if_lua.txt /*lua-buffer*
lua-commands if_lua.txt /*lua-commands*
lua-dict if_lua.txt /*lua-dict*
lua-list if_lua.txt /*lua-list*
lua-luaeval if_lua.txt /*lua-luaeval*
lua-vim if_lua.txt /*lua-vim*
lua-window if_lua.txt /*lua-window*
lua.vim syntax.txt /*lua.vim*
@@ -6935,8 +6940,11 @@ netrw-updir pi_netrw.txt /*netrw-updir*
netrw-urls pi_netrw.txt /*netrw-urls*
netrw-userpass pi_netrw.txt /*netrw-userpass*
netrw-v pi_netrw.txt /*netrw-v*
netrw-var pi_netrw.txt /*netrw-var*
netrw-variables pi_netrw.txt /*netrw-variables*
netrw-vexplore pi_netrw.txt /*netrw-vexplore*
netrw-windows-netrc pi_netrw.txt /*netrw-windows-netrc*
netrw-windows-s pi_netrw.txt /*netrw-windows-s*
netrw-write pi_netrw.txt /*netrw-write*
netrw-x pi_netrw.txt /*netrw-x*
netrw-xfer pi_netrw.txt /*netrw-xfer*

View File

@@ -1,4 +1,4 @@
*todo.txt* For Vim version 7.3. Last change: 2012 Mar 28
*todo.txt* For Vim version 7.3. Last change: 2012 Apr 13
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -43,6 +43,8 @@ Discussion about canonicalization of Hebrew. (Ron Aaron, 2011 April 10)
Stack trace of crash: http://vpaste.net/GBt9S
(Alexandre Provencio)
":help!" gives error, should use current language. (thinkca, 2012 Apr 1)
Once syntax and other runtime files have been fixed: add "set cp" to
check.vim. Use a function to run both with 'cp' and 'nocp'.
@@ -78,17 +80,6 @@ When exiting with unsaved changes, selecting an existing file in the file
dialog, there is no dialog to ask whether the existing file should be
overwritten. (Felipe G. Nievinski, 2011 Dec 22)
Using Ctrl-] in a mapping does not expand abbreviations. Patch by Christian
Brabandt, 2012 Mar 2.
Patch to fix member confusion in Lua interface. (Taro Muraoka, 2012 Jan 8)
Update Jan 9.
Carvalho merged the patch: New version 2012 Jan 19.
Patch for option in 'cino' to specify more indent for continued conditions.
(Lech Lorens, 2011 Nov 27)
Isn't this already possible? Update 2012 Feb 15.
Docs fix for v:register. (Ingo Karkat, 2011 Sep 26, 27)
v:register doesn't work exactly as expected. (David Fishburn, 2011 Sep 20)
@@ -112,7 +103,7 @@ Matsumoto, 2012 Jan 30)
Patch to add completion for :history command. (Dominique Pelle, 2012 Feb 26)
Patch for 'backupcopy' default behavior for symlinks on Windows. (David Pope,
2012 Mar 21)
2012 Mar 21, update Mar 31)
Use a count before "v" and "V" to select that many characters or lines?
(Kikyous)
@@ -139,6 +130,8 @@ Patch to pass list to or(), and() and xor(). (Yasuhiro Matsumoto, 2012 Feb 8)
Patch to improve "it" and "at" text object matching. (Christian Brabandt, 2011
Nov 20)
Patch to add ":py3do". (Lilydjwg, 2012 Apr 7)
`[ moves to character after insert, instead of the last inserted character.
(Yukihiro Nakadaira, 2011 Dec 9)
@@ -166,6 +159,12 @@ Needs more work. Pinged 2012 Jan 4.
Patch 7.3.116 was the wrong solution.
Christian Brabandt has another incomplete patch. (2011 Jul 13)
'cursorline' is drawn incorrectly in diff mode. Patch by Christian Brabandt,
2012 Apr 2.
'cursorline' works on a text line only. Add 'cursorscreenline' for
highlighting the screen line. (Christian Brabandt, 2012 Mar 31)
With concealed text mouse click doesn't put the cursor in the right position.
(Herb Sitz) Fix by Christian Brabandt, 2011 Jun 16. Doesn't work properly,
need to make the change in where RET_WIN_BUF_CHARTABSIZE() is called.

View File

@@ -1,4 +1,4 @@
*windows.txt* For Vim version 7.3. Last change: 2011 Aug 14
*windows.txt* For Vim version 7.3. Last change: 2012 Apr 13
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -174,7 +174,8 @@ CTRL-W CTRL_N *CTRL-W_CTRL-N*
2. WinEnter for the new window
3. BufLeave for the current buffer
4. BufEnter for the new buffer
This behaves like a ":split" first, and then a ":e" command.
This behaves like a ":split" first, and then an ":enew"
command.
:[N]vne[w] [++opt] [+cmd] [file] *:vne* *:vnew*
Like |:new|, but split vertically. If 'equalalways' is set
@@ -183,7 +184,8 @@ CTRL-W CTRL_N *CTRL-W_CTRL-N*
:[N]new [++opt] [+cmd] {file}
:[N]sp[lit] [++opt] [+cmd] {file} *:split_f*
Create a new window and start editing file {file} in it.
Create a new window and start editing file {file} in it. This
behaves like a ":split" first, and then an ":e" command.
If [+cmd] is given, execute the command when the file has been
loaded |+cmd|.
Also see |++opt|.

View File

@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2012 Mar 28
" Last Change: 2012 Apr 13
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
@@ -17,7 +17,7 @@ augroup filetypedetect
" Ignored extensions
if exists("*fnameescape")
au BufNewFile,BufRead ?\+.orig,?\+.bak,?\+.old,?\+.new,?\+.dpkg-dist,?\+.dpkg-old,?\+.rpmsave,?\+.rpmnew
au BufNewFile,BufRead ?\+.orig,?\+.bak,?\+.old,?\+.new,?\+.dpkg-dist,?\+.dpkg-old,?\+.dpkg-new,?\+.dpkg-bak,?\+.rpmsave,?\+.rpmnew
\ exe "doau filetypedetect BufRead " . fnameescape(expand("<afile>:r"))
au BufNewFile,BufRead *~
\ let s:name = expand("<afile>") |
@@ -239,8 +239,8 @@ func! s:FTVB(alt)
endif
endfunc
" Visual Basic Script (close to Visual Basic)
au BufNewFile,BufRead *.vbs,*.dsm,*.ctl setf vb
" Visual Basic Script (close to Visual Basic) or Visual Basic .NET
au BufNewFile,BufRead *.vb,*.vbs,*.dsm,*.ctl setf vb
" IBasic file (similar to QBasic)
au BufNewFile,BufRead *.iba,*.ibi setf ibasic
@@ -735,9 +735,11 @@ au BufNewFile,BufRead *.mo,*.gdmo setf gdmo
au BufNewFile,BufRead *.ged,lltxxxxx.txt setf gedcom
" Git
au BufNewFile,BufRead *.git/COMMIT_EDITMSG setf gitcommit
au BufNewFile,BufRead *.git/COMMIT_EDITMSG setf gitcommit
au BufNewFile,BufRead *.git/config,.gitconfig,.gitmodules setf gitconfig
au BufNewFile,BufRead git-rebase-todo setf gitrebase
au BufNewFile,BufRead *.git/modules/**/COMMIT_EDITMSG setf gitcommit
au BufNewFile,BufRead *.git/modules/**/config setf gitconfig
au BufNewFile,BufRead git-rebase-todo setf gitrebase
au BufNewFile,BufRead .msg.[0-9]*
\ if getline(1) =~ '^From.*# This line is ignored.$' |
\ setf gitsendemail |
@@ -2142,6 +2144,9 @@ au BufNewFile,BufReadPost *.tssop setf tssop
" TSS - Command Line (temporary)
au BufNewFile,BufReadPost *.tsscl setf tsscl
" TWIG files
au BufNewFile,BufReadPost *.twig setf twig
" Motif UIT/UIL files
au BufNewFile,BufRead *.uit,*.uil setf uil

View File

@@ -1,7 +1,6 @@
" Vim filetype plugin
" Language: generic git output
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Last Change: 2010 May 21
" Only do this when not done yet for this buffer
if (exists("b:did_ftplugin"))
@@ -10,7 +9,9 @@ endif
let b:did_ftplugin = 1
if !exists('b:git_dir')
if expand('%:p') =~# '\.git\>'
if expand('%:p') =~# '[\/]\.git[\/]modules[\/]'
" Stay out of the way
elseif expand('%:p') =~# '\.git\>'
let b:git_dir = matchstr(expand('%:p'),'.*\.git\>')
elseif $GIT_DIR != ''
let b:git_dir = $GIT_DIR

View File

@@ -1,7 +1,7 @@
" Vim filetype plugin
" Language: git commit file
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Last Change: 2010 May 21
" Last Change: 2012 April 7
" Only do this when not done yet for this buffer
if (exists("b:did_ftplugin"))
@@ -11,13 +11,14 @@ endif
runtime! ftplugin/git.vim
let b:did_ftplugin = 1
setlocal nomodeline
let b:undo_ftplugin = 'setl modeline<'
if &textwidth == 0
" make sure that log messages play nice with git-log on standard terminals
setlocal textwidth=72
if !exists("b:undo_ftplugin")
let b:undo_ftplugin = ""
endif
let b:undo_ftplugin = b:undo_ftplugin . "|setl tw<"
let b:undo_ftplugin .= "|setl tw<"
endif
if exists("g:no_gitcommit_commands") || v:version < 700
@@ -28,8 +29,6 @@ if !exists("b:git_dir")
let b:git_dir = expand("%:p:h")
endif
" Automatically diffing can be done with:
" autocmd FileType gitcommit DiffGitCached | wincmd p
command! -bang -bar -buffer -complete=custom,s:diffcomplete -nargs=* DiffGitCached :call s:gitdiffcached(<bang>0,b:git_dir,<f-args>)
function! s:diffcomplete(A,L,P)
@@ -58,11 +57,11 @@ function! s:gitdiffcached(bang,gitdir,...)
else
let extra = "-p --stat=".&columns
endif
call system(git." diff --cached --no-color ".extra." > ".(exists("*shellescape") ? shellescape(name) : name))
call system(git." diff --cached --no-color --no-ext-diff ".extra." > ".(exists("*shellescape") ? shellescape(name) : name))
exe "pedit ".(exists("*fnameescape") ? fnameescape(name) : name)
wincmd P
let b:git_dir = a:gitdir
command! -bang -bar -buffer -complete=custom,s:diffcomplete -nargs=* DiffGitCached :call s:gitdiffcached(<bang>0,b:git_dir,<f-args>)
nnoremap <silent> q :q<CR>
nnoremap <buffer> <silent> q :q<CR>
setlocal buftype=nowrite nobuflisted noswapfile nomodifiable filetype=git
endfunction

View File

@@ -1,7 +1,7 @@
" Vim indent file
" Language: git config file
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Last Change: 2010 May 21
" Last Change: 2012 April 7
if exists("b:did_indent")
finish
@@ -12,6 +12,8 @@ setlocal autoindent
setlocal indentexpr=GetGitconfigIndent()
setlocal indentkeys=o,O,*<Return>,0[,],0;,0#,=,!^F
let b:undo_indent = 'setl ai< inde< indk<'
" Only define the function once.
if exists("*GetGitconfigIndent")
finish

View File

@@ -20,7 +20,7 @@
if &cp || exists("g:loaded_netrwPlugin")
finish
endif
let g:loaded_netrwPlugin = "v143"
let g:loaded_netrwPlugin = "v145"
if v:version < 702
echohl WarningMsg | echo "***netrw*** you need vim version 7.2 for this version of netrw" | echohl None
finish

View File

@@ -3,7 +3,7 @@
" Maintainer: Erik Wognsen <erik.wognsen@gmail.com>
" Previous maintainer:
" Kevin Dahlhausen <kdahlhaus@yahoo.com>
" Last Change: 2012 Jan 5
" Last Change: 2012 Apr 09
" Thanks to Ori Avtalion for feedback on the comment markers!
@@ -56,6 +56,11 @@ syn keyword asmTodo contained TODO
" GAS supports one type of multi line comments:
syn region asmComment start="/\*" end="\*/" contains=asmTodo
" GAS (undocumentedly?) supports C++ style comments. Unlike in C/C++ however,
" a backslash ending a C++ style comment does not extend the comment to the
" next line (hence the syntax region does not define 'skip="\\$"')
syn region asmComment start="//" end="$" keepend contains=asmTodo
" Line comment characters depend on the target architecture and command line
" options and some comments may double as logical line number directives or
" preprocessor commands. This situation is described at

View File

@@ -1,7 +1,7 @@
" Vim syntax file
" Language: Django template
" Maintainer: Dave Hodder <dmh@dmh.org.uk>
" Last Change: 2010 May 19
" Last Change: 2012 Apr 09
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
@@ -21,7 +21,7 @@ syn match djangoError "%}\|}}\|#}"
syn keyword djangoStatement contained autoescape csrf_token empty
" FIXME ==, !=, <, >, <=, and >= should be djangoStatements:
" syn keyword djangoStatement contained == != < > <= >=
syn keyword djangoStatement contained and as block endblock by cycle debug else
syn keyword djangoStatement contained and as block endblock by cycle debug else elif
syn keyword djangoStatement contained extends filter endfilter firstof for
syn keyword djangoStatement contained endfor if endif ifchanged endifchanged
syn keyword djangoStatement contained ifequal endifequal ifnotequal
@@ -45,7 +45,7 @@ syn keyword djangoFilter contained linebreaks linebreaksbr linenumbers ljust
syn keyword djangoFilter contained lower make_list phone2numeric pluralize
syn keyword djangoFilter contained pprint random removetags rjust slice slugify
syn keyword djangoFilter contained safe safeseq stringformat striptags
syn keyword djangoFilter contained time timesince timeuntil title
syn keyword djangoFilter contained time timesince timeuntil title truncatechars
syn keyword djangoFilter contained truncatewords truncatewords_html unordered_list upper urlencode
syn keyword djangoFilter contained urlize urlizetrunc wordcount wordwrap yesno

View File

@@ -2,7 +2,7 @@
" Language: git commit file
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Filenames: *.git/COMMIT_EDITMSG
" Last Change: 2010 May 21
" Last Change: 2012 April 7
if exists("b:current_syntax")
finish
@@ -16,7 +16,7 @@ if has("spell")
endif
syn include @gitcommitDiff syntax/diff.vim
syn region gitcommitDiff start=/\%(^diff --\%(git\|cc\|combined\) \)\@=/ end=/^$\|^#\@=/ contains=@gitcommitDiff
syn region gitcommitDiff start=/\%(^diff --\%(git\|cc\|combined\) \)\@=/ end=/^\%(diff --\|$\|#\)\@=/ fold contains=@gitcommitDiff
syn match gitcommitFirstLine "\%^[^#].*" nextgroup=gitcommitBlank skipnl
syn match gitcommitSummary "^.\{0,50\}" contained containedin=gitcommitFirstLine nextgroup=gitcommitOverflow contains=@Spell
@@ -26,7 +26,7 @@ syn match gitcommitComment "^#.*"
syn match gitcommitHead "^\%(# .*\n\)\+#$" contained transparent
syn match gitcommitOnBranch "\%(^# \)\@<=On branch" contained containedin=gitcommitComment nextgroup=gitcommitBranch skipwhite
syn match gitcommitOnBranch "\%(^# \)\@<=Your branch .\{-\} '" contained containedin=gitcommitComment nextgroup=gitcommitBranch skipwhite
syn match gitcommitBranch "[^ \t']\+" contained
syn match gitcommitBranch "[^ ']\+" contained
syn match gitcommitNoBranch "\%(^# \)\@<=Not currently on any branch." contained containedin=gitcommitComment
syn match gitcommitHeader "\%(^# \)\@<=.*:$" contained containedin=gitcommitComment
syn region gitcommitAuthor matchgroup=gitCommitHeader start=/\%(^# \)\@<=\%(Author\|Committer\):/ end=/$/ keepend oneline contained containedin=gitcommitComment transparent
@@ -35,7 +35,7 @@ syn match gitcommitNoChanges "\%(^# \)\@<=No changes$" contained containedin=g
syn region gitcommitUntracked start=/^# Untracked files:/ end=/^#$\|^#\@!/ contains=gitcommitHeader,gitcommitHead,gitcommitUntrackedFile fold
syn match gitcommitUntrackedFile "\t\@<=.*" contained
syn region gitcommitDiscarded start=/^# Changed but not updated:/ end=/^#$\|^#\@!/ contains=gitcommitHeader,gitcommitHead,gitcommitDiscardedType fold
syn region gitcommitDiscarded start=/^# Change\%(s not staged for commit\|d but not updated\):/ end=/^#$\|^#\@!/ contains=gitcommitHeader,gitcommitHead,gitcommitDiscardedType fold
syn region gitcommitSelected start=/^# Changes to be committed:/ end=/^#$\|^#\@!/ contains=gitcommitHeader,gitcommitHead,gitcommitSelectedType fold
syn region gitcommitUnmerged start=/^# Unmerged paths:/ end=/^#$\|^#\@!/ contains=gitcommitHeader,gitcommitHead,gitcommitUnmergedType fold

View File

@@ -2,7 +2,7 @@
" Language: git rebase --interactive
" Maintainer: Tim Pope <vimNOSPAM@tpope.org>
" Filenames: git-rebase-todo
" Last Change: 2010 May 21
" Last Change: 2012 April 7
if exists("b:current_syntax")
finish
@@ -17,7 +17,9 @@ syn match gitrebaseReword "\v^r%(eword)=>" nextgroup=gitrebaseCommit skipwhite
syn match gitrebaseEdit "\v^e%(dit)=>" nextgroup=gitrebaseCommit skipwhite
syn match gitrebaseSquash "\v^s%(quash)=>" nextgroup=gitrebaseCommit skipwhite
syn match gitrebaseFixup "\v^f%(ixup)=>" nextgroup=gitrebaseCommit skipwhite
syn match gitrebaseExec "\v^%(x|exec)>" nextgroup=gitrebaseCommand skipwhite
syn match gitrebaseSummary ".*" contains=gitrebaseHash contained
syn match gitrebaseCommand ".*" contained
syn match gitrebaseComment "^#.*" contains=gitrebaseHash
syn match gitrebaseSquashError "\v%^%(s%(quash)=>|f%(ixup)=>)" nextgroup=gitrebaseCommit skipwhite
@@ -28,6 +30,7 @@ hi def link gitrebaseReword Number
hi def link gitrebaseEdit PreProc
hi def link gitrebaseSquash Type
hi def link gitrebaseFixup Special
hi def link gitrebaseExec Function
hi def link gitrebaseSummary String
hi def link gitrebaseComment Comment
hi def link gitrebaseSquashError Error

View File

@@ -51,7 +51,9 @@ POSTSCRIPT=no
# set to yes to enable OLE support
OLE=no
# Set the default $(WINVER) to make it work with pre-Win2k
ifndef WINVER
WINVER = 0x0400
endif
# Set to yes to enable Cscope support
CSCOPE=yes
# Set to yes to enable Netbeans support

View File

@@ -880,6 +880,7 @@ eval_init()
hash_add(&compat_hashtab, p->vv_di.di_key);
}
set_vim_var_nr(VV_SEARCHFORWARD, 1L);
set_reg_var(0); /* default for v:register is not 0 but '"' */
#ifdef EBCDIC
/*
@@ -12090,7 +12091,7 @@ f_has(argvars, rettv)
#ifdef FEAT_SEARCHPATH
"file_in_path",
#endif
#if (defined(UNIX) && !defined(USE_SYSTEM)) || defined(WIN3264)
#ifdef FEAT_FILTERPIPE
"filterpipe",
#endif
#ifdef FEAT_FIND_ID

View File

@@ -25,7 +25,6 @@ static int viminfo_encoding __ARGS((vir_T *virp));
static int read_viminfo_up_to_marks __ARGS((vir_T *virp, int forceit, int writing));
#endif
static int check_overwrite __ARGS((exarg_T *eap, buf_T *buf, char_u *fname, char_u *ffname, int other));
static int check_readonly __ARGS((int *forceit, buf_T *buf));
#ifdef FEAT_AUTOCMD
static void delbuf_msg __ARGS((char_u *name));
@@ -1113,7 +1112,7 @@ do_filter(line1, line2, eap, cmd, do_in, do_out)
if (do_out)
shell_flags |= SHELL_DOOUT;
#if (!defined(USE_SYSTEM) && defined(UNIX)) || defined(WIN3264)
#ifdef FEAT_FILTERPIPE
if (!do_in && do_out && !p_stmp)
{
/* Use a pipe to fetch stdout of the command, do not use a temp file. */
@@ -2722,7 +2721,7 @@ theend:
* May set eap->forceit if a dialog says it's OK to overwrite.
* Return OK if it's OK, FAIL if it is not.
*/
static int
int
check_overwrite(eap, buf, fname, ffname, other)
exarg_T *eap;
buf_T *buf;
@@ -3421,7 +3420,7 @@ do_ecmd(fnum, ffname, sfname, eap, newlnum, flags, oldwin)
* and re-attach to buffer, perhaps.
*/
if (curwin->w_s == &(curwin->w_buffer->b_s))
curwin->w_s = &(buf->b_s);
curwin->w_s = &(buf->b_s);
#endif
curwin->w_buffer = buf;
curbuf = buf;
@@ -5965,6 +5964,29 @@ find_help_tags(arg, num_matches, matches, keep_lang)
break;
}
*d = NUL;
if (*IObuff == '`')
{
if (d > IObuff + 2 && d[-1] == '`')
{
/* remove the backticks from `command` */
mch_memmove(IObuff, IObuff + 1, STRLEN(IObuff));
d[-2] = NUL;
}
else if (d > IObuff + 3 && d[-2] == '`' && d[-1] == ',')
{
/* remove the backticks and comma from `command`, */
mch_memmove(IObuff, IObuff + 1, STRLEN(IObuff));
d[-3] = NUL;
}
else if (d > IObuff + 4 && d[-3] == '`'
&& d[-2] == '\\' && d[-1] == '.')
{
/* remove the backticks and dot from `command`\. */
mch_memmove(IObuff, IObuff + 1, STRLEN(IObuff));
d[-4] = NUL;
}
}
}
}

View File

@@ -1489,6 +1489,7 @@ dialog_changed(buf, checkall)
char_u buff[DIALOG_MSG_SIZE];
int ret;
buf_T *buf2;
exarg_T ea;
dialog_msg(buff, _("Save changes to \"%s\"?"),
(buf->b_fname != NULL) ?
@@ -1498,13 +1499,19 @@ dialog_changed(buf, checkall)
else
ret = vim_dialog_yesnocancel(VIM_QUESTION, NULL, buff, 1);
/* Init ea pseudo-structure, this is needed for the check_overwrite()
* function. */
ea.append = ea.forceit = FALSE;
if (ret == VIM_YES)
{
#ifdef FEAT_BROWSE
/* May get file name, when there is none */
browse_save_fname(buf);
#endif
if (buf->b_fname != NULL) /* didn't hit Cancel */
if (buf->b_fname != NULL && check_overwrite(&ea, buf,
buf->b_fname, buf->b_ffname, FALSE) == OK)
/* didn't hit Cancel */
(void)buf_write_all(buf, FALSE);
}
else if (ret == VIM_NO)
@@ -1532,7 +1539,9 @@ dialog_changed(buf, checkall)
/* May get file name, when there is none */
browse_save_fname(buf2);
#endif
if (buf2->b_fname != NULL) /* didn't hit Cancel */
if (buf2->b_fname != NULL && check_overwrite(&ea, buf2,
buf2->b_fname, buf2->b_ffname, FALSE) == OK)
/* didn't hit Cancel */
(void)buf_write_all(buf2, FALSE);
#ifdef FEAT_AUTOCMD
/* an autocommand may have deleted the buffer */

View File

@@ -1316,3 +1316,11 @@
#ifdef FEAT_NORMAL
# define FEAT_PERSISTENT_UNDO
#endif
/*
* +filterpipe
*/
#if (defined(UNIX) && !defined(USE_SYSTEM)) \
|| (defined(WIN3264) && defined(FEAT_GUI_W32))
# define FEAT_FILTERPIPE
#endif

View File

@@ -2655,10 +2655,6 @@ failed:
}
#endif
/* Reset now, following writes should not omit the EOL. Also, the line
* number will become invalid because of edits. */
curbuf->b_no_eol_lnum = 0;
if (recoverymode && error)
return FAIL;
return OK;
@@ -5098,6 +5094,8 @@ nofail:
{
aco_save_T aco;
curbuf->b_no_eol_lnum = 0; /* in case it was set by the previous read */
/*
* Apply POST autocommands.
* Careful: The autocommands may call buf_write() recursively!

View File

@@ -90,6 +90,11 @@ typedef int GtkWidget;
static void entry_activate_cb(GtkWidget *widget, gpointer data);
static void entry_changed_cb(GtkWidget *entry, GtkWidget *dialog);
static void find_replace_cb(GtkWidget *widget, gpointer data);
static void recent_func_log_func(
const gchar *log_domain,
GLogLevelFlags log_level,
const gchar *message,
gpointer user_data);
#if defined(FEAT_TOOLBAR)
/*
@@ -839,6 +844,8 @@ gui_mch_browse(int saving UNUSED,
GtkWidget *fc;
#endif
char_u dirbuf[MAXPATHL];
guint log_handler;
const gchar *domain = "Gtk";
title = CONVERT_TO_UTF8(title);
@@ -853,6 +860,11 @@ gui_mch_browse(int saving UNUSED,
/* If our pointer is currently hidden, then we should show it. */
gui_mch_mousehide(FALSE);
/* Hack: The GTK file dialog warns when it can't access a new file, this
* makes it shut up. http://bugzilla.gnome.org/show_bug.cgi?id=664587 */
log_handler = g_log_set_handler(domain, G_LOG_LEVEL_WARNING,
recent_func_log_func, NULL);
#ifdef USE_FILE_CHOOSER
/* We create the dialog each time, so that the button text can be "Open"
* or "Save" according to the action. */
@@ -916,6 +928,7 @@ gui_mch_browse(int saving UNUSED,
gtk_widget_show(gui.filedlg);
gtk_main();
#endif
g_log_remove_handler(domain, log_handler);
CONVERT_TO_UTF8_FREE(title);
if (gui.browse_fname == NULL)
@@ -1882,3 +1895,14 @@ ex_helpfind(eap)
* backwards compatibility anyway. */
do_cmdline_cmd((char_u *)"emenu ToolBar.FindHelp");
}
static void
recent_func_log_func(const gchar *log_domain UNUSED,
GLogLevelFlags log_level UNUSED,
const gchar *message UNUSED,
gpointer user_data UNUSED)
{
/* We just want to suppress the warnings. */
/* http://bugzilla.gnome.org/show_bug.cgi?id=664587 */
}

View File

@@ -95,6 +95,7 @@ static luaV_Dict *luaV_pushdict (lua_State *L, dict_T *dic);
#define luaL_loadbufferx dll_luaL_loadbufferx
#define luaL_argerror dll_luaL_argerror
#endif
#define luaL_checkany dll_luaL_checkany
#define luaL_checklstring dll_luaL_checklstring
#define luaL_checkinteger dll_luaL_checkinteger
#define luaL_optinteger dll_luaL_optinteger
@@ -117,8 +118,8 @@ static luaV_Dict *luaV_pushdict (lua_State *L, dict_T *dic);
#define lua_pcallk dll_lua_pcallk
#define lua_getglobal dll_lua_getglobal
#define lua_setglobal dll_lua_setglobal
#define lua_typename dll_lua_typename
#endif
#define lua_typename dll_lua_typename
#define lua_close dll_lua_close
#define lua_gettop dll_lua_gettop
#define lua_settop dll_lua_settop
@@ -151,6 +152,7 @@ static luaV_Dict *luaV_pushdict (lua_State *L, dict_T *dic);
#define lua_rawset dll_lua_rawset
#define lua_rawseti dll_lua_rawseti
#define lua_setmetatable dll_lua_setmetatable
#define lua_next dll_lua_next
/* libs */
#define luaopen_base dll_luaopen_base
#define luaopen_table dll_luaopen_table
@@ -177,6 +179,7 @@ int (*dll_luaL_loadfilex) (lua_State *L, const char *filename, const char *mode)
int (*dll_luaL_loadbufferx) (lua_State *L, const char *buff, size_t sz, const char *name, const char *mode);
int (*dll_luaL_argerror) (lua_State *L, int numarg, const char *extramsg);
#endif
void (*dll_luaL_checkany) (lua_State *L, int narg);
const char *(*dll_luaL_checklstring) (lua_State *L, int numArg, size_t *l);
lua_Integer (*dll_luaL_checkinteger) (lua_State *L, int numArg);
lua_Integer (*dll_luaL_optinteger) (lua_State *L, int nArg, lua_Integer def);
@@ -201,8 +204,8 @@ int (*dll_lua_pcallk) (lua_State *L, int nargs, int nresults, int errfunc,
int ctx, lua_CFunction k);
void (*dll_lua_getglobal) (lua_State *L, const char *var);
void (*dll_lua_setglobal) (lua_State *L, const char *var);
const char *(*dll_lua_typename) (lua_State *L, int tp);
#endif
const char *(*dll_lua_typename) (lua_State *L, int tp);
void (*dll_lua_close) (lua_State *L);
int (*dll_lua_gettop) (lua_State *L);
void (*dll_lua_settop) (lua_State *L, int idx);
@@ -235,6 +238,7 @@ void (*dll_lua_setfield) (lua_State *L, int idx, const char *k);
void (*dll_lua_rawset) (lua_State *L, int idx);
void (*dll_lua_rawseti) (lua_State *L, int idx, int n);
int (*dll_lua_setmetatable) (lua_State *L, int objindex);
int (*dll_lua_next) (lua_State *L, int idx);
/* libs */
int (*dll_luaopen_base) (lua_State *L);
int (*dll_luaopen_table) (lua_State *L);
@@ -268,6 +272,7 @@ static const luaV_Reg luaV_dll[] = {
{"luaL_loadbufferx", (luaV_function) &dll_luaL_loadbufferx},
{"luaL_argerror", (luaV_function) &dll_luaL_argerror},
#endif
{"luaL_checkany", (luaV_function) &dll_luaL_checkany},
{"luaL_checklstring", (luaV_function) &dll_luaL_checklstring},
{"luaL_checkinteger", (luaV_function) &dll_luaL_checkinteger},
{"luaL_optinteger", (luaV_function) &dll_luaL_optinteger},
@@ -290,8 +295,8 @@ static const luaV_Reg luaV_dll[] = {
{"lua_pcallk", (luaV_function) &dll_lua_pcallk},
{"lua_getglobal", (luaV_function) &dll_lua_getglobal},
{"lua_setglobal", (luaV_function) &dll_lua_setglobal},
{"lua_typename", (luaV_function) &dll_lua_typename},
#endif
{"lua_typename", (luaV_function) &dll_lua_typename},
{"lua_close", (luaV_function) &dll_lua_close},
{"lua_gettop", (luaV_function) &dll_lua_gettop},
{"lua_settop", (luaV_function) &dll_lua_settop},
@@ -324,6 +329,7 @@ static const luaV_Reg luaV_dll[] = {
{"lua_rawset", (luaV_function) &dll_lua_rawset},
{"lua_rawseti", (luaV_function) &dll_lua_rawseti},
{"lua_setmetatable", (luaV_function) &dll_lua_setmetatable},
{"lua_next", (luaV_function) &dll_lua_next},
/* libs */
{"luaopen_base", (luaV_function) &dll_luaopen_base},
{"luaopen_table", (luaV_function) &dll_luaopen_table},
@@ -1828,7 +1834,7 @@ ex_luado(exarg_T *eap)
}
luaV_setrange(L, eap->line1, eap->line2);
luaL_buffinit(L, &b);
luaL_addlstring(&b, "return function(line) ", 22); /* header */
luaL_addlstring(&b, "return function(line, linenr) ", 30); /* header */
luaL_addlstring(&b, s, strlen(s));
luaL_addlstring(&b, " end", 4); /* footer */
luaL_pushresult(&b);
@@ -1845,7 +1851,8 @@ ex_luado(exarg_T *eap)
{
lua_pushvalue(L, -1); /* function */
luaV_pushline(L, curbuf, l); /* current line as arg */
if (lua_pcall(L, 1, 1, 0))
lua_pushinteger(L, l); /* current line number as arg */
if (lua_pcall(L, 2, 1, 0))
{
luaV_emsg(L);
break;

View File

@@ -77,6 +77,11 @@ OutputWrite(PyObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "et#", ENC_OPT, &str, &len))
return NULL;
/* TODO: This works around a gcc optimizer problem and avoids Vim
* from crashing. Should find a real solution. */
if (str == NULL)
return NULL;
Py_BEGIN_ALLOW_THREADS
Python_Lock_Vim();
writer((writefn)(error ? emsg : msg), (char_u *)str, len);

View File

@@ -1238,6 +1238,11 @@ static VALUE window_set_cursor(VALUE self, VALUE pos)
return Qnil;
}
static VALUE f_nop(VALUE self UNUSED)
{
return Qnil;
}
static VALUE f_p(int argc, VALUE *argv, VALUE self UNUSED)
{
int i;
@@ -1259,6 +1264,7 @@ static void ruby_io_init(void)
rb_stdout = rb_obj_alloc(rb_cObject);
rb_define_singleton_method(rb_stdout, "write", vim_message, 1);
rb_define_singleton_method(rb_stdout, "flush", f_nop, 0);
rb_define_global_function("p", f_p, -1);
}

View File

@@ -928,6 +928,18 @@ int vim_main2(int argc, char **argv)
TIME_MSG("VimEnter autocommands");
#endif
#if defined(FEAT_EVAL) && defined(FEAT_CLIPBOARD)
/* Adjust default register name for "unnamed" in 'clipboard'. Can only be
* done after the clipboard is available and all initial commands that may
* modify the 'clipboard' setting have run; i.e. just before entering the
* main loop. */
{
int default_regname = 0;
adjust_clip_reg(&default_regname);
set_reg_var(default_regname);
}
#endif
#if defined(FEAT_DIFF) && defined(FEAT_SCROLLBIND)
/* When a startup script or session file setup for diff'ing and
* scrollbind, sync the scrollbind now. */
@@ -1357,7 +1369,7 @@ getout(exitval)
{
apply_autocmds(EVENT_BUFWINLEAVE, buf->b_fname,
buf->b_fname, FALSE, buf);
buf->b_changedtick = -1; /* note that we did it already */
buf->b_changedtick = -1; /* note that we did it already */
/* start all over, autocommands may mess up the lists */
next_tp = first_tabpage;
break;

View File

@@ -4972,6 +4972,7 @@ static int cin_isif __ARGS((char_u *));
static int cin_iselse __ARGS((char_u *));
static int cin_isdo __ARGS((char_u *));
static int cin_iswhileofdo __ARGS((char_u *, linenr_T, int));
static int cin_is_if_for_while_before_offset __ARGS((char_u *line, int *poffset));
static int cin_iswhileofdo_end __ARGS((int terminated, int ind_maxparen, int ind_maxcomment));
static int cin_isbreak __ARGS((char_u *));
static int cin_is_cpp_baseclass __ARGS((colnr_T *col));
@@ -5770,6 +5771,52 @@ cin_iswhileofdo(p, lnum, ind_maxparen) /* XXX */
return retval;
}
/*
* Check whether in "p" there is an "if", "for" or "while" before "*poffset".
* Return 0 if there is none.
* Otherwise return !0 and update "*poffset" to point to the place where the
* string was found.
*/
static int
cin_is_if_for_while_before_offset(line, poffset)
char_u *line;
int *poffset;
{
int offset = *poffset;
if (offset-- < 2)
return 0;
while (offset > 2 && vim_iswhite(line[offset]))
--offset;
offset -= 1;
if (!STRNCMP(line + offset, "if", 2))
goto probablyFound;
if (offset >= 1)
{
offset -= 1;
if (!STRNCMP(line + offset, "for", 3))
goto probablyFound;
if (offset >= 2)
{
offset -= 2;
if (!STRNCMP(line + offset, "while", 5))
goto probablyFound;
}
}
return 0;
probablyFound:
if (!offset || !vim_isIDc(line[offset - 1]))
{
*poffset = offset;
return 1;
}
return 0;
}
/*
* Return TRUE if we are at the end of a do-while.
* do
@@ -6124,7 +6171,7 @@ find_start_brace(ind_maxcomment) /* XXX */
/*
* Find the matching '(', failing if it is in a comment.
* Return NULL of no match found.
* Return NULL if no match found.
*/
static pos_T *
find_match_paren(ind_maxparen, ind_maxcomment) /* XXX */
@@ -6393,6 +6440,12 @@ get_c_indent()
*/
int ind_cpp_namespace = 0;
/*
* handle continuation lines containing conditions of if(), for() and
* while()
*/
int ind_if_for_while = 0;
pos_T cur_curpos;
int amount;
int scope_amount;
@@ -6509,6 +6562,7 @@ get_c_indent()
case 'l': ind_keep_case_label = n; break;
case '#': ind_hash_comment = n; break;
case 'N': ind_cpp_namespace = n; break;
case 'k': ind_if_for_while = n; break;
}
if (*options == ',')
++options;
@@ -6812,6 +6866,33 @@ get_c_indent()
if (amount == -1)
{
int ignore_paren_col = 0;
int is_if_for_while = 0;
if (ind_if_for_while)
{
/* Look for the outermost opening parenthesis on this line
* and check whether it belongs to an "if", "for" or "while". */
pos_T cursor_save = curwin->w_cursor;
pos_T outermost;
char_u *line;
trypos = &our_paren_pos;
do {
outermost = *trypos;
curwin->w_cursor.lnum = outermost.lnum;
curwin->w_cursor.col = outermost.col;
trypos = find_match_paren(ind_maxparen, ind_maxcomment);
} while (trypos && trypos->lnum == outermost.lnum);
curwin->w_cursor = cursor_save;
line = ml_get(outermost.lnum);
is_if_for_while =
cin_is_if_for_while_before_offset(line, &outermost.col);
}
amount = skip_label(our_paren_pos.lnum, &look, ind_maxcomment);
look = skipwhite(look);
@@ -6836,7 +6917,7 @@ get_c_indent()
curwin->w_cursor.lnum = save_lnum;
look = ml_get(our_paren_pos.lnum) + look_col;
}
if (theline[0] == ')' || ind_unclosed == 0
if (theline[0] == ')' || (ind_unclosed == 0 && is_if_for_while == 0)
|| (!ind_unclosed_noignore && *look == '('
&& ignore_paren_col == 0))
{
@@ -6907,7 +6988,8 @@ get_c_indent()
{
/* Line up with the start of the matching paren line. */
}
else if (ind_unclosed == 0 || (!ind_unclosed_noignore
else if ((ind_unclosed == 0 && is_if_for_while == 0)
|| (!ind_unclosed_noignore
&& *look == '(' && ignore_paren_col == 0))
{
if (cur_amount != MAXCOL)
@@ -6943,7 +7025,12 @@ get_c_indent()
if (find_match_paren(ind_maxparen, ind_maxcomment) != NULL)
amount += ind_unclosed2;
else
amount += ind_unclosed;
{
if (is_if_for_while)
amount += ind_if_for_while;
else
amount += ind_unclosed;
}
}
/*
* For a line starting with ')' use the minimum of the two

View File

@@ -1812,14 +1812,15 @@ nb_do_cmd(
char_u *oldline = ml_get(lnum);
char_u *newline;
/* Insert halfway a line. For simplicity we assume we
* need to append to the line. */
/* Insert halfway a line. */
newline = alloc_check(
(unsigned)(STRLEN(oldline) + len + 1));
if (newline != NULL)
{
STRCPY(newline, oldline);
mch_memmove(newline, oldline, (size_t)pos->col);
newline[pos->col] = NUL;
STRCAT(newline, args);
STRCAT(newline, oldline + pos->col);
ml_replace(lnum, newline, FALSE);
}
}

View File

@@ -1720,9 +1720,14 @@ op_delete(oap)
did_yank = TRUE;
}
/* Yank into small delete register when no register specified and the
* delete is within one line. */
if (oap->regname == 0 && oap->motion_type != MLINE
/* Yank into small delete register when no named register specified
* and the delete is within one line. */
if ((
#ifdef FEAT_CLIPBOARD
((clip_unnamed & CLIP_UNNAMED) && oap->regname == '*') ||
((clip_unnamed & CLIP_UNNAMED_PLUS) && oap->regname == '+') ||
#endif
oap->regname == 0) && oap->motion_type != MLINE
&& oap->line_count == 1)
{
oap->regname = '-';

View File

@@ -3734,24 +3734,21 @@ wait4pid(child, status)
while (wait_pid != child)
{
# ifdef _THREAD_SAFE
/* Ugly hack: when compiled with Python threads are probably
* used, in which case wait() sometimes hangs for no obvious
* reason. Use waitpid() instead and loop (like the GUI). */
# ifdef __NeXT__
/* When compiled with Python threads are probably used, in which case
* wait() sometimes hangs for no obvious reason. Use waitpid()
* instead and loop (like the GUI). Also needed for other interfaces,
* they might call system(). */
# ifdef __NeXT__
wait_pid = wait4(child, status, WNOHANG, (struct rusage *)0);
# else
# else
wait_pid = waitpid(child, status, WNOHANG);
# endif
# endif
if (wait_pid == 0)
{
/* Wait for 1/100 sec before trying again. */
mch_delay(10L, TRUE);
continue;
}
# else
wait_pid = wait(status);
# endif
if (wait_pid <= 0
# ifdef ECHILD
&& errno == ECHILD

View File

@@ -23,6 +23,7 @@ void ex_file __ARGS((exarg_T *eap));
void ex_update __ARGS((exarg_T *eap));
void ex_write __ARGS((exarg_T *eap));
int do_write __ARGS((exarg_T *eap));
int check_overwrite __ARGS((exarg_T *eap, buf_T *buf, char_u *fname, char_u *ffname, int other));
void ex_wnext __ARGS((exarg_T *eap));
void do_wqall __ARGS((exarg_T *eap));
int not_writing __ARGS((void));

View File

@@ -13,6 +13,7 @@ VIMPROG = /vim
# test25 uses symbolic link
# test27 can't edit file with "*"
# test52 only for Win32
# test85 no Lua interface
SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
test7.out test8.out test9.out \

View File

@@ -30,7 +30,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
test68.out test69.out test71.out test72.out test73.out \
test74.out test75.out test76.out test77.out test78.out \
test79.out test80.out test81.out test82.out test83.out \
test84.out
test84.out test85.out
SCRIPTS32 = test50.out test70.out
@@ -52,7 +52,8 @@ win32: fixff $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS32)
fixff:
-$(VIMPROG) -u dos.vim --noplugin "+argdo set ff=dos|upd" +q *.in *.ok
-$(VIMPROG) -u dos.vim --noplugin "+argdo set ff=unix|upd" +q dotest.in
-$(VIMPROG) -u dos.vim --noplugin "+argdo set ff=unix|upd" +q \
dotest.in test60.ok test71.ok test74.ok
clean:
-del *.out

View File

@@ -50,7 +50,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
test68.out test69.out test71.out test72.out test73.out \
test74.out test75.out test76.out test77.out test78.out \
test79.out test80.out test81.out test82.out test83.out \
test84.out
test84.out test85.out
SCRIPTS32 = test50.out test70.out
@@ -75,6 +75,8 @@ win32: fixff $(SCRIPTS16) $(SCRIPTS) $(SCRIPTS32)
fixff:
-$(VIMPROG) -u dos.vim --noplugin "+argdo set ff=dos|upd" +q *.in *.ok
-$(VIMPROG) -u dos.vim --noplugin "+argdo set ff=unix|upd" +q \
dotest.in test60.ok test71.ok test74.ok
clean:
-$(DEL) *.out

View File

@@ -13,6 +13,7 @@ VIMPROG = ../vim.exe
# test25 uses symbolic link
# test27 can't edit file with "*" in file name
# test52 only for Win32
# test85 no Lua interface
SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
test7.out test8.out test9.out \

View File

@@ -4,7 +4,7 @@
# Authors: Zoltan Arpadffy, <arpadffy@polarhome.com>
# Sandor Kopanyi, <sandor.kopanyi@mailbox.hu>
#
# Last change: 2012 Mar 28
# Last change: 2012 Apr 05
#
# This has been tested on VMS 6.2 to 8.3 on DEC Alpha, VAX and IA64.
# Edit the lines in the Configuration section below to select.
@@ -89,6 +89,7 @@ SCRIPT = test1.out test2.out test3.out test4.out test5.out \
# with too many dots).
#
# Test 72: unknown reason
# Test 85: no Lua interface
.IFDEF WANT_GUI
SCRIPT_GUI = test16.out

View File

@@ -27,7 +27,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
test69.out test70.out test71.out test72.out test73.out \
test74.out test75.out test76.out test77.out test78.out \
test79.out test80.out test81.out test82.out test83.out \
test84.out
test84.out test85.out
SCRIPTS_GUI = test16.out

View File

@@ -15,6 +15,7 @@ If Vim was not compiled with the +multi_byte feature, the mbyte.vim script will
be set like small.vim above. mbyte.vim is sourced by tests that require the
+multi_byte feature.
Similar logic is applied to the +mzscheme feature, using mzscheme.vim.
Similar logic is applied to the +lua feature, using lua.vim.
STARTTEST
:" Write a single line to test.out to check if testing works at all.
@@ -28,10 +29,17 @@ w! test.out
qa!
:w! mbyte.vim
:w! mzscheme.vim
:w! lua.vim
:"
:" If +multi_byte feature supported, make mbyte.vim empty.
:if has("multi_byte") | sp another | w! mbyte.vim | q | endif
:"
:" If +mzscheme feature supported, make mzscheme.vim empty.
:if has("mzscheme") | sp another | w! mzscheme.vim | q | endif
:"
:" If +lua feature supported, make lua.vim empty.
:if has("lua") | sp another | w! lua.vim | q | endif
:"
:" If +eval feature supported quit here, leaving tiny.vim and small.vim empty.
:" Otherwise write small.vim to skip the test.
:if 1 | q! | endif

View File

@@ -1573,6 +1573,220 @@ void func(void)
for (int i = 0; i < 10; ++i)
if (i & 1) {
foo(1);
} else
foo(0);
baz();
}
STARTTEST
:set cino=k2s,(0
2kdd3j=][
ENDTEST
void func(void)
{
if (condition1
&& condition2)
action();
function(argument1
&& argument2);
if (c1 && (c2 ||
c3))
foo;
if (c1 &&
(c2 || c3))
{
}
if ( c1
&& ( c2
|| c3))
foo;
func( c1
&& ( c2
|| c3))
foo;
}
STARTTEST
:set cino=k2s,(s
2kdd3j=][
ENDTEST
void func(void)
{
if (condition1
&& condition2)
action();
function(argument1
&& argument2);
if (c1 && (c2 ||
c3))
foo;
if (c1 &&
(c2 || c3))
{
}
if ( c1
&& ( c2
|| c3))
foo;
func( c1
&& ( c2
|| c3))
foo;
}
STARTTEST
:set cino=k2s,(s,U1
2kdd3j=][
ENDTEST
void func(void)
{
if (condition1
&& condition2)
action();
function(argument1
&& argument2);
if (c1 && (c2 ||
c3))
foo;
if (c1 &&
(c2 || c3))
{
}
if (c123456789
&& (c22345
|| c3))
printf("foo\n");
c = c1 &&
(
c2 ||
c3
) && c4;
}
STARTTEST
:set cino=k2s,(0,W4
2kdd3j=][
ENDTEST
void func(void)
{
if (condition1
&& condition2)
action();
function(argument1
&& argument2);
if (c1 && (c2 ||
c3))
foo;
if (c1 &&
(c2 || c3))
{
}
if (c123456789
&& (c22345
|| c3))
printf("foo\n");
if ( c1
&& ( c2
|| c3))
foo;
a_long_line(
argument,
argument);
a_short_line(argument,
argument);
}
STARTTEST
:set cino=k2s,u2
2kdd3j=][
ENDTEST
void func(void)
{
if (condition1
&& condition2)
action();
function(argument1
&& argument2);
if (c1 && (c2 ||
c3))
foo;
if (c1 &&
(c2 || c3))
{
}
if (c123456789
&& (c22345
|| c3))
printf("foo\n");
}
STARTTEST
:set cino=k2s,(0,w1
2kdd3j=][
ENDTEST
void func(void)
{
if (condition1
&& condition2)
action();
function(argument1
&& argument2);
if (c1 && (c2 ||
c3))
foo;
if (c1 &&
(c2 || c3))
{
}
if (c123456789
&& (c22345
|| c3))
printf("foo\n");
if ( c1
&& ( c2
|| c3))
foo;
func( c1
&& ( c2
|| c3))
foo;
}
STARTTEST
:set cino=k2,(s
2kdd3j=][
ENDTEST
void func(void)
{
if (condition1
&& condition2)
action();
function(argument1
&& argument2);
if (c1 && (c2 ||
c3))
foo;
if (c1 &&
(c2 || c3))
{
}

View File

@@ -1411,6 +1411,192 @@ void func(void)
}
void func(void)
{
if (condition1
&& condition2)
action();
function(argument1
&& argument2);
if (c1 && (c2 ||
c3))
foo;
if (c1 &&
(c2 || c3))
{
}
if ( c1
&& ( c2
|| c3))
foo;
func( c1
&& ( c2
|| c3))
foo;
}
void func(void)
{
if (condition1
&& condition2)
action();
function(argument1
&& argument2);
if (c1 && (c2 ||
c3))
foo;
if (c1 &&
(c2 || c3))
{
}
if ( c1
&& ( c2
|| c3))
foo;
func( c1
&& ( c2
|| c3))
foo;
}
void func(void)
{
if (condition1
&& condition2)
action();
function(argument1
&& argument2);
if (c1 && (c2 ||
c3))
foo;
if (c1 &&
(c2 || c3))
{
}
if (c123456789
&& (c22345
|| c3))
printf("foo\n");
c = c1 &&
(
c2 ||
c3
) && c4;
}
void func(void)
{
if (condition1
&& condition2)
action();
function(argument1
&& argument2);
if (c1 && (c2 ||
c3))
foo;
if (c1 &&
(c2 || c3))
{
}
if (c123456789
&& (c22345
|| c3))
printf("foo\n");
if ( c1
&& ( c2
|| c3))
foo;
a_long_line(
argument,
argument);
a_short_line(argument,
argument);
}
void func(void)
{
if (condition1
&& condition2)
action();
function(argument1
&& argument2);
if (c1 && (c2 ||
c3))
foo;
if (c1 &&
(c2 || c3))
{
}
if (c123456789
&& (c22345
|| c3))
printf("foo\n");
}
void func(void)
{
if (condition1
&& condition2)
action();
function(argument1
&& argument2);
if (c1 && (c2 ||
c3))
foo;
if (c1 &&
(c2 || c3))
{
}
if (c123456789
&& (c22345
|| c3))
printf("foo\n");
if ( c1
&& ( c2
|| c3))
foo;
func( c1
&& ( c2
|| c3))
foo;
}
void func(void)
{
if (condition1
&& condition2)
action();
function(argument1
&& argument2);
if (c1 && (c2 ||
c3))
foo;
if (c1 &&
(c2 || c3))
{
}
}
NAMESPACESTART
/* valid namespaces with normal indent */
namespace

42
src/testdir/test85.in Normal file
View File

@@ -0,0 +1,42 @@
Test for Lua interface and luaeval() function
STARTTEST
:so small.vim
:so lua.vim
:set nocompatible viminfo+=nviminfo
:lua l = vim.list():add"item0":add"dictionary with list OK":add"item2"
:lua h = vim.dict(); h.list = l
:call garbagecollect()
/^1
:" change buffer contents
:lua curbuf = vim.buffer()
:lua curline = vim.eval"line('.')"
:lua curbuf[curline] = "1 changed line 1"
:" scalar test
:let tmp_string = luaeval('"string"')
:let tmp_1000 = luaeval('1000')
:if printf("%s%.0f", tmp_string, tmp_1000) == "string1000"
:let scalar_res = "OK"
:else
:let scalar_res = "FAILED"
:endif
:call append(search("^1"), "scalar test " . scalar_res)
:" dictionary containing a list
:let tmp = luaeval("h").list[1]
:/^2/put =tmp
:" circular list (at the same time test lists containing lists)
:lua l[2] = l
:let l2 = luaeval("h").list
:if l2[2] == l2
:let res = "OK"
:else
:let res = "FAILED"
:endif
:call setline(search("^3"), "circular test " . res)
:?^1?,$w! test.out
:qa!
ENDTEST
1 line 1
2 line 2
3 line 3

5
src/testdir/test85.ok Normal file
View File

@@ -0,0 +1,5 @@
1 changed line 1
scalar test OK
2 line 2
dictionary with list OK
circular test OK

View File

@@ -714,6 +714,42 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
508,
/**/
507,
/**/
506,
/**/
505,
/**/
504,
/**/
503,
/**/
502,
/**/
501,
/**/
500,
/**/
499,
/**/
498,
/**/
497,
/**/
496,
/**/
495,
/**/
494,
/**/
493,
/**/
492,
/**/
491,
/**/
490,
/**/