Merge remote-tracking branch 'vim/master'

This commit is contained in:
Kazuki Sakamoto
2017-06-07 20:55:24 -07:00
86 changed files with 1807 additions and 1186 deletions
+20 -20
View File
@@ -10,11 +10,11 @@ Arabic Language support (options & mappings) for Vim *Arabic*
*E800*
In order to use right-to-left and Arabic mapping support, it is
necessary to compile VIM with the |+arabic| feature.
necessary to compile Vim with the |+arabic| feature.
These functions have been created by Nadim Shaikli <nadim-at-arabeyes.org>
It is best to view this file with these settings within VIM's GUI: >
It is best to view this file with these settings within Vim's GUI: >
:set encoding=utf-8
:set arabicshape
@@ -42,7 +42,7 @@ the user interface remains the standard Vi interface.
Highlights
----------
o Editing left-to-right files as in the original VIM hasn't changed.
o Editing left-to-right files as in the original Vim hasn't changed.
o Viewing and editing files in right-to-left windows. File
orientation is per window, so it is possible to view the same
@@ -52,7 +52,7 @@ o No special terminal with right-to-left capabilities is required.
The right-to-left changes are completely hardware independent.
Only Arabic fonts are necessary.
o Compatible with the original VIM. Almost all features work in
o Compatible with the original Vim. Almost all features work in
right-to-left mode (there are liable to be bugs).
o Changing keyboard mapping and reverse insert modes using a single
@@ -66,14 +66,14 @@ o While in Arabic mode, numbers are entered from left to right. Upon
o Arabic keymapping on the command line in reverse insert mode.
o Proper Bidirectional functionality is possible given VIM is
o Proper Bidirectional functionality is possible given Vim is
started within a Bidi capable terminal emulator.
Arabic Fonts *arabicfonts*
------------
VIM requires monospaced fonts of which there are many out there.
Vim requires monospaced fonts of which there are many out there.
Arabic requires ISO-8859-6 as well as Presentation Form-B fonts
(without Form-B, Arabic will _NOT_ be usable). It is highly
recommended that users search for so-called 'ISO-10646-1' fonts.
@@ -96,13 +96,13 @@ o Installation of fonts for X Window systems (Unix/Linux)
Usage
-----
Prior to the actual usage of Arabic within VIM, a number of settings
Prior to the actual usage of Arabic within Vim, a number of settings
need to be accounted for and invoked.
o Setting the Arabic fonts
+ For VIM GUI set the 'guifont' to your_ARABIC_FONT. This is done
by entering the following command in the VIM window.
+ For Vim GUI set the 'guifont' to your_ARABIC_FONT. This is done
by entering the following command in the Vim window.
>
:set guifont=your_ARABIC_FONT
<
@@ -115,7 +115,7 @@ o Setting the Arabic fonts
you can include ':set guifont=your_ARABIC_FONT' to your .vimrc
file.
+ Under the X Window environment, you can also start VIM with
+ Under the X Window environment, you can also start Vim with
'-fn your_ARABIC_FONT' option.
o Setting the appropriate character Encoding
@@ -124,7 +124,7 @@ o Setting the appropriate character Encoding
>
:set encoding=utf-8
<
to your .vimrc file (entering the command manually into you VIM
to your .vimrc file (entering the command manually into you Vim
window is highly discouraged). In short, include ':set
encoding=utf-8' to your .vimrc file.
@@ -137,11 +137,11 @@ o Setting the appropriate character Encoding
o Enable Arabic settings [short-cut]
In order to simplify and streamline things, you can either invoke
VIM with the command-line option,
Vim with the command-line option,
% vim -A my_utf8_arabic_file ...
or enable 'arabic' via the following command within VIM
or enable 'arabic' via the following command within Vim
>
:set arabic
<
@@ -189,7 +189,7 @@ o Enable Arabic settings [short-cut]
>
:set keymap=arabic
<
in your VIM window. You can also append the 'keymap' set command to
in your Vim window. You can also append the 'keymap' set command to
your .vimrc file. In other words, you can include ':set keymap=arabic'
to your .vimrc file.
@@ -202,7 +202,7 @@ o Enable Arabic settings [short-cut]
+ Arabic deletion of a combined pair character
By default VIM has the 'delcombine' option disabled. This option
By default Vim has the 'delcombine' option disabled. This option
allows the deletion of ALEF in a LAM_ALEF (LAA) combined character
and still retain the LAM (i.e. it reverts to treating the combined
character as its natural two characters form -- this also pertains
@@ -211,13 +211,13 @@ o Enable Arabic settings [short-cut]
>
:set delcombine
<
in our VIM window. You can also append the 'delcombine' set command
in our Vim window. You can also append the 'delcombine' set command
to your .vimrc file. In other words, you can include ':set delcombine'
to your .vimrc file.
+ Arabic right-to-left Mode
By default VIM starts in Left-to-right mode. 'rightleft' is the
By default Vim starts in Left-to-right mode. 'rightleft' is the
command that allows one to alter a window's orientation - that can
be accomplished via,
@@ -253,7 +253,7 @@ o Enable Arabic settings [short-cut]
>
:set arabicshape
<
in our VIM window. You can also append the 'arabicshape' set
in our Vim window. You can also append the 'arabicshape' set
command to your .vimrc file. In other words, you can include
':set arabicshape' to your .vimrc file.
@@ -261,7 +261,7 @@ o Enable Arabic settings [short-cut]
Keymap/Keyboard *arabickeymap*
---------------
The character/letter encoding used in VIM is the standard UTF-8.
The character/letter encoding used in Vim is the standard UTF-8.
It is widely discouraged that any other encoding be used or even
attempted.
@@ -294,7 +294,7 @@ o Keyboard
Restrictions
------------
o VIM in its GUI form does not currently support Bi-directionality
o Vim in its GUI form does not currently support Bi-directionality
(i.e. the ability to see both Arabic and Latin intermixed within
the same line).
+1 -1
View File
@@ -610,7 +610,7 @@ FileChangedShell When Vim notices that the modification time of
|timestamp|
Mostly triggered after executing a shell
command, but also with a |:checktime| command
or when Gvim regains input focus.
or when gvim regains input focus.
This autocommand is triggered for each changed
file. It is not used when 'autoread' is set
and the buffer was not changed. If a
+2 -7
View File
@@ -1,4 +1,4 @@
*eval.txt* For Vim version 8.0. Last change: 2017 Apr 29
*eval.txt* For Vim version 8.0. Last change: 2017 Jun 04
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -3373,6 +3373,7 @@ did_filetype() Returns |TRUE| when autocommands are being executed and the
FileType event has been triggered at least once. Can be used
to avoid triggering the FileType event again in the scripts
that detect the file type. |FileType|
Returns |FALSE| when `:setf FALLBACK` was used.
When editing another file, the counter is reset, thus this
really checks if the FileType event has been triggered for the
current buffer. This allows an autocommand that starts
@@ -10696,12 +10697,6 @@ When the |+eval| feature is available the command is skipped because of the
"while 0". Without the |+eval| feature the "while 0" is an error, which is
silently ignored, and the command is executed.
The "<CR>" here is a real CR character, type CTRL-V Enter to get it.
When the |+eval| feature is available the ":" is remapped to add a double
quote, which has the effect of commenting-out the command. Without the
|+eval| feature the nnoremap command is skipped and the command is executed.
==============================================================================
11. The sandbox *eval-sandbox* *sandbox* *E48*
+1 -1
View File
@@ -116,7 +116,7 @@ NOTE: "gnat xref -v" is very tricky to use as it has almost no diagnostic
then "gnat xref -v *.ad?"
4) Project manager support is completely broken - don't even try "gnat xref
-Padacl.gpr".
5) VIM is faster when the tags file is sorted - use "sort --unique
5) Vim is faster when the tags file is sorted - use "sort --unique
--ignore-case --output=tags tags" .
6) Remember to insert "!_TAG_FILE_SORTED 2 %sort ui" as first line to mark
the file assorted.
+8 -8
View File
@@ -6,7 +6,7 @@
Introduction *hangul*
------------
It is to input hangul, the Korean language, with VIM GUI version.
It is to input hangul, the Korean language, with Vim GUI version.
If you have a XIM program, you can use another |+xim| feature.
Basically, it is for anybody who has no XIM program.
@@ -31,7 +31,7 @@ You should set LANG variable to Korean locale such as ko, ko_KR.eucKR
or ko_KR.UTF-8.
If you set LC_ALL variable, it should be set to Korean locale also.
VIM resource
Vim resource
------------
You may want to set 'encoding' and 'fileencodings'.
Next are examples: >
@@ -53,12 +53,12 @@ If both are set, VIM_KEYBOARD has higher priority.
Hangul Fonts
------------
If you use GTK version of GVIM, you should set 'guifont' and 'guifontwide'.
If you use GTK version of gvim, you should set 'guifont' and 'guifontwide'.
For example: >
set guifont=Courier\ 12
set guifontwide=NanumGothicCoding\ 12
If you use Motif or Athena version of GVIM, you should set 'guifontset' in
If you use Motif or Athena version of gvim, you should set 'guifontset' in
your vimrc. You can set fontset in the .Xdefaults file.
$HOME/.gvimrc: >
@@ -77,11 +77,11 @@ $HOME/.Xdefaults: >
attention! the , (comma) or ; (semicolon)
And there should be no ':set guifont'. If it exists, then Gvim ignores
':set guifontset'. It means VIM runs without fontset supporting.
And there should be no ':set guifont'. If it exists, then gvim ignores
':set guifontset'. It means Vim runs without fontset supporting.
So, you can see only English. Hangul does not be correctly displayed.
After "fontset" feature is enabled, VIM does not allow using english
After "fontset" feature is enabled, Vim does not allow using english
font only in "font" setting for syntax.
For example, if you use >
:set guifontset=eng_font,your_font
@@ -99,7 +99,7 @@ We don't support Johab font.
We don't support Hanja input.
And We don't have any plan to support them.
If you really need such features, you can use console version of VIM with a
If you really need such features, you can use console version of Vim with a
capable terminal emulator.
Bug or Comment
+1 -1
View File
@@ -31,7 +31,7 @@ Get specific help: It is possible to go directly to whatever you want help
help entries for "word".
Or use ":helpgrep word". |:helpgrep|
VIM stands for Vi IMproved. Most of VIM was made by Bram Moolenaar, but only
Vim stands for Vi IMproved. Most of Vim was made by Bram Moolenaar, but only
through the help of many others. See |credits|.
------------------------------------------------------------------------------
*doc-file-list* *Q_ct*
+2 -2
View File
@@ -41,9 +41,9 @@ instance), code similar to the following should be used:
$vim = new Win32::OLE 'Vim.Application';
[C#] >
// Add a reference to VIM in your project.
// Add a reference to Vim in your project.
// Choose the COM tab.
// Select "VIM Ole Interface 1.1 Type Library"
// Select "Vim Ole Interface 1.1 Type Library"
Vim.Vim vimobj = new Vim.Vim();
Vim does not support acting as a "hidden" OLE server, like some other OLE
+2 -2
View File
@@ -7,7 +7,7 @@
Perl and Vim *perl* *Perl*
1. Editing Perl files |perl-editing|
2. Compiling VIM with Perl interface |perl-compiling|
2. Compiling Vim with Perl interface |perl-compiling|
3. Using the Perl interface |perl-using|
4. Dynamic loading |perl-dynamic|
@@ -33,7 +33,7 @@ Vim in the $VIMRUNTIME/tools directory. This script has currently more
features than Exuberant ctags' Perl support.
==============================================================================
2. Compiling VIM with Perl interface *perl-compiling*
2. Compiling Vim with Perl interface *perl-compiling*
To compile Vim with Perl interface, you need Perl 5.004 (or later). Perl must
be installed before you compile Vim. Vim's Perl interface does NOT work with
+7 -7
View File
@@ -1,4 +1,4 @@
*insert.txt* For Vim version 8.0. Last change: 2017 Apr 07
*insert.txt* For Vim version 8.0. Last change: 2017 May 30
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -634,13 +634,13 @@ Completion can be done for:
10. User defined completion |i_CTRL-X_CTRL-U|
11. omni completion |i_CTRL-X_CTRL-O|
12. Spelling suggestions |i_CTRL-X_s|
13. keywords in 'complete' |i_CTRL-N|
13. keywords in 'complete' |i_CTRL-N| |i_CTRL-P|
All these (except 2) are done in CTRL-X mode. This is a sub-mode of Insert
and Replace modes. You enter CTRL-X mode by typing CTRL-X and one of the
CTRL-X commands. You exit CTRL-X mode by typing a key that is not a valid
CTRL-X mode command. Valid keys are the CTRL-X command itself, CTRL-N (next),
and CTRL-P (previous).
All these, except CTRL-N and CTRL-P, are done in CTRL-X mode. This is a
sub-mode of Insert and Replace modes. You enter CTRL-X mode by typing CTRL-X
and one of the CTRL-X commands. You exit CTRL-X mode by typing a key that is
not a valid CTRL-X mode command. Valid keys are the CTRL-X command itself,
CTRL-N (next), and CTRL-P (previous).
Also see the 'infercase' option if you want to adjust the case of the match.
+2 -2
View File
@@ -84,8 +84,8 @@ The Vim pages contain the most recent information about Vim. They also
contain links to the most recent version of Vim. The FAQ is a list of
Frequently Asked Questions. Read this if you have problems.
VIM home page: http://www.vim.org/
VIM FAQ: http://vimdoc.sf.net/
Vim home page: http://www.vim.org/
Vim FAQ: http://vimdoc.sf.net/
Downloading: ftp://ftp.vim.org/pub/vim/MIRRORS
+3 -3
View File
@@ -1,4 +1,4 @@
*map.txt* For Vim version 8.0. Last change: 2017 Mar 10
*map.txt* For Vim version 8.0. Last change: 2017 May 30
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -185,7 +185,7 @@ that starts with ",". Then you need to type another character for Vim to know
whether to use the "," mapping or the longer one. To avoid this add the
<nowait> argument. Then the mapping will be used when it matches, Vim does
not wait for more characters to be typed. However, if the characters were
already type they are used.
already typed they are used.
*:map-<silent>* *:map-silent*
To define a mapping which will not be echoed on the command line, add
@@ -798,7 +798,7 @@ Bear in mind that convert-meta has been reported to have troubles when used in
UTF-8 locales. On terminals like xterm, the "metaSendsEscape" resource can be
toggled on the fly through the "Main Options" menu, by pressing Ctrl-LeftClick
on the terminal; that's a good last resource in case you want to send ESC when
using other applications but not when inside VIM.
using other applications but not when inside Vim.
1.11 MAPPING AN OPERATOR *:map-operator*
+2 -2
View File
@@ -120,7 +120,7 @@ In case you do not want the NetBeans interface you can disable it by
uncommenting a line with "--disable-netbeans" in the Makefile.
Currently the NetBeans interface is supported by Vim running in a terminal and
by GVim when it is run with one of the following GUIs: GTK, GNOME, Windows,
by gvim when it is run with one of the following GUIs: GTK, GNOME, Windows,
Athena and Motif.
If Motif support is required the user must supply XPM libraries. See
@@ -996,7 +996,7 @@ to "Vim". In the Expert tab make sure the "Vim Command" is correct.
You should be careful if you change the "Vim Command". There are command
line options there which must be there for the connection to be properly
set up. You can change the command name but that's about it. If your gvim
can be found by your $PATH then the VIM Command can start with "gvim". If
can be found by your $PATH then the Vim Command can start with "gvim". If
you don't want gvim searched from your $PATH then hard code in the full
Unix path name. At this point you should get a gvim for any source file
you open in NetBeans.
+17 -3
View File
@@ -1,4 +1,4 @@
*options.txt* For Vim version 8.0. Last change: 2017 Mar 22
*options.txt* For Vim version 8.0. Last change: 2017 Jun 04
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -370,7 +370,7 @@ Note: In the future more global options can be made global-local. Using
Setting the filetype
:setf[iletype] {filetype} *:setf* *:setfiletype*
:setf[iletype] [FALLBACK] {filetype} *:setf* *:setfiletype*
Set the 'filetype' option to {filetype}, but only if
not done yet in a sequence of (nested) autocommands.
This is short for: >
@@ -380,6 +380,13 @@ Setting the filetype
< This command is used in a filetype.vim file to avoid
setting the 'filetype' option twice, causing different
settings and syntax files to be loaded.
When the optional FALLBACK argument is present, a
later :setfiletype command will override the
'filetype'. This is to used for filetype detections
that are just a guess. |did_filetype()| will return
false after this command.
{not in Vi}
*option-window* *optwin*
@@ -867,6 +874,12 @@ A jump table for the options with a short description can be found at |Q_op|.
< Vim will guess the value. In the GUI this should work correctly,
in other cases Vim might not be able to guess the right value.
When the t_BG option is set, Vim will use it to request the background
color from the terminal. If the returned RGB value is dark/light and
'background' is not dark/light, 'background' will be set and the
screen is redrawn. This may have side effects, make t_BG empty in
your .vimrc if you suspect this problem.
When starting the GUI, the default value for 'background' will be
"light". When the value is not set in the .gvimrc, and Vim detects
that the background is actually quite dark, 'background' is set to
@@ -2723,7 +2736,7 @@ A jump table for the options with a short description can be found at |Q_op|.
Makes the 'g' and 'c' flags of the ":substitute" command to be
toggled each time the flag is given. See |complex-change|. See
also 'gdefault' option.
Switching this option on is discouraged!
Switching this option on may break plugins!
*'emoji'* *'emo'* *'noemoji'* *'noemo'*
'emoji' 'emo' boolean (default: on)
@@ -7925,6 +7938,7 @@ A jump table for the options with a short description can be found at |Q_op|.
compatible terminal.
If setting this option does not work (produces a colorless UI)
reading |xterm-true-color| might help.
Note that the "cterm" attributes are still used, not the "gui" ones.
NOTE: This option is reset when 'compatible' is set.
*'terse'* *'noterse'*
+1 -1
View File
@@ -144,7 +144,7 @@ The default value for $VIM is set at compile time and can be determined with >
:version
The normal value is /boot/home/config/share/vim. If you don't like it you can
set the VIM environment variable to override this, or set 'helpfile' in your
set the Vim environment variable to override this, or set 'helpfile' in your
.vimrc: >
:if version >= 500
+5 -5
View File
@@ -539,7 +539,7 @@ More info under :help hardcopy
8.10 Setting up the symbols
When I use GVIM this way and press CTRL-Y in the parent terminal, gvim exits.
When I use gvim this way and press CTRL-Y in the parent terminal, gvim exits.
I now use a different symbol that seems to work OK and fixes the problem.
I suggest this instead: >
@@ -547,7 +547,7 @@ I suggest this instead: >
The /INPUT=NLA0: separates the standard input of the gvim process from the
parent terminal, to block signals from the parent window.
Without the -GEOMETRY, the GVIM window size will be minimal and the menu
Without the -GEOMETRY, the gvim window size will be minimal and the menu
will be confused after a window-resize.
(Carlo Mekenkamp, Coen Engelbarts, Vim 6.0ac)
@@ -764,14 +764,14 @@ GNU_TOOLS.ZIP package downloadable from http://www.polarhome.com/vim/
9. VMS related changes *vms-changes*
Version 7.4
- Undo: VMS can not handle more than one dot in the filenames use "dir/name" -> "dir/_un_name"
Version 7.4
- Undo: VMS can not handle more than one dot in the filenames use "dir/name" -> "dir/_un_name"
add _un_ at the beginning to keep the extension
- correct swap file name wildcard handling
- handle iconv usage correctly
- do not optimize on vax - otherwise it hangs compiling crypto files
- fileio.c fix the comment
- correct RealWaitForChar
- correct RealWaitForChar
- after 7.4-119 use different functions lib$cvtf_to_internal_time because Alpha and VAX have
G_FLOAT but IA64 uses IEEE float otherwise Vim crashes
- guard against crashes that are caused by mixed filenames
+1 -1
View File
@@ -135,7 +135,7 @@ you will need to get a version older than that.
6. Running under Windows 3.1 *win32-win3.1*
*win32s* *windows-3.1* *gui-w32s*
There was a special version of Gvim that runs under Windows 3.1 and 3.11.
There was a special version of gvim that runs under Windows 3.1 and 3.11.
Support was removed in patch 7.4.1363.
==============================================================================
+2 -2
View File
@@ -9,7 +9,7 @@ Copyright: (c) 2004-2012 by Charles E. Campbell *glvs-copyright*
The VIM LICENSE (see |copyright|) applies to the files in this
package, including getscriptPlugin.vim, getscript.vim,
GetLatestVimScripts.dist, and pi_getscript.txt, except use "getscript"
instead of "VIM". Like anything else that's free, getscript and its
instead of "Vim". Like anything else that's free, getscript and its
associated files are provided *as is* and comes with no warranty of
any kind, either expressed or implied. No guarantees of
merchantability. No guarantees of suitability for any purpose. By
@@ -68,7 +68,7 @@ Your computer needs to have wget or curl for GetLatestVimScripts to do its work.
mv GetLatestVimScripts.dist GetLatestVimScripts.dat
(edit GetLatestVimScripts.dat to install your own personal
list of desired plugins -- see |GetLatestVimScripts_dat|)
3. Windows:
vim getscript.vba
:so %
+32 -32
View File
@@ -99,25 +99,25 @@ If the option is empty, then vim will use the system default printer for
HPUX: hp-roman8,
EBCDIC: ebcdic-uk)
global
Sets the character encoding used when printing. This option tells VIM which
Sets the character encoding used when printing. This option tells Vim which
print character encoding file from the "print" directory in 'runtimepath' to
use.
This option will accept any value from |encoding-names|. Any recognized names
are converted to VIM standard names - see 'encoding' for more details. Names
not recognized by VIM will just be converted to lower case and underscores
are converted to Vim standard names - see 'encoding' for more details. Names
not recognized by Vim will just be converted to lower case and underscores
replaced with '-' signs.
If 'printencoding' is empty or VIM cannot find the file then it will use
'encoding' (if VIM is compiled with |+multi_byte| and it is set an 8-bit
encoding) to find the print character encoding file. If VIM is unable to find
If 'printencoding' is empty or Vim cannot find the file then it will use
'encoding' (if Vim is compiled with |+multi_byte| and it is set an 8-bit
encoding) to find the print character encoding file. If Vim is unable to find
a character encoding file then it will use the "latin1" print character
encoding file.
When 'encoding' is set to a multi-byte encoding, VIM will try to convert
When 'encoding' is set to a multi-byte encoding, Vim will try to convert
characters to the printing encoding for printing (if 'printencoding' is empty
then the conversion will be to latin1). Conversion to a printing encoding
other than latin1 will require VIM to be compiled with the |+iconv| feature.
other than latin1 will require Vim to be compiled with the |+iconv| feature.
If no conversion is possible then printing will fail. Any characters that
cannot be converted will be replaced with upside down question marks.
@@ -203,7 +203,7 @@ header is used when this option is empty.
'printmbcharset' 'pmbcs' string (default "")
global
Sets the CJK character set to be used when generating CJK output from
|:hardcopy|. The following predefined values are currently recognised by VIM:
|:hardcopy|. The following predefined values are currently recognised by Vim:
Value Description ~
Chinese GB_2312-80
@@ -270,7 +270,7 @@ Japanese text you would do the following; >
If 'printmbcharset' is not one of the above values then it is assumed to
specify a custom multi-byte character set and no check will be made that it is
compatible with the value for 'printencoding'. VIM will look for a file
compatible with the value for 'printencoding'. Vim will look for a file
defining the character set in the "print" directory in 'runtimepath'.
*pmbfn-option*
@@ -420,10 +420,10 @@ There are currently a number of limitations with PostScript printing:
possible to get all the characters in an encoding to print by installing a
new version of the Courier font family.
- Multi-byte support - Currently VIM will try to convert multi-byte characters
- Multi-byte support - Currently Vim will try to convert multi-byte characters
to the 8-bit encoding specified by 'printencoding' (or latin1 if it is
empty). Any characters that are not successfully converted are shown as
unknown characters. Printing will fail if VIM cannot convert the multi-byte
unknown characters. Printing will fail if Vim cannot convert the multi-byte
to the 8-bit encoding.
==============================================================================
@@ -434,11 +434,11 @@ you need to define your own PostScript font encoding vector. Details on how
to define a font encoding vector is beyond the scope of this help file, but
you can find details in the PostScript Language Reference Manual, 3rd Edition,
published by Addison-Wesley and available in PDF form at
http://www.adobe.com/. The following describes what you need to do for VIM to
http://www.adobe.com/. The following describes what you need to do for Vim to
locate and use your print character encoding.
i. Decide on a unique name for your encoding vector, one that does not clash
with any of the recognized or standard encoding names that VIM uses (see
with any of the recognized or standard encoding names that Vim uses (see
|encoding-names| for a list), and that no one else is likely to use.
ii. Copy $VIMRUNTIME/print/latin1.ps to the print subdirectory in your
'runtimepath' and rename it with your unique name.
@@ -446,23 +446,23 @@ iii. Edit your renamed copy of latin1.ps, replacing all occurrences of latin1
with your unique name (don't forget the line starting %%Title:), and
modify the array of glyph names to define your new encoding vector. The
array must have exactly 256 entries or you will not be able to print!
iv. Within VIM, set 'printencoding' to your unique encoding name and then
print your file. VIM will now use your custom print character encoding.
iv. Within Vim, set 'printencoding' to your unique encoding name and then
print your file. Vim will now use your custom print character encoding.
VIM will report an error with the resource file if you change the order or
Vim will report an error with the resource file if you change the order or
content of the first 3 lines, other than the name of the encoding on the line
starting %%Title: or the version number on the line starting %%Version:.
[Technical explanation for those that know PostScript - VIM looks for a file
[Technical explanation for those that know PostScript - Vim looks for a file
with the same name as the encoding it will use when printing. The file
defines a new PostScript Encoding resource called /VIM-name, where name is the
print character encoding VIM will use.]
print character encoding Vim will use.]
==============================================================================
5. PostScript CJK Printing *postscript-cjk-printing*
*E673* *E674* *E675*
VIM supports printing of Chinese, Japanese, and Korean files. Setting up VIM
Vim supports printing of Chinese, Japanese, and Korean files. Setting up Vim
to correctly print CJK files requires setting up a few more options.
Each of these countries has many standard character sets and encodings which
@@ -483,7 +483,7 @@ option allows you to specify different fonts to use when printing characters
which are syntax highlighted with the font styles normal, italic, bold and
bold-italic.
No CJK fonts are supplied with VIM. There are some free Korean, Japanese, and
No CJK fonts are supplied with Vim. There are some free Korean, Japanese, and
Traditional Chinese fonts available at:
http://examples.oreilly.com/cjkvinfo/adobe/samples/
@@ -498,7 +498,7 @@ CJK fonts can be large containing several thousand glyphs, and it is not
uncommon to find that they only contain a subset of a national standard. It
is not unusual to find the fonts to not include characters for codes in the
ASCII code range. If you find half-width Roman characters are not appearing
in your printout then you should configure VIM to use the Courier font the
in your printout then you should configure Vim to use the Courier font the
half-width ASCII characters with 'printmbfont'. If your font does not include
other characters then you will need to find another font that does.
@@ -506,7 +506,7 @@ Another issue with ASCII characters, is that the various national character
sets specify a couple of different glyphs in the ASCII code range. If you
print ASCII text using the national character set you may see some unexpected
characters. If you want true ASCII code printing then you need to configure
VIM to output ASCII characters for the ASCII code range with 'printmbfont'.
Vim to output ASCII characters for the ASCII code range with 'printmbfont'.
It is possible to define your own multi-byte character set although this
should not be attempted lightly. A discussion on the process if beyond the
@@ -525,13 +525,13 @@ print job completing.
There are a number of possible causes as to why the printing may have failed:
- Wrong version of the prolog resource file. The prolog resource file
contains some PostScript that VIM needs to be able to print. Each version
of VIM needs one particular version. Make sure you have correctly installed
contains some PostScript that Vim needs to be able to print. Each version
of Vim needs one particular version. Make sure you have correctly installed
the runtime files, and don't have any old versions of a file called prolog
in the print directory in your 'runtimepath' directory.
- Paper size. Some PostScript printers will abort printing a file if they do
not support the requested paper size. By default VIM uses A4 paper. Find
not support the requested paper size. By default Vim uses A4 paper. Find
out what size paper your printer normally uses and set the appropriate paper
size with 'printoptions'. If you cannot find the name of the paper used,
measure a sheet and compare it with the table of supported paper sizes listed
@@ -668,7 +668,7 @@ complex print document creation.
N-UP PRINTING
The psnup utility takes an existing PostScript file generated from VIM and
The psnup utility takes an existing PostScript file generated from Vim and
convert it to an n-up version. The simplest way to create a 2-up printout is
to first create a PostScript file with: >
@@ -724,16 +724,16 @@ There are a couple of points to bear in mind:
==============================================================================
8. Formfeed Characters *printing-formfeed*
By default VIM does not do any special processing of |formfeed| control
characters. Setting the 'printoptions' formfeed item will make VIM recognize
By default Vim does not do any special processing of |formfeed| control
characters. Setting the 'printoptions' formfeed item will make Vim recognize
formfeed characters and continue printing the current line at the beginning
of the first line on a new page. The use of formfeed characters provides
rudimentary print control but there are certain things to be aware of.
VIM will always start printing a line (including a line number if enabled)
Vim will always start printing a line (including a line number if enabled)
containing a formfeed character, even if it is the first character on the
line. This means if a line starting with a formfeed character is the first
line of a page then VIM will print a blank page.
line of a page then Vim will print a blank page.
Since the line number is printed at the start of printing the line containing
the formfeed character, the remainder of the line printed on the new page
@@ -742,7 +742,7 @@ lines of a long line when wrap in 'printoptions' is enabled).
If the formfeed character is the last character on a line, then printing will
continue on the second line of the new page, not the first. This is due to
VIM processing the end of the line after the formfeed character and moving
Vim processing the end of the line after the formfeed character and moving
down a line to continue printing.
Due to the points made above it is recommended that when formfeed character
+57 -57
View File
@@ -63,53 +63,53 @@ versions of 'emacs' in the late 1970's and was relieved by finding 'vi' in the
first UNIX I came across in 1983). In my opinion, it's about time 'VIM'
replace 'emacs' as the standard for top editors. (Bo Thide', Sweden)
I love and use VIM heavily too. (Larry Wall)
I love and use Vim heavily too. (Larry Wall)
Vi is like a Ferrari, if you're a beginner, it handles like a bitch, but once
you get the hang of it, it's small, powerful and FAST! (Unknown)
VIM is like a new model Ferrari, and sounds like one too - "VIIIIIIMMM!"
Vim is like a new model Ferrari, and sounds like one too - "VIIIIIIMMM!"
(Stephen Riehm, Germany)
Schon bei Nutzung eines Bruchteils der VIM-Funktionen wird der Benutzer recht
Schon bei Nutzung eines Bruchteils der Vim-Funktionen wird der Benutzer recht
schnell die Vorzuege dieses Editors kennen- und schaetzenlernen.
Translated: Even when only using a fraction of VIM-functions, the user will
Translated: Even when only using a fraction of Vim-functions, the user will
quickly get used to and appreciate the advantages of this editor. (Garry
Glendown, conclusion of an article on VIM in iX magazine 9/1998)
Glendown, conclusion of an article on Vim in iX magazine 9/1998)
I've recently acquired the O'Reilly book on VI (it also discusses VIM
I've recently acquired the O'Reilly book on Vi (it also discusses Vim
in-depth), and I'm amazed at just how powerful this application is. (Jeffrey
Rankin)
This guide was written using the Windows 9.x distribution of GVIM, which is
This guide was written using the Windows 9.x distribution of gvim, which is
quite possibly the greatest thing to come along since God created the naked
girl. (Michael DiBernardo)
Boy, I thought I knew almost everything about VIM, but every time I browse the
online documentation, I hit upon a minor but cool aspect of a VIM feature that
Boy, I thought I knew almost everything about Vim, but every time I browse the
online documentation, I hit upon a minor but cool aspect of a Vim feature that
I didn't know before! I must say the documentation is one the finest I've
ever seen in a product -- even better than most commercial products.
(Gautam Mudunuri)
VIM 4.5 is really a fantastic editor. It has sooooo many features and more
Vim 4.5 is really a fantastic editor. It has sooooo many features and more
importantly, the defaults are so well thought out that you really don't have
to change anything!! Words cannot express my amazement and gratitude to the
creators of VIM. Keep it up. (Vikas, USA)
creators of Vim. Keep it up. (Vikas, USA)
I wonder how long it will be before people will refer to other Vi editors as
VIM clones? (Darren Hiebert)
Vim clones? (Darren Hiebert)
I read about [auto-positioning-in-file-based-on-the-errors-from-make] in one
of those "Perfect Programmer's Editor" threads and was delighted to discover
that VIM already supports it. (Brendan Macmillan, Australia)
that Vim already supports it. (Brendan Macmillan, Australia)
I just discovered VIM (5.0) and I'm telling everyone I know about it!
I tell them VIM stands for VI for the new (M)illenium. Thanks so much!
I just discovered Vim (5.0) and I'm telling everyone I know about it!
I tell them Vim stands for Vi for the new (M)illenium. Thanks so much!
(Matt F. Valentine)
I think from now on "vi" should be called "Vim Imitation", not the other way
around. (Rungun Ramanathan)
The Law of VIM:
The Law of Vim:
For each member b of the possible behaviour space B of program P, there exists
a finite time t before which at least one user u in the total user space U of
program P will request b becomes a member of the allowed behaviour space B'
@@ -118,42 +118,42 @@ In other words: Sooner or later everyone wants everything as an option.
(Negri)
Whenever I move to a new computing platform, the first thing I do is to port
VIM. Lately, I am simply stunned by its ease of compilation using the
Vim. Lately, I am simply stunned by its ease of compilation using the
configure facility. (A.M. Sabuncu, Turkey)
The options are really excellent and very powerful. (Anish Maharaj)
The Spring user-interface designs are in, and word from the boutiques is that
80x24 text-only mode is back with a *vengeance! Vi editor clone VIM burst onto
80x24 text-only mode is back with a *vengeance! Vi editor clone Vim burst onto
March desk-tops with a dazzling show of pastel syntax highlights for its 5.0
look. Strident and customizable, VIM raises eyebrows with its interpretation
look. Strident and customizable, Vim raises eyebrows with its interpretation
of the classic Vi single-key macro collection.
http://www.ntk.net/index.cgi?back=archive98/now0327.txt&line=179#l
I just wanted to take this opportunity to let you know that VIM 5 ROCKS!
I just wanted to take this opportunity to let you know that Vim 5 ROCKS!
Syntax highlighting: how did I survive without it?! Thank you for creating
mankind's best editor! (Mun Johl, USA)
Thanks again for VIM. I use it every day on Linux. (Eric Foster-Johnson,
Thanks again for Vim. I use it every day on Linux. (Eric Foster-Johnson,
author of the book "UNIX Programming Tools")
The BEST EDITOR EVER (Stuart Woolford)
I have used most of VIM's fancy features at least once, many frequently, and I
I have used most of Vim's fancy features at least once, many frequently, and I
can honestly say that I couldn't live with anything less anymore. My
productivity has easily doubled compared to what it was when I used vi.
(Sitaram Chamarty)
I luv VIM. It is incredible. I'm naming my first-born Vimberly. (Jose
I luv Vim. It is incredible. I'm naming my first-born Vimberly. (Jose
Unpingco, USA)
Hint: "VIM" is "vi improved" - much better! (Sven Guckes, Germany)
Hint: "Vim" is "vi improved" - much better! (Sven Guckes, Germany)
I use VIM every day. I spend more time in VIM than in any other program...
I use Vim every day. I spend more time in Vim than in any other program...
It's the best vi clone there is. I think it's great. (Craig Sanders,
Australia)
I strongly advise using VIM--its infinite undo/redo saved me much grief.
I strongly advise using Vim--its infinite undo/redo saved me much grief.
(Terry Brown)
Thanks very much for writing what in my opinion is the finest text editor on
@@ -163,98 +163,98 @@ the planet. If I were to get another cat, I would name it "Vim".
I typed :set all and the screen FILLED up with options. A whole screen of
things to be set and unset. I saw some of my old friends like wrapmargin,
modelines and showmode, but the screen was FILLED with new friends! I love
them all! I love VIM! I'm so happy that I've found this editor! I feel
them all! I love Vim! I'm so happy that I've found this editor! I feel
like how I once felt when I started using vi after a couple of years of using
ed. I never thought I'd forsake my beloved ed, but vi ... oh god, vi was
great. And now, VIM. (Peter Jay Salzman, USA)
great. And now, Vim. (Peter Jay Salzman, USA)
I am really happy with such a wonderful software package. Much better than
almost any expensive, off the shelf program. (Jeff Walker)
Whenever I reread the VIM documentation I'm overcome with excitement at the
Whenever I reread the Vim documentation I'm overcome with excitement at the
power of the editor. (William Edward Webber, Australia)
Hurrah for VIM!! It is "at your fingertips" like vi, and has the extensions
Hurrah for Vim!! It is "at your fingertips" like vi, and has the extensions
that vi sorely needs: highlighting for executing commands on blocks, an easily
navigable and digestible help screen, and more. (Paul Pax)
The reason WHY I don't have this amazingly useful macro anymore, is that I
now use VIM - and this is built in!! (Stephen Riehm, Germany)
now use Vim - and this is built in!! (Stephen Riehm, Germany)
I am a user of VIM and I love it. I use it to do all my programming, C,
I am a user of Vim and I love it. I use it to do all my programming, C,
C++, HTML what ever. (Tim Allwine)
I discovered VIM after years of struggling with the original vi, and I just
I discovered Vim after years of struggling with the original vi, and I just
can't live without it anymore. (Emmanuel Mogenet, USA)
Emacs has not a bit of chance to survive so long as VIM is around. Besides,
Emacs has not a bit of chance to survive so long as Vim is around. Besides,
it also has the most detailed software documentation I have ever seen---much
better than most commercial software! (Leiming Qian)
This version of VIM will just blow people apart when they discover just how
This version of Vim will just blow people apart when they discover just how
fantastic it is! (Tony Nugent, Australia)
I took your advice & finally got VIM & I'm really impressed. Instant convert.
I took your advice & finally got Vim & I'm really impressed. Instant convert.
(Patrick Killelea, USA)
VIM is by far my favorite piece of shareware and I have been particularly
Vim is by far my favorite piece of shareware and I have been particularly
pleased with version 3.0. This is really a solid piece of work. (Robert
Colon, USA)
VIM is a joy to use, it is so well thought and practical that I wonder why
anybody would use visual development tools. VIM is powerful and elegant, it
Vim is a joy to use, it is so well thought and practical that I wonder why
anybody would use visual development tools. Vim is powerful and elegant, it
looks deceptively simple but is almost as complex as a 747 (especially when I
look at my growing .vimrc), keep up that wonderful job, VIM is a centerpiece
look at my growing .vimrc), keep up that wonderful job, Vim is a centerpiece
of the free software world. (Louis-David Mitterand, USA)
I cannot believe how great it is to use VIM. I think the guys at work are
I cannot believe how great it is to use Vim. I think the guys at work are
getting tired of hearing me bragging about it. Others eyes are lighting up.
(Rick Croote)
Emacs takes way too much time to start up and run, it is too big and bulky for
effective use and the interface is more confusing than it is of any help. VIM
effective use and the interface is more confusing than it is of any help. Vim
however is short, it is fast, it is powerful, it has a good interface and it
is all purpose. (Paal Ditlefsen Ekran)
From the first time I got VIM3.0, I was very enthusiastic. It has almost no
From the first time I got Vim3.0, I was very enthusiastic. It has almost no
problems. The swapfile handling and the backup possibilities are robust, also
the protection against editing one file twice. It is very compatible to the
real VI (and that is a MUST, because my brain is trained over years in using
it). (Gert van Antwerpen, Holland)
Visual mode in VIM is a very powerful thing! (Tony Nugent, Australia)
Visual mode in Vim is a very powerful thing! (Tony Nugent, Australia)
I have to say that VIM is =THE= single greatest piece of source code to ever
I have to say that Vim is =THE= single greatest piece of source code to ever
come across the net (Jim Battle, USA).
In fact, if you do want to get a new vi I'd suggest VIM-3.0. This is, by
In fact, if you do want to get a new vi I'd suggest Vim-3.0. This is, by
far, the best version of vi I've ever seen (Albert W. Schueller).
I should mention that VIM is a very good editor and can compete with anything
I should mention that Vim is a very good editor and can compete with anything
(Ilya Beloozerov).
To tell the truth sometimes I used elvis, vile, xvi, calvin, etc. And this is
the reason that I can state that VIM is the best! (Ferenc Deak, Hungary)
the reason that I can state that Vim is the best! (Ferenc Deak, Hungary)
VIM is by far the best editor that I have used in a long time, and I have
Vim is by far the best editor that I have used in a long time, and I have
looked at just about every thing that is available for every platform that I
use. VIM is the best on all of them. (Guy L. Oliver)
use. Vim is the best on all of them. (Guy L. Oliver)
VIM is the greatest editor since the stone chisel. (Jose Unpingco, USA)
Vim is the greatest editor since the stone chisel. (Jose Unpingco, USA)
I would like to say that with VIM I am finally making the 'emacs to vi'
I would like to say that with Vim I am finally making the 'emacs to vi'
transition - as an Editor it is so much better in many ways: keyboard layout,
memory usage, text alteration to name 3. (Mark Adam)
In fact, now if I want to know what a particular setting does in vi, I fire up
VIM and check out its help! (Nikhil Patel, USA)
Vim and check out its help! (Nikhil Patel, USA)
As a vi user, VIM has made working with text a far more pleasant task than
As a vi user, Vim has made working with text a far more pleasant task than
before I encountered this program. (Steinar Knutsen, Norway)
I use VIM since version 3.0. Since that time, it is the ONLY editor I use,
with Solaris, Linux and OS/2 Warp. I suggest all my friends to use VIM, they
try, and they continue using it. VIM is really the best software I have ever
I use Vim since version 3.0. Since that time, it is the ONLY editor I use,
with Solaris, Linux and OS/2 Warp. I suggest all my friends to use Vim, they
try, and they continue using it. Vim is really the best software I have ever
downloaded from the Internet, and the best editor I know of. (Marco
Eccettuato, Italy)
+2 -2
View File
@@ -478,7 +478,7 @@ Vim uses a binary file format for spelling. This greatly speeds up loading
the word list and keeps it small.
*.aff* *.dic* *Myspell*
You can create a Vim spell file from the .aff and .dic files that Myspell
uses. Myspell is used by OpenOffice.org and Mozilla. The OpenOffice .oxt
uses. Myspell is used by OpenOffice.org and Mozilla. The OpenOffice .oxt
files are zip files which contain the .aff and .dic files. You should be able
to find them here:
http://extensions.services.openoffice.org/dictionary
@@ -1614,7 +1614,7 @@ COMPOUNDSYLLABLE (Hunspell) *spell-COMPOUNDSYLLABLE*
KEY (Hunspell) *spell-KEY*
Define characters that are close together on the keyboard.
Used to give better suggestions. Not supported.
LANG (Hunspell) *spell-LANG*
This specifies language-specific behavior. This actually
moves part of the language knowledge into the program,
+6 -5
View File
@@ -1,4 +1,4 @@
*syntax.txt* For Vim version 8.0. Last change: 2017 Feb 06
*syntax.txt* For Vim version 8.0. Last change: 2017 Jun 04
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -4812,10 +4812,11 @@ ctermbg={color-nr} *highlight-ctermbg*
Example: >
:highlight Normal ctermfg=grey ctermbg=darkblue
< When setting the "ctermbg" color for the Normal group, the
'background' option will be adjusted automatically. This causes the
highlight groups that depend on 'background' to change! This means
you should set the colors for Normal first, before setting other
colors.
'background' option will be adjusted automatically, under the
condition that the color is recognized and 'background' was not set
explicitly. This causes the highlight groups that depend on
'background' to change! This means you should set the colors for
Normal first, before setting other colors.
When a colorscheme is being used, changing 'background' causes it to
be reloaded, which may reset all colors (including Normal). First
delete the "g:colors_name" variable when you don't want this.
+120 -20
View File
@@ -1,4 +1,4 @@
*todo.txt* For Vim version 8.0. Last change: 2017 Apr 28
*todo.txt* For Vim version 8.0. Last change: 2017 Jun 05
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -35,13 +35,9 @@ entered there will not be repeated below, unless there is extra information.
*known-bugs*
-------------------- Known bugs and current work -----------------------
Remove the Farsi code?
+channel:
- job_stop() should not always close the channel, e.g. for "int".
(Martin Gammelsæter, 2017 Apr 11, #1632)
Only assume killed on "kill".
Check job->jv_status not to be JOB_ENDED.
- When redrawing for the channel buffer, command line completion is cleared.
(Ramel Eshed, 2017 May 4)
- Try out background make plugin:
https://github.com/AndrewVos/vim-make-background
- Problem with stderr on Windows? (Vincent Rischmann, 2016 Aug 31, #1026)
@@ -110,13 +106,91 @@ Regexp problems:
had_endbrace[] is set but not initialized or used.
- Difference between two engines: ".*\zs\/\@>\/" on text "///"
(Chris Paul, 2016 Nov 13) New engine not greedy enough?
Another one: echom matchstr(" sdfsfsf\n sfdsdfsdf",'[^\n]*')
(2017 May 15, #1252)
With foldmethod=syntax and nofoldenable comment highlighting isn't removed.
(Marcin Szewczyk, 2017 Apr 26)
ml_get error when using a Python. (Yggdroot, 2017 Jun 1, #1737)
ml_get errors with buggy script. (Dominique, 2017 Apr 30)
Error in emsg with buggy script. (Dominique, 2017 Apr 30)
Add options_default() / options_restore() to set several options to Vim
defaults for a plugin. Comments from Zyx, 2017 May 10.
Perhaps use a vimcontext / endvimcontext command block.
Using freed memory with "qf" FileType autocommand that does :cclose.
(Lemonboy, 2017 May 28, #1730, fix in 1734, with test that doesn't fail, but
it fails when run manually) Add "starting" to test_override()?
Problem with three-piece comment. (Michael Lee, 2017 May 11, #1696)
When checking if a bufref is valid, also check the buffer number, to catch the
case of :bwipe followed by :new.
Files for Latvian language. (Vitolins, 2017 May 3, #1675)
Setting 'clipboard' to "unnamed" makes a global command very slow (Daniel
Drucker, 2017 May 8).
This was supposed to be fixed, did it break again somehow?
Christian cannot reproduce it.
Better TeX indent file. (Christian Brabandt, 2017 May 3)
Openhab syntax file (mueller, #1678)
Use gvimext.dll from the nightly build? (Issue #249)
Patch to remove HAVE_GTK_MULTIHEAD-relevant code. (Kazunobu Kuriyama, 2017 May
5) Update May 11
'synmaxcol' works with bytes instead of screen cells. (Llandon, 2017 May 31,
#1736)
Patch to pass quickfix list index to functions. (Yegappan Lakshmanan, 2017 May
31)
Problem with using :cd when remotely editing a file. (Gerd Wachsmuth, 2017 May
8, #1690)
'equalalways' only works for one column. (Glacambre, 2017 May 15, #1707)
Include solarized color scheme?
Updates to GTK help. (Kazunobu Kuriyama, 2017 May 4)
Running test_gui and test_gui_init with Motif sometimes kills the window
manager. Problem with Motif?
Bogus characters inserted when triggering indent while changing text.
(Vitor Antunes, 2016 Nov 22, #1269)
Patch to have ":stag" respect 'switchbuf'. (Ingo Karkat, 2017 May 5, #1681)
Patch to improve building with MSVC. (Leonardo Manera, #1747)
Wrong selection of quoted text (Guraga, #1687)
Patch to fix selection of quoted text. (Christian Brabandt, 2017 May 7, #1687)
Patch to use separate error message for regex range. (Itchyny, Ken Hamada,
2017 May 16)
Segmentation fault with complete(). (Lifepillar, 2017 Apr 29, #1668)
Check for "pat" to be NULL in search_for_exact_line()?
How did it get NULL? Comment by Christian, Apr 30.
Is it possible to keep the complete menu open when calling complete()?
(Prabir Shrestha, 2017 May 19, #1713)
Calling may_req_ambiguous_char_width() and may_req_bg_color() only after
executing command line commands may not work properly.
(Rastislav Barlink, 2017 May 18)
Set "starting" to 0 earlier, and move the may_req calls above exe_commands()?
No, that's a problem with using "-c quit", not running Vim interactive.
Memory leak in test97? The string is actually freed. Weird.
Patch for shellescape(). (Christian Brabandt, 2017 Apr 20, #1590)
@@ -127,6 +201,33 @@ New value "uselast" for 'switchbuf'. (Lemonboy, 2017 Apr 23, #1652)
Add a toolbar in the terminal. Can be global, above all windows, or specific
for one window.
Make maparg() also return the raw rhs, so that it doesn't depend on 'cpo'.
(Brett Stahlman, 2017 May 23)
Even better: add a way to disable a mapping temporarily and re-enable it
later. This is for a sub-mode that is active for a short while (one buffer).
Still need maplist() to find the mappings. What can we use to identify a
mapping? Something unique would be better than the LHS.
Perhaps simpler: actually delete the mappings. Use maplist() to list matching
mappings (with a lhs prefix, like maparg()), mapdelete() to delete,
maprestore() to restore (using the output of maplist().
Patch to support chinese wordcount in utf-8. (Rain, 2017 May 24, #1722)
Or not?
"gn" selects one character instead of the searched text. (keyboardfire, #1683)
Patch by Christian, 2017 May 7.
Wrong memory access using p_fdm, found in patch to add tests for diff mode
(#1658) (Dominique Pelle, 2017 May 6)
Patch to improve test coverage for diff mode. (Dominique Pelle, 2017 May 11,
#1685)
Add an argument to :mkvimrc (or add aother command) to skip mappings from
plugins (source is a Vim script). No need to put these in a .vimrc, they will
be defined when the plugin is loaded.
Use tb_set(winid, [{'text': 'stop', 'cb': callback, 'hi': 'Green'}])
tb_highlight(winid, 'ToolBar')
tb_get(winid)
@@ -160,6 +261,10 @@ Error in test_startup_utf8 on Solaris. (Danek Duvall, 2016 Aug 17)
Completion for :!cmd shows each match twice. #1435
Patch to change GUI behavior: instead of changing the window size change the
lines/columns when menu/toolbar/etc. is added/removed. (Ychin, 2016 Mar 20,
#703)
GTK: When adding a timer from 'balloonexpr' it won't fire, because
g_main_context_iteration() doesn't return. Need to trigger an event when the
timer expires.
@@ -194,6 +299,10 @@ writefile() does not abort as soon as an error is found. (Nikolai Pavlov,
Patch to support on-the-spot and over-the-spot input method. (Ken Takata, 2017
Feb 14).
Change the Farsi code to work with UTF-8. Possibly combined with the Arabic
support, or similar.
Invalid read error in Farsi mode. (Dominique Pelle, 2009 Aug 2)
Add a command to take a range of lines, filter them and put the output
somewhere else. :{range}copy {dest} !cmd
@@ -369,15 +478,9 @@ Autocommands blocked in do_arg_all(). Supposed to happen later?
'hlsearch' interferes with a Conceal match. (Rom Grk, 2016 Aug 9)
Patch to add context information to quickfix/location list. (Yegappan
Lakshmanan, 2016 Aug 25, #1012)
MS-Windows: use WS_HIDE instead of SW_SHOWMINNOACTIVE in os_win32.c?
Otherwise task flickers in taskbar.
Bogus characters inserted when triggering indent while changing test.
(Vitor Antunes, 2016 Nov 22, #1269)
Should make ":@r" handle line continuation. (Cesar Romani, 2016 Jun 26)
Also for ":@.".
@@ -444,6 +547,8 @@ No test, needs some work to include.
Patch to improve indenting for C++ constructor with initializer list.
(Hirohito Higashi, 2016 Mar 31)
Zero-out krypt key information when no longer in use. (Ben Fritz, 2017 May 15)
Add stronger encryption. Could use libsodium (NaCl).
https://github.com/jedisct1/libsodium/
Possibly include the needed code so that it can be build everywhere.
@@ -493,10 +598,6 @@ When command names are very long :command output is difficult to read. Use a
maximum for the column width? (#871)
Patcy by varmanishant, 2016 Jun 18, #876
Patch to change GUI behavior: instead of changing the window size change the
lines/columns when menu/toolbar/etc. is added/removed. (Ychin, 2016 Mar 20,
#703)
Installation of .desktop files does not work everywhere.
It's now fixed, but the target directory probably isn't right.
Add configure check?
@@ -615,7 +716,8 @@ Value of virtcol() for '[ and '] depend on multi-byte character.
(Luchr, #277)
Can we cache the syntax attributes, so that updates for 'relativenumber' and
'cursorline'/'cursorcolumn' are a lot faster?
'cursorline'/'cursorcolumn' are a lot faster? Thus store the attributes
before combining them.
C highlighting: modern C allows: /* comment */ #ifdef
and also line continuation after #include.
@@ -1519,8 +1621,6 @@ When a:base in 'completefunc' starts with a number it's passed as a number,
not a string. (Sean Ma) Need to add flag to call_func_retlist() to force a
string value.
Invalid read error in Farsi mode. (Dominique Pelle, 2009 Aug 2)
For running gvim on a USB stick: avoid the OLE registration. Use a command
line argument -noregister.
+2 -2
View File
@@ -191,7 +191,7 @@ mouse button. The selected text will be inserted.
The "current selection" will only remain valid until some other text is
selected. After doing the paste in the other gVim, now select some characters
in that window. You will notice that the words that were previously selected
in the other gVim window are displayed differently. This means that it no
in the other gvim window are displayed differently. This means that it no
longer is the current selection.
You don't need to select text with the mouse, using the keyboard commands for
@@ -215,7 +215,7 @@ USING BOTH
This use of both the "current selection" and the "real clipboard" might sound
a bit confusing. But it is very useful. Let's show this with an example.
Use one gVim with a text file and perform these actions:
Use one gvim with a text file and perform these actions:
- Select two words in Visual mode.
- Use the Edit/Copy menu to get these words onto the clipboard.
+2 -2
View File
@@ -1,4 +1,4 @@
*usr_44.txt* For Vim version 8.0. Last change: 2008 Dec 28
*usr_44.txt* For Vim version 8.0. Last change: 2017 May 06
VIM USER MANUAL - by Bram Moolenaar
@@ -686,7 +686,7 @@ that included files do this too, you might have to reset "b:current_syntax" if
you include two files.
If you want your syntax file to work with Vim 5.x, add a check for v:version.
See yacc.vim for an example.
Find an syntax file in the Vim 7.2 distribution for an example.
Do not include anything that is a user preference. Don't set 'tabstop',
'expandtab', etc. These belong in a filetype plugin.
+2 -2
View File
@@ -9250,7 +9250,7 @@ Files: runtime/doc/various.txt, src/ex_cmds.h, src/ex_docmd.c,
src/proto/quickfix.pro, src/quickfix.c
Patch 6.1.424 (extra)
Problem: Win32: Gvim compiled with VC++ 7.0 run on Windows 95 does not show
Problem: Win32: gvim compiled with VC++ 7.0 run on Windows 95 does not show
menu items.
Solution: Define $WINVER to avoid an extra item is added to MENUITEMINFO.
(Muraoka Taro)
@@ -12319,7 +12319,7 @@ Solution: Don't ignore the WM_SYSKEYUP event when the menu is disabled.
Files: src/gui_w32.c
Patch 6.2.362 (extra, after 6.2.347)
Problem: Win32: The manifest causes Gvim not to work. (Dave Roberts)
Problem: Win32: The manifest causes gvim not to work. (Dave Roberts)
Solution: Change "x86" to "X86". (Serge Pirotte)
Files: src/gvim.exe.mnf
+60 -60
View File
@@ -4153,7 +4153,7 @@ Patch 7.0.173
Problem: ":call f().TT()" doesn't work. (Richard Emberson)
Solution: When a function returns a Dictionary or another composite continue
evaluating what follows.
Files: src/eval.c
Files: src/eval.c
Patch 7.0.174
Problem: ":mksession" doesn't restore window layout correctly in tab pages
@@ -4267,7 +4267,7 @@ Problem: When 'swapfile' is switched off in an empty file it is possible
that not all blocks are loaded into memory, causing ml_get errors
later.
Solution: Rename "dont_release" to "mf_dont_release" and also use it to
avoid using the cached line and locked block.
avoid using the cached line and locked block.
Files: src/globals.h, src/memfile.c, src/memline.c
Patch 7.0.193
@@ -6033,7 +6033,7 @@ Solution: Add type casts. (Ben Schmidt)
Files: src/version.c
Patch 7.1.207
Problem: Netbeans: "remove" cannot delete one line.
Problem: Netbeans: "remove" cannot delete one line.
Solution: Remove partial lines and whole lines properly. Avoid a memory
leak. (Xavier de Gaye)
Files: src/netbeans.c
@@ -7993,7 +7993,7 @@ Files: src/ex_cmds.c
Patch 7.2.097
Problem: "!xterm&" doesn't work when 'shell' is "bash".
Solution: Ignore SIGHUP after calling setsid(). (Simon Schubert)
Solution: Ignore SIGHUP after calling setsid(). (Simon Schubert)
Files: src/os_unix.c
Patch 7.2.098
@@ -8742,7 +8742,7 @@ Files: src/gui_gtk_x11.c, src/message.c, src/ops.c, src/proto/ui.pro,
src/ui.c
Patch 7.2.222
Problem: ":mksession" doesn't work properly with 'acd' set.
Problem: ":mksession" doesn't work properly with 'acd' set.
Solution: Make it work. (Yakov Lerner)
Files: src/ex_docmd.c
@@ -9152,7 +9152,7 @@ Solution: Add the missing "else". (Lech Lorens)
Files: src/ops.c
Patch 7.2.293
Problem: When setting 'comments' option it may be used in a wrong way.
Problem: When setting 'comments' option it may be used in a wrong way.
Solution: Don't increment after skipping over digits. (Yukihiro Nakadaira)
Files: src/misc1.c
@@ -10193,32 +10193,32 @@ More information here: |two-engines|
Better Python interface *better-python-interface*
-----------------------
Added |python-bindeval| function. Unlike |python-eval| this one returns
|python-Dictionary|, |python-List| and |python-Function| objects for
dictionaries lists and functions respectively in place of their Python
Added |python-bindeval| function. Unlike |python-eval| this one returns
|python-Dictionary|, |python-List| and |python-Function| objects for
dictionaries lists and functions respectively in place of their Python
built-in equivalents (or None if we are talking about function references).
For simple types this function returns Python built-in types and not only
Python `str()` like |python-eval| does. On Python 3 it will return `bytes()`
For simple types this function returns Python built-in types and not only
Python `str()` like |python-eval| does. On Python 3 it will return `bytes()`
objects in place of `str()` ones avoiding possibility of UnicodeDecodeError.
Interface of new objects mimics standard Python `dict()` and `list()`
interfaces to some extent. Extent will be improved in the future.
Added special |python-vars| objects also available for |python-buffer| and
Added special |python-vars| objects also available for |python-buffer| and
|python-window|. They ease access to Vim script variables from Python.
Now you no longer need to alter `sys.path` to import your module: special
hooks are responsible for importing from {rtp}/python2, {rtp}/python3 and
{rtp}/pythonx directories (for Python 2, Python 3 and both respectively).
Now you no longer need to alter `sys.path` to import your module: special
hooks are responsible for importing from {rtp}/python2, {rtp}/python3 and
{rtp}/pythonx directories (for Python 2, Python 3 and both respectively).
See |python-special-path|.
Added possibility to work with |tabpage|s through |python-tabpage| object.
Added automatic conversion of Vim errors and exceptions to Python
Added automatic conversion of Vim errors and exceptions to Python
exceptions.
Changed the behavior of the |python-buffers| object: it now uses buffer numbers
as keys in place of the index of the buffer in the internal buffer list.
This should not break anything as the only way to get this index was
Changed the behavior of the |python-buffers| object: it now uses buffer numbers
as keys in place of the index of the buffer in the internal buffer list.
This should not break anything as the only way to get this index was
iterating over |python-buffers|.
Added |:pydo| and |:py3do| commands.
@@ -10228,7 +10228,7 @@ Added the |pyeval()| and |py3eval()| functions.
Now in all places which previously accepted `str()` objects, `str()` and
`unicode()` (Python 2) or `bytes()` and `str()` (Python 3) are accepted.
|python-window| has gained `.col` and `.row` attributes that are currently
|python-window| has gained `.col` and `.row` attributes that are currently
the only way to get internal window positions.
Added or fixed support for `dir()` in Vim Python objects.
@@ -10237,12 +10237,12 @@ Added or fixed support for `dir()` in Vim Python objects.
Changed *changed-7.4*
-------
Old Python versions (≤2.2) are no longer supported. Building with them did
Old Python versions (≤2.2) are no longer supported. Building with them did
not work anyway.
Options:
Added ability to automatically save the selection into the system
clipboard when using non-GUI version of Vim (autoselectplus in
Added ability to automatically save the selection into the system
clipboard when using non-GUI version of Vim (autoselectplus in
'clipboard'). Also added ability to use the system clipboard as
default register (previously only primary selection could be used).
(Ivan Krasilnikov, Christian Brabandt, Bram Moolenaar)
@@ -10257,12 +10257,12 @@ Options:
'relativenumber'. (Christian Brabandt)
Commands:
|:diffoff| now saves the local values of some settings and restores
them in place of blindly resetting them to the defaults. (Christian
|:diffoff| now saves the local values of some settings and restores
them in place of blindly resetting them to the defaults. (Christian
Brabandt)
Other:
Lua interface now also uses userdata binded to Vim structures. (Taro
Lua interface now also uses userdata binded to Vim structures. (Taro
Muraoka, Luis Carvalho)
glob() and autocommand patterns used to work with the undocumented
@@ -10287,74 +10287,74 @@ Functions:
Added |wildmenumode()| function. (Christian Brabandt)
Debugging functions: |screenattr()|, |screenchar()|, |screencol()|,
Debugging functions: |screenattr()|, |screenchar()|, |screencol()|,
|screenrow()|. (Simon Ruderich, Bram Moolenaar)
Added ability to use |Dictionary-function|s for |sort()|ing, via
Added ability to use |Dictionary-function|s for |sort()|ing, via
optional third argument. (Nikolay Pavlov)
Added special |expand()| argument that expands to the current line
Added special |expand()| argument that expands to the current line
number.
Made it possible to force |char2nr()| to always give unicode codepoints
Made it possible to force |char2nr()| to always give unicode codepoints
regardless of current encoding. (Yasuhiro Matsumoto)
Made it possible for functions generating file list generate |List|
and not NL-separated string. (e.g. |glob()|, |expand()|) (Christian
Made it possible for functions generating file list generate |List|
and not NL-separated string. (e.g. |glob()|, |expand()|) (Christian
Brabandt)
Functions that obtain variables from the specific window, tabpage or
buffer scope dictionary can now return specified default value in
place of empty string in case variable is not found. (|gettabvar()|,
Functions that obtain variables from the specific window, tabpage or
buffer scope dictionary can now return specified default value in
place of empty string in case variable is not found. (|gettabvar()|,
|getwinvar()|, |getbufvar()|) (Shougo Matsushita, Hirohito Higashi)
Autocommands:
Added |InsertCharPre| event launched before inserting character.
Added |InsertCharPre| event launched before inserting character.
(Jakson A. Aquino)
Added |CompleteDone| event launched after finishing completion in
Added |CompleteDone| event launched after finishing completion in
insert mode. (idea by Florian Klein)
Added |QuitPre| event launched when commands that can either close Vim
Added |QuitPre| event launched when commands that can either close Vim
or only some window(s) are launched.
Added |TextChanged| and |TextChangedI| events launched when text is
Added |TextChanged| and |TextChangedI| events launched when text is
changed.
Commands:
|:syntime| command useful for debugging.
Made it possible to remove all signs from the current buffer using
Made it possible to remove all signs from the current buffer using
|:sign-unplace|. (Christian Brabandt)
Added |:language| autocompletion. (Dominique Pelle)
Added more |:command-complete| completion types: |:behave| suboptions,
color schemes, compilers, |:cscope| suboptions, files from 'path',
|:history| suboptions, locale names, |:syntime| suboptions, user
Added more |:command-complete| completion types: |:behave| suboptions,
color schemes, compilers, |:cscope| suboptions, files from 'path',
|:history| suboptions, locale names, |:syntime| suboptions, user
names. (Dominique Pelle)
Added |:map-nowait| creating mapping which when having lhs that is the
prefix of another mappings lhs will not allow Vim to wait for user to
type more characters to resolve ambiguity, forcing Vim to take the
Added |:map-nowait| creating mapping which when having lhs that is the
prefix of another mappings lhs will not allow Vim to wait for user to
type more characters to resolve ambiguity, forcing Vim to take the
shorter alternative: one with <nowait>.
Options:
Made it possible to ignore case when completing: 'wildignorecase'.
Added ability to delete comment leader when using |J| by `j` flag in
Added ability to delete comment leader when using |J| by `j` flag in
'formatoptions' (|fo-table|). (Lech Lorens)
Added ability to control indentation inside namespaces: |cino-N|.
Added ability to control indentation inside namespaces: |cino-N|.
(Konstantin Lepa)
Added ability to control alignment inside `if` condition separately
Added ability to control alignment inside `if` condition separately
from alignment inside function arguments: |cino-k|. (Lech Lorens)
Other:
Improved support for cmd.exe. (Ben Fritz, Bram Moolenaar)
Added |v:windowid| variable containing current window number in GUI
Added |v:windowid| variable containing current window number in GUI
Vim. (Christian J. Robinson, Lech Lorens)
Added rxvt-unicode and SGR mouse support. (Yiding Jia, Hayaki Saito)
@@ -11925,7 +11925,7 @@ Solution: Pass the separator character to in_history(). (Taro Muraoka)
Files: src/ex_getln.c
Patch 7.3.266
Problem: In Gvim with iBus typing space in Insert mode doesn't work.
Problem: In gvim with iBus typing space in Insert mode doesn't work.
Solution: Clear xim_expected_char after checking it.
Files: src/mbyte.c
@@ -11940,7 +11940,7 @@ Solution: Use O_NOCTTY both in the master and slave. (Bjorn Winckler)
Files: src/os_unix.c
Patch 7.3.269
Problem: 'shellcmdflag' only works with one flag.
Problem: 'shellcmdflag' only works with one flag.
Solution: Split into multiple arguments. (Gary Johnson)
Files: src/os_unix.c
@@ -13120,7 +13120,7 @@ Files: src/ops.c
Patch 7.3.477
Problem: Using ":echo" to output enough lines to scroll, then using "j" and
"k" at the more prompt, displays the command on top of the output.
(Marcin Szamotulski)
(Marcin Szamotulski)
Solution: Put the output below the command. (Christian Brabandt)
Files: src/eval.c
@@ -13373,7 +13373,7 @@ Solution: Recognize completefunction returning -3. (Matsushita Shougo)
Files: src/edit.c
Patch 7.3.520
Problem: Gvim starts up slow on Ubuntu 12.04.
Problem: gvim starts up slow on Ubuntu 12.04.
Solution: Move the call to gui_mch_init_check() to after fork(). (Yasuhiro
Matsumoto) Do check $DISPLAY being set.
Files: src/gui.c, src/gui_gtk_x11.c, src/proto/gui_gtk_x11.pro
@@ -13426,7 +13426,7 @@ Solution: Make the count select that many characters or lines. (Christian
Files: src/normal.c
Patch 7.3.530 (after 7.3.520)
Problem: Gvim does not work when 'guioptions' includes "f". (Davido)
Problem: gvim does not work when 'guioptions' includes "f". (Davido)
Solution: Call gui_mch_init_check() when running GUI in the foreground.
(Yasuhiro Matsumoto)
Files: src/gui.c
@@ -14289,7 +14289,7 @@ Files: Filelist
Patch 7.3.682 (after 7.3.677)
Problem: Compiler complains about incompatible types.
Solution: Remove type casts. (hint by Danek Duvall)
Files: src/edit.c
Files: src/edit.c
Patch 7.3.683
Problem: ":python" may crash when vimbindeval() returns None.
@@ -16342,7 +16342,7 @@ Solution: Avoid negative argument to vim_strncpy(). (Narendran
Files: src/if_cscope.c
Patch 7.3.1039
Problem: New regexp engine does not support \%23c, \%<23c and the like.
Problem: New regexp engine does not support \%23c, \%<23c and the like.
Solution: Implement them. (partly by Yasuhiro Matsumoto)
Files: src/regexp.h, src/regexp_nfa.c, src/testdir/test64.in,
src/testdir/test64.ok
@@ -17554,9 +17554,9 @@ Solution: Specify a separate viminfo file.
Files: src/testdir/test61.in
Patch 7.3.1252
Problem: Gvim does not find the toolbar bitmap files in ~/vimfiles/bitmaps
Problem: gvim does not find the toolbar bitmap files in ~/vimfiles/bitmaps
if the corresponding menu command contains additional characters
like the shortcut marker '&' or if you use a non-english locale.
like the shortcut marker '&' or if you use a non-english locale.
Solution: Use menu->en_dname or menu->dname. (Martin Gieseking)
Files: src/gui_w32.c
@@ -18177,7 +18177,7 @@ Files: src/window.c
Patch 7.4a.045
Problem: Configure does not always find the right library for Lua. Missing
support for LuaJit.
support for LuaJit.
Solution: Improve the configure detection of Lua. (Hiroshi Shirosaki)
Files: src/Makefile, src/configure.in, src/auto/configure
+16 -16
View File
@@ -15117,7 +15117,7 @@ Files: src/option.c
Patch 8.0.0101
Problem: Some options are not strictly checked.
Solution: Add flags for strickter checks.
Solution: Add flags for stricter checks.
Files: src/option.c
Patch 8.0.0102 (after 8.0.0101)
@@ -15766,7 +15766,7 @@ Solution: Change #ifdef around ins_char_bytes.
Files: src/misc1.c
Patch 8.0.0212
Problem: The buffer used to store a key name theoreticaly could be too
Problem: The buffer used to store a key name theoretically could be too
small. (Coverity)
Solution: Count all possible modifier characters. Add a check for the
length just in case.
@@ -15834,7 +15834,7 @@ Files: src/ops.c, src/testdir/test_put.vim, src/Makefile,
Patch 8.0.0223
Problem: Coverity gets confused by the flags passed to find_tags() and
warnts for an uninitialized variable.
warns about uninitialized variable.
Solution: Disallow using cscope and help tags at the same time.
Files: src/tag.c
@@ -15955,7 +15955,7 @@ Files: src/testdir/test_usercommands.vim
Patch 8.0.0243
Problem: When making a character lower case with tolower() changes the byte
cound, it is not made lower case.
count, it is not made lower case.
Solution: Add strlow_save(). (Dominique Pelle, closes #1406)
Files: src/evalfunc.c, src/misc2.c, src/proto/misc2.pro,
src/testdir/test_functions.vim
@@ -16032,9 +16032,9 @@ Files: src/Makefile, src/charset.c, src/kword_test.c, src/mbyte.c,
src/proto/mbyte.pro
Patch 8.0.0253
Problem: When creating a session when winminheight is 2 or larger and
Problem: When creating a session when 'winminheight' is 2 or larger and
loading that session gives an error.
Solution: Also set winminheight before setting winheight to 1. (Rafael
Solution: Also set 'winminheight' before setting 'winheight' to 1. (Rafael
Bodill, neovim #5717)
Files: src/ex_docmd.c, src/testdir/test_mksession.vim
@@ -16541,7 +16541,7 @@ Solution: For quoted text objects bail out if the Visual area spans more
Files: src/search.c, src/testdir/test_visual.vim
Patch 8.0.0340
Problem: Not checking return valud of dict_add(). (Coverity)
Problem: Not checking return value of dict_add(). (Coverity)
Solution: Handle a failure.
Files: src/buffer.c
@@ -16612,12 +16612,12 @@ Files: src/testdir/test_expr.vim
Patch 8.0.0352
Problem: The condition for when a typval needs to be cleared is too
complicated.
Solution: Init the type to VAR_UNKNOWN and clear it always.
Solution: Init the type to VAR_UNKNOWN and always clear it.
Files: src/eval.c
Patch 8.0.0353
Problem: If [RO] in the status line is translated to a longer string, it is
trunctted to 4 bytes.
truncated to 4 bytes.
Solution: Skip over the resulting string. (Jente Hidskes, closes #1499)
Files: src/screen.c
@@ -17294,7 +17294,7 @@ Files: src/misc2.c
Patch 8.0.0461 (after 8.0.0457)
Problem: Test 45 hangs on MS-Windows.
Solution: Reset 'shiftwidth'. Also remove redundent function.
Solution: Reset 'shiftwidth'. Also remove redundant function.
Files: src/fold.c, src/testdir/test45.in
Patch 8.0.0462
@@ -17597,7 +17597,7 @@ Solution: Remove duplicate https:.
Files: README.md
Patch 8.0.0511
Problem: Menuage for skipping client-server tests is unclear.
Problem: Message for skipping client-server tests is unclear.
Solution: Be more specific about what's missing (Hirohito Higashi, Kazunobu
Kuriyama)
Files: src/testdir/test_quotestar.vim, src/testdir/test_clientserver.vim
@@ -17688,7 +17688,7 @@ Solution: Include the whole character.
Files: src/search.c, src/testdir/test_normal.vim
Patch 8.0.0524 (after 8.0.0518)
Problem: Folds are messed up when 'encodin' is "utf-8".
Problem: Folds are messed up when 'encoding' is "utf-8".
Solution: Also set the fold character when it's not multi-byte.
Files: src/screen.c, src/testdir/test_display.vim
@@ -17882,7 +17882,7 @@ Solution: Add a test. (Dominique Pelle, closes #1622)
Files: src/testdir/test_syntax.vim
Patch 8.0.0559
Problem: Setting ttytype to xxx does not always fail as expected. (Marvin
Problem: Setting 'ttytype' to xxx does not always fail as expected. (Marvin
Schmidt)
Solution: Catch both possible errors. (closes #1601)
Files: src/testdir/test_options.vim
@@ -17919,7 +17919,7 @@ Solution: Set qf_last to NULL.
Files: src/quickfix.c
Patch 8.0.0566
Problem: Setting nocompatible for the tiny version moves the cursor.
Problem: Setting 'nocompatible' for the tiny version moves the cursor.
Solution: Use another trick to skip commands when the +eval feature is
present. (Christian Brabandt, closes #1630)
Files: runtime/defaults.vim
@@ -17938,7 +17938,7 @@ Files: src/testdir/test_goto.vim, src/normal.c
Patch 8.0.0569
Problem: Bracketed paste is still enabled when executing a shell command.
(Michael Smith)
Solution: Disable brackted paste when going into cooked mode. (closes #1638)
Solution: Disable bracketed paste when going into cooked mode. (closes #1638)
Files: src/term.c
Patch 8.0.0570
@@ -17978,7 +17978,7 @@ Solution: Make a copy of 'indentexpr'.
Files: src/misc1.c, src/testdir/test_options.vim
Patch 8.0.0576 (after 8.0.0570 and 8.0.0573)
Problem: Can't build when configure choses "install-sh". (Daniel Hahler)
Problem: Can't build when configure chooses "install-sh". (Daniel Hahler)
Solution: Always use install-sh. Fix remaining use of mkinstalldirs.
(closes #1647)
Files: src/installman.sh, src/installml.sh, src/config.mk.in,
+31 -9
View File
@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2017 Apr 20
" Last Change: 2017 Jun 04
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
@@ -981,7 +981,7 @@ au BufNewFile,BufRead */etc/initng/*/*.i,*.ii setf initng
" Innovation Data Processing
au BufRead,BufNewFile upstream.dat\c,upstream.*.dat\c,*.upstream.dat\c setf upstreamdat
au BufRead,BufNewFile upstream.log\c,upstream.*.log\c,*.upstream.log\c setf upstreamlog
au BufRead,BufNewFile fdrupstream.log,upstream.log\c,upstream.*.log\c,*.upstream.log\c,UPSTREAM-*.log\c setf upstreamlog
au BufRead,BufNewFile upstreaminstall.log\c,upstreaminstall.*.log\c,*.upstreaminstall.log\c setf upstreaminstalllog
au BufRead,BufNewFile usserver.log\c,usserver.*.log\c,*.usserver.log\c setf usserverlog
au BufRead,BufNewFile usw2kagt.log\c,usw2kagt.*.log\c,*.usw2kagt.log\c setf usw2kagtlog
@@ -1181,14 +1181,21 @@ au BufNewFile,BufRead *.markdown,*.mdown,*.mkd,*.mkdn,*.mdwn,*.md setf markdown
" Mason
au BufNewFile,BufRead *.mason,*.mhtml,*.comp setf mason
" Matlab or Objective C
" Mathematica, Matlab, Murphi or Objective C
au BufNewFile,BufRead *.m call s:FTm()
func! s:FTm()
let n = 1
while n < 10
let saw_comment = 0 " Whether we've seen a multiline comment leader.
while n < 100
let line = getline(n)
if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|/\*\|//\)'
if line =~ '^\s*/\*'
" /* ... */ is a comment in Objective C and Murphi, so we can't conclude
" it's either of them yet, but track this as a hint in case we don't see
" anything more definitive.
let saw_comment = 1
endif
if line =~ '^\s*\(#\s*\(include\|import\)\>\|@import\>\|//\)'
setf objc
return
endif
@@ -1200,11 +1207,23 @@ func! s:FTm()
setf mma
return
endif
if line =~ '^\c\s*\(\(type\|var\)\>\|--\)'
setf murphi
return
endif
let n = n + 1
endwhile
if exists("g:filetype_m")
if saw_comment
" We didn't see anything definitive, but this looks like either Objective C
" or Murphi based on the comment leader. Assume the former as it is more
" common.
setf objc
elseif exists("g:filetype_m")
" Use user specified default filetype for .m
exe "setf " . g:filetype_m
else
" Default is matlab
setf matlab
endif
endfunc
@@ -1419,7 +1438,7 @@ if has("fname_case")
else
au BufNewFile,BufRead *.pl call s:FTpl()
endif
au BufNewFile,BufRead *.plx,*.al setf perl
au BufNewFile,BufRead *.plx,*.al,*.psgi setf perl
au BufNewFile,BufRead *.p6,*.pm6,*.pl6 setf perl6
func! s:FTpl()
@@ -1807,6 +1826,9 @@ au BufNewFile,BufRead *.sa setf sather
" Scala
au BufNewFile,BufRead *.scala setf scala
" SBT - Scala Build Tool
au BufNewFile,BufRead *.sbt setf sbt
" Scilab
au BufNewFile,BufRead *.sci,*.sce setf scilab
@@ -2774,12 +2796,12 @@ runtime! ftdetect/*.vim
" state.
augroup END
" Generic configuration file (check this last, it's just guessing!)
" Generic configuration file. Use FALLBACK, it's just guessing!
au filetypedetect BufNewFile,BufRead,StdinReadPost *
\ if !did_filetype() && expand("<amatch>") !~ g:ft_ignore_pat
\ && (getline(1) =~ '^#' || getline(2) =~ '^#' || getline(3) =~ '^#'
\ || getline(4) =~ '^#' || getline(5) =~ '^#') |
\ setf conf |
\ setf FALLBACK conf |
\ endif
+15
View File
@@ -0,0 +1,15 @@
" Vim filetype plugin file
" Language: sbt
" Maintainer: Steven Dobay <stevendobay at protonmail.com>
" License: Same as Vim
" Last Change: 2017.04.30
" ----------------------------------------------------------------------------
if exists('b:did_ftplugin') || &cp
finish
endif
let b:did_ftplugin = 1
runtime! ftplugin/scala.vim
+10 -9
View File
@@ -3,10 +3,12 @@
" Maintainer: Christian Brabandt <cb@256bit.org>
" Previous Maintainer: Peter Aronoff <telemachus@arpinum.org>
" Original Author: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2016-06-27
" Latest Revision: 2017-05-02
" License: Vim (see :h license)
" Repository: https://github.com/chrisbra/vim-sh-indent
" Changelog:
" 20170502: - get rid of buffer-shiftwidth function
" 20160912: - preserve indentation of here-doc blocks
" 20160627: - detect heredocs correctly
" 20160213: - detect function definition correctly
" 20160202: - use shiftwidth() function
@@ -33,15 +35,11 @@ endif
let s:cpo_save = &cpo
set cpo&vim
function s:buffer_shiftwidth()
return shiftwidth()
endfunction
let s:sh_indent_defaults = {
\ 'default': function('s:buffer_shiftwidth'),
\ 'continuation-line': function('s:buffer_shiftwidth'),
\ 'case-labels': function('s:buffer_shiftwidth'),
\ 'case-statements': function('s:buffer_shiftwidth'),
\ 'default': function('shiftwidth'),
\ 'continuation-line': function('shiftwidth'),
\ 'case-labels': function('shiftwidth'),
\ 'case-statements': function('shiftwidth'),
\ 'case-breaks': 0 }
function! s:indent_value(option)
@@ -110,6 +108,9 @@ function! GetShIndent()
let ind -= s:indent_value('case-breaks')
elseif s:is_here_doc(line)
let ind = 0
" statements, executed within a here document. Keep the current indent
elseif match(map(synstack(v:lnum, 1), 'synIDattr(v:val, "name")'), '\c\mheredoc') > -1
return indent(v:lnum)
endif
return ind
+63 -56
View File
@@ -1,8 +1,8 @@
" Vim indent file
" Language: LaTeX
" Maintainer: YiChao Zhou <broken.zhou AT gmail.com>
" Maintainer: Yichao Zhou <broken.zhou AT gmail.com>
" Created: Sat, 16 Feb 2002 16:50:19 +0100
" Version: 0.9.2
" Version: 0.9.4
" Please email me if you found something I can do. Comments, bug report and
" feature request are welcome.
@@ -15,49 +15,53 @@
" 2005/06/15, Moshe Kaminsky <kaminsky AT math.huji.ac.il>
" (*) New variables:
" g:tex_items, g:tex_itemize_env, g:tex_noindent_env
" 2011/3/6, by Zhou YiChao <broken.zhou AT gmail.com>
" 2011/3/6, by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Don't change indentation of lines starting with '%'
" I don't see any code with '%' and it doesn't work properly
" so I add some code.
" (*) New features: Add smartindent-like indent for "{}" and "[]".
" (*) New variables: g:tex_indent_brace
" 2011/9/25, by Zhou Yichao <broken.zhou AT gmail.com>
" 2011/9/25, by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Bug fix: smartindent-like indent for "[]"
" (*) New features: Align with "&".
" (*) New variable: g:tex_indent_and.
" 2011/10/23 by Zhou Yichao <broken.zhou AT gmail.com>
" 2011/10/23 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Bug fix: improve the smartindent-like indent for "{}" and
" "[]".
" 2012/02/27 by Zhou Yichao <broken.zhou AT gmail.com>
" 2012/02/27 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Bug fix: support default folding marker.
" (*) Indent with "&" is not very handy. Make it not enable by
" default.
" 2012/03/06 by Zhou Yichao <broken.zhou AT gmail.com>
" 2012/03/06 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Modify "&" behavior and make it default again. Now "&"
" won't align when there are more then one "&" in the previous
" line.
" (*) Add indent "\left(" and "\right)"
" (*) Trust user when in "verbatim" and "lstlisting"
" 2012/03/11 by Zhou Yichao <broken.zhou AT gmail.com>
" 2012/03/11 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Modify "&" so that only indent when current line start with
" "&".
" 2012/03/12 by Zhou Yichao <broken.zhou AT gmail.com>
" 2012/03/12 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Modify indentkeys.
" 2012/03/18 by Zhou Yichao <broken.zhou AT gmail.com>
" 2012/03/18 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Add &cpo
" 2013/05/02 by Zhou Yichao <broken.zhou AT gmail.com>
" 2013/05/02 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Fix problem about GetTeXIndent checker. Thank Albert Netymk
" for reporting this.
" 2014/06/23 by Zhou Yichao <broken.zhou AT gmail.com>
" 2014/06/23 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Remove the feature g:tex_indent_and because it is buggy.
" (*) If there is not any obvious indentation hints, we do not
" alert our user's current indentation.
" (*) g:tex_indent_brace now only works if the open brace is the
" last character of that line.
" 2014/08/03 by Zhou Yichao <broken.zhou AT gmail.com>
" 2014/08/03 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Indent current line if last line has larger indentation
" 2014/08/09 by Zhou Yichao <broken.zhou AT gmail.com>
" (*) Add missing return value for s:GetEndIndentation(...)
" 2016/11/08 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Fix problems for \[ and \]. Thanks Bruno for reporting.
" 2017/04/30 by Yichao Zhou <broken.zhou AT gmail.com>
" (*) Fix a bug between g:tex_noindent_env and g:tex_indent_items
" Now g:tex_noindent_env='document\|verbatim\|itemize' (Emacs
" style) is supported. Thanks Miles Wheeler for reporting.
"
" }}}
@@ -81,44 +85,44 @@
" % Example 2
" \tikzexternalize[
" prefix=tikz]
"
"
" * g:tex_indent_items
"
" If this variable is set, item-environments are indented like Emacs does
" it, i.e., continuation lines are indented with a shiftwidth.
"
"
" NOTE: I've already set the variable below; delete the corresponding line
" if you don't like this behaviour.
"
" Per default, it is unset.
"
"
" set unset
" ----------------------------------------------------------------
" \begin{itemize} \begin{itemize}
" \begin{itemize} \begin{itemize}
" \item blablabla \item blablabla
" bla bla bla bla bla bla
" bla bla bla bla bla bla
" \item blablabla \item blablabla
" bla bla bla bla bla bla
" \end{itemize} \end{itemize}
" bla bla bla bla bla bla
" \end{itemize} \end{itemize}
"
"
" * g:tex_items
"
" A list of tokens to be considered as commands for the beginning of an item
" command. The tokens should be separated with '\|'. The initial '\' should
" A list of tokens to be considered as commands for the beginning of an item
" command. The tokens should be separated with '\|'. The initial '\' should
" be escaped. The default is '\\bibitem\|\\item'.
"
" * g:tex_itemize_env
"
" A list of environment names, separated with '\|', where the items (item
" commands matching g:tex_items) may appear. The default is
"
" A list of environment names, separated with '\|', where the items (item
" commands matching g:tex_items) may appear. The default is
" 'itemize\|description\|enumerate\|thebibliography'.
"
" * g:tex_noindent_env
"
" A list of environment names. separated with '\|', where no indentation is
" A list of environment names. separated with '\|', where no indentation is
" required. The default is 'document\|verbatim'.
" }}}
" }}}
" Only define the function once
if exists("b:did_indent")
@@ -146,7 +150,7 @@ if g:tex_indent_items
let g:tex_itemize_env = 'itemize\|description\|enumerate\|thebibliography'
endif
if !exists('g:tex_items')
let g:tex_items = '\\bibitem\|\\item'
let g:tex_items = '\\bibitem\|\\item'
endif
else
let g:tex_items = ''
@@ -177,7 +181,7 @@ function! GetTeXIndent() " {{{
" At the start of the file use zero indent.
if lnum == 0
return 0
return 0
endif
let line = substitute(getline(lnum), '\s*%.*', '','g') " last line
@@ -191,9 +195,9 @@ function! GetTeXIndent() " {{{
return indent(v:lnum)
end
endif
if lnum == 0
return 0
return 0
endif
let ind = indent(lnum)
@@ -206,12 +210,14 @@ function! GetTeXIndent() " {{{
" Add a 'shiftwidth' after beginning of environments.
" Don't add it for \begin{document} and \begin{verbatim}
""if line =~ '^\s*\\begin{\(.*\)}' && line !~ 'verbatim'
" if line =~ '^\s*\\begin{\(.*\)}' && line !~ 'verbatim'
" LH modification : \begin does not always start a line
" ZYC modification : \end after \begin won't cause wrong indent anymore
if line =~ '\\begin{.*}' && line !~ g:tex_noindent_env
let ind = ind + &sw
let stay = 0
if line =~ '\\begin{.*}'
if line !~ g:tex_noindent_env
let ind = ind + &sw
let stay = 0
endif
if g:tex_indent_items
" Add another sw for item-environments
@@ -245,29 +251,27 @@ function! GetTeXIndent() " {{{
endif
if g:tex_indent_brace
let char = line[strlen(line)-1]
if char == '[' || char == '{'
if line =~ '[[{]$'
let ind += &sw
let stay = 0
endif
let cind = indent(v:lnum)
let char = cline[cind]
if (char == ']' || char == '}') &&
\ s:CheckPairedIsLastCharacter(v:lnum, cind)
if cline =~ '^\s*\\\?[\]}]' && s:CheckPairedIsLastCharacter(v:lnum, indent(v:lnum))
let ind -= &sw
let stay = 0
endif
for i in range(indent(lnum)+1, strlen(line)-1)
let char = line[i]
if char == ']' || char == '}'
if s:CheckPairedIsLastCharacter(lnum, i)
let ind -= &sw
let stay = 0
if line !~ '^\s*\\\?[\]}]'
for i in range(indent(lnum)+1, strlen(line)-1)
let char = line[i]
if char == ']' || char == '}'
if s:CheckPairedIsLastCharacter(lnum, i)
let ind -= &sw
let stay = 0
endif
endif
endif
endfor
endfor
endif
endif
" Special treatment for 'item'
@@ -309,12 +313,12 @@ function! s:GetLastBeginIndentation(lnum) " {{{
let matchend -= 1
endif
if matchend == 0
if line =~ g:tex_itemize_env
return indent(lnum) + 2 * &sw
endif
if line =~ g:tex_noindent_env
return indent(lnum)
endif
if line =~ g:tex_itemize_env
return indent(lnum) + 2 * &sw
endif
return indent(lnum) + &sw
endif
endfor
@@ -348,12 +352,15 @@ endfunction
" Most of the code is from matchparen.vim
function! s:CheckPairedIsLastCharacter(lnum, col) "{{{
" Get the character under the cursor and check if it's in 'matchpairs'.
let c_lnum = a:lnum
let c_col = a:col+1
let line = getline(c_lnum)
if line[c_col-1] == '\'
let c_col = c_col + 1
endif
let c = line[c_col-1]
let c = getline(c_lnum)[c_col-1]
let plist = split(&matchpairs, '.\zs[:,]')
let i = index(plist, c)
if i < 0
+4 -3
View File
@@ -4,7 +4,7 @@ For instructions on installing this file, type
:help matchit-install
inside Vim.
For Vim version 6.3. Last change: 2016 Mar 28
For Vim version 6.3. Last change: 2017 May 14
VIM REFERENCE MANUAL by Benji Fisher
@@ -242,7 +242,7 @@ Examples:
In LaTeX, since "%" is used as the comment character, you can >
:let b:match_skip = 'r:%'
< Unfortunately, this will skip anything after "\%", an escaped "%". To
allow for this, and also "\\%" (an excaped backslash followed by the
allow for this, and also "\\%" (an escaped backslash followed by the
comment character) you can >
:let b:match_skip = 'r:\(^\|[^\\]\)\(\\\\\)*%'
<
@@ -392,7 +392,8 @@ a while. Moral: if a bug (known or not) bothers you, let me know.
The various |:vmap|s defined in the script (%, |g%|, |[%|, |]%|, |a%|) may
have undesired effects in Select mode |Select-mode-mapping|. At least, if you
want to replace the selection with any character in "ag%[]" there will be a
pause of |'updatetime'| first.
pause of |'updatetime'| first. E.g., "yV%" would normally work linewise, but
the plugin mapping makes it characterwise.
It would be nice if "\0" were recognized as the entire pattern. That is, it
would be nice if "foo:\end\0" had the same effect as "\(foo\):\end\1". I may
+23 -35
View File
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: C
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2016 Nov 18
" Last Change: 2017 Apr 30
" Quit when a (custom) syntax file was already loaded
if exists("b:current_syntax")
@@ -311,44 +311,32 @@ if !exists("c_no_ansi") || exists("c_ansi_constants") || exists("c_gnu")
syn keyword cConstant PTRDIFF_MIN PTRDIFF_MAX SIG_ATOMIC_MIN SIG_ATOMIC_MAX
syn keyword cConstant SIZE_MAX WCHAR_MIN WCHAR_MAX WINT_MIN WINT_MAX
endif
syn keyword cConstant FLT_RADIX FLT_ROUNDS
syn keyword cConstant FLT_DIG FLT_MANT_DIG FLT_EPSILON
syn keyword cConstant DBL_DIG DBL_MANT_DIG DBL_EPSILON
syn keyword cConstant LDBL_DIG LDBL_MANT_DIG LDBL_EPSILON
syn keyword cConstant FLT_MIN FLT_MAX FLT_MIN_EXP FLT_MAX_EXP
syn keyword cConstant FLT_MIN_10_EXP FLT_MAX_10_EXP
syn keyword cConstant DBL_MIN DBL_MAX DBL_MIN_EXP DBL_MAX_EXP
syn keyword cConstant DBL_MIN_10_EXP DBL_MAX_10_EXP
syn keyword cConstant LDBL_MIN LDBL_MAX LDBL_MIN_EXP LDBL_MAX_EXP
syn keyword cConstant LDBL_MIN_10_EXP LDBL_MAX_10_EXP
syn keyword cConstant HUGE_VAL CLOCKS_PER_SEC NULL
syn keyword cConstant LC_ALL LC_COLLATE LC_CTYPE LC_MONETARY
syn keyword cConstant LC_NUMERIC LC_TIME
syn keyword cConstant SIG_DFL SIG_ERR SIG_IGN
syn keyword cConstant SIGABRT SIGFPE SIGILL SIGHUP SIGINT SIGSEGV SIGTERM
syn keyword cConstant FLT_RADIX FLT_ROUNDS FLT_DIG FLT_MANT_DIG FLT_EPSILON DBL_DIG DBL_MANT_DIG DBL_EPSILON
syn keyword cConstant LDBL_DIG LDBL_MANT_DIG LDBL_EPSILON FLT_MIN FLT_MAX FLT_MIN_EXP FLT_MAX_EXP FLT_MIN_10_EXP FLT_MAX_10_EXP
syn keyword cConstant DBL_MIN DBL_MAX DBL_MIN_EXP DBL_MAX_EXP DBL_MIN_10_EXP DBL_MAX_10_EXP LDBL_MIN LDBL_MAX LDBL_MIN_EXP LDBL_MAX_EXP
syn keyword cConstant LDBL_MIN_10_EXP LDBL_MAX_10_EXP HUGE_VAL CLOCKS_PER_SEC NULL LC_ALL LC_COLLATE LC_CTYPE LC_MONETARY
syn keyword cConstant LC_NUMERIC LC_TIME SIG_DFL SIG_ERR SIG_IGN SIGABRT SIGFPE SIGILL SIGHUP SIGINT SIGSEGV SIGTERM
" Add POSIX signals as well...
syn keyword cConstant SIGABRT SIGALRM SIGCHLD SIGCONT SIGFPE SIGHUP
syn keyword cConstant SIGILL SIGINT SIGKILL SIGPIPE SIGQUIT SIGSEGV
syn keyword cConstant SIGSTOP SIGTERM SIGTRAP SIGTSTP SIGTTIN SIGTTOU
syn keyword cConstant SIGUSR1 SIGUSR2
syn keyword cConstant _IOFBF _IOLBF _IONBF BUFSIZ EOF WEOF
syn keyword cConstant FOPEN_MAX FILENAME_MAX L_tmpnam
syn keyword cConstant SEEK_CUR SEEK_END SEEK_SET
syn keyword cConstant TMP_MAX stderr stdin stdout
syn keyword cConstant EXIT_FAILURE EXIT_SUCCESS RAND_MAX
syn keyword cConstant SIGABRT SIGALRM SIGCHLD SIGCONT SIGFPE SIGHUP SIGILL SIGINT SIGKILL SIGPIPE SIGQUIT SIGSEGV
syn keyword cConstant SIGSTOP SIGTERM SIGTRAP SIGTSTP SIGTTIN SIGTTOU SIGUSR1 SIGUSR2
syn keyword cConstant _IOFBF _IOLBF _IONBF BUFSIZ EOF WEOF FOPEN_MAX FILENAME_MAX L_tmpnam
syn keyword cConstant SEEK_CUR SEEK_END SEEK_SET TMP_MAX stderr stdin stdout EXIT_FAILURE EXIT_SUCCESS RAND_MAX
" POSIX 2001
syn keyword cConstant SIGBUS SIGPOLL SIGPROF SIGSYS SIGURG
syn keyword cConstant SIGVTALRM SIGXCPU SIGXFSZ
syn keyword cConstant SIGBUS SIGPOLL SIGPROF SIGSYS SIGURG SIGVTALRM SIGXCPU SIGXFSZ
" non-POSIX signals
syn keyword cConstant SIGWINCH SIGINFO
" Add POSIX errors as well
syn keyword cConstant E2BIG EACCES EAGAIN EBADF EBADMSG EBUSY
syn keyword cConstant ECANCELED ECHILD EDEADLK EDOM EEXIST EFAULT
syn keyword cConstant EFBIG EILSEQ EINPROGRESS EINTR EINVAL EIO EISDIR
syn keyword cConstant EMFILE EMLINK EMSGSIZE ENAMETOOLONG ENFILE ENODEV
syn keyword cConstant ENOENT ENOEXEC ENOLCK ENOMEM ENOSPC ENOSYS
syn keyword cConstant ENOTDIR ENOTEMPTY ENOTSUP ENOTTY ENXIO EPERM
syn keyword cConstant EPIPE ERANGE EROFS ESPIPE ESRCH ETIMEDOUT EXDEV
" Add POSIX errors as well. List comes from:
" http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/errno.h.html
syn keyword cConstant E2BIG EACCES EADDRINUSE EADDRNOTAVAIL EAFNOSUPPORT EAGAIN EALREADY EBADF
syn keyword cConstant EBADMSG EBUSY ECANCELED ECHILD ECONNABORTED ECONNREFUSED ECONNRESET EDEADLK
syn keyword cConstant EDESTADDRREQ EDOM EDQUOT EEXIST EFAULT EFBIG EHOSTUNREACH EIDRM EILSEQ
syn keyword cConstant EINPROGRESS EINTR EINVAL EIO EISCONN EISDIR ELOOP EMFILE EMLINK EMSGSIZE
syn keyword cConstant EMULTIHOP ENAMETOOLONG ENETDOWN ENETRESET ENETUNREACH ENFILE ENOBUFS ENODATA
syn keyword cConstant ENODEV ENOENT ENOEXEC ENOLCK ENOLINK ENOMEM ENOMSG ENOPROTOOPT ENOSPC ENOSR
syn keyword cConstant ENOSTR ENOSYS ENOTCONN ENOTDIR ENOTEMPTY ENOTRECOVERABLE ENOTSOCK ENOTSUP
syn keyword cConstant ENOTTY ENXIO EOPNOTSUPP EOVERFLOW EOWNERDEAD EPERM EPIPE EPROTO
syn keyword cConstant EPROTONOSUPPORT EPROTOTYPE ERANGE EROFS ESPIPE ESRCH ESTALE ETIME ETIMEDOUT
syn keyword cConstant ETXTBSY EWOULDBLOCK EXDEV
" math.h
syn keyword cConstant M_E M_LOG2E M_LOG10E M_LN2 M_LN10 M_PI M_PI_2 M_PI_4
syn keyword cConstant M_1_PI M_2_PI M_2_SQRTPI M_SQRT2 M_SQRT1_2
+2 -2
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: 2016 Oct 28
" Last Change: 2017 Jun 05
" quit when a syntax file was already loaded
if exists("b:current_syntax")
@@ -48,7 +48,7 @@ endif
if !exists("cpp_no_cpp14")
syn case ignore
syn match cppNumber display "\<0b[01]\('\=[01]\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
syn match cppNumber display "\<[1-9]\('\=\d\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
syn match cppNumber display "\<[1-9]\('\=\d\+\)*\(u\=l\{0,2}\|ll\=u\)\>" contains=cFloat
syn match cppNumber display "\<0x\x\('\=\x\+\)*\(u\=l\{0,2}\|ll\=u\)\>"
syn case match
endif
+2 -2
View File
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: Haskell
" Maintainer: Haskell Cafe mailinglist <haskell-cafe@haskell.org>
" Last Change: 2008 Dec 15
" Last Change: 2017 Jun 04
" Original Author: John Williams <jrw@pobox.com>
"
" Thanks to Ryan Crumley for suggestions and John Meacham for
@@ -62,7 +62,7 @@ syn match hsCharacter "^'\([^\\]\|\\[^']\+\|\\'\)'" contains=hsSpecialChar,hs
syn match hsNumber "\<[0-9]\+\>\|\<0[xX][0-9a-fA-F]\+\>\|\<0[oO][0-7]\+\>"
syn match hsFloat "\<[0-9]\+\.[0-9]\+\([eE][-+]\=[0-9]\+\)\=\>"
" Keyword definitions. These must be patters instead of keywords
" Keyword definitions. These must be patterns instead of keywords
" because otherwise they would match as keywords at the start of a
" "literate" comment (see lhs.vim).
syn match hsModule "\<module\>"
+32
View File
@@ -0,0 +1,32 @@
" Vim syntax file
" Language: sbt
" Maintainer: Steven Dobay <stevendobay at protonmail.com>
" Last Change: 2017.04.30
if exists("b:current_syntax")
finish
endif
runtime! syntax/scala.vim
syn region sbtString start="\"[^"]" skip="\\\"" end="\"" contains=sbtStringEscape
syn match sbtStringEscape "\\u[0-9a-fA-F]\{4}" contained
syn match sbtStringEscape "\\[nrfvb\\\"]" contained
syn match sbtIdentitifer "^\S\+\ze\s*\(:=\|++=\|+=\|<<=\|<+=\)"
syn match sbtBeginningSeq "^[Ss]eq\>"
syn match sbtSpecial "\(:=\|++=\|+=\|<<=\|<+=\)"
syn match sbtLineComment "//.*"
syn region sbtComment start="/\*" end="\*/"
syn region sbtDocComment start="/\*\*" end="\*/" keepend
hi link sbtString String
hi link sbtIdentitifer Keyword
hi link sbtBeginningSeq Keyword
hi link sbtSpecial Special
hi link sbtComment Comment
hi link sbtLineComment Comment
hi link sbtDocComment Comment
+2 -1
View File
@@ -2104,7 +2104,7 @@ test1 \
test30 test31 test32 test33 test34 test36 test37 test38 test39 \
test40 test41 test42 test43 test44 test45 test48 test49 \
test50 test51 test52 test53 test54 test55 test56 test57 test58 test59 \
test60 test64 test65 test66 test67 test68 test69 \
test60 test64 test66 test67 test68 test69 \
test70 test72 test73 test74 test75 test77 test78 test79 \
test80 test82 test83 test84 test85 test86 test87 test88 \
test90 test91 test94 test95 test97 test98 test99 \
@@ -2150,6 +2150,7 @@ test_arglist \
test_feedkeys \
test_file_perm \
test_fileformat \
test_filetype \
test_filter_cmd \
test_filter_map \
test_findfile \
-7
View File
@@ -9121,11 +9121,6 @@ $as_echo "no" >&6; }
fi
fi
if test "x$GUITYPE" = "xGTK"; then
if test "$gtk_minor_version" = 1 -a "0$gtk_micro_version" -ge 1 \
|| test "0$gtk_minor_version" -ge 2; then
$as_echo "#define HAVE_GTK_MULTIHEAD 1" >>confdefs.h
fi
if test -z "$SKIP_GNOME"; then
{
@@ -9418,8 +9413,6 @@ $as_echo "no" >&6; }
SKIP_MOTIF=YES
GUITYPE=GTK
$as_echo "#define HAVE_GTK_MULTIHEAD 1" >>confdefs.h
$as_echo "#define USE_GTK3 1" >>confdefs.h
fi
+14 -9
View File
@@ -372,18 +372,23 @@ open_buffer(
set_bufref(bufref_T *bufref, buf_T *buf)
{
bufref->br_buf = buf;
bufref->br_fnum = buf->b_fnum;
bufref->br_buf_free_count = buf_free_count;
}
/*
* Return TRUE if "bufref->br_buf" points to a valid buffer.
* Return TRUE if "bufref->br_buf" points to the same buffer as when
* set_bufref() was called and it is a valid buffer.
* Only goes through the buffer list if buf_free_count changed.
* Also checks if b_fnum is still the same, a :bwipe followed by :new might get
* the same allocated memory, but it's a different buffer.
*/
int
bufref_valid(bufref_T *bufref)
{
return bufref->br_buf_free_count == buf_free_count
? TRUE : buf_valid(bufref->br_buf);
? TRUE : buf_valid(bufref->br_buf)
&& bufref->br_fnum == bufref->br_buf->b_fnum;
}
/*
@@ -2265,14 +2270,14 @@ free_buf_options(
}
/*
* get alternate file n
* set linenr to lnum or altfpos.lnum if lnum == 0
* also set cursor column to altfpos.col if 'startofline' is not set.
* Get alternate file "n".
* Set linenr to "lnum" or altfpos.lnum if "lnum" == 0.
* Also set cursor column to altfpos.col if 'startofline' is not set.
* if (options & GETF_SETMARK) call setpcmark()
* if (options & GETF_ALT) we are jumping to an alternate file.
* if (options & GETF_SWITCH) respect 'switchbuf' settings when jumping
*
* return FAIL for failure, OK for success
* Return FAIL for failure, OK for success.
*/
int
buflist_getfile(
@@ -2351,8 +2356,8 @@ buflist_getfile(
#endif
++RedrawingDisabled;
if (getfile(buf->b_fnum, NULL, NULL, (options & GETF_SETMARK),
lnum, forceit) <= 0)
if (GETFILE_SUCCESS(getfile(buf->b_fnum, NULL, NULL,
(options & GETF_SETMARK), lnum, forceit)))
{
--RedrawingDisabled;
@@ -3003,7 +3008,7 @@ buflist_findlnum(buf_T *buf)
#if defined(FEAT_LISTCMDS) || defined(PROTO)
/*
* List all know file names (for :files and :buffers command).
* List all known file names (for :files and :buffers command).
*/
void
buflist_list(exarg_T *eap)
-3
View File
@@ -398,9 +398,6 @@
/* Define if you use KDE and want KDE Toolbar support. */
#undef FEAT_KDETOOLBAR
/* Define if GTK+ multihead support is available (requires GTK+ >= 2.1.1). */
#undef HAVE_GTK_MULTIHEAD
/* Define if your X has own locale library */
#undef X_LOCALE
-5
View File
@@ -2691,10 +2691,6 @@ if test -z "$SKIP_GTK2"; then
fi
fi
if test "x$GUITYPE" = "xGTK"; then
if test "$gtk_minor_version" = 1 -a "0$gtk_micro_version" -ge 1 \
|| test "0$gtk_minor_version" -ge 2; then
AC_DEFINE(HAVE_GTK_MULTIHEAD)
fi
dnl
dnl if GTK exists, then check for GNOME.
dnl
@@ -2743,7 +2739,6 @@ if test -z "$SKIP_GTK3"; then
SKIP_MOTIF=YES
GUITYPE=GTK
AC_SUBST(GTK_LIBNAME)
AC_DEFINE(HAVE_GTK_MULTIHEAD)
AC_DEFINE(USE_GTK3)
fi
fi
+5 -3
View File
@@ -3352,9 +3352,9 @@ f_float2nr(typval_T *argvars, typval_T *rettv)
if (get_float_arg(argvars, &f) == OK)
{
if (f < -VARNUM_MAX)
if (f <= -VARNUM_MAX + DBL_EPSILON)
rettv->vval.v_number = -VARNUM_MAX;
else if (f > VARNUM_MAX)
else if (f >= VARNUM_MAX - DBL_EPSILON)
rettv->vval.v_number = VARNUM_MAX;
else
rettv->vval.v_number = (varnumber_T)f;
@@ -10488,8 +10488,10 @@ f_sha256(typval_T *argvars, typval_T *rettv)
static void
f_shellescape(typval_T *argvars, typval_T *rettv)
{
int do_special = non_zero_arg(&argvars[1]);
rettv->vval.v_string = vim_strsave_shellescape(
get_tv_string(&argvars[0]), non_zero_arg(&argvars[1]), TRUE);
get_tv_string(&argvars[0]), do_special, do_special);
rettv->v_type = VAR_STRING;
}
+13 -10
View File
@@ -3520,11 +3520,14 @@ check_readonly(int *forceit, buf_T *buf)
/*
* Try to abandon current file and edit a new or existing file.
* 'fnum' is the number of the file, if zero use ffname/sfname.
* "fnum" is the number of the file, if zero use ffname/sfname.
* "lnum" is the line number for the cursor in the new file (if non-zero).
*
* Return 1 for "normal" error, 2 for "not written" error, 0 for success
* -1 for successfully opening another file.
* 'lnum' is the line number for the cursor in the new file (if non-zero).
* Return:
* GETFILE_ERROR for "normal" error,
* GETFILE_NOT_WRITTEN for "not written" error,
* GETFILE_SAME_FILE for success
* GETFILE_OPEN_OTHER for successfully opening another file.
*/
int
getfile(
@@ -3540,10 +3543,10 @@ getfile(
char_u *free_me = NULL;
if (text_locked())
return 1;
return GETFILE_ERROR;
#ifdef FEAT_AUTOCMD
if (curbuf_locked())
return 1;
return GETFILE_ERROR;
#endif
if (fnum == 0)
@@ -3570,7 +3573,7 @@ getfile(
if (other)
--no_wait_return;
EMSG(_(e_nowrtmsg));
retval = 2; /* file has been changed */
retval = GETFILE_NOT_WRITTEN; /* file has been changed */
goto theend;
}
}
@@ -3584,14 +3587,14 @@ getfile(
curwin->w_cursor.lnum = lnum;
check_cursor_lnum();
beginline(BL_SOL | BL_FIX);
retval = 0; /* it's in the same file */
retval = GETFILE_SAME_FILE; /* it's in the same file */
}
else if (do_ecmd(fnum, ffname, sfname, NULL, lnum,
(P_HID(curbuf) ? ECMD_HIDE : 0) + (forceit ? ECMD_FORCEIT : 0),
curwin) == OK)
retval = -1; /* opened another file */
retval = GETFILE_OPEN_OTHER; /* opened another file */
else
retval = 1; /* error encountered */
retval = GETFILE_ERROR; /* error encountered */
theend:
vim_free(free_me);
+23 -9
View File
@@ -3706,27 +3706,41 @@ theend:
vim_free(ffname);
}
static int did_source_packages = FALSE;
/*
* Add all packages in the "start" directory to 'runtimepath'.
*/
void
add_pack_start_dirs(void)
{
do_in_path(p_pp, (char_u *)"pack/*/start/*", DIP_ALL + DIP_DIR,
add_pack_plugin, &APP_ADD_DIR);
}
/*
* Load plugins from all packages in the "start" directory.
*/
void
load_start_packages(void)
{
did_source_packages = TRUE;
do_in_path(p_pp, (char_u *)"pack/*/start/*", DIP_ALL + DIP_DIR,
add_pack_plugin, &APP_LOAD);
}
/*
* ":packloadall"
* Find plugins in the package directories and source them.
* "eap" is NULL when invoked during startup.
*/
void
ex_packloadall(exarg_T *eap)
{
if (!did_source_packages || (eap != NULL && eap->forceit))
if (!did_source_packages || eap->forceit)
{
did_source_packages = TRUE;
/* First do a round to add all directories to 'runtimepath', then load
* the plugins. This allows for plugins to use an autoload directory
* of another plugin. */
do_in_path(p_pp, (char_u *)"pack/*/start/*", DIP_ALL + DIP_DIR,
add_pack_plugin, &APP_ADD_DIR);
do_in_path(p_pp, (char_u *)"pack/*/start/*", DIP_ALL + DIP_DIR,
add_pack_plugin, &APP_LOAD);
add_pack_start_dirs();
load_start_packages();
}
}
+12 -2
View File
@@ -5059,6 +5059,7 @@ expand_filename(
&& eap->cmdidx != CMD_lgrep
&& eap->cmdidx != CMD_grepadd
&& eap->cmdidx != CMD_lgrepadd
&& eap->cmdidx != CMD_hardcopy
#ifndef UNIX
&& !(eap->argt & NOSPC)
#endif
@@ -12207,13 +12208,22 @@ ex_filetype(exarg_T *eap)
}
/*
* ":setfiletype {name}"
* ":setfiletype [FALLBACK] {name}"
*/
static void
ex_setfiletype(exarg_T *eap)
{
if (!did_filetype)
set_option_value((char_u *)"filetype", 0L, eap->arg, OPT_LOCAL);
{
char_u *arg = eap->arg;
if (STRNCMP(arg, "FALLBACK ", 9) == 0)
arg += 9;
set_option_value((char_u *)"filetype", 0L, arg, OPT_LOCAL);
if (arg != eap->arg)
did_filetype = FALSE;
}
}
#endif
+3 -3
View File
@@ -2583,7 +2583,7 @@ vgetorpeek(int advance)
* get a character: 3. from the user - handle <Esc> in Insert mode
*/
/*
* special case: if we get an <ESC> in insert mode and there
* Special case: if we get an <ESC> in insert mode and there
* are no more characters at once, we pretend to go out of
* insert mode. This prevents the one second delay after
* typing an <ESC>. If we get something after all, we may
@@ -2617,8 +2617,8 @@ vgetorpeek(int advance)
mode_deleted = TRUE;
}
#ifdef FEAT_GUI
/* may show different cursor shape */
if (gui.in_use)
/* may show a different cursor shape */
if (gui.in_use && State != NORMAL && !cmd_silent)
{
int save_State;
+3 -1
View File
@@ -326,6 +326,8 @@ EXTERN int garbage_collect_at_exit INIT(= FALSE);
EXTERN scid_T current_SID INIT(= 0);
#endif
EXTERN int did_source_packages INIT(= FALSE);
/* Magic number used for hashitem "hi_key" value indicating a deleted item.
* Only the address is used. */
EXTERN char_u hash_removed;
@@ -385,7 +387,7 @@ EXTERN int keep_filetype INIT(= FALSE); /* value for did_filetype when
/* When deleting the current buffer, another one must be loaded. If we know
* which one is preferred, au_new_curbuf is set to it */
EXTERN bufref_T au_new_curbuf INIT(= {NULL COMMA 0});
EXTERN bufref_T au_new_curbuf INIT(= {NULL COMMA 0 COMMA 0});
/* When deleting a buffer/window and autocmd_busy is TRUE, do not free the
* buffer/window. but link it in the list starting with
+9 -4
View File
@@ -2892,6 +2892,10 @@ gui_insert_lines(int row, int count)
}
}
/*
* Returns OK if a character was found to be available within the given time,
* or FAIL otherwise.
*/
static int
gui_wait_for_chars_or_timer(long wtime)
{
@@ -2912,16 +2916,16 @@ gui_wait_for_chars_or_timer(long wtime)
if (typebuf.tb_change_cnt != tb_change_cnt)
{
/* timer may have used feedkeys() */
return FALSE;
return FAIL;
}
if (due_time <= 0 || (wtime > 0 && due_time > remaining))
due_time = remaining;
if (gui_mch_wait_for_chars(due_time))
return TRUE;
return OK;
if (wtime > 0)
remaining -= due_time;
}
return FALSE;
return FAIL;
#else
return gui_mch_wait_for_chars(wtime);
#endif
@@ -2939,6 +2943,7 @@ gui_wait_for_chars_or_timer(long wtime)
gui_wait_for_chars(long wtime)
{
int retval;
int tb_change_cnt = typebuf.tb_change_cnt;
#ifdef FEAT_MENU
/*
@@ -2996,7 +3001,7 @@ gui_wait_for_chars(long wtime)
}
#endif
if (retval == FAIL)
if (retval == FAIL && typebuf.tb_change_cnt == tb_change_cnt)
{
/* Blocking wait. */
before_blocking();
+2 -7
View File
@@ -1177,8 +1177,7 @@ drawBalloon(BalloonEval *beval)
int x_offset = EVAL_OFFSET_X;
int y_offset = EVAL_OFFSET_Y;
PangoLayout *layout;
# ifdef HAVE_GTK_MULTIHEAD
# if GTK_CHECK_VERSION(3,22,2)
# if GTK_CHECK_VERSION(3,22,2)
GdkRectangle rect;
GdkMonitor * const mon = gdk_display_get_monitor_at_window(
gtk_widget_get_display(beval->balloonShell),
@@ -1187,17 +1186,13 @@ drawBalloon(BalloonEval *beval)
screen_w = rect.width;
screen_h = rect.height;
# else
# else
GdkScreen *screen;
screen = gtk_widget_get_screen(beval->target);
gtk_window_set_screen(GTK_WINDOW(beval->balloonShell), screen);
screen_w = gdk_screen_get_width(screen);
screen_h = gdk_screen_get_height(screen);
# endif
# else
screen_w = gdk_screen_width();
screen_h = gdk_screen_height();
# endif
# if !GTK_CHECK_VERSION(3,0,0)
gtk_widget_ensure_style(beval->balloonShell);
+24 -51
View File
@@ -102,12 +102,8 @@ extern void bonobo_dock_item_set_behavior(BonoboDockItem *dock_item, BonoboDockI
/*
* Easy-to-use macro for multihead support.
*/
#ifdef HAVE_GTK_MULTIHEAD
# define GET_X_ATOM(atom) gdk_x11_atom_to_xatom_for_display( \
#define GET_X_ATOM(atom) gdk_x11_atom_to_xatom_for_display( \
gtk_widget_get_display(gui.mainwin), atom)
#else
# define GET_X_ATOM(atom) ((Atom)(atom))
#endif
/* Selection type distinguishers */
enum
@@ -2846,7 +2842,7 @@ mainwin_realize(GtkWidget *widget UNUSED, gpointer data UNUSED)
/*
* Cannot handle "XLib-only" windows with gtk event routines, we'll
* have to change the "server" registration to that of the main window
* If we have not registered a name yet, remember the window
* If we have not registered a name yet, remember the window.
*/
# if GTK_CHECK_VERSION(3,0,0)
serverChangeRegisteredWindow(GDK_WINDOW_XDISPLAY(mainwin_win),
@@ -2884,16 +2880,14 @@ create_blank_pointer(void)
char blank_data[] = { 0x0 };
#endif
#ifdef HAVE_GTK_MULTIHEAD
# if GTK_CHECK_VERSION(3,12,0)
#if GTK_CHECK_VERSION(3,12,0)
{
GdkWindow * const win = gtk_widget_get_window(gui.mainwin);
GdkScreen * const scrn = gdk_window_get_screen(win);
root_window = gdk_screen_get_root_window(scrn);
}
# else
#else
root_window = gtk_widget_get_root_window(gui.mainwin);
# endif
#endif
/* Create a pseudo blank pointer, which is in fact one pixel by one pixel
@@ -2932,7 +2926,6 @@ create_blank_pointer(void)
return cursor;
}
#ifdef HAVE_GTK_MULTIHEAD
static void
mainwin_screen_changed_cb(GtkWidget *widget,
GdkScreen *previous_screen UNUSED,
@@ -2945,22 +2938,22 @@ mainwin_screen_changed_cb(GtkWidget *widget,
* Recreate the invisible mouse cursor.
*/
if (gui.blank_pointer != NULL)
# if GTK_CHECK_VERSION(3,0,0)
#if GTK_CHECK_VERSION(3,0,0)
g_object_unref(G_OBJECT(gui.blank_pointer));
# else
#else
gdk_cursor_unref(gui.blank_pointer);
# endif
#endif
gui.blank_pointer = create_blank_pointer();
# if GTK_CHECK_VERSION(3,0,0)
#if GTK_CHECK_VERSION(3,0,0)
if (gui.pointer_hidden && gtk_widget_get_window(gui.drawarea) != NULL)
gdk_window_set_cursor(gtk_widget_get_window(gui.drawarea),
gui.blank_pointer);
# else
#else
if (gui.pointer_hidden && gui.drawarea->window != NULL)
gdk_window_set_cursor(gui.drawarea->window, gui.blank_pointer);
# endif
#endif
/*
* Create a new PangoContext for this screen, and initialize it
@@ -2978,7 +2971,6 @@ mainwin_screen_changed_cb(GtkWidget *widget,
gui_set_shellsize(FALSE, FALSE, RESIZE_BOTH);
}
}
#endif /* HAVE_GTK_MULTIHEAD */
/*
* After the drawing area comes up, we calculate all colors and create the
@@ -3907,12 +3899,8 @@ gui_mch_init(void)
GtkWidget *plug;
/* Use GtkSocket from another app. */
#ifdef HAVE_GTK_MULTIHEAD
plug = gtk_plug_new_for_display(gdk_display_get_default(),
gtk_socket_id);
#else
plug = gtk_plug_new(gtk_socket_id);
#endif
#if GTK_CHECK_VERSION(3,0,0)
if (plug != NULL && gtk_plug_get_socket_window(GTK_PLUG(plug)) != NULL)
#else
@@ -3972,10 +3960,10 @@ gui_mch_init(void)
gtk_signal_connect(GTK_OBJECT(gui.mainwin), "realize",
GTK_SIGNAL_FUNC(&mainwin_realize), NULL);
#endif
#ifdef HAVE_GTK_MULTIHEAD
g_signal_connect(G_OBJECT(gui.mainwin), "screen_changed",
g_signal_connect(G_OBJECT(gui.mainwin), "screen-changed",
G_CALLBACK(&mainwin_screen_changed_cb), NULL);
#endif
gui.accel_group = gtk_accel_group_new();
gtk_window_add_accel_group(GTK_WINDOW(gui.mainwin), gui.accel_group);
@@ -4992,8 +4980,7 @@ gui_mch_set_shellsize(int width, int height,
void
gui_mch_get_screen_dimensions(int *screen_w, int *screen_h)
{
#ifdef HAVE_GTK_MULTIHEAD
# if GTK_CHECK_VERSION(3,22,2)
#if GTK_CHECK_VERSION(3,22,2)
GdkRectangle rect;
GdkMonitor * const mon = gdk_display_get_monitor_at_window(
gtk_widget_get_display(gui.mainwin),
@@ -5001,8 +4988,10 @@ gui_mch_get_screen_dimensions(int *screen_w, int *screen_h)
gdk_monitor_get_geometry(mon, &rect);
*screen_w = rect.width;
/* Subtract 'guiheadroom' from the height to allow some room for the
* window manager (task list and window title bar). */
*screen_h = rect.height - p_ghr;
# else
#else
GdkScreen* screen;
if (gui.mainwin != NULL && gtk_widget_has_screen(gui.mainwin))
@@ -5011,13 +5000,9 @@ gui_mch_get_screen_dimensions(int *screen_w, int *screen_h)
screen = gdk_screen_get_default();
*screen_w = gdk_screen_get_width(screen);
*screen_h = gdk_screen_get_height(screen) - p_ghr;
# endif
#else
*screen_w = gdk_screen_width();
/* Subtract 'guiheadroom' from the height to allow some room for the
* window manager (task list and window title bar). */
*screen_h = gdk_screen_height() - p_ghr;
*screen_h = gdk_screen_get_height(screen) - p_ghr;
#endif
/*
@@ -6335,23 +6320,19 @@ gui_mch_get_display(void)
void
gui_mch_beep(void)
{
#ifdef HAVE_GTK_MULTIHEAD
GdkDisplay *display;
# if GTK_CHECK_VERSION(3,0,0)
#if GTK_CHECK_VERSION(3,0,0)
if (gui.mainwin != NULL && gtk_widget_get_realized(gui.mainwin))
# else
#else
if (gui.mainwin != NULL && GTK_WIDGET_REALIZED(gui.mainwin))
# endif
#endif
display = gtk_widget_get_display(gui.mainwin);
else
display = gdk_display_get_default();
if (display != NULL)
gdk_display_beep(display);
#else
gdk_beep();
#endif
}
void
@@ -6698,16 +6679,12 @@ theend:
void
gui_mch_flush(void)
{
#ifdef HAVE_GTK_MULTIHEAD
# if GTK_CHECK_VERSION(3,0,0)
#if GTK_CHECK_VERSION(3,0,0)
if (gui.mainwin != NULL && gtk_widget_get_realized(gui.mainwin))
# else
if (gui.mainwin != NULL && GTK_WIDGET_REALIZED(gui.mainwin))
# endif
gdk_display_flush(gtk_widget_get_display(gui.mainwin));
#else
gdk_flush(); /* historical misnomer: calls XSync(), not XFlush() */
if (gui.mainwin != NULL && GTK_WIDGET_REALIZED(gui.mainwin))
#endif
gdk_display_flush(gtk_widget_get_display(gui.mainwin));
}
/*
@@ -7298,12 +7275,8 @@ mch_set_mouse_shape(int shape)
id = mshape_ids[shape];
else
return;
# ifdef HAVE_GTK_MULTIHEAD
c = gdk_cursor_new_for_display(
gtk_widget_get_display(gui.drawarea), (GdkCursorType)id);
# else
c = gdk_cursor_new((GdkCursorType)id);
# endif
# if GTK_CHECK_VERSION(3,0,0)
gdk_window_set_cursor(gtk_widget_get_window(gui.drawarea), c);
# else
+3 -3
View File
@@ -4311,7 +4311,7 @@ restore_win_for_buf(
static int
SetBufferLine(buf_T *buf, PyInt n, PyObject *line, PyInt *len_change)
{
bufref_T save_curbuf = {NULL, 0};
bufref_T save_curbuf = {NULL, 0, 0};
win_T *save_curwin = NULL;
tabpage_T *save_curtab = NULL;
@@ -4415,7 +4415,7 @@ SetBufferLineList(
PyObject *list,
PyInt *len_change)
{
bufref_T save_curbuf = {NULL, 0};
bufref_T save_curbuf = {NULL, 0, 0};
win_T *save_curwin = NULL;
tabpage_T *save_curtab = NULL;
@@ -4616,7 +4616,7 @@ SetBufferLineList(
static int
InsertBufferLines(buf_T *buf, PyInt n, PyObject *lines, PyInt *len_change)
{
bufref_T save_curbuf = {NULL, 0};
bufref_T save_curbuf = {NULL, 0, 0};
win_T *save_curwin = NULL;
tabpage_T *save_curtab = NULL;
+3
View File
@@ -364,6 +364,9 @@
# if !defined(NAN)
# define NAN (INFINITY-INFINITY)
# endif
# if !defined(DBL_EPSILON)
# define DBL_EPSILON 2.2204460492503131e-16
# endif
# endif
#endif
+15 -4
View File
@@ -472,6 +472,12 @@ vim_main2(void)
*/
if (p_lpl)
{
/* First add all package directories to 'runtimepath', so that their
* autoload directories can be found. Only if not done already with a
* :packloadall command. */
if (!did_source_packages)
add_pack_start_dirs();
# ifdef VMS /* Somehow VMS doesn't handle the "**". */
source_runtime((char_u *)"plugin/*.vim", DIP_ALL | DIP_NOAFTER);
# else
@@ -479,7 +485,10 @@ vim_main2(void)
# endif
TIME_MSG("loading plugins");
ex_packloadall(NULL);
/* Only source "start" packages if not done already with a :packloadall
* command. */
if (!did_source_packages)
load_start_packages();
TIME_MSG("loading packages");
# ifdef VMS /* Somehow VMS doesn't handle the "**". */
@@ -833,6 +842,11 @@ vim_main2(void)
if (params.n_commands > 0)
exe_commands(&params);
#if defined(FEAT_TERMRESPONSE) && defined(FEAT_MBYTE)
/* Must be done before redrawing, puts a few characters on the screen. */
may_req_ambiguous_char_width();
#endif
RedrawingDisabled = 0;
redraw_all_later(NOT_VALID);
no_wait_return = FALSE;
@@ -846,9 +860,6 @@ vim_main2(void)
* argument doesn't make it appear in the shell Vim was started from. */
may_req_termresponse();
# if defined(FEAT_MBYTE)
may_req_ambiguous_char_width();
# endif
may_req_bg_color();
#endif
+2 -11
View File
@@ -5369,17 +5369,12 @@ im_synthesize_keypress(unsigned int keyval, unsigned int state)
{
GdkEventKey *event;
# ifdef HAVE_GTK_MULTIHEAD
event = (GdkEventKey *)gdk_event_new(GDK_KEY_PRESS);
# if GTK_CHECK_VERSION(3,0,0)
# if GTK_CHECK_VERSION(3,0,0)
g_object_ref(gtk_widget_get_window(gui.drawarea));
/* unreffed by gdk_event_free() */
# else
g_object_ref(gui.drawarea->window); /* unreffed by gdk_event_free() */
# endif
# else
event = (GdkEventKey *)g_malloc0((gulong)sizeof(GdkEvent));
event->type = GDK_KEY_PRESS;
g_object_ref(gui.drawarea->window); /* unreffed by gdk_event_free() */
# endif
# if GTK_CHECK_VERSION(3,0,0)
event->window = gtk_widget_get_window(gui.drawarea);
@@ -5402,11 +5397,7 @@ im_synthesize_keypress(unsigned int keyval, unsigned int state)
event->send_event = FALSE;
gtk_im_context_filter_keypress(xic, event);
# ifdef HAVE_GTK_MULTIHEAD
gdk_event_free((GdkEvent *)event);
# else
g_free(event);
# endif
}
# endif // FEAT_GUI_MACVIM
+1 -1
View File
@@ -9020,7 +9020,7 @@ nv_esc(cmdarg_T *cap)
#endif
&& !VIsual_active
&& no_reason)
MSG(_("Type :quit<Enter> to exit Vim"));
MSG(_("Type :qa! and press <Enter> to abandon all changes and exit Vim"));
/* Don't reset "restart_edit" when 'insertmode' is set, it won't be
* set again below when halfway a mapping. */
+506 -408
View File
File diff suppressed because it is too large Load Diff
+2
View File
@@ -72,6 +72,8 @@ void ex_runtime(exarg_T *eap);
int source_runtime(char_u *name, int flags);
int do_in_path(char_u *path, char_u *name, int flags, void (*callback)(char_u *fname, void *ck), void *cookie);
int do_in_runtimepath(char_u *name, int flags, void (*callback)(char_u *fname, void *ck), void *cookie);
void add_pack_start_dirs(void);
void load_start_packages(void);
void ex_packloadall(exarg_T *eap);
void ex_packadd(exarg_T *eap);
void ex_options(exarg_T *eap);
+55 -39
View File
@@ -118,10 +118,10 @@ struct efm_S
static efm_T *fmt_start = NULL; /* cached across qf_parse_line() calls */
static int qf_init_ext(qf_info_T *qi, char_u *efile, buf_T *buf, typval_T *tv, char_u *errorformat, int newlist, linenr_T lnumfirst, linenr_T lnumlast, char_u *qf_title, char_u *enc);
static void qf_store_title(qf_info_T *qi, char_u *title);
static void qf_store_title(qf_info_T *qi, int qf_idx, char_u *title);
static void qf_new_list(qf_info_T *qi, char_u *qf_title);
static void ll_free_all(qf_info_T **pqi);
static int qf_add_entry(qf_info_T *qi, char_u *dir, char_u *fname, int bufnum, char_u *mesg, long lnum, int col, int vis_col, char_u *pattern, int nr, int type, int valid);
static int qf_add_entry(qf_info_T *qi, int qf_idx, char_u *dir, char_u *fname, int bufnum, char_u *mesg, long lnum, int col, int vis_col, char_u *pattern, int nr, int type, int valid);
static qf_info_T *ll_new_list(void);
static void qf_free(qf_info_T *qi, int idx);
static char_u *qf_types(int, int);
@@ -157,6 +157,13 @@ static qf_info_T *ll_get_or_alloc_list(win_T *);
*/
#define GET_LOC_LIST(wp) (IS_LL_WINDOW(wp) ? wp->w_llist_ref : wp->w_llist)
/*
* Looking up a buffer can be slow if there are many. Remember the last one
* to make this a lot faster if there are multiple matches in the same file.
*/
static char_u *qf_last_bufname = NULL;
static bufref_T qf_last_bufref = {NULL, 0, 0};
/*
* Read the errorfile "efile" into memory, line by line, building the error
* list. Set the error list's title to qf_title.
@@ -1151,6 +1158,10 @@ qf_init_ext(
int retval = -1; /* default: return error flag */
int status;
/* Do not used the cached buffer, it may have been wiped out. */
vim_free(qf_last_bufname);
qf_last_bufname = NULL;
vim_memset(&state, 0, sizeof(state));
vim_memset(&fields, 0, sizeof(fields));
#ifdef FEAT_MBYTE
@@ -1266,6 +1277,7 @@ qf_init_ext(
continue;
if (qf_add_entry(qi,
qi->qf_curlist,
qi->qf_directory,
(*fields.namebuf || qi->qf_directory != NULL)
? fields.namebuf
@@ -1333,13 +1345,13 @@ qf_init_end:
}
static void
qf_store_title(qf_info_T *qi, char_u *title)
qf_store_title(qf_info_T *qi, int qf_idx, char_u *title)
{
if (title != NULL)
{
char_u *p = alloc((int)STRLEN(title) + 2);
qi->qf_lists[qi->qf_curlist].qf_title = p;
qi->qf_lists[qf_idx].qf_title = p;
if (p != NULL)
sprintf((char *)p, ":%s", (char *)title);
}
@@ -1375,7 +1387,7 @@ qf_new_list(qf_info_T *qi, char_u *qf_title)
else
qi->qf_curlist = qi->qf_listcount++;
vim_memset(&qi->qf_lists[qi->qf_curlist], 0, (size_t)(sizeof(qf_list_T)));
qf_store_title(qi, qf_title);
qf_store_title(qi, qi->qf_curlist, qf_title);
}
/*
@@ -1427,6 +1439,7 @@ qf_free_all(win_T *wp)
static int
qf_add_entry(
qf_info_T *qi, /* quickfix list */
int qf_idx, /* list index */
char_u *dir, /* optional directory name */
char_u *fname, /* file name or NULL */
int bufnum, /* buffer number or zero */
@@ -1477,13 +1490,13 @@ qf_add_entry(
qfp->qf_type = type;
qfp->qf_valid = valid;
lastp = &qi->qf_lists[qi->qf_curlist].qf_last;
if (qi->qf_lists[qi->qf_curlist].qf_count == 0)
lastp = &qi->qf_lists[qf_idx].qf_last;
if (qi->qf_lists[qf_idx].qf_count == 0)
/* first element in the list */
{
qi->qf_lists[qi->qf_curlist].qf_start = qfp;
qi->qf_lists[qi->qf_curlist].qf_ptr = qfp;
qi->qf_lists[qi->qf_curlist].qf_index = 0;
qi->qf_lists[qf_idx].qf_start = qfp;
qi->qf_lists[qf_idx].qf_ptr = qfp;
qi->qf_lists[qf_idx].qf_index = 0;
qfp->qf_prev = NULL;
}
else
@@ -1494,13 +1507,13 @@ qf_add_entry(
qfp->qf_next = NULL;
qfp->qf_cleared = FALSE;
*lastp = qfp;
++qi->qf_lists[qi->qf_curlist].qf_count;
if (qi->qf_lists[qi->qf_curlist].qf_index == 0 && qfp->qf_valid)
++qi->qf_lists[qf_idx].qf_count;
if (qi->qf_lists[qf_idx].qf_index == 0 && qfp->qf_valid)
/* first valid entry */
{
qi->qf_lists[qi->qf_curlist].qf_index =
qi->qf_lists[qi->qf_curlist].qf_count;
qi->qf_lists[qi->qf_curlist].qf_ptr = qfp;
qi->qf_lists[qf_idx].qf_index =
qi->qf_lists[qf_idx].qf_count;
qi->qf_lists[qf_idx].qf_ptr = qfp;
}
return OK;
@@ -1617,6 +1630,7 @@ copy_loclist(win_T *from, win_T *to)
++i, from_qfp = from_qfp->qf_next)
{
if (qf_add_entry(to->w_llist,
to->w_llist->qf_curlist,
NULL,
NULL,
0,
@@ -1659,13 +1673,6 @@ copy_loclist(win_T *from, win_T *to)
to->w_llist->qf_curlist = qi->qf_curlist; /* current list */
}
/*
* Looking up a buffer can be slow if there are many. Remember the last one
* to make this a lot faster if there are multiple matches in the same file.
*/
static char_u *qf_last_bufname = NULL;
static bufref_T qf_last_bufref = {NULL, 0};
/*
* Get buffer number for file "directory/fname".
* Also sets the b_has_qf_entry flag.
@@ -2728,7 +2735,7 @@ qf_history(exarg_T *eap)
}
/*
* Free error list "idx".
* Free all the entries in the error list "idx".
*/
static void
qf_free(qf_info_T *qi, int idx)
@@ -4236,6 +4243,7 @@ ex_vimgrep(exarg_T *eap)
* dummy buffer, unless duplicate_name is set, then the
* buffer will be wiped out below. */
if (qf_add_entry(qi,
qi->qf_curlist,
NULL, /* dir */
fname,
duplicate_name ? 0 : buf->b_fnum,
@@ -4740,6 +4748,7 @@ get_errorlist_properties(win_T *wp, dict_T *what, dict_T *retdict)
static int
qf_add_entries(
qf_info_T *qi,
int qf_idx,
list_T *list,
char_u *title,
int action)
@@ -4758,18 +4767,21 @@ qf_add_entries(
int retval = OK;
int did_bufnr_emsg = FALSE;
if (action == ' ' || qi->qf_curlist == qi->qf_listcount)
if (action == ' ' || qf_idx == qi->qf_listcount)
{
/* make place for a new list */
qf_new_list(qi, title);
qf_idx = qi->qf_curlist;
}
#ifdef FEAT_WINDOWS
else if (action == 'a' && qi->qf_lists[qi->qf_curlist].qf_count > 0)
else if (action == 'a' && qi->qf_lists[qf_idx].qf_count > 0)
/* Adding to existing list, use last entry. */
old_last = qi->qf_lists[qi->qf_curlist].qf_last;
old_last = qi->qf_lists[qf_idx].qf_last;
#endif
else if (action == 'r')
{
qf_free(qi, qi->qf_curlist);
qf_store_title(qi, title);
qf_free(qi, qf_idx);
qf_store_title(qi, qf_idx, title);
}
for (li = list->lv_first; li != NULL; li = li->li_next)
@@ -4815,6 +4827,7 @@ qf_add_entries(
valid = (int)get_dict_number(d, (char_u *)"valid");
status = qf_add_entry(qi,
qf_idx,
NULL, /* dir */
filename,
bufnum,
@@ -4839,17 +4852,17 @@ qf_add_entries(
}
}
if (qi->qf_lists[qi->qf_curlist].qf_index == 0)
if (qi->qf_lists[qf_idx].qf_index == 0)
/* no valid entry */
qi->qf_lists[qi->qf_curlist].qf_nonevalid = TRUE;
qi->qf_lists[qf_idx].qf_nonevalid = TRUE;
else
qi->qf_lists[qi->qf_curlist].qf_nonevalid = FALSE;
qi->qf_lists[qf_idx].qf_nonevalid = FALSE;
if (action != 'a')
{
qi->qf_lists[qi->qf_curlist].qf_ptr =
qi->qf_lists[qi->qf_curlist].qf_start;
if (qi->qf_lists[qi->qf_curlist].qf_count > 0)
qi->qf_lists[qi->qf_curlist].qf_index = 1;
qi->qf_lists[qf_idx].qf_ptr =
qi->qf_lists[qf_idx].qf_start;
if (qi->qf_lists[qf_idx].qf_count > 0)
qi->qf_lists[qf_idx].qf_index = 1;
}
#ifdef FEAT_WINDOWS
@@ -4877,7 +4890,9 @@ qf_set_properties(qf_info_T *qi, dict_T *what, int action)
/* Use the specified quickfix/location list */
if (di->di_tv.v_type == VAR_NUMBER)
{
qf_idx = di->di_tv.vval.v_number - 1;
/* for zero use the current list */
if (di->di_tv.vval.v_number != 0)
qf_idx = di->di_tv.vval.v_number - 1;
if (qf_idx < 0 || qf_idx >= qi->qf_listcount)
return FAIL;
}
@@ -4908,11 +4923,11 @@ qf_set_properties(qf_info_T *qi, dict_T *what, int action)
if ((di = dict_find(what, (char_u *)"context", -1)) != NULL)
{
typval_T *ctx;
free_tv(qi->qf_lists[qi->qf_curlist].qf_ctx);
free_tv(qi->qf_lists[qf_idx].qf_ctx);
ctx = alloc_tv();
if (ctx != NULL)
copy_tv(&di->di_tv, ctx);
qi->qf_lists[qi->qf_curlist].qf_ctx = ctx;
qi->qf_lists[qf_idx].qf_ctx = ctx;
}
return retval;
@@ -5018,7 +5033,7 @@ set_errorlist(
else if (what != NULL)
retval = qf_set_properties(qi, what, action);
else
retval = qf_add_entries(qi, list, title, action);
retval = qf_add_entries(qi, qi->qf_curlist, list, title, action);
return retval;
}
@@ -5381,6 +5396,7 @@ ex_helpgrep(exarg_T *eap)
line[--l] = NUL;
if (qf_add_entry(qi,
qi->qf_curlist,
NULL, /* dir */
fnames[fi],
0,
+7 -3
View File
@@ -358,6 +358,10 @@ static char_u *regprop(char_u *);
static int re_mult_next(char *what);
static char_u e_missingbracket[] = N_("E769: Missing ] after %s[");
static char_u e_reverse_range[] = N_("E944: Reverse range in character class");
#ifdef FEAT_MBYTE
static char_u e_large_class[] = N_("E945: Range too large in character class");
#endif
static char_u e_unmatchedpp[] = N_("E53: Unmatched %s%%(");
static char_u e_unmatchedp[] = N_("E54: Unmatched %s(");
static char_u e_unmatchedpar[] = N_("E55: Unmatched %s)");
@@ -2426,14 +2430,14 @@ collection:
endc = coll_get_char();
if (startc > endc)
EMSG_RET_NULL(_(e_invrange));
EMSG_RET_NULL(_(e_reverse_range));
#ifdef FEAT_MBYTE
if (has_mbyte && ((*mb_char2len)(startc) > 1
|| (*mb_char2len)(endc) > 1))
{
/* Limit to a range of 256 chars */
/* Limit to a range of 256 chars. */
if (endc > startc + 256)
EMSG_RET_NULL(_(e_invrange));
EMSG_RET_NULL(_(e_large_class));
while (++startc <= endc)
regmbc(startc);
}
+7 -5
View File
@@ -628,37 +628,39 @@ nfa_recognize_char_class(char_u *start, char_u *end, int extra_newl)
config |= CLASS_o9;
break;
}
else
if (*(p + 2) == '7')
{
config |= CLASS_o7;
break;
}
return FAIL;
case 'a':
if (*(p + 2) == 'z')
{
config |= CLASS_az;
break;
}
else
if (*(p + 2) == 'f')
{
config |= CLASS_af;
break;
}
return FAIL;
case 'A':
if (*(p + 2) == 'Z')
{
config |= CLASS_AZ;
break;
}
else
if (*(p + 2) == 'F')
{
config |= CLASS_AF;
break;
}
/* FALLTHROUGH */
return FAIL;
default:
return FAIL;
}
@@ -1851,7 +1853,7 @@ collection:
endc = startc;
startc = oldstartc;
if (startc > endc)
EMSG_RET_FAIL(_(e_invrange));
EMSG_RET_FAIL(_(e_reverse_range));
if (endc > startc + 2)
{
+31 -15
View File
@@ -1533,9 +1533,9 @@ end_do_search:
* search_for_exact_line(buf, pos, dir, pat)
*
* Search for a line starting with the given pattern (ignoring leading
* white-space), starting from pos and going in direction dir. pos will
* white-space), starting from pos and going in direction "dir". "pos" will
* contain the position of the match found. Blank lines match only if
* ADDING is set. if p_ic is set then the pattern must be in lowercase.
* ADDING is set. If p_ic is set then the pattern must be in lowercase.
* Return OK for success, or FAIL if no line found.
*/
int
@@ -4373,7 +4373,7 @@ current_quote(
int selected_quote = FALSE; /* Has quote inside selection */
int i;
/* Correct cursor when 'selection' is exclusive */
/* Correct cursor when 'selection' is "exclusive". */
if (VIsual_active)
{
/* this only works within one line */
@@ -4381,8 +4381,19 @@ current_quote(
return FALSE;
vis_bef_curs = LT_POS(VIsual, curwin->w_cursor);
if (*p_sel == 'e' && vis_bef_curs)
if (*p_sel == 'e')
{
if (!vis_bef_curs)
{
/* VIsual needs to be start of Visual selection. */
pos_T t = curwin->w_cursor;
curwin->w_cursor = VIsual;
VIsual = t;
vis_bef_curs = TRUE;
}
dec_cursor();
}
vis_empty = EQUAL_POS(VIsual, curwin->w_cursor);
}
@@ -4597,7 +4608,7 @@ current_quote(
#endif /* FEAT_TEXTOBJ */
static int is_one_char(char_u *pattern, int move);
static int is_one_char(char_u *pattern, int move, pos_T *cur);
/*
* Find next search match under cursor, cursor at end.
@@ -4645,7 +4656,7 @@ current_search(
orig_pos = pos = curwin->w_cursor;
/* Is the pattern is zero-width? */
one_char = is_one_char(spats[last_idx].pat, TRUE);
one_char = is_one_char(spats[last_idx].pat, TRUE, &curwin->w_cursor);
if (one_char == -1)
{
p_ws = old_p_ws;
@@ -4708,7 +4719,10 @@ current_search(
/* Check again from the current cursor position,
* since the next match might actually by only one char wide */
one_char = is_one_char(spats[last_idx].pat, FALSE);
one_char = is_one_char(spats[last_idx].pat, FALSE, &pos);
if (one_char < 0)
/* search failed, abort */
return FAIL;
/* move to match, except for zero-width matches, in which case, we are
* already on the next match */
@@ -4759,12 +4773,12 @@ current_search(
/*
* Check if the pattern is one character long or zero-width.
* If move is TRUE, check from the beginning of the buffer, else from the
* current cursor position.
* If move is TRUE, check from the beginning of the buffer, else from position
* "cur".
* Returns TRUE, FALSE or -1 for failure.
*/
static int
is_one_char(char_u *pattern, int move)
is_one_char(char_u *pattern, int move, pos_T *cur)
{
regmmatch_T regmatch;
int nmatched = 0;
@@ -4789,7 +4803,7 @@ is_one_char(char_u *pattern, int move)
}
else
{
pos = curwin->w_cursor;
pos = *cur;
/* accept a match at the cursor position */
flag = SEARCH_START;
}
@@ -5406,8 +5420,9 @@ search_line:
#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
if (g_do_tagpreview != 0)
{
if (getfile(0, curwin_save->w_buffer->b_fname,
NULL, TRUE, lnum, FALSE) > 0)
if (!GETFILE_SUCCESS(getfile(
0, curwin_save->w_buffer->b_fname,
NULL, TRUE, lnum, FALSE)))
break; /* failed to jump to file */
}
else
@@ -5417,8 +5432,9 @@ search_line:
}
else
{
if (getfile(0, files[depth].name, NULL, TRUE,
files[depth].lnum, FALSE) > 0)
if (!GETFILE_SUCCESS(getfile(
0, files[depth].name, NULL, TRUE,
files[depth].lnum, FALSE)))
break; /* failed to jump to file */
/* autocommands may have changed the lnum, we don't
* want that here */
+3 -1
View File
@@ -69,11 +69,13 @@ typedef struct frame_S frame_T;
typedef int scid_T; /* script ID */
typedef struct file_buffer buf_T; /* forward declaration */
/* Reference to a buffer that stores the value of buf_free_count.
/*
* Reference to a buffer that stores the value of buf_free_count.
* bufref_valid() only needs to check "buf" when the count differs.
*/
typedef struct {
buf_T *br_buf;
int br_fnum;
int br_buf_free_count;
} bufref_T;
+13 -6
View File
@@ -7835,18 +7835,25 @@ do_highlight(
must_redraw = CLEAR;
if (color >= 0)
{
int dark = -1;
if (termcap_active)
term_bg_color(color);
if (t_colors < 16)
i = (color == 0 || color == 4);
else
i = (color < 7 || color == 8);
dark = (color == 0 || color == 4);
/* Limit the heuristic to the standard 16 colors */
else if (color < 16)
dark = (color < 7 || color == 8);
/* Set the 'background' option if the value is
* wrong. */
if (i != (*p_bg == 'd'))
if (dark != -1
&& dark != (*p_bg == 'd')
&& !option_was_set((char_u *)"bg"))
{
set_option_value((char_u *)"bg", 0L,
i ? (char_u *)"dark"
: (char_u *)"light", 0);
(char_u *)(dark ? "dark" : "light"), 0);
reset_option_was_set((char_u *)"bg");
}
}
}
}
+28 -5
View File
@@ -3088,7 +3088,7 @@ jumpto_tag(
char_u *fname;
tagptrs_T tagp;
int retval = FAIL;
int getfile_result;
int getfile_result = GETFILE_UNUSED;
int search_options;
#ifdef FEAT_SEARCH_EXTRA
int save_no_hlsearch;
@@ -3202,7 +3202,29 @@ jumpto_tag(
/* If it was a CTRL-W CTRL-] command split window now. For ":tab tag"
* open a new tab page. */
if (postponed_split || cmdmod.tab != 0)
if (postponed_split && (swb_flags & (SWB_USEOPEN | SWB_USETAB)))
{
buf_T *existing_buf = buflist_findname_exp(fname);
if (existing_buf != NULL)
{
win_T *wp = NULL;
if (swb_flags & SWB_USEOPEN)
wp = buf_jump_open_win(existing_buf);
/* If 'switchbuf' contains "usetab": jump to first window in any tab
* page containing "existing_buf" if one exists */
if (wp == NULL && (swb_flags & SWB_USETAB))
wp = buf_jump_open_tab(existing_buf);
/* We've switched to the buffer, the usual loading of the file must
* be skipped. */
if (wp != NULL)
getfile_result = GETFILE_SAME_FILE;
}
}
if (getfile_result == GETFILE_UNUSED
&& (postponed_split || cmdmod.tab != 0))
{
if (win_split(postponed_split > 0 ? postponed_split : 0,
postponed_split_flags) == FAIL)
@@ -3225,10 +3247,11 @@ jumpto_tag(
#endif
keep_help_flag = curbuf->b_help;
}
getfile_result = getfile(0, fname, NULL, TRUE, (linenr_T)0, forceit);
if (getfile_result == GETFILE_UNUSED)
getfile_result = getfile(0, fname, NULL, TRUE, (linenr_T)0, forceit);
keep_help_flag = FALSE;
if (getfile_result <= 0) /* got to the right file */
if (GETFILE_SUCCESS(getfile_result)) /* got to the right file */
{
curwin->w_set_curswant = TRUE;
#ifdef FEAT_WINDOWS
@@ -3377,7 +3400,7 @@ jumpto_tag(
#endif
/* Return OK if jumped to another file (at least we found the file!). */
if (getfile_result == -1)
if (getfile_result == GETFILE_OPEN_OTHER)
retval = OK;
if (retval == OK)
+16 -6
View File
@@ -3339,9 +3339,13 @@ may_req_ambiguous_char_width(void)
out_str(T_U7);
u7_status = U7_SENT;
out_flush();
/* This overwrites a few characters on the screen, a redraw is needed
* after this. Clear them out for now. */
term_windgoto(1, 0);
out_str((char_u *)" ");
term_windgoto(0, 0);
/* check for the characters now, otherwise they might be eaten by
* get_keystroke() */
out_flush();
@@ -4391,14 +4395,20 @@ check_termcode(
if (i - j >= 21 && STRNCMP(tp + j + 3, "rgb:", 4) == 0
&& tp[j + 11] == '/' && tp[j + 16] == '/'
&& !option_was_set((char_u *)"bg"))
{/* TODO: don't set option when already the right value */
{
char *newval = (3 * '6' < tp[j+7] + tp[j+12]
+ tp[j+17]) ? "light" : "dark";
LOG_TR("Received RBG");
rbg_status = RBG_GOT;
set_option_value((char_u *)"bg", 0L, (char_u *)(
(3 * '6' < tp[j+7] + tp[j+12] + tp[j+17])
? "light" : "dark"), 0);
reset_option_was_set((char_u *)"bg");
redraw_asap(CLEAR);
if (STRCMP(p_bg, newval) != 0)
{
/* value differs, apply it */
set_option_value((char_u *)"bg", 0L,
(char_u *)newval, 0);
reset_option_was_set((char_u *)"bg");
redraw_asap(CLEAR);
}
}
/* got finished code: consume it */
-1
View File
@@ -50,7 +50,6 @@ SCRIPTS_ALL = \
test57.out \
test60.out \
test64.out \
test65.out \
test66.out \
test67.out \
test68.out \
+1 -1
View File
@@ -87,7 +87,7 @@ SCRIPT = test1.out test3.out test4.out test5.out \
test43.out test44.out test45.out \
test48.out test49.out test51.out test53.out test54.out \
test55.out test56.out test57.out test60.out \
test64.out test65.out \
test64.out \
test66.out test67.out test68.out test69.out \
test72.out test75.out \
test77a.out test78.out test79.out test80.out \
+9 -3
View File
@@ -98,9 +98,15 @@ p:s/\%#=2\U//g
p:s/\%#=0[^A-Z]//g
p:s/\%#=1[^A-Z]//g
p:s/\%#=2[^A-Z]//g
p:s/\%#=0\%204l^\t...//g
p:s/\%#=1\%205l^\t...//g
p:s/\%#=2\%206l^\t...//g
p:s/\%#=0\%210l^\t...//g
p:s/\%#=1\%211l^\t...//g
p:s/\%#=2\%212l^\t...//g
p:s/\%#=0[0-z]//g
p:s/\%#=1[0-z]//g
p:s/\%#=2[0-z]//g
p:s/\%#=0[^0-z]//g
p:s/\%#=1[^0-z]//g
p:s/\%#=2[^0-z]//g
:/^start-here/+1,$wq! test.out
ENDTEST
+6
View File
@@ -97,3 +97,9 @@ ABCDEFGHIXYZ
!"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~Ρ芝嚔
!"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~Ρ芝嚔
!"#$%&'()#+'-./0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz{|}~Ρ芝嚔
!"#$%&'()#+'-./{|}~Ρ芝嚔
!"#$%&'()#+'-./{|}~Ρ芝嚔
!"#$%&'()#+'-./{|}~Ρ芝嚔
0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz
0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz
0123456789:;<=>?@ABCDEFGHIXYZ[\]^_`abcdefghiwxyz
-95
View File
@@ -1,95 +0,0 @@
Test for floating point and logical operators.
STARTTEST
:so small.vim
:if !has("float")
: e! test.ok
: wq! test.out
:endif
:"
:$put =printf('%f', 123.456)
:$put =printf('%e', 123.456)
:$put =printf('%g', 123.456)
:" check we don't crash on division by zero
:echo 1.0 / 0.0
:$put ='+='
:let v = 1.234
:let v += 6.543
:$put =printf('%g', v)
:let v = 1.234
:let v += 5
:$put =printf('%g', v)
:let a = 5
:let a += 3.333
:$put =string(a)
:$put ='=='
:let v = 1.234
:$put =v == 1.234
:$put =v == 1.2341
:$put ='add-subtract'
:$put =printf('%g', 4 + 1.234)
:$put =printf('%g', 1.234 - 8)
:$put ='mult-div'
:$put =printf('%g', 4 * 1.234)
:$put =printf('%g', 4.0 / 1234)
:$put ='dict'
:$put =string({'x': 1.234, 'y': -2.0e20})
:$put ='list'
:$put =string([-123.4, 2.0e-20])
:$put ='abs'
:$put =printf('%d', abs(1456))
:$put =printf('%d', abs(-4))
:$put =printf('%d', abs([1, 2, 3]))
:$put =printf('%g', abs(14.56))
:$put =printf('%g', abs(-54.32))
:$put ='ceil'
:$put =printf('%g', ceil(1.456))
:$put =printf('%g', ceil(-5.456))
:$put =printf('%g', ceil(-4.000))
:$put ='floor'
:$put =printf('%g', floor(1.856))
:$put =printf('%g', floor(-5.456))
:$put =printf('%g', floor(4.0))
:$put ='log10'
:$put =printf('%g', log10(1000))
:$put =printf('%g', log10(0.01000))
:$put ='pow'
:$put =printf('%g', pow(3, 3.0))
:$put =printf('%g', pow(2, 16))
:$put ='round'
:$put =printf('%g', round(0.456))
:$put =printf('%g', round(4.5))
:$put =printf('%g', round(-4.50))
:$put ='sqrt'
:$put =printf('%g', sqrt(100))
:echo sqrt(-4.01)
:$put ='str2float'
:$put =printf('%g', str2float('1e40'))
:$put ='trunc'
:$put =printf('%g', trunc(1.456))
:$put =printf('%g', trunc(-5.456))
:$put =printf('%g', trunc(4.000))
:$put ='float2nr'
:$put =float2nr(123.456)
:$put =float2nr(-123.456)
:$put ='AND'
:$put =and(127, 127)
:$put =and(127, 16)
:$put =and(127, 128)
:$put ='OR'
:$put =or(16, 7)
:$put =or(8, 7)
:$put =or(0, 123)
:$put ='XOR'
:$put =xor(127, 127)
:$put =xor(127, 16)
:$put =xor(127, 128)
:$put ='invert'
:$put =and(invert(127), 65535)
:$put =and(invert(16), 65535)
:$put =and(invert(128), 65535)
:$put =invert(1.0)
:/^Results/,$wq! test.out
ENDTEST
Results of test65:
-73
View File
@@ -1,73 +0,0 @@
Results of test65:
123.456000
1.234560e+02
123.456
+=
7.777
6.234
8.333
==
1
0
add-subtract
5.234
-6.766
mult-div
4.936
0.003241
dict
{'x': 1.234, 'y': -2.0e20}
list
[-123.4, 2.0e-20]
abs
1456
4
-1
14.56
54.32
ceil
2.0
-5.0
-4.0
floor
1.0
-6.0
4.0
log10
3.0
-2.0
pow
27.0
65536.0
round
0.0
5.0
-5.0
sqrt
10.0
str2float
1.0e40
trunc
1.0
-5.0
4.0
float2nr
123
-123
AND
127
16
0
OR
23
15
123
XOR
0
111
255
invert
65408
65519
65407
0
+1
View File
@@ -16,6 +16,7 @@ source test_expr.vim
source test_feedkeys.vim
source test_file_perm.vim
source test_fileformat.vim
source test_filetype.vim
source test_filter_cmd.vim
source test_filter_map.vim
source test_findfile.vim
+43
View File
@@ -0,0 +1,43 @@
" Test :setfiletype
func Test_detection()
filetype on
augroup filetypedetect
au BufNewFile,BufRead * call assert_equal(1, did_filetype())
augroup END
new something.vim
call assert_equal('vim', &filetype)
bwipe!
filetype off
endfunc
func Test_conf_type()
filetype on
call writefile(['# some comment', 'must be conf'], 'Xfile')
augroup filetypedetect
au BufNewFile,BufRead * call assert_equal(0, did_filetype())
augroup END
split Xfile
call assert_equal('conf', &filetype)
bwipe!
call delete('Xfile')
filetype off
endfunc
func Test_other_type()
filetype on
augroup filetypedetect
au BufNewFile,BufRead * call assert_equal(0, did_filetype())
au BufNewFile,BufRead Xfile setf testfile
au BufNewFile,BufRead * call assert_equal(1, did_filetype())
augroup END
call writefile(['# some comment', 'must be conf'], 'Xfile')
split Xfile
call assert_equal('testfile', &filetype)
bwipe!
call delete('Xfile')
filetype off
endfunc
+47
View File
@@ -224,6 +224,20 @@ func Test_str2float()
call assert_fails("call str2float(function('string'))", 'E729:')
endfunc
func Test_float2nr()
call assert_equal(1, float2nr(1.234))
call assert_equal(123, float2nr(1.234e2))
call assert_equal(12, float2nr(123.4e-1))
let max_number = 1/0
let min_number = -max_number
call assert_equal(max_number/2+1, float2nr(pow(2, 62)))
call assert_equal(max_number, float2nr(pow(2, 63)))
call assert_equal(max_number, float2nr(pow(2, 64)))
call assert_equal(min_number/2-1, float2nr(-pow(2, 62)))
call assert_equal(min_number, float2nr(-pow(2, 63)))
call assert_equal(min_number, float2nr(-pow(2, 64)))
endfunc
func Test_floor()
call assert_equal('2.0', string(floor(2.0)))
call assert_equal('2.0', string(floor(2.11)))
@@ -282,3 +296,36 @@ func Test_isnan()
call assert_equal(0, isnan([]))
call assert_equal(0, isnan({}))
endfunc
" This was converted from test65
func Test_float_misc()
call assert_equal('123.456000', printf('%f', 123.456))
call assert_equal('1.234560e+02', printf('%e', 123.456))
call assert_equal('123.456', printf('%g', 123.456))
" +=
let v = 1.234
let v += 6.543
call assert_equal('7.777', printf('%g', v))
let v = 1.234
let v += 5
call assert_equal('6.234', printf('%g', v))
let v = 5
let v += 3.333
call assert_equal('8.333', string(v))
" ==
let v = 1.234
call assert_true(v == 1.234)
call assert_false(v == 1.2341)
" add-subtract
call assert_equal('5.234', printf('%g', 4 + 1.234))
call assert_equal('-6.766', printf('%g', 1.234 - 8))
" mult-div
call assert_equal('4.936', printf('%g', 4 * 1.234))
call assert_equal('0.003241', printf('%g', 4.0 / 1234))
" dict
call assert_equal("{'x': 1.234, 'y': -2.0e20}", string({'x': 1.234, 'y': -2.0e20}))
" list
call assert_equal('[-123.4, 2.0e-20]', string([-123.4, 2.0e-20]))
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+25
View File
@@ -784,3 +784,28 @@ func Test_redo_in_nested_functions()
delfunc Operator
delfunc Apply
endfunc
func Test_shellescape()
let save_shell = &shell
set shell=bash
call assert_equal("'text'", shellescape('text'))
call assert_equal("'te\"xt'", shellescape('te"xt'))
call assert_equal("'te'\\''xt'", shellescape("te'xt"))
call assert_equal("'te%xt'", shellescape("te%xt"))
call assert_equal("'te\\%xt'", shellescape("te%xt", 1))
call assert_equal("'te#xt'", shellescape("te#xt"))
call assert_equal("'te\\#xt'", shellescape("te#xt", 1))
call assert_equal("'te!xt'", shellescape("te!xt"))
call assert_equal("'te\\!xt'", shellescape("te!xt", 1))
call assert_equal("'te\nxt'", shellescape("te\nxt"))
call assert_equal("'te\\\nxt'", shellescape("te\nxt", 1))
set shell=tcsh
call assert_equal("'te\\!xt'", shellescape("te!xt"))
call assert_equal("'te\\\\!xt'", shellescape("te!xt", 1))
call assert_equal("'te\\\nxt'", shellescape("te\nxt"))
call assert_equal("'te\\\\\nxt'", shellescape("te\nxt", 1))
let &shell = save_shell
endfunc
+26 -1
View File
@@ -1,43 +1,50 @@
" Test for gn command
func Test_gn_command()
noa new
set belloff=all
noautocmd new
" replace a single char by itsself quoted:
call setline('.', 'abc x def x ghi x jkl')
let @/='x'
exe "norm! cgn'x'\<esc>.."
call assert_equal("abc 'x' def 'x' ghi 'x' jkl", getline('.'))
sil! %d_
" simple search match
call setline('.', 'foobar')
let @/='foobar'
exe "norm! gncsearchmatch"
call assert_equal('searchmatch', getline('.'))
sil! %d _
" replace a multi-line match
call setline('.', ['', 'one', 'two'])
let @/='one\_s*two\_s'
exe "norm! gnceins\<CR>zwei"
call assert_equal(['','eins','zwei'], getline(1,'$'))
sil! %d _
" test count argument
call setline('.', ['', 'abcdx | abcdx | abcdx'])
let @/='[a]bcdx'
exe "norm! 2gnd"
call assert_equal(['','abcdx | | abcdx'], getline(1,'$'))
sil! %d _
" join lines
call setline('.', ['join ', 'lines'])
let @/='$'
exe "norm! 0gnd"
call assert_equal(['join lines'], getline(1,'$'))
sil! %d _
" zero-width match
call setline('.', ['', 'zero width pattern'])
let @/='\>\zs'
exe "norm! 0gnd"
call assert_equal(['', 'zerowidth pattern'], getline(1,'$'))
sil! %d _
" delete first and last chars
call setline('.', ['delete first and last chars'])
let @/='^'
@@ -46,23 +53,27 @@ func Test_gn_command()
exe "norm! gnd"
call assert_equal(['elete first and last char'], getline(1,'$'))
sil! %d _
" using visual mode
call setline('.', ['', 'uniquepattern uniquepattern'])
exe "norm! /[u]niquepattern/s\<cr>vlgnd"
call assert_equal(['', ' uniquepattern'], getline(1,'$'))
sil! %d _
" backwards search
call setline('.', ['my very excellent mother just served us nachos'])
let @/='mother'
exe "norm! $cgNmongoose"
call assert_equal(['my very excellent mongoose just served us nachos'], getline(1,'$'))
sil! %d _
" search for single char
call setline('.', ['','for (i=0; i<=10; i++)'])
let @/='i'
exe "norm! cgnj"
call assert_equal(['','for (j=0; i<=10; i++)'], getline(1,'$'))
sil! %d _
" search hex char
call setline('.', ['','Y'])
set noignorecase
@@ -70,24 +81,38 @@ func Test_gn_command()
exe "norm! gnd"
call assert_equal(['',''], getline(1,'$'))
sil! %d _
" test repeating gdn
call setline('.', ['', '1', 'Johnny', '2', 'Johnny', '3'])
let @/='Johnny'
exe "norm! dgn."
call assert_equal(['','1', '', '2', '', '3'], getline(1,'$'))
sil! %d _
" test repeating gUgn
call setline('.', ['', '1', 'Depp', '2', 'Depp', '3'])
let @/='Depp'
exe "norm! gUgn."
call assert_equal(['', '1', 'DEPP', '2', 'DEPP', '3'], getline(1,'$'))
sil! %d _
" test using look-ahead assertions
call setline('.', ['a:10', '', 'a:1', '', 'a:20'])
let @/='a:0\@!\zs\d\+'
exe "norm! 2nygno\<esc>p"
call assert_equal(['a:10', '', 'a:1', '1', '', 'a:20'], getline(1,'$'))
sil! %d _
" test using nowrapscan
set nowrapscan
call setline(1, 'foo bar baz')
exe "norm! /bar/e\<cr>"
exe "norm! gnd"
call assert_equal(['foo baz'], getline(1,'$'))
sil! %d_
set wrapscan&vim
set belloff&vim
endfu
" vim: shiftwidth=2 sts=2 expandtab
+11
View File
@@ -60,3 +60,14 @@ func Test_with_syntax()
set printoptions&
endif
endfunc
func Test_fname_with_spaces()
if has('postscript')
split t\ e\ s\ t.txt
call setline(1, ['just', 'some', 'text'])
hardcopy > %.ps
call assert_true(filereadable('t e s t.txt.ps'))
call delete('t e s t.txt.ps')
bwipe!
endif
endfunc
+47
View File
@@ -1804,6 +1804,37 @@ func Xproperty_tests(cchar)
call setloclist(0, [], 'f')
call assert_equal({}, getloclist(0, {'context':1}))
endif
" Test for changing the context of previous quickfix lists
call g:Xsetlist([], 'f')
Xexpr "One"
Xexpr "Two"
Xexpr "Three"
call g:Xsetlist([], ' ', {'context' : [1], 'nr' : 1})
call g:Xsetlist([], ' ', {'context' : [2], 'nr' : 2})
" Also, check for setting the context using quickfix list number zero.
call g:Xsetlist([], ' ', {'context' : [3], 'nr' : 0})
call test_garbagecollect_now()
let l = g:Xgetlist({'nr' : 1, 'context' : 1})
call assert_equal([1], l.context)
let l = g:Xgetlist({'nr' : 2, 'context' : 1})
call assert_equal([2], l.context)
let l = g:Xgetlist({'nr' : 3, 'context' : 1})
call assert_equal([3], l.context)
" Test for changing the context through reference and for garbage
" collection of quickfix context
let l = ["red"]
call g:Xsetlist([], ' ', {'context' : l})
call add(l, "blue")
let x = g:Xgetlist({'context' : 1})
call add(x.context, "green")
call assert_equal(["red", "blue", "green"], l)
call assert_equal(["red", "blue", "green"], x.context)
unlet l
call test_garbagecollect_now()
let m = g:Xgetlist({'context' : 1})
call assert_equal(["red", "blue", "green"], m.context)
endfunc
func Test_qf_property()
@@ -2073,3 +2104,19 @@ func Test_qf_free()
call XfreeTests('c')
call XfreeTests('l')
endfunc
" Test for buffer overflow when parsing lines and adding new entries to
" the quickfix list.
func Test_bufoverflow()
set efm=%f:%l:%m
cgetexpr ['File1:100:' . repeat('x', 1025)]
set efm=%+GCompiler:\ %.%#,%f:%l:%m
cgetexpr ['Compiler: ' . repeat('a', 1015), 'File1:10:Hello World']
set efm=%DEntering\ directory\ %f,%f:%l:%m
cgetexpr ['Entering directory ' . repeat('a', 1006),
\ 'File1:10:Hello World']
set efm&vim
endfunc
+17
View File
@@ -137,3 +137,20 @@ func Test_classes_re2()
call s:classes_test()
set re=0
endfunc
func Test_reversed_range()
for re in range(0, 2)
exe 'set re=' . re
call assert_fails('call match("abc def", "[c-a]")', 'E944:')
endfor
set re=0
endfunc
func Test_large_class()
set re=1
call assert_fails('call match("abc def", "[\u3000-\u4000]")', 'E945:')
set re=2
call assert_equal(0, 'abc def' =~# '[\u3000-\u4000]')
call assert_equal(1, "\u3042" =~# '[\u3000-\u4000]')
set re=0
endfunc
+32
View File
@@ -61,6 +61,38 @@ func Test_after_comes_later()
call delete('Xafter', 'rf')
endfunc
func Test_pack_in_rtp_when_plugins_run()
if !has('packages')
return
endif
let before = [
\ 'set nocp viminfo+=nviminfo',
\ 'set guioptions+=M',
\ 'let $HOME = "/does/not/exist"',
\ 'set loadplugins',
\ 'set rtp=Xhere',
\ 'set packpath=Xhere',
\ 'set nomore',
\ ]
let after = [
\ 'quit',
\ ]
call mkdir('Xhere/plugin', 'p')
call writefile(['redir! > Xtestout', 'silent set runtimepath?', 'silent! call foo#Trigger()', 'redir END'], 'Xhere/plugin/here.vim')
call mkdir('Xhere/pack/foo/start/foobar/autoload', 'p')
call writefile(['function! foo#Trigger()', 'echo "autoloaded foo"', 'endfunction'], 'Xhere/pack/foo/start/foobar/autoload/foo.vim')
if RunVim(before, after, '')
let lines = filter(readfile('Xtestout'), '!empty(v:val)')
call assert_match('Xhere[/\\]pack[/\\]foo[/\\]start[/\\]foobar', get(lines, 0))
call assert_match('autoloaded foo', get(lines, 1))
endif
call delete('Xtestout')
call delete('Xhere', 'rf')
endfunc
func Test_help_arg()
if !has('unix') && has('gui')
" this doesn't work with gvim on MS-Windows
+23
View File
@@ -401,3 +401,26 @@ func Test_highlight_invalid_arg()
call assert_fails('hi XXX xxx=White', 'E423:')
endfunc
func Test_bg_detection()
if has('gui_running')
return
endif
" auto-detection of &bg, make sure sure it isn't set anywhere before
" this test
hi Normal ctermbg=0
call assert_equal('dark', &bg)
hi Normal ctermbg=4
call assert_equal('dark', &bg)
hi Normal ctermbg=12
call assert_equal('light', &bg)
hi Normal ctermbg=15
call assert_equal('light', &bg)
" manually-set &bg takes precendence over auto-detection
set bg=light
hi Normal ctermbg=4
call assert_equal('light', &bg)
set bg=dark
hi Normal ctermbg=12
call assert_equal('dark', &bg)
endfunc
+42
View File
@@ -65,6 +65,48 @@ func Test_duplicate_tagjump()
call delete('Xfile1')
endfunc
func Test_tagjump_switchbuf()
set tags=Xtags
call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//",
\ "second\tXfile1\t2",
\ "third\tXfile1\t3",],
\ 'Xtags')
call writefile(['first', 'second', 'third'], 'Xfile1')
enew | only
set switchbuf=
stag second
call assert_equal(2, winnr('$'))
call assert_equal(2, line('.'))
stag third
call assert_equal(3, winnr('$'))
call assert_equal(3, line('.'))
enew | only
set switchbuf=useopen
stag second
call assert_equal(2, winnr('$'))
call assert_equal(2, line('.'))
stag third
call assert_equal(2, winnr('$'))
call assert_equal(3, line('.'))
enew | only
set switchbuf=usetab
tab stag second
call assert_equal(2, tabpagenr('$'))
call assert_equal(2, line('.'))
1tabnext | stag third
call assert_equal(2, tabpagenr('$'))
call assert_equal(3, line('.'))
tabclose!
enew | only
call delete('Xfile1')
call delete('Xtags')
set switchbuf&vim
endfunc
" Tests for [ CTRL-I and CTRL-W CTRL-I commands
function Test_keyword_jump()
call writefile(["#include Xinclude", "",
+18 -8
View File
@@ -5,7 +5,7 @@ if !has('textobjects')
endif
set belloff=all
function! CpoM(line, useM, expected)
func CpoM(line, useM, expected)
new
if a:useM
@@ -29,16 +29,26 @@ function! CpoM(line, useM, expected)
call assert_equal(getreg('"'), a:expected[2])
q!
endfunction
endfunc
function! Test_inner_block_without_cpo_M()
func Test_inner_block_without_cpo_M()
call CpoM('(red \(blue) green)', 0, ['red \(blue', 'red \(blue', ''])
endfunction
endfunc
function! Test_inner_block_with_cpo_M_left_backslash()
func Test_inner_block_with_cpo_M_left_backslash()
call CpoM('(red \(blue) green)', 1, ['red \(blue) green', 'blue', 'red \(blue) green'])
endfunction
endfunc
function! Test_inner_block_with_cpo_M_right_backslash()
func Test_inner_block_with_cpo_M_right_backslash()
call CpoM('(red (blue\) green)', 1, ['red (blue\) green', 'blue\', 'red (blue\) green'])
endfunction
endfunc
func Test_quote_selection_selection_exclusive()
new
call setline(1, "a 'bcde' f")
set selection=exclusive
exe "norm! fdvhi'y"
call assert_equal('bcde', @")
set selection&vim
bw!
endfunc
+43
View File
@@ -1320,6 +1320,49 @@ func Test_script_emty_line_continuation()
\
endfunc
"-------------------------------------------------------------------------------
" Test 97: bitwise functions {{{1
"-------------------------------------------------------------------------------
func Test_bitwise_functions()
" and
call assert_equal(127, and(127, 127))
call assert_equal(16, and(127, 16))
call assert_equal(0, and(127, 128))
call assert_fails("call and(1.0, 1)", 'E805:')
call assert_fails("call and([], 1)", 'E745:')
call assert_fails("call and({}, 1)", 'E728:')
call assert_fails("call and(1, 1.0)", 'E805:')
call assert_fails("call and(1, [])", 'E745:')
call assert_fails("call and(1, {})", 'E728:')
" or
call assert_equal(23, or(16, 7))
call assert_equal(15, or(8, 7))
call assert_equal(123, or(0, 123))
call assert_fails("call or(1.0, 1)", 'E805:')
call assert_fails("call or([], 1)", 'E745:')
call assert_fails("call or({}, 1)", 'E728:')
call assert_fails("call or(1, 1.0)", 'E805:')
call assert_fails("call or(1, [])", 'E745:')
call assert_fails("call or(1, {})", 'E728:')
" xor
call assert_equal(0, xor(127, 127))
call assert_equal(111, xor(127, 16))
call assert_equal(255, xor(127, 128))
call assert_fails("call xor(1.0, 1)", 'E805:')
call assert_fails("call xor([], 1)", 'E745:')
call assert_fails("call xor({}, 1)", 'E728:')
call assert_fails("call xor(1, 1.0)", 'E805:')
call assert_fails("call xor(1, [])", 'E745:')
call assert_fails("call xor(1, {})", 'E728:')
" invert
call assert_equal(65408, and(invert(127), 65535))
call assert_equal(65519, and(invert(16), 65535))
call assert_equal(65407, and(invert(128), 65535))
call assert_fails("call invert(1.0)", 'E805:')
call assert_fails("call invert([])", 'E745:')
call assert_fails("call invert({})", 'E728:')
endfunc
"-------------------------------------------------------------------------------
" Modelines {{{1
" vim: ts=8 sw=4 tw=80 fdm=marker
+48
View File
@@ -779,6 +779,54 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
628,
/**/
627,
/**/
626,
/**/
625,
/**/
624,
/**/
623,
/**/
622,
/**/
621,
/**/
620,
/**/
619,
/**/
618,
/**/
617,
/**/
616,
/**/
615,
/**/
614,
/**/
613,
/**/
612,
/**/
611,
/**/
610,
/**/
609,
/**/
608,
/**/
607,
/**/
606,
/**/
605,
/**/
604,
/**/
+8
View File
@@ -961,6 +961,14 @@ extern int (*dyn_libintl_putenv)(const char *envstring);
#define GETF_ALT 0x02 /* jumping to alternate file (not buf num) */
#define GETF_SWITCH 0x04 /* respect 'switchbuf' settings when jumping */
/* Return values of getfile() */
#define GETFILE_ERROR 1 /* normal error */
#define GETFILE_NOT_WRITTEN 2 /* "not written" error */
#define GETFILE_SAME_FILE 0 /* success, same file */
#define GETFILE_OPEN_OTHER -1 /* success, opened another file */
#define GETFILE_UNUSED 8
#define GETFILE_SUCCESS(x) ((x) <= 0)
/* Values for buflist_new() flags */
#define BLN_CURBUF 1 /* may re-use curbuf for new buffer */
#define BLN_LISTED 2 /* put new buffer in buffer list */