Compare commits

...

8 Commits

Author SHA1 Message Date
Bram Moolenaar
bd74325960 updated for version 7.3.032
Problem:    maparg() doesn't return the flags, such as <buffer>, <script>,
            <silent>.  These are needed to save and restore a mapping.
Solution:   Improve maparg(). (also by Christian Brabandt)
2010-10-20 21:23:33 +02:00
Bram Moolenaar
727c876b78 updated for version 7.3.031
Problem:    Can't pass the X window ID to another application.
Solution:   Add v:windowid. (Christian J. Robinson, Lech Lorens)
2010-10-20 19:17:48 +02:00
Bram Moolenaar
483c5d80a7 Updated runtime files and translations. 2010-10-20 18:45:33 +02:00
Bram Moolenaar
680eeca955 updated for version 7.3.030
Problem:    Cannot store Dict and List in viminfo file.
Solution:   Add support for this. (Christian Brabandt)
2010-10-20 17:44:42 +02:00
Bram Moolenaar
f75d498844 updated for version 7.3.029
Problem:    ":sort n" sorts lines without a number as number zero. (Beeyawned)
Solution:   Make lines without a number sort before lines with a number.  Also
            fix sorting negative numbers.
2010-10-15 20:20:05 +02:00
Bram Moolenaar
b60574ba21 updated for version 7.3.028
Problem:    Signs don't show up. (Charles Campbell)
Solution:   Don't use negative numbers.  Also assign a number to signs that
            have a name of all digits to avoid using a sign number twice.
2010-10-14 21:29:37 +02:00
Bram Moolenaar
464c92545a updated for version 7.3.027
Problem:    Opening a file on a network share is very slow.
Solution:   When fixing file name case append "\*" to directory, server and
            network share names. (David Anderson, John Beckett)
2010-10-13 20:37:41 +02:00
Bram Moolenaar
77a0aa457d updated for version 7.3.026
Problem:    CTRL-] in a help file doesn't always work. (Tony Mechelynck)
Solution:   Don't escape special characters. (Carlo Teubner)
2010-10-13 18:06:47 +02:00
43 changed files with 627 additions and 294 deletions

View File

@@ -1,7 +1,7 @@
" Vim compiler file
" Compiler: GNU C Compiler
" Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2010-05-30
" Latest Revision: 2010-10-14
if exists("current_compiler")
finish
@@ -18,10 +18,10 @@ CompilerSet errorformat=
\\"%f\"%*\\D%l:\ %m,
\%-G%f:%l:\ %trror:\ (Each\ undeclared\ identifier\ is\ reported\ only\ once,
\%-G%f:%l:\ %trror:\ for\ each\ function\ it\ appears\ in.),
\%f:%l:%c:\ %terror:\ %m,
\%f:%l:%c:\ %trror:\ %m,
\%f:%l:%c:\ %tarning:\ %m,
\%f:%l:%c:\ %m,
\%f:%l:\ %terror:\ %m,
\%f:%l:\ %trror:\ %m,
\%f:%l:\ %tarning:\ %m,
\%f:%l:\ %m,
\\"%f\"\\,\ line\ %l%*\\D%c%*[^\ ]\ %m,

View File

@@ -1,4 +1,4 @@
*eval.txt* For Vim version 7.3. Last change: 2010 Sep 29
*eval.txt* For Vim version 7.3. Last change: 2010 Oct 18
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1657,6 +1657,11 @@ v:version Version number of Vim: Major version number times 100 plus
*v:warningmsg* *warningmsg-variable*
v:warningmsg Last given warning message. It's allowed to set this variable.
*v:windowid* *windowid-variable*
v:windowid When any X11 based GUI is running or when running in a
terminal and Vim connects to the X server (|-X|) this will be
set to the window ID. Otherwise the value is zero.
==============================================================================
4. Builtin Functions *functions*
@@ -1822,7 +1827,7 @@ localtime() Number current time
log( {expr}) Float natural logarithm (base e) of {expr}
log10( {expr}) Float logarithm of Float {expr} to base 10
map( {expr}, {string}) List/Dict change each item in {expr} to {expr}
maparg( {name}[, {mode} [, {abbr}]])
maparg( {name}[, {mode} [, {abbr} [, {dict}]]])
String rhs of mapping {name} in mode {mode}
mapcheck( {name}[, {mode} [, {abbr}]])
String check for mappings matching {name}
@@ -1934,6 +1939,7 @@ synID( {lnum}, {col}, {trans}) Number syntax ID at {lnum} and {col}
synIDattr( {synID}, {what} [, {mode}])
String attribute {what} of syntax ID {synID}
synIDtrans( {synID}) Number translated syntax ID of {synID}
synconcealed( {lnum}, {col}) List info about concealing
synstack( {lnum}, {col}) List stack of syntax IDs at {lnum} and {col}
system( {expr} [, {input}]) String output of shell command/filter {expr}
tabpagebuflist( [{arg}]) List list of buffer numbers in tab page
@@ -3966,23 +3972,51 @@ map({expr}, {string}) *map()*
further items in {expr} are processed.
maparg({name}[, {mode} [, {abbr}]]) *maparg()*
Return the rhs of mapping {name} in mode {mode}. When there
is no mapping for {name}, an empty String is returned.
maparg({name}[, {mode} [, {abbr} [, {dict}]]]) *maparg()*
When {dict} is omitted or zero: Return the rhs of mapping
{name} in mode {mode}. The returned String has special
characters translated like in the output of the ":map" command
listing.
When there is no mapping for {name}, an empty String is
returned.
The {name} can have special key names, like in the ":map"
command.
{mode} can be one of these strings:
"n" Normal
"v" Visual
"v" Visual (including Select)
"o" Operator-pending
"i" Insert
"c" Cmd-line
"s" Select
"x" Visual
"l" langmap |language-mapping|
"" Normal, Visual and Operator-pending
When {mode} is omitted, the modes for "" are used.
When {abbr} is there and it is non-zero use abbreviations
instead of mappings.
The {name} can have special key names, like in the ":map"
command. The returned String has special characters
translated like in the output of the ":map" command listing.
When {dict} is there and it is non-zero return a dictionary
containing all the information of the mapping with the
following items:
"lhs" The {lhs} of the mapping.
"rhs" The {rhs} of the mapping as typed.
"silent" 1 for a |:map-silent| mapping, else 0.
"noremap" 1 if the {rhs} of the mapping is remappable.
"expr" 1 for an expression mapping (|:map-<expr>|).
"buffer" 1 for a buffer local mapping (|:map-local|).
"mode" Modes for which the mapping is defined. In
addition to the modes mentioned above, these
characters will be used:
" " Normal, Visual and Operator-pending
"!" Insert and Commandline mode
(|mapmpde-ic|)
"sid" the Script local ID, used for <sid> mappings
(|<SID>|)
The mappings local to the current buffer are checked first,
then the global mappings.
This function can be used to map a key even when it's already
@@ -5558,20 +5592,6 @@ synID({lnum}, {col}, {trans}) *synID()*
:echo synIDattr(synID(line("."), col("."), 1), "name")
<
synconcealed({lnum}, {col}) *synconcealed()*
The result is a List. The first item in the list is 0 if the
character at the position {lnum} and {col} is not part of a
concealable region, 1 if it is. The second item in the list is
a string. If the first item is 1, the second item contains the
text which will be displayed in place of the concealed text,
depending on the current setting of 'conceallevel'. The third
and final item in the list is a unique number representing the
specific syntax region matched. This allows detection of the
beginning of a new concealable region if there are two
consecutive regions with the same replacement character.
For an example use see $VIMRUNTIME/syntax/2html.vim .
synIDattr({synID}, {what} [, {mode}]) *synIDattr()*
The result is a String, which is the {what} attribute of
syntax ID {synID}. This can be used to obtain information
@@ -5612,6 +5632,20 @@ synIDtrans({synID}) *synIDtrans()*
highlight the character. Highlight links given with
":highlight link" are followed.
synconcealed({lnum}, {col}) *synconcealed()*
The result is a List. The first item in the list is 0 if the
character at the position {lnum} and {col} is not part of a
concealable region, 1 if it is. The second item in the list is
a string. If the first item is 1, the second item contains the
text which will be displayed in place of the concealed text,
depending on the current setting of 'conceallevel'. The third
and final item in the list is a unique number representing the
specific syntax region matched. This allows detection of the
beginning of a new concealable region if there are two
consecutive regions with the same replacement character.
For an example use see $VIMRUNTIME/syntax/2html.vim .
synstack({lnum}, {col}) *synstack()*
Return a |List|, which is the stack of syntax items at the
position {lnum} and {col} in the current window. Each item in

View File

@@ -1,4 +1,4 @@
*if_pyth.txt* For Vim version 7.3. Last change: 2010 Aug 13
*if_pyth.txt* For Vim version 7.3. Last change: 2010 Oct 20
VIM REFERENCE MANUAL by Paul Moore
@@ -355,7 +355,7 @@ When Python 2 and Python 3 are both supported they must be loaded dynamically.
When doing this on Linux/Unix systems and importing global symbols, this leads
to a crash when the second Python version is used. So either global symbols
are loaded but only one Python version is activated, or no global symbols are
loaded. The latter makes Python's "import" fail on libaries that expect the
loaded. The latter makes Python's "import" fail on libraries that expect the
symbols to be provided by Vim.
*E836* *E837*
Vim's configuration script makes a guess for all libraries based on one

View File

@@ -1,4 +1,4 @@
*options.txt* For Vim version 7.3. Last change: 2010 Sep 21
*options.txt* For Vim version 7.3. Last change: 2010 Oct 20
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1496,6 +1496,25 @@ A jump table for the options with a short description can be found at |Q_op|.
feature}
Number of screen lines to use for the command-line window. |cmdwin|
*'colorcolumn'* *'cc'*
'colorcolumn' 'cc' string (default "")
local to window
{not in Vi}
{not available when compiled without the |+syntax|
feature}
'colorcolumn' is a comma separated list of screen columns that are
highlighted with ColorColumn |hl-ColorColumn|. Useful to align
text. Will make screen redrawing slower.
The screen column can be an absolute number, or a number preceded with
'+' or '-', which is added to or subtracted from 'textwidth'. >
:set cc=+1 " highlight column after 'textwidth'
:set cc=+1,+2,+3 " highlight three columns after 'textwidth'
:hi ColorColumn ctermbg=lightgrey guibg=lightgrey
<
When 'textwidth' is zero then the items with '-' and '+' are not used.
A maximum of 256 columns are highlighted.
*'columns'* *'co'* *E594*
'columns' 'co' number (default 80 or terminal width)
global
@@ -4601,25 +4620,6 @@ A jump table for the options with a short description can be found at |Q_op|.
< This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
*'colorcolumn'* *'cc'*
'colorcolumn' 'cc' string (default "")
local to window
{not in Vi}
{not available when compiled without the |+syntax|
feature}
'colorcolumn' is a comma separated list of screen columns that are
highlighted with ColorColumn |hl-ColorColumn|. Useful to align
text. Will make screen redrawing slower.
The screen column can be an absolute number, or a number preceded with
'+' or '-', which is added to or subtracted from 'textwidth'. >
:set cc=+1 " highlight column after 'textwidth'
:set cc=+1,+2,+3 " highlight three columns after 'textwidth'
:hi ColorColumn ctermbg=lightgrey guibg=lightgrey
<
When 'textwidth' is zero then the items with '-' and '+' are not used.
A maximum of 256 columns are highlighted.
*'matchpairs'* *'mps'*
'matchpairs' 'mps' string (default "(:),{:},[:]")
local to buffer
@@ -7530,8 +7530,9 @@ A jump table for the options with a short description can be found at |Q_op|.
! When included, save and restore global variables that start
with an uppercase letter, and don't contain a lowercase
letter. Thus "KEEPTHIS and "K_L_M" are stored, but "KeepThis"
and "_K_L_M" are not. Only String and Number types are
stored.
and "_K_L_M" are not. Nested List and Dict items may not be
read back correctly, you end up with a string representation
instead.
" Maximum number of lines saved for each register. Old name of
the '<' item, with the disadvantage that you need to put a
backslash before the ", otherwise it will be recognized as the

View File

@@ -1,4 +1,4 @@
*quickfix.txt* For Vim version 7.3. Last change: 2010 Jul 20
*quickfix.txt* For Vim version 7.3. Last change: 2010 Oct 20
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -546,6 +546,14 @@ descriptors when searching many files. However, when the |:hide| command
modifier is used the buffers are kept loaded. This makes following searches
in the same files a lot faster.
Note that |:copen| (or |:lopen| for |:lgrep|) may be used to open a buffer
containing the search results in linked form. The |:silent| command may be
used to suppress the default full screen grep output. The |:grep!| form of
the |:grep| command doesn't jump to the first match automatically. These
commands can be combined to create a NewGrep command: >
command! -nargs=+ NewGrep execute 'silent grep! <args>' | copen 42
5.1 using Vim's internal grep

View File

@@ -1,4 +1,4 @@
*sign.txt* For Vim version 7.3. Last change: 2010 May 07
*sign.txt* For Vim version 7.3. Last change: 2010 Oct 14
VIM REFERENCE MANUAL by Gordon Prieur
@@ -70,7 +70,8 @@ DEFINING A SIGN. *:sign-define* *E255* *E160* *E612*
:sign define {name} {argument}...
Define a new sign or set attributes for an existing sign.
The {name} can either be a number (all digits) or a name
starting with a non-digit.
starting with a non-digit. Leading digits are ignored, thus
"0012", "012" and "12" are considered the same name.
About 120 different signs can be defined.
Accepted arguments:

View File

@@ -1,4 +1,4 @@
*todo.txt* For Vim version 7.3. Last change: 2010 Sep 29
*todo.txt* For Vim version 7.3. Last change: 2010 Oct 20
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -30,21 +30,9 @@ be worked on, but only if you sponsor Vim development. See |sponsor|.
*known-bugs*
-------------------- Known bugs and current work -----------------------
Cursor position wrong when 'formatoptions' contains "a". (Moshe Kamensky, 2010
Sep 7, Gary Johnson, 2010 Sep 14)
Formatoptions cause cursor to jump. (ZyX, 2010 Aug 22)
Caused by revision 2294, "Make joining a range of lines much faster. (Milan
Vancura)" ?
Patch by Carlo Teubner, 2010 Sep 25. Test Sep 26.
'cursorline' is displayed too short when there are concealed characters and
'list' is set, 'listchars' at default value. (Dennis Preiser, 2010 Aug 15)
Hang on slave PTY on Mac. Patch from Nikola Knezevic, 2010 Aug 29.
Patch to fix sign type negative and memory not freed. (Xavier de Gaye, 2010
Aug 20)
Conceal: using Tab for cchar causes problems. Should reject it. (ZyX, 2010
Aug 25)
@@ -52,24 +40,14 @@ Syntax region with 'concealends' and a 'cchar' value, 'conceallevel' set to 2,
only one of the two ends gets the cchar displayed. (Brett Stahlman, 2010 Aug
21, Ben Fritz, 2010 Sep 14)
Patch for :mksession not escaping file name properly. (Peter Odding, 2010 Sep
19)
Patch for CTRL-] in help file doing wrong escaping. (Carlo Teubner, 2010 Sep
25)
Patch to support List and Dict in .viminfo. (Christian Brabandt, 2010 Sep 24)
Sep 26 with a test.
Patch for :grep docs. (Britton Kerin, 2010 Aug 31)
Patch for dynamic loading Ruby on Unix. (Jon, 2010 Aug 23)
Included, but also need a change to configure.
Replacement R syntax file. (Jakson A. Aquino, 2010 Sep 29)
Windows keys not set properly on Windows 7? (cncyber, 2010 Aug 26)
This line hangs Vim, because of syntax HL:
call append(line, "INFO ....12....18....24....30....36....42....48....54....60....66....72....78%$")
Patch to add v:windowid. (Christian J. Robinson, 2010 Oct 13, update by Lech
Lorens, Oct 14)
maparg() doesn't return the flags, such as <buffer>, <script>, <silent>.
These are needed to save and restore a mapping.
Also: the rhs string is not always correct. (Hari Krishna Dara, 2009 Sept 29)
@@ -80,6 +58,10 @@ build. (Bill Lam, 2010 Sep 18)
Bug: E685 error for func_unref(). (ZyX, 2010 Aug 5)
Using ":break" or something else that stops executing commands inside a
":finally" does not rethrow a previously uncaught exception. (ZyX, 2010 Oct
15)
Patch to fix warning for accessing mediumVersion. (Dominique Pelle, 2010 Aug
18)
@@ -87,24 +69,42 @@ Patch for 2html to support 'fileencoding'. (Benjamin Fritz, 2010 Sep 10)
Patch to use 'previewheight' for popup menu. (Benjamin Haskell, 2010 Sep 29)
CTRL-] on help tag |/[\n]| doesn't jump to the right place. (Tony Mechelynck,
2010 Aug 8)
Three patches for undo persistence. (Christian Brabandt, 2010 Sep 4)
ml_get error for using :copen in a custom complete function. (Xavier
Deguillard, 2010 Oct 19) Other way to reproduce it by Lech Lorens, Oct 20.
string() can't parse back "inf" and "nan". Fix documentation or fix code?
(ZyX, 2010 Aug 23)
Patch to use "--as-needed" instead of the link.sh functionality. (Kirill A.
Shutemov, 2010 Aug 25)
Patch to fix complete(). (Kikuchan, 2010 Oct 15)
Ruby: Patch to load Gem module. Why is this needed? (Yasuhiro Matsumoto, 2010
Oct 6)
":command Print echo 'print'" works, but ":Print" doesn't. Builtin Print
should be overruled. (Aaron Thoma)
Patch by Christian Brabandt, 2010 Sep 5.
Comparing recursive structure loops forever. (ZyX, 2010 Aug 22, info from John
Beckett Aug 23)
Patch from Christian Brabandt, 2010 Oct 2
":drop" does not respect 'autochdir'. (Peter Odding, 2010 Jul 24)
Patch from Benjamin Fritz, 2010 Oct 13.
Highlighting stops working after changing it many times. Script to reproduce
it: Pablo Contreras, 2010 Oct 12 Windows XP and 7. Font is never freed?
GTK: drawing a double-width combining character over single-width characters
doesn't look right. (Dominique Pelle, 2010 Aug 8)
Using ":call" inside "if 0" does not see that a function returns a Dict and
gives error for "." as string concatenation. (Yasuhiro Matsumoto, 2010 Oct 20)
Copy/paste between Vim and Google chrome doesn't work well for multi-byte
characters. (Ben Haskell, 2010 Sep 17)
When putting text in the cut buffer (when exiting) and conversion doesn't work
@@ -115,9 +115,17 @@ clear why it doesn't work.
Editing a file with a ^M with 'ff' set to "mac", opening a help file, then the
^M is displayed as ^J sometimes. Getting 'ff' value from wrong window/buffer?
Patch to add 'systemencoding', convert between 'encoding' and this for file
names, shell commands and the like. (Kikuchan, 2010 Oct 14)
Assume the system converts between the actual encoding of the filesystem to
the system encoding (usually utf-8).
Problem producing tags file when hebrew.frx is present. It has a BOM.
Results in E670. (Tony Mechelynck, 2010 May 2)
Patch for dynamic loading Ruby on Unix. (Jon, 2010 Aug 23)
Included, but also need a change to configure.
setpos() does not restore cursor position after :normal. (Tyru, 2010 Aug 11)
getpos()/setpos() don't include curswant. getpos() could return a fifth
@@ -127,13 +135,12 @@ and that it's documented.
Messages in message.txt are highlighted as examples.
Win32: Patch to fix slow access over network (David Anderson). Cleaned up by
John Beckett, 2010 Aug 25.
Test 73 fails on MS-Windows when compiled with DJGPP and run twice. How to
delete the Xfind directory? Add an rmdir() function, just like we have
mkdir().
":echo "\x85" =~# '[\u0085]'" returns 1 instead of 0. (ZyX, 2010 Oct 3)
'cindent' not correct when 'list' is set. (Zdravi Korusef, 2010 Apr 15)
Windows installer: licence text should not use indent, causes bad word wrap.
@@ -156,8 +163,6 @@ Patch: Let rare word highlighting overrule good word highlighting.
Patch to make more characters work in dialogs. (Yankwei Jia, 2010 Aug 4)
":drop" does not respect 'autochdir'. (Peter Odding, 2010 Jul 24)
When 'lines' is 25 and 'scrolloff' is 12, "j" scrolls zero or two lines
instead of one. (Constantin Pan, 2010 Sep 10)
@@ -196,6 +201,8 @@ Shell not recognized properly if it ends in "csh -f". (James Vega, 2009 Nov 3)
Find tail? Might have a / in argument. Find space? Might have space in
path.
":sort n" treats empty line as higher than zero. (Beeyawned, 2010 Oct 13)
":function f(x) keepjumps" creates a function where every command is executed
like it has ":keepjumps" before it.
@@ -364,6 +371,10 @@ perhaps. And undo CTRL-W. CTRL-G l would redo.
Diff mode out of sync. (Gary Johnson, 2010 Aug 4)
Support a 'systemencoding' option (for Unix). It specifies the encoding of
file names. (Kikuchan, 2010 Oct 5). Useful on a latin1 or double-byte Asian
system when 'encoding' is "utf-8".
Win32: A --remote command that has a directory name starting with a ( doesn't
work, the backslash is removed, assuming that it escapes the (. (Valery
Kondakoff, 2009 May 13)

View File

@@ -1,4 +1,4 @@
*version7.txt* For Vim version 7.3. Last change: 2010 Aug 15
*version7.txt* For Vim version 7.3. Last change: 2010 Oct 20
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -8180,7 +8180,7 @@ Solution: Use get_cmdline_type(). (James Vega)
Files: src/ex_getln.c
Patch 7.2.130
Problem: Vim may haing until CTRL-C is typed when using CTRL-Z.
Problem: Vim may hang until CTRL-C is typed when using CTRL-Z.
Solution: Avoid using pause(). Also use "volatile" for variables used in
signal functions. (Dominique Pelle)
Files: src/auto/configure, src/configure.in, src/config.h.in,

View File

@@ -1,4 +1,4 @@
*vi_diff.txt* For Vim version 7.3. Last change: 2010 Sep 25
*vi_diff.txt* For Vim version 7.3. Last change: 2010 Oct 11
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -989,6 +989,8 @@ These are remarks about running the POSIX test suite:
- vi test 33 sometimes fails for unknown reasons
- vi test 250 fails; behavior will be changed in a new revision
http://www.opengroup.org/austin/mailarchives/ag-review/msg01710.html
(link no longer works, perhaps it's now:
https://www.opengroup.org/sophocles/show_mail.tpl?CALLER=show_archive.tpl&source=L&listname=austin-review-l&id=1711)
- vi test 310 fails; exit code non-zero when any error occurred?
- ex test 24 fails because test is wrong. Changed between SUSv2 and SUSv3.
- ex tests 47, 48, 49, 72, 73 fail because .exrc file isn't read in silent

View File

@@ -1,7 +1,7 @@
" Vim filetype plugin file
" Language: generic Changelog file
" Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2009-05-25
" Latest Revision: 2010-08-17
" Variables:
" g:changelog_timeformat (deprecated: use g:changelog_dateformat instead) -
" description: the timeformat used in ChangeLog entries.
@@ -170,7 +170,7 @@ if &filetype == 'changelog'
endfunction
" Internal function to create a new entry in the ChangeLog.
function! s:new_changelog_entry()
function! s:new_changelog_entry(...)
" Deal with 'paste' option.
let save_paste = &paste
let &paste = 1

View File

@@ -0,0 +1,22 @@
" Vim filetype plugin file
" Language: DocBook
" Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2010-10-14
if exists('b:did_ftplugin')
finish
endif
if !exists('b:docbk_type')
if expand('%:e') == 'sgml'
let b:docbk_type = 'sgml'
else
let b:docbk_type = 'xml'
endif
endif
if b:docbk_type == 'sgml'
runtime! ftplugin/sgml.vim ftplugin/sgml_*.vim ftplugin/sgml/*.vim
else
runtime! ftplugin/xml.vim ftplugin/xml_*.vim ftplugin/xml/*.vim
endif

View File

@@ -1,7 +1,7 @@
" Vim syntax file
" Language: gpg(1) configuration file
" Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2007-06-17
" Latest Revision: 2010-10-14
if exists("b:current_syntax")
finish
@@ -54,7 +54,7 @@ syn keyword gpgOption contained skipwhite nextgroup=gpgArg
\ personal-digest-preferences photo-viewer
\ recipient s2k-cipher-algo s2k-digest-algo s2k-mode
\ secret-keyring set-filename set-policy-url status-fd
\ trusted-key verify-options
\ trusted-key verify-options keyid-format list-options
syn keyword gpgOption contained skipwhite nextgroup=gpgArgError
\ allow-freeform-uid allow-non-selfsigned-uid
\ allow-secret-key-import always-trust

View File

@@ -1,111 +1,137 @@
" Vim syntax file
" Language: R (GNU S)
" Maintainer: Vaidotas Zemlys <zemlys@gmail.com>
" Last Change: 2006 Apr 30
" Filenames: *.R *.Rout *.r *.Rhistory *.Rt *.Rout.save *.Rout.fail
" URL: http://uosis.mif.vu.lt/~zemlys/vim-syntax/r.vim
" Language: R (GNU S)
" Maintainer: Jakson Aquino <jalvesaq@gmail.com>
" Former Maintainers: Vaidotas Zemlys <zemlys@gmail.com>
" Tom Payne <tom@tompayne.org>
" Last Change: Wed Sep 29, 2010 09:31AM
" Filenames: *.R *.r *.Rhistory *.Rt
"
" NOTE: The highlighting of R functions is defined in the
" r-plugin/functions.vim, which is part of vim-r-plugin2:
" http://www.vim.org/scripts/script.php?script_id=2628
"
" Some lines of code were borrowed from Zhuojun Chen.
" First maintainer Tom Payne <tom@tompayne.org>
" Modified to make syntax less colourful and added the highlighting of
" R assignment arrow
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
if exists("b:current_syntax")
finish
endif
if version >= 600
setlocal iskeyword=@,48-57,_,.
else
set iskeyword=@,48-57,_,.
endif
setlocal iskeyword=@,48-57,_,.
syn case match
" Comment
syn match rComment /\#.*/
syn match rComment contains=@Spell "\#.*"
" Constant
" string enclosed in double quotes
syn region rString start=/"/ skip=/\\\\\|\\"/ end=/"/
syn region rString contains=rSpecial,rStrError,@Spell start=/"/ skip=/\\\\\|\\"/ end=/"/
" string enclosed in single quotes
syn region rString start=/'/ skip=/\\\\\|\\'/ end=/'/
" number with no fractional part or exponent
syn match rNumber /\d\+/
" floating point number with integer and fractional parts and optional exponent
syn match rFloat /\d\+\.\d*\([Ee][-+]\=\d\+\)\=/
" floating point number with no integer part and optional exponent
syn match rFloat /\.\d\+\([Ee][-+]\=\d\+\)\=/
" floating point number with no fractional part and optional exponent
syn match rFloat /\d\+[Ee][-+]\=\d\+/
syn region rString contains=rSpecial,rStrError,@Spell start=/'/ skip=/\\\\\|\\'/ end=/'/
" Identifier
" identifier with leading letter and optional following keyword characters
syn match rIdentifier /\a\k*/
" identifier with leading period, one or more digits, and at least one non-digit keyword character
syn match rIdentifier /\.\d*\K\k*/
syn match rStrError display contained "\\."
" New line, carriage return, tab, backspace, bell, feed, vertical tab, backslash
syn match rSpecial display contained "\\\(n\|r\|t\|b\|a\|f\|v\|'\|\"\)\|\\\\"
" Hexadecimal and Octal digits
syn match rSpecial display contained "\\\(x\x\{1,2}\|[0-8]\{1,3}\)"
" Unicode characters
syn match rSpecial display contained "\\u\x\{1,4}"
syn match rSpecial display contained "\\U\x\{1,8}"
syn match rSpecial display contained "\\u{\x\{1,4}}"
syn match rSpecial display contained "\\U{\x\{1,8}}"
syn match rDollar "\$"
" Statement
syn keyword rStatement break next return
syn keyword rConditional if else
syn keyword rRepeat for in repeat while
" Constant (not really)
syn keyword rConstant T F LETTERS letters month.ab month.name pi
syn keyword rConstant R.version.string
" Constant
syn keyword rConstant LETTERS letters month.ab month.name pi
syn keyword rConstant NULL
syn keyword rBoolean FALSE TRUE
syn keyword rNumber NA
syn match rArrow /<\{1,2}-/
syn keyword rNumber NA NA_integer_ NA_real_ NA_complex_ NA_character_
syn keyword rNumber Inf NaN
" Type
syn keyword rType array category character complex double function integer list logical matrix numeric vector data.frame
" integer
syn match rInteger "\<\d\+L"
syn match rInteger "\<0x\([0-9]\|[a-f]\|[A-F]\)\+L"
syn match rInteger "\<\d\+[Ee]+\=\d\+L"
syn match rOperator "[\*\!\&\+\-\<\>\=\^\|\~\`/:@]"
syn match rOperator "%\{2}\|%\*%\|%\/%\|%in%\|%o%\|%x%"
syn match rComplex "\<\d\+i"
syn match rComplex "\<0x\([0-9]\|[a-f]\|[A-F]\)\+i"
syn match rComplex "\<\d\+\.\d*\([Ee][-+]\=\d\+\)\=i"
syn match rComplex "\<\.\d\+\([Ee][-+]\=\d\+\)\=i"
syn match rComplex "\<\d\+[Ee][-+]\=\d\+i"
" number with no fractional part or exponent
syn match rNumber "\<\d\+\>"
" hexadecimal number
syn match rNumber "\<0x\([0-9]\|[a-f]\|[A-F]\)\+"
" floating point number with integer and fractional parts and optional exponent
syn match rFloat "\<\d\+\.\d*\([Ee][-+]\=\d\+\)\="
" floating point number with no integer part and optional exponent
syn match rFloat "\<\.\d\+\([Ee][-+]\=\d\+\)\="
" floating point number with no fractional part and optional exponent
syn match rFloat "\<\d\+[Ee][-+]\=\d\+"
syn match rArrow "<\{1,2}-"
syn match rArrow "->\{1,2}"
" Special
syn match rDelimiter /[,;:]/
syn match rDelimiter "[,;:]"
" Error
syn region rRegion matchgroup=Delimiter start=/(/ matchgroup=Delimiter end=/)/ transparent contains=ALLBUT,rError,rBraceError,rCurlyError
syn region rRegion matchgroup=Delimiter start=/{/ matchgroup=Delimiter end=/}/ transparent contains=ALLBUT,rError,rBraceError,rParenError
syn region rRegion matchgroup=Delimiter start=/\[/ matchgroup=Delimiter end=/]/ transparent contains=ALLBUT,rError,rCurlyError,rParenError
syn match rError /[)\]}]/
syn match rBraceError /[)}]/ contained
syn match rCurlyError /[)\]]/ contained
syn match rParenError /[\]}]/ contained
syn match rError "[)\]}]"
syn match rBraceError "[)}]" contained
syn match rCurlyError "[)\]]" contained
syn match rParenError "[\]}]" contained
" Functions that may add new objects
syn keyword rPreProc library require attach detach source
" Type
syn keyword rType array category character complex double function integer list logical matrix numeric vector data.frame
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_r_syn_inits")
if version < 508
let did_r_syn_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HiLink rComment Comment
HiLink rConstant Constant
HiLink rString String
HiLink rNumber Number
HiLink rBoolean Boolean
HiLink rFloat Float
HiLink rStatement Statement
HiLink rConditional Conditional
HiLink rRepeat Repeat
HiLink rIdentifier Normal
HiLink rArrow Statement
HiLink rType Type
HiLink rDelimiter Delimiter
HiLink rError Error
HiLink rBraceError Error
HiLink rCurlyError Error
HiLink rParenError Error
delcommand HiLink
endif
hi def link rArrow Statement
hi def link rBoolean Boolean
hi def link rBraceError Error
hi def link rComment Comment
hi def link rComplex Number
hi def link rConditional Conditional
hi def link rConstant Constant
hi def link rCurlyError Error
hi def link rDelimiter Delimiter
hi def link rDollar SpecialChar
hi def link rError Error
hi def link rFloat Float
hi def link rInteger Number
hi def link rNumber Number
hi def link rOperator Operator
hi def link rParenError Error
hi def link rPreProc PreProc
hi def link rRepeat Repeat
hi def link rSpecial SpecialChar
hi def link rStatement Statement
hi def link rString String
hi def link rStrError Error
hi def link rType Type
let b:current_syntax="r"
" vim: ts=8 sw=2

View File

@@ -2,7 +2,7 @@
" Language: YAML (YAML Ain't Markup Language) 1.2
" Maintainer: Nikolai Pavlov <zyx.vim@gmail.com>
" First author: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2010-09-16
" Latest Revision: 2010-10-08
if exists('b:current_syntax')
finish
@@ -124,7 +124,7 @@ syn match yamlConstant '\<\~\>'
syn match yamlTimestamp /\%([\[\]{}, \t]\@!\p\)\@<!\%(\d\{4}-\d\d\=-\d\d\=\%(\%([Tt]\|\s\+\)\%(\d\d\=\):\%(\d\d\):\%(\d\d\)\%(\.\%(\d*\)\)\=\%(\s*\%(Z\|[+-]\d\d\=\%(:\d\d\)\=\)\)\=\)\=\)\%([\[\]{}, \t]\@!\p\)\@!/
syn match yamlInteger /\%([\[\]{}, \t]\@!\p\)\@<!\%([+-]\=\%(0\%(b[0-1_]\+\|[0-7_]\+\|x[0-9a-fA-F_]\+\)\=\|\%([1-9][0-9_]*\%(:[0-5]\=\d\)\+\)\)\)\%([\[\]{}, \t]\@!\p\)\@!/
syn match yamlInteger /\%([\[\]{}, \t]\@!\p\)\@<!\%([+-]\=\%(0\%(b[0-1_]\+\|[0-7_]\+\|x[0-9a-fA-F_]\+\)\=\|\%([1-9][0-9_]*\%(:[0-5]\=\d\)\+\)\)\|[1-9][0-9_]*\)\%([\[\]{}, \t]\@!\p\)\@!/
syn match yamlFloat /\%([\[\]{}, \t]\@!\p\)\@<!\%([+-]\=\%(\%(\d[0-9_]*\)\.[0-9_]*\%([eE][+-]\d\+\)\=\|\.[0-9_]\+\%([eE][-+][0-9]\+\)\=\|\d[0-9_]*\%(:[0-5]\=\d\)\+\.[0-9_]*\|\.\%(inf\|Inf\|INF\)\)\|\%(\.\%(nan\|NaN\|NAN\)\)\)\%([\[\]{}, \t]\@!\p\)\@!/
execute 'syn match yamlNodeTag '.string(s:c_ns_tag_property)

View File

@@ -362,6 +362,7 @@ static struct vimvar
{VV_NAME("operator", VAR_STRING), VV_RO},
{VV_NAME("searchforward", VAR_NUMBER), 0},
{VV_NAME("oldfiles", VAR_LIST), 0},
{VV_NAME("windowid", VAR_NUMBER), VV_RO},
};
/* shorthand */
@@ -7803,7 +7804,7 @@ static struct fst
{"log10", 1, 1, f_log10},
#endif
{"map", 2, 2, f_map},
{"maparg", 1, 3, f_maparg},
{"maparg", 1, 4, f_maparg},
{"mapcheck", 1, 3, f_mapcheck},
{"match", 2, 4, f_match},
{"matchadd", 2, 4, f_matchadd},
@@ -13291,8 +13292,10 @@ get_maparg(argvars, rettv, exact)
char_u *keys_buf = NULL;
char_u *rhs;
int mode;
garray_T ga;
int abbr = FALSE;
int get_dict = FALSE;
mapblock_T *mp;
int buffer_local;
/* return empty string for failure */
rettv->v_type = VAR_STRING;
@@ -13306,7 +13309,11 @@ get_maparg(argvars, rettv, exact)
{
which = get_tv_string_buf_chk(&argvars[1], buf);
if (argvars[2].v_type != VAR_UNKNOWN)
{
abbr = get_tv_number(&argvars[2]);
if (argvars[3].v_type != VAR_UNKNOWN)
get_dict = get_tv_number(&argvars[3]);
}
}
else
which = (char_u *)"";
@@ -13316,19 +13323,34 @@ get_maparg(argvars, rettv, exact)
mode = get_map_mode(&which, 0);
keys = replace_termcodes(keys, &keys_buf, TRUE, TRUE, FALSE);
rhs = check_map(keys, mode, exact, FALSE, abbr);
rhs = check_map(keys, mode, exact, FALSE, abbr, &mp, &buffer_local);
vim_free(keys_buf);
if (rhs != NULL)
if (!get_dict)
{
ga_init(&ga);
ga.ga_itemsize = 1;
ga.ga_growsize = 40;
/* Return a string. */
if (rhs != NULL)
rettv->vval.v_string = str2special_save(rhs, FALSE);
while (*rhs != NUL)
ga_concat(&ga, str2special(&rhs, FALSE));
}
else if (rettv_dict_alloc(rettv) != FAIL && rhs != NULL)
{
/* Return a dictionary. */
char_u *lhs = str2special_save(mp->m_keys, TRUE);
char_u *mapmode = map_mode_to_chars(mp->m_mode);
dict_T *dict = rettv->vval.v_dict;
ga_append(&ga, NUL);
rettv->vval.v_string = (char_u *)ga.ga_data;
dict_add_nr_str(dict, "lhs", 0L, lhs);
dict_add_nr_str(dict, "rhs", 0L, mp->m_orig_str);
dict_add_nr_str(dict, "noremap", mp->m_noremap ? 1L : 0L , NULL);
dict_add_nr_str(dict, "expr", mp->m_expr ? 1L : 0L, NULL);
dict_add_nr_str(dict, "silent", mp->m_silent ? 1L : 0L, NULL);
dict_add_nr_str(dict, "sid", (long)mp->m_script_ID, NULL);
dict_add_nr_str(dict, "buffer", (long)buffer_local, NULL);
dict_add_nr_str(dict, "mode", 0L, mapmode);
vim_free(lhs);
vim_free(mapmode);
}
}
@@ -22520,18 +22542,21 @@ read_viminfo_varlist(virp, writing)
if (tab != NULL)
{
*tab++ = '\0'; /* isolate the variable name */
if (*tab == 'S') /* string var */
type = VAR_STRING;
switch (*tab)
{
case 'S': type = VAR_STRING; break;
#ifdef FEAT_FLOAT
else if (*tab == 'F')
type = VAR_FLOAT;
case 'F': type = VAR_FLOAT; break;
#endif
case 'D': type = VAR_DICT; break;
case 'L': type = VAR_LIST; break;
}
tab = vim_strchr(tab, '\t');
if (tab != NULL)
{
tv.v_type = type;
if (type == VAR_STRING)
if (type == VAR_STRING || type == VAR_DICT || type == VAR_LIST)
tv.vval.v_string = viminfo_readstring(virp,
(int)(tab - virp->vir_line + 1), TRUE);
#ifdef FEAT_FLOAT
@@ -22540,9 +22565,27 @@ read_viminfo_varlist(virp, writing)
#endif
else
tv.vval.v_number = atol((char *)tab + 1);
if (type == VAR_DICT || type == VAR_LIST)
{
typval_T *etv = eval_expr(tv.vval.v_string, NULL);
if (etv == NULL)
/* Failed to parse back the dict or list, use it as a
* string. */
tv.v_type = VAR_STRING;
else
{
vim_free(tv.vval.v_string);
tv = *etv;
}
}
set_var(virp->vir_line + 1, &tv, FALSE);
if (type == VAR_STRING)
if (tv.v_type == VAR_STRING)
vim_free(tv.vval.v_string);
else if (tv.v_type == VAR_DICT || tv.v_type == VAR_LIST)
clear_tv(&tv);
}
}
}
@@ -22584,8 +22627,10 @@ write_viminfo_varlist(fp)
case VAR_STRING: s = "STR"; break;
case VAR_NUMBER: s = "NUM"; break;
#ifdef FEAT_FLOAT
case VAR_FLOAT: s = "FLO"; break;
case VAR_FLOAT: s = "FLO"; break;
#endif
case VAR_DICT: s = "DIC"; break;
case VAR_LIST: s = "LIS"; break;
default: continue;
}
fprintf(fp, "!%s\t%s\t", this_var->di_key, s);

View File

@@ -323,7 +323,8 @@ sort_compare(s1, s2)
/* When sorting numbers "start_col_nr" is the number, not the column
* number. */
if (sort_nr)
result = l1.start_col_nr - l2.start_col_nr;
result = l1.start_col_nr == l2.start_col_nr ? 0
: l1.start_col_nr > l2.start_col_nr ? 1 : -1;
else
{
/* We need to copy one line into "sortbuf1", because there is no
@@ -482,7 +483,7 @@ ex_sort(eap)
* of the match, by temporarily terminating the string there */
s2 = s + end_col;
c = *s2;
(*s2) = 0;
*s2 = NUL;
/* Sorting on number: Store the number itself. */
p = s + start_col;
if (sort_hex)
@@ -491,9 +492,13 @@ ex_sort(eap)
s = skiptodigit(p);
if (s > p && s[-1] == '-')
--s; /* include preceding negative sign */
vim_str2nr(s, NULL, NULL, sort_oct, sort_hex,
&nrs[lnum - eap->line1].start_col_nr, NULL);
(*s2) = c;
if (*s == NUL)
/* empty line should sort before any number */
nrs[lnum - eap->line1].start_col_nr = -MAXLNUM;
else
vim_str2nr(s, NULL, NULL, sort_oct, sort_hex,
&nrs[lnum - eap->line1].start_col_nr, NULL);
*s2 = c;
}
else
{
@@ -6556,8 +6561,7 @@ typedef struct sign sign_T;
struct sign
{
sign_T *sn_next; /* next sign in list */
int sn_typenr; /* type number of sign (negative if not equal
to name) */
int sn_typenr; /* type number of sign */
char_u *sn_name; /* name of sign */
char_u *sn_icon; /* name of pixmap */
#ifdef FEAT_SIGN_ICONS
@@ -6569,7 +6573,7 @@ struct sign
};
static sign_T *first_sign = NULL;
static int last_sign_typenr = MAX_TYPENR; /* is decremented */
static int next_sign_typenr = 1;
static int sign_cmd_idx __ARGS((char_u *begin_cmd, char_u *end_cmd));
static void sign_list_defined __ARGS((sign_T *sp));
@@ -6651,9 +6655,14 @@ ex_sign(eap)
EMSG(_("E156: Missing sign name"));
else
{
/* Isolate the sign name. If it's a number skip leading zeroes,
* so that "099" and "99" are the same sign. But keep "0". */
p = skiptowhite(arg);
if (*p != NUL)
*p++ = NUL;
while (arg[0] == '0' && arg[1] != NUL)
++arg;
sp_prev = NULL;
for (sp = first_sign; sp != NULL; sp = sp->sn_next)
{
@@ -6666,41 +6675,45 @@ ex_sign(eap)
/* ":sign define {name} ...": define a sign */
if (sp == NULL)
{
sign_T *lp;
int start = next_sign_typenr;
/* Allocate a new sign. */
sp = (sign_T *)alloc_clear((unsigned)sizeof(sign_T));
if (sp == NULL)
return;
/* If the name is a number use that for the typenr,
* otherwise use a negative number. */
if (VIM_ISDIGIT(*arg))
sp->sn_typenr = atoi((char *)arg);
else
/* Check that next_sign_typenr is not already being used.
* This only happens after wrapping around. Hopefully
* another one got deleted and we can use its number. */
for (lp = first_sign; lp != NULL; )
{
sign_T *lp;
int start = last_sign_typenr;
for (lp = first_sign; lp != NULL; lp = lp->sn_next)
if (lp->sn_typenr == next_sign_typenr)
{
if (lp->sn_typenr == -last_sign_typenr)
++next_sign_typenr;
if (next_sign_typenr == MAX_TYPENR)
next_sign_typenr = 1;
if (next_sign_typenr == start)
{
--last_sign_typenr;
if (last_sign_typenr == 0)
last_sign_typenr = MAX_TYPENR;
if (last_sign_typenr == start)
{
vim_free(sp);
EMSG(_("E612: Too many signs defined"));
return;
}
lp = first_sign;
continue;
vim_free(sp);
EMSG(_("E612: Too many signs defined"));
return;
}
lp = first_sign; /* start all over */
continue;
}
lp = lp->sn_next;
}
sp->sn_typenr = -last_sign_typenr;
if (--last_sign_typenr == 0)
last_sign_typenr = MAX_TYPENR; /* wrap around */
sp->sn_typenr = next_sign_typenr;
if (++next_sign_typenr == MAX_TYPENR)
next_sign_typenr = 1; /* wrap around */
sp->sn_name = vim_strsave(arg);
if (sp->sn_name == NULL) /* out of memory */
{
vim_free(sp);
return;
}
/* add the new sign to the list of signs */
@@ -6708,7 +6721,6 @@ ex_sign(eap)
first_sign = sp;
else
sp_prev->sn_next = sp;
sp->sn_name = vim_strnsave(arg, (int)(p - arg));
}
/* set values for a defined sign. */
@@ -6886,6 +6898,8 @@ ex_sign(eap)
arg = skiptowhite(arg);
if (*arg != NUL)
*arg++ = NUL;
while (sign_name[0] == '0' && sign_name[1] != NUL)
++sign_name;
}
else if (STRNCMP(arg, "file=", 5) == 0)
{

View File

@@ -3168,6 +3168,7 @@ do_map(maptype, arg, mode, abbrev)
int expr = FALSE;
#endif
int noremap;
char_u *orig_rhs;
keys = arg;
map_table = maphash;
@@ -3266,6 +3267,7 @@ do_map(maptype, arg, mode, abbrev)
}
if (*p != NUL)
*p++ = NUL;
p = skipwhite(p);
rhs = p;
hasarg = (*rhs != NUL);
@@ -3290,6 +3292,7 @@ do_map(maptype, arg, mode, abbrev)
keys = replace_termcodes(keys, &keys_buf, TRUE, TRUE, special);
if (hasarg)
{
orig_rhs = rhs;
if (STRICMP(rhs, "<nop>") == 0) /* "<Nop>" means nothing */
rhs = (char_u *)"";
else
@@ -3298,7 +3301,7 @@ do_map(maptype, arg, mode, abbrev)
#ifdef FEAT_FKMAP
/*
* when in right-to-left mode and alternate keymap option set,
* When in right-to-left mode and alternate keymap option set,
* reverse the character flow in the rhs in Farsi.
*/
if (p_altkeymap && curwin->w_p_rl)
@@ -3556,6 +3559,8 @@ do_map(maptype, arg, mode, abbrev)
}
vim_free(mp->m_str);
mp->m_str = newstr;
vim_free(mp->m_orig_str);
mp->m_orig_str = vim_strsave(orig_rhs);
mp->m_noremap = noremap;
mp->m_silent = silent;
mp->m_mode = mode;
@@ -3633,10 +3638,12 @@ do_map(maptype, arg, mode, abbrev)
mp->m_keys = vim_strsave(keys);
mp->m_str = vim_strsave(rhs);
mp->m_orig_str = vim_strsave(orig_rhs);
if (mp->m_keys == NULL || mp->m_str == NULL)
{
vim_free(mp->m_keys);
vim_free(mp->m_str);
vim_free(mp->m_orig_str);
vim_free(mp);
retval = 4; /* no mem */
goto theend;
@@ -3682,6 +3689,7 @@ map_free(mpp)
mp = *mpp;
vim_free(mp->m_keys);
vim_free(mp->m_str);
vim_free(mp->m_orig_str);
*mpp = mp->m_next;
vim_free(mp);
}
@@ -3851,12 +3859,57 @@ map_clear_int(buf, mode, local, abbr)
}
}
/*
* Return characters to represent the map mode in an allocated string.
* Returns NULL when out of memory.
*/
char_u *
map_mode_to_chars(mode)
int mode;
{
garray_T mapmode;
ga_init2(&mapmode, 1, 7);
if ((mode & (INSERT + CMDLINE)) == INSERT + CMDLINE)
ga_append(&mapmode, '!'); /* :map! */
else if (mode & INSERT)
ga_append(&mapmode, 'i'); /* :imap */
else if (mode & LANGMAP)
ga_append(&mapmode, 'l'); /* :lmap */
else if (mode & CMDLINE)
ga_append(&mapmode, 'c'); /* :cmap */
else if ((mode & (NORMAL + VISUAL + SELECTMODE + OP_PENDING))
== NORMAL + VISUAL + SELECTMODE + OP_PENDING)
ga_append(&mapmode, ' '); /* :map */
else
{
if (mode & NORMAL)
ga_append(&mapmode, 'n'); /* :nmap */
if (mode & OP_PENDING)
ga_append(&mapmode, 'o'); /* :omap */
if ((mode & (VISUAL + SELECTMODE)) == VISUAL + SELECTMODE)
ga_append(&mapmode, 'v'); /* :vmap */
else
{
if (mode & VISUAL)
ga_append(&mapmode, 'x'); /* :xmap */
if (mode & SELECTMODE)
ga_append(&mapmode, 's'); /* :smap */
}
}
ga_append(&mapmode, NUL);
return (char_u *)mapmode.ga_data;
}
static void
showmap(mp, local)
mapblock_T *mp;
int local; /* TRUE for buffer-local map */
{
int len = 1;
int len = 1;
char_u *mapchars;
if (msg_didout || msg_silent != 0)
{
@@ -3864,49 +3917,15 @@ showmap(mp, local)
if (got_int) /* 'q' typed at MORE prompt */
return;
}
if ((mp->m_mode & (INSERT + CMDLINE)) == INSERT + CMDLINE)
msg_putchar('!'); /* :map! */
else if (mp->m_mode & INSERT)
msg_putchar('i'); /* :imap */
else if (mp->m_mode & LANGMAP)
msg_putchar('l'); /* :lmap */
else if (mp->m_mode & CMDLINE)
msg_putchar('c'); /* :cmap */
else if ((mp->m_mode & (NORMAL + VISUAL + SELECTMODE + OP_PENDING))
== NORMAL + VISUAL + SELECTMODE + OP_PENDING)
msg_putchar(' '); /* :map */
else
mapchars = map_mode_to_chars(mp->m_mode);
if (mapchars != NULL)
{
len = 0;
if (mp->m_mode & NORMAL)
{
msg_putchar('n'); /* :nmap */
++len;
}
if (mp->m_mode & OP_PENDING)
{
msg_putchar('o'); /* :omap */
++len;
}
if ((mp->m_mode & (VISUAL + SELECTMODE)) == VISUAL + SELECTMODE)
{
msg_putchar('v'); /* :vmap */
++len;
}
else
{
if (mp->m_mode & VISUAL)
{
msg_putchar('x'); /* :xmap */
++len;
}
if (mp->m_mode & SELECTMODE)
{
msg_putchar('s'); /* :smap */
++len;
}
}
msg_puts(mapchars);
len = STRLEN(mapchars);
vim_free(mapchars);
}
while (++len <= 3)
msg_putchar(' ');
@@ -3931,8 +3950,7 @@ showmap(mp, local)
msg_putchar(' ');
/* Use FALSE below if we only want things like <Up> to show up as such on
* the rhs, and not M-x etc, TRUE gets both -- webb
*/
* the rhs, and not M-x etc, TRUE gets both -- webb */
if (*mp->m_str == NUL)
msg_puts_attr((char_u *)"<Nop>", hl_attr(HLF_8));
else
@@ -4995,19 +5013,21 @@ check_map_keycodes()
sourcing_name = save_name;
}
#ifdef FEAT_EVAL
#if defined(FEAT_EVAL) || defined(PROTO)
/*
* Check the string "keys" against the lhs of all mappings
* Return pointer to rhs of mapping (mapblock->m_str)
* NULL otherwise
* Check the string "keys" against the lhs of all mappings.
* Return pointer to rhs of mapping (mapblock->m_str).
* NULL when no mapping found.
*/
char_u *
check_map(keys, mode, exact, ign_mod, abbr)
check_map(keys, mode, exact, ign_mod, abbr, mp_ptr, local_ptr)
char_u *keys;
int mode;
int exact; /* require exact match */
int ign_mod; /* ignore preceding modifier */
int abbr; /* do abbreviations */
mapblock_T **mp_ptr; /* return: pointer to mapblock or NULL */
int *local_ptr; /* return: buffer-local mapping or NULL */
{
int hash;
int len, minlen;
@@ -5062,7 +5082,13 @@ check_map(keys, mode, exact, ign_mod, abbr)
minlen = mp->m_keylen - 3;
}
if (STRNCMP(s, keys, minlen) == 0)
{
if (mp_ptr != NULL)
*mp_ptr = mp;
if (local_ptr != NULL)
*local_ptr = local;
return mp->m_str;
}
}
}
}

View File

@@ -105,8 +105,18 @@ gui_start()
#if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11)
if (gui.in_use)
{
# ifdef FEAT_EVAL
Window x11_window;
Display *x11_display;
if (gui_get_x11_windis(&x11_window, &x11_display) == OK)
set_vim_var_nr(VV_WINDOWID, (long)x11_window);
# endif
/* Display error messages in a dialog now. */
display_errors();
}
#endif
#if defined(MAY_FORK) && !defined(__QNXNTO__)

View File

@@ -1810,7 +1810,8 @@ process_message(void)
* mapped we want to use the mapping instead. */
if (vk == VK_F10
&& gui.menu_is_active
&& check_map(k10, State, FALSE, TRUE, FALSE) == NULL)
&& check_map(k10, State, FALSE, TRUE, FALSE,
NULL, NULL) == NULL)
break;
#endif
if (GetKeyState(VK_SHIFT) & 0x8000)
@@ -1924,7 +1925,8 @@ process_message(void)
/* Check for <F10>: Default effect is to select the menu. When <F10> is
* mapped we need to stop it here to avoid strange effects (e.g., for the
* key-up event) */
if (vk != VK_F10 || check_map(k10, State, FALSE, TRUE, FALSE) == NULL)
if (vk != VK_F10 || check_map(k10, State, FALSE, TRUE, FALSE,
NULL, NULL) == NULL)
#endif
DispatchMessage(&msg);
}

View File

@@ -1477,6 +1477,27 @@ msg_outtrans_special(strstart, from)
return retval;
}
#if defined(FEAT_EVAL) || defined(PROTO)
/*
* Return the lhs or rhs of a mapping, with the key codes turned into printable
* strings, in an allocated string.
*/
char_u *
str2special_save(str, is_lhs)
char_u *str;
int is_lhs; /* TRUE for lhs, FALSE for rhs */
{
garray_T ga;
char_u *p = str;
ga_init2(&ga, 1, 40);
while (*p != NUL)
ga_concat(&ga, str2special(&p, is_lhs));
ga_append(&ga, NUL);
return (char_u *)ga.ga_data;
}
#endif
/*
* Return the printable string for the key codes at "*sp".
* Used for translating the lhs or rhs of a mapping to printable chars.

View File

@@ -5666,8 +5666,13 @@ nv_ident(cap)
else if (cmdchar == '#')
aux_ptr = (char_u *)(p_magic ? "/?.*~[^$\\" : "/?^$\\");
else if (tag_cmd)
/* Don't escape spaces and Tabs in a tag with a backslash */
aux_ptr = (char_u *)"\\|\"\n[";
{
if (curbuf->b_help)
/* ":help" handles unescaped argument */
aux_ptr = (char_u *)"";
else
aux_ptr = (char_u *)"\\|\"\n[";
}
else
aux_ptr = (char_u *)"\\|\"\n*?[";

View File

@@ -1738,6 +1738,11 @@ get_x11_windis()
}
if (x11_window == 0 || x11_display == NULL)
return (result = FAIL);
# ifdef FEAT_EVAL
set_vim_var_nr(VV_WINDOWID, (long)x11_window);
# endif
return (result = OK);
}

View File

@@ -2308,12 +2308,14 @@ fname_case(
int len)
{
char szTrueName[_MAX_PATH + 2];
char szTrueNameTemp[_MAX_PATH + 2];
char *ptrue, *ptruePrev;
char *porig, *porigPrev;
int flen;
WIN32_FIND_DATA fb;
HANDLE hFind;
int c;
int slen;
flen = (int)STRLEN(name);
if (flen == 0 || flen > _MAX_PATH)
@@ -2358,12 +2360,19 @@ fname_case(
}
*ptrue = NUL;
/* To avoid a slow failure append "\*" when searching a directory,
* server or network share. */
STRCPY(szTrueNameTemp, szTrueName);
slen = strlen(szTrueNameTemp);
if (*porig == psepc && slen + 2 < _MAX_PATH)
STRCPY(szTrueNameTemp + slen, "\\*");
/* Skip "", "." and "..". */
if (ptrue > ptruePrev
&& (ptruePrev[0] != '.'
|| (ptruePrev[1] != NUL
&& (ptruePrev[1] != '.' || ptruePrev[2] != NUL)))
&& (hFind = FindFirstFile(szTrueName, &fb))
&& (hFind = FindFirstFile(szTrueNameTemp, &fb))
!= INVALID_HANDLE_VALUE)
{
c = *porig;

View File

@@ -201,7 +201,7 @@ msgstr "Segni per %s:"
#, c-format
msgid " line=%ld id=%d name=%s"
msgstr " linea=%ld id=%d, nome=%s"
msgstr " linea=%ld id=%d nome=%s"
#, c-format
msgid "E96: Can not diff more than %ld buffers"

View File

@@ -173,7 +173,7 @@ msgstr "Tecken f
#, c-format
msgid " line=%ld id=%d name=%s"
msgstr " line=%ld id=%d namn%s"
msgstr " line=%ld id=%d namn=%s"
#, c-format
msgid "E96: Can not diff more than %ld buffers"

View File

@@ -51,6 +51,7 @@ int do_map __ARGS((int maptype, char_u *arg, int mode, int abbrev));
int get_map_mode __ARGS((char_u **cmdp, int forceit));
void map_clear __ARGS((char_u *cmdp, char_u *arg, int forceit, int abbr));
void map_clear_int __ARGS((buf_T *buf, int mode, int local, int abbr));
char_u *map_mode_to_chars __ARGS((int mode));
int map_to_exists __ARGS((char_u *str, char_u *modechars, int abbr));
int map_to_exists_mode __ARGS((char_u *rhs, int mode, int abbr));
char_u *set_context_in_map_cmd __ARGS((expand_T *xp, char_u *cmd, char_u *arg, int forceit, int isabbrev, int isunmap, cmdidx_T cmdidx));
@@ -61,7 +62,7 @@ void vim_unescape_csi __ARGS((char_u *p));
int makemap __ARGS((FILE *fd, buf_T *buf));
int put_escstr __ARGS((FILE *fd, char_u *strstart, int what));
void check_map_keycodes __ARGS((void));
char_u *check_map __ARGS((char_u *keys, int mode, int exact, int ign_mod, int abbr));
char_u *check_map __ARGS((char_u *keys, int mode, int exact, int ign_mod, int abbr, mapblock_T **mp_ptr, int *local_ptr));
void init_mappings __ARGS((void));
void add_map __ARGS((char_u *map, int mode));
/* vim: set ft=c : */

View File

@@ -33,6 +33,7 @@ char_u *msg_outtrans_one __ARGS((char_u *p, int attr));
int msg_outtrans_len_attr __ARGS((char_u *msgstr, int len, int attr));
void msg_make __ARGS((char_u *arg));
int msg_outtrans_special __ARGS((char_u *strstart, int from));
char_u *str2special_save __ARGS((char_u *str, int is_lhs));
char_u *str2special __ARGS((char_u **sp, int from));
void str2specialbuf __ARGS((char_u *sp, char_u *buf, int len));
void msg_prt_line __ARGS((char_u *s, int list));

View File

@@ -979,9 +979,10 @@ typedef struct mapblock mapblock_T;
struct mapblock
{
mapblock_T *m_next; /* next mapblock in list */
char_u *m_keys; /* mapped from */
char_u *m_keys; /* mapped from, lhs */
int m_keylen; /* strlen(m_keys) */
char_u *m_str; /* mapped to */
char_u *m_str; /* mapped to, rhs */
char_u *m_orig_str; /* rhs as entered by the user */
int m_mode; /* valid mode */
int m_noremap; /* if non-zero no re-mapping for m_str */
char m_silent; /* <silent> used, don't echo commands */

View File

@@ -27,7 +27,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
test56.out test57.out test58.out test59.out test60.out \
test61.out test62.out test63.out test64.out test65.out \
test66.out test67.out test68.out test69.out test70.out \
test71.out test72.out test73.out
test71.out test72.out test73.out test74.out
.SUFFIXES: .in .out
@@ -120,3 +120,4 @@ test70.out: test70.in
test71.out: test71.in
test72.out: test72.in
test73.out: test73.in
test74.out: test74.in

View File

@@ -27,7 +27,8 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
test30.out test31.out test32.out test33.out test34.out \
test37.out test38.out test39.out test40.out test41.out \
test42.out test52.out test65.out test66.out test67.out \
test68.out test69.out test71.out test72.out test73.out
test68.out test69.out test71.out test72.out test73.out \
test74.out
SCRIPTS32 = test50.out test70.out

View File

@@ -47,7 +47,8 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
test30.out test31.out test32.out test33.out test34.out \
test37.out test38.out test39.out test40.out test41.out \
test42.out test52.out test65.out test66.out test67.out \
test68.out test69.out test71.out test72.out test72.out
test68.out test69.out test71.out test72.out test73.out \
test74.out
SCRIPTS32 = test50.out test70.out

View File

@@ -27,7 +27,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
test56.out test57.out test58.out test59.out test60.out \
test61.out test62.out test63.out test64.out test65.out \
test66.out test67.out test68.out test69.out test70.out \
test71.out test72.out test73.out
test71.out test72.out test73.out test74.out
.SUFFIXES: .in .out

View File

@@ -74,7 +74,7 @@ SCRIPT = test1.out test2.out test3.out test4.out test5.out \
test56.out test57.out test60.out \
test61.out test62.out test63.out test64.out test65.out \
test66.out test67.out test68.out test69.out \
test71.out test72.out
test71.out test72.out test74.out
# Known problems:
# Test 30: a problem around mac format - unknown reason

View File

@@ -10,6 +10,7 @@ VIMPROG = ../vim
# This will make testing about 10 times as slow.
# VALGRIND = valgrind --tool=memcheck --leak-check=yes --num-callers=15 --log-file=valgrind.$*
SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
test7.out test8.out test9.out test10.out test11.out \
test12.out test13.out test14.out test15.out test17.out \
@@ -23,7 +24,8 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
test54.out test55.out test56.out test57.out test58.out \
test59.out test60.out test61.out test62.out test63.out \
test64.out test65.out test66.out test67.out test68.out \
test69.out test70.out test71.out test72.out test73.out
test69.out test70.out test71.out test72.out test73.out \
test74.out
SCRIPTS_GUI = test16.out

View File

@@ -13,7 +13,7 @@ Scripts = test1.out test2.out test3.out test4.out test5.out test6.out
test33.out test34.out test35.out test36.out test37.out
test38.out test39.out test40.out test41.out test42.out
test43.out test44.out test45.out test46.out test47.out
test48.out test49.out
test48.out test49.out test74.out
ScriptsGUI = test16.out

View File

@@ -53,15 +53,19 @@ b321b
t02: numeric
abc
ab
a
a321
a123
a122
a
x-22
b321
b123
c123d
-24
123b
c321d
0
b322b
b321
b321b

View File

@@ -21,6 +21,10 @@ ab
a
-24
x-22
0
a122
a123
b123

36
src/testdir/test74.in Normal file
View File

@@ -0,0 +1,36 @@
" Tests for storing global variables in the .viminfo file vim: set ft=vim:
STARTTEST
:so small.vim
:" Do all test in a separate window to avoid E211 when we recursively
:" delete the Xfind directory during cleanup
:"
:" This will cause a few errors, do it silently.
:set visualbell
:set nocp viminfo+=!,nviminfo
:let MY_GLOBAL_DICT={'foo': 1, 'bar': 0, 'longvarible': 1000}
:" store a really long list, so line wrapping will occur in viminfo file
:let MY_GLOBAL_LIST=range(1,100)
:wv! Xviminfo
:unlet MY_GLOBAL_DICT
:unlet MY_GLOBAL_LIST
:rv! Xviminfo
:call delete('Xviminfo')
:if exists("MY_GLOBAL_DICT")
:redir >> test.out
:echo MY_GLOBAL_DICT
:redir end
:endif
:if exists("MY_GLOBAL_LIST")
:redir >> test.out
:echo MY_GLOBAL_LIST
:redir end
:endif
:redir >> test.out
:echo "foobar"
:redir end
:endif
:qa!
ENDTEST
eof

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

@@ -0,0 +1,5 @@
{'foo': 1, 'longvarible': 1000, 'bar': 0}
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100]
foobar

16
src/testdir/test75.in Normal file
View File

@@ -0,0 +1,16 @@
" Tests for functions.
STARTTEST
:so small.vim
:" Test maparg() with a string result
:map foo<C-V> is<F4>foo
:vnoremap <script> <buffer> <expr> <silent> bar isbar
:call append('$', maparg('foo<C-V>'))
:call append('$', string(maparg('foo<C-V>', '', 0, 1)))
:call append('$', string(maparg('bar', '', 0, 1)))
:"
:/^eof/+1,$w! test.out
:qa!
ENDTEST
eof

3
src/testdir/test75.ok Normal file
View File

@@ -0,0 +1,3 @@
is<F4>foo
{'silent': 0, 'noremap': 0, 'lhs': 'foo<C-V>', 'mode': ' ', 'expr': 0, 'sid': 0, 'rhs': 'is<F4>foo', 'buffer': 0}
{'silent': 1, 'noremap': 1, 'lhs': 'bar', 'mode': 'v', 'expr': 1, 'sid': 0, 'rhs': 'isbar', 'buffer': 1}

View File

@@ -714,6 +714,20 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
32,
/**/
31,
/**/
30,
/**/
29,
/**/
28,
/**/
27,
/**/
26,
/**/
25,
/**/

View File

@@ -1842,7 +1842,8 @@ typedef int proftime_T; /* dummy for function prototypes */
#define VV_OP 52
#define VV_SEARCHFORWARD 53
#define VV_OLDFILES 54
#define VV_LEN 55 /* number of v: vars */
#define VV_WINDOWID 55
#define VV_LEN 56 /* number of v: vars */
#ifdef FEAT_CLIPBOARD