Compare commits

...

76 Commits

Author SHA1 Message Date
Douglas Drumond 51e413becf Snapshot 77
Signed-off-by: Douglas Drumond <douglas@cafelinear.com>
2015-07-06 04:39:01 -03:00
Bram Moolenaar 96d5c56b14 patch 7.4.769 Problem: Behavior of :diffoff is not tested. Solution: Add a bit of testing. (Olaf Dabrunz) 2015-07-06 04:38:13 -03:00
Bram Moolenaar 6ebbfe0b6c patch 7.4.768 Problem: :diffoff only works properly once. Solution: Also make :diffoff work when used a second time. (Olaf Dabrunz) 2015-07-06 04:38:13 -03:00
Bram Moolenaar 02c1b1e575 patch 7.4.767 Problem: --remote-tab-silent can fail on MS-Windows. Solution: Use single quotes to avoid problems with backslashes. (Idea by Weiyong Mao) 2015-07-06 04:38:12 -03:00
Bram Moolenaar 436f9d20c3 patch 7.4.766 Problem: Background color check does not work on Tera Term. Solution: Also recognize ST as a termination character. (Hirohito Higashi) 2015-07-06 04:38:12 -03:00
Bram Moolenaar d9d8cbb410 patch 7.4.765 Problem: CTRL-A and CTRL-X in Visual mode do not always work well. Solution: Improvements for increment and decrement. (Christian Brabandt) 2015-07-06 04:38:12 -03:00
Bram Moolenaar 154afff3a0 patch 7.4.764 Problem: test_increment fails on MS-Windows. (Ken Takata) Solution: Clear Visual mappings. (Taro Muraoka) 2015-07-06 04:38:12 -03:00
Bram Moolenaar 7780a20713 patch 7.4.763 Problem: Building with Lua 5.1 doesn't work. Solution: Define lua_replace and lua_remove. (KF Leong) 2015-07-06 04:38:11 -03:00
Bram Moolenaar cabe434bc1 patch 7.4.762 Problem: Comment for may_req_bg_color() is wrong. (Christ van Willegen) Solution: Rewrite the comment. 2015-07-06 04:38:11 -03:00
Bram Moolenaar 21dee6799c Update help files. 2015-07-06 04:38:11 -03:00
Bram Moolenaar 72ea633d80 patch 7.4.761 Problem: The request-background termcode implementation is incomplete. Solution: Add the missing pieces. 2015-07-06 04:38:11 -03:00
Bram Moolenaar 0f1dfa5a02 patch 7.4.760 Problem: Spelling mistakes are not displayed after ":syn spell". Solution: Force a redraw after ":syn spell" command. (Christian Brabandt) 2015-07-06 04:38:11 -03:00
Bram Moolenaar ae620a6e8f patch 7.4.759 Problem: Building with Lua 5.3 doesn't work, symbols have changed. Solution: Use the new names for the new version. (Felix Schnizlein) 2015-07-06 04:38:10 -03:00
Bram Moolenaar b274364347 patch 7.4.758 Problem: When 'conceallevel' is 1 and quitting the command-line window with CTRL-C the first character ':' is erased. Solution: Reset 'conceallevel' in the command-line window. (Hirohito Higashi) 2015-07-06 04:38:10 -03:00
Bram Moolenaar 16168c4f24 patch 7.4.757 Problem: Cannot detect the background color of a terminal. Solution: Add T_RBG to request the background color if possible. (Lubomir Rintel) 2015-07-06 04:38:10 -03:00
Bram Moolenaar dfc5fc322e patch 7.4.756 Problem: Can't use strawberry Perl 5.22 x64 on MS-Windows. Solution: Add new defines and #if. (Ken Takata) 2015-07-06 04:38:10 -03:00
Bram Moolenaar 2216f1191d patch 7.4.755 Problem: It is not easy to count the number of characters. Solution: Add the skipcc argument to strchars(). (Hirohito Higashi, Ken Takata) 2015-07-06 04:38:10 -03:00
Bram Moolenaar d04cc55104 patch 7.4.754 Problem: Using CTRL-A in Visual mode does not work well. (Gary Johnson) Solution: Make it increment all numbers in the Visual area. (Christian Brabandt) 2015-07-06 04:38:09 -03:00
Bram Moolenaar 2c03ee082f patch 7.4.753 Problem: Appending in Visual mode with 'linebreak' set does not work properly. Also when 'selection' is "exclusive". (Ingo Karkat) Solution: Recalculate virtual columns. (Christian Brabandt) 2015-07-06 04:38:09 -03:00
Bram Moolenaar c995a66d85 patch 7.4.752 Problem: Unicode 8.0 not supported. Solution: Update tables for Unicode 8.0. Avoid E36 when running the script. (James McCoy) 2015-07-06 04:38:09 -03:00
Bram Moolenaar fcb0b2f39f patch 7.4.751 Problem: It is not obvious how to enable the address sanitizer. Solution: Add commented-out flags in the Makefile. (Dominique Pelle) Also add missing test targets. 2015-07-06 04:38:09 -03:00
Bram Moolenaar 904c5b6c59 patch 7.4.750 Problem: Cannot build with clang 3.5 on Cygwin with perl enabled. Solution: Strip "-fdebug-prefix-map" in configure. (Ken Takata) 2015-07-06 04:38:08 -03:00
Bram Moolenaar 1cf531a4c7 patch 7.4.748 Problem: Buffer overflow. Solution: Make the buffer larger. (Kazunobu Kuriyama) 2015-07-06 04:38:08 -03:00
Bram Moolenaar 22c8ade399 Add the logiPat plugin to the distribution. 2015-07-06 04:38:08 -03:00
Bram Moolenaar 1e70321fc1 patch 7.4.747 Problem: ":cnext" may jump to the wrong column when setting 'virtualedit=all' (cs86661) Solution: Reset the coladd field. (Hirohito Higashi) 2015-07-06 04:38:08 -03:00
Bram Moolenaar 6f47c47b33 patch 7.4.746 Problem: ":[count]tag" is not always working. (cs86661) Solution: Set cur_match a bit later. (Hirohito Higashi) 2015-07-06 04:38:07 -03:00
Bram Moolenaar 5fbd36afc4 patch 7.4.745 Problem: The entries added by matchaddpos() are returned by getmatches() but can't be set with setmatches(). (Lcd) Solution: Fix setmatches(). (Christian Brabandt) 2015-07-06 04:38:07 -03:00
Bram Moolenaar 2d68b5c578 patch 7.4.744 Problem: No tests for Ruby and Perl. Solution: Add minimal tests. (Ken Takata) 2015-07-06 04:38:07 -03:00
Bram Moolenaar 07ae743a43 patch 7.4.743 Problem: "p" in Visual mode causes an unexpected line split. Solution: Advance the cursor first. (Yukihiro Nakadaira) 2015-07-06 04:38:07 -03:00
Bram Moolenaar 6a8a704300 patch 7.4.742 Problem: Cannot specify a vertical split when loading a buffer for a quickfix command. Solution: Add the "vsplit" value to 'switchbuf'. (Brook Hong) 2015-07-06 04:38:07 -03:00
Bram Moolenaar 9ffb99aaac Add new test files. 2015-07-06 04:38:06 -03:00
Bram Moolenaar 1932308565 patch 7.4.741 Problem: When using += with ":set" a trailing comma is not recognized. (Issue 365) Solution: Don't add a second comma. Add a test. (partly by Christian Brabandt) 2015-07-06 04:38:06 -03:00
Bram Moolenaar f9a7efe252 Updated runtime files. 2015-07-06 04:38:06 -03:00
Bram Moolenaar 060c84869e patch 7.4.740 Problem: ":1quit" works like ":.quit". (Bohr Shaw) Solution: Don't exit Vim when a range is specified. (Christian Brabandt) 2015-07-06 04:38:05 -03:00
Bram Moolenaar 91a4f1a4f8 patch 7.4.739 Problem: In a string "\U" only takes 4 digits, while after CTRL-V U eight digits can be used. Solution: Make "\U" also take eight digits. (Christian Brabandt) 2015-07-06 04:38:05 -03:00
Bram Moolenaar d6b63e6b7a patch 7.4.738 Problem: Can't compile without the syntax highlighting feature. Solution: Add #ifdef around use of w_p_cul. (Hirohito Higashi) 2015-07-06 04:38:05 -03:00
Bram Moolenaar a42b568891 patch 7.4.737 Problem: On MS-Windows vimgrep over arglist doesn't work (Issue 361) Solution: Only escape backslashes in ## expansion when it is not used as the path separator. (James McCoy) 2015-07-06 04:38:04 -03:00
Bram Moolenaar 6f9d3c0f0c patch 7.4.736 Problem: Invalid memory access. Solution: Avoid going over the end of a NUL terminated string. (Dominique Pelle) 2015-07-06 04:38:04 -03:00
Bram Moolenaar 9c2af3e259 patch 7.4.735 Problem: Wrong argument for sizeof(). Solution: Use a pointer argument. (Chris Hall) 2015-07-06 04:38:04 -03:00
Bram Moolenaar 816660d05f patch 7.4.734 Problem: ml_get error when using "p" in a Visual selection in the last line. Solution: Change the behavior at the last line. (Yukihiro Nakadaira) 2015-07-06 04:38:04 -03:00
Bram Moolenaar 0312c083d5 patch 7.4.733 Problem: test_listchars breaks on MS-Windows. (Kenichi Ito) Solution: Set fileformat to "unix". (Christian Brabandt) 2015-07-06 04:38:04 -03:00
Bram Moolenaar 2b7258519e Updated runtime files. 2015-07-06 04:38:03 -03:00
Bram Moolenaar eaa701e2d2 patch 7.4.732 Problem: The cursor line is not always updated for the "O" command. Solution: Reset the VALID_CROW flag. (Christian Brabandt) 2015-07-06 04:38:03 -03:00
Bram Moolenaar e8656d3496 patch 7.4.731 Problem: The tab menu shows "Close tab" even when it doesn't work. Solution: Don't show "Close tab" for the last tab. (John Marriott) 2015-07-06 04:38:03 -03:00
Bram Moolenaar 234968680c patch 7.4.730 Problem: When setting the crypt key and using a swap file, text may be encrypted twice or unencrypted text remains in the swap file. (Issue 369) Solution: Call ml_preserve() before re-encrypting. Set correct index for next pointer block. 2015-07-06 04:38:03 -03:00
Bram Moolenaar d9a29c1132 patch 7.4.729 Problem: Occasional crash with 'list' set. Solution: Fix off-by-one error. (Christian Brabandt) 2015-07-06 04:38:02 -03:00
Bram Moolenaar 50eef128f1 patch 7.4.728 Problem: Can't build with some version of Visual Studio 2015. Solution: Recognize another version 14 number. (Sinan) 2015-07-06 04:38:02 -03:00
Bram Moolenaar eb865e81b3 patch 7.4.727 Problem: Cannot build GvimExt with MingW. Solution: Add -lgdi32. (KF Leong) 2015-07-06 04:38:02 -03:00
Bram Moolenaar 8b22f375aa patch 7.4.726 Problem: Cannot build GvimExt. Solution: Set APPVER to 5.0. (KF Leong) 2015-07-06 04:38:02 -03:00
Bram Moolenaar db5cd357f2 patch 7.4.725 Problem: ":call setreg('"', [])" reports an internal error. Solution: Make the register empty. (Yasuhiro Matsumoto) 2015-07-06 04:38:02 -03:00
Bram Moolenaar cf07712bac patch 7.4.724 Problem: Vim icon does not show in Windows context menu. (issue 249) Solution: Load the icon in GvimExt. 2015-07-06 04:38:01 -03:00
Bram Moolenaar b89e20d3ca patch 7.4.723 Problem: For indenting, finding the C++ baseclass can be slow. Solution: Cache the result. (Hirohito Higashi) 2015-07-06 04:38:01 -03:00
Bram Moolenaar 8da92c9fd6 patch 7.4.722 Problem: 0x202f is not recognized as a non-breaking space character. Solution: Add 0x202f to the list. (Christian Brabandt) 2015-07-06 04:38:01 -03:00
Bram Moolenaar 15d17cfc87 patch 7.4.720 Problem: Can't build with Visual Studio 2015. Solution: Recognize the "version 14" numbers and omit /nodefaultlib when appropriate. (Paul Moore) 2015-07-06 04:38:01 -03:00
Bram Moolenaar fa09f6a1ba patch 7.4.719 Problem: Overflow when adding MAXCOL to a pointer. Solution: Subtract pointers instead. (James McCoy) 2015-07-06 04:38:01 -03:00
Bram Moolenaar d1771fe793 patch 7.4.718 Problem: Autocommands triggered by quickfix cannot get the current title value. Solution: Set w:quickfix_title earlier. (Yannick) Also move the check for a title into the function. 2015-07-06 04:38:00 -03:00
Bram Moolenaar c54b58f673 patch 7.4.717 Problem: ":let list += list" can change a locked list. Solution: Check for the lock earlier. (Olaf Dabrunz) 2015-07-06 04:38:00 -03:00
Bram Moolenaar 4426e03f08 patch 7.4.716 Problem: When using the 'c' flag of ":substitute" and selecting "a" or "l" at the prompt the flags are not remembered for ":&&". (Ingo Karkat) Solution: Save the flag values and restore them. (Hirohito Higashi) 2015-07-06 04:38:00 -03:00
Bram Moolenaar 2f8a843dec patch 7.4.715 Problem: Invalid memory access when there are illegal bytes. Solution: Get the length from the text, not from the character. (Dominique Pelle) 2015-07-06 04:38:00 -03:00
Bram Moolenaar 526b318d13 patch 7.4.714 Problem: Illegal memory access when there are illegal bytes. Solution: Check the byte length of the character. (Dominique Pelle) 2015-07-06 04:37:59 -03:00
Bram Moolenaar 4011b53d6c patch 7.4.713 Problem: Wrong condition for #ifdef. Solution: Change USR_EXRC_FILE2 to USR_VIMRC_FILE2. (Mikael Fourrier) 2015-07-06 04:37:59 -03:00
Douglas Drumond 890dccd14d Merge pull request #49 from psagers/master
Fix for native full screen on secondary monitor.
2015-07-06 03:34:36 -03:00
Douglas Drumond e878fe5a3a Merge pull request #41 from jpetrie/fix-bad-unicode-crash
Fix crash when rendering invalid Unicode characters.
2015-07-06 03:33:56 -03:00
Douglas Drumond 4e52b08851 Merge pull request #38 from jpetrie/fix-warnings
Fix additional deprecation warnings.
2015-07-06 03:32:03 -03:00
Peter Sagerson 70ef60ad42 Fix for native full screen on secondary monitor. 2015-06-29 12:52:01 -07:00
Josh Petrie 40989c03c2 Fix crash when rendering invalid Unicode characters. 2015-05-30 09:46:46 -07:00
Josh Petrie 6473f51469 Correct mistakes related to versioning warning fixes:
- added availability macro constants for OS X versions through 10.10.3
  so compilation on earlier OS versions still works.
- added a versioning guard to a NSScroller change that slipped by
  unnoticed in a previous commit.
2015-05-29 18:23:35 -07:00
Josh Petrie 4a20795452 Explicitly take the address of potentially-missing weak-linked functions. 2015-05-28 18:34:46 -07:00
Josh Petrie b5f6174c70 Replace deprecated [NSScroller scrollerWidth] with modern equivalent. 2015-05-28 18:19:09 -07:00
Douglas Drumond b834a6d1d2 Merge pull request #34 from jpetrie/fix-warnings
Fix deprecation warning regarding NSOKButton on 10.10+.
2015-05-27 23:44:38 -03:00
Douglas Drumond 301a2d83db Merge pull request #8 from ericcong/fix-yosemite-fullscreen-problem
Fix the fullscreen problem in Yosemite
2015-05-27 23:42:56 -03:00
Josh Petrie 91bdf6c87c Fix deprecation warning regarding NSOKButton on 10.10+. 2015-05-15 20:00:58 -07:00
Chen Cong 8bdcaf8d4c Fix the fullscreen problem in Yosemite 2015-05-01 13:09:36 -04:00
Douglas Drumond 34192eeed9 Snapshot 76
Signed-off-by: Douglas Drumond <douglas@cafelinear.com>
2015-04-29 05:59:30 -03:00
Douglas Drumond ca0359465b Merge pull request #6 from jpetrie/multimonitor-window-sizing
Fix 'flicker' during window presentation caused by early-out criteria.
2015-04-29 05:51:47 -03:00
Josh Petrie 8564f74aa2 Fix 'flicker' during window presentation caused by overly-broad early-out criteria. 2015-04-27 19:20:23 -07:00
120 changed files with 4048 additions and 1335 deletions
+2
View File
@@ -75,6 +75,7 @@ DOCS = \
pattern.txt \
pi_getscript.txt \
pi_gzip.txt \
pi_logipat.txt \
pi_netrw.txt \
pi_paren.txt \
pi_spec.txt \
@@ -207,6 +208,7 @@ HTMLS = \
pattern.html \
pi_getscript.html \
pi_gzip.html \
pi_logipat.html \
pi_netrw.html \
pi_paren.html \
pi_spec.html \
+8 -10
View File
@@ -1,4 +1,4 @@
*eval.txt* For Vim version 7.4. Last change: 2015 Apr 11
*eval.txt* For Vim version 7.4. Last change: 2015 Jun 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1021,7 +1021,7 @@ A string constant accepts these special characters:
\X. same as \x.
\u.... character specified with up to 4 hex numbers, stored according to the
current value of 'encoding' (e.g., "\u02a4")
\U.... same as \u....
\U.... same as \u but allows up to 8 hex numbers.
\b backspace <BS>
\e escape <Esc>
\f formfeed <FF>
@@ -1985,7 +1985,7 @@ split( {expr} [, {pat} [, {keepempty}]])
sqrt( {expr}) Float square root of {expr}
str2float( {expr}) Float convert String to Float
str2nr( {expr} [, {base}]) Number convert String to Number
strchars( {expr}) Number character length of the String {expr}
strchars( {expr} [, {skipcc}]) Number character length of the String {expr}
strdisplaywidth( {expr} [, {col}]) Number display length of the String {expr}
strftime( {format}[, {time}]) String time in specified format
stridx( {haystack}, {needle}[, {start}])
@@ -2961,6 +2961,8 @@ extend({expr1}, {expr2} [, {expr3}]) *extend()*
{expr1} is changed when {expr2} is not empty. If necessary
make a copy of {expr1} first.
{expr2} remains unchanged.
When {expr1} is locked and {expr2} is not empty the operation
fails.
Returns {expr1}.
@@ -5911,15 +5913,11 @@ string({expr}) Return {expr} converted to a String. If {expr} is a Number,
*strlen()*
strlen({expr}) The result is a Number, which is the length of the String
{expr} in bytes.
If you want to count the number of multi-byte characters (not
counting composing characters) use something like this: >
:let len = strlen(substitute(str, ".", "x", "g"))
<
If the argument is a Number it is first converted to a String.
For other types an error is given.
Also see |len()|, |strchars()|, |strdisplaywidth()| and
|strwidth()|.
If you want to count the number of multi-byte characters use
|strchars()|.
Also see |len()|, |strdisplaywidth()| and |strwidth()|.
strpart({src}, {start}[, {len}]) *strpart()*
The result is a String, which is part of {src}, starting from
+6 -4
View File
@@ -1,4 +1,4 @@
*insert.txt* For Vim version 7.4. Last change: 2014 Aug 04
*insert.txt* For Vim version 7.4. Last change: 2015 May 22
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -81,9 +81,11 @@ CTRL-W Delete the word before the cursor (see |i_backspacing| about
joining lines). See the section "word motions",
|word-motions|, for the definition of a word.
*i_CTRL-U*
CTRL-U Delete all entered characters in the current line (see
|i_backspacing| about joining lines).
CTRL-U Delete all entered characters before the cursor in the current
line. If there are no newly entereed characters and
'backspace'is not empty, delete all characters before the
cursor in the current line.
See |i_backspacing| about joining lines.
*i_CTRL-I* *i_<Tab>* *i_Tab*
<Tab> or CTRL-I Insert a tab. If the 'expandtab' option is on, the
equivalent number of spaces is inserted (use CTRL-V <Tab> to
+3 -1
View File
@@ -1,4 +1,4 @@
*motion.txt* For Vim version 7.4. Last change: 2014 Feb 11
*motion.txt* For Vim version 7.4. Last change: 2015 Jun 06
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -172,6 +172,8 @@ CTRL-H or *CTRL-H* *<BS>*
l or *l*
<Right> or *<Right>* *<Space>*
<Space> [count] characters to the right. |exclusive| motion.
See the 'whichwrap' option for adjusting the behavior
at end of line
*0*
0 To the first character of the line. |exclusive|
+5 -3
View File
@@ -1,4 +1,4 @@
*options.txt* For Vim version 7.4. Last change: 2015 Feb 17
*options.txt* For Vim version 7.4. Last change: 2015 Jun 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -4848,8 +4848,9 @@ A jump table for the options with a short description can be found at |Q_op|.
conceal:c Character to show in place of concealed text, when
'conceallevel' is set to 1.
*lcs-nbsp*
nbsp:c Character to show for a non-breakable space (character
0xA0, 160). Left blank when omitted.
nbsp:c Character to show for a non-breakable space character
(0xA0 (160 decimal) and U+202F). Left blank when
omitted.
The characters ':' and ',' should not be used. UTF-8 characters can
be used when 'encoding' is "utf-8", otherwise only printable
@@ -7181,6 +7182,7 @@ A jump table for the options with a short description can be found at |Q_op|.
split If included, split the current window before loading
a buffer for a |quickfix| command that display errors.
Otherwise: do not split, use current window.
vsplit Just like "split" but split vertically.
newtab Like "split", but open a new tab page. Overrules
"split" when both are present.
+117
View File
@@ -0,0 +1,117 @@
*pi_logipat.txt* Logical Patterns Mar 13, 2013
Author: Charles E. Campbell <NdrOchip@ScampbellPfamily.AbizM>
Copyright: (c) 2004-2013 by Charles E. Campbell *logipat-copyright*
The VIM LICENSE applies to LogiPat.vim and LogiPat.txt
(see |copyright|) except use "LogiPat" instead of "Vim"
No warranty, express or implied. Use At-Your-Own-Risk.
==============================================================================
1. Contents *logipat* *logipat-contents*
1. Contents.................: |logipat-contents|
2. LogiPat Manual...........: |logipat-manual|
3. LogiPat Examples.........: |logipat-examples|
4. Caveat...................: |logipat-caveat|
5. LogiPat History..........: |logipat-history|
==============================================================================
2. LogiPat Manual *logipat-manual* *logipat-man*
*logipat-arg* *logipat-input* *logipat-pattern* *logipat-operators*
Boolean logic patterns are composed of
operators ! = not
| = logical-or
& = logical-and
grouping ( ... )
patterns "pattern"
:LogiPat {boolean-logic pattern} *:LogiPat*
:LogiPat is a command which takes a boolean-logic
argument (|logipat-arg|).
:LP {boolean-logic pattern} *:LP*
:LP is a shorthand command version of :LogiPat
(|:LogiPat|).
:ELP {boolean-logic pattern} *:ELP*
No search is done, but the conversion from the
boolean logic pattern to the regular expression
is performed and echoed onto the display.
:LogiPatFlags {search flags} *LogiPat-flags*
:LogiPatFlags {search flags}
LogiPat uses the |search()| command. The flags
passed to that call to search() may be specified
by the :LogiPatFlags command.
:LPF {search flags} *:LPF*
:LPF is a shorthand version of :LogiPatFlags.
:let pat=LogiPat({boolean-logic pattern}) *LogiPat()*
If one calls LogiPat() directly, no search
is done, but the transformation from the boolean
logic pattern into a regular expression pattern
is performed and returned.
To get a " inside a pattern, as opposed to having it delimit
the pattern, double it.
==============================================================================
3. LogiPat Examples *logipat-examples*
LogiPat takes Boolean logic arguments and produces a regular
expression which implements the choices. A series of examples
follows:
>
:LogiPat "abc"
< will search for lines containing the string :abc:
>
:LogiPat "ab""cd"
< will search for lines containing the string :ab"c:
>
:LogiPat !"abc"
< will search for lines which don't contain the string :abc:
>
:LogiPat "abc"|"def"
< will search for lines which contain either the string
:abc: or the string :def:
>
:LogiPat !("abc"|"def")
< will search for lines which don't contain either
of the strings :abc: or :def:
>
:LogiPat "abc"&"def"
< will search for lines which contain both of the strings
:abc: and :def:
>
:let pat= LogiPat('!"abc"')
< will return the regular expression which will match
all lines not containing :abc: . The double quotes
are needed to pass normal patterns to LogiPat, and
differentiate such patterns from boolean logic
operators.
==============================================================================
4. Caveat *logipat-caveat*
The "not" operator may be fragile; ie. it may not always play well
with the & (logical-and) and | (logical-or) operators. Please try out
your patterns, possibly with :set hls, to insure that what is matching
is what you want.
==============================================================================
3. LogiPat History *logipat-history*
v3 Sep 25, 2006 * LP_Or() fixed; it now encapsulates its output
in \%(...\) parentheses
Dec 12, 2011 * |:ELP| added
* "" is mapped to a single " and left inside patterns
v2 May 31, 2005 * LPF and LogiPatFlags commands weren't working
v1 May 23, 2005 * initial release
==============================================================================
vim:tw=78:ts=8:ft=help
+27
View File
@@ -941,6 +941,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
't_KJ' term.txt /*'t_KJ'*
't_KK' term.txt /*'t_KK'*
't_KL' term.txt /*'t_KL'*
't_RB' term.txt /*'t_RB'*
't_RI' term.txt /*'t_RI'*
't_RV' term.txt /*'t_RV'*
't_SI' term.txt /*'t_SI'*
@@ -1854,6 +1855,7 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:CompilerSet usr_41.txt /*:CompilerSet*
:DiffOrig diff.txt /*:DiffOrig*
:DoMatchParen pi_paren.txt /*:DoMatchParen*
:ELP pi_logipat.txt /*:ELP*
:Explore pi_netrw.txt /*:Explore*
:GLVS pi_getscript.txt /*:GLVS*
:GetLatestVimScripts_dat pi_getscript.txt /*:GetLatestVimScripts_dat*
@@ -1861,7 +1863,10 @@ $VIMRUNTIME starting.txt /*$VIMRUNTIME*
:GnatPretty ft_ada.txt /*:GnatPretty*
:GnatTags ft_ada.txt /*:GnatTags*
:Hexplore pi_netrw.txt /*:Hexplore*
:LP pi_logipat.txt /*:LP*
:LPF pi_logipat.txt /*:LPF*
:Lexplore pi_netrw.txt /*:Lexplore*
:LogiPat pi_logipat.txt /*:LogiPat*
:Man filetype.txt /*:Man*
:MkVimball pi_vimball.txt /*:MkVimball*
:N editing.txt /*:N*
@@ -4468,6 +4473,8 @@ L motion.txt /*L*
Linux-backspace options.txt /*Linux-backspace*
List eval.txt /*List*
Lists eval.txt /*Lists*
LogiPat() pi_logipat.txt /*LogiPat()*
LogiPat-flags pi_logipat.txt /*LogiPat-flags*
Lua if_lua.txt /*Lua*
M motion.txt /*M*
MDI starting.txt /*MDI*
@@ -4604,6 +4611,7 @@ SourcePre autocmd.txt /*SourcePre*
SpellFileMissing autocmd.txt /*SpellFileMissing*
StdinReadPost autocmd.txt /*StdinReadPost*
StdinReadPre autocmd.txt /*StdinReadPre*
String eval.txt /*String*
SwapExists autocmd.txt /*SwapExists*
Syntax autocmd.txt /*Syntax*
SystemColors.plist gui_mac.txt /*SystemColors.plist*
@@ -6789,6 +6797,7 @@ lcs-eol options.txt /*lcs-eol*
lcs-extends options.txt /*lcs-extends*
lcs-nbsp options.txt /*lcs-nbsp*
lcs-precedes options.txt /*lcs-precedes*
lcs-space options.txt /*lcs-space*
lcs-tab options.txt /*lcs-tab*
lcs-trail options.txt /*lcs-trail*
left-right-motions motion.txt /*left-right-motions*
@@ -6836,6 +6845,18 @@ location-list quickfix.txt /*location-list*
location-list-window quickfix.txt /*location-list-window*
log() eval.txt /*log()*
log10() eval.txt /*log10()*
logipat pi_logipat.txt /*logipat*
logipat-arg pi_logipat.txt /*logipat-arg*
logipat-caveat pi_logipat.txt /*logipat-caveat*
logipat-contents pi_logipat.txt /*logipat-contents*
logipat-copyright pi_logipat.txt /*logipat-copyright*
logipat-examples pi_logipat.txt /*logipat-examples*
logipat-history pi_logipat.txt /*logipat-history*
logipat-input pi_logipat.txt /*logipat-input*
logipat-man pi_logipat.txt /*logipat-man*
logipat-manual pi_logipat.txt /*logipat-manual*
logipat-operators pi_logipat.txt /*logipat-operators*
logipat-pattern pi_logipat.txt /*logipat-pattern*
long-lines version5.txt /*long-lines*
love intro.txt /*love*
lowercase change.txt /*lowercase*
@@ -7514,6 +7535,7 @@ php3.vim syntax.txt /*php3.vim*
phtml.vim syntax.txt /*phtml.vim*
pi_getscript.txt pi_getscript.txt /*pi_getscript.txt*
pi_gzip.txt pi_gzip.txt /*pi_gzip.txt*
pi_logipat.txt pi_logipat.txt /*pi_logipat.txt*
pi_netrw.txt pi_netrw.txt /*pi_netrw.txt*
pi_paren.txt pi_paren.txt /*pi_paren.txt*
pi_spec.txt pi_spec.txt /*pi_spec.txt*
@@ -8195,6 +8217,7 @@ t_KI term.txt /*t_KI*
t_KJ term.txt /*t_KJ*
t_KK term.txt /*t_KK*
t_KL term.txt /*t_KL*
t_RB term.txt /*t_RB*
t_RI term.txt /*t_RI*
t_RV term.txt /*t_RV*
t_SI term.txt /*t_SI*
@@ -8618,11 +8641,13 @@ v_<Esc> visual.txt /*v_<Esc>*
v_= change.txt /*v_=*
v_> change.txt /*v_>*
v_C change.txt /*v_C*
v_CTRL-A change.txt /*v_CTRL-A*
v_CTRL-C visual.txt /*v_CTRL-C*
v_CTRL-G visual.txt /*v_CTRL-G*
v_CTRL-H change.txt /*v_CTRL-H*
v_CTRL-O visual.txt /*v_CTRL-O*
v_CTRL-V visual.txt /*v_CTRL-V*
v_CTRL-X change.txt /*v_CTRL-X*
v_CTRL-Z starting.txt /*v_CTRL-Z*
v_CTRL-\_CTRL-G intro.txt /*v_CTRL-\\_CTRL-G*
v_CTRL-\_CTRL-N intro.txt /*v_CTRL-\\_CTRL-N*
@@ -8678,7 +8703,9 @@ v_gJ change.txt /*v_gJ*
v_gN visual.txt /*v_gN*
v_gV visual.txt /*v_gV*
v_g] tagsrch.txt /*v_g]*
v_g_CTRL-A change.txt /*v_g_CTRL-A*
v_g_CTRL-G editing.txt /*v_g_CTRL-G*
v_g_CTRL-X change.txt /*v_g_CTRL-X*
v_g_CTRL-] tagsrch.txt /*v_g_CTRL-]*
v_gf editing.txt /*v_gf*
v_gn visual.txt /*v_gn*
+86 -43
View File
@@ -1,4 +1,4 @@
*todo.txt* For Vim version 7.4. Last change: 2015 Apr 15
*todo.txt* For Vim version 7.4. Last change: 2015 Jun 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -74,49 +74,58 @@ More info Jul 24. Not clear why.
Better .ico file for Windows. (Pat Suwalski, 2015 Feb 13)
Waiting for response on remark from Edward Fox.
Patch to make getregtype() return the right size for non-linux systems.
(Yasuhiro Matsumoto, 2014 Jul 8)
Breaks test_eval. Inefficient, can we only compute y_width when needed?
Show Vim icon in Windows context menu. Issue 249. (Mario Weber, 2015 Apr 11)
Problem that a previous silent ":throw" causes a following try/catch not to
work. (ZyX, 2013 Sep 28)
Problem using ":try" inside ":execute". (ZyX, 2013 Sep 15)
R indent files update. (Jakson Alves de Aquino, Mar 31)
Updated Python syntax file. (Dmitry Vasiliev, Mar 30)
Regression for v_b_A. (Ingo Karkat, 2015 May 18)
":cd C:\Windows\System32\drivers\etc*" does not work, even though the
directory exists. (Sergio Gallelli, 2013 Dec 29)
Invalid memory access in regexp.c. (Dominique Pelle, 2015 May 23)
Using ":windo" to set options in all windows has the side effect that it
changes the window layout and the current window. Make a variant that saves
and restores. Use in the matchparen plugin.
Perhaps we can use ":silent window"?
Patch to make Ruby 2.2 work. (Andrei Olsen)
Patch for appending in Visual mode with 'linebreak' set.
(Christian Brabandt, 2015 Jun 1)
Window drawn wrong with 'laststatus' zero and a command-line window.
(Yclept Nemo, 2015 Apr 7)
Patch by Christian, Apr 8.
Patch to make undo files not executable. (Mikael Berthe, 2015 Apr 5)
Patch to make CTRL-A in Visual mode increment all Visually selected numbers.
Same for decrement with CTRL-X. (Christian Brabandt, 2015 Jun 8)
Update Jun 9.
C indent: should recognize C11 raw strings. (Mark Lodato, 2015 Mar 1)
Need to recognize R"string".
Need to recognize R"string" for 'cindent'.
Patch for :tabmove not working as documented. (Hirohito Higashi, 2015 Mar 10)
https://gist.github.com/h-east/ffabb0cdd589a5f9acd2
Updated patch emailed. (Mar 17) Awaiting comments.
Updated phpcomplete. (Mikolaj Machowski, 2015 May 6)
Patch to detect background terminal color in xterm. (Lubomir Rintel, 2015 Jun
1)
Patch to fix that in command-line window first character is erased
when conceallevel is set. (Hirohito Higashi, 2015 May 12)
Patch to make Lua 5.3 and later work. (Felix Schnizlein, 2015 Jun 11)
Patch to make \U in a string accept up to 8 characters. (Christian Brabandt,
2015 Jun 12) Does this break existing scripts?
Crash when changing the 'tags' option from a remote command.
(Benjamin Fritz, 2015 Mar 18)
(Benjamin Fritz, 2015 Mar 18, stack trace Mar 20)
Patch on issue 361.
Patch on issue 362.
Gvim: when both Tab and CTRL-I are mapped, use CTRL-I not for Tab.
Can src/GvimExt/Make_cyg.mak be removed?
Same for src/xxd/Make_cyg.mak
Python: ":py raw_input('prompt')" doesn't work. (Manu Hack)
MS-Windows: When editing a file with a leading space, writing it uses the
@@ -125,14 +134,37 @@ wrong name. (Aram, 2014 Nov 7) Vim 7.4.
Can't recognize the $ProgramFiles(x86) environment variable. Recognize it
specifically? First try with the parens, then without.
Patch to force redraw after ":syn spell" command. (Christian, 2015 May 8)
Patch for multi-byte characters in langmap and applying a mapping on them.
(Christian Brabandt, 2015 Jun 12)
Is this the right solution?
Patch for langmap not working properly with mapping in Command-line mode.
Issue 376.
Patch to add grepfile(). (Scott Prager, 2015 May 26)
Work in progress.
Patch to make getregtype() return the right size for non-linux systems.
(Yasuhiro Matsumoto, 2014 Jul 8)
Breaks test_eval. Inefficient, can we only compute y_width when needed?
Value returned by virtcol() changes depending on how lines wrap. This is
inconsistent with the documentation.
Better greek spell checking. Issue 299.
Patch to add 'completeselect' option. Specifies how to select a candidate in
insert completion. (Shougo, 2013 May 29)
Update to add to existing 'completeopt'. 2013 May 30
Updated update: Shougo 2015 Jun 12
When complete() first argument is before where insert started and 'backspace'
is Vi compatible, the completion fails. (Hirohito Higashi, 2015 Feb 19)
Patch to fix equivalence classes in regexp. (Dominique Pelle, 2015 Jun 2)
Weird encryption problems on Windows. (Ben Fritz, 2015 Feb 13)
Goes away when disabling the swap file. (might1, Feb 16)
@@ -148,16 +180,19 @@ Build with Python on Mac does not always use the right library.
ml_updatechunk() is slow when retrying for another encoding. (John Little,
2014 Sep 11)
Patch to add 'space' argument to 'listchars'. (Issue 350)
Author: David Bürgin
Patch to use different terminal mode settings for system(). (Hayaki Saito)
Does this work for everybody?
Patch to fix that wide characters do not work properly after exiting.
(Yasuhiro Matsumoto, 2015 May 24) Better patch to come.
Patch for man.vim. (SungHyun Nam, 2015 May 20)
Doesn't work completely (Dominique Orban)
When a session file is created and there are "nofile" buffers, these are not
filled. Need to trigger BufReadCmd autocommands. Also handle deleting the
initial empty buffer better. (ZyX, 2015 March 8)
Calling setreg() with an empty list doesn't work.
Patch by Yasuhiro Matsumoto, 2014 Dec 14.
Extended file attributes lost on write (backupcopy=no). Issue 306.
Patch to add an argument to ":ls" for specific kinds of buffers.
@@ -170,8 +205,16 @@ from two windows? Stopped happening (Feb 5).
Patch for an extra argument to matchadd() for conceal. (Christian Brabandt,
2015 Feb 17, update Feb 19)
Patch to add v:completed_item. (Shougo Matsu, 2013 Nov 29).
Update 2015 May 30.
Patch to add :lockjumps. (Carlo Baldassi, 2015 May 25)
OK to not block marks?
Mixup of highlighting when there is a match and SpellBad. (ZyX, 2015 Jan 1)
Patch on issue 79: use 'path' option for filename completion.
Patch to add 'belloff' option. (Christian Brabandt, 2015 Jan 31)
Update Feb 6.
@@ -217,11 +260,24 @@ With test, Nov 23.
Wrong scrolling when using incsearch. Patch by Christian Brabandt, 2014 Dec 4.
Is this a good solution?
Patch to allow setting w:quickfix_title via setqflist() and setloclist()
functions. (Christian Brabandt, 2013 May 8, update May 21)
Patch to add getlocstack() / setlocstack(). (Christian Brabandt, 2013 May 14)
Second one. Update May 22.
Update by Daniel Hahler, 2014 Jul 4, Aug 14, Oct 14, Oct 15.
Patch: Let rare word highlighting overrule good word highlighting.
(Jakson A. Aquino, 2010 Jul 30, again 2011 Jul 2)
Patch to add digits argument to round(). (Yasuhiro Matsumoto, 2015 Apr 26)
Can assign to s:type when a function s:type has been defined.
Also the other way around: define a function while a variable with that name
was already defined.
(Yasuhiro Matsumoto, 2014 Nov 3)
Patch for ordered dict. (Ozaki Kiichi, 2015 May 7)
Patch to make closed folds line up. (Charles Campbell, 2014 Sep 12)
Remark from Roland Eggner: does it cause crashes? (2014 Dec 12)
Updated patch by Roland Eggner, Dec 16
@@ -261,8 +317,10 @@ Patch to add argument to :cquit. (Thinca, 2014 Oct 12)
No error for missing endwhile. (ZyX, 2014 Mar 20)
The entries added by matchaddpos() are returned by getmatches() but can't be
set with setmatches(). (lcd47, 2014 Jun 29)
Patch to make extend() fail early when it might fail at some point.
(Olaf Dabrunz, 2015 May 2) Makes extend() slower, do we still want it?
Perhaps only the checks that can be done without looping over the dict or
arguments.
Patch to add :arglocal and :arglists. (Marcin Szamotulski, 2014 Aug 6)
@@ -382,8 +440,6 @@ Remark on the docs. Should not be a compile time feature. But then what?
Completion of ":e" is ":earlier", should be ":edit". Complete to the matching
command instead of doing this alphabetically. (Mikel Jorgensen)
Patch to add v:completed_item. (Shougo Matsu, 2013 Nov 29).
Patch to get MSVC version in a nicer way. (Ken Takata, 2014 Jul 24)
Patch to define macros for hardcoded values. (Elias Diem, 2013 Dec 14)
@@ -518,12 +574,6 @@ Dialog is too big on Linux too. (David Fishburn, 2013 Sep 2)
Patch to check whether a buffer is quickfix or a location list.
(Yasuhiro Matsumoto, 2014 Dec 9)
Patch to allow setting w:quickfix_title via setqflist() and setloclist()
functions. (Christian Brabandt, 2013 May 8, update May 21)
Patch to add getlocstack() / setlocstack(). (Christian Brabandt, 2013 May 14)
Second one. Update May 22.
Update by Daniel Hahler, 2014 Jul 4, Aug 14, Oct 14, Oct 15.
Patch to make fold updates much faster. (Christian Brabandt, 2012 Dec)
Issue 54: document behavior of -complete, also expands arg.
@@ -572,10 +622,6 @@ signs? Patch by Christian Brabandt, 2013 Aug 22.
Patch to remove flicker from popup menu. (Yasuhiro Matsumoto, 2013 Aug 15)
Patch to add 'completeselect' option. Specifies how to select a candidate in
insert completion. (Shougo, 2013 May 29)
Update to add to existing 'completeopt'. 2013 May 30
Problem with refresh:always in completion. (Tyler Wade, 2013 Mar 17)
b:undo_ftplugin cannot call a script-local function. (Boris Danilov, 2013 Jan
@@ -1002,9 +1048,6 @@ Patch for GVimExt to show an icon. (Dominik Riebeling, 2010 Nov 7)
When writing a file > 2Gbyte, the reported number of bytes is negative.
(Antonio Colombo, 2010 Dec 18)
Patch: Let rare word highlighting overrule good word highlighting.
(Jakson A. Aquino, 2010 Jul 30, again 2011 Jul 2)
When 'lines' is 25 and 'scrolloff' is 12, "j" scrolls zero or two lines
instead of one. (Constantin Pan, 2010 Sep 10)
+4 -5
View File
@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2015 Apr 06
" Last Change: 2015 Jun 06
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
@@ -499,7 +499,7 @@ au BufNewFile,BufRead *.prg
\ endif
" Clojure
au BufNewFile,BufRead *.clj,*.cljs setf clojure
au BufNewFile,BufRead *.clj,*.cljs,*.cljx,*.cljc setf clojure
" Cmake
au BufNewFile,BufRead CMakeLists.txt,*.cmake,*.cmake.in setf cmake
@@ -776,10 +776,9 @@ 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/MERGE_MSG setf gitcommit
au BufNewFile,BufRead COMMIT_EDITMSG setf gitcommit
au BufNewFile,BufRead MERGE_MSG setf gitcommit
au BufNewFile,BufRead *.git/config,.gitconfig,.gitmodules setf gitconfig
au BufNewFile,BufRead *.git/modules/*/COMMIT_EDITMSG setf gitcommit
au BufNewFile,BufRead *.git/modules/*/config setf gitconfig
au BufNewFile,BufRead */.config/git/config setf gitconfig
if !empty($XDG_CONFIG_HOME)
+11 -2
View File
@@ -1,6 +1,10 @@
" Vim filetype plugin file
" Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2008-07-09
" Vim syntax file
" Maintainer: Christian Brabandt <cb@256bit.org>
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2015-05-29
" License: Vim (see :h license)
" Repository: https://github.com/chrisbra/vim-kconfig
if exists("b:did_ftplugin")
finish
@@ -14,5 +18,10 @@ let b:undo_ftplugin = "setl com< cms< fo<"
setlocal comments=:# commentstring=#\ %s formatoptions-=t formatoptions+=croql
" For matchit.vim
if exists("loaded_matchit")
let b:match_words = '^\<menu\>:\<endmenu\>,^\<if\>:\<endif\>,^\<choice\>:\<endchoice\>'
endif
let &cpo = s:cpo_save
unlet s:cpo_save
+31 -3
View File
@@ -2,7 +2,7 @@
" Filename: spec.vim
" Maintainer: Igor Gnatenko i.gnatenko.brain@gmail.com
" Former Maintainer: Gustavo Niemeyer <niemeyer@conectiva.com> (until March 2014)
" Last Change: Fri Feb 20 16:01 MSK 2014 Igor Gnatenko
" Last Change: Mon Jun 01 21:15 MSK 2015 Igor Gnatenko
if exists("b:did_ftplugin")
finish
@@ -22,11 +22,36 @@ if !hasmapto("call <SID>SpecChangelog(\"\")<CR>")
noremap <buffer> <unique> <script> <Plug>SpecChangelog :call <SID>SpecChangelog("")<CR>
endif
if !exists("*s:GetRelVer")
function! s:GetRelVer()
if has('python')
python << PYEND
import sys, datetime, shutil, tempfile
import vim
try:
import rpm
except ImportError:
pass
else:
specfile = vim.current.buffer.name
if specfile:
spec = rpm.spec(specfile)
headers = spec.packages[0].header
version = headers['Version']
release = ".".join(headers['Release'].split(".")[:-1])
vim.command("let ver = " + version)
vim.command("let rel = " + release)
PYEND
endif
endfunction
endif
if !exists("*s:SpecChangelog")
function s:SpecChangelog(format)
if strlen(a:format) == 0
if !exists("g:spec_chglog_format")
let email = input("Email address: ")
let email = input("Name <email address>: ")
let g:spec_chglog_format = "%a %b %d %Y " . l:email
echo "\r"
endif
@@ -71,6 +96,9 @@ if !exists("*s:SpecChangelog")
else
let include_release_info = 0
endif
call s:GetRelVer()
if (chgline == -1)
let option = confirm("Can't find %changelog. Create one? ","&End of file\n&Here\n&Cancel",3)
if (option == 1)
@@ -85,7 +113,7 @@ if !exists("*s:SpecChangelog")
endif
endif
if (chgline != -1)
let parsed_format = "* ".strftime(format)
let parsed_format = "* ".strftime(format)." - ".ver."-".rel
let release_info = "+ ".name."-".ver."-".rel
let wrong_format = 0
let wrong_release = 0
+6 -3
View File
@@ -1,7 +1,10 @@
" Vim filetype plugin file
" Language: Zsh shell script
" Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2011-01-23
" Language: Zsh shell script
" Maintainer: Christian Brabandt <cb@256bit.org>
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2015-05-29
" License: Vim (see :h license)
" Repository: https://github.com/chrisbra/vim-zsh
if exists("b:did_ftplugin")
finish
+2 -2
View File
@@ -2,7 +2,7 @@
" Header: "{{{
" Maintainer: Bram Moolenaar
" Original Author: Andy Wokula <anwoku@yahoo.de>
" Last Change: 2015 Jan 11
" Last Change: 2015 Jun 12
" Version: 1.0
" Description: HTML indent script with cached state for faster indenting on a
" range of lines.
@@ -94,7 +94,7 @@ func! HtmlIndent_CheckUserSettings()
let autotags = g:html_indent_autotags
endif
let b:hi_removed_tags = {}
if autotags
if len(autotags) > 0
call s:RemoveITags(b:hi_removed_tags, split(autotags, ","))
endif
+4 -2
View File
@@ -1,7 +1,7 @@
" Vim indent file
" Language: Javascript
" Maintainer: None! Wanna improve this?
" Last Change: 2007 Jan 22
" Maintainer: Going to be Darrick Wiebe
" Last Change: 2015 Jun 09
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
@@ -12,5 +12,7 @@ let b:did_indent = 1
" C indenting is not too bad.
setlocal cindent
setlocal cinoptions+=j1,J1
setlocal cinkeys-=0#
setlocal cinkeys+=0]
let b:undo_indent = "setl cin<"
+416 -393
View File
@@ -1,12 +1,12 @@
" Vim indent file
" Language: R
" Author: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Last Change: Fri Feb 15, 2013 08:11PM
" Last Change: Thu Mar 26, 2015 05:36PM
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
finish
endif
let b:did_indent = 1
@@ -15,478 +15,501 @@ setlocal indentexpr=GetRIndent()
" Only define the function once.
if exists("*GetRIndent")
finish
finish
endif
" Options to make the indentation more similar to Emacs/ESS:
if !exists("g:r_indent_align_args")
let g:r_indent_align_args = 1
let g:r_indent_align_args = 1
endif
if !exists("g:r_indent_ess_comments")
let g:r_indent_ess_comments = 0
let g:r_indent_ess_comments = 0
endif
if !exists("g:r_indent_comment_column")
let g:r_indent_comment_column = 40
let g:r_indent_comment_column = 40
endif
if ! exists("g:r_indent_ess_compatible")
let g:r_indent_ess_compatible = 0
let g:r_indent_ess_compatible = 0
endif
if ! exists("g:r_indent_op_pattern")
let g:r_indent_op_pattern = '\(+\|-\|\*\|/\|=\|\~\|%\)$'
endif
function s:RDelete_quotes(line)
let i = 0
let j = 0
let line1 = ""
let llen = strlen(a:line)
while i < llen
if a:line[i] == '"'
let i += 1
let line1 = line1 . 's'
while !(a:line[i] == '"' && ((i > 1 && a:line[i-1] == '\' && a:line[i-2] == '\') || a:line[i-1] != '\')) && i < llen
let i += 1
endwhile
if a:line[i] == '"'
let i += 1
endif
else
if a:line[i] == "'"
let i += 1
let line1 = line1 . 's'
while !(a:line[i] == "'" && ((i > 1 && a:line[i-1] == '\' && a:line[i-2] == '\') || a:line[i-1] != '\')) && i < llen
let i += 1
endwhile
if a:line[i] == "'"
let i += 1
endif
else
if a:line[i] == "`"
let i += 1
let line1 = line1 . 's'
while a:line[i] != "`" && i < llen
let i += 1
endwhile
if a:line[i] == "`"
let i += 1
endif
endif
endif
endif
if i == llen
break
endif
let line1 = line1 . a:line[i]
let j += 1
let i = 0
let j = 0
let line1 = ""
let llen = strlen(a:line)
while i < llen
if a:line[i] == '"'
let i += 1
let line1 = line1 . 's'
while !(a:line[i] == '"' && ((i > 1 && a:line[i-1] == '\' && a:line[i-2] == '\') || a:line[i-1] != '\')) && i < llen
let i += 1
endwhile
return line1
endwhile
if a:line[i] == '"'
let i += 1
endif
else
if a:line[i] == "'"
let i += 1
let line1 = line1 . 's'
while !(a:line[i] == "'" && ((i > 1 && a:line[i-1] == '\' && a:line[i-2] == '\') || a:line[i-1] != '\')) && i < llen
let i += 1
endwhile
if a:line[i] == "'"
let i += 1
endif
else
if a:line[i] == "`"
let i += 1
let line1 = line1 . 's'
while a:line[i] != "`" && i < llen
let i += 1
endwhile
if a:line[i] == "`"
let i += 1
endif
endif
endif
endif
if i == llen
break
endif
let line1 = line1 . a:line[i]
let j += 1
let i += 1
endwhile
return line1
endfunction
" Convert foo(bar()) int foo()
function s:RDelete_parens(line)
if s:Get_paren_balance(a:line, "(", ")") != 0
return a:line
endif
let i = 0
let j = 0
let line1 = ""
let llen = strlen(a:line)
while i < llen
let line1 = line1 . a:line[i]
if a:line[i] == '('
let nop = 1
while nop > 0 && i < llen
let i += 1
if a:line[i] == ')'
let nop -= 1
else
if a:line[i] == '('
let nop += 1
endif
endif
endwhile
let line1 = line1 . a:line[i]
endif
if s:Get_paren_balance(a:line, "(", ")") != 0
return a:line
endif
let i = 0
let j = 0
let line1 = ""
let llen = strlen(a:line)
while i < llen
let line1 = line1 . a:line[i]
if a:line[i] == '('
let nop = 1
while nop > 0 && i < llen
let i += 1
endwhile
return line1
if a:line[i] == ')'
let nop -= 1
else
if a:line[i] == '('
let nop += 1
endif
endif
endwhile
let line1 = line1 . a:line[i]
endif
let i += 1
endwhile
return line1
endfunction
function! s:Get_paren_balance(line, o, c)
let line2 = substitute(a:line, a:o, "", "g")
let openp = strlen(a:line) - strlen(line2)
let line3 = substitute(line2, a:c, "", "g")
let closep = strlen(line2) - strlen(line3)
return openp - closep
let line2 = substitute(a:line, a:o, "", "g")
let openp = strlen(a:line) - strlen(line2)
let line3 = substitute(line2, a:c, "", "g")
let closep = strlen(line2) - strlen(line3)
return openp - closep
endfunction
function! s:Get_matching_brace(linenr, o, c, delbrace)
let line = SanitizeRLine(getline(a:linenr))
if a:delbrace == 1
let line = substitute(line, '{$', "", "")
endif
let pb = s:Get_paren_balance(line, a:o, a:c)
let i = a:linenr
while pb != 0 && i > 1
let i -= 1
let pb += s:Get_paren_balance(SanitizeRLine(getline(i)), a:o, a:c)
endwhile
return i
let line = SanitizeRLine(getline(a:linenr))
if a:delbrace == 1
let line = substitute(line, '{$', "", "")
endif
let pb = s:Get_paren_balance(line, a:o, a:c)
let i = a:linenr
while pb != 0 && i > 1
let i -= 1
let pb += s:Get_paren_balance(SanitizeRLine(getline(i)), a:o, a:c)
endwhile
return i
endfunction
" This function is buggy because there 'if's without 'else'
" It must be rewritten relying more on indentation
function! s:Get_matching_if(linenr, delif)
" let filenm = expand("%")
" call writefile([filenm], "/tmp/matching_if_" . a:linenr)
let line = SanitizeRLine(getline(a:linenr))
if a:delif
let line = substitute(line, "if", "", "g")
endif
let elsenr = 0
let i = a:linenr
let ifhere = 0
while i > 0
let line2 = substitute(line, '\<else\>', "xxx", "g")
let elsenr += strlen(line) - strlen(line2)
if line =~ '.*\s*if\s*()' || line =~ '.*\s*if\s*()'
let elsenr -= 1
if elsenr == 0
let ifhere = i
break
endif
endif
let i -= 1
let line = SanitizeRLine(getline(i))
endwhile
if ifhere
return ifhere
else
return a:linenr
let line = SanitizeRLine(getline(a:linenr))
if a:delif
let line = substitute(line, "if", "", "g")
endif
let elsenr = 0
let i = a:linenr
let ifhere = 0
while i > 0
let line2 = substitute(line, '\<else\>', "xxx", "g")
let elsenr += strlen(line) - strlen(line2)
if line =~ '.*\s*if\s*()' || line =~ '.*\s*if\s*()'
let elsenr -= 1
if elsenr == 0
let ifhere = i
break
endif
endif
let i -= 1
let line = SanitizeRLine(getline(i))
endwhile
if ifhere
return ifhere
else
return a:linenr
endif
endfunction
function! s:Get_last_paren_idx(line, o, c, pb)
let blc = a:pb
let line = substitute(a:line, '\t', s:curtabstop, "g")
let theidx = -1
let llen = strlen(line)
let idx = 0
while idx < llen
if line[idx] == a:o
let blc -= 1
if blc == 0
let theidx = idx
endif
else
if line[idx] == a:c
let blc += 1
endif
endif
let idx += 1
endwhile
return theidx + 1
let blc = a:pb
let line = substitute(a:line, '\t', s:curtabstop, "g")
let theidx = -1
let llen = strlen(line)
let idx = 0
while idx < llen
if line[idx] == a:o
let blc -= 1
if blc == 0
let theidx = idx
endif
else
if line[idx] == a:c
let blc += 1
endif
endif
let idx += 1
endwhile
return theidx + 1
endfunction
" Get previous relevant line. Search back until getting a line that isn't
" comment or blank
function s:Get_prev_line(lineno)
let lnum = a:lineno - 1
let lnum = a:lineno - 1
let data = getline( lnum )
while lnum > 0 && (data =~ '^\s*#' || data =~ '^\s*$')
let lnum = lnum - 1
let data = getline( lnum )
while lnum > 0 && (data =~ '^\s*#' || data =~ '^\s*$')
let lnum = lnum - 1
let data = getline( lnum )
endwhile
return lnum
endwhile
return lnum
endfunction
" This function is also used by r-plugin/common_global.vim
" Delete from '#' to the end of the line, unless the '#' is inside a string.
function SanitizeRLine(line)
let newline = s:RDelete_quotes(a:line)
let newline = s:RDelete_parens(newline)
let newline = substitute(newline, '#.*', "", "")
let newline = substitute(newline, '\s*$', "", "")
return newline
let newline = s:RDelete_quotes(a:line)
let newline = s:RDelete_parens(newline)
let newline = substitute(newline, '#.*', "", "")
let newline = substitute(newline, '\s*$', "", "")
if &filetype == "rhelp" && newline =~ '^\\method{.*}{.*}(.*'
let newline = substitute(newline, '^\\method{\(.*\)}{.*}', '\1', "")
endif
return newline
endfunction
function GetRIndent()
let clnum = line(".") " current line
let clnum = line(".") " current line
let cline = getline(clnum)
if cline =~ '^\s*#'
if g:r_indent_ess_comments == 1
if cline =~ '^\s*###'
return 0
endif
if cline !~ '^\s*##'
return g:r_indent_comment_column
endif
endif
endif
let cline = SanitizeRLine(cline)
if cline =~ '^\s*}' || cline =~ '^\s*}\s*)$'
let indline = s:Get_matching_brace(clnum, '{', '}', 1)
if indline > 0 && indline != clnum
let iline = SanitizeRLine(getline(indline))
if s:Get_paren_balance(iline, "(", ")") == 0 || iline =~ '(\s*{$'
return indent(indline)
else
let indline = s:Get_matching_brace(indline, '(', ')', 1)
return indent(indline)
endif
endif
endif
" Find the first non blank line above the current line
let lnum = s:Get_prev_line(clnum)
" Hit the start of the file, use zero indent.
if lnum == 0
let cline = getline(clnum)
if cline =~ '^\s*#'
if g:r_indent_ess_comments == 1
if cline =~ '^\s*###'
return 0
endif
if cline !~ '^\s*##'
return g:r_indent_comment_column
endif
endif
endif
let line = SanitizeRLine(getline(lnum))
let cline = SanitizeRLine(cline)
if &filetype == "rhelp"
if cline =~ '^\\dontshow{' || cline =~ '^\\dontrun{' || cline =~ '^\\donttest{' || cline =~ '^\\testonly{'
return 0
endif
if line =~ '^\\examples{' || line =~ '^\\usage{' || line =~ '^\\dontshow{' || line =~ '^\\dontrun{' || line =~ '^\\donttest{' || line =~ '^\\testonly{'
return 0
endif
if line =~ '^\\method{.*}{.*}(.*'
let line = substitute(line, '^\\method{\(.*\)}{.*}', '\1', "")
endif
if cline =~ '^\s*}' || cline =~ '^\s*}\s*)$'
let indline = s:Get_matching_brace(clnum, '{', '}', 1)
if indline > 0 && indline != clnum
let iline = SanitizeRLine(getline(indline))
if s:Get_paren_balance(iline, "(", ")") == 0 || iline =~ '(\s*{$'
return indent(indline)
else
let indline = s:Get_matching_brace(indline, '(', ')', 1)
return indent(indline)
endif
endif
endif
if cline =~ '^\s*{'
if g:r_indent_ess_compatible && line =~ ')$'
let nlnum = lnum
let nline = line
while s:Get_paren_balance(nline, '(', ')') < 0
let nlnum = s:Get_prev_line(nlnum)
let nline = SanitizeRLine(getline(nlnum)) . nline
endwhile
if nline =~ '^\s*function\s*(' && indent(nlnum) == &sw
return 0
endif
endif
if s:Get_paren_balance(line, "(", ")") == 0
return indent(lnum)
endif
" Find the first non blank line above the current line
let lnum = s:Get_prev_line(clnum)
" Hit the start of the file, use zero indent.
if lnum == 0
return 0
endif
let line = SanitizeRLine(getline(lnum))
if &filetype == "rhelp"
if cline =~ '^\\dontshow{' || cline =~ '^\\dontrun{' || cline =~ '^\\donttest{' || cline =~ '^\\testonly{'
return 0
endif
" line is an incomplete command:
if line =~ '\<\(if\|while\|for\|function\)\s*()$' || line =~ '\<else$' || line =~ '<-$'
return indent(lnum) + &sw
if line =~ '^\\examples{' || line =~ '^\\usage{' || line =~ '^\\dontshow{' || line =~ '^\\dontrun{' || line =~ '^\\donttest{' || line =~ '^\\testonly{'
return 0
endif
endif
" Deal with () and []
if &filetype == "rnoweb" && line =~ "^<<.*>>="
return 0
endif
let pb = s:Get_paren_balance(line, '(', ')')
if cline =~ '^\s*{'
if g:r_indent_ess_compatible && line =~ ')$'
let nlnum = lnum
let nline = line
while s:Get_paren_balance(nline, '(', ')') < 0
let nlnum = s:Get_prev_line(nlnum)
let nline = SanitizeRLine(getline(nlnum)) . nline
endwhile
if nline =~ '^\s*function\s*(' && indent(nlnum) == &sw
return 0
endif
endif
if s:Get_paren_balance(line, "(", ")") == 0
return indent(lnum)
endif
endif
if line =~ '^\s*{$' || line =~ '(\s*{' || (pb == 0 && (line =~ '{$' || line =~ '(\s*{$'))
return indent(lnum) + &sw
" line is an incomplete command:
if line =~ '\<\(if\|while\|for\|function\)\s*()$' || line =~ '\<else$' || line =~ '<-$'
return indent(lnum) + &sw
endif
" Deal with () and []
let pb = s:Get_paren_balance(line, '(', ')')
if line =~ '^\s*{$' || line =~ '(\s*{' || (pb == 0 && (line =~ '{$' || line =~ '(\s*{$'))
return indent(lnum) + &sw
endif
let s:curtabstop = repeat(' ', &tabstop)
if g:r_indent_align_args == 1
if pb > 0 && line =~ '{$'
return s:Get_last_paren_idx(line, '(', ')', pb) + &sw
endif
let bb = s:Get_paren_balance(line, '[', ']')
let s:curtabstop = repeat(' ', &tabstop)
if g:r_indent_align_args == 1
if pb == 0 && bb == 0 && (line =~ '.*[,&|\-\*+<>]$' || cline =~ '^\s*[,&|\-\*+<>]')
return indent(lnum)
endif
if pb > 0
if &filetype == "rhelp"
let ind = s:Get_last_paren_idx(line, '(', ')', pb)
else
let ind = s:Get_last_paren_idx(getline(lnum), '(', ')', pb)
endif
return ind
endif
if pb < 0 && line =~ '.*[,&|\-\*+<>]$'
let lnum = s:Get_prev_line(lnum)
while pb < 1 && lnum > 0
let line = SanitizeRLine(getline(lnum))
let line = substitute(line, '\t', s:curtabstop, "g")
let ind = strlen(line)
while ind > 0
if line[ind] == ')'
let pb -= 1
else
if line[ind] == '('
let pb += 1
endif
endif
if pb == 1
return ind + 1
endif
let ind -= 1
endwhile
let lnum -= 1
endwhile
return 0
endif
if bb > 0
let ind = s:Get_last_paren_idx(getline(lnum), '[', ']', bb)
return ind
endif
if pb > 0
if &filetype == "rhelp"
let ind = s:Get_last_paren_idx(line, '(', ')', pb)
else
let ind = s:Get_last_paren_idx(getline(lnum), '(', ')', pb)
endif
return ind
endif
let post_block = 0
if line =~ '}$'
let lnum = s:Get_matching_brace(lnum, '{', '}', 0)
if pb < 0 && line =~ '.*[,&|\-\*+<>]$'
let lnum = s:Get_prev_line(lnum)
while pb < 1 && lnum > 0
let line = SanitizeRLine(getline(lnum))
if lnum > 0 && line =~ '^\s*{'
let lnum = s:Get_prev_line(lnum)
let line = SanitizeRLine(getline(lnum))
endif
let pb = s:Get_paren_balance(line, '(', ')')
let post_block = 1
endif
let post_fun = 0
if pb < 0 && line !~ ')\s*[,&|\-\*+<>]$'
let post_fun = 1
while pb < 0 && lnum > 0
let lnum -= 1
let linepiece = SanitizeRLine(getline(lnum))
let pb += s:Get_paren_balance(linepiece, "(", ")")
let line = linepiece . line
endwhile
if line =~ '{$' && post_block == 0
return indent(lnum) + &sw
endif
" Now we can do some tests again
if cline =~ '^\s*{'
return indent(lnum)
endif
if post_block == 0
let newl = SanitizeRLine(line)
if newl =~ '\<\(if\|while\|for\|function\)\s*()$' || newl =~ '\<else$' || newl =~ '<-$'
return indent(lnum) + &sw
let line = substitute(line, '\t', s:curtabstop, "g")
let ind = strlen(line)
while ind > 0
if line[ind] == ')'
let pb -= 1
else
if line[ind] == '('
let pb += 1
endif
endif
endif
if cline =~ '^\s*else'
if line =~ '<-\s*if\s*()'
return indent(lnum) + &sw
else
if line =~ '\<if\s*()'
return indent(lnum)
else
return indent(lnum) - &sw
endif
endif
endif
if bb < 0 && line =~ '.*]'
while bb < 0 && lnum > 0
let lnum -= 1
let linepiece = SanitizeRLine(getline(lnum))
let bb += s:Get_paren_balance(linepiece, "[", "]")
let line = linepiece . line
endif
if pb == 1
return ind + 1
endif
let ind -= 1
endwhile
let line = s:RDelete_parens(line)
let lnum -= 1
endwhile
return 0
endif
let plnum = s:Get_prev_line(lnum)
let ppost_else = 0
if plnum > 0
let pline = SanitizeRLine(getline(plnum))
let ppost_block = 0
if pline =~ '}$'
let ppost_block = 1
let plnum = s:Get_matching_brace(plnum, '{', '}', 0)
let pline = SanitizeRLine(getline(plnum))
if pline =~ '^\s*{$' && plnum > 0
let plnum = s:Get_prev_line(plnum)
let pline = SanitizeRLine(getline(plnum))
endif
endif
if pline =~ 'else$'
let ppost_else = 1
let plnum = s:Get_matching_if(plnum, 0)
let pline = SanitizeRLine(getline(plnum))
endif
if pline =~ '^\s*else\s*if\s*('
let pplnum = s:Get_prev_line(plnum)
let ppline = SanitizeRLine(getline(pplnum))
while ppline =~ '^\s*else\s*if\s*(' || ppline =~ '^\s*if\s*()\s*\S$'
let plnum = pplnum
let pline = ppline
let pplnum = s:Get_prev_line(plnum)
let ppline = SanitizeRLine(getline(pplnum))
endwhile
while ppline =~ '\<\(if\|while\|for\|function\)\s*()$' || ppline =~ '\<else$' || ppline =~ '<-$'
let plnum = pplnum
let pline = ppline
let pplnum = s:Get_prev_line(plnum)
let ppline = SanitizeRLine(getline(pplnum))
endwhile
endif
let ppb = s:Get_paren_balance(pline, '(', ')')
if ppb < 0 && (pline =~ ')\s*{$' || pline =~ ')$')
while ppb < 0 && plnum > 0
let plnum -= 1
let linepiece = SanitizeRLine(getline(plnum))
let ppb += s:Get_paren_balance(linepiece, "(", ")")
let pline = linepiece . pline
endwhile
let pline = s:RDelete_parens(pline)
endif
if bb > 0
let ind = s:Get_last_paren_idx(getline(lnum), '[', ']', bb)
return ind
endif
endif
let ind = indent(lnum)
let pind = indent(plnum)
if g:r_indent_align_args == 0 && pb != 0
let ind += pb * &sw
return ind
let post_block = 0
if line =~ '}$'
let lnum = s:Get_matching_brace(lnum, '{', '}', 0)
let line = SanitizeRLine(getline(lnum))
if lnum > 0 && line =~ '^\s*{'
let lnum = s:Get_prev_line(lnum)
let line = SanitizeRLine(getline(lnum))
endif
let pb = s:Get_paren_balance(line, '(', ')')
let post_block = 1
endif
if g:r_indent_align_args == 0 && bb != 0
let ind += bb * &sw
return ind
" Indent after operator pattern
let olnum = s:Get_prev_line(lnum)
let oline = getline(olnum)
if olnum > 0
if line =~ g:r_indent_op_pattern
if oline =~ g:r_indent_op_pattern
return indent(lnum)
else
return indent(lnum) + &sw
endif
else
if oline =~ g:r_indent_op_pattern
return indent(lnum) - &sw
endif
endif
endif
if ind == pind || (ind == (pind + &sw) && pline =~ '{$' && ppost_else == 0)
return ind
endif
let pline = getline(plnum)
let pbb = s:Get_paren_balance(pline, '[', ']')
while pind < ind && plnum > 0 && ppb == 0 && pbb == 0
let ind = pind
let plnum = s:Get_prev_line(plnum)
let pline = getline(plnum)
let ppb = s:Get_paren_balance(pline, '(', ')')
let pbb = s:Get_paren_balance(pline, '[', ']')
while pline =~ '^\s*else'
let plnum = s:Get_matching_if(plnum, 1)
let pline = getline(plnum)
let ppb = s:Get_paren_balance(pline, '(', ')')
let pbb = s:Get_paren_balance(pline, '[', ']')
endwhile
let pind = indent(plnum)
if ind == (pind + &sw) && pline =~ '{$'
return ind
endif
let post_fun = 0
if pb < 0 && line !~ ')\s*[,&|\-\*+<>]$'
let post_fun = 1
while pb < 0 && lnum > 0
let lnum -= 1
let linepiece = SanitizeRLine(getline(lnum))
let pb += s:Get_paren_balance(linepiece, "(", ")")
let line = linepiece . line
endwhile
if line =~ '{$' && post_block == 0
return indent(lnum) + &sw
endif
" Now we can do some tests again
if cline =~ '^\s*{'
return indent(lnum)
endif
if post_block == 0
let newl = SanitizeRLine(line)
if newl =~ '\<\(if\|while\|for\|function\)\s*()$' || newl =~ '\<else$' || newl =~ '<-$'
return indent(lnum) + &sw
endif
endif
endif
if cline =~ '^\s*else'
if line =~ '<-\s*if\s*()'
return indent(lnum) + &sw
else
if line =~ '\<if\s*()'
return indent(lnum)
else
return indent(lnum) - &sw
endif
endif
endif
let bb = s:Get_paren_balance(line, '[', ']')
if bb < 0 && line =~ '.*]'
while bb < 0 && lnum > 0
let lnum -= 1
let linepiece = SanitizeRLine(getline(lnum))
let bb += s:Get_paren_balance(linepiece, "[", "]")
let line = linepiece . line
endwhile
let line = s:RDelete_parens(line)
endif
let plnum = s:Get_prev_line(lnum)
let ppost_else = 0
if plnum > 0
let pline = SanitizeRLine(getline(plnum))
let ppost_block = 0
if pline =~ '}$'
let ppost_block = 1
let plnum = s:Get_matching_brace(plnum, '{', '}', 0)
let pline = SanitizeRLine(getline(plnum))
if pline =~ '^\s*{$' && plnum > 0
let plnum = s:Get_prev_line(plnum)
let pline = SanitizeRLine(getline(plnum))
endif
endif
if pline =~ 'else$'
let ppost_else = 1
let plnum = s:Get_matching_if(plnum, 0)
let pline = SanitizeRLine(getline(plnum))
endif
if pline =~ '^\s*else\s*if\s*('
let pplnum = s:Get_prev_line(plnum)
let ppline = SanitizeRLine(getline(pplnum))
while ppline =~ '^\s*else\s*if\s*(' || ppline =~ '^\s*if\s*()\s*\S$'
let plnum = pplnum
let pline = ppline
let pplnum = s:Get_prev_line(plnum)
let ppline = SanitizeRLine(getline(pplnum))
endwhile
while ppline =~ '\<\(if\|while\|for\|function\)\s*()$' || ppline =~ '\<else$' || ppline =~ '<-$'
let plnum = pplnum
let pline = ppline
let pplnum = s:Get_prev_line(plnum)
let ppline = SanitizeRLine(getline(pplnum))
endwhile
endif
let ppb = s:Get_paren_balance(pline, '(', ')')
if ppb < 0 && (pline =~ ')\s*{$' || pline =~ ')$')
while ppb < 0 && plnum > 0
let plnum -= 1
let linepiece = SanitizeRLine(getline(plnum))
let ppb += s:Get_paren_balance(linepiece, "(", ")")
let pline = linepiece . pline
endwhile
let pline = s:RDelete_parens(pline)
endif
endif
let ind = indent(lnum)
let pind = indent(plnum)
if g:r_indent_align_args == 0 && pb != 0
let ind += pb * &sw
return ind
endif
if g:r_indent_align_args == 0 && bb != 0
let ind += bb * &sw
return ind
endif
if ind == pind || (ind == (pind + &sw) && pline =~ '{$' && ppost_else == 0)
return ind
endif
let pline = getline(plnum)
let pbb = s:Get_paren_balance(pline, '[', ']')
while pind < ind && plnum > 0 && ppb == 0 && pbb == 0
let ind = pind
let plnum = s:Get_prev_line(plnum)
let pline = getline(plnum)
let ppb = s:Get_paren_balance(pline, '(', ')')
let pbb = s:Get_paren_balance(pline, '[', ']')
while pline =~ '^\s*else'
let plnum = s:Get_matching_if(plnum, 1)
let pline = getline(plnum)
let ppb = s:Get_paren_balance(pline, '(', ')')
let pbb = s:Get_paren_balance(pline, '[', ']')
endwhile
let pind = indent(plnum)
if ind == (pind + &sw) && pline =~ '{$'
return ind
endif
endwhile
return ind
endfunction
" vim: sw=4
" vim: sw=2
+6 -10
View File
@@ -1,7 +1,7 @@
" Vim indent file
" Language: R Documentation (Help), *.Rd
" Author: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Last Change: Wed Jul 09, 2014 07:34PM
" Last Change: Thu Oct 16, 2014 07:07AM
" Only load this indent file when no other was loaded.
@@ -12,22 +12,18 @@ runtime indent/r.vim
let s:RIndent = function(substitute(&indentexpr, "()", "", ""))
let b:did_indent = 1
setlocal indentkeys=0{,0},:,!^F,o,O,e
setlocal indentexpr=GetRHelpIndent()
" Only define the function once.
if exists("*GetRHelpIndent")
finish
endif
setlocal noautoindent
setlocal nocindent
setlocal nosmartindent
setlocal nolisp
setlocal indentkeys=0{,0},:,!^F,o,O,e
setlocal indentexpr=GetCorrectRHelpIndent()
" Only define the functions once.
if exists("*GetRHelpIndent")
finish
endif
function s:SanitizeRHelpLine(line)
let newline = substitute(a:line, '\\\\', "x", "g")
let newline = substitute(newline, '\\{', "x", "g")
+3 -3
View File
@@ -1,7 +1,7 @@
" Vim indent file
" Language: Rmd
" Author: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Last Change: Wed Jul 09, 2014 07:33PM
" Last Change: Thu Jul 10, 2014 07:11PM
" Only load this indent file when no other was loaded.
@@ -33,10 +33,10 @@ function GetMdIndent()
endfunction
function GetRmdIndent()
if getline(".") =~ '^```{r .*}$' || getline(".") =~ '^```$'
if getline(".") =~ '^[ \t]*```{r .*}$' || getline(".") =~ '^[ \t]*```$'
return 0
endif
if search('^```{r', "bncW") > search('^```$', "bncW")
if search('^[ \t]*```{r', "bncW") > search('^[ \t]*```$', "bncW")
return s:RIndent()
else
return GetMdIndent()
+3 -2
View File
@@ -1,7 +1,7 @@
" Vim indent file
" Language: Rnoweb
" Author: Jakson Alves de Aquino <jalvesaq@gmail.com>
" Last Change: Wed Jul 09, 2014 07:28PM
" Last Change: Sun Mar 22, 2015 09:28AM
" Only load this indent file when no other was loaded.
@@ -23,7 +23,8 @@ if exists("*GetRnowebIndent")
endif
function GetRnowebIndent()
if getline(".") =~ "^<<.*>>=$"
let curline = getline(".")
if curline =~ '^<<.*>>=$' || curline =~ '^\s*@$'
return 0
endif
if search("^<<", "bncW") > search("^@", "bncW")
+6 -3
View File
@@ -1,7 +1,10 @@
" Vim indent file
" Language: Zsh Shell Script
" Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2006-04-19
" Language: Zsh shell script
" Maintainer: Christian Brabandt <cb@256bit.org>
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2015-05-29
" License: Vim (see :h license)
" Repository: https://github.com/chrisbra/vim-zsh
if exists("b:did_indent")
finish
+104
View File
@@ -0,0 +1,104 @@
" Vim Keymap file for russian characters, layout 'jcuken', MS Windows variant
" (slightly incompatible with XFree86 'ru' keymap - makes use of NUMERO SIGN)
" Useful mainly with utf-8 but may work with other encodings
" Derived from russian-jcuken.vim by Artem Chuprina <ran@ran.pp.ru>
" Typewriter variant of standart russian layout
" Maintainer: Denis Proskurin <danwerspb@gmail.com>
" Last Changed: 2015 May 15
" All characters are given literally, conversion to another encoding (e.g.,
" UTF-8) should work.
scriptencoding utf-8
let b:keymap_name = "ru"
loadkeymap
~ + CYRILLIC CAPITAL LETTER IO
` | CYRILLIC SMALL LETTER IO
F А CYRILLIC CAPITAL LETTER A
< Б CYRILLIC CAPITAL LETTER BE
D В CYRILLIC CAPITAL LETTER VE
U Г CYRILLIC CAPITAL LETTER GHE
L Д CYRILLIC CAPITAL LETTER DE
T Е CYRILLIC CAPITAL LETTER IE
: Ж CYRILLIC CAPITAL LETTER ZHE
P З CYRILLIC CAPITAL LETTER ZE
B И CYRILLIC CAPITAL LETTER I
Q Й CYRILLIC CAPITAL LETTER SHORT I
R К CYRILLIC CAPITAL LETTER KA
K Л CYRILLIC CAPITAL LETTER EL
V М CYRILLIC CAPITAL LETTER EM
Y Н CYRILLIC CAPITAL LETTER EN
J О CYRILLIC CAPITAL LETTER O
G П CYRILLIC CAPITAL LETTER PE
H Р CYRILLIC CAPITAL LETTER ER
C С CYRILLIC CAPITAL LETTER ES
N Т CYRILLIC CAPITAL LETTER TE
E У CYRILLIC CAPITAL LETTER U
A Ф CYRILLIC CAPITAL LETTER EF
{ Х CYRILLIC CAPITAL LETTER HA
W Ц CYRILLIC CAPITAL LETTER TSE
X Ч CYRILLIC CAPITAL LETTER CHE
I Ш CYRILLIC CAPITAL LETTER SHA
O Щ CYRILLIC CAPITAL LETTER SHCHA
} Ъ CYRILLIC CAPITAL LETTER HARD SIGN
S Ы CYRILLIC CAPITAL LETTER YERU
M Ь CYRILLIC CAPITAL LETTER SOFT SIGN
\" Э CYRILLIC CAPITAL LETTER E
> Ю CYRILLIC CAPITAL LETTER YU
Z Я CYRILLIC CAPITAL LETTER YA
f а CYRILLIC SMALL LETTER A
, б CYRILLIC SMALL LETTER BE
d в CYRILLIC SMALL LETTER VE
u г CYRILLIC SMALL LETTER GHE
l д CYRILLIC SMALL LETTER DE
t е CYRILLIC SMALL LETTER IE
; ж CYRILLIC SMALL LETTER ZHE
p з CYRILLIC SMALL LETTER ZE
b и CYRILLIC SMALL LETTER I
q й CYRILLIC SMALL LETTER SHORT I
r к CYRILLIC SMALL LETTER KA
k л CYRILLIC SMALL LETTER EL
v м CYRILLIC SMALL LETTER EM
y н CYRILLIC SMALL LETTER EN
j о CYRILLIC SMALL LETTER O
g п CYRILLIC SMALL LETTER PE
h р CYRILLIC SMALL LETTER ER
c с CYRILLIC SMALL LETTER ES
n т CYRILLIC SMALL LETTER TE
e у CYRILLIC SMALL LETTER U
a ф CYRILLIC SMALL LETTER EF
[ х CYRILLIC SMALL LETTER HA
w ц CYRILLIC SMALL LETTER TSE
x ч CYRILLIC SMALL LETTER CHE
i ш CYRILLIC SMALL LETTER SHA
o щ CYRILLIC SMALL LETTER SHCHA
] ъ CYRILLIC SMALL LETTER HARD SIGN
s ы CYRILLIC SMALL LETTER YERU
m ь CYRILLIC SMALL LETTER SOFT SIGN
' э CYRILLIC SMALL LETTER E
. ю CYRILLIC SMALL LETTER YU
z я CYRILLIC SMALL LETTER YA
@ "
# № NUMERO SIGN
$ ;
^ :
& ?
/ ё
? Ё
1
2 -
3 /
4 "
5 :
6 ,
7 .
8 _
9 ?
0 %
- !
= ;
\\ )
\| (
+1
View File
@@ -5,6 +5,7 @@ Look in the file for hints on how it can be disabled without deleting it.
getscriptPlugin.vim get latest version of Vim scripts
gzip.vim edit compressed files
logiPat.vim logical operators on patterns
matchparen.vim highlight paren matching the one under the cursor
netrwPlugin.vim edit files over a network and browse (remote) directories
rrhelper.vim used for --remote-wait editing
+335
View File
@@ -0,0 +1,335 @@
" LogiPat:
" Author: Charles E. Campbell
" Date: Mar 13, 2013
" Version: 3
" Purpose: to do Boolean-logic based regular expression pattern matching
" Copyright: Copyright (C) 1999-2011 Charles E. Campbell {{{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 most anything else that's free,
" LogiPat.vim is provided *as is* and comes with no warranty
" of any kind, either expressed or implied. By using this
" plugin, you agree that in no event will the copyright
" holder be liable for any damages resulting from the use
" of this software.
"
" Usage: {{{1
" :LogiPat ...
"
" Boolean logic supported:
" () grouping operators
" ! not the following pattern
" | logical or
" & logical and
" "..pattern.."
" Example: {{{1
" :LogiPat !("january"|"february")
" would match all strings not containing the strings january
" or february
" GetLatestVimScripts: 1290 1 :AutoInstall: LogiPat.vim
"
" Behold, you will conceive in your womb, and bring forth a son, {{{1
" and will call his name Jesus. He will be great, and will be
" called the Son of the Most High. The Lord God will give him the
" throne of his father, David, and he will reign over the house of
" Jacob forever. There will be no end to his kingdom. (Luke 1:31-33 WEB)
" ---------------------------------------------------------------------
" Load Once: {{{1
if &cp || exists("loaded_logipat")
finish
endif
let g:loaded_LogiPat = "v3"
let s:keepcpo = &cpo
set cpo&vim
"DechoRemOn
" ---------------------------------------------------------------------
" Public Interface: {{{1
com! -nargs=* LogiPat call LogiPat(<q-args>,1)
silent! com -nargs=* LP call LogiPat(<q-args>,1)
com! -nargs=+ ELP echomsg LogiPat(<q-args>)
com! -nargs=+ LogiPatFlags let s:LogiPatFlags="<args>"
silent! com -nargs=+ LPF let s:LogiPatFlags="<args>"
" =====================================================================
" Functions: {{{1
" ---------------------------------------------------------------------
" LogiPat: this function interprets the boolean-logic pattern {{{2
fun! LogiPat(pat,...)
" call Dfunc("LogiPat(pat<".a:pat.">)")
" LogiPat(pat,dosearch)
if a:0 > 0
let dosearch= a:1
else
let dosearch= 0
endif
let s:npatstack = 0
let s:nopstack = 0
let s:preclvl = 0
let expr = a:pat
" Lexer/Parser
while expr != ""
" call Decho("expr<".expr.">")
if expr =~ '^"'
" push a Pattern; accept "" as a single " in the pattern
let expr = substitute(expr,'^\s*"','','')
let pat = substitute(expr,'^\(\%([^"]\|\"\"\)\{-}\)"\([^"].*$\|$\)','\1','')
let pat = substitute(pat,'""','"','g')
let expr = substitute(expr,'^\(\%([^"]\|\"\"\)\{-}\)"\([^"].*$\|$\)','\2','')
let expr = substitute(expr,'^\s*','','')
" call Decho("pat<".pat."> expr<".expr.">")
call s:LP_PatPush('.*'.pat.'.*')
elseif expr =~ '^[!()|&]'
" push an operator
let op = strpart(expr,0,1)
let expr = strpart(expr,strlen(op))
" allow for those who can't resist doubling their and/or operators
if op =~ '[|&]' && expr[0] == op
let expr = strpart(expr,strlen(op))
endif
call s:LP_OpPush(op)
elseif expr =~ '^\s'
" skip whitespace
let expr= strpart(expr,1)
else
echoerr "operator<".strpart(expr,0,1)."> not supported (yet)"
let expr= strpart(expr,1)
endif
endwhile
" Final Execution
call s:LP_OpPush('Z')
let result= s:LP_PatPop(1)
" call Decho("result=".result)
" sanity checks and cleanup
if s:npatstack > 0
echoerr s:npatstack." patterns left on stack!"
let s:npatstack= 0
endif
if s:nopstack > 0
echoerr s:nopstack." operators left on stack!"
let s:nopstack= 0
endif
" perform the indicated search
if dosearch
if exists("s:LogiPatFlags")
" call Decho("search(result<".result."> LogiPatFlags<".s:LogiPatFlags.">)")
call search(result,s:LogiPatFlags)
else
" call Decho("search(result<".result.">)")
call search(result)
endif
let @/= result
endif
" call Dret("LogiPat ".result)
return result
endfun
" ---------------------------------------------------------------------
" s:String: Vim6.4 doesn't have string() {{{2
func! s:String(str)
return "'".escape(a:str, '"')."'"
endfunc
" ---------------------------------------------------------------------
" LP_PatPush: {{{2
fun! s:LP_PatPush(pat)
" call Dfunc("LP_PatPush(pat<".a:pat.">)")
let s:npatstack = s:npatstack + 1
let s:patstack_{s:npatstack} = a:pat
" call s:StackLook("patpush") "Decho
" call Dret("LP_PatPush : npatstack=".s:npatstack)
endfun
" ---------------------------------------------------------------------
" LP_PatPop: pop a number/variable from LogiPat's pattern stack {{{2
fun! s:LP_PatPop(lookup)
" call Dfunc("LP_PatPop(lookup=".a:lookup.")")
if s:npatstack > 0
let ret = s:patstack_{s:npatstack}
let s:npatstack = s:npatstack - 1
else
let ret= "---error---"
echoerr "(LogiPat) invalid expression"
endif
" call s:StackLook("patpop") "Decho
" call Dret("LP_PatPop ".ret)
return ret
endfun
" ---------------------------------------------------------------------
" LP_OpPush: {{{2
fun! s:LP_OpPush(op)
" call Dfunc("LP_OpPush(op<".a:op.">)")
" determine new operator's precedence level
if a:op == '('
let s:preclvl= s:preclvl + 10
let preclvl = s:preclvl
elseif a:op == ')'
let s:preclvl= s:preclvl - 10
if s:preclvl < 0
let s:preclvl= 0
echoerr "too many )s"
endif
let preclvl= s:preclvl
elseif a:op =~ '|'
let preclvl= s:preclvl + 2
elseif a:op =~ '&'
let preclvl= s:preclvl + 4
elseif a:op == '!'
let preclvl= s:preclvl + 6
elseif a:op == 'Z'
let preclvl= -1
else
echoerr "expr<".expr."> not supported (yet)"
let preclvl= s:preclvl
endif
" call Decho("new operator<".a:op."> preclvl=".preclvl)
" execute higher-precdence operators
" call Decho("execute higher-precedence operators")
call s:LP_Execute(preclvl)
" push new operator onto operator-stack
" call Decho("push new operator<".a:op."> onto stack with preclvl=".preclvl." at nopstack=".(s:nopstack+1))
if a:op =~ '!'
let s:nopstack = s:nopstack + 1
let s:opprec_{s:nopstack} = preclvl
let s:opstack_{s:nopstack} = a:op
elseif a:op =~ '|'
let s:nopstack = s:nopstack + 1
let s:opprec_{s:nopstack} = preclvl
let s:opstack_{s:nopstack} = a:op
elseif a:op == '&'
let s:nopstack = s:nopstack + 1
let s:opprec_{s:nopstack} = preclvl
let s:opstack_{s:nopstack} = a:op
endif
" call s:StackLook("oppush") "Decho
" call Dret("LP_OpPush : s:preclvl=".s:preclvl)
endfun
" ---------------------------------------------------------------------
" LP_Execute: execute operators from opstack using pattern stack {{{2
fun! s:LP_Execute(preclvl)
" call Dfunc("LP_Execute(preclvl=".a:preclvl.") npatstack=".s:npatstack." nopstack=".s:nopstack)
" execute all higher precedence operators
while s:nopstack > 0 && a:preclvl < s:opprec_{s:nopstack}
let op= s:opstack_{s:nopstack}
" call Decho("op<".op."> nop=".s:nopstack." [preclvl=".a:preclvl."] < [opprec_".s:nopstack."=".s:opprec_{s:nopstack}."]")
let s:nopstack = s:nopstack - 1
if op == '!'
let n1= s:LP_PatPop(1)
call s:LP_PatPush(s:LP_Not(n1))
elseif op == '|'
let n1= s:LP_PatPop(1)
let n2= s:LP_PatPop(1)
call s:LP_PatPush(s:LP_Or(n2,n1))
elseif op =~ '&'
let n1= s:LP_PatPop(1)
let n2= s:LP_PatPop(1)
call s:LP_PatPush(s:LP_And(n2,n1))
endif
" call s:StackLook("execute") "Decho
endwhile
" call Dret("LP_Execute")
endfun
" ---------------------------------------------------------------------
" LP_Not: writes a logical-not for a pattern {{{2
fun! s:LP_Not(pat)
" call Dfunc("LP_Not(pat<".a:pat.">)")
if a:pat =~ '^\.\*' && a:pat =~ '\.\*$'
let pat= substitute(a:pat,'^\.\*\(.*\)\.\*$','\1','')
let ret= '^\%(\%('.pat.'\)\@!.\)*$'
else
let ret= '^\%(\%('.a:pat.'\)\@!.\)*$'
endif
" call Dret("LP_Not ".ret)
return ret
endfun
" ---------------------------------------------------------------------
" LP_Or: writes a logical-or branch using two patterns {{{2
fun! s:LP_Or(pat1,pat2)
" call Dfunc("LP_Or(pat1<".a:pat1."> pat2<".a:pat2.">)")
let ret= '\%('.a:pat1.'\|'.a:pat2.'\)'
" call Dret("LP_Or ".ret)
return ret
endfun
" ---------------------------------------------------------------------
" LP_And: writes a logical-and concat using two patterns {{{2
fun! s:LP_And(pat1,pat2)
" call Dfunc("LP_And(pat1<".a:pat1."> pat2<".a:pat2.">)")
let ret= '\%('.a:pat1.'\&'.a:pat2.'\)'
" call Dret("LP_And ".ret)
return ret
endfun
" ---------------------------------------------------------------------
" StackLook: {{{2
fun! s:StackLook(description)
" call Dfunc("StackLook(description<".a:description.">)")
let iop = 1
let ifp = 1
" call Decho("Pattern Operator")
" print both pattern and operator
while ifp <= s:npatstack && iop <= s:nopstack
let fp = s:patstack_{ifp}
let op = s:opstack_{iop}." (P".s:opprec_{s:nopstack}.')'
let fplen= strlen(fp)
if fplen < 30
let fp= fp.strpart(" ",1,30-fplen)
endif
" call Decho(fp.op)
let ifp = ifp + 1
let iop = iop + 1
endwhile
" print just pattern
while ifp <= s:npatstack
let fp = s:patstack_{ifp}
" call Decho(fp)
let ifp = ifp + 1
endwhile
" print just operator
while iop <= s:nopstack
let op = s:opstack_{iop}." (P".s:opprec_{s:nopstack}.')'
" call Decho(" ".op)
let iop = iop + 1
endwhile
" call Dret("StackLook")
endfun
" ---------------------------------------------------------------------
" Cleanup And Modeline: {{{1
let &cpo= s:keepcpo
unlet s:keepcpo
" vim: ts=4 fdm=marker
+3 -3
View File
@@ -2,7 +2,7 @@
" Language: C++
" Current Maintainer: vim-jp (https://github.com/vim-jp/vim-cpp)
" Previous Maintainer: Ken Shan <ccshan@post.harvard.edu>
" Last Change: 2015 Mar 1
" Last Change: 2015 May 04
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
@@ -46,7 +46,7 @@ if !exists("cpp_no_cpp11")
syn keyword cppConstant ATOMIC_WCHAR_T_LOCK_FREE ATOMIC_SHORT_LOCK_FREE
syn keyword cppConstant ATOMIC_INT_LOCK_FREE ATOMIC_LONG_LOCK_FREE
syn keyword cppConstant ATOMIC_LLONG_LOCK_FREE ATOMIC_POINTER_LOCK_FREE
syn region cppRawString matchgroup=cppRawDelimiter start=+\%(u8\|[uLU]\)\=R"\z([[:alnum:]_{}[\]#<>%:;.?*\+\-/\^&|~!=,"']\{,16}\)(+ end=+)\z1"+ contains=@Spell
syn region cppRawString matchgroup=cppRawStringDelimiter start=+\%(u8\|[uLU]\)\=R"\z([[:alnum:]_{}[\]#<>%:;.?*\+\-/\^&|~!=,"']\{,16}\)(+ end=+)\z1"+ contains=@Spell
endif
" The minimum and maximum operators in GNU C++
@@ -70,7 +70,7 @@ if version >= 508 || !exists("did_cpp_syntax_inits")
HiLink cppStructure Structure
HiLink cppBoolean Boolean
HiLink cppConstant Constant
HiLink cppRawDelimiter Delimiter
HiLink cppRawStringDelimiter Delimiter
HiLink cppRawString String
delcommand HiLink
endif
+69 -58
View File
@@ -6,7 +6,7 @@
" Nikolai Weibull (Add CSS2 support)
" Maintainer: Jules Wang <w.jq0722@gmail.com>
" URL: https://github.com/JulesWang/css.vim
" Last Change: 2013 Nov.27
" Last Change: 2015 Apr.17
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
@@ -26,18 +26,19 @@ set cpo&vim
syn case ignore
" All HTML4 tags
syn keyword cssTagName abbr acronym address applet area a b base
syn keyword cssTagName basefont bdo big blockquote body br button
syn keyword cssTagName caption center cite code col colgroup dd del
syn keyword cssTagName dfn dir div dl dt em fieldset font form frame
syn keyword cssTagName frameset h1 h2 h3 h4 h5 h6 head hr html img i
syn keyword cssTagName iframe img input ins isindex kbd label legend li
syn keyword cssTagName link map menu meta noframes noscript ol optgroup
syn keyword cssTagName option p param pre q s samp script select small
syn keyword cssTagName span strike strong style sub sup table tbody td
syn keyword cssTagName textarea tfoot th thead title tr tt ul u var
" HTML4 tags
syn keyword cssTagName abbr address area a b base
syn keyword cssTagName bdo blockquote body br button
syn keyword cssTagName caption cite code col colgroup dd del
syn keyword cssTagName dfn div dl dt em fieldset form
syn keyword cssTagName h1 h2 h3 h4 h5 h6 head hr html img i
syn keyword cssTagName iframe input ins isindex kbd label legend li
syn keyword cssTagName link map menu meta noscript ol optgroup
syn keyword cssTagName option p param pre q s samp script small
syn keyword cssTagName span strong sub sup tbody td
syn keyword cssTagName textarea tfoot th thead title tr ul u var
syn keyword cssTagName object svg
syn match cssTagName /\<select\>\|\<style\>\|\<table\>/
" 34 HTML5 tags
syn keyword cssTagName article aside audio bdi canvas command data
@@ -47,8 +48,8 @@ syn keyword cssTagName output progress rt rp ruby section
syn keyword cssTagName source summary time track video wbr
" Tags not supported in HTML5
syn keyword cssDeprecated acronym applet basefont big center dir
syn keyword cssDeprecated font frame frameset noframes strike tt
" acronym applet basefont big center dir
" font frame frameset noframes strike tt
syn match cssTagName "\*"
@@ -70,13 +71,13 @@ endtry
" digits
syn match cssValueInteger contained "[-+]\=\d\+" contains=cssUnitDecorators
syn match cssValueNumber contained "[-+]\=\d\+\(\.\d*\)\=" contains=cssUnitDecorators
syn match cssValueLength contained "[-+]\=\d\+\(\.\d*\)\=\(%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\|rem\|dpi\|dppx\|dpcm\)" contains=cssUnitDecorators
syn match cssValueAngle contained "[-+]\=\d\+\(\.\d*\)\=\(deg\|grad\|rad\)" contains=cssUnitDecorators
syn match cssValueTime contained "+\=\d\+\(\.\d*\)\=\(ms\|s\)" contains=cssUnitDecorators
syn match cssValueFrequency contained "+\=\d\+\(\.\d*\)\=\(Hz\|kHz\)" contains=cssUnitDecorators
syn match cssValueLength contained "[-+]\=\d\+\(\.\d*\)\=\(%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\|rem\|dpi\|dppx\|dpcm\)\>" contains=cssUnitDecorators
syn match cssValueAngle contained "[-+]\=\d\+\(\.\d*\)\=\(deg\|grad\|rad\)\>" contains=cssUnitDecorators
syn match cssValueTime contained "+\=\d\+\(\.\d*\)\=\(ms\|s\)\>" contains=cssUnitDecorators
syn match cssValueFrequency contained "+\=\d\+\(\.\d*\)\=\(Hz\|kHz\)\>" contains=cssUnitDecorators
syn match cssIncludeKeyword /@\(-[a-z]+-\)\=\(media\|keyframes\|import\|charset\|namespace\|page\)/ contained
syn match cssIncludeKeyword /@\(-[a-z]\+-\)\=\(media\|keyframes\|import\|charset\|namespace\|page\)/ contained
" @media
syn region cssInclude start=/@media\>/ end=/\ze{/ skipwhite skipnl contains=cssMediaProp,cssValueLength,cssMediaKeyword,cssValueInteger,cssMediaAttr,cssVendor,cssMediaType,cssIncludeKeyword,cssMediaComma,cssComment nextgroup=cssMediaBlock
syn keyword cssMediaType contained screen print aural braille embossed handheld projection tty tv speech all contained skipwhite skipnl
@@ -86,7 +87,7 @@ syn match cssMediaComma "," skipwhite skipnl contained
" Reference: http://www.w3.org/TR/css3-mediaqueries/
syn keyword cssMediaProp contained width height orientation scan grid
syn match cssMediaProp contained /\(\(device\)-\)\=aspect-ratio/
syn match cssMediaProp contained /\(\(max\|min\)-\)\=\(\(device\)-\)\=aspect-ratio/
syn match cssMediaProp contained /\(\(max\|min\)-\)\=device-pixel-ratio/
syn match cssMediaProp contained /\(\(max\|min\)-\)\=device-\(height\|width\)/
syn match cssMediaProp contained /\(\(max\|min\)-\)\=\(height\|width\|resolution\|monochrome\|color\(-index\)\=\)/
@@ -104,7 +105,7 @@ syn keyword cssPageProp contained orphans widows
" @keyframe
" http://www.w3.org/TR/css3-animations/#keyframes
syn match cssKeyFrame "@\(-[a-z]+-\)\=keyframes\>[^{]*{\@=" nextgroup=cssKeyFrameWrap contains=cssVendor,cssIncludeKeyword skipwhite skipnl transparent
syn match cssKeyFrame "@\(-[a-z]\+-\)\=keyframes\>[^{]*{\@=" nextgroup=cssKeyFrameWrap contains=cssVendor,cssIncludeKeyword skipwhite skipnl transparent
syn region cssKeyFrameWrap contained transparent matchgroup=cssBraces start="{" end="}" contains=cssKeyFrameSelector
syn match cssKeyFrameSelector /\(\d*%\|from\|to\)\=/ contained skipwhite skipnl nextgroup=cssDefinition
@@ -116,15 +117,27 @@ syn region cssInclude start=/@namespace\>/ end=/\ze;/ transparent contains=cssSt
" @font-face
" http://www.w3.org/TR/css3-fonts/#at-font-face-rule
syn match cssFontDescriptor "@font-face\>" nextgroup=cssFontDescriptorBlock skipwhite skipnl
syn region cssFontDescriptorBlock contained transparent matchgroup=cssBraces start="{" end="}" contains=cssComment,cssError,cssUnicodeEscape,cssFontProp,cssFontAttr,cssCommonAttr,cssStringQ,cssStringQQ,cssFontDescriptorProp,cssValue.*,cssFontDescriptorFunction,cssUnicodeRange,cssFontDescriptorAttr
"syn match cssFontDescriptorProp contained "\<\(unicode-range\|unit-per-em\|panose-1\|cap-height\|x-height\|definition-src\)\>"
"syn keyword cssFontDescriptorProp contained src stemv stemh slope ascent descent widths bbox baseline centerline mathline topline
syn region cssFontDescriptorBlock contained transparent matchgroup=cssBraces start="{" end="}" contains=cssComment,cssError,cssUnicodeEscape,cssCommonAttr,cssFontDescriptorProp,cssValue.*,cssFontDescriptorFunction,cssFontDescriptorAttr,cssNoise
syn match cssFontDescriptorProp contained "\<font-family\>"
syn keyword cssFontDescriptorProp contained src
syn match cssFontDescriptorProp contained "\<font-\(style\|weight\|stretch\)\>"
syn match cssFontDescriptorProp contained "\<unicode-range\>"
syn keyword cssFontDescriptorAttr contained all
syn match cssFontDescriptorProp contained "\<font-\(variant\|feature-settings\)\>"
" src functions
syn region cssFontDescriptorFunction contained matchgroup=cssFunctionName start="\<\(uri\|url\|local\|format\)\s*(" end=")" contains=cssStringQ,cssStringQQ oneline keepend
syn match cssUnicodeRange contained "U+[0-9A-Fa-f?]\+"
syn match cssUnicodeRange contained "U+\x\+-\x\+"
" font-sytle and font-weight attributes
syn keyword cssFontDescriptorAttr contained normal italic oblique bold
" font-stretch attributes
syn match cssFontDescriptorAttr contained "\<\(\(ultra\|extra\|semi\)-\)\=\(condensed\|expanded\)\>"
" unicode-range attributes
syn match cssFontDescriptorAttr contained "U+[0-9A-Fa-f?]\+"
syn match cssFontDescriptorAttr contained "U+\x\+-\x\+"
" font-feature-settings attributes
syn keyword cssFontDescriptorAttr contained on off
" The 16 basic color names
syn keyword cssColor contained aqua black blue fuchsia gray green lime maroon navy olive purple red silver teal yellow
@@ -133,23 +146,23 @@ syn keyword cssColor contained aqua black blue fuchsia gray green lime maroon na
syn keyword cssColor contained aliceblue antiquewhite aquamarine azure
syn keyword cssColor contained beige bisque blanchedalmond blueviolet brown burlywood
syn keyword cssColor contained cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan
syn match cssColor contained /dark\(blue\|cyan\|goldenrod\|gray\|green\|grey\|khaki\)/
syn match cssColor contained /dark\(magenta\|olivegreen\|orange\|orchid\|red\|salmon\|seagreen\)/
syn match cssColor contained /darkslate\(blue\|gray\|grey\)/
syn match cssColor contained /dark\(turquoise\|violet\)/
syn match cssColor contained /\<dark\(blue\|cyan\|goldenrod\|gray\|green\|grey\|khaki\)\>/
syn match cssColor contained /\<dark\(magenta\|olivegreen\|orange\|orchid\|red\|salmon\|seagreen\)\>/
syn match cssColor contained /\<darkslate\(blue\|gray\|grey\)\>/
syn match cssColor contained /\<dark\(turquoise\|violet\)\>/
syn keyword cssColor contained deeppink deepskyblue dimgray dimgrey dodgerblue firebrick
syn keyword cssColor contained floralwhite forestgreen gainsboro ghostwhite gold
syn keyword cssColor contained goldenrod greenyellow grey honeydew hotpink
syn keyword cssColor contained indianred indigo ivory khaki lavender lavenderblush lawngreen
syn keyword cssColor contained lemonchiffon limegreen linen magenta
syn match cssColor contained /light\(blue\|coral\|cyan\|goldenrodyellow\|gray\|green\)/
syn match cssColor contained /light\(grey\|pink\|salmon\|seagreen\|skyblue\|yellow\)/
syn match cssColor contained /light\(slategray\|slategrey\|steelblue\)/
syn match cssColor contained /medium\(aquamarine\|blue\|orchid\|purple\|seagreen\)/
syn match cssColor contained /medium\(slateblue\|springgreen\|turquoise\|violetred\)/
syn match cssColor contained /\<light\(blue\|coral\|cyan\|goldenrodyellow\|gray\|green\)\>/
syn match cssColor contained /\<light\(grey\|pink\|salmon\|seagreen\|skyblue\|yellow\)\>/
syn match cssColor contained /\<light\(slategray\|slategrey\|steelblue\)\>/
syn match cssColor contained /\<medium\(aquamarine\|blue\|orchid\|purple\|seagreen\)\>/
syn match cssColor contained /\<medium\(slateblue\|springgreen\|turquoise\|violetred\)\>/
syn keyword cssColor contained midnightblue mintcream mistyrose moccasin navajowhite
syn keyword cssColor contained oldlace olivedrab orange orangered orchid
syn match cssColor contained /pale\(goldenrod\|green\|turquoise\|violetred\)/
syn match cssColor contained /\<pale\(goldenrod\|green\|turquoise\|violetred\)\>/
syn keyword cssColor contained papayawhip peachpuff peru pink plum powderblue
syn keyword cssColor contained rosybrown royalblue saddlebrown salmon sandybrown
syn keyword cssColor contained seagreen seashell sienna skyblue slateblue
@@ -167,11 +180,12 @@ syn case ignore
syn match cssImportant contained "!\s*important\>"
syn match cssColor contained "\<transparent\>"
syn match cssColor contained "\<currentColor\>"
syn match cssColor contained "\<white\>"
syn match cssColor contained "#[0-9A-Fa-f]\{3\}\>" contains=cssUnitDecorators
syn match cssColor contained "#[0-9A-Fa-f]\{6\}\>" contains=cssUnitDecorators
syn region cssURL contained matchgroup=cssFunctionName start="\<url\s*(" end=")" oneline extend
syn region cssURL contained matchgroup=cssFunctionName start="\<url\s*(" end=")" contains=cssStringQ,cssStringQQ oneline
syn region cssFunction contained matchgroup=cssFunctionName start="\<\(rgb\|clip\|attr\|counter\|rect\|cubic-bezier\|steps\)\s*(" end=")" oneline contains=cssValueInteger,cssValueNumber,cssValueLength,cssFunctionComma
syn region cssFunction contained matchgroup=cssFunctionName start="\<\(rgba\|hsl\|hsla\|color-stop\|from\|to\)\s*(" end=")" oneline contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunctionComma,cssFunction
syn region cssFunction contained matchgroup=cssFunctionName start="\<\(linear-\|radial-\)\=\gradient\s*(" end=")" oneline contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunction,cssGradientAttr,cssFunctionComma
@@ -196,6 +210,9 @@ syn keyword cssAnimationAttr contained forwards backwards both
" animation-play-state attributes
syn keyword cssAnimationAttr contained running paused
" animation-iteration-count attributes
syn keyword cssAnimationAttr contained infinite
"------------------------------------------------
" CSS Backgrounds and Borders Module Level 3
" http://www.w3.org/TR/css3-background/
@@ -253,7 +270,7 @@ syn keyword cssDimensionProp contained width
syn match cssFlexibleBoxProp contained "\<box-\(align\|direction\|flex\|ordinal-group\|orient\|pack\|shadow\|sizing\)\>"
syn keyword cssFlexibleBoxAttr contained start end baseline
syn keyword cssFlexibleBoxAttr contained reverse
syn keyword cssFlexibleBoxAttr contained single mulitple
syn keyword cssFlexibleBoxAttr contained single multiple
syn keyword cssFlexibleBoxAttr contained horizontal
syn match cssFlexibleBoxAttr contained "\<vertical\(-align\)\@!\>" "escape vertical-align
syn match cssFlexibleBoxAttr contained "\<\(inline\|block\)-axis\>"
@@ -261,6 +278,7 @@ syn match cssFlexibleBoxAttr contained "\<\(inline\|block\)-axis\>"
" CSS Fonts Module Level 3
" http://www.w3.org/TR/css-fonts-3/
syn match cssFontProp contained "\<font\(-\(family\|\|feature-settings\|kerning\|language-override\|size\(-adjust\)\=\|stretch\|style\|synthesis\|variant\(-\(alternates\|caps\|east-asian\|ligatures\|numeric\|position\)\)\=\|weight\)\)\=\>"
" font attributes
syn keyword cssFontAttr contained icon menu caption
syn match cssFontAttr contained "\<small-\(caps\|caption\)\>"
@@ -268,27 +286,21 @@ syn match cssFontAttr contained "\<message-box\>"
syn match cssFontAttr contained "\<status-bar\>"
syn keyword cssFontAttr contained larger smaller
syn match cssFontAttr contained "\<\(x\{1,2\}-\)\=\(large\|small\)\>"
" font-family attributes
syn match cssFontAttr contained "\<\(sans-\)\=serif\>"
syn keyword cssFontAttr contained Antiqua Arial Black Book Charcoal Comic Courier Dingbats Gadget Geneva Georgia Grande Helvetica Impact Linotype Lucida MS Monaco Neue New Palatino Roboto Roman Symbol Tahoma Times Trebuchet Unicode Verdana Webdings Wingdings York Zapf
syn keyword cssFontAttr contained Antiqua Arial Black Book Charcoal Comic Courier Dingbats Gadget Geneva Georgia Grande Helvetica Impact Linotype Lucida MS Monaco Neue New Palatino Roboto Roman Symbol Tahoma Times Trebuchet Verdana Webdings Wingdings York Zapf
syn keyword cssFontAttr contained cursive fantasy monospace
" font-feature-settings attributes
syn keyword cssFontAttr contained on off
" font-stretch attributes
syn match cssFontAttr contained "\<\(\(ultra\|extra\|semi\)-\)\=\(condensed\|expanded\)\>"
" font-style attributes
syn keyword cssFontAttr contained italic oblique
" font-variant-caps attributes
syn match cssFontAttr contained "\<\(all-\)\=\(small-\|petite-\|titling-\)caps\>"
syn keyword cssFontAttr contained unicase
" font-synthesis attributes
syn keyword cssFontAttr contained weight style
" font-weight attributes
syn keyword cssFontAttr contained bold bolder lighter
" TODO: font-variant-* attributes
"------------------------------------------------
" Webkit specific property/attributes
@@ -448,7 +460,7 @@ syn match cssMobileTextProp contained "\<text-size-adjust\>"
syn match cssBraces contained "[{}]"
syn match cssError contained "{@<>"
syn region cssDefinition transparent matchgroup=cssBraces start='{' end='}' contains=cssAttrRegion,css.*Prop,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssHacks keepend fold
syn region cssDefinition transparent matchgroup=cssBraces start='{' end='}' contains=cssAttrRegion,css.*Prop,cssComment,cssValue.*,cssColor,cssURL,cssImportant,cssError,cssStringQ,cssStringQQ,cssFunction,cssUnicodeEscape,cssVendor,cssDefinition,cssHacks,cssNoise fold
syn match cssBraceError "}"
syn match cssAttrComma ","
@@ -466,6 +478,9 @@ syn match cssPseudoClassId contained "\<selection\>"
syn match cssPseudoClassId contained "\<focus\(-inner\)\=\>"
syn match cssPseudoClassId contained "\<\(input-\)\=placeholder\>"
" Misc highlight groups
syntax match cssUnitDecorators /\(#\|-\|%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\|ch\|rem\|vh\|vw\|vmin\|vmax\|dpi\|dppx\|dpcm\|Hz\|kHz\|s\|ms\|deg\|grad\|rad\)/ contained
syntax match cssNoise contained /\(:\|;\|\/\)/
" Comment
syn region cssComment start="/\*" end="\*/" contains=@Spell fold
@@ -487,17 +502,13 @@ syn match cssVendor contained "\(-\(webkit\|moz\|o\|ms\)-\)"
" http://www.paulirish.com/2009/browser-specific-css-hacks/
syn match cssHacks contained /\(_\|*\)/
" Misc highlight groups
syntax match cssUnitDecorators /\(#\|-\|%\|mm\|cm\|in\|pt\|pc\|em\|ex\|px\|rem\|dpi\|dppx\|dpcm\|Hz\|kHz\|s\|ms\|deg\|grad\|rad\)/ contained
syntax match cssNoise contained /\(:\|;\|\/\)/
" Attr Enhance
" Some keywords are both Prop and Attr, so we have to handle them
syn region cssAttrRegion start=/:/ end=/;/ contained keepend contains=css.*Attr,cssColor,cssImportant,cssValue.*,cssFunction,cssString.*,cssURL,cssComment,cssUnicodeEscape,cssVendor,cssError,cssAttrComma,cssNoise
syn region cssAttrRegion start=/:/ end=/\ze\(;\|)\|}\)/ contained contains=css.*Attr,cssColor,cssImportant,cssValue.*,cssFunction,cssString.*,cssURL,cssComment,cssUnicodeEscape,cssVendor,cssError,cssAttrComma,cssNoise
" Hack for transition
" The 'transition' Prop has Props after ':'.
syn region cssAttrRegion start=/transition\s*:/ end=/;/ contained keepend contains=css.*Prop,css.*Attr,cssColor,cssImportant,cssValue.*,cssFunction,cssString.*,cssURL,cssComment,cssUnicodeEscape,cssVendor,cssError,cssAttrComma,cssNoise
" 'transition' has Props after ':'.
syn region cssAttrRegion start=/transition\s*:/ end=/\ze\(;\|)\|}\)/ contained contains=css.*Prop,css.*Attr,cssColor,cssImportant,cssValue.*,cssFunction,cssString.*,cssURL,cssComment,cssUnicodeEscape,cssVendor,cssError,cssAttrComma,cssNoise
if main_syntax == "css"
@@ -635,7 +646,7 @@ if version >= 508 || !exists("did_css_syn_inits")
HiLink cssAttr Constant
HiLink cssUnitDecorators Number
HiLink cssNoise Noise
HiLink atKeyword Comment
HiLink atKeyword PreProc
delcommand HiLink
endif
+10 -5
View File
@@ -3,7 +3,7 @@
" Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
" Former Maintainers: Gerfried Fuchs <alfie@ist.org>
" Wichert Akkerman <wakkerma@debian.org>
" Last Change: 2014 Jul 11
" Last Change: 2015 Apr 30
" URL: http://anonscm.debian.org/hg/pkg-vim/vim/raw-file/unstable/runtime/syntax/debchangelog.vim
" Standard syntax initialization
@@ -16,10 +16,14 @@ endif
" Case doesn't matter for us
syn case ignore
let urgency='urgency=\(low\|medium\|high\|critical\)\( [^[:space:],][^,]*\)\='
let binNMU='binary-only=yes'
" Define some common expressions we can use later on
syn match debchangelogName contained "^[[:alnum:]][[:alnum:].+-]\+ "
syn match debchangelogUrgency contained "; urgency=\(low\|medium\|high\|critical\|emergency\)\( \S.*\)\="
syn match debchangelogTarget contained "\v %(frozen|unstable|%(testing|%(old)=stable)%(-proposed-updates|-security)=|experimental|squeeze-%(backports%(-sloppy)=|volatile)|wheezy-backports|%(devel|lucid|precise|trusty|utopic)%(-%(security|proposed|updates|backports|commercial|partner))=)+"
exe 'syn match debchangelogFirstKV contained "; \('.urgency.'\|'.binNMU.'\)"'
exe 'syn match debchangelogOtherKV contained ", \('.urgency.'\|'.binNMU.'\)"'
syn match debchangelogTarget contained "\v %(frozen|unstable|sid|%(testing|%(old)=stable)%(-proposed-updates|-security)=|experimental|squeeze-%(backports%(-sloppy)=|volatile|lts|security)|wheezy-%(backports%(-sloppy)=|security)|jessie%(-backports|-security)=|stretch|%(devel|lucid|precise|trusty|utopic)%(-%(security|proposed|updates|backports|commercial|partner))=)+"
syn match debchangelogVersion contained "(.\{-})"
syn match debchangelogCloses contained "closes:\_s*\(bug\)\=#\=\_s\=\d\+\(,\_s*\(bug\)\=#\=\_s\=\d\+\)*"
syn match debchangelogLP contained "\clp:\s\+#\d\+\(,\s*#\d\+\)*"
@@ -27,7 +31,7 @@ syn match debchangelogEmail contained "[_=[:alnum:].+-]\+@[[:alnum:]./\-]\+"
syn match debchangelogEmail contained "<.\{-}>"
" Define the entries that make up the changelog
syn region debchangelogHeader start="^[^ ]" end="$" contains=debchangelogName,debchangelogUrgency,debchangelogTarget,debchangelogVersion oneline
syn region debchangelogHeader start="^[^ ]" end="$" contains=debchangelogName,debchangelogFirstKV,debchangelogOtherKV,debchangelogTarget,debchangelogVersion,debchangelogBinNMU oneline
syn region debchangelogFooter start="^ [^ ]" end="$" contains=debchangelogEmail oneline
syn region debchangelogEntry start="^ " end="$" contains=debchangelogCloses,debchangelogLP oneline
@@ -45,7 +49,8 @@ if version >= 508 || !exists("did_debchangelog_syn_inits")
HiLink debchangelogEntry Normal
HiLink debchangelogCloses Statement
HiLink debchangelogLP Statement
HiLink debchangelogUrgency Identifier
HiLink debchangelogFirstKV Identifier
HiLink debchangelogOtherKV Identifier
HiLink debchangelogName Comment
HiLink debchangelogVersion Identifier
HiLink debchangelogTarget Identifier
+2 -2
View File
@@ -3,7 +3,7 @@
" Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
" Former Maintainers: Gerfried Fuchs <alfie@ist.org>
" Wichert Akkerman <wakkerma@debian.org>
" Last Change: 2014 May 01
" Last Change: 2014 Oct 08
" URL: http://anonscm.debian.org/hg/pkg-vim/vim/raw-file/unstable/runtime/syntax/debcontrol.vim
" Standard syntax initialization
@@ -50,7 +50,7 @@ syn match debcontrolDmUpload contained "\cyes"
syn match debcontrolHTTPUrl contained "\vhttps?://[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?(:\d+)?(/[^[:space:]]*)?$"
syn match debcontrolVcsSvn contained "\vsvn%(\+ssh)?://[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?(:\d+)?(/[^[:space:]]*)?$"
syn match debcontrolVcsCvs contained "\v%(\-d *)?:pserver:[^@]+\@[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?:/[^[:space:]]*%( [^[:space:]]+)?$"
syn match debcontrolVcsGit contained "\v%(git|http)://[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?(:\d+)?(/[^[:space:]]*)?%(\s+-b\s+[^ ~^:?*[\\]+)?$"
syn match debcontrolVcsGit contained "\v%(git|https?)://[[:alnum:]][-[:alnum:]]*[[:alnum:]]?(\.[[:alnum:]][-[:alnum:]]*[[:alnum:]]?)*\.[[:alpha:]][-[:alnum:]]*[[:alpha:]]?(:\d+)?(/[^[:space:]]*)?%(\s+-b\s+[^ ~^:?*[\\]+)?$"
" An email address
syn match debcontrolEmail "[_=[:alnum:]\.+-]\+@[[:alnum:]\./\-]\+"
+27 -7
View File
@@ -2,7 +2,7 @@
" Language: Debian sources.list
" Maintainer: Debian Vim Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
" Former Maintainer: Matthijs Mohlmann <matthijs@cacholong.nl>
" Last Change: 2014 Jul 11
" Last Change: 2015 May 25
" URL: http://anonscm.debian.org/hg/pkg-vim/vim/raw-file/unstable/runtime/syntax/debsources.vim
" Standard syntax initialization
@@ -21,15 +21,35 @@ syn match debsourcesKeyword /\(deb-src\|deb\|main\|contrib\|non-free\|res
" Match comments
syn match debsourcesComment /#.*/ contains=@Spell
let s:cpo = &cpo
set cpo-=C
let s:supported = [
\ 'oldstable', 'stable', 'testing', 'unstable', 'experimental',
\ 'squeeze', 'wheezy', 'jessie', 'stretch', 'sid', 'rc-buggy',
\
\ 'precise', 'trusty', 'utopic', 'vivid', 'wily', 'devel'
\ ]
let s:unsupported = [
\ 'buzz', 'rex', 'bo', 'hamm', 'slink', 'potato',
\ 'woody', 'sarge', 'etch', 'lenny',
\
\ 'warty', 'hoary', 'breezy', 'dapper', 'edgy', 'feisty',
\ 'gutsy', 'hardy', 'intrepid', 'jaunty', 'karmic', 'lucid',
\ 'maverick', 'natty', 'oneiric', 'quantal', 'raring', 'saucy'
\ ]
let &cpo=s:cpo
" Match uri's
syn match debsourcesUri +\(http://\|ftp://\|[rs]sh://\|debtorrent://\|\(cdrom\|copy\|file\):\)[^' <>"]\++
syn match debsourcesDistrKeyword +\([[:alnum:]_./]*\)\(squeeze\|wheezy\|jessie\|\(old\)\=stable\|testing\|unstable\|sid\|rc-buggy\|experimental\|devel\|lucid\|precise\|trusty\|utopic\)\([-[:alnum:]_./]*\)+
exe 'syn match debsourcesDistrKeyword +\([[:alnum:]_./]*\)\('. join(s:supported, '\|'). '\)\([-[:alnum:]_./]*\)+'
exe 'syn match debsourcesUnsupportedDistrKeyword +\([[:alnum:]_./]*\)\('. join(s:unsupported, '\|') .'\)\([-[:alnum:]_./]*\)+'
" Associate our matches and regions with pretty colours
hi def link debsourcesLine Error
hi def link debsourcesKeyword Statement
hi def link debsourcesDistrKeyword Type
hi def link debsourcesComment Comment
hi def link debsourcesUri Constant
hi def link debsourcesLine Error
hi def link debsourcesKeyword Statement
hi def link debsourcesDistrKeyword Type
hi def link debsourcesUnsupportedDistrKeyword WarningMsg
hi def link debsourcesComment Comment
hi def link debsourcesUri Constant
let b:current_syntax = "debsources"
+3 -3
View File
@@ -2,9 +2,9 @@
" Language: Groovy
" Original Author: Alessio Pace <billy.corgan@tiscali.it>
" Maintainer: Tobias Rapp <yahuxo@gmx.de>
" Version: 0.1.13
" Version: 0.1.14
" URL: http://www.vim.org/scripts/script.php?script_id=945
" Last Change: 2015 Apr 13
" Last Change: 2015 Apr 21
" THE ORIGINAL AUTHOR'S NOTES:
"
@@ -157,7 +157,7 @@ syn match groovyOperator "\.\."
syn match groovyOperator "<\{2,3}"
syn match groovyOperator ">\{2,3}"
syn match groovyOperator "->"
syn match groovyExternal '^#!.*[/\\]groovy\>'
syn match groovyLineComment '^\%1l#!.*' " Shebang line
syn match groovyExceptions "\<Exception\>\|\<[A-Z]\{1,}[a-zA-Z0-9]*Exception\>"
" Groovy JDK stuff
+5 -2
View File
@@ -1,6 +1,9 @@
" Vim syntax file
" Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2009-05-25
" Maintainer: Christian Brabandt <cb@256bit.org>
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2015-05-29
" License: Vim (see :h license)
" Repository: https://github.com/chrisbra/vim-kconfig
if exists("b:current_syntax")
finish
+7 -1
View File
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: po (gettext)
" Maintainer: Dwayne Bailey <dwayne@translate.org.za>
" Last Change: 2012 Apr 30
" Last Change: 2015 Jun 07
" Contributors: Dwayne Bailey (Most advanced syntax highlighting)
" Leonardo Fontenelle (Spell checking)
" Nam SungHyun <namsh@kldp.org> (Original maintainer)
@@ -52,6 +52,9 @@ syn match poCommentTranslator "^# .*$" contains=poCopyrightUnset
syn match poCommentAutomatic "^#\..*$"
syn match poCommentSources "^#:.*$"
syn match poCommentFlags "^#,.*$" contains=poFlagFuzzy
syn match poDiffOld '\(^#| "[^{]*+}\|{+[^}]*+}\|{+[^}]*\|"$\)' contained
syn match poDiffNew '\(^#| "[^{]*-}\|{-[^}]*-}\|{-[^}]*\|"$\)' contained
syn match poCommentDiff "^#|.*$" contains=poDiffOld,poDiffNew
" Translations (also includes header fields as they appear in a translation msgstr)
syn region poCommentKDE start=+"_: +ms=s+1 end="\\n" end="\"\n^msgstr"me=s-1 contained
@@ -94,8 +97,11 @@ if version >= 508 || !exists("did_po_syn_inits")
HiLink poCommentAutomatic Comment
HiLink poCommentTranslator Comment
HiLink poCommentFlags Special
HiLink poCommentDiff Comment
HiLink poCopyrightUnset Todo
HiLink poFlagFuzzy Todo
HiLink poDiffOld Todo
HiLink poDiffNew Special
HiLink poObsolete Comment
HiLink poStatementMsgid Statement
+10 -9
View File
@@ -1,9 +1,8 @@
" Vim syntax file
" Language: Python
" Maintainer: Neil Schemenauer <nas@python.ca>
" Last Change: 2014 Jul 16
" Credits: Zvezdan Petkovic <zpetkovic@acm.org>
" Neil Schemenauer <nas@python.ca>
" Maintainer: Zvezdan Petkovic <zpetkovic@acm.org>
" Last Change: 2015 Jun 19
" Credits: Neil Schemenauer <nas@python.ca>
" Dmitry Vasiliev
"
" This version is a major rewrite by Zvezdan Petkovic.
@@ -95,16 +94,16 @@ syn match pythonComment "#.*$" contains=pythonTodo,@Spell
syn keyword pythonTodo FIXME NOTE NOTES TODO XXX contained
" Triple-quoted strings can contain doctests.
syn region pythonString
syn region pythonString matchgroup=pythonQuotes
\ start=+[uU]\=\z(['"]\)+ end="\z1" skip="\\\\\|\\\z1"
\ contains=pythonEscape,@Spell
syn region pythonString
syn region pythonString matchgroup=pythonTripleQuotes
\ start=+[uU]\=\z('''\|"""\)+ end="\z1" keepend
\ contains=pythonEscape,pythonSpaceError,pythonDoctest,@Spell
syn region pythonRawString
syn region pythonRawString matchgroup=pythonQuotes
\ start=+[uU]\=[rR]\z(['"]\)+ end="\z1" skip="\\\\\|\\\z1"
\ contains=@Spell
syn region pythonRawString
syn region pythonRawString matchgroup=pythonTripleQuotes
\ start=+[uU]\=[rR]\z('''\|"""\)+ end="\z1" keepend
\ contains=pythonSpaceError,pythonDoctest,@Spell
@@ -113,7 +112,7 @@ syn match pythonEscape "\\\o\{1,3}" contained
syn match pythonEscape "\\x\x\{2}" contained
syn match pythonEscape "\%(\\u\x\{4}\|\\U\x\{8}\)" contained
" Python allows case-insensitive Unicode IDs: http://www.unicode.org/charts/
syn match pythonEscape "\\N{.\{-}}" contained
syn match pythonEscape "\\N{\a\+\%(\s\a\+\)*}" contained
syn match pythonEscape "\\$"
if exists("python_highlight_all")
@@ -274,6 +273,8 @@ if version >= 508 || !exists("did_python_syn_inits")
HiLink pythonTodo Todo
HiLink pythonString String
HiLink pythonRawString String
HiLink pythonQuotes String
HiLink pythonTripleQuotes pythonQuotes
HiLink pythonEscape Special
if !exists("python_no_number_highlight")
HiLink pythonNumber Number
+6 -3
View File
@@ -1,7 +1,10 @@
" Vim syntax file
" Language: M$ Resource files (*.rc)
" Maintainer: Heiko Erhardt <Heiko.Erhardt@munich.netsurf.de>
" Last Change: 2001 May 09
" Maintainer: Christian Brabandt
" Last Change: 2015-05-29
" Repository: https://github.com/chrisbra/vim-rc-syntax
" License: Vim (see :h license)
" Previous Maintainer: Heiko Erhardt <Heiko.Erhardt@munich.netsurf.de>
" This file is based on the c.vim
@@ -21,7 +24,7 @@ syn keyword rcMainObject MENU ACCELERATORS TOOLBAR DIALOG
syn keyword rcMainObject STRINGTABLE MESSAGETABLE RCDATA DLGINIT DESIGNINFO
syn keyword rcSubObject POPUP MENUITEM SEPARATOR
syn keyword rcSubObject CONTROL LTEXT CTEXT EDITTEXT
syn keyword rcSubObject CONTROL LTEXT CTEXT RTEXT EDITTEXT
syn keyword rcSubObject BUTTON PUSHBUTTON DEFPUSHBUTTON GROUPBOX LISTBOX COMBOBOX
syn keyword rcSubObject FILEVERSION PRODUCTVERSION FILEFLAGSMASK FILEFLAGS FILEOS
syn keyword rcSubObject FILETYPE FILESUBTYPE
+78 -78
View File
@@ -2,8 +2,8 @@
" Language: shell (sh) Korn shell (ksh) bash (sh)
" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
" Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int>
" Last Change: Apr 10, 2015
" Version: 136
" Last Change: May 29, 2015
" Version: 137
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH
" For options and settings, please use: :help ft-sh-syntax
" This file includes many ideas from ?ric Brunet (eric.brunet@ens.fr)
@@ -17,7 +17,7 @@ elseif exists("b:current_syntax")
endif
" AFAICT "." should be considered part of the iskeyword. Using iskeywords in
" syntax is dicey, so the following code permits the user to prevent/override
" syntax is dicey, so the following code permits the user to
" g:sh_isk set to a string : specify iskeyword.
" g:sh_noisk exists : don't change iskeyword
" g:sh_noisk does not exist : (default) append "." to iskeyword
@@ -108,8 +108,7 @@ syn cluster shArithParenList contains=shArithmetic,shCaseEsac,shComment,shDeref,
syn cluster shArithList contains=@shArithParenList,shParenError
syn cluster shCaseEsacList contains=shCaseStart,shCase,shCaseBar,shCaseIn,shComment,shDeref,shDerefSimple,shCaseCommandSub,shCaseExSingleQuote,shCaseSingleQuote,shCaseDoubleQuote,shCtrlSeq,@shErrorList,shStringSpecial,shCaseRange
syn cluster shCaseList contains=@shCommandSubList,shCaseEsac,shColon,shCommandSub,shComment,shDo,shEcho,shExpr,shFor,shHereDoc,shIf,shRedir,shSetList,shSource,shStatement,shVariable,shCtrlSeq
"syn cluster shColonList contains=@shCaseList
syn cluster shCommandSubList contains=shArithmetic,shDeref,shDerefSimple,shEcho,shEscape,shNumber,shOption,shPosnParm,shExSingleQuote,shSingleQuote,shExDoubleQuote,shDoubleQuote,shStatement,shVariable,shSubSh,shAlias,shTest,shCtrlSeq,shSpecial,shCmdParenRegion
syn cluster shCommandSubList contains=shAlias,shArithmetic,shCmdParenRegion,shCtrlSeq,shDeref,shDerefSimple,shDoubleQuote,shEcho,shEscape,shExDoubleQuote,shExpr,shExSingleQuote,shNumber,shOperator,shOption,shPosnParm,shSingleQuote,shSpecial,shStatement,shSubSh,shTest,shVariable
syn cluster shCurlyList contains=shNumber,shComma,shDeref,shDerefSimple,shDerefSpecial
syn cluster shDblQuoteList contains=shCommandSub,shDeref,shDerefSimple,shEscape,shPosnParm,shCtrlSeq,shSpecial
syn cluster shDerefList contains=shDeref,shDerefSimple,shDerefVar,shDerefSpecial,shDerefWordError,shDerefPPS
@@ -182,7 +181,7 @@ syn match shRedir "\d<<-\="
syn match shOperator "<<\|>>" contained
syn match shOperator "[!&;|]" contained
syn match shOperator "\[[[^:]\|\]]" contained
syn match shOperator "!\==" skipwhite nextgroup=shPattern
syn match shOperator "[-=/*+%]\==" skipwhite nextgroup=shPattern
syn match shPattern "\<\S\+\())\)\@=" contained contains=shExSingleQuote,shSingleQuote,shExDoubleQuote,shDoubleQuote,shDeref
" Subshells: {{{1
@@ -194,8 +193,8 @@ syn region shSubSh transparent matchgroup=shSubShRegion start="[^(]\zs(" end=")"
"=======
syn region shExpr matchgroup=shRange start="\[" skip=+\\\\\|\\$\|\[+ end="\]" contains=@shTestList,shSpecial
syn region shTest transparent matchgroup=shStatement start="\<test\s" skip=+\\\\\|\\$+ matchgroup=NONE end="[;&|]"me=e-1 end="$" contains=@shExprList1
syn match shTestOpr contained '[^-+/%]\zs=' skipwhite nextgroup=shTestDoubleQuote,shTestSingleQuote,shTestPattern
syn match shTestOpr contained "<=\|>=\|!=\|==\|-.\>\|-\(nt\|ot\|ef\|eq\|ne\|lt\|le\|gt\|ge\)\>\|[!<>]"
syn match shTestOpr contained '=' skipwhite nextgroup=shTestDoubleQuote,shTestSingleQuote,shTestPattern
syn match shTestPattern contained '\w\+'
syn region shTestDoubleQuote contained start='\%(\%(\\\\\)*\\\)\@<!"' skip=+\\\\\|\\"+ end='"'
syn match shTestSingleQuote contained '\\.'
@@ -322,12 +321,13 @@ elseif !exists("g:sh_no_error")
endif
syn region shSingleQuote matchgroup=shQuote start=+'+ end=+'+ contains=@Spell
syn region shDoubleQuote matchgroup=shQuote start=+\%(\%(\\\\\)*\\\)\@<!"+ skip=+\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial,@Spell
"syn region shDoubleQuote matchgroup=shQuote start=+"+ skip=+\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial,@Spell
syn match shStringSpecial "[^[:print:] \t]" contained
syn region shDoubleQuote matchgroup=shQuote start=+"+ skip=+\\"+ end=+"+ contains=@shDblQuoteList,shStringSpecial,@Spell
syn match shStringSpecial "[^[:print:] \t]" contained
syn match shStringSpecial "\%(\\\\\)*\\[\\"'`$()#]"
syn match shSpecial "[^\\]\zs\%(\\\\\)*\\[\\"'`$()#]" nextgroup=shMoreSpecial,shComment
syn match shSpecial "^\%(\\\\\)*\\[\\"'`$()#]" nextgroup=shComment
syn match shMoreSpecial "\%(\\\\\)*\\[\\"'`$()#]" nextgroup=shMoreSpecial contained
" COMBAK: why is ,shComment on next line???
syn match shSpecial "[^\\]\zs\%(\\\\\)*\\[\\"'`$()#]" nextgroup=shMoreSpecial,shComment
syn match shSpecial "^\%(\\\\\)*\\[\\"'`$()#]" nextgroup=shComment
syn match shMoreSpecial "\%(\\\\\)*\\[\\"'`$()#]" nextgroup=shMoreSpecial contained
" Comments: {{{1
"==========
@@ -341,42 +341,42 @@ syn match shQuickComment contained "#.*$"
" Here Documents: {{{1
" =========================================
if version < 600
syn region shHereDoc matchgroup=shRedir01 start="<<\s*\**END[a-zA-Z_0-9]*\**" matchgroup=shRedir01 end="^END[a-zA-Z_0-9]*$" contains=@shDblQuoteList
syn region shHereDoc matchgroup=shRedir02 start="<<-\s*\**END[a-zA-Z_0-9]*\**" matchgroup=shRedir02 end="^\s*END[a-zA-Z_0-9]*$" contains=@shDblQuoteList
syn region shHereDoc matchgroup=shRedir03 start="<<\s*\**EOF\**" matchgroup=shRedir03 end="^EOF$" contains=@shDblQuoteList
syn region shHereDoc matchgroup=shRedir04 start="<<-\s*\**EOF\**" matchgroup=shRedir04 end="^\s*EOF$" contains=@shDblQuoteList
syn region shHereDoc matchgroup=shRedir05 start="<<\s*\**\.\**" matchgroup=shRedir05 end="^\.$" contains=@shDblQuoteList
syn region shHereDoc matchgroup=shRedir06 start="<<-\s*\**\.\**" matchgroup=shRedir06 end="^\s*\.$" contains=@shDblQuoteList
syn region shHereDoc matchgroup=shHereDoc01 start="<<\s*\**END[a-zA-Z_0-9]*\**" matchgroup=shHereDoc01 end="^END[a-zA-Z_0-9]*$" contains=@shDblQuoteList
syn region shHereDoc matchgroup=shHereDoc02 start="<<-\s*\**END[a-zA-Z_0-9]*\**" matchgroup=shHereDoc02 end="^\s*END[a-zA-Z_0-9]*$" contains=@shDblQuoteList
syn region shHereDoc matchgroup=shHereDoc03 start="<<\s*\**EOF\**" matchgroup=shHereDoc03 end="^EOF$" contains=@shDblQuoteList
syn region shHereDoc matchgroup=shHereDoc04 start="<<-\s*\**EOF\**" matchgroup=shHereDoc04 end="^\s*EOF$" contains=@shDblQuoteList
syn region shHereDoc matchgroup=shHereDoc05 start="<<\s*\**\.\**" matchgroup=shHereDoc05 end="^\.$" contains=@shDblQuoteList
syn region shHereDoc matchgroup=shHereDoc06 start="<<-\s*\**\.\**" matchgroup=shHereDoc06 end="^\s*\.$" contains=@shDblQuoteList
elseif s:sh_fold_heredoc
syn region shHereDoc matchgroup=shRedir07 fold start="<<\s*\z([^ \t|]*\)" matchgroup=shRedir07 end="^\z1\s*$" contains=@shDblQuoteList
syn region shHereDoc matchgroup=shRedir08 fold start="<<\s*\"\z([^ \t|]*\)\"" matchgroup=shRedir08 end="^\z1\s*$"
syn region shHereDoc matchgroup=shRedir09 fold start="<<\s*'\z([^ \t|]*\)'" matchgroup=shRedir09 end="^\z1\s*$"
syn region shHereDoc matchgroup=shRedir10 fold start="<<-\s*\z([^ \t|]*\)" matchgroup=shRedir10 end="^\s*\z1\s*$" contains=@shDblQuoteList
syn region shHereDoc matchgroup=shRedir11 fold start="<<-\s*\"\z([^ \t|]*\)\"" matchgroup=shRedir11 end="^\s*\z1\s*$"
syn region shHereDoc matchgroup=shRedir12 fold start="<<-\s*'\z([^ \t|]*\)'" matchgroup=shRedir12 end="^\s*\z1\s*$"
syn region shHereDoc matchgroup=shRedir13 fold start="<<\s*\\\_$\_s*\z([^ \t|]*\)" matchgroup=shRedir13 end="^\z1\s*$"
syn region shHereDoc matchgroup=shRedir14 fold start="<<\s*\\\_$\_s*\"\z([^ \t|]*\)\"" matchgroup=shRedir14 end="^\z1\s*$"
syn region shHereDoc matchgroup=shRedir15 fold start="<<-\s*\\\_$\_s*'\z([^ \t|]*\)'" matchgroup=shRedir15 end="^\s*\z1\s*$"
syn region shHereDoc matchgroup=shRedir16 fold start="<<-\s*\\\_$\_s*\z([^ \t|]*\)" matchgroup=shRedir16 end="^\s*\z1\s*$"
syn region shHereDoc matchgroup=shRedir17 fold start="<<-\s*\\\_$\_s*\"\z([^ \t|]*\)\"" matchgroup=shRedir17 end="^\s*\z1\s*$"
syn region shHereDoc matchgroup=shRedir18 fold start="<<\s*\\\_$\_s*'\z([^ \t|]*\)'" matchgroup=shRedir18 end="^\z1\s*$"
syn region shHereDoc matchgroup=shRedir19 fold start="<<\\\z([^ \t|]*\)" matchgroup=shRedir19 end="^\z1\s*$"
syn region shHereDoc matchgroup=shHereDoc07 fold start="<<\s*\z([^ \t|]*\)" matchgroup=shHereDoc07 end="^\z1\s*$" contains=@shDblQuoteList
syn region shHereDoc matchgroup=shHereDoc08 fold start="<<\s*\"\z([^ \t|]*\)\"" matchgroup=shHereDoc08 end="^\z1\s*$"
syn region shHereDoc matchgroup=shHereDoc09 fold start="<<\s*'\z([^ \t|]*\)'" matchgroup=shHereDoc09 end="^\z1\s*$"
syn region shHereDoc matchgroup=shHereDoc10 fold start="<<-\s*\z([^ \t|]*\)" matchgroup=shHereDoc10 end="^\s*\z1\s*$" contains=@shDblQuoteList
syn region shHereDoc matchgroup=shHereDoc11 fold start="<<-\s*\"\z([^ \t|]*\)\"" matchgroup=shHereDoc11 end="^\s*\z1\s*$"
syn region shHereDoc matchgroup=shHereDoc12 fold start="<<-\s*'\z([^ \t|]*\)'" matchgroup=shHereDoc12 end="^\s*\z1\s*$"
syn region shHereDoc matchgroup=shHereDoc13 fold start="<<\s*\\\_$\_s*\z([^ \t|]*\)" matchgroup=shHereDoc13 end="^\z1\s*$"
syn region shHereDoc matchgroup=shHereDoc14 fold start="<<\s*\\\_$\_s*\"\z([^ \t|]*\)\"" matchgroup=shHereDoc14 end="^\z1\s*$"
syn region shHereDoc matchgroup=shHereDoc15 fold start="<<-\s*\\\_$\_s*'\z([^ \t|]*\)'" matchgroup=shHereDoc15 end="^\s*\z1\s*$"
syn region shHereDoc matchgroup=shHereDoc16 fold start="<<-\s*\\\_$\_s*\z([^ \t|]*\)" matchgroup=shHereDoc16 end="^\s*\z1\s*$"
syn region shHereDoc matchgroup=shHereDoc17 fold start="<<-\s*\\\_$\_s*\"\z([^ \t|]*\)\"" matchgroup=shHereDoc17 end="^\s*\z1\s*$"
syn region shHereDoc matchgroup=shHereDoc18 fold start="<<\s*\\\_$\_s*'\z([^ \t|]*\)'" matchgroup=shHereDoc18 end="^\z1\s*$"
syn region shHereDoc matchgroup=shHereDoc19 fold start="<<\\\z([^ \t|]*\)" matchgroup=shHereDoc19 end="^\z1\s*$"
else
syn region shHereDoc matchgroup=shRedir20 start="<<\s*\\\=\z([^ \t|]*\)" matchgroup=shRedir20 end="^\z1\s*$" contains=@shDblQuoteList
syn region shHereDoc matchgroup=shRedir21 start="<<\s*\"\z([^ \t|]*\)\"" matchgroup=shRedir21 end="^\z1\s*$"
syn region shHereDoc matchgroup=shRedir22 start="<<-\s*\z([^ \t|]*\)" matchgroup=shRedir22 end="^\s*\z1\s*$" contains=@shDblQuoteList
syn region shHereDoc matchgroup=shRedir23 start="<<-\s*'\z([^ \t|]*\)'" matchgroup=shRedir23 end="^\s*\z1\s*$"
syn region shHereDoc matchgroup=shRedir24 start="<<\s*'\z([^ \t|]*\)'" matchgroup=shRedir24 end="^\z1\s*$"
syn region shHereDoc matchgroup=shRedir25 start="<<-\s*\"\z([^ \t|]*\)\"" matchgroup=shRedir25 end="^\s*\z1\s*$"
syn region shHereDoc matchgroup=shRedir26 start="<<\s*\\\_$\_s*\z([^ \t|]*\)" matchgroup=shRedir26 end="^\z1\s*$"
syn region shHereDoc matchgroup=shRedir27 start="<<-\s*\\\_$\_s*\z([^ \t|]*\)" matchgroup=shRedir27 end="^\s*\z1\s*$"
syn region shHereDoc matchgroup=shRedir28 start="<<-\s*\\\_$\_s*'\z([^ \t|]*\)'" matchgroup=shRedir28 end="^\s*\z1\s*$"
syn region shHereDoc matchgroup=shRedir29 start="<<\s*\\\_$\_s*'\z([^ \t|]*\)'" matchgroup=shRedir29 end="^\z1\s*$"
syn region shHereDoc matchgroup=shRedir30 start="<<\s*\\\_$\_s*\"\z([^ \t|]*\)\"" matchgroup=shRedir30 end="^\z1\s*$"
syn region shHereDoc matchgroup=shRedir31 start="<<-\s*\\\_$\_s*\"\z([^ \t|]*\)\"" matchgroup=shRedir31 end="^\s*\z1\s*$"
syn region shHereDoc matchgroup=shRedir32 start="<<\\\z([^ \t|]*\)" matchgroup=shRedir32 end="^\z1\s*$"
syn region shHereDoc matchgroup=shHereDoc20 start="<<\s*\\\=\z([^ \t|]*\)" matchgroup=shHereDoc20 end="^\z1\s*$" contains=@shDblQuoteList
syn region shHereDoc matchgroup=shHereDoc21 start="<<\s*\"\z([^ \t|]*\)\"" matchgroup=shHereDoc21 end="^\z1\s*$"
syn region shHereDoc matchgroup=shHereDoc22 start="<<-\s*\z([^ \t|]*\)" matchgroup=shHereDoc22 end="^\s*\z1\s*$" contains=@shDblQuoteList
syn region shHereDoc matchgroup=shHereDoc23 start="<<-\s*'\z([^ \t|]*\)'" matchgroup=shHereDoc23 end="^\s*\z1\s*$"
syn region shHereDoc matchgroup=shHereDoc24 start="<<\s*'\z([^ \t|]*\)'" matchgroup=shHereDoc24 end="^\z1\s*$"
syn region shHereDoc matchgroup=shHereDoc25 start="<<-\s*\"\z([^ \t|]*\)\"" matchgroup=shHereDoc25 end="^\s*\z1\s*$"
syn region shHereDoc matchgroup=shHereDoc26 start="<<\s*\\\_$\_s*\z([^ \t|]*\)" matchgroup=shHereDoc26 end="^\z1\s*$"
syn region shHereDoc matchgroup=shHereDoc27 start="<<-\s*\\\_$\_s*\z([^ \t|]*\)" matchgroup=shHereDoc27 end="^\s*\z1\s*$"
syn region shHereDoc matchgroup=shHereDoc28 start="<<-\s*\\\_$\_s*'\z([^ \t|]*\)'" matchgroup=shHereDoc28 end="^\s*\z1\s*$"
syn region shHereDoc matchgroup=shHereDoc29 start="<<\s*\\\_$\_s*'\z([^ \t|]*\)'" matchgroup=shHereDoc29 end="^\z1\s*$"
syn region shHereDoc matchgroup=shHereDoc30 start="<<\s*\\\_$\_s*\"\z([^ \t|]*\)\"" matchgroup=shHereDoc30 end="^\z1\s*$"
syn region shHereDoc matchgroup=shHereDoc31 start="<<-\s*\\\_$\_s*\"\z([^ \t|]*\)\"" matchgroup=shHereDoc31 end="^\s*\z1\s*$"
syn region shHereDoc matchgroup=shHereDoc32 start="<<\\\z([^ \t|]*\)" matchgroup=shHereDoc32 end="^\z1\s*$"
endif
" Here Strings: {{{1
@@ -389,8 +389,8 @@ endif
" Identifiers: {{{1
"=============
syn match shSetOption "\s\zs[-+][a-zA-Z0-9]\+\>" contained
syn match shVariable "\<\([bwglsav]:\)\=[a-zA-Z0-9.!@_%+,]*\ze=" nextgroup=shSetIdentifier
syn match shSetIdentifier "=" contained nextgroup=shCmdParenRegion,shPattern,shDeref,shDerefSimple,shDoubleQuote,shExDoubleQuote,shSingleQuote,shExSingleQuote
syn match shVariable "\<\([bwglsav]:\)\=[a-zA-Z0-9.!@_%+,]*\ze=" nextgroup=shVarAssign
syn match shVarAssign "=" contained nextgroup=shCmdParenRegion,shPattern,shDeref,shDerefSimple,shDoubleQuote,shExDoubleQuote,shSingleQuote,shExSingleQuote
syn region shAtExpr contained start="@(" end=")" contains=@shIdList
if exists("b:is_bash")
syn region shSetList oneline matchgroup=shSet start="\<\(declare\|typeset\|local\|export\|unset\)\>\ze[^/]" end="$" matchgroup=shSetListDelim end="\ze[}|);&]" matchgroup=NONE end="\ze\s\+#\|=" contains=@shIdList
@@ -668,38 +668,38 @@ hi def link shStatement Statement
hi def link shString String
hi def link shTodo Todo
hi def link shAlias Identifier
hi def link shRedir01 shRedir
hi def link shRedir02 shRedir
hi def link shRedir03 shRedir
hi def link shRedir04 shRedir
hi def link shRedir05 shRedir
hi def link shRedir06 shRedir
hi def link shRedir07 shRedir
hi def link shRedir08 shRedir
hi def link shRedir09 shRedir
hi def link shRedir10 shRedir
hi def link shRedir11 shRedir
hi def link shRedir12 shRedir
hi def link shRedir13 shRedir
hi def link shRedir14 shRedir
hi def link shRedir15 shRedir
hi def link shRedir16 shRedir
hi def link shRedir17 shRedir
hi def link shRedir18 shRedir
hi def link shRedir19 shRedir
hi def link shRedir20 shRedir
hi def link shRedir21 shRedir
hi def link shRedir22 shRedir
hi def link shRedir23 shRedir
hi def link shRedir24 shRedir
hi def link shRedir25 shRedir
hi def link shRedir26 shRedir
hi def link shRedir27 shRedir
hi def link shRedir28 shRedir
hi def link shRedir29 shRedir
hi def link shRedir30 shRedir
hi def link shRedir31 shRedir
hi def link shRedir32 shRedir
hi def link shHereDoc01 shRedir
hi def link shHereDoc02 shRedir
hi def link shHereDoc03 shRedir
hi def link shHereDoc04 shRedir
hi def link shHereDoc05 shRedir
hi def link shHereDoc06 shRedir
hi def link shHereDoc07 shRedir
hi def link shHereDoc08 shRedir
hi def link shHereDoc09 shRedir
hi def link shHereDoc10 shRedir
hi def link shHereDoc11 shRedir
hi def link shHereDoc12 shRedir
hi def link shHereDoc13 shRedir
hi def link shHereDoc14 shRedir
hi def link shHereDoc15 shRedir
hi def link shHereDoc16 shRedir
hi def link shHereDoc17 shRedir
hi def link shHereDoc18 shRedir
hi def link shHereDoc19 shRedir
hi def link shHereDoc20 shRedir
hi def link shHereDoc21 shRedir
hi def link shHereDoc22 shRedir
hi def link shHereDoc23 shRedir
hi def link shHereDoc24 shRedir
hi def link shHereDoc25 shRedir
hi def link shHereDoc26 shRedir
hi def link shHereDoc27 shRedir
hi def link shHereDoc28 shRedir
hi def link shHereDoc29 shRedir
hi def link shHereDoc30 shRedir
hi def link shHereDoc31 shRedir
hi def link shHereDoc32 shRedir
" Set Current Syntax: {{{1
" ===================
+28 -28
View File
@@ -1,8 +1,8 @@
" Vim syntax file
" Language: TeX
" Maintainer: Charles E. Campbell <NdrchipO@ScampbellPfamily.AbizM>
" Last Change: Apr 02, 2015
" Version: 84
" Last Change: Jun 11, 2015
" Version: 87
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TEX
"
" Notes: {{{1
@@ -207,7 +207,7 @@ if s:tex_fast =~ 'M'
if !exists("s:tex_no_error") || !s:tex_no_error
syn match texMathError "}" contained
endif
syn region texMathMatcher matchgroup=Delimiter start="{" skip="\\\\\|\\}" end="}" end="%stopzone\>" contained contains=@texMathMatchGroup
syn region texMathMatcher matchgroup=Delimiter start="{" skip="\(\\\\\)*\\}" end="}" end="%stopzone\>" contained contains=@texMathMatchGroup
endif
endif
@@ -226,7 +226,7 @@ endif
" TeX/LaTeX delimiters: {{{1
syn match texDelimiter "&"
syn match texDelimiter "\\\\"
syn match texDelimiter "[{}]"
"%syn match texDelimiter "[{}]"
" Tex/Latex Options: {{{1
syn match texOption "[^\\]\zs#\d\+\|^#\d\+"
@@ -247,7 +247,7 @@ syn match texLigature "\\\([ijolL]\|ae\|oe\|ss\|AA\|AE\|OE\)$"
" \begin{}/\end{} section markers: {{{1
syn match texBeginEnd "\\begin\>\|\\end\>" nextgroup=texBeginEndName
if s:tex_fast =~ 'm'
syn region texBeginEndName matchgroup=Delimiter start="{" end="}" contained nextgroup=texBeginEndModifier contains=texComment
syn region texBeginEndName matchgroup=Delimiter start="{" end="}" contained nextgroup=texBeginEndModifier contains=texComment
syn region texBeginEndModifier matchgroup=Delimiter start="\[" end="]" contained contains=texComment,@NoSpell
endif
@@ -392,22 +392,22 @@ endif
if s:tex_fast =~ 'b'
if s:tex_conceal =~ 'b'
if !exists("g:tex_nospell") || !g:tex_nospell
syn region texBoldStyle matchgroup=texTypeStyle start="\\textbf\s*\ze{" matchgroup=Delimiter end="}" concealends contains=@texBoldGroup,@Spell
syn region texBoldItalStyle matchgroup=texTypeStyle start="\\textit\s*\ze{" matchgroup=Delimiter end="}" concealends contains=@texItalGroup,@Spell
syn region texItalStyle matchgroup=texTypeStyle start="\\textit\s*\ze{" matchgroup=Delimiter end="}" concealends contains=@texItalGroup,@Spell
syn region texItalBoldStyle matchgroup=texTypeStyle start="\\textbf\s*\ze{" matchgroup=Delimiter end="}" concealends contains=@texBoldGroup,@Spell
else
syn region texBoldStyle matchgroup=texTypeStyle start="\\textbf\s*\ze{" matchgroup=Delimiter end="}" concealends contains=@texBoldGroup
syn region texBoldItalStyle matchgroup=texTypeStyle start="\\textit\s*\ze{" matchgroup=Delimiter end="}" concealends contains=@texItalGroup
syn region texItalStyle matchgroup=texTypeStyle start="\\textit\s*\ze{" matchgroup=Delimiter end="}" concealends contains=@texItalGroup
syn region texItalBoldStyle matchgroup=texTypeStyle start="\\textbf\s*\ze{" matchgroup=Delimiter end="}" concealends contains=@texBoldGroup
syn region texBoldStyle matchgroup=texTypeStyle start="\\textbf\s*{" matchgroup=texTypeStyle end="}" concealends contains=@texBoldGroup,@Spell
syn region texBoldItalStyle matchgroup=texTypeStyle start="\\textit\s*{" matchgroup=texTypeStyle end="}" concealends contains=@texItalGroup,@Spell
syn region texItalStyle matchgroup=texTypeStyle start="\\textit\s*{" matchgroup=texTypeStyle end="}" concealends contains=@texItalGroup,@Spell
syn region texItalBoldStyle matchgroup=texTypeStyle start="\\textbf\s*{" matchgroup=texTypeStyle end="}" concealends contains=@texBoldGroup,@Spell
else
syn region texBoldStyle matchgroup=texTypeStyle start="\\textbf\s*{" matchgroup=texTypeStyle end="}" concealends contains=@texBoldGroup
syn region texBoldItalStyle matchgroup=texTypeStyle start="\\textit\s*{" matchgroup=texTypeStyle end="}" concealends contains=@texItalGroup
syn region texItalStyle matchgroup=texTypeStyle start="\\textit\s*{" matchgroup=texTypeStyle end="}" concealends contains=@texItalGroup
syn region texItalBoldStyle matchgroup=texTypeStyle start="\\textbf\s*{" matchgroup=texTypeStyle end="}" concealends contains=@texBoldGroup
endif
endif
endif
" Bad Math (mismatched): {{{1
if !exists("g:tex_no_math") && (!exists("s:tex_no_error") || !s:tex_no_error)
syn match texBadMath "\\end\s*{\s*\(array\|gathered\|bBpvV]matrix\|split\|subequations\|smallmatrix\|xxalignat\)\s*}"
syn match texBadMath "\\end\s*{\s*\(array\|gathered\|bBpvV]matrix\|split\|smallmatrix\|xxalignat\)\s*}"
syn match texBadMath "\\end\s*{\s*\(align\|alignat\|displaymath\|displaymath\|eqnarray\|equation\|flalign\|gather\|math\|multline\|xalignat\)\*\=\s*}"
syn match texBadMath "\\[\])]"
endif
@@ -456,24 +456,23 @@ if !exists("g:tex_no_math")
call TexNewMathZone("G","gather",1)
call TexNewMathZone("H","math",1)
call TexNewMathZone("I","multline",1)
call TexNewMathZone("J","subequations",0)
call TexNewMathZone("K","xalignat",1)
call TexNewMathZone("L","xxalignat",0)
call TexNewMathZone("J","xalignat",1)
call TexNewMathZone("K","xxalignat",0)
" Inline Math Zones: {{{2
if s:tex_fast =~ 'M'
if has("conceal") && &enc == 'utf-8' && s:tex_conceal =~ 'd'
syn region texMathZoneV matchgroup=Delimiter start="\\(" matchgroup=Delimiter end="\\)\|%stopzone\>" keepend concealends contains=@texMathZoneGroup
syn region texMathZoneW matchgroup=Delimiter start="\\\[" matchgroup=Delimiter end="\\]\|%stopzone\>" keepend concealends contains=@texMathZoneGroup
syn region texMathZoneX matchgroup=Delimiter start="\$" skip="\\\\\|\\\$" matchgroup=Delimiter end="\$" end="%stopzone\>" concealends contains=@texMathZoneGroup
syn region texMathZoneY matchgroup=Delimiter start="\$\$" matchgroup=Delimiter end="\$\$" end="%stopzone\>" concealends keepend contains=@texMathZoneGroup
syn region texMathZoneV matchgroup=Delimiter start="\\(" matchgroup=Delimiter end="\\)\|%stopzone\>" keepend concealends contains=@texMathZoneGroup
syn region texMathZoneW matchgroup=Delimiter start="\\\[" matchgroup=Delimiter end="\\]\|%stopzone\>" keepend concealends contains=@texMathZoneGroup
syn region texMathZoneX matchgroup=Delimiter start="\$" skip="\\\\\|\\\$" matchgroup=Delimiter end="\$" end="%stopzone\>" concealends contains=@texMathZoneGroup
syn region texMathZoneY matchgroup=Delimiter start="\$\$" matchgroup=Delimiter end="\$\$" end="%stopzone\>" keepend concealends contains=@texMathZoneGroup
else
syn region texMathZoneV matchgroup=Delimiter start="\\(" matchgroup=Delimiter end="\\)\|%stopzone\>" keepend contains=@texMathZoneGroup
syn region texMathZoneW matchgroup=Delimiter start="\\\[" matchgroup=Delimiter end="\\]\|%stopzone\>" keepend contains=@texMathZoneGroup
syn region texMathZoneX matchgroup=Delimiter start="\$" skip="\\\\\|\\\$" matchgroup=Delimiter end="\$" end="%stopzone\>" contains=@texMathZoneGroup
syn region texMathZoneY matchgroup=Delimiter start="\$\$" matchgroup=Delimiter end="\$\$" end="%stopzone\>" keepend contains=@texMathZoneGroup
syn region texMathZoneV matchgroup=Delimiter start="\\(" matchgroup=Delimiter end="\\)\|%stopzone\>" keepend contains=@texMathZoneGroup
syn region texMathZoneW matchgroup=Delimiter start="\\\[" matchgroup=Delimiter end="\\]\|%stopzone\>" keepend contains=@texMathZoneGroup
syn region texMathZoneX matchgroup=Delimiter start="\$" skip="\\\\\|\\\$" matchgroup=Delimiter end="\$" end="%stopzone\>" contains=@texMathZoneGroup
syn region texMathZoneY matchgroup=Delimiter start="\$\$" matchgroup=Delimiter end="\$\$" end="%stopzone\>" keepend contains=@texMathZoneGroup
endif
syn region texMathZoneZ matchgroup=texStatement start="\\ensuremath\s*{" matchgroup=texStatement end="}" end="%stopzone\>" contains=@texMathZoneGroup
syn region texMathZoneZ matchgroup=texStatement start="\\ensuremath\s*{" matchgroup=texStatement end="}" end="%stopzone\>" contains=@texMathZoneGroup
endif
syn match texMathOper "[_^=]" contained
@@ -1062,11 +1061,12 @@ if has("conceal") && &enc == 'utf-8'
syn region texSuperscript matchgroup=Delimiter start='\^{' skip="\\\\\|\\[{}]" end='}' contained concealends contains=texSpecialChar,texSuperscripts,texStatement,texSubscript,texSuperscript,texMathMatcher
syn region texSubscript matchgroup=Delimiter start='_{' skip="\\\\\|\\[{}]" end='}' contained concealends contains=texSpecialChar,texSubscripts,texStatement,texSubscript,texSuperscript,texMathMatcher
endif
" s:SuperSub:
fun! s:SuperSub(group,leader,pat,cchar)
if a:pat =~ '^\\' || (a:leader == '\^' && a:pat =~ g:tex_superscripts) || (a:leader == '_' && a:pat =~ g:tex_subscripts)
" call Decho("SuperSub: group<".a:group."> leader<".a:leader."> pat<".a:pat."> cchar<".a:cchar.">")
exe 'syn match '.a:group." '".a:leader.a:pat."' contained conceal cchar=".a:cchar
exe 'syn match '.a:group."s '".a:pat."' contained conceal cchar=".a:cchar.' nextgroup='.a:group.'s'
exe 'syn match '.a:group."s '".a:pat ."' contained conceal cchar=".a:cchar.' nextgroup='.a:group.'s'
endif
endfun
call s:SuperSub('texSuperscript','\^','0','⁰')
+29 -18
View File
@@ -3,7 +3,7 @@
" Maintainer: Daniel Kho <daniel.kho@tauhop.com>
" Previous Maintainer: Czo <Olivier.Sirol@lip6.fr>
" Credits: Stephan Hegel <stephan.hegel@snc.siemens.com.cn>
" Last Changed: 2012 Feb 03 by Thilo Six
" Last Changed: 2015 Apr 25 by Daniel Kho
" $Id: vhdl.vim,v 1.1 2004/06/13 15:34:56 vimboss Exp $
" VHSIC (Very High Speed Integrated Circuit) Hardware Description Language
@@ -160,10 +160,20 @@ syn match vhdlSpecial "[().,;]"
syn match vhdlTime "\<\d\+\s\+\(\([fpnum]s\)\|\(sec\)\|\(min\)\|\(hr\)\)\>"
syn match vhdlTime "\<\d\+\.\d\+\s\+\(\([fpnum]s\)\|\(sec\)\|\(min\)\|\(hr\)\)\>"
syn keyword vhdlTodo contained TODO FIXME
syn keyword vhdlTodo contained TODO NOTE
syn keyword vhdlFixme contained FIXME
syn region vhdlComment start="/\*" end="\*/" contains=vhdlTodo,@Spell
syn match vhdlComment "--.*" contains=vhdlTodo,@Spell
" Regex for space is '\s'
" Any number of spaces: \s*
" At least one space: \s+
syn region vhdlComment start="/\*" end="\*/" contains=vhdlTodo,vhdlFixme,@Spell
syn match vhdlComment "--.*" contains=vhdlTodo,vhdlFixme,@Spell
syn match vhdlPreProc "/\* synthesis .* \*/"
syn match vhdlPreProc "/\* pragma .* \*/"
syn match vhdlPreProc "/\* synopsys .* \*/"
syn match vhdlPreProc "--\s*synthesis .*"
syn match vhdlPreProc "--\s*pragma .*"
syn match vhdlPreProc "--\s*synopsys .*"
" syn match vhdlGlobal "[\'$#~!%@?\^\[\]{}\\]"
"Modify the following as needed. The trade-off is performance versus functionality.
@@ -180,21 +190,22 @@ if version >= 508 || !exists("did_vhdl_syntax_inits")
command -nargs=+ HiLink hi def link <args>
endif
" HiLink cDefine PreProc
HiLink vhdlSpecial Special
HiLink vhdlStatement Statement
HiLink vhdlCharacter Character
HiLink vhdlString String
HiLink vhdlVector Number
HiLink vhdlBoolean Number
HiLink vhdlTodo Todo
HiLink vhdlComment Comment
HiLink vhdlNumber Number
HiLink vhdlTime Number
HiLink vhdlType Type
HiLink vhdlOperator Special
HiLink vhdlSpecial Special
HiLink vhdlStatement Statement
HiLink vhdlCharacter Character
HiLink vhdlString String
HiLink vhdlVector Number
HiLink vhdlBoolean Number
HiLink vhdlTodo Todo
HiLink vhdlFixme Fixme
HiLink vhdlComment Comment
HiLink vhdlNumber Number
HiLink vhdlTime Number
HiLink vhdlType Type
HiLink vhdlOperator Operator
" HiLink vhdlGlobal Error
HiLink vhdlAttribute Type
HiLink vhdlAttribute Special
HiLink vhdlPreProc PreProc
delcommand HiLink
endif
+172 -17
View File
@@ -1,7 +1,10 @@
" Vim syntax file
" Language: Zsh shell script
" Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2010-01-23
" Language: Zsh shell script
" Maintainer: Christian Brabandt <cb@256bit.org>
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2015-05-29
" License: Vim (see :h license)
" Repository: https://github.com/chrisbra/vim-zsh
if exists("b:current_syntax")
finish
@@ -14,7 +17,7 @@ setlocal iskeyword+=-
syn keyword zshTodo contained TODO FIXME XXX NOTE
syn region zshComment oneline start='\%(^\|\s\)#' end='$'
syn region zshComment oneline start='\%(^\|\s*\)#' end='$'
\ contains=zshTodo,@Spell
syn match zshPreProc '^\%1l#\%(!\|compdef\|autoload\).*$'
@@ -30,7 +33,7 @@ syn match zshJobSpec '%\(\d\+\|?\=\w\+\|[%+-]\)'
syn keyword zshPrecommand noglob nocorrect exec command builtin - time
syn keyword zshDelimiter do done
syn keyword zshDelimiter do done end
syn keyword zshConditional if then elif else fi case in esac select
@@ -64,7 +67,7 @@ syn region zshHereDoc matchgroup=zshRedir
\ end='^\s*\z1\>'
\ contains=@zshSubst
syn region zshHereDoc matchgroup=zshRedir
\ start=+<\@<!<<\s*\(["']\)\z(\S\+\)\1+
\ start=+<\@<!<<\s*\(["']\)\z(\S\+\)\1+
\ end='^\z1\>'
syn region zshHereDoc matchgroup=zshRedir
\ start=+<\@<!<<-\s*\(["']\)\z(\S\+\)\1+
@@ -121,6 +124,165 @@ syn keyword zshCommands alias autoload bg bindkey break bye cap cd
\ zmodload zparseopts zprof zpty zregexparse
\ zsocket zstyle ztcp
" Options, generated by: echo ${(j:\n:)options[(I)*]} | sort
syn case ignore
syn keyword zshOptions aliases allexport all_export alwayslastprompt
\ always_lastprompt alwaystoend always_to_end
\ appendhistory append_history autocd autocontinue
\ auto_continue autolist auto_list
\ automenu auto_menu autonamedirs auto_name_dirs
\ autoparamkeys auto_param_keys autoparamslash
\ auto_param_slash autopushd auto_pushd autoremoveslash
\ auto_remove_slash autoresume auto_resume badpattern
\ banghist bang_hist bareglobqual bare_glob_qual
\ bashautolist bash_auto_list bashrematch bash_rematch
\ beep bgnice braceccl brace_ccl braceexpand brace_expand
\ bsdecho bsd_echo caseglob case_glob casematch case_match
\ cbases cdablevars cd_able_vars chasedots chase_dots
\ chaselinks chase_links checkjobs check_jobs
\ clobber combiningchars combining_chars completealiases
\ complete_aliases completeinword complete_in_word
\ continueonerror continue_on_error correct
\ correctall correct_all cprecedences c_precedences
\ cshjunkiehistory csh_junkie_history cshjunkieloops
\ csh_junkie_loops cshjunkiequotes csh_junkie_quotes
\ cshnullcmd csh_null_cmd cshnullglob csh_null_glob
\ debugbeforecmd debug_before_cmd dotglob dot_glob dvorak
\ emacs equals errexit err_exit errreturn err_return evallineno
\ eval_lineno exec extendedglob extended_glob extendedhistory
\ extended_history flowcontrol flow_control forcefloat
\ force_float functionargzero function_arg_zero glob globalexport
\ global_export globalrcs global_rcs globassign glob_assign
\ globcomplete glob_complete globdots glob_dots glob_subst
\ globsubst hashall hash_all hashcmds hash_cmds hashdirs
\ hash_dirs hashexecutablesonly hash_executables_only hashlistall
\ hash_list_all histallowclobber hist_allow_clobber histappend
\ hist_append histbeep hist_beep hist_expand hist_expire_dups_first
\ histexpand histexpiredupsfirst histfcntllock hist_fcntl_lock
\ histfindnodups hist_find_no_dups histignorealldups
\ hist_ignore_all_dups histignoredups hist_ignore_dups
\ histignorespace hist_ignore_space histlexwords hist_lex_words
\ histnofunctions hist_no_functions histnostore hist_no_store
\ histreduceblanks hist_reduce_blanks histsavebycopy
\ hist_save_by_copy histsavenodups hist_save_no_dups
\ histsubstpattern hist_subst_pattern histverify hist_verify
\ hup ignorebraces ignore_braces ignoreclosebraces ignore_close_braces
\ ignoreeof ignore_eof incappendhistory inc_append_history
\ incappendhistorytime inc_append_history_time interactive
\ interactivecomments interactive_comments ksharrays ksh_arrays
\ kshautoload ksh_autoload kshglob ksh_glob kshoptionprint
\ ksh_option_print kshtypeset ksh_typeset kshzerosubscript
\ ksh_zero_subscript listambiguous list_ambiguous listbeep
\ list_beep listpacked list_packed listrowsfirst list_rows_first
\ listtypes list_types localloops local_loops localoptions
\ local_options localpatterns local_patterns localtraps
\ local_traps log login longlistjobs long_list_jobs magicequalsubst
\ magic_equal_subst mailwarn mail_warn mail_warning mark_dirs
\ mailwarning markdirs menucomplete menu_complete monitor
\ multibyte multi_byte multifuncdef multi_func_def multios
\ multi_os nomatch no_match notify nullglob null_glob numericglobsort
\ numeric_glob_sort octalzeroes octal_zeroes onecmd one_cmd
\ overstrike over_strike pathdirs path_dirs pathscript
\ path_script physical pipefail pipe_fail posixaliases
\ posix_aliases posixargzero posix_arg_zero posixbuiltins
\ posix_builtins posixcd posix_cd posixidentifiers posix_identifiers
\ posixjobs posix_jobs posixstrings posix_strings posixtraps
\ posix_traps printeightbit print_eight_bit printexitvalue
\ print_exit_value privileged promptbang prompt_bang promptcr
\ prompt_cr promptpercent prompt_percent promptsp prompt_sp
\ promptsubst prompt_subst promptvars prompt_vars pushdignoredups
\ pushd_ignore_dups pushdminus pushd_minus pushdsilent pushd_silent
\ pushdtohome pushd_to_home rcexpandparam rc_expandparam rcquotes
\ rc_quotes rcs recexact rec_exact rematchpcre re_match_pcre
\ restricted rmstarsilent rm_star_silent rmstarwait rm_star_wait
\ sharehistory share_history shfileexpansion sh_file_expansion
\ shglob sh_glob shinstdin shin_stdin shnullcmd sh_nullcmd
\ shoptionletters sh_option_letters shortloops short_loops shwordsplit
\ sh_word_split singlecommand single_command singlelinezle single_line_zle
\ sourcetrace source_trace stdin sunkeyboardhack sun_keyboard_hack
\ trackall track_all transientrprompt transient_rprompt
\ trapsasync trapasync typesetsilent type_set_silent unset verbose vi
\ warncreateglobal warn_create_global xtrace zle
syn keyword zshOptions noaliases no_aliases noallexport no_allexport noall_export no_all_export noalwayslastprompt no_alwayslastprompt
\ noalways_lastprompt no_always_lastprompt noalwaystoend no_alwaystoend noalways_to_end no_always_to_end
\ noappendhistory no_appendhistory noappend_history no_append_history noautocd no_autocd noautocontinue no_autocontinue
\ noauto_continue no_auto_continue noautolist no_autolist noauto_list no_auto_list
\ noautomenu no_automenu noauto_menu no_auto_menu noautonamedirs no_autonamedirs noauto_name_dirs no_auto_name_dirs
\ noautoparamkeys no_autoparamkeys noauto_param_keys no_auto_param_keys noautoparamslash no_autoparamslash
\ noauto_param_slash no_auto_param_slash noautopushd no_autopushd noauto_pushd no_auto_pushd noautoremoveslash no_autoremoveslash
\ noauto_remove_slash no_auto_remove_slash noautoresume no_autoresume noauto_resume no_auto_resume nobadpattern no_badpattern
\ nobanghist no_banghist nobang_hist no_bang_hist nobareglobqual no_bareglobqual nobare_glob_qual no_bare_glob_qual
\ nobashautolist no_bashautolist nobash_auto_list no_bash_auto_list nobashrematch no_bashrematch nobash_rematch no_bash_rematch
\ nobeep no_beep nobgnice no_bgnice nobraceccl no_braceccl nobrace_ccl no_brace_ccl nobraceexpand no_braceexpand nobrace_expand no_brace_expand
\ nobsdecho no_bsdecho nobsd_echo no_bsd_echo nocaseglob no_caseglob nocase_glob no_case_glob nocasematch no_casematch nocase_match no_case_match
\ nocbases no_cbases nocdablevars no_cdablevars nocd_able_vars no_cd_able_vars nochasedots no_chasedots nochase_dots no_chase_dots
\ nochaselinks no_chaselinks nochase_links no_chase_links nocheckjobs no_checkjobs nocheck_jobs no_check_jobs
\ noclobber no_clobber nocombiningchars no_combiningchars nocombining_chars no_combining_chars nocompletealiases no_completealiases
\ nocomplete_aliases no_complete_aliases nocompleteinword no_completeinword nocomplete_in_word no_complete_in_word
\ nocontinueonerror no_continueonerror nocontinue_on_error no_continue_on_error nocorrect no_correct
\ nocorrectall no_correctall nocorrect_all no_correct_all nocprecedences no_cprecedences noc_precedences no_c_precedences
\ nocshjunkiehistory no_cshjunkiehistory nocsh_junkie_history no_csh_junkie_history nocshjunkieloops no_cshjunkieloops
\ nocsh_junkie_loops no_csh_junkie_loops nocshjunkiequotes no_cshjunkiequotes nocsh_junkie_quotes no_csh_junkie_quotes
\ nocshnullcmd no_cshnullcmd nocsh_null_cmd no_csh_null_cmd nocshnullglob no_cshnullglob nocsh_null_glob no_csh_null_glob
\ nodebugbeforecmd no_debugbeforecmd nodebug_before_cmd no_debug_before_cmd nodotglob no_dotglob nodot_glob no_dot_glob nodvorak no_dvorak
\ noemacs no_emacs noequals no_equals noerrexit no_errexit noerr_exit no_err_exit noerrreturn no_errreturn noerr_return no_err_return noevallineno no_evallineno
\ noeval_lineno no_eval_lineno noexec no_exec noextendedglob no_extendedglob noextended_glob no_extended_glob noextendedhistory no_extendedhistory
\ noextended_history no_extended_history noflowcontrol no_flowcontrol noflow_control no_flow_control noforcefloat no_forcefloat
\ noforce_float no_force_float nofunctionargzero no_functionargzero nofunction_arg_zero no_function_arg_zero noglob no_glob noglobalexport no_globalexport
\ noglobal_export no_global_export noglobalrcs no_globalrcs noglobal_rcs no_global_rcs noglobassign no_globassign noglob_assign no_glob_assign
\ noglobcomplete no_globcomplete noglob_complete no_glob_complete noglobdots no_globdots noglob_dots no_glob_dots noglob_subst no_glob_subst
\ noglobsubst no_globsubst nohashall no_hashall nohash_all no_hash_all nohashcmds no_hashcmds nohash_cmds no_hash_cmds nohashdirs no_hashdirs
\ nohash_dirs no_hash_dirs nohashexecutablesonly no_hashexecutablesonly nohash_executables_only no_hash_executables_only nohashlistall no_hashlistall
\ nohash_list_all no_hash_list_all nohistallowclobber no_histallowclobber nohist_allow_clobber no_hist_allow_clobber nohistappend no_histappend
\ nohist_append no_hist_append nohistbeep no_histbeep nohist_beep no_hist_beep nohist_expand no_hist_expand nohist_expire_dups_first no_hist_expire_dups_first
\ nohistexpand no_histexpand nohistexpiredupsfirst no_histexpiredupsfirst nohistfcntllock no_histfcntllock nohist_fcntl_lock no_hist_fcntl_lock
\ nohistfindnodups no_histfindnodups nohist_find_no_dups no_hist_find_no_dups nohistignorealldups no_histignorealldups
\ nohist_ignore_all_dups no_hist_ignore_all_dups nohistignoredups no_histignoredups nohist_ignore_dups no_hist_ignore_dups
\ nohistignorespace no_histignorespace nohist_ignore_space no_hist_ignore_space nohistlexwords no_histlexwords nohist_lex_words no_hist_lex_words
\ nohistnofunctions no_histnofunctions nohist_no_functions no_hist_no_functions nohistnostore no_histnostore nohist_no_store no_hist_no_store
\ nohistreduceblanks no_histreduceblanks nohist_reduce_blanks no_hist_reduce_blanks nohistsavebycopy no_histsavebycopy
\ nohist_save_by_copy no_hist_save_by_copy nohistsavenodups no_histsavenodups nohist_save_no_dups no_hist_save_no_dups
\ nohistsubstpattern no_histsubstpattern nohist_subst_pattern no_hist_subst_pattern nohistverify no_histverify nohist_verify no_hist_verify
\ nohup no_hup noignorebraces no_ignorebraces noignore_braces no_ignore_braces noignoreclosebraces no_ignoreclosebraces noignore_close_braces no_ignore_close_braces
\ noignoreeof no_ignoreeof noignore_eof no_ignore_eof noincappendhistory no_incappendhistory noinc_append_history no_inc_append_history
\ noincappendhistorytime no_incappendhistorytime noinc_append_history_time no_inc_append_history_time nointeractive no_interactive
\ nointeractivecomments no_interactivecomments nointeractive_comments no_interactive_comments noksharrays no_ksharrays noksh_arrays no_ksh_arrays
\ nokshautoload no_kshautoload noksh_autoload no_ksh_autoload nokshglob no_kshglob noksh_glob no_ksh_glob nokshoptionprint no_kshoptionprint
\ noksh_option_print no_ksh_option_print nokshtypeset no_kshtypeset noksh_typeset no_ksh_typeset nokshzerosubscript no_kshzerosubscript
\ noksh_zero_subscript no_ksh_zero_subscript nolistambiguous no_listambiguous nolist_ambiguous no_list_ambiguous nolistbeep no_listbeep
\ nolist_beep no_list_beep nolistpacked no_listpacked nolist_packed no_list_packed nolistrowsfirst no_listrowsfirst nolist_rows_first no_list_rows_first
\ nolisttypes no_listtypes nolist_types no_list_types nolocalloops no_localloops nolocal_loops no_local_loops nolocaloptions no_localoptions
\ nolocal_options no_local_options nolocalpatterns no_localpatterns nolocal_patterns no_local_patterns nolocaltraps no_localtraps
\ nolocal_traps no_local_traps nolog no_log nologin no_login nolonglistjobs no_longlistjobs nolong_list_jobs no_long_list_jobs nomagicequalsubst no_magicequalsubst
\ nomagic_equal_subst no_magic_equal_subst nomailwarn no_mailwarn nomail_warn no_mail_warn nomail_warning no_mail_warning nomark_dirs no_mark_dirs
\ nomailwarning no_mailwarning nomarkdirs no_markdirs nomenucomplete no_menucomplete nomenu_complete no_menu_complete nomonitor no_monitor
\ nomultibyte no_multibyte nomulti_byte no_multi_byte nomultifuncdef no_multifuncdef nomulti_func_def no_multi_func_def nomultios no_multios
\ nomulti_os no_multi_os nonomatch no_nomatch nono_match no_no_match nonotify no_notify nonullglob no_nullglob nonull_glob no_null_glob nonumericglobsort no_numericglobsort
\ nonumeric_glob_sort no_numeric_glob_sort nooctalzeroes no_octalzeroes nooctal_zeroes no_octal_zeroes noonecmd no_onecmd noone_cmd no_one_cmd
\ nooverstrike no_overstrike noover_strike no_over_strike nopathdirs no_pathdirs nopath_dirs no_path_dirs nopathscript no_pathscript
\ nopath_script no_path_script nophysical no_physical nopipefail no_pipefail nopipe_fail no_pipe_fail noposixaliases no_posixaliases
\ noposix_aliases no_posix_aliases noposixargzero no_posixargzero noposix_arg_zero no_posix_arg_zero noposixbuiltins no_posixbuiltins
\ noposix_builtins no_posix_builtins noposixcd no_posixcd noposix_cd no_posix_cd noposixidentifiers no_posixidentifiers noposix_identifiers no_posix_identifiers
\ noposixjobs no_posixjobs noposix_jobs no_posix_jobs noposixstrings no_posixstrings noposix_strings no_posix_strings noposixtraps no_posixtraps
\ noposix_traps no_posix_traps noprinteightbit no_printeightbit noprint_eight_bit no_print_eight_bit noprintexitvalue no_printexitvalue
\ noprint_exit_value no_print_exit_value noprivileged no_privileged nopromptbang no_promptbang noprompt_bang no_prompt_bang nopromptcr no_promptcr
\ noprompt_cr no_prompt_cr nopromptpercent no_promptpercent noprompt_percent no_prompt_percent nopromptsp no_promptsp noprompt_sp no_prompt_sp
\ nopromptsubst no_promptsubst noprompt_subst no_prompt_subst nopromptvars no_promptvars noprompt_vars no_prompt_vars nopushdignoredups no_pushdignoredups
\ nopushd_ignore_dups no_pushd_ignore_dups nopushdminus no_pushdminus nopushd_minus no_pushd_minus nopushdsilent no_pushdsilent nopushd_silent no_pushd_silent
\ nopushdtohome no_pushdtohome nopushd_to_home no_pushd_to_home norcexpandparam no_rcexpandparam norc_expandparam no_rc_expandparam norcquotes no_rcquotes
\ norc_quotes no_rc_quotes norcs no_rcs norecexact no_recexact norec_exact no_rec_exact norematchpcre no_rematchpcre nore_match_pcre no_re_match_pcre
\ norestricted no_restricted normstarsilent no_rmstarsilent norm_star_silent no_rm_star_silent normstarwait no_rmstarwait norm_star_wait no_rm_star_wait
\ nosharehistory no_sharehistory noshare_history no_share_history noshfileexpansion no_shfileexpansion nosh_file_expansion no_sh_file_expansion
\ noshglob no_shglob nosh_glob no_sh_glob noshinstdin no_shinstdin noshin_stdin no_shin_stdin noshnullcmd no_shnullcmd nosh_nullcmd no_sh_nullcmd
\ noshoptionletters no_shoptionletters nosh_option_letters no_sh_option_letters noshortloops no_shortloops noshort_loops no_short_loops noshwordsplit no_shwordsplit
\ nosh_word_split no_sh_word_split nosinglecommand no_singlecommand nosingle_command no_single_command nosinglelinezle no_singlelinezle nosingle_line_zle no_single_line_zle
\ nosourcetrace no_sourcetrace nosource_trace no_source_trace nostdin no_stdin nosunkeyboardhack no_sunkeyboardhack nosun_keyboard_hack no_sun_keyboard_hack
\ notrackall no_trackall notrack_all no_track_all notransientrprompt no_transientrprompt notransient_rprompt no_transient_rprompt
\ notrapsasync no_trapsasync notrapasync no_trapasync notypesetsilent no_typesetsilent notype_set_silent no_type_set_silent nounset no_unset noverbose no_verbose novi no_vi
\ nowarncreateglobal no_warncreateglobal nowarn_create_global no_warn_create_global noxtrace no_xtrace nozle no_zle
syn case match
syn keyword zshTypes float integer local typeset declare
" XXX: this may be too much
@@ -149,7 +311,7 @@ syn region zshSubst matchgroup=zshSubstDelim start='\${' skip='\\}'
syn region zshOldSubst matchgroup=zshSubstDelim start=+`+ skip=+\\`+
\ end=+`+ contains=TOP,zshOldSubst
syn sync minlines=50
syn sync minlines=50 maxlines=90
syn sync match zshHereDocSync grouphere NONE '<<-\=\s*\%(\\\=\S\+\|\(["']\)\S\+\1\)'
syn sync match zshHereDocEndSync groupthere NONE '^\s*EO\a\+\>'
@@ -170,16 +332,8 @@ hi def link zshKeyword Keyword
hi def link zshFunction None
hi def link zshKSHFunction zshFunction
hi def link zshHereDoc String
if 0
hi def link zshOperator Operator
else
hi def link zshOperator None
endif
if 1
hi def link zshRedir Operator
else
hi def link zshRedir None
endif
hi def link zshOperator None
hi def link zshRedir Operator
hi def link zshVariable None
hi def link zshVariableDef zshVariable
hi def link zshDereferencing PreProc
@@ -199,6 +353,7 @@ else
hi def link zshDeref None
endif
hi def link zshCommands Keyword
hi def link zshOptions Constant
hi def link zshTypes Type
hi def link zshSwitches Special
hi def link zshNumber Number
+2
View File
@@ -252,6 +252,8 @@ func! BuildWidthTable(pattern, tableName)
endfunc
" Try to avoid hitting E36
set equalalways
" Edit the Unicode text file. Requires the netrw plugin.
edit http://unicode.org/Public/UNIDATA/UnicodeData.txt
+1 -1
View File
@@ -47,7 +47,7 @@ CXX := $(CROSS_COMPILE)g++
WINDRES := $(CROSS_COMPILE)windres
WINDRES_CXX = $(CXX)
WINDRES_FLAGS = --preprocessor="$(WINDRES_CXX) -E -xc" -DRC_INVOKED
LIBS := -luuid
LIBS := -luuid -lgdi32
RES := gvimext.res
DEFFILE = gvimext_ming.def
OBJ := gvimext.o
+3 -1
View File
@@ -4,7 +4,9 @@
#
TARGETOS=BOTH
APPVER=4.0
!ifndef APPVER
APPVER=5.0
!endif
!if "$(DEBUG)" != "yes"
NODEBUG = 1
+88 -34
View File
@@ -79,19 +79,24 @@ getGvimName(char *name, int runtime)
strcpy(name, searchpath((char *)"gvim.bat"));
if (name[0] == 0)
strcpy(name, "gvim"); // finds gvim.bat or gvim.exe
// avoid that Vim tries to expand wildcards in the file names
strcat(name, " --literal");
}
}
static void
getGvimNameW(wchar_t *nameW)
getGvimInvocation(char *name, int runtime)
{
getGvimName(name, runtime);
// avoid that Vim tries to expand wildcards in the file names
strcat(name, " --literal");
}
static void
getGvimInvocationW(wchar_t *nameW)
{
char *name;
name = (char *)malloc(BUFSIZE);
getGvimName(name, 0);
getGvimInvocation(name, 0);
mbstowcs(nameW, name, BUFSIZE);
free(name);
}
@@ -123,6 +128,26 @@ getRuntimeDir(char *buf)
}
}
HBITMAP IconToBitmap(HICON hIcon, HBRUSH hBackground, int width, int height)
{
HDC hDC = GetDC(NULL);
HDC hMemDC = CreateCompatibleDC(hDC);
HBITMAP hMemBmp = CreateCompatibleBitmap(hDC, width, height);
HBITMAP hResultBmp = NULL;
HGDIOBJ hOrgBMP = SelectObject(hMemDC, hMemBmp);
DrawIconEx(hMemDC, 0, 0, hIcon, width, height, 0, hBackground, DI_NORMAL);
hResultBmp = hMemBmp;
hMemBmp = NULL;
SelectObject(hMemDC, hOrgBMP);
DeleteDC(hMemDC);
ReleaseDC(NULL, hDC);
DestroyIcon(hIcon);
return hResultBmp;
}
//
// GETTEXT: translated messages and menu entries
//
@@ -404,7 +429,7 @@ STDMETHODIMP CShellExtClassFactory::QueryInterface(REFIID riid,
{
*ppv = NULL;
// Any interface on this object is the object pointer
// any interface on this object is the object pointer
if (IsEqualIID(riid, IID_IUnknown) || IsEqualIID(riid, IID_IClassFactory))
{
@@ -448,7 +473,7 @@ STDMETHODIMP CShellExtClassFactory::CreateInstance(LPUNKNOWN pUnkOuter,
// QueryInterface with IID_IShellExtInit--this is how shell extensions are
// initialized.
LPCSHELLEXT pShellExt = new CShellExt(); //Create the CShellExt object
LPCSHELLEXT pShellExt = new CShellExt(); // create the CShellExt object
if (NULL == pShellExt)
return E_OUTOFMEMORY;
@@ -469,6 +494,8 @@ CShellExt::CShellExt()
m_pDataObj = NULL;
inc_cRefThisDLL();
LoadMenuIcon();
}
CShellExt::~CShellExt()
@@ -477,6 +504,9 @@ CShellExt::~CShellExt()
m_pDataObj->Release();
dec_cRefThisDLL();
if (m_hVimIconBitmap)
DeleteObject(m_hVimIconBitmap);
}
STDMETHODIMP CShellExt::QueryInterface(REFIID riid, LPVOID FAR *ppv)
@@ -597,6 +627,7 @@ STDMETHODIMP CShellExt::QueryContextMenu(HMENU hMenu,
HKEY keyhandle;
bool showExisting = true;
bool showIcons = true;
// Check whether "Edit with existing Vim" entries are disabled.
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, "Software\\Vim\\Gvim", 0,
@@ -605,6 +636,9 @@ STDMETHODIMP CShellExt::QueryContextMenu(HMENU hMenu,
if (RegQueryValueEx(keyhandle, "DisableEditWithExisting", 0, NULL,
NULL, NULL) == ERROR_SUCCESS)
showExisting = false;
if (RegQueryValueEx(keyhandle, "DisableContextMenuIcons", 0, NULL,
NULL, NULL) == ERROR_SUCCESS)
showIcons = false;
RegCloseKey(keyhandle);
}
@@ -612,28 +646,33 @@ STDMETHODIMP CShellExt::QueryContextMenu(HMENU hMenu,
if (showExisting)
EnumWindows(EnumWindowsProc, (LPARAM)this);
MENUITEMINFO mii = { sizeof(MENUITEMINFO) };
mii.fMask = MIIM_STRING | MIIM_ID;
if (showIcons)
{
mii.fMask |= MIIM_BITMAP;
mii.hbmpItem = m_hVimIconBitmap;
}
if (cbFiles > 1)
{
InsertMenu(hMenu,
indexMenu++,
MF_STRING|MF_BYPOSITION,
idCmd++,
_("Edit with &multiple Vims"));
mii.wID = idCmd++;
mii.dwTypeData = _("Edit with &multiple Vims");
mii.cch = lstrlen(mii.dwTypeData);
InsertMenuItem(hMenu, indexMenu++, TRUE, &mii);
InsertMenu(hMenu,
indexMenu++,
MF_STRING|MF_BYPOSITION,
idCmd++,
_("Edit with single &Vim"));
mii.wID = idCmd++;
mii.dwTypeData = _("Edit with single &Vim");
mii.cch = lstrlen(mii.dwTypeData);
InsertMenuItem(hMenu, indexMenu++, TRUE, &mii);
if (cbFiles <= 4)
{
// Can edit up to 4 files in diff mode
InsertMenu(hMenu,
indexMenu++,
MF_STRING|MF_BYPOSITION,
idCmd++,
_("Diff with Vim"));
mii.wID = idCmd++;
mii.dwTypeData = _("Diff with Vim");
mii.cch = lstrlen(mii.dwTypeData);
InsertMenuItem(hMenu, indexMenu++, TRUE, &mii);
m_edit_existing_off = 3;
}
else
@@ -642,11 +681,10 @@ STDMETHODIMP CShellExt::QueryContextMenu(HMENU hMenu,
}
else
{
InsertMenu(hMenu,
indexMenu++,
MF_STRING|MF_BYPOSITION,
idCmd++,
_("Edit with &Vim"));
mii.wID = idCmd++;
mii.dwTypeData = _("Edit with &Vim");
mii.cch = lstrlen(mii.dwTypeData);
InsertMenuItem(hMenu, indexMenu++, TRUE, &mii);
m_edit_existing_off = 1;
}
@@ -672,11 +710,11 @@ STDMETHODIMP CShellExt::QueryContextMenu(HMENU hMenu,
temp[BUFSIZE - 1] = '\0';
strncat(temp, title, BUFSIZE - 1 - strlen(temp));
temp[BUFSIZE - 1] = '\0';
InsertMenu(hMenu,
indexMenu++,
MF_STRING|MF_BYPOSITION,
idCmd++,
temp);
mii.wID = idCmd++;
mii.dwTypeData = temp;
mii.cch = lstrlen(mii.dwTypeData);
InsertMenuItem(hMenu, indexMenu++, TRUE, &mii);
}
// InsertMenu(hMenu, indexMenu++, MF_SEPARATOR|MF_BYPOSITION, 0, NULL);
@@ -813,6 +851,22 @@ BOOL CALLBACK CShellExt::EnumWindowsProc(HWND hWnd, LPARAM lParam)
return TRUE; // continue enumeration (otherwise this would be false)
}
BOOL CShellExt::LoadMenuIcon()
{
char vimExeFile[BUFSIZE];
getGvimName(vimExeFile, 1);
if (vimExeFile[0] == '\0')
return FALSE;
HICON hVimIcon;
if (ExtractIconEx(vimExeFile, 0, NULL, &hVimIcon, 1) == 0)
return FALSE;
m_hVimIconBitmap = IconToBitmap(hVimIcon,
GetSysColorBrush(COLOR_MENU),
GetSystemMetrics(SM_CXSMICON),
GetSystemMetrics(SM_CYSMICON));
return TRUE;
}
#ifdef WIN32
// This symbol is not defined in older versions of the SDK or Visual C++.
@@ -893,7 +947,7 @@ STDMETHODIMP CShellExt::InvokeGvim(HWND hParent,
m_szFileUserClickedOn,
sizeof(m_szFileUserClickedOn));
getGvimNameW(cmdStrW);
getGvimInvocationW(cmdStrW);
wcscat(cmdStrW, L" \"");
if ((wcslen(cmdStrW) + wcslen(m_szFileUserClickedOn) + 2) < BUFSIZE)
@@ -961,7 +1015,7 @@ STDMETHODIMP CShellExt::InvokeSingleGvim(HWND hParent,
cmdlen = BUFSIZE;
cmdStrW = (wchar_t *) malloc(cmdlen * sizeof(wchar_t));
getGvimNameW(cmdStrW);
getGvimInvocationW(cmdStrW);
if (useDiff)
wcscat(cmdStrW, L" -d");
+4
View File
@@ -110,10 +110,14 @@ typedef CShellExtClassFactory *LPCSHELLEXTCLASSFACTORY;
class CShellExt : public IContextMenu,
IShellExtInit
{
private:
BOOL LoadMenuIcon();
protected:
ULONG m_cRef;
LPDATAOBJECT m_pDataObj;
UINT m_edit_existing_off;
HBITMAP m_hVimIconBitmap;
// For some reason, this callback must be static
static BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lParam);
+1 -1
View File
@@ -1256,7 +1256,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>75</string>
<string>77</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
+18 -5
View File
@@ -769,6 +769,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
if (!screen)
screen = [win screen];
BOOL willSwitchScreens = screen != [win screen];
if (cascadeFrom) {
// Do manual cascading instead of using
// -[MMWindow cascadeTopLeftFromPoint:] since it is rather
@@ -795,7 +796,14 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
ASLogNotice(@"Window not on screen, don't constrain position");
}
[win setFrameTopLeftPoint:topLeft];
// setFrameTopLeftPoint will trigger a resize event if the window is
// moved across monitors; at this point such a resize would incorrectly
// constrain the window to the default vim dimensions, so a specialized
// method is used that will avoid that behavior.
if (willSwitchScreens)
[windowController moveWindowAcrossScreens:topLeft];
else
[win setFrameTopLeftPoint:topLeft];
}
if (1 == [vimControllers count]) {
@@ -1087,7 +1095,12 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
#else
NSInteger result = [panel runModalForDirectory:dir file:nil types:nil];
#endif
#if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10)
if (NSModalResponseOK == result) {
#else
if (NSOKButton == result) {
#endif
// NOTE: -[NSOpenPanel filenames] is deprecated on 10.7 so use
// -[NSOpenPanel URLs] instead. The downside is that we have to check
// that each URL is really a path first.
@@ -2063,7 +2076,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
if (fsEventStream)
return;
if (NULL == FSEventStreamStart)
if (NULL == &FSEventStreamStart)
return; // FSEvent functions are weakly linked
NSString *path = [@"~/.vim" stringByExpandingTildeInPath];
@@ -2085,7 +2098,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
- (void)stopWatchingVimDir
{
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
if (NULL == FSEventStreamStop)
if (NULL == &FSEventStreamStop)
return; // FSEvent functions are weakly linked
if (fsEventStream) {
@@ -2476,7 +2489,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
{
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
// The TIS symbols are weakly linked.
if (NULL != TISCopyCurrentKeyboardInputSource) {
if (NULL != &TISCopyCurrentKeyboardInputSource) {
// We get here when compiled on >=10.5 and running on >=10.5.
id nc = [NSDistributedNotificationCenter defaultCenter];
@@ -2494,7 +2507,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
{
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
// The TIS symbols are weakly linked.
if (NULL != TISCopyCurrentKeyboardInputSource) {
if (NULL != &TISCopyCurrentKeyboardInputSource) {
// We get here when compiled on >=10.5 and running on >=10.5.
id nc = [NSDistributedNotificationCenter defaultCenter];
+34 -12
View File
@@ -986,26 +986,31 @@ defaultAdvanceForFont(NSFont *font)
}
static CTFontRef
lookupFont(NSMutableArray *fontCache, const unichar *chars,
lookupFont(NSMutableArray *fontCache, const unichar *chars, UniCharCount count,
CTFontRef currFontRef)
{
CGGlyph glyphs[count];
// See if font in cache can draw at least one character
NSUInteger i;
for (i = 0; i < [fontCache count]; ++i) {
NSFont *font = [fontCache objectAtIndex:i];
CGGlyph glyphs[1];
if (CTFontGetGlyphsForCharacters((CTFontRef)font, chars, glyphs, 1))
if (CTFontGetGlyphsForCharacters((CTFontRef)font, chars, glyphs, count))
return (CTFontRef)[font retain];
}
// Ask Core Text for a font (can be *very* slow, which is why we cache
// fonts in the first place)
CFRange r = { 0, 1 };
CFStringRef strRef = CFStringCreateWithCharacters(NULL, chars, 1);
CFRange r = { 0, count };
CFStringRef strRef = CFStringCreateWithCharacters(NULL, chars, count);
CTFontRef newFontRef = CTFontCreateForString(currFontRef, strRef, r);
CFRelease(strRef);
// Verify the font can actually convert all the glyphs.
if (!CTFontGetGlyphsForCharacters(newFontRef, chars, glyphs, count))
return nil;
if (newFontRef)
[fontCache addObject:(NSFont *)newFontRef];
@@ -1055,16 +1060,33 @@ recurseDraw(const unichar *chars, CGGlyph *glyphs, CGPoint *positions,
++p;
}
// Figure out which font to draw these chars with.
// Try to find a fallback font that can render the entire
// invalid range. If that fails, repeatedly halve the attempted
// range until a font is found.
UniCharCount count = c - chars;
CTFontRef newFontRef = lookupFont(fontCache, chars, fontRef);
if (!newFontRef)
return;
UniCharCount attemptedCount = count;
CTFontRef fallback = nil;
while (fallback == nil && attemptedCount > 0) {
fallback = lookupFont(fontCache, chars, attemptedCount, fontRef);
if (!fallback)
attemptedCount /= 2;
}
recurseDraw(chars, glyphs, positions, count, context, newFontRef,
fontCache);
if (!fallback) {
return;
}
CFRelease(newFontRef);
recurseDraw(chars, glyphs, positions, attemptedCount, context,
fallback, fontCache);
// If only a portion of the invalid range was rendered above,
// the remaining range needs to be attempted by subsequent
// iterations of the draw loop.
c -= count - attemptedCount;
g -= count - attemptedCount;
p -= count - attemptedCount;
CFRelease(fallback);
}
chars = c;
+4 -4
View File
@@ -130,7 +130,7 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
ASLogDebug(@"%@", event);
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
if (NULL == TISCopyCurrentKeyboardInputSource) {
if (NULL == &TISCopyCurrentKeyboardInputSource) {
#endif
// NOTE: Check IM state _before_ key has been interpreted or we'll pick
@@ -787,7 +787,7 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
// The TIS symbols are weakly linked.
if (NULL != TISCopyCurrentKeyboardInputSource) {
if (NULL != &TISCopyCurrentKeyboardInputSource) {
// We get here when compiled on >=10.5 and running on >=10.5.
if (asciiImSource) {
@@ -824,7 +824,7 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
// The TIS symbols are weakly linked.
if (NULL != TISCopyCurrentKeyboardInputSource) {
if (NULL != &TISCopyCurrentKeyboardInputSource) {
// We get here when compiled on >=10.5 and running on >=10.5.
// Enable IM: switch back to input source used when IM was last on
@@ -862,7 +862,7 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
- (void)checkImState
{
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)
if (imControl && NULL != TISCopyCurrentKeyboardInputSource) {
if (imControl && NULL != &TISCopyCurrentKeyboardInputSource) {
// We get here when compiled on >=10.5 and running on >=10.5.
TISInputSourceRef cur = TISCopyCurrentKeyboardInputSource();
BOOL state = !KeyboardInputSourcesEqual(asciiImSource, cur);
+4
View File
@@ -888,7 +888,11 @@ static BOOL isUnsafeMessage(int msgid);
context:(void *)context
{
NSString *path = nil;
#if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10)
if (code == NSModalResponseOK) {
#else
if (code == NSOKButton) {
#endif
NSURL *url = [panel URL];
if ([url isFileURL])
path = [url path];
+34 -15
View File
@@ -199,7 +199,11 @@ enum {
|| !([[self window] styleMask] & NSTexturedBackgroundWindowMask))
return;
#if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7)
int sw = [NSScroller scrollerWidthForControlSize:NSRegularControlSize scrollerStyle:NSScrollerStyleLegacy];
#else
int sw = [NSScroller scrollerWidth];
#endif
// add .5 to the pixel locations to put the lines on a pixel boundary.
// the top and right edges of the rect will be outside of the bounds rect
@@ -699,11 +703,16 @@ enum {
continue;
NSRect rect;
#if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7)
CGFloat scrollerWidth = [NSScroller scrollerWidthForControlSize:NSRegularControlSize scrollerStyle:NSScrollerStyleLegacy];
#else
CGFloat scrollerWidth = [NSScroller scrollerWidth];
#endif
if ([scroller type] == MMScrollerTypeBottom) {
rect = [textView rectForColumnsInRange:[scroller range]];
rect.size.height = [NSScroller scrollerWidth];
rect.size.height = scrollerWidth;
if (leftSbVisible)
rect.origin.x += [NSScroller scrollerWidth];
rect.origin.x += scrollerWidth;
// HACK! Make sure the horizontal scrollbar covers the text view
// all the way to the right, otherwise it looks ugly when the user
@@ -722,7 +731,7 @@ enum {
if (NSMaxX(rect) > NSMaxX(textViewFrame))
rect.size.width -= NSMaxX(rect) - NSMaxX(textViewFrame);
if (!rightSbVisible)
rect.size.width -= [NSScroller scrollerWidth];
rect.size.width -= scrollerWidth;
if (rect.size.width < 0)
rect.size.width = 0;
} else {
@@ -730,7 +739,7 @@ enum {
// Adjust for the fact that text layout is flipped.
rect.origin.y = NSMaxY(textViewFrame) - rect.origin.y
- rect.size.height;
rect.size.width = [NSScroller scrollerWidth];
rect.size.width = scrollerWidth;
if ([scroller type] == MMScrollerTypeRight)
rect.origin.x = NSMaxX(textViewFrame);
@@ -752,9 +761,9 @@ enum {
// Vertical scrollers must not cover the resize box in the
// bottom-right corner of the window.
if ([[self window] showsResizeIndicator] // XXX: make this a flag
&& rect.origin.y < [NSScroller scrollerWidth]) {
rect.size.height -= [NSScroller scrollerWidth] - rect.origin.y;
rect.origin.y = [NSScroller scrollerWidth];
&& rect.origin.y < scrollerWidth) {
rect.size.height -= scrollerWidth - rect.origin.y;
rect.origin.y = scrollerWidth;
}
// Make sure scrollbar rect is bounded by the text view frame.
@@ -808,16 +817,21 @@ enum {
- (NSSize)vimViewSizeForTextViewSize:(NSSize)textViewSize
{
NSSize size = textViewSize;
#if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7)
CGFloat scrollerWidth = [NSScroller scrollerWidthForControlSize:NSRegularControlSize scrollerStyle:NSScrollerStyleLegacy];
#else
CGFloat scrollerWidth = [NSScroller scrollerWidth];
#endif
if (![[self tabBarControl] isHidden])
size.height += [[self tabBarControl] frame].size.height;
if ([self bottomScrollbarVisible])
size.height += [NSScroller scrollerWidth];
size.height += scrollerWidth;
if ([self leftScrollbarVisible])
size.width += [NSScroller scrollerWidth];
size.width += scrollerWidth;
if ([self rightScrollbarVisible])
size.width += [NSScroller scrollerWidth];
size.width += scrollerWidth;
return size;
}
@@ -825,20 +839,25 @@ enum {
- (NSRect)textViewRectForVimViewSize:(NSSize)contentSize
{
NSRect rect = { {0, 0}, {contentSize.width, contentSize.height} };
#if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7)
CGFloat scrollerWidth = [NSScroller scrollerWidthForControlSize:NSRegularControlSize scrollerStyle:NSScrollerStyleLegacy];
#else
CGFloat scrollerWidth = [NSScroller scrollerWidth];
#endif
if (![[self tabBarControl] isHidden])
rect.size.height -= [[self tabBarControl] frame].size.height;
if ([self bottomScrollbarVisible]) {
rect.size.height -= [NSScroller scrollerWidth];
rect.origin.y += [NSScroller scrollerWidth];
rect.size.height -= scrollerWidth;
rect.origin.y += scrollerWidth;
}
if ([self leftScrollbarVisible]) {
rect.size.width -= [NSScroller scrollerWidth];
rect.origin.x += [NSScroller scrollerWidth];
rect.size.width -= scrollerWidth;
rect.origin.x += scrollerWidth;
}
if ([self rightScrollbarVisible])
rect.size.width -= [NSScroller scrollerWidth];
rect.size.width -= scrollerWidth;
return rect;
}
+2
View File
@@ -45,6 +45,7 @@
NSPoint userTopLeft;
NSPoint defaultTopLeft;
NSToolbar *toolbar;
BOOL resizingDueToMove;
}
- (id)initWithVimController:(MMVimController *)controller;
@@ -55,6 +56,7 @@
- (void)cleanup;
- (void)openWindow;
- (BOOL)presentWindow:(id)unused;
- (void)moveWindowAcrossScreens:(NSPoint)origin;
- (void)updateTabsWithData:(NSData *)data;
- (void)selectTabWithIndex:(int)idx;
- (void)setTextDimensionsWithRows:(int)rows columns:(int)cols isLive:(BOOL)live
+40 -5
View File
@@ -150,6 +150,8 @@
self = [super initWithWindow:win];
if (!self) return nil;
resizingDueToMove = NO;
vimController = controller;
decoratedWindow = [win retain];
@@ -347,6 +349,18 @@
return YES;
}
- (void)moveWindowAcrossScreens:(NSPoint)topLeft
{
// HACK! This method moves a window to a new origin and to a different
// screen. This is primarily useful to avoid a scenario where such a move
// will trigger a resize, even though the frame didn't actually change size.
// This method should not be called unless the new origin is definitely on
// a different screen, otherwise the next legitimate resize message will
// be skipped.
resizingDueToMove = YES;
[[self window] setFrameTopLeftPoint:topLeft];
}
- (void)updateTabsWithData:(NSData *)data
{
[vimView updateTabsWithData:data];
@@ -993,7 +1007,13 @@
- (void)windowDidResize:(id)sender
{
if (!setupDone || fullScreenEnabled || !windowPresented) return;
if (resizingDueToMove)
{
resizingDueToMove = NO;
return;
}
if (!setupDone || fullScreenEnabled) return;
// NOTE: Since we have no control over when the window may resize (Cocoa
// may resize automatically) we simply set the view to fill the entire
@@ -1130,6 +1150,8 @@
// Fade out window, remove title bar and maximize, then fade back in.
// (There is a small delay before window is maximized but usually this is
// not noticeable on a relatively modern Mac.)
// Fade out
[NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) {
[context setDuration:0.5*duration];
[[window animator] setAlphaValue:0];
@@ -1137,13 +1159,21 @@
[window setStyleMask:([window styleMask] | NSFullScreenWindowMask)];
[[vimView tabBarControl] setStyleNamed:@"Unified"];
[self updateTablineSeparator];
[self maximizeWindow:fullScreenOptions];
// Stay dark for some time to wait for things to sync, then do the full screen operation
[NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) {
[context setDuration:0.5*duration];
[[window animator] setAlphaValue:1];
[[window animator] setAlphaValue:0];
} completionHandler:^{
// Do nothing
[self maximizeWindow:fullScreenOptions];
// Fade in
[NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) {
[context setDuration:0.5*duration];
[[window animator] setAlphaValue:1];
} completionHandler:^{
// Do nothing
}];
}];
}];
}
@@ -1505,7 +1535,12 @@
// NOTE: Do not use [NSScreen visibleFrame] when determining the screen
// size since it compensates for menu and dock.
int maxRows, maxColumns;
NSSize size = [[NSScreen mainScreen] frame].size;
NSScreen *screen = [decoratedWindow screen];
if (!screen) {
ASLogNotice(@"Window not on screen, using main screen");
screen = [NSScreen mainScreen];
}
NSSize size = [screen frame].size;
[vimView constrainRows:&maxRows columns:&maxColumns toSize:size];
ASLogDebug(@"Window dimensions max: %dx%d current: %dx%d",
+15
View File
@@ -25,6 +25,21 @@
#ifndef MAC_OS_X_VERSION_10_7
# define MAC_OS_X_VERSION_10_7 1070
#endif
#ifndef MAC_OS_X_VERSION_10_8
# define MAC_OS_X_VERSION_10_8 1080
#endif
#ifndef MAC_OS_X_VERSION_10_9
# define MAC_OS_X_VERSION_10_9 1090
#endif
#ifndef MAC_OS_X_VERSION_10_10
# define MAC_OS_X_VERSION_10_10 101000
#endif
#ifndef MAC_OS_X_VERSION_10_10_2
# define MAC_OS_X_VERSION_10_10_2 101002
#endif
#ifndef MAC_OS_X_VERSION_10_10_3
# define MAC_OS_X_VERSION_10_10_3 101003
#endif
//
+2 -2
View File
@@ -614,7 +614,7 @@
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 75;
CURRENT_PROJECT_VERSION = 77;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
@@ -645,7 +645,7 @@
buildSettings = {
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
COPY_PHASE_STRIP = YES;
CURRENT_PROJECT_VERSION = 75;
CURRENT_PROJECT_VERSION = 77;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(FRAMEWORK_SEARCH_PATHS_QUOTED_FOR_TARGET_1)",
+1 -1
View File
@@ -397,7 +397,7 @@ endif
endif
ifdef PERL
CFLAGS += -I$(PERLLIBS) -DFEAT_PERL
CFLAGS += -I$(PERLLIBS) -DFEAT_PERL -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS
ifeq (yes, $(DYNAMIC_PERL))
CFLAGS += -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl$(PERL_VER).dll\"
EXTRA_LIBS += -L$(PERLLIBS) -lperl$(PERL_VER)
+15 -5
View File
@@ -343,7 +343,7 @@ XPM_INC = -I $(XPM)\include -I $(XPM)\..\include
# gdi32.lib and comdlg32.lib for printing support
# ole32.lib and uuid.lib are needed for FEAT_SHORTCUT
CON_LIB = oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib \
comdlg32.lib ole32.lib uuid.lib /machine:$(CPU) /nodefaultlib
comdlg32.lib ole32.lib uuid.lib /machine:$(CPU)
!if "$(DELAYLOAD)" == "yes"
CON_LIB = $(CON_LIB) /DELAYLOAD:comdlg32.dll /DELAYLOAD:ole32.dll DelayImp.lib
!endif
@@ -446,6 +446,9 @@ MSVCVER = 11.0
!if "$(_NMAKE_VER)" == "12.00.21005.1"
MSVCVER = 12.0
!endif
!if ("$(_NMAKE_VER)" == "14.00.22609.0") || ("$(_NMAKE_VER)" == "14.00.22816.0")
MSVCVER = 14.0
!endif
!endif
# Abort building VIM if version of VC is unrecognised.
@@ -460,7 +463,7 @@ MSVCVER = 12.0
!endif
# Convert processor ID to MVC-compatible number
!if ("$(MSVCVER)" != "8.0") && ("$(MSVCVER)" != "9.0") && ("$(MSVCVER)" != "10.0") && ("$(MSVCVER)" != "11.0") && ("$(MSVCVER)" != "12.0")
!if ("$(MSVCVER)" != "8.0") && ("$(MSVCVER)" != "9.0") && ("$(MSVCVER)" != "10.0") && ("$(MSVCVER)" != "11.0") && ("$(MSVCVER)" != "12.0") && ("$(MSVCVER)" != "14.0")
!if "$(CPUNR)" == "i386"
CPUARG = /G3
!elseif "$(CPUNR)" == "i486"
@@ -484,6 +487,13 @@ CPUARG = /arch:SSE2
LIBC =
DEBUGINFO = /Zi
# Don't use /nodefaultlib on MSVC 14
!if "$(MSVCVER)" == "14.0"
NODEFAULTLIB =
!else
NODEFAULTLIB = /nodefaultlib
!endif
!ifdef NODEBUG
VIM = vim
!if "$(OPTIMIZE)" == "SPACE"
@@ -655,7 +665,7 @@ GUI_OBJ = \
GUI_LIB = \
gdi32.lib version.lib $(IME_LIB) \
winspool.lib comctl32.lib advapi32.lib shell32.lib \
/machine:$(CPU) /nodefaultlib
/machine:$(CPU)
!else
SUBSYSTEM = console
!endif
@@ -864,7 +874,7 @@ PERL_LIB = $(PERL_INCDIR)\libperl$(PERL_VER).a
!endif
!endif
CFLAGS = $(CFLAGS) -DFEAT_PERL
CFLAGS = $(CFLAGS) -DFEAT_PERL -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS
# Do we want to load Perl dynamically?
!if "$(DYNAMIC_PERL)" == "yes"
@@ -976,7 +986,7 @@ conflags = $(conflags) /map /mapinfo:lines
!ENDIF
LINKARGS1 = $(linkdebug) $(conflags)
LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(LIBC) $(OLE_LIB) user32.lib $(SNIFF_LIB) \
LINKARGS2 = $(CON_LIB) $(GUI_LIB) $(NODEFAULTLIB) $(LIBC) $(OLE_LIB) user32.lib $(SNIFF_LIB) \
$(LUA_LIB) $(MZSCHEME_LIB) $(PERL_LIB) $(PYTHON_LIB) $(PYTHON3_LIB) $(RUBY_LIB) \
$(TCL_LIB) $(NETBEANS_LIB) $(XPM_LIB) $(LINK_PDB)
+9 -5
View File
@@ -2075,17 +2075,21 @@ buflist_getfile(n, lnum, options, forceit)
* "buf" if one exists */
if (swb_flags & SWB_USEOPEN)
wp = buf_jump_open_win(buf);
/* If 'switchbuf' contains "usetab": jump to first window in any tab
* page containing "buf" if one exists */
if (wp == NULL && (swb_flags & SWB_USETAB))
wp = buf_jump_open_tab(buf);
/* If 'switchbuf' contains "split" or "newtab" and the current buffer
* isn't empty: open new window */
if (wp == NULL && (swb_flags & (SWB_SPLIT | SWB_NEWTAB)) && !bufempty())
/* If 'switchbuf' contains "split", "vsplit" or "newtab" and the
* current buffer isn't empty: open new tab or window */
if (wp == NULL && (swb_flags & (SWB_VSPLIT | SWB_SPLIT | SWB_NEWTAB))
&& !bufempty())
{
if (swb_flags & SWB_NEWTAB) /* Open in a new tab */
if (swb_flags & SWB_NEWTAB)
tabpage_new();
else if (win_split(0, 0) == FAIL) /* Open in a new window */
else if (win_split(0, (swb_flags & SWB_VSPLIT) ? WSP_VERT : 0)
== FAIL)
return FAIL;
RESET_BINDING(curwin);
}
+3 -1
View File
@@ -957,8 +957,10 @@ if test "$enable_perlinterp" = "yes" -o "$enable_perlinterp" = "dynamic"; then
done
AC_SUBST(vi_cv_perlsitelib)
dnl Remove "-fno-something", it breaks using cproto.
dnl Remove "-fdebug-prefix-map", it isn't supported by clang.
perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \
-e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[[^ ]]*//'`
-e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[[^ ]]*//' \
-e 's/-fdebug-prefix-map[[^ ]]*//g'`
dnl Remove "-lc", it breaks on FreeBSD when using "-pthread".
perllibs=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed -e 'ldopts' | \
sed -e '/Warning/d' -e '/Note (probably harmless)/d' \
+41 -48
View File
@@ -1138,32 +1138,34 @@ diff_win_options(wp, addbuf)
curwin = old_curwin;
# endif
wp->w_p_diff = TRUE;
/* Use 'scrollbind' and 'cursorbind' when available */
#ifdef FEAT_SCROLLBIND
if (!wp->w_p_diff_saved)
if (!wp->w_p_diff)
wp->w_p_scb_save = wp->w_p_scb;
wp->w_p_scb = TRUE;
#endif
#ifdef FEAT_CURSORBIND
if (!wp->w_p_diff_saved)
if (!wp->w_p_diff)
wp->w_p_crb_save = wp->w_p_crb;
wp->w_p_crb = TRUE;
#endif
if (!wp->w_p_diff_saved)
if (!wp->w_p_diff)
wp->w_p_wrap_save = wp->w_p_wrap;
wp->w_p_wrap = FALSE;
# ifdef FEAT_FOLDING
curwin = wp;
curbuf = curwin->w_buffer;
if (!wp->w_p_diff_saved)
if (!wp->w_p_diff)
{
if (wp->w_p_diff_saved)
free_string_option(wp->w_p_fdm_save);
wp->w_p_fdm_save = vim_strsave(wp->w_p_fdm);
}
set_string_option_direct((char_u *)"fdm", -1, (char_u *)"diff",
OPT_LOCAL|OPT_FREE, 0);
curwin = old_curwin;
curbuf = curwin->w_buffer;
if (!wp->w_p_diff_saved)
if (!wp->w_p_diff)
{
wp->w_p_fdc_save = wp->w_p_fdc;
wp->w_p_fen_save = wp->w_p_fen;
@@ -1183,6 +1185,8 @@ diff_win_options(wp, addbuf)
/* Saved the current values, to be restored in ex_diffoff(). */
wp->w_p_diff_saved = TRUE;
wp->w_p_diff = TRUE;
if (addbuf)
diff_buf_add(wp->w_buffer);
redraw_win_later(wp, NOT_VALID);
@@ -1197,7 +1201,6 @@ ex_diffoff(eap)
exarg_T *eap;
{
win_T *wp;
win_T *old_curwin = curwin;
#ifdef FEAT_SCROLLBIND
int diffwin = FALSE;
#endif
@@ -1206,57 +1209,47 @@ ex_diffoff(eap)
{
if (eap->forceit ? wp->w_p_diff : wp == curwin)
{
/* Set 'diff', 'scrollbind' off and 'wrap' on. If option values
* were saved in diff_win_options() restore them. */
/* Set 'diff' off. If option values were saved in
* diff_win_options(), restore the ones whose settings seem to have
* been left over from diff mode. */
wp->w_p_diff = FALSE;
#ifdef FEAT_SCROLLBIND
if (wp->w_p_scb)
wp->w_p_scb = wp->w_p_diff_saved ? wp->w_p_scb_save : FALSE;
#endif
#ifdef FEAT_CURSORBIND
if (wp->w_p_crb)
wp->w_p_crb = wp->w_p_diff_saved ? wp->w_p_crb_save : FALSE;
#endif
if (!wp->w_p_wrap)
wp->w_p_wrap = wp->w_p_diff_saved ? wp->w_p_wrap_save : TRUE;
#ifdef FEAT_FOLDING
curwin = wp;
curbuf = curwin->w_buffer;
if (wp->w_p_diff_saved)
{
free_string_option(wp->w_p_fdm);
wp->w_p_fdm = wp->w_p_fdm_save;
wp->w_p_fdm_save = empty_option;
}
else
set_string_option_direct((char_u *)"fdm", -1,
(char_u *)"manual", OPT_LOCAL|OPT_FREE, 0);
curwin = old_curwin;
curbuf = curwin->w_buffer;
if (wp->w_p_fdc == diff_foldcolumn)
wp->w_p_fdc = wp->w_p_diff_saved ? wp->w_p_fdc_save : 0;
if (wp->w_p_fdl == 0 && wp->w_p_diff_saved)
wp->w_p_fdl = wp->w_p_fdl_save;
if (wp->w_p_fen)
{
#ifdef FEAT_SCROLLBIND
if (wp->w_p_scb)
wp->w_p_scb = wp->w_p_scb_save;
#endif
#ifdef FEAT_CURSORBIND
if (wp->w_p_crb)
wp->w_p_crb = wp->w_p_crb_save;
#endif
if (!wp->w_p_wrap)
wp->w_p_wrap = wp->w_p_wrap_save;
#ifdef FEAT_FOLDING
free_string_option(wp->w_p_fdm);
wp->w_p_fdm = vim_strsave(wp->w_p_fdm_save);
if (wp->w_p_fdc == diff_foldcolumn)
wp->w_p_fdc = wp->w_p_fdc_save;
if (wp->w_p_fdl == 0)
wp->w_p_fdl = wp->w_p_fdl_save;
/* Only restore 'foldenable' when 'foldmethod' is not
* "manual", otherwise we continue to show the diff folds. */
if (foldmethodIsManual(wp) || !wp->w_p_diff_saved)
wp->w_p_fen = FALSE;
else
wp->w_p_fen = wp->w_p_fen_save;
if (wp->w_p_fen)
wp->w_p_fen = foldmethodIsManual(wp) ? FALSE
: wp->w_p_fen_save;
foldUpdateAll(wp);
/* make sure topline is not halfway a fold */
changed_window_setting_win(wp);
#endif
}
foldUpdateAll(wp);
/* make sure topline is not halfway a fold */
changed_window_setting_win(wp);
#endif
/* Note: 'sbo' is not restored, it's a global option. */
diff_buf_adjust(wp);
wp->w_p_diff_saved = FALSE;
}
#ifdef FEAT_SCROLLBIND
diffwin |= wp->w_p_diff;
+97 -28
View File
@@ -783,7 +783,7 @@ static char_u *find_name_end __ARGS((char_u *arg, char_u **expr_start, char_u **
static char_u * make_expanded_name __ARGS((char_u *in_start, char_u *expr_start, char_u *expr_end, char_u *in_end));
static int eval_isnamec __ARGS((int c));
static int eval_isnamec1 __ARGS((int c));
static int get_var_tv __ARGS((char_u *name, int len, typval_T *rettv, int verbose, int no_autoload));
static int get_var_tv __ARGS((char_u *name, int len, typval_T *rettv, dictitem_T **dip, int verbose, int no_autoload));
static int handle_subscript __ARGS((char_u **arg, typval_T *rettv, int evaluate, int verbose));
static typval_T *alloc_tv __ARGS((void));
static typval_T *alloc_string_tv __ARGS((char_u *string));
@@ -2257,7 +2257,7 @@ list_arg_vars(eap, arg, first)
{
if (tofree != NULL)
name = tofree;
if (get_var_tv(name, len, &tv, TRUE, FALSE) == FAIL)
if (get_var_tv(name, len, &tv, NULL, TRUE, FALSE) == FAIL)
error = TRUE;
else
{
@@ -2926,10 +2926,15 @@ set_var_lval(lp, endp, rettv, copy, op)
typval_T tv;
/* handle +=, -= and .= */
di = NULL;
if (get_var_tv(lp->ll_name, (int)STRLEN(lp->ll_name),
&tv, TRUE, FALSE) == OK)
&tv, &di, TRUE, FALSE) == OK)
{
if (tv_op(&tv, rettv, op) == OK)
if ((di == NULL
|| (!var_check_ro(di->di_flags, lp->ll_name, FALSE)
&& !tv_check_lock(di->di_tv.v_lock, lp->ll_name,
FALSE)))
&& tv_op(&tv, rettv, op) == OK)
set_var(lp->ll_name, &tv, FALSE);
clear_tv(&tv);
}
@@ -3805,7 +3810,7 @@ do_lock_var(lp, name_end, deep, lock)
/* (un)lock a List item. */
item_lock(&lp->ll_li->li_tv, deep, lock);
else
/* un(lock) a Dictionary item. */
/* (un)lock a Dictionary item. */
item_lock(&lp->ll_di->di_tv, deep, lock);
return ret;
@@ -5246,7 +5251,7 @@ eval7(arg, rettv, evaluate, want_string)
}
}
else if (evaluate)
ret = get_var_tv(s, len, rettv, TRUE, FALSE);
ret = get_var_tv(s, len, rettv, NULL, TRUE, FALSE);
else
ret = OK;
}
@@ -5740,8 +5745,10 @@ get_string_tv(arg, rettv, evaluate)
if (c == 'X')
n = 2;
else
else if (*p == 'u')
n = 4;
else
n = 8;
nr = 0;
while (--n >= 0 && vim_isxdigit(p[1]))
{
@@ -8303,7 +8310,7 @@ static struct fst
{"str2float", 1, 1, f_str2float},
#endif
{"str2nr", 1, 2, f_str2nr},
{"strchars", 1, 1, f_strchars},
{"strchars", 1, 2, f_strchars},
{"strdisplaywidth", 1, 2, f_strdisplaywidth},
#ifdef HAVE_STRFTIME
{"strftime", 1, 2, f_strftime},
@@ -10376,7 +10383,7 @@ f_exists(argvars, rettv)
{
if (tofree != NULL)
name = tofree;
n = (get_var_tv(name, len, &tv, FALSE, TRUE) == OK);
n = (get_var_tv(name, len, &tv, NULL, FALSE, TRUE) == OK);
if (n)
{
/* handle d.key, l[idx], f(expr) */
@@ -17139,6 +17146,7 @@ f_setmatches(argvars, rettv)
list_T *l;
listitem_T *li;
dict_T *d;
list_T *s = NULL;
rettv->vval.v_number = -1;
if (argvars[0].v_type != VAR_LIST)
@@ -17161,7 +17169,8 @@ f_setmatches(argvars, rettv)
return;
}
if (!(dict_find(d, (char_u *)"group", -1) != NULL
&& dict_find(d, (char_u *)"pattern", -1) != NULL
&& (dict_find(d, (char_u *)"pattern", -1) != NULL
|| dict_find(d, (char_u *)"pos1", -1) != NULL)
&& dict_find(d, (char_u *)"priority", -1) != NULL
&& dict_find(d, (char_u *)"id", -1) != NULL))
{
@@ -17175,11 +17184,53 @@ f_setmatches(argvars, rettv)
li = l->lv_first;
while (li != NULL)
{
int i = 0;
char_u buf[5];
dictitem_T *di;
d = li->li_tv.vval.v_dict;
match_add(curwin, get_dict_string(d, (char_u *)"group", FALSE),
if (dict_find(d, (char_u *)"pattern", -1) == NULL)
{
if (s == NULL)
{
s = list_alloc();
if (s == NULL)
return;
}
/* match from matchaddpos() */
for (i = 1; i < 9; i++)
{
sprintf((char *)buf, (char *)"pos%d", i);
if ((di = dict_find(d, (char_u *)buf, -1)) != NULL)
{
if (di->di_tv.v_type != VAR_LIST)
return;
list_append_tv(s, &di->di_tv);
s->lv_refcount++;
}
else
break;
}
}
if (i == 0)
{
match_add(curwin, get_dict_string(d, (char_u *)"group", FALSE),
get_dict_string(d, (char_u *)"pattern", FALSE),
(int)get_dict_number(d, (char_u *)"priority"),
(int)get_dict_number(d, (char_u *)"id"), NULL);
}
else
{
match_add(curwin, get_dict_string(d, (char_u *)"group", FALSE),
NULL, (int)get_dict_number(d, (char_u *)"priority"),
(int)get_dict_number(d, (char_u *)"id"), s);
list_unref(s);
s = NULL;
}
li = li->li_next;
}
rettv->vval.v_number = 0;
@@ -18349,18 +18400,30 @@ f_strchars(argvars, rettv)
typval_T *rettv;
{
char_u *s = get_tv_string(&argvars[0]);
int skipcc = 0;
#ifdef FEAT_MBYTE
varnumber_T len = 0;
while (*s != NUL)
{
mb_cptr2char_adv(&s);
++len;
}
rettv->vval.v_number = len;
#else
rettv->vval.v_number = (varnumber_T)(STRLEN(s));
int (*func_mb_ptr2char_adv)(char_u **pp);
#endif
if (argvars[1].v_type != VAR_UNKNOWN)
skipcc = get_tv_number_chk(&argvars[1], NULL);
if (skipcc < 0 || skipcc > 1)
EMSG(_(e_invarg));
else
{
#ifdef FEAT_MBYTE
func_mb_ptr2char_adv = skipcc ? mb_ptr2char_adv : mb_cptr2char_adv;
while (*s != NUL)
{
func_mb_ptr2char_adv(&s);
++len;
}
rettv->vval.v_number = len;
#else
rettv->vval.v_number = (varnumber_T)(STRLEN(s));
#endif
}
}
/*
@@ -20674,10 +20737,11 @@ set_cmdarg(eap, oldarg)
* Return OK or FAIL.
*/
static int
get_var_tv(name, len, rettv, verbose, no_autoload)
get_var_tv(name, len, rettv, dip, verbose, no_autoload)
char_u *name;
int len; /* length of "name" */
typval_T *rettv; /* NULL when only checking existence */
dictitem_T **dip; /* non-NULL when typval's dict item is needed */
int verbose; /* may give error message */
int no_autoload; /* do not use script autoloading */
{
@@ -20708,7 +20772,11 @@ get_var_tv(name, len, rettv, verbose, no_autoload)
{
v = find_var(name, NULL, no_autoload);
if (v != NULL)
{
tv = &v->di_tv;
if (dip != NULL)
*dip = v;
}
}
if (tv == NULL)
@@ -21502,8 +21570,8 @@ set_var(name, tv, copy)
}
/*
* Handle setting internal v: variables separately: we don't change
* the type.
* Handle setting internal v: variables separately where needed to
* prevent changing the type.
*/
if (ht == &vimvarht)
{
@@ -21518,10 +21586,9 @@ set_var(name, tv, copy)
v->di_tv.vval.v_string = tv->vval.v_string;
tv->vval.v_string = NULL;
}
return;
}
else if (v->di_tv.v_type != VAR_NUMBER)
EMSG2(_(e_intern2), "set_var()");
else
else if (v->di_tv.v_type == VAR_NUMBER)
{
v->di_tv.vval.v_number = get_tv_number(tv);
if (STRCMP(varname, "searchforward") == 0)
@@ -21533,8 +21600,10 @@ set_var(name, tv, copy)
redraw_all_later(SOME_VALID);
}
#endif
return;
}
return;
else if (v->di_tv.v_type != tv->v_type)
EMSG2(_(e_intern2), "set_var()");
}
clear_tv(&v->di_tv);
@@ -23181,7 +23250,7 @@ func_dump_profile(fd)
if (todo == 0)
return; /* nothing to dump */
sorttab = (ufunc_T **)alloc((unsigned)(sizeof(ufunc_T) * todo));
sorttab = (ufunc_T **)alloc((unsigned)(sizeof(ufunc_T *) * todo));
for (hi = func_hashtab.ht_array; todo > 0; ++hi)
{
+9
View File
@@ -4279,6 +4279,8 @@ do_sub(eap)
static int do_list = FALSE; /* list last line with subs. */
static int do_number = FALSE; /* list last line with line nr*/
static int do_ic = 0; /* ignore case flag */
int save_do_all; /* remember user specified 'g' flag */
int save_do_ask; /* remember user specified 'c' flag */
char_u *pat = NULL, *sub = NULL; /* init for GCC */
int delimiter;
int sublen;
@@ -4514,6 +4516,9 @@ do_sub(eap)
if (do_count)
do_ask = FALSE;
save_do_all = do_all;
save_do_ask = do_ask;
/*
* check for a trailing count
*/
@@ -5327,6 +5332,10 @@ outofmem:
#endif
vim_regfree(regmatch.regprog);
/* Restore the flag values, they can be used for ":&&". */
do_all = save_do_all;
do_ask = save_do_ask;
}
/*
+13 -2
View File
@@ -7109,7 +7109,14 @@ ex_quit(eap)
else
{
#ifdef FEAT_WINDOWS
if (only_one_window()) /* quit last window */
/* quit last window
* Note: only_one_window() returns true, even so a help window is
* still open. In that case only quit, if no address has been
* specified. Example:
* :h|wincmd w|1q - don't quit
* :h|wincmd w|q - quit
*/
if (only_one_window() && (firstwin == lastwin || eap->addr_count == 0))
#endif
getout(0);
#ifdef FEAT_WINDOWS
@@ -10765,7 +10772,11 @@ arg_all()
}
for ( ; *p != NUL; ++p)
{
if (*p == ' ' || *p == '\\')
if (*p == ' '
#ifndef BACKSLASH_IN_FILENAME
|| *p == '\\'
#endif
)
{
/* insert a backslash */
if (retval != NULL)
+4
View File
@@ -6624,6 +6624,10 @@ ex_window()
# ifdef FEAT_AUTOCMD
/* Don't execute autocommands while deleting the window. */
block_autocmds();
# endif
# ifdef FEAT_CONCEAL
/* Avoid command-line window first character being concealed. */
curwin->w_p_cole = 0;
# endif
wp = curwin;
bp = curbuf;
+3 -1
View File
@@ -2873,7 +2873,9 @@ create_tabline_menu(void)
GtkWidget *menu;
menu = gtk_menu_new();
add_tabline_menu_item(menu, (char_u *)_("Close"), TABLINE_MENU_CLOSE);
if (first_tabpage->tp_next != NULL)
add_tabline_menu_item(menu, (char_u *)_("Close tab"),
TABLINE_MENU_CLOSE);
add_tabline_menu_item(menu, (char_u *)_("New tab"), TABLINE_MENU_NEW);
add_tabline_menu_item(menu, (char_u *)_("Open Tab..."), TABLINE_MENU_OPEN);
+2 -1
View File
@@ -6819,7 +6819,8 @@ initialise_tabline(void)
// create tabline popup menu required by vim docs (see :he tabline-menu)
CreateNewMenu(kTabContextMenuId, 0, &contextMenu);
AppendMenuItemTextWithCFString(contextMenu, CFSTR("Close"), 0,
if (first_tabpage->tp_next != NULL)
AppendMenuItemTextWithCFString(contextMenu, CFSTR("Close Tab"), 0,
TABLINE_MENU_CLOSE, NULL);
AppendMenuItemTextWithCFString(contextMenu, CFSTR("New Tab"), 0,
TABLINE_MENU_NEW, NULL);
+11 -8
View File
@@ -540,14 +540,17 @@ gui_x11_create_widgets()
tabLine_menu = XmCreatePopupMenu(tabLine, "tabline popup", NULL, 0);
/* Add the buttons to the menu */
n = 0;
XtSetArg(args[n], XmNuserData, TABLINE_MENU_CLOSE); n++;
xms = XmStringCreate((char *)"Close tab", STRING_TAG);
XtSetArg(args[n], XmNlabelString, xms); n++;
button = XmCreatePushButton(tabLine_menu, "Close", args, n);
XtAddCallback(button, XmNactivateCallback,
(XtCallbackProc)tabline_button_cb, NULL);
XmStringFree(xms);
if (first_tabpage->tp_next != NULL)
{
n = 0;
XtSetArg(args[n], XmNuserData, TABLINE_MENU_CLOSE); n++;
xms = XmStringCreate((char *)"Close tab", STRING_TAG);
XtSetArg(args[n], XmNlabelString, xms); n++;
button = XmCreatePushButton(tabLine_menu, "Close", args, n);
XtAddCallback(button, XmNactivateCallback,
(XtCallbackProc)tabline_button_cb, NULL);
XmStringFree(xms);
}
n = 0;
XtSetArg(args[n], XmNuserData, TABLINE_MENU_NEW); n++;
+3 -1
View File
@@ -2389,7 +2389,9 @@ show_tabline_popup_menu(void)
if (tab_pmenu == NULL)
return;
add_tabline_popup_menu_entry(tab_pmenu, TABLINE_MENU_CLOSE, _("Close tab"));
if (first_tabpage->tp_next != NULL)
add_tabline_popup_menu_entry(tab_pmenu,
TABLINE_MENU_CLOSE, _("Close tab"));
add_tabline_popup_menu_entry(tab_pmenu, TABLINE_MENU_NEW, _("New tab"));
add_tabline_popup_menu_entry(tab_pmenu, TABLINE_MENU_OPEN,
_("Open tab..."));
+24 -6
View File
@@ -119,13 +119,19 @@ static luaV_Dict *luaV_pushdict (lua_State *L, dict_T *dic);
#define lua_getglobal dll_lua_getglobal
#define lua_setglobal dll_lua_setglobal
#endif
#if LUA_VERSION_NUM <= 502
#define lua_replace dll_lua_replace
#define lua_remove dll_lua_remove
#endif
#if LUA_VERSION_NUM >= 503
#define lua_rotate dll_lua_rotate
#define lua_copy dll_lua_copy
#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
#define lua_pushvalue dll_lua_pushvalue
#define lua_replace dll_lua_replace
#define lua_remove dll_lua_remove
#define lua_isnumber dll_lua_isnumber
#define lua_isstring dll_lua_isstring
#define lua_type dll_lua_type
@@ -205,13 +211,19 @@ int (*dll_lua_pcallk) (lua_State *L, int nargs, int nresults, int errfunc,
void (*dll_lua_getglobal) (lua_State *L, const char *var);
void (*dll_lua_setglobal) (lua_State *L, const char *var);
#endif
#if LUA_VERSION_NUM <= 502
void (*dll_lua_replace) (lua_State *L, int idx);
void (*dll_lua_remove) (lua_State *L, int idx);
#endif
#if LUA_VERSION_NUM >= 503
void (*dll_lua_rotate) (lua_State *L, int idx, int n);
void (*dll_lua_copy) (lua_State *L, int fromidx, int toidx);
#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);
void (*dll_lua_pushvalue) (lua_State *L, int idx);
void (*dll_lua_replace) (lua_State *L, int idx);
void (*dll_lua_remove) (lua_State *L, int idx);
int (*dll_lua_isnumber) (lua_State *L, int idx);
int (*dll_lua_isstring) (lua_State *L, int idx);
int (*dll_lua_type) (lua_State *L, int idx);
@@ -295,14 +307,20 @@ 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},
#endif
#if LUA_VERSION_NUM <= 502
{"lua_replace", (luaV_function) &dll_lua_replace},
{"lua_remove", (luaV_function) &dll_lua_remove},
#endif
#if LUA_VERSION_NUM >= 503
{"lua_rotate", (luaV_function) &dll_lua_rotate},
{"lua_copy", (luaV_function) &dll_lua_copy},
#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},
{"lua_pushvalue", (luaV_function) &dll_lua_pushvalue},
{"lua_replace", (luaV_function) &dll_lua_replace},
{"lua_remove", (luaV_function) &dll_lua_remove},
{"lua_isnumber", (luaV_function) &dll_lua_isnumber},
{"lua_isstring", (luaV_function) &dll_lua_isstring},
{"lua_type", (luaV_function) &dll_lua_type},
+25 -3
View File
@@ -197,10 +197,12 @@ typedef int perl_key;
# define Perl_stack_grow dll_Perl_stack_grow
# define Perl_set_context dll_Perl_set_context
# if (PERL_REVISION == 5) && (PERL_VERSION >= 14)
# define Perl_sv_2bool_flags dll_Perl_sv_2bool_flags
# define Perl_xs_apiversion_bootcheck dll_Perl_xs_apiversion_bootcheck
# define Perl_sv_2bool_flags dll_Perl_sv_2bool_flags
# if (PERL_REVISION == 5) && (PERL_VERSION < 22)
# define Perl_xs_apiversion_bootcheck dll_Perl_xs_apiversion_bootcheck
# endif
# else
# define Perl_sv_2bool dll_Perl_sv_2bool
# define Perl_sv_2bool dll_Perl_sv_2bool
# endif
# define Perl_sv_2iv dll_Perl_sv_2iv
# define Perl_sv_2mortal dll_Perl_sv_2mortal
@@ -268,6 +270,10 @@ typedef int perl_key;
# define Perl_call_list dll_Perl_call_list
# define Perl_Iscopestack_ix_ptr dll_Perl_Iscopestack_ix_ptr
# define Perl_Iunitcheckav_ptr dll_Perl_Iunitcheckav_ptr
# if (PERL_REVISION == 5) && (PERL_VERSION >= 22)
# define Perl_xs_handshake dll_Perl_xs_handshake
# define Perl_xs_boot_epilog dll_Perl_xs_boot_epilog
# endif
# if (PERL_REVISION == 5) && (PERL_VERSION >= 14)
# ifdef USE_ITHREADS
# define PL_thr_key *dll_PL_thr_key
@@ -299,7 +305,11 @@ static void (*Perl_croak_nocontext)(const char*, ...);
static I32 (*Perl_dowantarray)(pTHX);
static void (*Perl_free_tmps)(pTHX);
static HV* (*Perl_gv_stashpv)(pTHX_ const char*, I32);
#if (PERL_REVISION == 5) && (PERL_VERSION >= 22)
static I32* (*Perl_markstack_grow)(pTHX);
#else
static void (*Perl_markstack_grow)(pTHX);
#endif
static MAGIC* (*Perl_mg_find)(pTHX_ SV*, int);
static CV* (*Perl_newXS)(pTHX_ char*, XSUBADDR_t, char*);
static SV* (*Perl_newSV)(pTHX_ STRLEN);
@@ -321,7 +331,9 @@ static SV** (*Perl_stack_grow)(pTHX_ SV**, SV**p, int);
static SV** (*Perl_set_context)(void*);
#if (PERL_REVISION == 5) && (PERL_VERSION >= 14)
static bool (*Perl_sv_2bool_flags)(pTHX_ SV*, I32);
# if (PERL_REVISION == 5) && (PERL_VERSION < 22)
static void (*Perl_xs_apiversion_bootcheck)(pTHX_ SV *module, const char *api_p, STRLEN api_len);
# endif
#else
static bool (*Perl_sv_2bool)(pTHX_ SV*);
#endif
@@ -394,6 +406,10 @@ static I32* (*Perl_Iscopestack_ix_ptr)(register PerlInterpreter*);
static AV** (*Perl_Iunitcheckav_ptr)(register PerlInterpreter*);
# endif
#endif
#if (PERL_REVISION == 5) && (PERL_VERSION >= 22)
static I32 (*Perl_xs_handshake)(const U32, void *, const char *, ...);
static void (*Perl_xs_boot_epilog)(pTHX_ const U32);
#endif
#if (PERL_REVISION == 5) && (PERL_VERSION >= 14)
# ifdef USE_ITHREADS
@@ -453,7 +469,9 @@ static struct {
{"Perl_set_context", (PERL_PROC*)&Perl_set_context},
#if (PERL_REVISION == 5) && (PERL_VERSION >= 14)
{"Perl_sv_2bool_flags", (PERL_PROC*)&Perl_sv_2bool_flags},
# if (PERL_REVISION == 5) && (PERL_VERSION < 22)
{"Perl_xs_apiversion_bootcheck",(PERL_PROC*)&Perl_xs_apiversion_bootcheck},
# endif
#else
{"Perl_sv_2bool", (PERL_PROC*)&Perl_sv_2bool},
#endif
@@ -521,6 +539,10 @@ static struct {
{"Perl_Iunitcheckav_ptr", (PERL_PROC*)&Perl_Iunitcheckav_ptr},
# endif
#endif
#if (PERL_REVISION == 5) && (PERL_VERSION >= 22)
{"Perl_xs_handshake", (PERL_PROC*)&Perl_xs_handshake},
{"Perl_xs_boot_epilog", (PERL_PROC*)&Perl_xs_boot_epilog},
#endif
#if (PERL_REVISION == 5) && (PERL_VERSION >= 14)
# ifdef USE_ITHREADS
{"PL_thr_key", (PERL_PROC*)&dll_PL_thr_key},
+7 -4
View File
@@ -853,8 +853,11 @@ vim_main2(int argc UNUSED, char **argv UNUSED)
starttermcap(); /* start termcap if not done by wait_return() */
TIME_MSG("start termcap");
#if defined(FEAT_TERMRESPONSE) && defined(FEAT_MBYTE)
#if defined(FEAT_TERMRESPONSE)
# if defined(FEAT_MBYTE)
may_req_ambiguous_char_width();
# endif
may_req_bg_color();
#endif
#ifdef FEAT_MOUSE
@@ -4092,15 +4095,15 @@ build_drop_cmd(filec, filev, tabs, sendReply)
* if haslocaldir()
* cd -
* lcd -
* elseif getcwd() ==# "current path"
* elseif getcwd() ==# 'current path'
* cd -
* endif
* endif
*/
ga_concat(&ga, (char_u *)":if !exists('+acd')||!&acd|if haslocaldir()|");
ga_concat(&ga, (char_u *)"cd -|lcd -|elseif getcwd() ==# \"");
ga_concat(&ga, (char_u *)"cd -|lcd -|elseif getcwd() ==# '");
ga_concat(&ga, cdp);
ga_concat(&ga, (char_u *)"\"|cd -|endif|endif<CR>");
ga_concat(&ga, (char_u *)"'|cd -|endif|endif<CR>");
vim_free(cdp);
if (sendReply)
+31 -6
View File
@@ -2266,7 +2266,7 @@ utf_iscomposing(c)
{0x0825, 0x0827},
{0x0829, 0x082d},
{0x0859, 0x085b},
{0x08e4, 0x0903},
{0x08e3, 0x0903},
{0x093a, 0x093c},
{0x093e, 0x094f},
{0x0951, 0x0957},
@@ -2366,8 +2366,6 @@ utf_iscomposing(c)
{0x18a9, 0x18a9},
{0x1920, 0x192b},
{0x1930, 0x193b},
{0x19b0, 0x19c0},
{0x19c8, 0x19c9},
{0x1a17, 0x1a1b},
{0x1a55, 0x1a5e},
{0x1a60, 0x1a7c},
@@ -2395,7 +2393,7 @@ utf_iscomposing(c)
{0x3099, 0x309a},
{0xa66f, 0xa672},
{0xa674, 0xa67d},
{0xa69f, 0xa69f},
{0xa69e, 0xa69f},
{0xa6f0, 0xa6f1},
{0xa802, 0xa802},
{0xa806, 0xa806},
@@ -2424,7 +2422,7 @@ utf_iscomposing(c)
{0xabec, 0xabed},
{0xfb1e, 0xfb1e},
{0xfe00, 0xfe0f},
{0xfe20, 0xfe2d},
{0xfe20, 0xfe2f},
{0x101fd, 0x101fd},
{0x102e0, 0x102e0},
{0x10376, 0x1037a},
@@ -2443,9 +2441,10 @@ utf_iscomposing(c)
{0x11173, 0x11173},
{0x11180, 0x11182},
{0x111b3, 0x111c0},
{0x111ca, 0x111cc},
{0x1122c, 0x11237},
{0x112df, 0x112ea},
{0x11301, 0x11303},
{0x11300, 0x11303},
{0x1133c, 0x1133c},
{0x1133e, 0x11344},
{0x11347, 0x11348},
@@ -2457,8 +2456,10 @@ utf_iscomposing(c)
{0x114b0, 0x114c3},
{0x115af, 0x115b5},
{0x115b8, 0x115c0},
{0x115dc, 0x115dd},
{0x11630, 0x11640},
{0x116ab, 0x116b7},
{0x1171d, 0x1172b},
{0x16af0, 0x16af4},
{0x16b30, 0x16b36},
{0x16f51, 0x16f7e},
@@ -2470,6 +2471,12 @@ utf_iscomposing(c)
{0x1d185, 0x1d18b},
{0x1d1aa, 0x1d1ad},
{0x1d242, 0x1d244},
{0x1da00, 0x1da36},
{0x1da3b, 0x1da6c},
{0x1da75, 0x1da75},
{0x1da84, 0x1da84},
{0x1da9b, 0x1da9f},
{0x1daa1, 0x1daaf},
{0x1e8d0, 0x1e8d6},
{0xe0100, 0xe01ef}
};
@@ -2742,6 +2749,7 @@ static convertStruct foldCase[] =
{0x531,0x556,1,48},
{0x10a0,0x10c5,1,7264},
{0x10c7,0x10cd,6,7264},
{0x13f8,0x13fd,1,-8},
{0x1e00,0x1e94,2,1},
{0x1e9b,0x1e9b,-1,-58},
{0x1e9e,0x1e9e,-1,-7615},
@@ -2809,8 +2817,13 @@ static convertStruct foldCase[] =
{0xa7ad,0xa7ad,-1,-42305},
{0xa7b0,0xa7b0,-1,-42258},
{0xa7b1,0xa7b1,-1,-42282},
{0xa7b2,0xa7b2,-1,-42261},
{0xa7b3,0xa7b3,-1,928},
{0xa7b4,0xa7b6,2,1},
{0xab70,0xabbf,1,-38864},
{0xff21,0xff3a,1,32},
{0x10400,0x10427,1,40},
{0x10c80,0x10cb2,1,64},
{0x118a0,0x118bf,1,32}
};
@@ -2952,6 +2965,8 @@ static convertStruct toLower[] =
{0x531,0x556,1,48},
{0x10a0,0x10c5,1,7264},
{0x10c7,0x10cd,6,7264},
{0x13a0,0x13ef,1,38864},
{0x13f0,0x13f5,1,8},
{0x1e00,0x1e94,2,1},
{0x1e9e,0x1e9e,-1,-7615},
{0x1ea0,0x1efe,2,1},
@@ -3017,8 +3032,12 @@ static convertStruct toLower[] =
{0xa7ad,0xa7ad,-1,-42305},
{0xa7b0,0xa7b0,-1,-42258},
{0xa7b1,0xa7b1,-1,-42282},
{0xa7b2,0xa7b2,-1,-42261},
{0xa7b3,0xa7b3,-1,928},
{0xa7b4,0xa7b6,2,1},
{0xff21,0xff3a,1,32},
{0x10400,0x10427,1,40},
{0x10c80,0x10cb2,1,64},
{0x118a0,0x118bf,1,32}
};
@@ -3098,6 +3117,7 @@ static convertStruct toUpper[] =
{0x28a,0x28b,1,-217},
{0x28c,0x28c,-1,-71},
{0x292,0x292,-1,-219},
{0x29d,0x29d,-1,42261},
{0x29e,0x29e,-1,42258},
{0x345,0x345,-1,84},
{0x371,0x373,2,-1},
@@ -3130,6 +3150,7 @@ static convertStruct toUpper[] =
{0x4cf,0x4cf,-1,-15},
{0x4d1,0x52f,2,-1},
{0x561,0x586,1,-48},
{0x13f8,0x13fd,1,-8},
{0x1d79,0x1d79,-1,35332},
{0x1d7d,0x1d7d,-1,3814},
{0x1e01,0x1e95,2,-1},
@@ -3183,8 +3204,12 @@ static convertStruct toUpper[] =
{0xa78c,0xa791,5,-1},
{0xa793,0xa797,4,-1},
{0xa799,0xa7a9,2,-1},
{0xa7b5,0xa7b7,2,-1},
{0xab53,0xab53,-1,-928},
{0xab70,0xabbf,1,-38864},
{0xff41,0xff5a,1,-32},
{0x10428,0x1044f,1,-40},
{0x10cc0,0x10cf2,1,-64},
{0x118c0,0x118df,1,-32}
};
/*
+3 -1
View File
@@ -811,6 +811,8 @@ mf_rem_used(mfp, hp)
*
* Return the block header to the caller, including the memory block, so
* it can be re-used. Make sure the page_count is right.
*
* Returns NULL if no block is released.
*/
static bhdr_T *
mf_release(mfp, page_count)
@@ -1219,7 +1221,7 @@ mf_trans_add(mfp, hp)
}
/*
* Lookup a translation from the trans lists and delete the entry
* Lookup a translation from the trans lists and delete the entry.
*
* Return the positive new number when found, the old number when not found
*/
+38 -10
View File
@@ -488,7 +488,7 @@ ml_set_b0_crypt(buf, b0p)
ml_set_crypt_key(buf, old_key, old_cm)
buf_T *buf;
char_u *old_key;
int old_cm;
char_u *old_cm;
{
memfile_T *mfp = buf->b_ml.ml_mfp;
bhdr_T *hp;
@@ -500,15 +500,30 @@ ml_set_crypt_key(buf, old_key, old_cm)
DATA_BL *dp;
blocknr_T bnum;
int top;
int old_method;
if (mfp == NULL)
return; /* no memfile yet, nothing to do */
old_method = crypt_method_nr_from_name(old_cm);
/* First make sure the swapfile is in a consistent state, using the old
* key and method. */
{
char_u *new_key = buf->b_p_key;
char_u *new_buf_cm = buf->b_p_cm;
buf->b_p_key = old_key;
buf->b_p_cm = old_cm;
ml_preserve(buf, FALSE);
buf->b_p_key = new_key;
buf->b_p_cm = new_buf_cm;
}
/* Set the key, method and seed to be used for reading, these must be the
* old values. */
mfp->mf_old_key = old_key;
mfp->mf_old_cm = old_cm;
if (old_cm > 0)
mfp->mf_old_cm = old_method;
if (old_method > 0 && *old_key != NUL)
mch_memmove(mfp->mf_old_seed, mfp->mf_seed, MF_SEED_LEN);
/* Update block 0 with the crypt flag and may set a new seed. */
@@ -561,8 +576,10 @@ ml_set_crypt_key(buf, old_key, old_cm)
{
if (pp->pb_pointer[idx].pe_bnum < 0)
{
/* Skip data block with negative block number. */
++idx; /* get same block again for next index */
/* Skip data block with negative block number.
* Should not happen, because of the ml_preserve()
* above. Get same block again for next index. */
++idx;
continue;
}
@@ -579,6 +596,7 @@ ml_set_crypt_key(buf, old_key, old_cm)
bnum = pp->pb_pointer[idx].pe_bnum;
page_count = pp->pb_pointer[idx].pe_page_count;
idx = 0;
continue;
}
}
@@ -605,6 +623,8 @@ ml_set_crypt_key(buf, old_key, old_cm)
idx = ip->ip_index + 1; /* go to next index */
page_count = 1;
}
if (hp != NULL)
mf_put(mfp, hp, FALSE, FALSE); /* release previous block */
if (error > 0)
EMSG(_("E843: Error while updating swap file crypt"));
@@ -4859,6 +4879,10 @@ ml_encrypt_data(mfp, data, offset, size)
if (dp->db_id != DATA_ID)
return data;
state = ml_crypt_prepare(mfp, offset, FALSE);
if (state == NULL)
return data;
new_data = (char_u *)alloc(size);
if (new_data == NULL)
return NULL;
@@ -4870,7 +4894,6 @@ ml_encrypt_data(mfp, data, offset, size)
mch_memmove(new_data, dp, head_end - (char_u *)dp);
/* Encrypt the text. */
state = ml_crypt_prepare(mfp, offset, FALSE);
crypt_encode(state, text_start, text_len, new_data + dp->db_txt_start);
crypt_free_state(state);
@@ -4882,7 +4905,7 @@ ml_encrypt_data(mfp, data, offset, size)
}
/*
* Decrypt the text in "data" if it points to a data block.
* Decrypt the text in "data" if it points to an encrypted data block.
*/
void
ml_decrypt_data(mfp, data, offset, size)
@@ -4907,10 +4930,13 @@ ml_decrypt_data(mfp, data, offset, size)
|| dp->db_txt_end > size)
return; /* data was messed up */
/* Decrypt the text in place. */
state = ml_crypt_prepare(mfp, offset, TRUE);
crypt_decode_inplace(state, text_start, text_len);
crypt_free_state(state);
if (state != NULL)
{
/* Decrypt the text in place. */
crypt_decode_inplace(state, text_start, text_len);
crypt_free_state(state);
}
}
}
@@ -4943,6 +4969,8 @@ ml_crypt_prepare(mfp, offset, reading)
key = buf->b_p_key;
seed = mfp->mf_seed;
}
if (*key == NUL)
return NULL;
if (method_nr == CRYPT_M_ZIP)
{
+3 -1
View File
@@ -1701,7 +1701,9 @@ msg_prt_line(s, list)
else if (has_mbyte && (l = (*mb_ptr2len)(s)) > 1)
{
col += (*mb_ptr2cells)(s);
if (lcs_nbsp != NUL && list && mb_ptr2char(s) == 160)
if (lcs_nbsp != NUL && list
&& (mb_ptr2char(s) == 160
|| mb_ptr2char(s) == 0x202f))
{
mb_char2bytes(lcs_nbsp, buf);
buf[(*mb_ptr2len)(buf)] = NUL;
+29 -13
View File
@@ -5382,6 +5382,12 @@ do_c_expr_indent()
fixthisline(get_c_indent);
}
/* Find result cache for cpp_baseclass */
typedef struct {
int found;
lpos_T lpos;
} cpp_baseclass_cache_T;
/*
* Functions for C-indenting.
* Most of this originally comes from Eric Fischer.
@@ -5415,7 +5421,7 @@ static int cin_iswhileofdo __ARGS((char_u *, linenr_T));
static int cin_is_if_for_while_before_offset __ARGS((char_u *line, int *poffset));
static int cin_iswhileofdo_end __ARGS((int terminated));
static int cin_isbreak __ARGS((char_u *));
static int cin_is_cpp_baseclass __ARGS((colnr_T *col));
static int cin_is_cpp_baseclass __ARGS((cpp_baseclass_cache_T *cached));
static int get_baseclass_amount __ARGS((int col));
static int cin_ends_in __ARGS((char_u *, char_u *, char_u *));
static int cin_starts_with __ARGS((char_u *s, char *word));
@@ -6378,15 +6384,19 @@ cin_isbreak(p)
* This is a lot of guessing. Watch out for "cond ? func() : foo".
*/
static int
cin_is_cpp_baseclass(col)
colnr_T *col; /* return: column to align with */
cin_is_cpp_baseclass(cached)
cpp_baseclass_cache_T *cached; /* input and output */
{
lpos_T *pos = &cached->lpos; /* find position */
char_u *s;
int class_or_struct, lookfor_ctor_init, cpp_base_class;
linenr_T lnum = curwin->w_cursor.lnum;
char_u *line = ml_get_curline();
*col = 0;
if (pos->lnum <= lnum)
return cached->found; /* Use the cached result */
pos->col = 0;
s = skipwhite(line);
if (*s == '#') /* skip #define FOO x ? (x) : x */
@@ -6430,6 +6440,7 @@ cin_is_cpp_baseclass(col)
--lnum;
}
pos->lnum = lnum;
line = ml_get(lnum);
s = cin_skipcomment(line);
for (;;)
@@ -6462,7 +6473,7 @@ cin_is_cpp_baseclass(col)
* cpp-base-class-declaration or constructor-initialization */
cpp_base_class = TRUE;
lookfor_ctor_init = class_or_struct = FALSE;
*col = 0;
pos->col = 0;
s = cin_skipcomment(s + 1);
}
else
@@ -6503,24 +6514,27 @@ cin_is_cpp_baseclass(col)
class_or_struct = FALSE;
lookfor_ctor_init = FALSE;
}
else if (*col == 0)
else if (pos->col == 0)
{
/* it can't be a constructor-initialization any more */
lookfor_ctor_init = FALSE;
/* the first statement starts here: lineup with this one... */
if (cpp_base_class)
*col = (colnr_T)(s - line);
pos->col = (colnr_T)(s - line);
}
/* When the line ends in a comma don't align with it. */
if (lnum == curwin->w_cursor.lnum && *s == ',' && cin_nocode(s + 1))
*col = 0;
pos->col = 0;
s = cin_skipcomment(s + 1);
}
}
cached->found = cpp_base_class;
if (cpp_base_class)
pos->lnum = lnum;
return cpp_base_class;
}
@@ -7053,7 +7067,7 @@ get_c_indent()
#define LOOKFOR_CPP_BASECLASS 9
#define LOOKFOR_ENUM_OR_INIT 10
#define LOOKFOR_JS_KEY 11
#define LOOKFOR_COMMA 12
#define LOOKFOR_COMMA 12
int whilelevel;
linenr_T lnum;
@@ -7065,6 +7079,7 @@ get_c_indent()
int original_line_islabel;
int added_to_amount = 0;
int js_cur_has_key = 0;
cpp_baseclass_cache_T cache_cpp_baseclass = { FALSE, { MAXLNUM, 0 } };
/* make a copy, value is changed below */
int ind_continuation = curbuf->b_ind_continuation;
@@ -8095,7 +8110,7 @@ get_c_indent()
n = FALSE;
if (lookfor != LOOKFOR_TERM && curbuf->b_ind_cpp_baseclass > 0)
{
n = cin_is_cpp_baseclass(&col);
n = cin_is_cpp_baseclass(&cache_cpp_baseclass);
l = ml_get_curline();
}
if (n)
@@ -8116,7 +8131,8 @@ get_c_indent()
}
else
/* XXX */
amount = get_baseclass_amount(col);
amount = get_baseclass_amount(
cache_cpp_baseclass.lpos.col);
break;
}
else if (lookfor == LOOKFOR_CPP_BASECLASS)
@@ -8786,13 +8802,13 @@ term_again:
n = FALSE;
if (curbuf->b_ind_cpp_baseclass != 0 && theline[0] != '{')
{
n = cin_is_cpp_baseclass(&col);
n = cin_is_cpp_baseclass(&cache_cpp_baseclass);
l = ml_get_curline();
}
if (n)
{
/* XXX */
amount = get_baseclass_amount(col);
amount = get_baseclass_amount(cache_cpp_baseclass.lpos.col);
break;
}
+149 -83
View File
@@ -174,6 +174,7 @@ static void nv_drop __ARGS((cmdarg_T *cap));
#ifdef FEAT_AUTOCMD
static void nv_cursorhold __ARGS((cmdarg_T *cap));
#endif
static void get_op_vcol __ARGS((oparg_T *oap, colnr_T col, int initial));
static char *e_noident = N_("E349: No identifier under cursor");
@@ -1418,6 +1419,8 @@ do_pending_operator(cap, old_col, gui_yank)
{
#ifdef FEAT_LINEBREAK
/* Avoid a problem with unwanted linebreaks in block mode. */
if (curwin->w_p_lbr)
curwin->w_valid &= ~VALID_VIRTCOL;
curwin->w_p_lbr = FALSE;
#endif
oap->is_VIsual = VIsual_active;
@@ -1547,8 +1550,10 @@ do_pending_operator(cap, old_col, gui_yank)
}
/* In Select mode, a linewise selection is operated upon like a
* characterwise selection. */
if (VIsual_select && VIsual_mode == 'V')
* characterwise selection.
* Special case: gH<Del> deletes the last line. */
if (VIsual_select && VIsual_mode == 'V'
&& cap->oap->op_type != OP_DELETE)
{
if (lt(VIsual, curwin->w_cursor))
{
@@ -1629,61 +1634,7 @@ do_pending_operator(cap, old_col, gui_yank)
if (VIsual_active || redo_VIsual_busy)
{
if (VIsual_mode == Ctrl_V) /* block mode */
{
colnr_T start, end;
oap->block_mode = TRUE;
getvvcol(curwin, &(oap->start),
&oap->start_vcol, NULL, &oap->end_vcol);
if (!redo_VIsual_busy)
{
getvvcol(curwin, &(oap->end), &start, NULL, &end);
if (start < oap->start_vcol)
oap->start_vcol = start;
if (end > oap->end_vcol)
{
if (*p_sel == 'e' && start >= 1
&& start - 1 >= oap->end_vcol)
oap->end_vcol = start - 1;
else
oap->end_vcol = end;
}
}
/* if '$' was used, get oap->end_vcol from longest line */
if (curwin->w_curswant == MAXCOL)
{
curwin->w_cursor.col = MAXCOL;
oap->end_vcol = 0;
for (curwin->w_cursor.lnum = oap->start.lnum;
curwin->w_cursor.lnum <= oap->end.lnum;
++curwin->w_cursor.lnum)
{
getvvcol(curwin, &curwin->w_cursor, NULL, NULL, &end);
if (end > oap->end_vcol)
oap->end_vcol = end;
}
}
else if (redo_VIsual_busy)
oap->end_vcol = oap->start_vcol + redo_VIsual_vcol - 1;
/*
* Correct oap->end.col and oap->start.col to be the
* upper-left and lower-right corner of the block area.
*
* (Actually, this does convert column positions into character
* positions)
*/
curwin->w_cursor.lnum = oap->end.lnum;
coladvance(oap->end_vcol);
oap->end = curwin->w_cursor;
curwin->w_cursor = oap->start;
coladvance(oap->start_vcol);
oap->start = curwin->w_cursor;
}
get_op_vcol(oap, redo_VIsual_vcol, TRUE);
if (!redo_VIsual_busy && !gui_yank)
{
@@ -1770,24 +1721,16 @@ do_pending_operator(cap, old_col, gui_yank)
oap->inclusive = FALSE;
/* Try to include the newline, unless it's an operator
* that works on lines only. */
if (*p_sel != 'o' && !op_on_lines(oap->op_type))
if (*p_sel != 'o'
&& !op_on_lines(oap->op_type)
&& oap->end.lnum < curbuf->b_ml.ml_line_count)
{
if (oap->end.lnum < curbuf->b_ml.ml_line_count)
{
++oap->end.lnum;
oap->end.col = 0;
++oap->end.lnum;
oap->end.col = 0;
#ifdef FEAT_VIRTUALEDIT
oap->end.coladd = 0;
oap->end.coladd = 0;
#endif
++oap->line_count;
}
else
{
/* Cannot move below the last line, make the op
* inclusive to tell the operation to include the
* line break. */
oap->inclusive = TRUE;
}
++oap->line_count;
}
}
}
@@ -1988,7 +1931,11 @@ do_pending_operator(cap, old_col, gui_yank)
#ifdef FEAT_LINEBREAK
/* Restore linebreak, so that when the user edits it looks as
* before. */
curwin->w_p_lbr = lbr_saved;
if (curwin->w_p_lbr != lbr_saved)
{
curwin->w_p_lbr = lbr_saved;
get_op_vcol(oap, redo_VIsual_mode, FALSE);
}
#endif
/* Reset finish_op now, don't want it set inside edit(). */
finish_op = FALSE;
@@ -2088,7 +2035,11 @@ do_pending_operator(cap, old_col, gui_yank)
#ifdef FEAT_LINEBREAK
/* Restore linebreak, so that when the user edits it looks as
* before. */
curwin->w_p_lbr = lbr_saved;
if (curwin->w_p_lbr != lbr_saved)
{
curwin->w_p_lbr = lbr_saved;
get_op_vcol(oap, redo_VIsual_mode, FALSE);
}
#endif
op_insert(oap, cap->count1);
#ifdef FEAT_LINEBREAK
@@ -2120,11 +2071,15 @@ do_pending_operator(cap, old_col, gui_yank)
#ifdef FEAT_VISUALEXTRA
else
{
#ifdef FEAT_LINEBREAK
# ifdef FEAT_LINEBREAK
/* Restore linebreak, so that when the user edits it looks as
* before. */
curwin->w_p_lbr = lbr_saved;
#endif
if (curwin->w_p_lbr != lbr_saved)
{
curwin->w_p_lbr = lbr_saved;
get_op_vcol(oap, redo_VIsual_mode, FALSE);
}
# endif
op_replace(oap, cap->nchar);
}
#endif
@@ -4251,9 +4206,34 @@ nv_help(cap)
nv_addsub(cap)
cmdarg_T *cap;
{
if (!checkclearopq(cap->oap)
&& do_addsub((int)cap->cmdchar, cap->count1) == OK)
prep_redo_cmd(cap);
int visual = VIsual_active;
if (cap->oap->op_type == OP_NOP
&& do_addsub((int)cap->cmdchar, cap->count1, cap->arg) == OK)
{
if (visual)
{
ResetRedobuff();
AppendCharToRedobuff(VIsual_mode);
if (VIsual_mode == 'V')
{
AppendNumberToRedobuff(cap->oap->line_count);
AppendCharToRedobuff('j');
}
AppendNumberToRedobuff(cap->count1);
if (cap->nchar != NUL)
AppendCharToRedobuff(cap->nchar);
AppendCharToRedobuff(cap->cmdchar);
}
else
prep_redo_cmd(cap);
}
else
clearopbeep(cap->oap);
if (visual)
{
VIsual_active = FALSE;
redraw_later(CLEAR);
}
}
/*
@@ -7920,14 +7900,28 @@ nv_g_cmd(cap)
switch (cap->nchar)
{
case Ctrl_A:
case Ctrl_X:
#ifdef MEM_PROFILE
/*
* "g^A": dump log of used memory.
*/
case Ctrl_A:
vim_mem_profile_dump();
break;
if (!VIsual_active && cap->nchar == Ctrl_A)
vim_mem_profile_dump();
else
#endif
/*
* "g^A/g^X": sequentially increment visually selected region
*/
if (VIsual_active)
{
cap->arg = TRUE;
cap->cmdchar = cap->nchar;
nv_addsub(cap);
}
else
clearopbeep(oap);
break;
#ifdef FEAT_VREPLACE
/*
@@ -8527,6 +8521,11 @@ n_opencmd(cap)
/* When '#' is in 'cpoptions' ignore the count. */
if (vim_strchr(p_cpo, CPO_HASH) != NULL)
cap->count1 = 1;
#ifdef FEAT_SYN_HL
if (curwin->w_p_cul)
/* force redraw of cursorline */
curwin->w_valid &= ~VALID_CROW;
#endif
invoke_edit(cap, FALSE, cap->cmdchar, TRUE);
}
}
@@ -9577,3 +9576,70 @@ nv_cursorhold(cap)
cap->retval |= CA_COMMAND_BUSY; /* don't call edit() now */
}
#endif
/*
* calculate start/end virtual columns for operating in block mode
*/
static void
get_op_vcol(oap, redo_VIsual_vcol, initial)
oparg_T *oap;
colnr_T redo_VIsual_vcol;
int initial; /* when true: adjust position for 'selectmode' */
{
colnr_T start, end;
if (VIsual_mode != Ctrl_V)
return;
oap->block_mode = TRUE;
#ifdef FEAT_MBYTE
/* prevent from moving onto a trail byte */
if (has_mbyte)
mb_adjustpos(curwin->w_buffer, &oap->end);
#endif
getvvcol(curwin, &(oap->start), &oap->start_vcol, NULL, &oap->end_vcol);
getvvcol(curwin, &(oap->end), &start, NULL, &end);
if (start < oap->start_vcol)
oap->start_vcol = start;
if (end > oap->end_vcol)
{
if (initial && *p_sel == 'e' && start >= 1
&& start - 1 >= oap->end_vcol)
oap->end_vcol = start - 1;
else
oap->end_vcol = end;
}
/* if '$' was used, get oap->end_vcol from longest line */
if (curwin->w_curswant == MAXCOL)
{
curwin->w_cursor.col = MAXCOL;
oap->end_vcol = 0;
for (curwin->w_cursor.lnum = oap->start.lnum;
curwin->w_cursor.lnum <= oap->end.lnum;
++curwin->w_cursor.lnum)
{
getvvcol(curwin, &curwin->w_cursor, NULL, NULL, &end);
if (end > oap->end_vcol)
oap->end_vcol = end;
}
}
else if (redo_VIsual_busy)
oap->end_vcol = oap->start_vcol + redo_VIsual_vcol - 1;
/*
* Correct oap->end.col and oap->start.col to be the
* upper-left and lower-right corner of the block area.
*
* (Actually, this does convert column positions into character
* positions)
*/
curwin->w_cursor.lnum = oap->end.lnum;
coladvance(oap->end_vcol);
oap->end = curwin->w_cursor;
curwin->w_cursor = oap->start;
coladvance(oap->start_vcol);
oap->start = curwin->w_cursor;
}
+312 -245
View File
@@ -1959,60 +1959,31 @@ op_delete(oap)
curwin->w_cursor.coladd = 0;
}
#endif
if (oap->op_type == OP_DELETE
&& oap->inclusive
&& oap->end.lnum == curbuf->b_ml.ml_line_count
&& n > (int)STRLEN(ml_get(oap->end.lnum)))
{
/* Special case: gH<Del> deletes the last line. */
del_lines(1L, FALSE);
}
else
{
(void)del_bytes((long)n, !virtual_op,
oap->op_type == OP_DELETE && !oap->is_VIsual);
}
(void)del_bytes((long)n, !virtual_op,
oap->op_type == OP_DELETE && !oap->is_VIsual);
}
else /* delete characters between lines */
{
pos_T curpos;
int delete_last_line;
/* save deleted and changed lines for undo */
if (u_save((linenr_T)(curwin->w_cursor.lnum - 1),
(linenr_T)(curwin->w_cursor.lnum + oap->line_count)) == FAIL)
return FAIL;
delete_last_line = (oap->end.lnum == curbuf->b_ml.ml_line_count);
truncate_line(TRUE); /* delete from cursor to end of line */
curpos = curwin->w_cursor; /* remember curwin->w_cursor */
++curwin->w_cursor.lnum;
del_lines((long)(oap->line_count - 2), FALSE);
if (delete_last_line)
oap->end.lnum = curbuf->b_ml.ml_line_count;
/* delete from start of line until op_end */
n = (oap->end.col + 1 - !oap->inclusive);
if (oap->inclusive && delete_last_line
&& n > (int)STRLEN(ml_get(oap->end.lnum)))
{
/* Special case: gH<Del> deletes the last line. */
del_lines(1L, FALSE);
curwin->w_cursor = curpos; /* restore curwin->w_cursor */
if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count)
curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
}
else
{
/* delete from start of line until op_end */
curwin->w_cursor.col = 0;
(void)del_bytes((long)n, !virtual_op,
oap->op_type == OP_DELETE && !oap->is_VIsual);
curwin->w_cursor = curpos; /* restore curwin->w_cursor */
}
if (curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count)
(void)do_join(2, FALSE, FALSE, FALSE, FALSE);
curwin->w_cursor.col = 0;
(void)del_bytes((long)n, !virtual_op,
oap->op_type == OP_DELETE && !oap->is_VIsual);
curwin->w_cursor = curpos; /* restore curwin->w_cursor */
(void)do_join(2, FALSE, FALSE, FALSE, FALSE);
}
}
@@ -3488,17 +3459,26 @@ do_put(regname, dir, count, flags)
{
if (flags & PUT_LINE_SPLIT)
{
char_u *p;
/* "p" or "P" in Visual mode: split the lines to put the text in
* between. */
if (u_save_cursor() == FAIL)
goto end;
ptr = vim_strsave(ml_get_cursor());
p = ml_get_cursor();
if (dir == FORWARD && *p != NUL)
mb_ptr_adv(p);
ptr = vim_strsave(p);
if (ptr == NULL)
goto end;
ml_append(curwin->w_cursor.lnum, ptr, (colnr_T)0, FALSE);
vim_free(ptr);
ptr = vim_strnsave(ml_get_curline(), curwin->w_cursor.col);
oldp = ml_get_curline();
p = oldp + curwin->w_cursor.col;
if (dir == FORWARD && *p != NUL)
mb_ptr_adv(p);
ptr = vim_strnsave(oldp, p - oldp);
if (ptr == NULL)
goto end;
ml_replace(curwin->w_cursor.lnum, ptr, FALSE);
@@ -5395,9 +5375,10 @@ reverse_line(s)
* return FAIL for failure, OK otherwise
*/
int
do_addsub(command, Prenum1)
do_addsub(command, Prenum1, g_cmd)
int command;
linenr_T Prenum1;
int g_cmd; /* was g<c-a>/g<c-x> */
{
int col;
char_u *buf1;
@@ -5405,6 +5386,7 @@ do_addsub(command, Prenum1)
int hex; /* 'X' or 'x': hex; '0': octal */
static int hexupper = FALSE; /* 0xABC */
unsigned long n;
unsigned long offset = 0; /* line offset for Ctrl_V mode */
long_u oldn;
char_u *ptr;
int c;
@@ -5414,247 +5396,324 @@ do_addsub(command, Prenum1)
int dooct;
int doalp;
int firstdigit;
int negative;
int subtract;
int negative = FALSE;
int was_positive = TRUE;
int visual = VIsual_active;
int i;
int lnum = curwin->w_cursor.lnum;
int lnume = curwin->w_cursor.lnum;
int startcol;
dohex = (vim_strchr(curbuf->b_p_nf, 'x') != NULL); /* "heX" */
dooct = (vim_strchr(curbuf->b_p_nf, 'o') != NULL); /* "Octal" */
doalp = (vim_strchr(curbuf->b_p_nf, 'p') != NULL); /* "alPha" */
ptr = ml_get_curline();
RLADDSUBFIX(ptr);
/*
* First check if we are on a hexadecimal number, after the "0x".
*/
col = curwin->w_cursor.col;
if (dohex)
while (col > 0 && vim_isxdigit(ptr[col]))
--col;
if ( dohex
&& col > 0
&& (ptr[col] == 'X'
|| ptr[col] == 'x')
&& ptr[col - 1] == '0'
&& vim_isxdigit(ptr[col + 1]))
if (VIsual_active)
{
/*
* Found hexadecimal number, move to its start.
*/
--col;
if (lt(curwin->w_cursor, VIsual))
{
pos_T t;
t = curwin->w_cursor;
curwin->w_cursor = VIsual;
VIsual = t;
}
if (VIsual_mode == 'V')
VIsual.col = 0;
ptr = ml_get(VIsual.lnum);
RLADDSUBFIX(ptr);
/* store visual area for 'gv' */
curbuf->b_visual.vi_start = VIsual;
curbuf->b_visual.vi_end = curwin->w_cursor;
curbuf->b_visual.vi_mode = VIsual_mode;
if (VIsual_mode != 'v')
startcol = VIsual.col < curwin->w_cursor.col ? VIsual.col
: curwin->w_cursor.col;
else
startcol = VIsual.col;
col = startcol;
lnum = VIsual.lnum;
lnume = curwin->w_cursor.lnum;
}
else
{
/*
* Search forward and then backward to find the start of number.
*/
col = curwin->w_cursor.col;
ptr = ml_get_curline();
RLADDSUBFIX(ptr);
while (ptr[col] != NUL
&& !vim_isdigit(ptr[col])
&& !(doalp && ASCII_ISALPHA(ptr[col])))
++col;
while (col > 0
&& vim_isdigit(ptr[col - 1])
&& !(doalp && ASCII_ISALPHA(ptr[col])))
--col;
}
/*
* If a number was found, and saving for undo works, replace the number.
*/
firstdigit = ptr[col];
RLADDSUBFIX(ptr);
if ((!VIM_ISDIGIT(firstdigit) && !(doalp && ASCII_ISALPHA(firstdigit)))
|| u_save_cursor() != OK)
{
beep_flush();
return FAIL;
}
/* get ptr again, because u_save() may have changed it */
ptr = ml_get_curline();
RLADDSUBFIX(ptr);
if (doalp && ASCII_ISALPHA(firstdigit))
{
/* decrement or increment alphabetic character */
if (command == Ctrl_X)
if (dohex)
while (col > 0 && vim_isxdigit(ptr[col]))
--col;
if ( dohex
&& col > 0
&& (ptr[col] == 'X'
|| ptr[col] == 'x')
&& ptr[col - 1] == '0'
&& vim_isxdigit(ptr[col + 1]))
{
if (CharOrd(firstdigit) < Prenum1)
{
if (isupper(firstdigit))
firstdigit = 'A';
else
firstdigit = 'a';
}
else
#ifdef EBCDIC
firstdigit = EBCDIC_CHAR_ADD(firstdigit, -Prenum1);
#else
firstdigit -= Prenum1;
#endif
/* Found hexadecimal number, move to its start. */
--col;
}
else
{
if (26 - CharOrd(firstdigit) - 1 < Prenum1)
{
if (isupper(firstdigit))
firstdigit = 'Z';
else
firstdigit = 'z';
}
else
#ifdef EBCDIC
firstdigit = EBCDIC_CHAR_ADD(firstdigit, Prenum1);
#else
firstdigit += Prenum1;
#endif
/*
* Search forward and then backward to find the start of number.
*/
col = curwin->w_cursor.col;
while (ptr[col] != NUL
&& !vim_isdigit(ptr[col])
&& !(doalp && ASCII_ISALPHA(ptr[col])))
++col;
while (col > 0
&& vim_isdigit(ptr[col - 1])
&& !(doalp && ASCII_ISALPHA(ptr[col])))
--col;
}
curwin->w_cursor.col = col;
(void)del_char(FALSE);
ins_char(firstdigit);
}
else
for (i = lnum; i <= lnume; i++)
{
negative = FALSE;
if (col > 0 && ptr[col - 1] == '-') /* negative number */
curwin->w_cursor.lnum = i;
ptr = ml_get_curline();
if ((int)STRLEN(ptr) <= col)
/* try again on next line */
continue;
if (visual && ptr[col] == '-')
{
--col;
negative = TRUE;
was_positive = FALSE;
col++;
}
/* get the number value (unsigned) */
vim_str2nr(ptr + col, &hex, &length, dooct, dohex, NULL, &n);
/* ignore leading '-' for hex and octal numbers */
if (hex && negative)
{
++col;
--length;
negative = FALSE;
}
/* add or subtract */
subtract = FALSE;
if (command == Ctrl_X)
subtract ^= TRUE;
if (negative)
subtract ^= TRUE;
oldn = n;
if (subtract)
n -= (unsigned long)Prenum1;
else
n += (unsigned long)Prenum1;
/* handle wraparound for decimal numbers */
if (!hex)
{
if (subtract)
{
if (n > oldn)
{
n = 1 + (n ^ (unsigned long)-1);
negative ^= TRUE;
}
}
else /* add */
{
if (n < oldn)
{
n = (n ^ (unsigned long)-1);
negative ^= TRUE;
}
}
if (n == 0)
negative = FALSE;
}
RLADDSUBFIX(ptr);
/*
* Delete the old number.
* If a number was found, and saving for undo works, replace the number.
*/
curwin->w_cursor.col = col;
todel = length;
c = gchar_cursor();
/*
* Don't include the '-' in the length, only the length of the part
* after it is kept the same.
*/
if (c == '-')
--length;
while (todel-- > 0)
firstdigit = ptr[col];
RLADDSUBFIX(ptr);
if ((!VIM_ISDIGIT(firstdigit) && !(doalp && ASCII_ISALPHA(firstdigit)))
|| u_save_cursor() != OK)
{
if (c < 0x100 && isalpha(c))
{
if (isupper(c))
hexupper = TRUE;
else
hexupper = FALSE;
}
/* del_char() will mark line needing displaying */
(void)del_char(FALSE);
c = gchar_cursor();
}
/*
* Prepare the leading characters in buf1[].
* When there are many leading zeros it could be very long. Allocate
* a bit too much.
*/
buf1 = alloc((unsigned)length + NUMBUFLEN);
if (buf1 == NULL)
if (lnum < lnume)
/* Try again on next line */
continue;
beep_flush();
return FAIL;
ptr = buf1;
if (negative)
{
*ptr++ = '-';
}
if (hex)
{
*ptr++ = '0';
--length;
}
if (hex == 'x' || hex == 'X')
{
*ptr++ = hex;
--length;
}
/*
* Put the number characters in buf2[].
*/
if (hex == 0)
sprintf((char *)buf2, "%lu", n);
else if (hex == '0')
sprintf((char *)buf2, "%lo", n);
else if (hex && hexupper)
sprintf((char *)buf2, "%lX", n);
ptr = ml_get_curline();
RLADDSUBFIX(ptr);
if (doalp && ASCII_ISALPHA(firstdigit))
{
/* decrement or increment alphabetic character */
if (command == Ctrl_X)
{
if (CharOrd(firstdigit) < Prenum1)
{
if (isupper(firstdigit))
firstdigit = 'A';
else
firstdigit = 'a';
}
else
#ifdef EBCDIC
firstdigit = EBCDIC_CHAR_ADD(firstdigit, -Prenum1);
#else
firstdigit -= Prenum1;
#endif
}
else
{
if (26 - CharOrd(firstdigit) - 1 < Prenum1)
{
if (isupper(firstdigit))
firstdigit = 'Z';
else
firstdigit = 'z';
}
else
#ifdef EBCDIC
firstdigit = EBCDIC_CHAR_ADD(firstdigit, Prenum1);
#else
firstdigit += Prenum1;
#endif
}
curwin->w_cursor.col = col;
(void)del_char(FALSE);
ins_char(firstdigit);
}
else
sprintf((char *)buf2, "%lx", n);
length -= (int)STRLEN(buf2);
{
if (col > 0 && ptr[col - 1] == '-' && !visual)
{
/* negative number */
--col;
negative = TRUE;
}
/*
* Adjust number of zeros to the new number of digits, so the
* total length of the number remains the same.
* Don't do this when
* the result may look like an octal number.
*/
if (firstdigit == '0' && !(dooct && hex == 0))
while (length-- > 0)
/* get the number value (unsigned) */
vim_str2nr(ptr + col, &hex, &length, dooct, dohex, NULL, &n);
/* ignore leading '-' for hex and octal numbers */
if (hex && negative)
{
++col;
--length;
negative = FALSE;
}
/* add or subtract */
subtract = FALSE;
if (command == Ctrl_X)
subtract ^= TRUE;
if (negative)
subtract ^= TRUE;
oldn = n;
if (subtract)
n -= (unsigned long)Prenum1;
else
n += (unsigned long)Prenum1;
/* handle wraparound for decimal numbers */
if (!hex)
{
if (subtract)
{
if (n > oldn)
{
n = 1 + (n ^ (unsigned long)-1);
negative ^= TRUE;
}
}
else
{
/* add */
if (n < oldn)
{
n = (n ^ (unsigned long)-1);
negative ^= TRUE;
}
}
if (n == 0)
negative = FALSE;
}
if (visual && !was_positive && !negative)
{
/* need to remove the '-' */
col--;
length++;
}
/*
* Delete the old number.
*/
curwin->w_cursor.col = col;
todel = length;
c = gchar_cursor();
/*
* Don't include the '-' in the length, only the length of the
* part after it is kept the same.
*/
if (c == '-')
--length;
while (todel-- > 0)
{
if (c < 0x100 && isalpha(c))
{
if (isupper(c))
hexupper = TRUE;
else
hexupper = FALSE;
}
/* del_char() will mark line needing displaying */
(void)del_char(FALSE);
c = gchar_cursor();
}
/*
* Prepare the leading characters in buf1[].
* When there are many leading zeros it could be very long.
* Allocate a bit too much.
*/
buf1 = alloc((unsigned)length + NUMBUFLEN);
if (buf1 == NULL)
return FAIL;
ptr = buf1;
if (negative && (!visual || (visual && was_positive)))
{
*ptr++ = '-';
}
if (hex)
{
*ptr++ = '0';
*ptr = NUL;
STRCAT(buf1, buf2);
ins_str(buf1); /* insert the new number */
vim_free(buf1);
--length;
}
if (hex == 'x' || hex == 'X')
{
*ptr++ = hex;
--length;
}
/*
* Put the number characters in buf2[].
*/
if (hex == 0)
sprintf((char *)buf2, "%lu", n);
else if (hex == '0')
sprintf((char *)buf2, "%lo", n);
else if (hex && hexupper)
sprintf((char *)buf2, "%lX", n);
else
sprintf((char *)buf2, "%lx", n);
length -= (int)STRLEN(buf2);
/*
* Adjust number of zeros to the new number of digits, so the
* total length of the number remains the same.
* Don't do this when
* the result may look like an octal number.
*/
if (firstdigit == '0' && !(dooct && hex == 0))
while (length-- > 0)
*ptr++ = '0';
*ptr = NUL;
STRCAT(buf1, buf2);
ins_str(buf1); /* insert the new number */
vim_free(buf1);
}
if (g_cmd)
{
offset = (unsigned long)Prenum1;
g_cmd = 0;
}
/* reset */
subtract = FALSE;
negative = FALSE;
if (visual && VIsual_mode != Ctrl_V)
col = 0;
else
col = startcol;
Prenum1 += offset;
curwin->w_set_curswant = TRUE;
#ifdef FEAT_RIGHTLEFT
ptr = ml_get_buf(curbuf, curwin->w_cursor.lnum, TRUE);
RLADDSUBFIX(ptr);
#endif
}
--curwin->w_cursor.col;
curwin->w_set_curswant = TRUE;
#ifdef FEAT_RIGHTLEFT
ptr = ml_get_buf(curbuf, curwin->w_cursor.lnum, TRUE);
RLADDSUBFIX(ptr);
#endif
return OK;
}
@@ -6642,6 +6701,14 @@ str_to_reg(y_ptr, yank_type, str, len, blocklen, str_list)
}
}
/* Without any lines make the register empty. */
if (y_ptr->y_size + newlines == 0)
{
vim_free(y_ptr->y_array);
y_ptr->y_array = NULL;
return;
}
/*
* Allocate an array to hold the pointers to the new register lines.
* If the register was not empty, move the existing lines to the new array.
+16 -12
View File
@@ -2986,11 +2986,11 @@ static struct vimoption
#ifdef FEAT_VERTSPLIT
p_term("t_CV", T_CSV)
#endif
p_term("t_ut", T_UT)
p_term("t_da", T_DA)
p_term("t_db", T_DB)
p_term("t_DL", T_CDL)
p_term("t_dl", T_DL)
p_term("t_EI", T_CEI)
p_term("t_fs", T_FS)
p_term("t_IE", T_CIE)
p_term("t_IS", T_CIS)
@@ -3004,28 +3004,29 @@ static struct vimoption
p_term("t_ms", T_MS)
p_term("t_nd", T_ND)
p_term("t_op", T_OP)
p_term("t_RB", T_RBG)
p_term("t_RI", T_CRI)
p_term("t_RV", T_CRV)
p_term("t_u7", T_U7)
p_term("t_Sb", T_CSB)
p_term("t_Sf", T_CSF)
p_term("t_se", T_SE)
p_term("t_Sf", T_CSF)
p_term("t_SI", T_CSI)
p_term("t_so", T_SO)
p_term("t_SR", T_CSR)
p_term("t_sr", T_SR)
p_term("t_ts", T_TS)
p_term("t_te", T_TE)
p_term("t_ti", T_TI)
p_term("t_ts", T_TS)
p_term("t_u7", T_U7)
p_term("t_ue", T_UE)
p_term("t_us", T_US)
p_term("t_ut", T_UT)
p_term("t_vb", T_VB)
p_term("t_ve", T_VE)
p_term("t_vi", T_VI)
p_term("t_vs", T_VS)
p_term("t_WP", T_CWP)
p_term("t_WS", T_CWS)
p_term("t_SI", T_CSI)
p_term("t_EI", T_CEI)
p_term("t_SR", T_CSR)
p_term("t_xn", T_XN)
p_term("t_xs", T_XS)
p_term("t_ZH", T_CZH)
@@ -4897,6 +4898,10 @@ do_set(arg, opt_flags)
if (adding)
{
i = (int)STRLEN(origval);
/* strip a trailing comma, would get 2 */
if (comma && i > 1 && origval[i - 1] == ','
&& origval[i - 2] != '\\')
i--;
mch_memmove(newval + i + comma, newval,
STRLEN(newval) + 1);
mch_memmove(newval, origval, (size_t)i);
@@ -6239,7 +6244,8 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
# endif
if (STRCMP(curbuf->b_p_key, oldval) != 0)
/* Need to update the swapfile. */
ml_set_crypt_key(curbuf, oldval, crypt_get_method_nr(curbuf));
ml_set_crypt_key(curbuf, oldval,
*curbuf->b_p_cm == NUL ? p_cm : curbuf->b_p_cm);
}
else if (gvarp == &p_cm)
@@ -6283,8 +6289,7 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
else
p = curbuf->b_p_cm;
if (STRCMP(s, p) != 0)
ml_set_crypt_key(curbuf, curbuf->b_p_key,
crypt_method_nr_from_name(s));
ml_set_crypt_key(curbuf, curbuf->b_p_key, s);
/* If the global value changes need to update the swapfile for all
* buffers using that value. */
@@ -6294,8 +6299,7 @@ did_set_string_option(opt_idx, varp, new_value_alloced, oldval, errbuf,
for (buf = firstbuf; buf != NULL; buf = buf->b_next)
if (buf != curbuf && *buf->b_p_cm == NUL)
ml_set_crypt_key(buf, buf->b_p_key,
crypt_method_nr_from_name(oldval));
ml_set_crypt_key(buf, buf->b_p_key, oldval);
}
}
}
+2 -1
View File
@@ -777,12 +777,13 @@ EXTERN char_u *p_sws; /* 'swapsync' */
EXTERN char_u *p_swb; /* 'switchbuf' */
EXTERN unsigned swb_flags;
#ifdef IN_OPTION_C
static char *(p_swb_values[]) = {"useopen", "usetab", "split", "newtab", NULL};
static char *(p_swb_values[]) = {"useopen", "usetab", "split", "newtab", "vsplit", NULL};
#endif
#define SWB_USEOPEN 0x001
#define SWB_USETAB 0x002
#define SWB_SPLIT 0x004
#define SWB_NEWTAB 0x008
#define SWB_VSPLIT 0x010
EXTERN int p_tbs; /* 'tagbsearch' */
EXTERN long p_tl; /* 'taglength' */
EXTERN int p_tr; /* 'tagrelative' */
+1 -1
View File
@@ -290,7 +290,7 @@ typedef struct dsc$descriptor DESC;
#endif
#if !defined(USR_EXRC_FILE2)
#if !defined(USR_VIMRC_FILE2)
# ifdef OS2
# define USR_VIMRC_FILE2 "$HOME/vimfiles/vimrc"
# else
+1 -1
View File
@@ -1,6 +1,6 @@
/* memline.c */
int ml_open __ARGS((buf_T *buf));
void ml_set_crypt_key __ARGS((buf_T *buf, char_u *old_key, int old_cm));
void ml_set_crypt_key __ARGS((buf_T *buf, char_u *old_key, char_u *old_cm));
void ml_setname __ARGS((buf_T *buf));
void ml_open_files __ARGS((void));
void ml_open_file __ARGS((buf_T *buf));
+1 -1
View File
@@ -43,7 +43,7 @@ void op_formatexpr __ARGS((oparg_T *oap));
int fex_format __ARGS((linenr_T lnum, long count, int c));
void format_lines __ARGS((linenr_T line_count, int avoid_fex));
int paragraph_start __ARGS((linenr_T lnum));
int do_addsub __ARGS((int command, linenr_T Prenum1));
int do_addsub __ARGS((int command, linenr_T Prenum1, int g_cmd));
int read_viminfo_register __ARGS((vir_T *virp, int force));
void write_viminfo_registers __ARGS((FILE *fp));
void x11_export_final_selection __ARGS((void));
+1
View File
@@ -36,6 +36,7 @@ void starttermcap __ARGS((void));
void stoptermcap __ARGS((void));
void may_req_termresponse __ARGS((void));
void may_req_ambiguous_char_width __ARGS((void));
void may_req_bg_color __ARGS((void));
int swapping_screen __ARGS((void));
void setmouse __ARGS((void));
int mouse_has __ARGS((int c));
+11 -6
View File
@@ -1841,6 +1841,9 @@ win_found:
if (qf_ptr->qf_col > 0)
{
curwin->w_cursor.col = qf_ptr->qf_col - 1;
#ifdef FEAT_VIRTUALEDIT
curwin->w_cursor.coladd = 0;
#endif
if (qf_ptr->qf_viscol == TRUE)
{
/*
@@ -2452,14 +2455,13 @@ ex_copen(eap)
prevwin = win;
}
qf_set_title_var(qi);
/*
* Fill the buffer with the quickfix list.
*/
qf_fill_buffer(qi);
if (qi->qf_lists[qi->qf_curlist].qf_title != NULL)
qf_set_title_var(qi);
curwin->w_cursor.lnum = qi->qf_lists[qi->qf_curlist].qf_index;
curwin->w_cursor.col = 0;
check_cursor();
@@ -2608,8 +2610,7 @@ qf_update_buffer(qi)
qf_fill_buffer(qi);
if (qi->qf_lists[qi->qf_curlist].qf_title != NULL
&& (win = qf_find_win(qi)) != NULL)
if ((win = qf_find_win(qi)) != NULL)
{
curwin_save = curwin;
curwin = win;
@@ -2625,11 +2626,15 @@ qf_update_buffer(qi)
}
}
/*
* Set "w:quickfix_title" if "qi" has a title.
*/
static void
qf_set_title_var(qi)
qf_info_T *qi;
{
set_internal_string_var((char_u *)"w:quickfix_title",
if (qi->qf_lists[qi->qf_curlist].qf_title != NULL)
set_internal_string_var((char_u *)"w:quickfix_title",
qi->qf_lists[qi->qf_curlist].qf_title);
}
+6 -5
View File
@@ -1157,7 +1157,7 @@ get_coll_element(pp)
int l = 1;
char_u *p = *pp;
if (p[1] == '.')
if (p[0] != NUL && p[1] == '.')
{
#ifdef FEAT_MBYTE
if (has_mbyte)
@@ -1228,8 +1228,9 @@ skip_anyof(p)
{
if (get_char_class(&p) == CLASS_NONE
&& get_equi_class(&p) == 0
&& get_coll_element(&p) == 0)
++p; /* It was not a class name */
&& get_coll_element(&p) == 0
&& *p != NUL)
++p; /* it is not a class name and not NUL */
}
else
++p;
@@ -3156,7 +3157,7 @@ peekchr()
/*
* META contains everything that may be magic sometimes,
* except ^ and $ ("\^" and "\$" are only magic after
* "\v"). We now fetch the next character and toggle its
* "\V"). We now fetch the next character and toggle its
* magicness. Therefore, \ is so meta-magic that it is
* not in META.
*/
@@ -6113,7 +6114,7 @@ do_class:
{
if (ireg_ic && enc_utf8)
cf = utf_fold(utf_ptr2char(opnd));
while (count < maxcount)
while (count < maxcount && (*mb_ptr2len)(scan) >= len)
{
for (i = 0; i < len; ++i)
if (opnd[i] != scan[i])
+1 -1
View File
@@ -6602,7 +6602,7 @@ nfa_regmatch(prog, start, submatch, m)
/* If ireg_icombine is not set only skip over the character
* itself. When it is set skip over composing characters. */
if (result && enc_utf8 && !ireg_icombine)
clen = utf_char2len(curc);
clen = utf_ptr2len(reginput);
#endif
ADD_STATE_IF_MATCH(t->state);
break;
+11 -11
View File
@@ -3750,24 +3750,24 @@ win_line(wp, lnum, startrow, endrow, nochange)
if (draw_state == WL_BRI - 1 && n_extra == 0)
{
draw_state = WL_BRI;
# ifdef FEAT_DIFF
# endif
if (wp->w_p_bri && n_extra == 0 && row != startrow
#ifdef FEAT_DIFF
# ifdef FEAT_DIFF
&& filler_lines == 0
#endif
# endif
)
{
char_attr = 0; /* was: hl_attr(HLF_AT); */
#ifdef FEAT_DIFF
# ifdef FEAT_DIFF
if (diff_hlf != (hlf_T)0)
{
char_attr = hl_attr(diff_hlf);
# ifdef FEAT_SYN_HL
if (wp->w_p_cul && lnum == wp->w_cursor.lnum)
char_attr = hl_combine_attr(char_attr,
hl_attr(HLF_CUL));
# endif
}
#endif
# endif
p_extra = NULL;
c_extra = ' ';
n_extra = get_breakindent_win(wp,
@@ -4338,10 +4338,10 @@ win_line(wp, lnum, startrow, endrow, nochange)
if (wp->w_p_list
&& (((c == 160
#ifdef FEAT_MBYTE
|| (mb_utf8 && mb_c == 160)
|| (mb_utf8 && (mb_c == 160 || mb_c == 0x202f))
#endif
) && lcs_nbsp)
|| (c == ' ' && lcs_space && ptr <= line + trailcol)))
|| (c == ' ' && lcs_space && ptr - line <= trailcol)))
{
c = (c == ' ') ? lcs_space : lcs_nbsp;
if (area_attr == 0 && search_attr == 0)
@@ -4703,7 +4703,7 @@ win_line(wp, lnum, startrow, endrow, nochange)
}
}
else if (c == NUL
&& ((wp->w_p_list && lcs_eol > 0)
&& (wp->w_p_list
|| ((fromcol >= 0 || fromcol_prev >= 0)
&& tocol > vcol
&& VIsual_mode != Ctrl_V
@@ -4715,7 +4715,7 @@ win_line(wp, lnum, startrow, endrow, nochange)
&& !(noinvcur
&& lnum == wp->w_cursor.lnum
&& (colnr_T)vcol == wp->w_virtcol)))
&& lcs_eol_one >= 0)
&& lcs_eol_one > 0)
{
/* Display a '$' after the line or highlight an extra
* character if the line break is included. */
@@ -4749,7 +4749,7 @@ win_line(wp, lnum, startrow, endrow, nochange)
c_extra = NUL;
}
}
if (wp->w_p_list)
if (wp->w_p_list && lcs_eol > 0)
c = lcs_eol;
else
c = ' ';
+6
View File
@@ -3469,7 +3469,13 @@ syn_cmd_spell(eap, syncing)
else if (STRNICMP(arg, "default", 7) == 0 && next - arg == 7)
curwin->w_s->b_syn_spell = SYNSPL_DEFAULT;
else
{
EMSG2(_("E390: Illegal argument: %s"), arg);
return;
}
/* assume spell checking changed, force a redraw */
redraw_win_later(curwin, NOT_VALID);
}
/*
+9 -10
View File
@@ -508,14 +508,7 @@ do_tag(tag, type, count, forceit, verbose)
tagmatchname = vim_strsave(name);
}
/*
* If a count is supplied to the ":tag <name>" command, then
* jump to count'th matching tag.
*/
if (type == DT_TAG && *tag != NUL && count > 0)
cur_match = count - 1;
if (type == DT_SELECT || type == DT_JUMP
if (type == DT_TAG || type == DT_SELECT || type == DT_JUMP
#if defined(FEAT_QUICKFIX)
|| type == DT_LTAG
#endif
@@ -594,7 +587,13 @@ do_tag(tag, type, count, forceit, verbose)
}
else
#endif
if (type == DT_SELECT || (type == DT_JUMP && num_matches > 1))
if (type == DT_TAG)
/*
* If a count is supplied to the ":tag <name>" command, then
* jump to count'th matching tag.
*/
cur_match = count > 0 ? count - 1 : 0;
else if (type == DT_SELECT || (type == DT_JUMP && num_matches > 1))
{
/*
* List all the matching tags.
@@ -990,7 +989,7 @@ do_tag(tag, type, count, forceit, verbose)
ic = (matches[cur_match][0] & MT_IC_OFF);
if (type != DT_SELECT && type != DT_JUMP
if (type != DT_TAG && type != DT_SELECT && type != DT_JUMP
#ifdef FEAT_CSCOPE
&& type != DT_CSCOPE
#endif
+78 -7
View File
@@ -124,6 +124,11 @@ static int crv_status = CRV_GET;
# define U7_SENT 2 /* did send T_U7, waiting for answer */
# define U7_GOT 3 /* received T_U7 response */
static int u7_status = U7_GET;
/* Request background color report: */
# define RBG_GET 1 /* send T_RBG when switched to RAW mode */
# define RBG_SENT 2 /* did send T_RBG, waiting for answer */
# define RBG_GOT 3 /* received T_RBG response */
static int rbg_status = RBG_GET;
# endif
/*
@@ -949,6 +954,7 @@ static struct builtin_term builtin_termcaps[] =
{(int)KS_CWP, IF_EB("\033[3;%d;%dt", ESC_STR "[3;%d;%dt")},
# endif
{(int)KS_CRV, IF_EB("\033[>c", ESC_STR "[>c")},
{(int)KS_RBG, IF_EB("\033]11;?\007", ESC_STR "]11;?\007")},
{(int)KS_U7, IF_EB("\033[6n", ESC_STR "[6n")},
{K_UP, IF_EB("\033O*A", ESC_STR "O*A")},
@@ -1240,6 +1246,7 @@ static struct builtin_term builtin_termcaps[] =
# endif
{(int)KS_CRV, "[CRV]"},
{(int)KS_U7, "[U7]"},
{(int)KS_RBG, "[RBG]"},
{K_UP, "[KU]"},
{K_DOWN, "[KD]"},
{K_LEFT, "[KL]"},
@@ -1615,7 +1622,7 @@ set_termname(term)
{KS_TS, "ts"}, {KS_FS, "fs"},
{KS_CWP, "WP"}, {KS_CWS, "WS"},
{KS_CSI, "SI"}, {KS_CEI, "EI"},
{KS_U7, "u7"},
{KS_U7, "u7"}, {KS_RBG, "RB"},
{(enum SpecialKey)0, NULL}
};
@@ -3224,7 +3231,8 @@ settmode(tmode)
* doesn't work in Cooked mode, an external program may get
* them. */
if (tmode != TMODE_RAW && (crv_status == CRV_SENT
|| u7_status == U7_SENT))
|| u7_status == U7_SENT
|| rbg_status == RBG_SENT))
(void)vpeekc_nomap();
check_for_codes_from_term();
}
@@ -3285,8 +3293,9 @@ stoptermcap()
if (!gui.in_use && !gui.starting)
# endif
{
/* May need to discard T_CRV or T_U7 response. */
if (crv_status == CRV_SENT || u7_status == U7_SENT)
/* May need to discard T_CRV, T_U7 or T_RBG response. */
if (crv_status == CRV_SENT || u7_status == U7_SENT
|| rbg_status == RBG_SENT)
{
# ifdef UNIX
/* Give the terminal a chance to respond. */
@@ -3398,6 +3407,36 @@ may_req_ambiguous_char_width()
}
# endif
#if defined(FEAT_TERMRESPONSE) || defined(PROTO)
/*
* Similar to requesting the version string: Request the terminal background
* color when it is the right moment.
*/
void
may_req_bg_color()
{
if (rbg_status == RBG_GET
&& cur_tmode == TMODE_RAW
&& termcap_active
&& p_ek
# ifdef UNIX
&& isatty(1)
&& isatty(read_cmd_fd)
# endif
&& *T_RBG != NUL
&& !option_was_set((char_u *)"bg"))
{
LOG_TR("Sending BG request");
out_str(T_RBG);
rbg_status = RBG_SENT;
/* check for the characters now, otherwise they might be eaten by
* get_keystroke() */
out_flush();
(void)vpeekc_nomap();
}
}
# endif
# ifdef DEBUG_TERMRESPONSE
static void
log_tr(char *msg)
@@ -4222,12 +4261,20 @@ check_termcode(max_offset, buf, bufsize, buflen)
* - Cursor position report: <Esc>[{row};{col}R
* The final byte must be 'R'. It is used for checking the
* ambiguous-width character state.
*
* - Background color response:
* <Esc>]11;rgb:{rrrr}/{gggg}/{bbbb}\007
* Or
* <Esc>]11;rgb:{rrrr}/{gggg}/{bbbb}ST
* The final byte must be '\007' or ST(0x9c or ESC\).
*/
p = tp[0] == CSI ? tp + 1 : tp + 2;
if ((*T_CRV != NUL || *T_U7 != NUL)
char_u *argp = tp[0] == CSI ? tp + 1 : tp + 2;
if ((*T_CRV != NUL || *T_U7 != NUL || *T_RBG != NUL)
&& ((tp[0] == ESC && tp[1] == '[' && len >= 3)
|| (tp[0] == ESC && tp[1] == ']' && len >= 24)
|| (tp[0] == CSI && len >= 2))
&& (VIM_ISDIGIT(*p) || *p == '>' || *p == '?'))
&& (VIM_ISDIGIT(*argp) || *argp == '>' || *argp == '?'))
{
#ifdef FEAT_MBYTE
int col;
@@ -4363,6 +4410,30 @@ check_termcode(max_offset, buf, bufsize, buflen)
key_name[1] = (int)KE_IGNORE;
slen = i + 1;
}
else if (*T_RBG != NUL
&& len >= 24 - (tp[0] == CSI)
&& len >= 24 - (tp[0] == CSI) + (argp[21] == ESC)
&& argp[0] == '1' && argp[1] == '1'
&& argp[2] == ';' && argp[3] == 'r' && argp[4] == 'g'
&& argp[5] == 'b' && argp[6] == ':'
&& argp[11] == '/' && argp[16] == '/'
&& (argp[21] == '\007' || argp[21] == STERM
|| (argp[21] == ESC && argp[22] == '\\')))
{
LOG_TR("Received RBG");
rbg_status = RBG_GOT;
if (!option_was_set((char_u *)"bg"))
{
set_option_value((char_u *)"bg", 0L, (char_u *)(
(3 * '6' < argp[7] + argp[12] + argp[17])
? "light" : "dark"), 0);
reset_option_was_set((char_u *)"bg");
redraw_asap(CLEAR);
}
key_name[0] = (int)KS_EXTRA;
key_name[1] = (int)KE_IGNORE;
slen = 24 - (tp[0] == CSI) + (argp[21] == ESC);
}
}
/* Check for '<Esc>P1+r<hex bytes><Esc>\'. A "0" instead of the
+2
View File
@@ -79,6 +79,7 @@ enum SpecialKey
KS_CWP, /* set window position in pixels */
KS_CWS, /* set window size in characters */
KS_CRV, /* request version string */
KS_RBG, /* request background color */
KS_CSI, /* start insert mode (bar cursor) */
KS_CEI, /* end insert mode (block cursor) */
KS_CSR, /* start replace mode (underline cursor) */
@@ -162,6 +163,7 @@ extern char_u *(term_strings[]); /* current terminal strings */
#define T_CEI (term_str(KS_CEI)) /* end insert mode */
#define T_CSR (term_str(KS_CSR)) /* start replace mode */
#define T_CRV (term_str(KS_CRV)) /* request version string */
#define T_RBG (term_str(KS_RBG)) /* request background RGB */
#define T_OP (term_str(KS_OP)) /* original color pair */
#define T_U7 (term_str(KS_U7)) /* request cursor position */
+8
View File
@@ -45,6 +45,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
test_command_count.out \
test_erasebackword.out \
test_eval.out \
test_increment.out \
test_insertcount.out \
test_listchars.out \
test_listlbr.out \
@@ -53,7 +54,10 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
test_marks.out \
test_nested_function.out \
test_options.out \
test_perl.out \
test_qf_title.out \
test_ruby.out \
test_set.out \
test_signs.out \
test_textobjects.out \
test_utf8.out
@@ -189,6 +193,7 @@ test_close_count.out: test_close_count.in
test_command_count.out: test_command_count.in
test_erasebackword.out: test_erasebackword.in
test_eval.out: test_eval.in
test_increment.out: test_increment.in
test_insertcount.out: test_insertcount.in
test_listchars.out: test_listchars.in
test_listlbr.out: test_listlbr.in
@@ -197,7 +202,10 @@ test_mapping.out: test_mapping.in
test_marks.out: test_marks.in
test_nested_function.out: test_nested_function.in
test_options.out: test_options.in
test_perl.out: test_perl.in
test_qf_title.out: test_qf_title.in
test_ruby.out: test_ruby.in
test_set.out: test_set.in
test_signs.out: test_signs.in
test_textobjects.out: test_textobjects.in
test_utf8.out: test_utf8.in
+4
View File
@@ -44,6 +44,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
test_command_count.out \
test_erasebackword.out \
test_eval.out \
test_increment.out \
test_insertcount.out \
test_listchars.out \
test_listlbr.out \
@@ -52,7 +53,10 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
test_marks.out \
test_nested_function.out \
test_options.out \
test_perl.out \
test_qf_title.out \
test_ruby.out \
test_set.out \
test_signs.out \
test_textobjects.out \
test_utf8.out
+4
View File
@@ -66,6 +66,7 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
test_command_count.out \
test_erasebackword.out \
test_eval.out \
test_increment.out \
test_insertcount.out \
test_listchars.out \
test_listlbr.out \
@@ -74,7 +75,10 @@ SCRIPTS = test3.out test4.out test5.out test6.out test7.out \
test_marks.out \
test_nested_function.out \
test_options.out \
test_perl.out \
test_qf_title.out \
test_ruby.out \
test_set.out \
test_signs.out \
test_textobjects.out \
test_utf8.out
+4
View File
@@ -46,6 +46,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
test_command_count.out \
test_erasebackword.out \
test_eval.out \
test_increment.out \
test_insertcount.out \
test_listchars.out \
test_listlbr.out \
@@ -54,7 +55,10 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \
test_marks.out \
test_nested_function.out \
test_options.out \
test_perl.out \
test_qf_title.out \
test_ruby.out \
test_set.out \
test_signs.out \
test_textobjects.out \
test_utf8.out
+5 -1
View File
@@ -4,7 +4,7 @@
# Authors: Zoltan Arpadffy, <arpadffy@polarhome.com>
# Sandor Kopanyi, <sandor.kopanyi@mailbox.hu>
#
# Last change: 2015 Apr 21
# Last change: 2015 Jun 19
#
# 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.
@@ -105,6 +105,7 @@ SCRIPT = test1.out test2.out test3.out test4.out test5.out \
test_command_count.out \
test_erasebackword.out \
test_eval.out \
test_increment.out \
test_insertcount.out \
test_listchars.out \
test_listlbr.out \
@@ -113,7 +114,10 @@ SCRIPT = test1.out test2.out test3.out test4.out test5.out \
test_marks.out \
test_nested_function.out \
test_options.out \
test_perl.out \
test_qf_title.out \
test_ruby.out \
test_set.out \
test_signs.out \
test_textobjects.out \
test_utf8.out
+4
View File
@@ -42,6 +42,7 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
test_command_count.out \
test_erasebackword.out \
test_eval.out \
test_increment.out \
test_insertcount.out \
test_listchars.out \
test_listlbr.out \
@@ -50,7 +51,10 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \
test_marks.out \
test_nested_function.out \
test_options.out \
test_perl.out \
test_qf_title.out \
test_ruby.out \
test_set.out \
test_signs.out \
test_textobjects.out \
test_utf8.out
+6
View File
@@ -48,6 +48,12 @@ otestje3
:au BufWipeout Xtestje1 buf Xtestje1
:bwipe
:w >>test.out
:only
:help
:wincmd w
:1quit
:$put ='Final line'
:$w >>test.out
:qa!
ENDTEST
+1
View File
@@ -28,3 +28,4 @@ testje1
contents
contents
end of testfile
Final line
+33 -2
View File
@@ -1,5 +1,7 @@
Tests for vertical splits and filler lines in diff mode
Also tests restoration of saved options by :diffoff.
STARTTEST
:so small.vim
:" Disable the title to avoid xterm keeping the wrong one.
@@ -10,8 +12,15 @@ pkdd:w! Xtest
ddGpkkrXoxxx:w! Xtest2
:file Nop
ggoyyyjjjozzzz
:set foldmethod=marker foldcolumn=4
:redir => nodiffsettings
:silent! :set diff? fdm? fdc? scb? crb? wrap?
:redir END
:vert diffsplit Xtest
:vert diffsplit Xtest2
:redir => diffsettings
:silent! :set diff? fdm? fdc? scb? crb? wrap?
:redir END
:" jump to second window for a moment to have filler line appear at start of
:" first window
ggpgg:let one = winline()
@@ -36,8 +45,30 @@ j:let three = three . "-" . winline()
:call append("$", two)
:call append("$", three)
:$-2,$w! test.out
:" Test that diffing shows correct filler lines
:"
:" Test diffoff
:diffoff!
:$put =nodiffsettings
:$put =diffsettings
1
:redir => nd1
:silent! :set diff? fdm? fdc? scb? crb? wrap?
:redir END

:redir => nd2
:silent! :set diff? fdm? fdc? scb? crb? wrap?
:redir END

:redir => nd3
:silent! :set diff? fdm? fdc? scb? crb? wrap?
:redir END

:$put =nd1
:$put =nd2
:$put =nd3
:$-39,$w >> test.out
:"
:" Test that diffing shows correct filler lines
:windo :bw!
:enew
:put =range(4,10)
@@ -51,7 +82,7 @@ j:let three = three . "-" . winline()
:enew
:put =w0
:.w >> test.out
:unlet! one two three w0
:unlet! one two three nodiffsettings diffsettings nd1 nd2 nd3 w0
:qa!
ENDTEST
+40
View File
@@ -1,4 +1,44 @@
2-4-5-6-8-9
1-2-4-5-8
2-3-4-5-6-7-8
nodiff
foldmethod=marker
foldcolumn=4
noscrollbind
nocursorbind
wrap
diff
foldmethod=diff
foldcolumn=2
scrollbind
cursorbind
nowrap
nodiff
foldmethod=marker
foldcolumn=4
noscrollbind
nocursorbind
wrap
nodiff
foldmethod=marker
foldcolumn=4
noscrollbind
nocursorbind
wrap
nodiff
foldmethod=marker
foldcolumn=4
noscrollbind
nocursorbind
wrap
1
+11
View File
@@ -442,6 +442,17 @@ let l = [0, 1, 2, 3]
:unlockvar 1 b:
:unlet! b:testvar
:"
:$put ='No :let += of locked list variable:'
:let l = ['a', 'b', 3]
:lockvar 1 l
:try
: let l += ['x']
: $put ='did :let +='
:catch
: $put =v:exception[:14]
:endtry
:$put =string(l)
:"
:unlet l
:let l = [1, 2, 3, 4]
:lockvar! l
+3
View File
@@ -144,6 +144,9 @@ No extend() of write-protected scope-level variable:
Vim(put):E742:
No :unlet of variable in locked scope:
Vim(unlet):E741:
No :let += of locked list variable:
Vim(let):E741:
['a', 'b', 3]
[1, 2, 3, 4]
[1, 2, 3, 4]
[1, 2, 3, 4]

Some files were not shown because too many files have changed in this diff Show More