mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-11 15:37:29 +02:00
Merge remote-tracking branch 'vim/master'
This commit is contained in:
@@ -73,6 +73,7 @@ runtime/ftplugin/awk.vim @dkearns
|
||||
runtime/ftplugin/basic.vim @dkearns
|
||||
runtime/ftplugin/bst.vim @tpope
|
||||
runtime/ftplugin/cfg.vim @chrisbra
|
||||
runtime/ftplugin/csh.vim @dkearns
|
||||
runtime/ftplugin/css.vim @dkearns
|
||||
runtime/ftplugin/cucumber.vim @tpope
|
||||
runtime/ftplugin/eiffel.vim @dkearns
|
||||
@@ -111,8 +112,10 @@ runtime/ftplugin/sass.vim @tpope
|
||||
runtime/ftplugin/scss.vim @tpope
|
||||
runtime/ftplugin/spec.vim @ignatenkobrain
|
||||
runtime/ftplugin/systemverilog.vim @Kocha
|
||||
runtime/ftplugin/tcsh.vim @dkearns
|
||||
runtime/ftplugin/tidy.vim @dkearns
|
||||
runtime/ftplugin/tmux.vim @ericpruitt
|
||||
runtime/ftplugin/toml.vim @averms
|
||||
runtime/ftplugin/typescript.vim @dkearns
|
||||
runtime/ftplugin/typescriptreact.vim @dkearns
|
||||
runtime/ftplugin/xml.vim @chrisbra
|
||||
@@ -151,6 +154,7 @@ runtime/indent/scss.vim @tpope
|
||||
runtime/indent/sh.vim @chrisbra
|
||||
runtime/indent/systemverilog.vim @Kocha
|
||||
runtime/indent/tcl.vim @dkearns
|
||||
runtime/indent/tcsh.vim @dkearns
|
||||
runtime/indent/teraterm.vim @k-takata
|
||||
runtime/indent/xml.vim @chrisbra
|
||||
runtime/indent/zsh.vim @chrisbra
|
||||
@@ -238,10 +242,12 @@ runtime/syntax/sshdconfig.vim @Jakuje
|
||||
runtime/syntax/sudoers.vim @e-kwsm
|
||||
runtime/syntax/systemverilog.vim @Kocha
|
||||
runtime/syntax/tags.vim @cecamp
|
||||
runtime/syntax/tcsh.vim @dkearns
|
||||
runtime/syntax/teraterm.vim @k-takata
|
||||
runtime/syntax/tex.vim @cecamp
|
||||
runtime/syntax/tidy.vim @dkearns
|
||||
runtime/syntax/tmux.vim @ericpruitt
|
||||
runtime/syntax/toml.vim @averms
|
||||
runtime/syntax/vim.vim @cecamp
|
||||
runtime/syntax/wget.vim @dkearns
|
||||
runtime/syntax/xbl.vim @dkearns
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve Vim
|
||||
title: ''
|
||||
labels: ''
|
||||
|
||||
---
|
||||
|
||||
_Instructions: Replace the template text and remove irrelevant text (including this line)_
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
(Issues related to the runtime files should be reported to their maintainer, check the file header.)
|
||||
|
||||
**To Reproduce**
|
||||
Detailed steps to reproduce the behavior:
|
||||
1. Run `vim --clean` (or `gvim --clean`, etc.)
|
||||
2. Edit `filename`
|
||||
3. Type '....'
|
||||
4. Describe the error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, copy/paste the text or add screenshots to help explain your problem.
|
||||
|
||||
**Environment (please complete the following information):**
|
||||
- Vim version [e.g. 8.1.1234] (Or paste the result of `vim --version`.)
|
||||
- OS: [e.g. Ubuntu 18.04, Windows 10 1809, macOS 10.14]
|
||||
- Terminal: [e.g. GNOME Terminal, mintty, iTerm2, tmux, GNU screen] (Use GUI if you use the GUI.)
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
@@ -0,0 +1,47 @@
|
||||
---
|
||||
name: Bug report
|
||||
description: Create a report to help us improve Vim.
|
||||
labels: [bug]
|
||||
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for reporting issues of Vim!
|
||||
|
||||
To make it easier for us to help you please enter detailed information below.
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Steps to reproduce
|
||||
placeholder: |
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
4.
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Expected behaviour
|
||||
placeholder: A clear and concise description of what you expected to happen.
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: Operating system
|
||||
description: >
|
||||
Your operating system name, version and desktop environment.
|
||||
validations:
|
||||
required: true
|
||||
- type: input
|
||||
attributes:
|
||||
label: Version of Vim
|
||||
description: >
|
||||
The name of your development environment, version. [e.g. GNOME Terminal (v0.0.0000)]
|
||||
validations:
|
||||
required: true
|
||||
- type: textarea
|
||||
attributes:
|
||||
label: Logs and stack traces
|
||||
placeholder: Insert log or other text here (if necessary)
|
||||
render: shell
|
||||
@@ -710,7 +710,7 @@ EncodingChanged Fires off after the 'encoding' option has been
|
||||
*FileAppendCmd*
|
||||
FileAppendCmd Before appending to a file. Should do the
|
||||
appending to the file. Use the '[ and ']
|
||||
marks for the range of lines.|Cmd-event|
|
||||
marks for the range of lines. |Cmd-event|
|
||||
*FileAppendPost*
|
||||
FileAppendPost After appending to a file.
|
||||
*FileAppendPre*
|
||||
@@ -838,7 +838,7 @@ FilterReadPre Before reading a file from a filter command.
|
||||
*FilterWritePost*
|
||||
FilterWritePost After writing a file for a filter command or
|
||||
making a diff with an external diff (see
|
||||
DiffUpdated for internal diff).
|
||||
|DiffUpdated| for internal diff).
|
||||
Vim checks the pattern against the name of
|
||||
the current buffer as with FilterWritePre.
|
||||
Not triggered when 'shelltemp' is off.
|
||||
@@ -1202,9 +1202,9 @@ TextYankPost After text has been yanked or deleted in the
|
||||
register, as a list of lines,
|
||||
like with: >
|
||||
getreg(r, 1, 1)
|
||||
< regname Name of the |register| or
|
||||
empty string for the unnamed
|
||||
register.
|
||||
< regname Name of the register or empty
|
||||
string for the unnamed
|
||||
register, see |registers|.
|
||||
regtype Type of the register, see
|
||||
|getregtype()|.
|
||||
visual True if the operation is
|
||||
|
||||
@@ -1184,9 +1184,6 @@ a register, a paste on a visual selected area will paste that single line on
|
||||
each of the selected lines (thus replacing the blockwise selected region by a
|
||||
block of the pasted line).
|
||||
|
||||
Use |zP|/|zp| to paste a blockwise yanked register without appending trailing
|
||||
spaces.
|
||||
|
||||
*blockwise-register*
|
||||
If you use a blockwise Visual mode command to get the text into the register,
|
||||
the block of text will be inserted before ("P") or after ("p") the cursor
|
||||
@@ -1197,6 +1194,9 @@ this happen. However, if the width of the block is not a multiple of a <Tab>
|
||||
width and the text after the inserted block contains <Tab>s, that text may be
|
||||
misaligned.
|
||||
|
||||
Use |zP|/|zp| to paste a blockwise yanked register without appending trailing
|
||||
spaces.
|
||||
|
||||
Note that after a characterwise yank command, Vim leaves the cursor on the
|
||||
first yanked character that is closest to the start of the buffer. This means
|
||||
that "yl" doesn't move the cursor, but "yh" moves the cursor one character
|
||||
|
||||
@@ -803,7 +803,7 @@ three lines: >
|
||||
3:d<CR> is translated into: .,.+2d<CR>
|
||||
<
|
||||
|
||||
Visual Mode and Range
|
||||
Visual Mode and Range
|
||||
*v_:*
|
||||
{Visual}: Starts a command-line with the Visual selected lines as a
|
||||
range. The code `:'<,'>` is used for this range, which makes
|
||||
|
||||
@@ -351,8 +351,8 @@ $ DO 0x24 36 DOLLAR SIGN
|
||||
þ th 0xfe 254 LATIN SMALL LETTER THORN (Icelandic)
|
||||
ÿ y: 0xff 255 LATIN SMALL LETTER Y WITH DIAERESIS
|
||||
|
||||
If your Vim is compiled with |multibyte| support and you are using a multibyte
|
||||
'encoding', Vim provides this enhanced set of additional digraphs:
|
||||
If you are using a |multibyte| 'encoding', Vim provides this enhanced set of
|
||||
additional digraphs:
|
||||
|
||||
*digraph-table-mbyte*
|
||||
char digraph hex dec official name ~
|
||||
|
||||
+14
-9
@@ -1,4 +1,4 @@
|
||||
*editing.txt* For Vim version 8.2. Last change: 2021 Oct 04
|
||||
*editing.txt* For Vim version 8.2. Last change: 2021 Oct 16
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1329,26 +1329,26 @@ present in 'cpoptions' and "!" is not used in the command.
|
||||
other tabs and for windows in the current tab that
|
||||
have their own window-local directory.
|
||||
|
||||
*:tch* *:tchdir*
|
||||
:tch[dir][!] Same as |:tcd|.
|
||||
|
||||
*:tcd-*
|
||||
:tc[d][!] - Change to the previous current directory, before the
|
||||
last ":tcd {path}" command.
|
||||
|
||||
*:tch* *:tchdir*
|
||||
:tch[dir][!] Same as |:tcd|.
|
||||
|
||||
*:lc* *:lcd*
|
||||
:lc[d][!] {path} Like |:cd|, but only set the current directory when
|
||||
the cursor is in the current window. The current
|
||||
directory for other windows is not changed, switching
|
||||
to another window will stop using {path}.
|
||||
|
||||
*:lch* *:lchdir*
|
||||
:lch[dir][!] Same as |:lcd|.
|
||||
|
||||
*:lcd-*
|
||||
:lcd[!] - Change to the previous current directory, before the
|
||||
last ":lcd {path}" command.
|
||||
|
||||
*:lch* *:lchdir*
|
||||
:lch[dir][!] Same as |:lcd|.
|
||||
|
||||
*:pw* *:pwd* *E187*
|
||||
:pw[d] Print the current directory name.
|
||||
Also see |getcwd()|.
|
||||
@@ -1375,14 +1375,14 @@ change anything for the current directory.
|
||||
When a |:lcd| command has been used for a window, the specified directory
|
||||
becomes the current directory for that window. Windows where the |:lcd|
|
||||
command has not been used stick to the global or tab-local current directory.
|
||||
When jumping to another window the current directory will become the last
|
||||
When jumping to another window the current directory is changed to the last
|
||||
specified local current directory. If none was specified, the global or
|
||||
tab-local current directory is used.
|
||||
|
||||
When a |:tcd| command has been used for a tab page, the specified directory
|
||||
becomes the current directory for the current tab page and the current window.
|
||||
The current directory of other tab pages is not affected. When jumping to
|
||||
another tab page, the current directory will become the last specified local
|
||||
another tab page, the current directory is changed to the last specified local
|
||||
directory for that tab page. If the current tab has no local current directory
|
||||
the global current directory is used.
|
||||
|
||||
@@ -1676,6 +1676,11 @@ It is also possible that you modified the file yourself, from another edit
|
||||
session or with another command (e.g., a filter command). Then you will know
|
||||
which version of the file you want to keep.
|
||||
|
||||
The accuracy of the time check depends on the filesystem. On Unix it is
|
||||
usually sub-second. With old file sytems and on MS-Windows it is normally one
|
||||
second. Use has('nanotime') check if sub-second time stamp checks are
|
||||
available.
|
||||
|
||||
There is one situation where you get the message while there is nothing wrong:
|
||||
On a Win32 system on the day daylight saving time starts. There is something
|
||||
in the Win32 libraries that confuses Vim about the hour time difference. The
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 8.2. Last change: 2021 Oct 04
|
||||
*eval.txt* For Vim version 8.2. Last change: 2021 Oct 14
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -2561,7 +2561,7 @@ deletebufline({buf}, {first} [, {last}])
|
||||
did_filetype() Number |TRUE| if FileType autocmd event used
|
||||
diff_filler({lnum}) Number diff filler lines about {lnum}
|
||||
diff_hlID({lnum}, {col}) Number diff highlighting at {lnum}/{col}
|
||||
digraph_get({chars}) String get the digraph of {chars}
|
||||
digraph_get({chars}) String get the |digraph| of {chars}
|
||||
digraph_getlist([{listall}]) List get all |digraph|s
|
||||
digraph_set({chars}, {digraph}) Boolean register |digraph|
|
||||
digraph_setlist({digraphlist}) Boolean register multiple |digraph|s
|
||||
@@ -12250,6 +12250,7 @@ multi_byte_encoding 'encoding' is set to a multibyte encoding.
|
||||
multi_byte_ime Compiled with support for IME input method.
|
||||
multi_lang Compiled with support for multiple languages.
|
||||
mzscheme Compiled with MzScheme interface |mzscheme|.
|
||||
nanotime Compiled with sub-second time stamp checks.
|
||||
netbeans_enabled Compiled with support for |netbeans| and connected.
|
||||
netbeans_intg Compiled with support for |netbeans|.
|
||||
num64 Compiled with 64-bit |Number| support.
|
||||
|
||||
@@ -88,6 +88,7 @@ Tuning Vim ~
|
||||
|usr_43.txt| Using filetypes
|
||||
|usr_44.txt| Your own syntax highlighted
|
||||
|usr_45.txt| Select your language
|
||||
|usr_46.txt| Write plugins using Vim9 script
|
||||
|
||||
Making Vim Run ~
|
||||
|usr_90.txt| Installing Vim
|
||||
|
||||
+59
-11
@@ -824,6 +824,9 @@ CTRL-X CTRL-K Search the files given with the 'dictionary' option
|
||||
CTRL-P Search backwards for next matching keyword. This
|
||||
keyword replaces the previous matching keyword.
|
||||
|
||||
|
||||
Completing words in 'thesaurus' *compl-thesaurus*
|
||||
|
||||
*i_CTRL-X_CTRL-T*
|
||||
CTRL-X CTRL-T Works as CTRL-X CTRL-K, but in a special way. It uses
|
||||
the 'thesaurus' option instead of 'dictionary'. If a
|
||||
@@ -832,16 +835,6 @@ CTRL-X CTRL-T Works as CTRL-X CTRL-K, but in a special way. It uses
|
||||
matches, even though they don't complete the word.
|
||||
Thus a word can be completely replaced.
|
||||
|
||||
For an example, imagine the 'thesaurus' file has a
|
||||
line like this: >
|
||||
angry furious mad enraged
|
||||
< Placing the cursor after the letters "ang" and typing
|
||||
CTRL-X CTRL-T would complete the word "angry";
|
||||
subsequent presses would change the word to "furious",
|
||||
"mad" etc.
|
||||
Other uses include translation between two languages,
|
||||
or grouping API functions by keyword.
|
||||
|
||||
CTRL-T or
|
||||
CTRL-N Search forward for next matching keyword. This
|
||||
keyword replaces the previous matching keyword.
|
||||
@@ -849,6 +842,61 @@ CTRL-X CTRL-T Works as CTRL-X CTRL-K, but in a special way. It uses
|
||||
CTRL-P Search backwards for next matching keyword. This
|
||||
keyword replaces the previous matching keyword.
|
||||
|
||||
In the file used by the 'thesaurus' option each line in the file should
|
||||
contain words with similar meaning, separated by non-keyword characters (white
|
||||
space is preferred). Maximum line length is 510 bytes.
|
||||
|
||||
For an example, imagine the 'thesaurus' file has a line like this: >
|
||||
angry furious mad enraged
|
||||
<Placing the cursor after the letters "ang" and typing CTRL-X CTRL-T would
|
||||
complete the word "angry"; subsequent presses would change the word to
|
||||
"furious", "mad" etc.
|
||||
|
||||
Other uses include translation between two languages, or grouping API
|
||||
functions by keyword.
|
||||
|
||||
An English word list was added to this github issue:
|
||||
https://github.com/vim/vim/issues/629#issuecomment-443293282
|
||||
Unpack thesaurus_pkg.zip, put the thesaurus.txt file somewhere, e.g.
|
||||
~/.vim/thesaurus/english.txt, and the 'thesaurus' option to this file name.
|
||||
|
||||
|
||||
Completing keywords with 'thesaurusfunc' *compl-thesaurusfunc*
|
||||
|
||||
If the 'thesaurusfunc' option is set, then the user specified function is
|
||||
invoked to get the list of completion matches and the 'thesaurus' option is
|
||||
not used. See |complete-functions| for an explanation of how the function is
|
||||
invoked and what it should return.
|
||||
|
||||
Here is an example that uses the "aiksaurus" command (provided by Magnus
|
||||
Groß): >
|
||||
|
||||
func Thesaur(findstart, base)
|
||||
if a:findstart
|
||||
let line = getline('.')
|
||||
let start = col('.') - 1
|
||||
while start > 0 && line[start - 1] =~ '\a'
|
||||
let start -= 1
|
||||
endwhile
|
||||
return start
|
||||
else
|
||||
let res = []
|
||||
let h = ''
|
||||
for l in split(system('aiksaurus '.shellescape(a:base)), '\n')
|
||||
if l[:3] == '=== '
|
||||
let h = substitute(l[4:], ' =*$', '', '')
|
||||
elseif l[0] =~ '\a'
|
||||
call extend(res, map(split(l, ', '), {_, val -> {'word': val, 'menu': '('.h.')'}}))
|
||||
endif
|
||||
endfor
|
||||
return res
|
||||
endif
|
||||
endfunc
|
||||
|
||||
if has('patch-8.2.3520')
|
||||
set thesaurusfunc=Thesaur
|
||||
endif
|
||||
|
||||
|
||||
Completing keywords in the current and included files *compl-keyword*
|
||||
|
||||
@@ -1052,7 +1100,7 @@ CTRL-X CTRL-Z Stop completion without changing the text.
|
||||
|
||||
FUNCTIONS FOR FINDING COMPLETIONS *complete-functions*
|
||||
|
||||
This applies to 'completefunc' and 'omnifunc'.
|
||||
This applies to 'completefunc', 'thesaurusfunc' and 'omnifunc'.
|
||||
|
||||
The function is called in two different ways:
|
||||
- First the function is called to find the start of the text to be completed.
|
||||
|
||||
+44
-20
@@ -2425,7 +2425,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
xchacha20 XChaCha20 Cipher with Poly1305 Message Authentication
|
||||
Code. Medium strong till strong encryption.
|
||||
Encryption is provided by the libsodium library, it
|
||||
requires Vim to be built with |+sodium|
|
||||
requires Vim to be built with |+sodium|.
|
||||
It adds a seed and a message authentication code (MAC)
|
||||
to the file. This needs at least a Vim 8.2.3022 to
|
||||
read the encrypted file.
|
||||
@@ -3625,8 +3625,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
systems without an fsync() implementation, this variable is always
|
||||
off.
|
||||
Also see 'swapsync' for controlling fsync() on swap files.
|
||||
'fsync' also applies to |writefile()|, unless a flag is used to
|
||||
overrule it.
|
||||
'fsync' also applies to |writefile()| (unless a flag is used to
|
||||
overrule it) and when writing undo files (see |undo-persistence|).
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
|
||||
@@ -3883,6 +3883,18 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
screen. Set it to a negative value to allow windows taller than the
|
||||
screen.
|
||||
|
||||
*'guiligatures'* *'gli'* *E1243*
|
||||
'guiligatures' 'gli' string (default "")
|
||||
global
|
||||
{only for GTK GUI}
|
||||
List of ASCII characters that, when combined together, can create more
|
||||
complex shapes. Each character must be a printable ASCII character
|
||||
with a value in the 32-127 range.
|
||||
Example: >
|
||||
:set guiligatures=!\"#$%&()*+-./:<=>?@[]^_{\|~
|
||||
< Changing this option updates screen output immediately. Set it to an
|
||||
empty string to disable ligatures.
|
||||
|
||||
*'guioptions'* *'go'*
|
||||
'guioptions' 'go' string (default "egmrLtT" (MS-Windows,
|
||||
"t" is removed in |defaults.vim|),
|
||||
@@ -5073,6 +5085,13 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
be used when 'encoding' is "utf-8", otherwise only printable
|
||||
characters are allowed. All characters must be single width.
|
||||
|
||||
Each character can be specified as hex: >
|
||||
set listchars=eol:\\x24
|
||||
set listchars=eol:\\u21b5
|
||||
set listchars=eol:\\U000021b5
|
||||
< Note that a double backslash is used. The number of hex characters
|
||||
must be exactly 2 for \\x, 4 for \\u and 8 for \\U.
|
||||
|
||||
Examples: >
|
||||
:set lcs=tab:>-,trail:-
|
||||
:set lcs=tab:>-,eol:<,nbsp:%
|
||||
@@ -7538,13 +7557,13 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
return value of expr contains % items they will get expanded.
|
||||
The expression can contain the } character, the end of
|
||||
expression is denoted by %}.
|
||||
The For example: >
|
||||
For example: >
|
||||
func! Stl_filename() abort
|
||||
return "%t"
|
||||
endfunc
|
||||
< `stl=%{Stl_filename()}` results in `"%t"`
|
||||
`stl=%{%Stl_filename()%}` results in `"Name of current file"`
|
||||
} - End of `{%` expression
|
||||
%} - End of `{%` expression
|
||||
( - Start of item group. Can be used for setting the width and
|
||||
alignment of a section. Must be followed by %) somewhere.
|
||||
) - End of item group. No width fields allowed.
|
||||
@@ -8141,25 +8160,30 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
'thesaurus' 'tsr' string (default "")
|
||||
global or local to buffer |global-local|
|
||||
List of file names, separated by commas, that are used to lookup words
|
||||
for thesaurus completion commands |i_CTRL-X_CTRL-T|.
|
||||
for thesaurus completion commands |i_CTRL-X_CTRL-T|. See
|
||||
|compl-thesaurus|.
|
||||
|
||||
Each line in the file should contain words with similar meaning,
|
||||
separated by non-keyword characters (white space is preferred).
|
||||
Maximum line length is 510 bytes.
|
||||
|
||||
An English word list was added to this github issue:
|
||||
https://github.com/vim/vim/issues/629#issuecomment-443293282
|
||||
Unpack thesaurus_pkg.zip, put the thesaurus.txt file somewhere, e.g.
|
||||
~/.vim/thesaurus/english.txt, and the 'thesaurus' option to this file
|
||||
name.
|
||||
This option is not used if 'thesaurusfunc' is set, either for the
|
||||
buffer or globally.
|
||||
|
||||
To include a comma in a file name precede it with a backslash. Spaces
|
||||
after a comma are ignored, otherwise spaces are included in the file
|
||||
name. See |option-backslash| about using backslashes.
|
||||
The use of |:set+=| and |:set-=| is preferred when adding or removing
|
||||
directories from the list. This avoids problems when a future version
|
||||
uses another default.
|
||||
Backticks cannot be used in this option for security reasons.
|
||||
name. See |option-backslash| about using backslashes. The use of
|
||||
|:set+=| and |:set-=| is preferred when adding or removing directories
|
||||
from the list. This avoids problems when a future version uses
|
||||
another default. Backticks cannot be used in this option for security
|
||||
reasons.
|
||||
|
||||
*'thesaurusfunc'* *tsrfu'*
|
||||
'thesaurusfunc' 'tsrfu' string (default: empty)
|
||||
global or local to buffer |global-local|
|
||||
{not available when compiled without the |+eval|
|
||||
feature}
|
||||
This option specifies a function to be used for thesaurus completion
|
||||
with CTRL-X CTRL-T. |i_CTRL-X_CTRL-T| See |compl-thesaurusfunc|.
|
||||
|
||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||
security reasons.
|
||||
|
||||
*'tildeop'* *'top'* *'notildeop'* *'notop'*
|
||||
'tildeop' 'top' boolean (default off)
|
||||
|
||||
@@ -932,7 +932,7 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
|
||||
\%.l Matches at the cursor line.
|
||||
\%<.l Matches above the cursor line.
|
||||
\%>.l Matches below the cursor line.
|
||||
These three can be used to match specific lines in a buffer. The "23"
|
||||
These six can be used to match specific lines in a buffer. The "23"
|
||||
can be any line number. The first line is 1.
|
||||
WARNING: When inserting or deleting lines Vim does not automatically
|
||||
update the matches. This means Syntax highlighting quickly becomes
|
||||
@@ -953,16 +953,15 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
|
||||
\%.c Matches at the cursor column.
|
||||
\%<.c Matches before the cursor column.
|
||||
\%>.c Matches after the cursor column.
|
||||
These three can be used to match specific columns in a buffer or
|
||||
string. The "23" can be any column number. The first column is 1.
|
||||
Actually, the column is the byte number (thus it's not exactly right
|
||||
for multibyte characters).
|
||||
These six can be used to match specific columns in a buffer or string.
|
||||
The "23" can be any column number. The first column is 1. Actually,
|
||||
the column is the byte number (thus it's not exactly right for
|
||||
multibyte characters).
|
||||
WARNING: When inserting or deleting text Vim does not automatically
|
||||
update the matches. This means Syntax highlighting quickly becomes
|
||||
wrong. Also when referring to the cursor position (".") and
|
||||
the cursor moves the display isn't updated for this change. An update
|
||||
is done when using the |CTRL-L| command (the whole screen is updated).
|
||||
|
||||
Example, to highlight the column where the cursor currently is: >
|
||||
:exe '/\%' . col(".") . 'c'
|
||||
< Alternatively use: >
|
||||
@@ -980,8 +979,8 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
|
||||
\%.v Matches at the current virtual column.
|
||||
\%<.v Matches before the current virtual column.
|
||||
\%>.v Matches after the current virtual column.
|
||||
These three can be used to match specific virtual columns in a buffer
|
||||
or string. When not matching with a buffer in a window, the option
|
||||
These six can be used to match specific virtual columns in a buffer or
|
||||
string. When not matching with a buffer in a window, the option
|
||||
values of the current window are used (e.g., 'tabstop').
|
||||
The "23" can be any column number. The first column is 1.
|
||||
Note that some virtual column positions will never match, because they
|
||||
@@ -1012,7 +1011,7 @@ $ At end of pattern or in front of "\|", "\)" or "\n" ('magic' on):
|
||||
/.*\%17v
|
||||
< Column 17 is highlighted by 'hlsearch' because there is another match
|
||||
where ".*" matches zero characters.
|
||||
<
|
||||
|
||||
|
||||
Character classes:
|
||||
\i identifier character (see 'isident' option) */\i*
|
||||
|
||||
@@ -955,6 +955,7 @@ Short explanation of each option: *option-list*
|
||||
'textmode' 'tx' obsolete, use 'fileformat'
|
||||
'textwidth' 'tw' maximum width of text that is being inserted
|
||||
'thesaurus' 'tsr' list of thesaurus files for keyword completion
|
||||
'thesaurusfunc' 'tsrfu' function to be used for thesaurus completion
|
||||
'tildeop' 'top' tilde command "~" behaves like an operator
|
||||
'timeout' 'to' time out on mappings and key codes
|
||||
'timeoutlen' 'tm' time out time in milliseconds
|
||||
|
||||
@@ -168,9 +168,6 @@ terminal window will start with a white or black background.
|
||||
To use a different color the Terminal highlight group can be used, for
|
||||
example: >
|
||||
hi Terminal ctermbg=lightgrey ctermfg=blue guibg=lightgrey guifg=blue
|
||||
The highlight needs to be defined before the terminal is created. Doing it
|
||||
later, or setting 'wincolor', will only have effect when the program running
|
||||
in the terminal displays text or clears the terminal.
|
||||
Instead of Terminal another group can be specified with the "term_highlight"
|
||||
option for `term_start()`.
|
||||
|
||||
|
||||
@@ -85,14 +85,14 @@ test_getvalue({name}) *test_getvalue()*
|
||||
test_gui_drop_files({list}, {row}, {col}, {mods})
|
||||
Drop one or more files in {list} in the window at {row}, {col}.
|
||||
This function only works when the GUI is running and the
|
||||
|drag-n-drop| feature is present.
|
||||
|
||||
|drop_file| feature is present.
|
||||
|
||||
The supported values for {mods} are:
|
||||
0x4 Shift
|
||||
0x8 Alt
|
||||
0x10 Ctrl
|
||||
The files are added to the argument list and the first file in
|
||||
{list} is edited in the window. See |drag-n-drop| for more
|
||||
The files are added to the |argument-list| and the first file
|
||||
in {list} is edited in the window. See |drag-n-drop| for more
|
||||
information.
|
||||
|
||||
*test_gui_mouse_event()*
|
||||
|
||||
+26
-22
@@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 8.2. Last change: 2021 Sep 22
|
||||
*todo.txt* For Vim version 8.2. Last change: 2021 Oct 15
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -38,12 +38,13 @@ browser use: https://github.com/vim/vim/issues/1234
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
Flaky test op Windows:
|
||||
From test_vim9_script.vim:
|
||||
Found errors in Test_no_unknown_error_after_error():
|
||||
command line..script D:/a/vim/vim/src2/testdir/runtest.vim[486]..function RunTheTest[44]..Test_no_unknown_error_after_error line 22: Expected 'E1012:' but got 'E684: list index out of range: 0': so Xdef
|
||||
Remove s:flaky_tests from runtest.vim, set g:test_is_flaky in each test.
|
||||
|
||||
Vim9 - Make everything work:
|
||||
- "filter #pat# ls" should work, #pat# is not a comment
|
||||
vim9script
|
||||
edit foobar
|
||||
filter #foobar# ls
|
||||
- Check TODO items in vim9compile.c and vim9execute.c
|
||||
- use CheckLegacyAndVim9Success(lines) in many more places
|
||||
- For builtin functions using tv_get_string*() use check_for_string() to be
|
||||
@@ -629,24 +630,27 @@ Window size changes after closing a tab. (#4741)
|
||||
|
||||
Problem with colors in terminal window. (Jason Franklin, 2019 May 12)
|
||||
|
||||
Lifepillar: Updated/cleaned up color schemes:
|
||||
https://github.com/lifepillar/vim8-colorschemes.
|
||||
|
||||
Include a few color schemes, based on popularity:
|
||||
http://www.vim.org/scripts/script_search_results.php?keywords=&script_type=color+scheme&order_by=rating&direction=descending&search=search
|
||||
Color schemes:
|
||||
NOTE: modernizing the default colorschemes _AND_ introducing new ones is now
|
||||
a project in its own right: https://github.com/vim/colorschemes. Feel free to
|
||||
reach out if you want to lend a hand.
|
||||
- Lifepillar: Updated/cleaned up color schemes:
|
||||
https://github.com/lifepillar/vim8-colorschemes.
|
||||
- Include a few color schemes, based on popularity:
|
||||
- http://www.vim.org/scripts/script_search_results.php?keywords=&script_type=color+scheme&order_by=rating&direction=descending&search=search
|
||||
http://vimawesome.com/?q=tag:color-scheme
|
||||
Use names that indicate their appearance (Christian Brabandt, 2017 Aug 3)
|
||||
- monokai - Xia Crusoe (2017 Aug 4)
|
||||
- seoul256 - Christian Brabandt (2017 Aug 3)
|
||||
- gruvbox - Christian Brabandt (2017 Aug 3) (simplified version from
|
||||
Lifepillar, 2018 Jan 22, #2573)
|
||||
- janah - Marco Hinz (2017 Aug 4)
|
||||
- apprentice - Romain Lafourcade (2017 Aug 6) remarks about help file #1964
|
||||
Suggested by Hiroki Kokubun:
|
||||
- [Iceberg](https://github.com/cocopon/iceberg.vim) (my one)
|
||||
- [hybrid](https://github.com/w0ng/vim-hybrid)
|
||||
Include solarized color scheme?, it does not support termguicolors.
|
||||
- Sanitized version of pablo (Lifepillar, 2017 Nov 21)
|
||||
- Use names that indicate their appearance (Christian Brabandt, 2017 Aug 3)
|
||||
- monokai - Xia Crusoe (2017 Aug 4)
|
||||
- seoul256 - Christian Brabandt (2017 Aug 3)
|
||||
- gruvbox - Christian Brabandt (2017 Aug 3) (simplified version from
|
||||
Lifepillar, 2018 Jan 22, #2573)
|
||||
- janah - Marco Hinz (2017 Aug 4)
|
||||
- apprentice - Romain Lafourcade (2017 Aug 6) remarks about help file #1964
|
||||
- Suggested by Hiroki Kokubun:
|
||||
- [Iceberg](https://github.com/cocopon/iceberg.vim) (my one)
|
||||
- [hybrid](https://github.com/w0ng/vim-hybrid)
|
||||
- Include solarized color scheme?, it does not support termguicolors.
|
||||
- Sanitized version of pablo (Lifepillar, 2017 Nov 21)
|
||||
|
||||
Bug: "vipgw" does not put cursor back where it belongs. (Jason Franklin, 2019
|
||||
Mar 5)
|
||||
|
||||
@@ -172,7 +172,7 @@ g8 Print the hex values of the bytes used in the
|
||||
|
||||
*:z!*
|
||||
:[range]z![+-^.=][count]
|
||||
Like ":z:", but when [count] is not specified, it
|
||||
Like ":z", but when [count] is not specified, it
|
||||
defaults to the Vim window height minus one.
|
||||
|
||||
:[range]z[!]#[+-^.=][count] *:z#*
|
||||
|
||||
+24
-11
@@ -103,7 +103,7 @@ script and `:def` functions; details are below:
|
||||
writefile(['done'], 'file.txt')
|
||||
- You cannot use `:xit`, `:t`, `:k`, `:append`, `:change`, `:insert`, `:open`,
|
||||
and `:s` or `:d` with only flags.
|
||||
or curly-braces names.
|
||||
- You cannot use curly-braces names.
|
||||
- A range before a command must be prefixed with a colon: >
|
||||
:%s/this/that
|
||||
- Executing a register with "@r" does not work, you can prepend a colon or use
|
||||
@@ -206,7 +206,7 @@ When a function argument is optional (it has a default value) passing `v:none`
|
||||
as the argument results in using the default value. This is useful when you
|
||||
want to specify a value for an argument that comes after an argument that
|
||||
should use its default value. Example: >
|
||||
def MyFunc(one = 'one', last = 'last)
|
||||
def MyFunc(one = 'one', last = 'last')
|
||||
...
|
||||
enddef
|
||||
MyFunc(v:none, 'LAST') # first argument uses default value 'one'
|
||||
@@ -631,7 +631,7 @@ at the start of the line indicates line continuation: >
|
||||
| echo 'match'
|
||||
| endif
|
||||
|
||||
Note that this means that in heredoc the first line cannot be a bar: >
|
||||
Note that this means that in heredoc the first line cannot start with a bar: >
|
||||
var lines =<< trim END
|
||||
| this doesn't work
|
||||
END
|
||||
@@ -639,7 +639,7 @@ Either use an empty line at the start or do not use heredoc. Or temporarily
|
||||
add the "C" flag to 'cpoptions': >
|
||||
set cpo+=C
|
||||
var lines =<< trim END
|
||||
| this doesn't work
|
||||
| this works
|
||||
END
|
||||
set cpo-=C
|
||||
If the heredoc is inside a function 'cpoptions' must be set before :def and
|
||||
@@ -942,9 +942,22 @@ Ex command ranges need to be prefixed with a colon. >
|
||||
|
||||
Some Ex commands can be confused with assignments in Vim9 script: >
|
||||
g:name = value # assignment
|
||||
g:pattern:cmd # invalid command - ERROR
|
||||
:g:pattern:cmd # :global command
|
||||
|
||||
To avoid confusion between a `:global` or `:substitute` command and an
|
||||
expression or assignment, a few separators cannot be used when these commands
|
||||
are abbreviated to a single character: ':', '-' and '.'. >
|
||||
g:pattern:cmd # invalid command - ERROR
|
||||
s:pattern:repl # invalid command - ERROR
|
||||
g-pattern-cmd # invalid command - ERROR
|
||||
s-pattern-repl # invalid command - ERROR
|
||||
g.pattern.cmd # invalid command - ERROR
|
||||
s.pattern.repl # invalid command - ERROR
|
||||
|
||||
Also, there cannot be a space between the command and the separator: >
|
||||
g /pattern/cmd # invalid command - ERROR
|
||||
s /pattern/repl # invalid command - ERROR
|
||||
|
||||
Functions defined with `:def` compile the whole function. Legacy functions
|
||||
can bail out, and the following lines are not parsed: >
|
||||
func Maybe()
|
||||
@@ -1105,7 +1118,7 @@ The map argument is a string expression, which is evaluated without the
|
||||
function scope. Instead, use a lambda: >
|
||||
def MapList(): list<string>
|
||||
var list = ['aa', 'bb', 'cc', 'dd']
|
||||
return range(1, 2)->map(( _, v) => list[v])
|
||||
return range(1, 2)->map((_, v) => list[v])
|
||||
enddef
|
||||
|
||||
The same is true for commands that are not compiled, such as `:global`.
|
||||
@@ -1309,16 +1322,16 @@ an error, thus breaking backwards compatibility. For example:
|
||||
- Using a string value when setting a number option.
|
||||
- Using a number where a string is expected. *E1024*
|
||||
|
||||
One consequence is that the item type of a list or dict given to map() must
|
||||
One consequence is that the item type of a list or dict given to |map()| must
|
||||
not change. This will give an error in Vim9 script: >
|
||||
vim9 echo map([1, 2, 3], (i, v) => 'item ' .. i)
|
||||
echo map([1, 2, 3], (i, v) => 'item ' .. i)
|
||||
E1012: Type mismatch; expected number but got string
|
||||
Instead use |mapnew(): >
|
||||
vim9 echo mapnew([1, 2, 3], (i, v) => 'item ' .. i)
|
||||
Instead use |mapnew()|: >
|
||||
echo mapnew([1, 2, 3], (i, v) => 'item ' .. i)
|
||||
['item 0', 'item 1', 'item 2']
|
||||
|
||||
If the item type was determined to be "any" it can change to a more specific
|
||||
type. E.g. when a list of mixed types gets changed to a list of numbers: >
|
||||
type. E.g. when a list of mixed types gets changed to a list of strings: >
|
||||
var mylist = [1, 2.0, '3']
|
||||
# typename(mylist) == "list<any>"
|
||||
map(mylist, (i, v) => 'item ' .. i)
|
||||
|
||||
@@ -707,6 +707,7 @@ au BufNewFile,BufRead *.gpi setf gnuplot
|
||||
|
||||
" Go (Google)
|
||||
au BufNewFile,BufRead *.go setf go
|
||||
au BufNewFile,BufRead Gopkg.lock setf toml
|
||||
|
||||
" GrADS scripts
|
||||
au BufNewFile,BufRead *.gs setf grads
|
||||
@@ -1290,7 +1291,7 @@ au BufNewFile,BufRead *.rcp setf pilrc
|
||||
au BufNewFile,BufRead .pinerc,pinerc,.pinercex,pinercex setf pine
|
||||
|
||||
" Pipenv Pipfiles
|
||||
au BufNewFile,BufRead Pipfile setf config
|
||||
au BufNewFile,BufRead Pipfile setf toml
|
||||
au BufNewFile,BufRead Pipfile.lock setf json
|
||||
|
||||
" PL/1, PL/I
|
||||
@@ -1524,6 +1525,7 @@ au BufNewFile,BufRead [rR]antfile,*.rant,[rR]akefile,*.rake setf ruby
|
||||
|
||||
" Rust
|
||||
au BufNewFile,BufRead *.rs setf rust
|
||||
au BufNewFile,BufRead Cargo.lock,*/.cargo/config,*/.cargo/credentials setf toml
|
||||
|
||||
" S-lang (or shader language, or SmallLisp)
|
||||
au BufNewFile,BufRead *.sl setf slang
|
||||
@@ -2305,6 +2307,9 @@ au BufNewFile,BufRead .tcshrc* call dist#ft#SetFileTypeShell("tcsh")
|
||||
" csh scripts ending in a star
|
||||
au BufNewFile,BufRead .login*,.cshrc* call dist#ft#CSH()
|
||||
|
||||
" tmux configuration with arbitrary extension
|
||||
au BufNewFile,BufRead {.,}tmux*.conf* setf tmux
|
||||
|
||||
" VHDL
|
||||
au BufNewFile,BufRead *.vhdl_[0-9]* call s:StarSetf('vhdl')
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" Language: ConTeXt typesetting engine
|
||||
" Maintainer: Nicola Vitacolonna <nvitacolonna@gmail.com>
|
||||
" Former Maintainers: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2016 Oct 30
|
||||
" Latest Revision: 2021 Oct 15
|
||||
|
||||
if exists("b:did_ftplugin")
|
||||
finish
|
||||
@@ -17,7 +17,6 @@ if !exists('current_compiler')
|
||||
endif
|
||||
|
||||
let b:undo_ftplugin = "setl com< cms< def< inc< sua< fo< ofu<"
|
||||
\ . "| unlet! b:match_ignorecase b:match_words b:match_skip"
|
||||
|
||||
setlocal comments=b:%D,b:%C,b:%M,:% commentstring=%\ %s formatoptions+=tjcroql2
|
||||
if get(b:, 'context_metapost', get(g:, 'context_metapost', 1))
|
||||
@@ -35,11 +34,12 @@ let &l:include = '^\s*\\\%(input\|component\|product\|project\|environment\)'
|
||||
|
||||
setlocal suffixesadd=.tex
|
||||
|
||||
if exists("loaded_matchit")
|
||||
if exists("loaded_matchit") && !exists("b:match_words")
|
||||
let b:match_ignorecase = 0
|
||||
let b:match_skip = 'r:\\\@<!\%(\\\\\)*%'
|
||||
let b:match_words = '(:),\[:],{:},\\(:\\),\\\[:\\],' .
|
||||
\ '\\start\(\a\+\):\\stop\1'
|
||||
let b:undo_ftplugin .= " | unlet! b:match_ignorecase b:match_words b:match_skip"
|
||||
endif
|
||||
|
||||
let s:context_regex = {
|
||||
@@ -57,19 +57,28 @@ function! s:move_around(count, what, flags, visual)
|
||||
call map(range(2, a:count), 'search(s:context_regex[a:what], a:flags)')
|
||||
endfunction
|
||||
|
||||
" Move around macros.
|
||||
nnoremap <silent><buffer> [[ :<C-U>call <SID>move_around(v:count1, "beginsection", "bW", v:false) <CR>
|
||||
vnoremap <silent><buffer> [[ :<C-U>call <SID>move_around(v:count1, "beginsection", "bW", v:true) <CR>
|
||||
nnoremap <silent><buffer> ]] :<C-U>call <SID>move_around(v:count1, "beginsection", "W", v:false) <CR>
|
||||
vnoremap <silent><buffer> ]] :<C-U>call <SID>move_around(v:count1, "beginsection", "W", v:true) <CR>
|
||||
nnoremap <silent><buffer> [] :<C-U>call <SID>move_around(v:count1, "endsection", "bW", v:false) <CR>
|
||||
vnoremap <silent><buffer> [] :<C-U>call <SID>move_around(v:count1, "endsection", "bW", v:true) <CR>
|
||||
nnoremap <silent><buffer> ][ :<C-U>call <SID>move_around(v:count1, "endsection", "W", v:false) <CR>
|
||||
vnoremap <silent><buffer> ][ :<C-U>call <SID>move_around(v:count1, "endsection", "W", v:true) <CR>
|
||||
nnoremap <silent><buffer> [{ :<C-U>call <SID>move_around(v:count1, "beginblock", "bW", v:false) <CR>
|
||||
vnoremap <silent><buffer> [{ :<C-U>call <SID>move_around(v:count1, "beginblock", "bW", v:true) <CR>
|
||||
nnoremap <silent><buffer> ]} :<C-U>call <SID>move_around(v:count1, "endblock", "W", v:false) <CR>
|
||||
vnoremap <silent><buffer> ]} :<C-U>call <SID>move_around(v:count1, "endblock", "W", v:true) <CR>
|
||||
if !exists("no_plugin_maps") && !exists("no_context_maps")
|
||||
" Move around macros.
|
||||
nnoremap <silent><buffer> [[ :<C-U>call <SID>move_around(v:count1, "beginsection", "bW", v:false) <CR>
|
||||
vnoremap <silent><buffer> [[ :<C-U>call <SID>move_around(v:count1, "beginsection", "bW", v:true) <CR>
|
||||
nnoremap <silent><buffer> ]] :<C-U>call <SID>move_around(v:count1, "beginsection", "W", v:false) <CR>
|
||||
vnoremap <silent><buffer> ]] :<C-U>call <SID>move_around(v:count1, "beginsection", "W", v:true) <CR>
|
||||
nnoremap <silent><buffer> [] :<C-U>call <SID>move_around(v:count1, "endsection", "bW", v:false) <CR>
|
||||
vnoremap <silent><buffer> [] :<C-U>call <SID>move_around(v:count1, "endsection", "bW", v:true) <CR>
|
||||
nnoremap <silent><buffer> ][ :<C-U>call <SID>move_around(v:count1, "endsection", "W", v:false) <CR>
|
||||
vnoremap <silent><buffer> ][ :<C-U>call <SID>move_around(v:count1, "endsection", "W", v:true) <CR>
|
||||
nnoremap <silent><buffer> [{ :<C-U>call <SID>move_around(v:count1, "beginblock", "bW", v:false) <CR>
|
||||
vnoremap <silent><buffer> [{ :<C-U>call <SID>move_around(v:count1, "beginblock", "bW", v:true) <CR>
|
||||
nnoremap <silent><buffer> ]} :<C-U>call <SID>move_around(v:count1, "endblock", "W", v:false) <CR>
|
||||
vnoremap <silent><buffer> ]} :<C-U>call <SID>move_around(v:count1, "endblock", "W", v:true) <CR>
|
||||
|
||||
let b:undo_ftplugin .= " | sil! exe 'nunmap <buffer> [[' | sil! exe 'vunmap <buffer> [['" .
|
||||
\ " | sil! exe 'nunmap <buffer> ]]' | sil! exe 'vunmap <buffer> ]]'" .
|
||||
\ " | sil! exe 'nunmap <buffer> []' | sil! exe 'vunmap <buffer> []'" .
|
||||
\ " | sil! exe 'nunmap <buffer> ][' | sil! exe 'vunmap <buffer> ]['" .
|
||||
\ " | sil! exe 'nunmap <buffer> [{' | sil! exe 'vunmap <buffer> [{'" .
|
||||
\ " | sil! exe 'nunmap <buffer> ]}' | sil! exe 'vunmap <buffer> ]}'"
|
||||
end
|
||||
|
||||
" Other useful mappings
|
||||
if get(g:, 'context_mappings', 1)
|
||||
@@ -81,16 +90,22 @@ if get(g:, 'context_mappings', 1)
|
||||
call cursor(search(s:tp_regex, 'W') - 1, 1)
|
||||
endf
|
||||
|
||||
" Reflow paragraphs with commands like gqtp ("gq TeX paragraph")
|
||||
onoremap <silent><buffer> tp :<c-u>call <sid>tp()<cr>
|
||||
" Select TeX paragraph
|
||||
vnoremap <silent><buffer> tp <esc>:<c-u>call <sid>tp()<cr>
|
||||
if !exists("no_plugin_maps") && !exists("no_context_maps")
|
||||
" Reflow paragraphs with commands like gqtp ("gq TeX paragraph")
|
||||
onoremap <silent><buffer> tp :<c-u>call <sid>tp()<cr>
|
||||
" Select TeX paragraph
|
||||
vnoremap <silent><buffer> tp <esc>:<c-u>call <sid>tp()<cr>
|
||||
|
||||
" $...$ text object
|
||||
onoremap <silent><buffer> i$ :<c-u>normal! T$vt$<cr>
|
||||
onoremap <silent><buffer> a$ :<c-u>normal! F$vf$<cr>
|
||||
vnoremap <buffer> i$ T$ot$
|
||||
vnoremap <buffer> a$ F$of$
|
||||
" $...$ text object
|
||||
onoremap <silent><buffer> i$ :<c-u>normal! T$vt$<cr>
|
||||
onoremap <silent><buffer> a$ :<c-u>normal! F$vf$<cr>
|
||||
vnoremap <buffer> i$ T$ot$
|
||||
vnoremap <buffer> a$ F$of$
|
||||
|
||||
let b:undo_ftplugin .= " | sil! exe 'ounmap <buffer> tp' | sil! exe 'vunmap <buffer> tp'" .
|
||||
\ " | sil! exe 'ounmap <buffer> i$' | sil! exe 'vunmap <buffer> i$'" .
|
||||
\ " | sil! exe 'ounmap <buffer> a$' | sil! exe 'vunmap <buffer> a$'"
|
||||
endif
|
||||
endif
|
||||
|
||||
" Commands for asynchronous typesetting
|
||||
|
||||
+26
-23
@@ -1,21 +1,23 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: csh
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
" Language: csh
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Previous Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
" Contributor: Johannes Zellner <johannes@zellner.org>
|
||||
" Last Change: 2021 Oct 15
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
" Make sure the continuation lines below do not cause problems in
|
||||
" compatibility mode.
|
||||
let s:save_cpo = &cpo
|
||||
set cpo-=C
|
||||
|
||||
setlocal comments=:#
|
||||
setlocal commentstring=#%s
|
||||
setlocal formatoptions-=t
|
||||
setlocal formatoptions+=crql
|
||||
|
||||
let b:undo_ftplugin = "setlocal com< cms< fo<"
|
||||
|
||||
" Csh: thanks to Johannes Zellner
|
||||
" - Both foreach and end must appear alone on separate lines.
|
||||
" - The words else and endif must appear at the beginning of input lines;
|
||||
@@ -23,26 +25,27 @@ setlocal formatoptions+=crql
|
||||
" - Each case label and the default label must appear at the start of a
|
||||
" line.
|
||||
" - while and end must appear alone on their input lines.
|
||||
if exists("loaded_matchit")
|
||||
let b:match_words =
|
||||
\ '^\s*\<if\>.*(.*).*\<then\>:'.
|
||||
\ '^\s*\<else\>\s\+\<if\>.*(.*).*\<then\>:^\s*\<else\>:'.
|
||||
\ '^\s*\<endif\>,'.
|
||||
\ '\%(^\s*\<foreach\>\s\+\S\+\|^s*\<while\>\).*(.*):'.
|
||||
\ '\<break\>:\<continue\>:^\s*\<end\>,'.
|
||||
\ '^\s*\<switch\>.*(.*):^\s*\<case\>\s\+:^\s*\<default\>:^\s*\<endsw\>'
|
||||
if exists("loaded_matchit") && !exists("b:match_words")
|
||||
let s:line_start = '\%(^\s*\)\@<='
|
||||
let b:match_words =
|
||||
\ s:line_start .. 'if\s*(.*)\s*then\>:' ..
|
||||
\ s:line_start .. 'else\s\+if\s*(.*)\s*then\>:' .. s:line_start .. 'else\>:' ..
|
||||
\ s:line_start .. 'endif\>,' ..
|
||||
\ s:line_start .. '\%(\<foreach\s\+\h\w*\|while\)\s*(:' ..
|
||||
\ '\<break\>:\<continue\>:' ..
|
||||
\ s:line_start .. 'end\>,' ..
|
||||
\ s:line_start .. 'switch\s*(:' ..
|
||||
\ s:line_start .. 'case\s\+:' .. s:line_start .. 'default\>:\<breaksw\>:' ..
|
||||
\ s:line_start .. 'endsw\>'
|
||||
unlet s:line_start
|
||||
let b:undo_ftplugin ..= " | unlet b:match_words"
|
||||
endif
|
||||
|
||||
" Change the :browse e filter to primarily show csh-related files.
|
||||
if has("gui_win32")
|
||||
let b:browsefilter="csh Scripts (*.csh)\t*.csh\n" .
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter")
|
||||
let b:browsefilter="csh Scripts (*.csh)\t*.csh\n" ..
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
let b:undo_ftplugin ..= " | unlet b:browsefilter"
|
||||
endif
|
||||
|
||||
" Undo the stuff we changed.
|
||||
let b:undo_ftplugin = "setlocal commentstring< formatoptions<" .
|
||||
\ " | unlet! b:match_words b:browsefilter"
|
||||
|
||||
" Restore the saved compatibility options.
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: tcsh
|
||||
" Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
" Last Changed: 20 Jan 2009
|
||||
" URL: http://dwsharp.users.sourceforge.net/vim/ftplugin
|
||||
" Language: tcsh
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Previous Maintainer: Dan Sharp <dwsharp at users dot sourceforge dot net>
|
||||
" Last Change: 2021 Oct 15
|
||||
|
||||
if exists("b:did_ftplugin") | finish | endif
|
||||
|
||||
" Make sure the continuation lines below do not cause problems in
|
||||
" compatibility mode.
|
||||
let s:save_cpo = &cpo
|
||||
set cpo-=C
|
||||
|
||||
" Define some defaults in case the included ftplugins don't set them.
|
||||
let s:undo_ftplugin = ""
|
||||
let s:browsefilter = "csh Files (*.csh)\t*.csh\n" .
|
||||
let s:browsefilter = "csh Files (*.csh)\t*.csh\n" ..
|
||||
\ "All Files (*.*)\t*.*\n"
|
||||
|
||||
runtime! ftplugin/csh.vim ftplugin/csh_*.vim ftplugin/csh/*.vim
|
||||
@@ -27,14 +25,11 @@ if exists("b:browsefilter")
|
||||
let s:browsefilter = b:browsefilter
|
||||
endif
|
||||
|
||||
" Change the :browse e filter to primarily show tcsh-related files.
|
||||
if has("gui_win32")
|
||||
let b:browsefilter="tcsh Scripts (*.tcsh)\t*.tcsh\n" . s:browsefilter
|
||||
if (has("gui_win32") || has("gui_gtk"))
|
||||
let b:browsefilter="tcsh Scripts (*.tcsh)\t*.tcsh\n" .. s:browsefilter
|
||||
endif
|
||||
|
||||
" Undo the stuff we changed.
|
||||
let b:undo_ftplugin = "unlet! b:browsefilter | " . s:undo_ftplugin
|
||||
let b:undo_ftplugin = "unlet! b:browsefilter | " .. s:undo_ftplugin
|
||||
|
||||
" Restore the saved compatibility options.
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
@@ -9,4 +9,7 @@ if exists("b:did_ftplugin")
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let b:undo_ftplugin = "setlocal comments< commentstring<"
|
||||
|
||||
setlocal comments=:#
|
||||
setlocal commentstring=#\ %s
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
" Vim filetype plugin
|
||||
" Language: TOML
|
||||
" Homepage: https://github.com/cespare/vim-toml
|
||||
" Maintainer: Aman Verma
|
||||
" Author: Kevin Ballard <kevin@sb.org>
|
||||
" Last Change: Sep 21, 2021
|
||||
|
||||
if exists('b:did_ftplugin')
|
||||
finish
|
||||
endif
|
||||
let b:did_ftplugin = 1
|
||||
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
let b:undo_ftplugin = 'setlocal commentstring< comments<'
|
||||
|
||||
setlocal commentstring=#\ %s
|
||||
setlocal comments=:#
|
||||
|
||||
let &cpo = s:save_cpo
|
||||
unlet s:save_cpo
|
||||
|
||||
" vim: et sw=2 sts=2
|
||||
@@ -1,8 +1,14 @@
|
||||
" Vim indent file
|
||||
" Language: Hamster Script
|
||||
" Version: 2.0.6.0
|
||||
" Last Change: Wed Nov 08 2006 12:02:42 PM
|
||||
" Maintainer: David Fishburn <fishburn@ianywhere.com>
|
||||
" Version: 2.0.6.1
|
||||
" Last Change: 2021 Oct 11
|
||||
" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>
|
||||
" Download: https://www.vim.org/scripts/script.php?script_id=1099
|
||||
"
|
||||
" 2.0.6.1 (Oct 2021)
|
||||
" Added b:undo_indent
|
||||
" Added cpo check
|
||||
"
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
@@ -14,12 +20,17 @@ setlocal indentkeys+==~if,=~else,=~endif,=~endfor,=~endwhile
|
||||
setlocal indentkeys+==~do,=~until,=~while,=~repeat,=~for,=~loop
|
||||
setlocal indentkeys+==~sub,=~endsub
|
||||
|
||||
let b:undo_indent = "setl indentkeys<"
|
||||
|
||||
" Define the appropriate indent function but only once
|
||||
setlocal indentexpr=HamGetFreeIndent()
|
||||
if exists("*HamGetFreeIndent")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:keepcpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function HamGetIndent(lnum)
|
||||
let ind = indent(a:lnum)
|
||||
let prevline=getline(a:lnum)
|
||||
@@ -52,4 +63,8 @@ function HamGetFreeIndent()
|
||||
return ind
|
||||
endfunction
|
||||
|
||||
" Restore:
|
||||
let &cpo = s:keepcpo
|
||||
unlet s:keepcpo
|
||||
|
||||
" vim:sw=2 tw=80
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
" Vim indent file
|
||||
" Language: SQL
|
||||
" Maintainer: David Fishburn <dfishburn dot vim at gmail dot com>
|
||||
" Last Change By Maintainer: 2017 Jun 13
|
||||
" Last Change: by Stephen Wall, #5578, 2020 Jun 07
|
||||
" Version: 3.0
|
||||
" Last Change: 2021 Oct 11
|
||||
" Version: 4.0
|
||||
" Download: http://vim.sourceforge.net/script.php?script_id=495
|
||||
|
||||
" Notes:
|
||||
@@ -21,6 +20,9 @@
|
||||
" it, this can leave the indent hanging to the right one too many.
|
||||
"
|
||||
" History:
|
||||
" 4.0 (Oct 2021)
|
||||
" Added b:undo_indent
|
||||
"
|
||||
" 3.0 (Dec 2012)
|
||||
" Added cpo check
|
||||
"
|
||||
@@ -56,10 +58,13 @@ setlocal indentkeys+==~end,=~else,=~elseif,=~elsif,0=~when,0=)
|
||||
" in the indentkeys is typed
|
||||
setlocal indentexpr=GetSQLIndent()
|
||||
|
||||
let b:undo_indent = "setl indentexpr< indentkeys<"
|
||||
|
||||
" Only define the functions once.
|
||||
if exists("*GetSQLIndent")
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
|
||||
@@ -68,14 +73,9 @@ set cpo&vim
|
||||
" IS is excluded, since it is difficult to determine when the
|
||||
" ending block is (especially for procedures/functions).
|
||||
let s:SQLBlockStart = '^\s*\%('.
|
||||
\ 'if\>.*\<then\|'.
|
||||
\ 'then\|else\>\|'.
|
||||
\ 'elseif\>.*\<then\|'.
|
||||
\ 'elsif\>.(\<then\|'.
|
||||
\ 'while\>.*\<loop\|'.
|
||||
\ 'for\>.*\<loop\|'.
|
||||
\ 'foreach\>.*\<loop\|'.
|
||||
\ 'loop\|do\|declare\|begin\|'.
|
||||
\ 'if\|else\|elseif\|elsif\|'.
|
||||
\ 'while\|loop\|do\|for\|'.
|
||||
\ 'begin\|'.
|
||||
\ 'case\|when\|merge\|exception'.
|
||||
\ '\)\>'
|
||||
let s:SQLBlockEnd = '^\s*\(end\)\>'
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
" Vim indent file
|
||||
" Language: C-shell (tcsh)
|
||||
" Maintainer: Doug Kearns <a@b.com> where a=dougkearns, b=gmail
|
||||
" Last Modified: Sun 26 Sep 2021 12:38:38 PM EDT
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Previous Maintainer: Gautam Iyer <gi1242+vim@NoSpam.com> where NoSpam=gmail (Original Author)
|
||||
" Last Change: 2021 Oct 15
|
||||
|
||||
" Only load this indent file when no other was loaded.
|
||||
if exists("b:did_indent")
|
||||
@@ -11,7 +12,9 @@ endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal indentexpr=TcshGetIndent()
|
||||
setlocal indentkeys+=e,0=end,0=endsw indentkeys-=0{,0},0),:,0#
|
||||
setlocal indentkeys+=e,0=end
|
||||
setlocal indentkeys-=0{,0},0),:,0#
|
||||
|
||||
let b:undo_indent = "setl inde< indk<"
|
||||
|
||||
" Only define the function once.
|
||||
@@ -40,9 +43,9 @@ function TcshGetIndent()
|
||||
let ind = ind - shiftwidth()
|
||||
endif
|
||||
|
||||
" Subtract indent if current line has on end, endif, case commands
|
||||
" Subtract indent if current line has on end, endif, endsw, case commands
|
||||
let line = getline(v:lnum)
|
||||
if line =~ '\v^\s*%(else|end|endif)\s*$'
|
||||
if line =~ '\v^\s*%(else|end|endif|endsw)\s*$'
|
||||
let ind = ind - shiftwidth()
|
||||
endif
|
||||
|
||||
|
||||
+17
-10
@@ -2,12 +2,12 @@
|
||||
" Language: Cascading Style Sheets
|
||||
" Previous Contributor List:
|
||||
" Jules Wang <w.jq0722@gmail.com>
|
||||
" Claudio Fleiner <claudio@fleiner.com> (Maintainer)
|
||||
" Claudio Fleiner <claudio@fleiner.com>
|
||||
" Yeti (Add full CSS2, HTML4 support)
|
||||
" Nikolai Weibull (Add CSS2 support)
|
||||
" URL: https://github.com/jsit/css.vim
|
||||
" URL: https://github.com/vim-language-dept/css-syntax.vim
|
||||
" Maintainer: Jay Sitter <jay@jaysitter.com>
|
||||
" Last Change: 2019 Jul. 29
|
||||
" Last Change: 2021 Oct 15
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
if !exists("main_syntax")
|
||||
@@ -23,6 +23,8 @@ let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
syn case ignore
|
||||
" Add dash to allowed keyword characters.
|
||||
syn iskeyword @,48-57,_,192-255,-
|
||||
|
||||
" HTML4 tags
|
||||
syn keyword cssTagName abbr address area a b base
|
||||
@@ -32,7 +34,7 @@ syn keyword cssTagName dfn div dl dt em fieldset form
|
||||
syn keyword cssTagName h1 h2 h3 h4 h5 h6 head hr html img i
|
||||
syn keyword cssTagName iframe input ins isindex kbd label legend li
|
||||
syn keyword cssTagName link map menu meta noscript ol optgroup
|
||||
syn keyword cssTagName option p param pre q s samp script small
|
||||
syn keyword cssTagName option p param picture pre q s samp script small
|
||||
syn keyword cssTagName span strong sub sup tbody td
|
||||
syn keyword cssTagName textarea tfoot th thead title tr ul u var
|
||||
syn keyword cssTagName object svg
|
||||
@@ -127,7 +129,7 @@ syn region cssURL contained matchgroup=cssFunctionName start="\<\(uri\|url\|loca
|
||||
syn region cssFunction contained matchgroup=cssFunctionName start="\<\(var\|calc\)\s*(" end=")" contains=cssCustomProp,cssValue.*,cssFunction,cssColor,cssStringQ,cssStringQQ oneline
|
||||
syn region cssFunction contained matchgroup=cssFunctionName start="\<\(rgb\|clip\|attr\|counter\|rect\|cubic-bezier\|steps\)\s*(" end=")" oneline contains=cssValueInteger,cssValueNumber,cssValueLength,cssFunctionComma
|
||||
syn region cssFunction contained matchgroup=cssFunctionName start="\<\(rgba\|hsl\|hsla\|color-stop\|from\|to\)\s*(" end=")" oneline contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunctionComma,cssFunction
|
||||
syn region cssFunction contained matchgroup=cssFunctionName start="\<\(linear-\|radial-\)\=\gradient\s*(" end=")" oneline contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunction,cssGradientAttr,cssFunctionComma
|
||||
syn region cssFunction contained matchgroup=cssFunctionName start="\<\(linear-\|radial-\|conic-\)\=\gradient\s*(" end=")" oneline contains=cssColor,cssValueInteger,cssValueNumber,cssValueLength,cssFunction,cssGradientAttr,cssFunctionComma
|
||||
syn region cssFunction contained matchgroup=cssFunctionName start="\<\(matrix\(3d\)\=\|scale\(3d\|X\|Y\|Z\)\=\|translate\(3d\|X\|Y\|Z\)\=\|skew\(X\|Y\)\=\|rotate\(3d\|X\|Y\|Z\)\=\|perspective\)\s*(" end=")" oneline contains=cssValueInteger,cssValueNumber,cssValueLength,cssValueAngle,cssFunctionComma
|
||||
syn region cssFunction contained matchgroup=cssFunctionName start="\<\(blur\|brightness\|contrast\|drop-shadow\|grayscale\|hue-rotate\|invert\|opacity\|saturate\|sepia\)\s*(" end=")" oneline contains=cssValueInteger,cssValueNumber,cssValueLength,cssValueAngle,cssFunctionComma
|
||||
syn keyword cssGradientAttr contained top bottom left right cover center middle ellipse at
|
||||
@@ -220,7 +222,7 @@ syn keyword cssFlexibleBoxProp contained order
|
||||
syn match cssFlexibleBoxAttr contained "\<\(row\|column\|wrap\)\(-reverse\)\=\>"
|
||||
syn keyword cssFlexibleBoxAttr contained nowrap stretch baseline center
|
||||
syn match cssFlexibleBoxAttr contained "\<flex\(-\(start\|end\)\)\=\>"
|
||||
syn match cssFlexibleBoxAttr contained "\<space\(-\(between\|around\)\)\=\>"
|
||||
syn match cssFlexibleBoxAttr contained "\<space\(-\(between\|around\|evenly\)\)\=\>"
|
||||
|
||||
" CSS Fonts Module Level 3
|
||||
" http://www.w3.org/TR/css-fonts-3/
|
||||
@@ -234,9 +236,7 @@ syn keyword cssFontAttr contained larger smaller
|
||||
syn match cssFontAttr contained "\<\(x\{1,2\}-\)\=\(large\|small\)\>"
|
||||
syn match cssFontAttr contained "\<small-\(caps\|caption\)\>"
|
||||
" font-family attributes
|
||||
syn match cssFontAttr contained "\<\(sans-\)\=serif\>"
|
||||
syn keyword cssFontAttr contained Antiqua Arial Black Book Charcoal Comic Courier Dingbats Gadget Geneva Georgia Grande Helvetica Impact Linotype Lucida MS Monaco Neue New Palatino Roboto Roman Symbol Tahoma Times Trebuchet Verdana Webdings Wingdings York Zapf
|
||||
syn keyword cssFontAttr contained cursive fantasy monospace
|
||||
syn keyword cssFontAttr contained sans-serif serif cursive fantasy monospace
|
||||
" font-feature-settings attributes
|
||||
syn keyword cssFontAttr contained on off
|
||||
" font-stretch attributes
|
||||
@@ -283,6 +283,7 @@ syn match cssGridProp contained "\<grid\>"
|
||||
syn match cssGridProp contained "\<grid-template\(-\(columns\|rows\|areas\)\)\=\>"
|
||||
syn match cssGridProp contained "\<grid-\(column\|row\)\(-\(start\|end\|gap\)\)\=\>"
|
||||
syn match cssGridProp contained "\<grid-\(area\|gap\)\>"
|
||||
syn match cssGridProp contained "\<gap\>"
|
||||
syn match cssGridProp contained "\<grid-auto-\(flow\|rows\|columns\)\>"
|
||||
|
||||
syn match cssHyerlinkProp contained "\<target\(-\(name\|new\|position\)\)\=\>"
|
||||
@@ -294,6 +295,10 @@ syn match cssListAttr contained "\<\(decimal\(-leading-zero\)\=\|cjk-ideographic
|
||||
syn keyword cssListAttr contained disc circle square hebrew armenian georgian
|
||||
syn keyword cssListAttr contained inside outside
|
||||
|
||||
" object-fit https://www.w3.org/TR/css-images-3/#the-object-fit
|
||||
syn match cssObjectProp contained "\<object-\(fit\|position\)\>"
|
||||
syn keyword cssObjectAttr contained fill contain cover scale-down
|
||||
|
||||
syn keyword cssPositioningProp contained bottom clear clip display float left
|
||||
syn keyword cssPositioningProp contained position right top visibility
|
||||
syn match cssPositioningProp contained "\<z-index\>"
|
||||
@@ -303,7 +308,7 @@ syn keyword cssPositioningAttr contained left right both
|
||||
syn match cssPositioningAttr contained "\<list-item\>"
|
||||
syn match cssPositioningAttr contained "\<inline\(-\(block\|box\|table\|grid\|flex\)\)\=\>"
|
||||
syn match cssPositioningAttr contained "\<flow\(-root\)\=\>"
|
||||
syn keyword cssPositioningAttr contained static relative absolute fixed subgrid
|
||||
syn keyword cssPositioningAttr contained static relative absolute fixed subgrid sticky
|
||||
|
||||
syn keyword cssPrintAttr contained landscape portrait crop cross always
|
||||
|
||||
@@ -548,6 +553,7 @@ hi def link cssMarqueeProp cssProp
|
||||
hi def link cssMultiColumnProp cssProp
|
||||
hi def link cssPagedMediaProp cssProp
|
||||
hi def link cssPositioningProp cssProp
|
||||
hi def link cssObjectProp cssProp
|
||||
hi def link cssPrintProp cssProp
|
||||
hi def link cssRubyProp cssProp
|
||||
hi def link cssSpeechProp cssProp
|
||||
@@ -581,6 +587,7 @@ hi def link cssMultiColumnAttr cssAttr
|
||||
hi def link cssPaddingAttr cssAttr
|
||||
hi def link cssPagedMediaAttr cssAttr
|
||||
hi def link cssPositioningAttr cssAttr
|
||||
hi def link cssObjectAttr cssAttr
|
||||
hi def link cssGradientAttr cssAttr
|
||||
hi def link cssPrintAttr cssAttr
|
||||
hi def link cssRubyAttr cssAttr
|
||||
|
||||
+36
-30
@@ -1,8 +1,9 @@
|
||||
" tcsh.vim: Vim syntax file for tcsh scripts
|
||||
" Maintainer: Doug Kearns <dougkearns@NoSpam.com> where NoSpam=gmail
|
||||
" Author: Gautam Iyer <gi1242+vim@NoSpam.com> where NoSpam=gmail
|
||||
" Modified: Sun 26 Sep 2021 12:40:55 PM EDT
|
||||
"
|
||||
" Vim syntax file
|
||||
" Language: tcsh scripts
|
||||
" Maintainer: Doug Kearns <dougkearns@gmail.com>
|
||||
" Previous Maintainer: Gautam Iyer <gi1242+vim@NoSpam.com> where NoSpam=gmail (Original Author)
|
||||
" Last Change: 2021 Oct 15
|
||||
|
||||
" Description: We break up each statement into a "command" and an "end" part.
|
||||
" All groups are either a "command" or part of the "end" of a statement (ie
|
||||
" everything after the "command"). This is because blindly highlighting tcsh
|
||||
@@ -20,36 +21,36 @@ endif
|
||||
let s:oldcpo = &cpo
|
||||
set cpo&vim " Line continuation is used
|
||||
|
||||
setlocal iskeyword+=-
|
||||
syn iskeyword @,48-57,_,192-255,-
|
||||
|
||||
syn case match
|
||||
|
||||
" ----- Clusters -----
|
||||
" ----- Clusters ----- {{{1
|
||||
syn cluster tcshModifiers contains=tcshModifier,tcshModifierError
|
||||
syn cluster tcshQuoteList contains=tcshDQuote,tcshSQuote,tcshBQuote
|
||||
syn cluster tcshStatementEnds contains=@tcshQuoteList,tcshComment,@tcshVarList,tcshRedir,tcshMeta,tcshHereDoc,tcshSpecial,tcshArguement
|
||||
syn cluster tcshStatementEnds contains=@tcshQuoteList,tcshComment,@tcshVarList,tcshRedir,tcshMeta,tcshHereDoc,tcshSpecial,tcshArgument
|
||||
syn cluster tcshStatements contains=tcshBuiltin,tcshCommands,tcshIf,tcshWhile
|
||||
syn cluster tcshVarList contains=tcshUsrVar,tcshArgv,tcshSubst
|
||||
syn cluster tcshConditions contains=tcshCmdSubst,tcshParenExpr,tcshOperator,tcshNumber,@tcshVarList
|
||||
|
||||
" ----- Errors -----
|
||||
" ----- Errors ----- {{{1
|
||||
" Define first, so can be easily overridden.
|
||||
syn match tcshError contained '\v\S.+'
|
||||
|
||||
" ----- Statements -----
|
||||
" ----- Statements ----- {{{1
|
||||
" Tcsh commands: Any filename / modifiable variable (must be first!)
|
||||
syn match tcshCommands '\v[a-zA-Z0-9\\./_$:-]+' contains=tcshSpecial,tcshUsrVar,tcshArgv,tcshVarError nextgroup=tcshStatementEnd
|
||||
|
||||
" Builtin commands except those treated specially. Currently (un)set(env),
|
||||
" (un)alias, if, while, else, bindkey
|
||||
syn keyword tcshBuiltin nextgroup=tcshStatementEnd alloc bg break breaksw builtins bye case cd chdir complete continue default dirs echo echotc end endif endsw eval exec exit fg filetest foreach getspath getxvers glob goto hashstat history hup inlib jobs kill limit log login logout ls ls-F migrate newgrp nice nohup notify onintr popd printenv pushd rehash repeat rootnode sched setpath setspath settc setty setxvers shift source stop suspend switch telltc time umask uncomplete unhash universe unlimit ver wait warp watchlog where which
|
||||
syn keyword tcshBuiltin nextgroup=tcshStatementEnd alloc bg break breaksw builtins bye case cd chdir complete continue default dirs echo echotc end endif endsw eval exec exit fg filetest foreach getspath getxvers glob goto hashstat history hup inlib jobs kill limit log login logout ls ls-F migrate newgrp nice nohup notify onintr popd printenv pushd rehash repeat rootnode sched setpath setspath settc setty setxvers shift source stop suspend switch telltc termname time umask uncomplete unhash universe unlimit ver wait warp watchlog where which
|
||||
|
||||
" StatementEnd is anything after a built-in / command till the lexical end of a
|
||||
" statement (;, |, ||, |&, && or end of line)
|
||||
syn region tcshStatementEnd transparent contained matchgroup=tcshBuiltin start='' end='\v\\@<!(;|\|[|&]?|\&\&|$)' contains=@tcshStatementEnds
|
||||
|
||||
" set expressions (Contains shell variables)
|
||||
syn keyword tcshShellVar contained afsuser ampm argv autocorrect autoexpand autolist autologout backslash_quote catalog cdpath color colorcat command complete continue continue_args correct cwd dextract dirsfile dirstack dspmbyte dunique echo echo_style edit ellipsis fignore filec gid group histchars histdup histfile histlit history home ignoreeof implicitcd inputmode killdup killring listflags listjobs listlinks listmax listmaxrows loginsh logout mail matchbeep nobeep noclobber noding noglob nokanji nonomatch nostat notify oid owd path printexitvalue prompt prompt2 prompt3 promptchars pushdtohome pushdsilent recexact recognize_only_executables rmstar rprompt savedirs savehist sched shell shlvl status symlinks tcsh term time tperiod tty uid user verbose version visiblebell watch who wordchars
|
||||
syn keyword tcshShellVar contained addsuffix afsuser ampm anyerror argv autocorrect autoexpand autolist autologout autorehash backslash_quote catalog cdpath cdtohome color colorcat command compat_expr complete continue continue_args correct csubstnonl cwd dextract dirsfile dirstack dspmbyte dunique echo echo_style edit editors ellipsis euid euser fignore filec gid globdot globstar group highlight histchars histdup histfile histlit history home ignoreeof implicitcd inputmode killdup killring listflags listjobs listlinks listmax listmaxrows loginsh logout mail matchbeep nobeep noclobber noding noglob nokanji nonomatch nostat notify oid owd padhour parseoctal path printexitvalue prompt prompt2 prompt3 promptchars pushdtohome pushdsilent recexact recognize_only_executables rmstar rprompt savedirs savehist sched shell shlvl status symlinks tcsh term time tperiod tty uid user verbose version vimode visiblebell watch who wordchars
|
||||
syn keyword tcshBuiltin nextgroup=tcshSetEnd set unset
|
||||
syn region tcshSetEnd contained transparent matchgroup=tcshBuiltin start='' skip='\\$' end='$\|;' contains=tcshShellVar,@tcshStatementEnds
|
||||
|
||||
@@ -96,14 +97,15 @@ syn keyword tcshBindkeyFuncs contained backward-char backward-delete-char
|
||||
\ history-search-forward insert-last-word i-search-fwd
|
||||
\ i-search-back keyboard-quit kill-line kill-region
|
||||
\ kill-whole-line list-choices list-choices-raw list-glob
|
||||
\ list-or-eof load-average magic-space newline normalize-path
|
||||
\ normalize-command overwrite-mode prefix-meta quoted-insert
|
||||
\ redisplay run-fg-editor run-help self-insert-command
|
||||
\ sequence-lead-in set-mark-command spell-word spell-line
|
||||
\ stuff-char toggle-literal-history transpose-chars
|
||||
\ transpose-gosling tty-dsusp tty-flush-output tty-sigintr
|
||||
\ tty-sigquit tty-sigtsusp tty-start-output tty-stop-output
|
||||
\ undefined-key universal-argument up-history upcase-word
|
||||
\ list-or-eof load-average magic-space newline newline-and-hold
|
||||
\ newline-and-down-history normalize-path normalize-command
|
||||
\ overwrite-mode prefix-meta quoted-insert redisplay
|
||||
\ run-fg-editor run-help self-insert-command sequence-lead-in
|
||||
\ set-mark-command spell-word spell-line stuff-char
|
||||
\ toggle-literal-history transpose-chars transpose-gosling
|
||||
\ tty-dsusp tty-flush-output tty-sigintr tty-sigquit tty-sigtsusp
|
||||
\ tty-start-output tty-stop-output undefined-key
|
||||
\ universal-argument up-history upcase-word
|
||||
\ vi-beginning-of-next-word vi-add vi-add-at-eol vi-chg-case
|
||||
\ vi-chg-meta vi-chg-to-eol vi-cmd-mode vi-cmd-mode-complete
|
||||
\ vi-delprev vi-delmeta vi-endword vi-eword vi-char-back
|
||||
@@ -116,7 +118,7 @@ syn keyword tcshBindkeyFuncs contained backward-char backward-delete-char
|
||||
\ e_paste_from_clipboard e_dosify_next e_dosify_prev e_page_up
|
||||
\ e_page_down
|
||||
syn keyword tcshBuiltin nextgroup=tcshBindkeyEnd bindkey
|
||||
syn region tcshBindkeyEnd contained transparent matchgroup=tcshBuiltin start='' skip='\\$' end='$' contains=@tcshQuoteList,tcshComment,@tcshVarList,tcshMeta,tcshSpecial,tcshArguement,tcshBindkeyFuncs
|
||||
syn region tcshBindkeyEnd contained transparent matchgroup=tcshBuiltin start='' skip='\\$' end='$' contains=@tcshQuoteList,tcshComment,@tcshVarList,tcshMeta,tcshSpecial,tcshArgument,tcshBindkeyFuncs
|
||||
|
||||
" Expressions start with @.
|
||||
syn match tcshExprStart '\v\@\s+' nextgroup=tcshExprVar
|
||||
@@ -126,20 +128,20 @@ syn match tcshExprOp contained '\v\s*\=' nextgroup=tcshExprEnd
|
||||
syn match tcshExprEnd contained '\v.*$'hs=e+1 contains=@tcshConditions
|
||||
syn match tcshExprEnd contained '\v.{-};'hs=e contains=@tcshConditions
|
||||
|
||||
" ----- Comments: -----
|
||||
" ----- Comments: ----- {{{1
|
||||
syn match tcshComment '#\s.*' contains=tcshTodo,tcshCommentTi,@Spell
|
||||
syn match tcshComment '\v#($|\S.*)' contains=tcshTodo,tcshCommentTi
|
||||
syn match tcshSharpBang '^#! .*$'
|
||||
syn match tcshCommentTi contained '\v#\s*\u\w*(\s+\u\w*)*:'hs=s+1 contains=tcshTodo
|
||||
syn match tcshTodo contained '\v\c<todo>'
|
||||
|
||||
" ----- Strings -----
|
||||
" ----- Strings ----- {{{1
|
||||
" Tcsh does not allow \" in strings unless the "backslash_quote" shell
|
||||
" variable is set. Set the vim variable "tcsh_backslash_quote" to 0 if you
|
||||
" want VIM to assume that no backslash quote constructs exist.
|
||||
|
||||
" Backquotes are treated as commands, and are not contained in anything
|
||||
if(exists('tcsh_backslash_quote') && tcsh_backslash_quote == 0)
|
||||
if exists('tcsh_backslash_quote') && tcsh_backslash_quote == 0
|
||||
syn region tcshSQuote keepend contained start="\v\\@<!'" end="'"
|
||||
syn region tcshDQuote keepend contained start='\v\\@<!"' end='"' contains=@tcshVarList,tcshSpecial,@Spell
|
||||
syn region tcshBQuote keepend start='\v\\@<!`' end='`' contains=@tcshStatements
|
||||
@@ -149,7 +151,7 @@ else
|
||||
syn region tcshBQuote keepend matchgroup=tcshBQuoteGrp start='\v\\@<!`' skip='\v\\\\|\\`' end='`' contains=@tcshStatements
|
||||
endif
|
||||
|
||||
" ----- Variables -----
|
||||
" ----- Variables ----- {{{1
|
||||
" Variable Errors. Must come first! \$ constructs will be flagged by
|
||||
" tcshSpecial, so we don't consider them here.
|
||||
syn match tcshVarError '\v\$\S*' contained
|
||||
@@ -171,7 +173,7 @@ syn match tcshSubst contained '\v\$\{[%#?]%(\h\w*|\d+)%(:\S*)?\}' contains=tcshM
|
||||
syn match tcshModifierError contained '\v:\S*'
|
||||
syn match tcshModifier contained '\v:[ag]?[htreuls&qx]' nextgroup=@tcshModifiers
|
||||
|
||||
" ----- Operators / Specials -----
|
||||
" ----- Operators / Specials ----- {{{1
|
||||
" Standard redirects (except <<) [<, >, >>, >>&, >>!, >>&!]
|
||||
syn match tcshRedir contained '\v\<|\>\>?\&?!?'
|
||||
|
||||
@@ -190,13 +192,13 @@ syn match tcshOperator contained '&&\|!\~\|!=\|<<\|<=\|==\|=\~\|>=\|>>\|\*\|\^\|
|
||||
syn match tcshNumber contained '\v<-?\d+>'
|
||||
|
||||
" Arguments
|
||||
syn match tcshArguement contained '\v\s@<=-(\w|-)*'
|
||||
syn match tcshArgument contained '\v\s@<=-(\w|-)*'
|
||||
|
||||
" Special characters. \xxx, or backslashed characters.
|
||||
"syn match tcshSpecial contained '\v\\@<!\\(\d{3}|.)'
|
||||
syn match tcshSpecial contained '\v\\%([0-7]{3}|.)'
|
||||
|
||||
" ----- Synchronising -----
|
||||
" ----- Synchronising ----- {{{1
|
||||
if exists('tcsh_minlines')
|
||||
if tcsh_minlines == 'fromstart'
|
||||
syn sync fromstart
|
||||
@@ -207,6 +209,7 @@ else
|
||||
syn sync minlines=100 " Some completions can be quite long
|
||||
endif
|
||||
|
||||
" ----- Highlighting ----- {{{1
|
||||
" Define highlighting of syntax groups
|
||||
hi def link tcshError Error
|
||||
hi def link tcshBuiltin Statement
|
||||
@@ -233,17 +236,20 @@ hi def link tcshVarError Error
|
||||
hi def link tcshUsrVar Type
|
||||
hi def link tcshArgv tcshUsrVar
|
||||
hi def link tcshSubst tcshUsrVar
|
||||
hi def link tcshModifier tcshArguement
|
||||
hi def link tcshModifier tcshArgument
|
||||
hi def link tcshModifierError tcshVarError
|
||||
hi def link tcshMeta tcshSubst
|
||||
hi def link tcshRedir tcshOperator
|
||||
hi def link tcshHereDoc tcshSQuote
|
||||
hi def link tcshOperator Operator
|
||||
hi def link tcshNumber Number
|
||||
hi def link tcshArguement Special
|
||||
hi def link tcshArgument Special
|
||||
hi def link tcshSpecial SpecialChar
|
||||
" }}}
|
||||
|
||||
let &cpo = s:oldcpo
|
||||
unlet s:oldcpo
|
||||
|
||||
let b:current_syntax = 'tcsh'
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8 noet fdm=marker:
|
||||
|
||||
+55
-48
@@ -1,5 +1,5 @@
|
||||
" Language: tmux(1) configuration file
|
||||
" Version: 3.0 (git-48cbbb87)
|
||||
" Version: 3.2a (git-44ada9cd)
|
||||
" URL: https://github.com/ericpruitt/tmux.vim/
|
||||
" Maintainer: Eric Pruitt <eric.pruitt@gmail.com>
|
||||
" License: 2-Clause BSD (http://opensource.org/licenses/BSD-2-Clause)
|
||||
@@ -30,14 +30,14 @@ syn match tmuxVariable /\w\+=/ display
|
||||
syn match tmuxVariableExpansion /\${\=\w\+}\=/ display
|
||||
syn match tmuxControl /%\(if\|elif\|else\|endif\)/
|
||||
|
||||
syn region tmuxComment start=/#/ skip=/\\\@<!\\$/ end=/$/ contains=tmuxTodo
|
||||
syn region tmuxComment start=/#/ skip=/\\\@<!\\$/ end=/$/ contains=tmuxTodo,@Spell
|
||||
|
||||
syn region tmuxString start=+"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=tmuxFormatString
|
||||
syn region tmuxString start=+'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end='$' contains=tmuxFormatString
|
||||
syn region tmuxString start=+"+ skip=+\\\\\|\\"\|\\$+ excludenl end=+"+ end='$' contains=tmuxFormatString,@Spell
|
||||
syn region tmuxString start=+'+ skip=+\\\\\|\\'\|\\$+ excludenl end=+'+ end='$' contains=tmuxFormatString,@Spell
|
||||
|
||||
" TODO: Figure out how escaping works inside of #(...) and #{...} blocks.
|
||||
syn region tmuxFormatString start=/#[#DFhHIPSTW]/ end=// contained keepend
|
||||
syn region tmuxFormatString start=/#{/ skip=/#{.\{-}}/ end=/}/ contained keepend
|
||||
syn region tmuxFormatString start=/#{/ skip=/#{.\{-}}/ end=/}/ keepend
|
||||
syn region tmuxFormatString start=/#(/ skip=/#(.\{-})/ end=/)/ contained keepend
|
||||
|
||||
hi def link tmuxFormatString Identifier
|
||||
@@ -55,62 +55,69 @@ hi def link tmuxTodo Todo
|
||||
hi def link tmuxVariable Identifier
|
||||
hi def link tmuxVariableExpansion Identifier
|
||||
|
||||
" Make the foreground of colourXXX keywords match the color they represent.
|
||||
" Make the foreground of colourXXX keywords match the color they represent
|
||||
" when g:tmux_syntax_colors is unset or set to a non-zero value.
|
||||
" Darker colors have their background set to white.
|
||||
for s:i in range(0, 255)
|
||||
let s:bg = (!s:i || s:i == 16 || (s:i > 231 && s:i < 235)) ? 15 : "none"
|
||||
exec "syn match tmuxColour" . s:i . " /\\<colour" . s:i . "\\>/ display"
|
||||
\ " | highlight tmuxColour" . s:i . " ctermfg=" . s:i . " ctermbg=" . s:bg
|
||||
endfor
|
||||
if get(g:, "tmux_syntax_colors", 1)
|
||||
for s:i in range(0, 255)
|
||||
let s:bg = (!s:i || s:i == 16 || (s:i > 231 && s:i < 235)) ? 15 : "none"
|
||||
exec "syn match tmuxColour" . s:i . " /\\<colour" . s:i . "\\>/ display"
|
||||
\ " | highlight tmuxColour" . s:i . " ctermfg=" . s:i . " ctermbg=" . s:bg
|
||||
endfor
|
||||
endif
|
||||
|
||||
syn keyword tmuxOptions
|
||||
\ backspace buffer-limit command-alias default-terminal escape-time
|
||||
\ exit-empty activity-action assume-paste-time base-index bell-action
|
||||
\ default-command default-shell default-size destroy-unattached
|
||||
\ backspace buffer-limit command-alias copy-command default-terminal editor
|
||||
\ escape-time exit-empty activity-action assume-paste-time base-index
|
||||
\ bell-action default-command default-shell default-size destroy-unattached
|
||||
\ detach-on-destroy display-panes-active-colour display-panes-colour
|
||||
\ display-panes-time display-time exit-unattached focus-events history-file
|
||||
\ history-limit key-table lock-after-time lock-command message-command-style
|
||||
\ message-limit message-style aggressive-resize allow-rename
|
||||
\ alternate-screen automatic-rename automatic-rename-format
|
||||
\ clock-mode-colour clock-mode-style main-pane-height main-pane-width
|
||||
\ mode-keys mode-style monitor-activity monitor-bell monitor-silence mouse
|
||||
\ other-pane-height other-pane-width pane-active-border-style
|
||||
\ pane-base-index pane-border-format pane-border-status pane-border-style
|
||||
\ prefix prefix2 remain-on-exit renumber-windows repeat-time set-clipboard
|
||||
\ set-titles set-titles-string silence-action status status-bg status-fg
|
||||
\ status-format status-interval status-justify status-keys status-left
|
||||
\ status-left-length status-left-style status-position status-right
|
||||
\ status-right-length status-right-style status-style synchronize-panes
|
||||
\ terminal-overrides update-environment user-keys visual-activity
|
||||
\ visual-bell visual-silence window-active-style window-size
|
||||
\ window-status-activity-style window-status-bell-style
|
||||
\ display-panes-time display-time exit-unattached extended-keys focus-events
|
||||
\ history-file history-limit key-table lock-after-time lock-command
|
||||
\ message-command-style message-limit message-style aggressive-resize
|
||||
\ allow-rename alternate-screen automatic-rename automatic-rename-format
|
||||
\ clock-mode-colour clock-mode-style copy-mode-current-match-style
|
||||
\ copy-mode-mark-style copy-mode-match-style main-pane-height
|
||||
\ main-pane-width mode-keys mode-style monitor-activity monitor-bell
|
||||
\ monitor-silence mouse other-pane-height other-pane-width
|
||||
\ pane-active-border-style pane-base-index pane-border-format
|
||||
\ pane-border-lines pane-border-status pane-border-style pane-colours prefix
|
||||
\ prefix2 prompt-history-limit remain-on-exit renumber-windows repeat-time
|
||||
\ set-clipboard set-titles set-titles-string silence-action status status-bg
|
||||
\ status-fg status-format status-interval status-justify status-keys
|
||||
\ status-left status-left-length status-left-style status-position
|
||||
\ status-right status-right-length status-right-style status-style
|
||||
\ synchronize-panes terminal-features terminal-overrides update-environment
|
||||
\ user-keys visual-activity visual-bell visual-silence window-active-style
|
||||
\ window-size window-status-activity-style window-status-bell-style
|
||||
\ window-status-current-format window-status-current-style
|
||||
\ window-status-format window-status-last-style window-status-separator
|
||||
\ window-status-style window-style word-separators wrap-search xterm-keys
|
||||
\ window-status-style window-style word-separators wrap-search
|
||||
|
||||
syn keyword tmuxCommands
|
||||
\ attach attach-session bind bind-key break-pane breakp capture-pane
|
||||
\ capturep choose-buffer choose-client choose-tree clear-history clearhist
|
||||
\ clock-mode command-prompt confirm confirm-before copy-mode detach
|
||||
\ detach-client display display-menu display-message display-panes displayp
|
||||
\ find-window findw if if-shell join-pane joinp kill-pane kill-server
|
||||
\ kill-session kill-window killp has-session has killw link-window linkw
|
||||
\ list-buffers list-clients list-commands list-keys list-panes list-sessions
|
||||
\ list-windows load-buffer loadb lock lock-client lock-server lock-session
|
||||
\ lockc last-pane lastp locks ls last-window last lsb lsc delete-buffer
|
||||
\ deleteb lscm lsk lsp lsw menu move-pane move-window movep movew new
|
||||
\ new-session new-window neww next next-layout next-window nextl
|
||||
\ paste-buffer pasteb pipe-pane pipep prev previous-layout previous-window
|
||||
\ prevl refresh refresh-client rename rename-session rename-window renamew
|
||||
\ resize-pane resize-window resizep resizew respawn-pane respawn-window
|
||||
\ respawnp respawnw rotate-window rotatew run run-shell save-buffer saveb
|
||||
\ clock-mode command-prompt confirm confirm-before copy-mode customize-mode
|
||||
\ detach detach-client display display-menu display-message display-panes
|
||||
\ display-popup displayp find-window findw if if-shell join-pane joinp
|
||||
\ kill-pane kill-server kill-session kill-window killp has has-session killw
|
||||
\ link-window linkw list-buffers list-clients list-commands list-keys
|
||||
\ list-panes list-sessions list-windows load-buffer loadb lock lock-client
|
||||
\ lock-server lock-session lockc last-pane lastp locks ls last last-window
|
||||
\ lsb delete-buffer deleteb lsc lscm lsk lsp lsw menu move-pane move-window
|
||||
\ clear-prompt-history clearphist movep movew new new-session new-window
|
||||
\ neww next next-layout next-window nextl paste-buffer pasteb pipe-pane
|
||||
\ pipep popup prev previous-layout previous-window prevl refresh
|
||||
\ refresh-client rename rename-session rename-window renamew resize-pane
|
||||
\ resize-window resizep resizew respawn-pane respawn-window respawnp
|
||||
\ respawnw rotate-window rotatew run run-shell save-buffer saveb
|
||||
\ select-layout select-pane select-window selectl selectp selectw send
|
||||
\ send-keys send-prefix set set-buffer set-environment set-hook set-option
|
||||
\ set-window-option setb setenv setw show show-buffer show-environment
|
||||
\ show-hooks show-messages show-options show-window-options showb showenv
|
||||
\ showmsgs showw source source-file split-window splitw start start-server
|
||||
\ suspend-client suspendc swap-pane swap-window swapp swapw switch-client
|
||||
\ switchc unbind unbind-key unlink-window unlinkw wait wait-for
|
||||
\ show-hooks show-messages show-options show-prompt-history
|
||||
\ show-window-options showb showenv showmsgs showphist showw source
|
||||
\ source-file split-window splitw start start-server suspend-client suspendc
|
||||
\ swap-pane swap-window swapp swapw switch-client switchc unbind unbind-key
|
||||
\ unlink-window unlinkw wait wait-for
|
||||
|
||||
let &cpo = s:original_cpo
|
||||
unlet! s:original_cpo s:bg s:i
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
" Vim syntax file
|
||||
" Language: TOML
|
||||
" Homepage: https://github.com/cespare/vim-toml
|
||||
" Maintainer: Aman Verma
|
||||
" Previous Maintainer: Caleb Spare <cespare@gmail.com>
|
||||
" Last Change: Oct 8, 2021
|
||||
|
||||
if exists('b:current_syntax')
|
||||
finish
|
||||
endif
|
||||
|
||||
syn match tomlEscape /\\[btnfr"/\\]/ display contained
|
||||
syn match tomlEscape /\\u\x\{4}/ contained
|
||||
syn match tomlEscape /\\U\x\{8}/ contained
|
||||
syn match tomlLineEscape /\\$/ contained
|
||||
|
||||
" Basic strings
|
||||
syn region tomlString oneline start=/"/ skip=/\\\\\|\\"/ end=/"/ contains=tomlEscape
|
||||
" Multi-line basic strings
|
||||
syn region tomlString start=/"""/ end=/"""/ contains=tomlEscape,tomlLineEscape
|
||||
" Literal strings
|
||||
syn region tomlString oneline start=/'/ end=/'/
|
||||
" Multi-line literal strings
|
||||
syn region tomlString start=/'''/ end=/'''/
|
||||
|
||||
syn match tomlInteger /[+-]\=\<[1-9]\(_\=\d\)*\>/ display
|
||||
syn match tomlInteger /[+-]\=\<0\>/ display
|
||||
syn match tomlInteger /[+-]\=\<0x[[:xdigit:]]\(_\=[[:xdigit:]]\)*\>/ display
|
||||
syn match tomlInteger /[+-]\=\<0o[0-7]\(_\=[0-7]\)*\>/ display
|
||||
syn match tomlInteger /[+-]\=\<0b[01]\(_\=[01]\)*\>/ display
|
||||
syn match tomlInteger /[+-]\=\<\(inf\|nan\)\>/ display
|
||||
|
||||
syn match tomlFloat /[+-]\=\<\d\(_\=\d\)*\.\d\+\>/ display
|
||||
syn match tomlFloat /[+-]\=\<\d\(_\=\d\)*\(\.\d\(_\=\d\)*\)\=[eE][+-]\=\d\(_\=\d\)*\>/ display
|
||||
|
||||
syn match tomlBoolean /\<\%(true\|false\)\>/ display
|
||||
|
||||
" https://tools.ietf.org/html/rfc3339
|
||||
syn match tomlDate /\d\{4\}-\d\{2\}-\d\{2\}/ display
|
||||
syn match tomlDate /\d\{2\}:\d\{2\}:\d\{2\}\%(\.\d\+\)\?/ display
|
||||
syn match tomlDate /\d\{4\}-\d\{2\}-\d\{2\}[T ]\d\{2\}:\d\{2\}:\d\{2\}\%(\.\d\+\)\?\%(Z\|[+-]\d\{2\}:\d\{2\}\)\?/ display
|
||||
|
||||
syn match tomlDotInKey /\v[^.]+\zs\./ contained display
|
||||
syn match tomlKey /\v(^|[{,])\s*\zs[[:alnum:]._-]+\ze\s*\=/ contains=tomlDotInKey display
|
||||
syn region tomlKeyDq oneline start=/\v(^|[{,])\s*\zs"/ end=/"\ze\s*=/ contains=tomlEscape
|
||||
syn region tomlKeySq oneline start=/\v(^|[{,])\s*\zs'/ end=/'\ze\s*=/
|
||||
|
||||
syn region tomlTable oneline start=/^\s*\[[^\[]/ end=/\]/ contains=tomlKey,tomlKeyDq,tomlKeySq,tomlDotInKey
|
||||
|
||||
syn region tomlTableArray oneline start=/^\s*\[\[/ end=/\]\]/ contains=tomlKey,tomlKeyDq,tomlKeySq,tomlDotInKey
|
||||
|
||||
syn region tomlKeyValueArray start=/=\s*\[\zs/ end=/\]/ contains=@tomlValue
|
||||
|
||||
syn region tomlArray start=/\[/ end=/\]/ contains=@tomlValue contained
|
||||
|
||||
syn cluster tomlValue contains=tomlArray,tomlString,tomlInteger,tomlFloat,tomlBoolean,tomlDate,tomlComment
|
||||
|
||||
syn keyword tomlTodo TODO FIXME XXX BUG contained
|
||||
|
||||
syn match tomlComment /#.*/ contains=@Spell,tomlTodo
|
||||
|
||||
hi def link tomlComment Comment
|
||||
hi def link tomlTodo Todo
|
||||
hi def link tomlTableArray Title
|
||||
hi def link tomlTable Title
|
||||
hi def link tomlDotInKey Normal
|
||||
hi def link tomlKeySq Identifier
|
||||
hi def link tomlKeyDq Identifier
|
||||
hi def link tomlKey Identifier
|
||||
hi def link tomlDate Constant
|
||||
hi def link tomlBoolean Boolean
|
||||
hi def link tomlFloat Float
|
||||
hi def link tomlInteger Number
|
||||
hi def link tomlString String
|
||||
hi def link tomlLineEscape SpecialChar
|
||||
hi def link tomlEscape SpecialChar
|
||||
|
||||
syn sync minlines=500
|
||||
let b:current_syntax = 'toml'
|
||||
|
||||
" vim: et sw=2 sts=2
|
||||
+8
-8
@@ -533,6 +533,10 @@ CClink = $(CC)
|
||||
# CONF_OPT_CANBERRA = --enable-canberra
|
||||
# CONF_OPT_CANBERRA = --disable-canberra
|
||||
|
||||
# libsodium - For enhanced encryption. Default is on.
|
||||
# Uncomment the next line to not use libsodium
|
||||
# CONF_OPT_SODIUM = --disable-libsodium
|
||||
|
||||
# FEATURES - For creating Vim with more or less features
|
||||
# Uncomment one of these lines when you want to include few to many features.
|
||||
# The default is "huge" for most systems.
|
||||
@@ -615,7 +619,7 @@ CClink = $(CC)
|
||||
# Note: If you use -Wextra and get warnings in GTK code about function
|
||||
# parameters, you can add -Wno-cast-function-type (but not with clang)
|
||||
#CFLAGS = -g -Wall -Wextra -Wshadow -Wmissing-prototypes -Wunreachable-code -Wno-cast-function-type -Wno-deprecated-declarations -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
|
||||
#CFLAGS = -g -Wall -Wextra -Wshadow -Wmissing-prototypes -Wunreachable-code -Wno-deprecated-declarations -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
|
||||
#CFLAGS = -g -Wall -Wextra -Wshadow -Wmissing-prototypes -Wunreachable-code -Wno-deprecated-declarations -D_REENTRANT -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
|
||||
# Add -Wpedantic to find // comments and other C99 constructs.
|
||||
# Better disable Perl and Python to avoid a lot of warnings.
|
||||
#CFLAGS = -g -Wall -Wextra -Wshadow -Wmissing-prototypes -Wpedantic -Wunreachable-code -Wunused-result -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
|
||||
@@ -778,10 +782,6 @@ SANITIZER_LIBS = $(SANITIZER_CFLAGS)
|
||||
# needed to avoid a problem where strings.h gets included
|
||||
#CFLAGS = -qsrcmsg -O2 -qmaxmem=8192 -D__STR31__
|
||||
|
||||
### (W) Solaris with multi-threaded libraries (-lthread):
|
||||
### If suspending doesn't work properly, try using this line:
|
||||
#EXTRA_DEFS = -D_REENTRANT
|
||||
|
||||
### (7) Solaris 2.4/2.5 with Centerline compiler
|
||||
#CC = clcc
|
||||
#X_LIBS_DIR = -L/usr/openwin/lib -R/usr/openwin/lib
|
||||
@@ -1472,12 +1472,12 @@ CPP_DEPEND = $(CC) -I$(srcdir) -M$(CPP_MM) \
|
||||
# -D"__attribute__\\(x\\)=" -D"__asm__\\(x\\)=" \
|
||||
# -D__extension__= -D__restrict="" \
|
||||
# -D__gnuc_va_list=char -D__builtin_va_list=char
|
||||
|
||||
#
|
||||
# This is for cproto 3 patchlevel 9 or above (currently 4.6, 4.7g)
|
||||
# __inline and __attribute__ are now recognized by cproto
|
||||
# __attribute() is not recognized and used in X11/Intrinsic.h
|
||||
# -D"foo()=" is not supported by all compilers so do not use it
|
||||
NO_ATTR=
|
||||
NO_ATTR = -D"__attribute\\(x\\)="
|
||||
#
|
||||
# Use this for cproto 3 patchlevel 6 or below (use "cproto -V" to check):
|
||||
# PROTO_FLAGS = -f4 -d -E"$(CPP)" $(NO_ATTR)
|
||||
@@ -2104,7 +2104,7 @@ config auto/config.mk: auto/configure config.mk.in config.h.in
|
||||
$(CONF_ARGS4) $(CONF_ARGS5) $(CONF_ARGS6) \
|
||||
$(CONF_OPT_MZSCHEME) $(CONF_OPT_PLTHOME) \
|
||||
$(CONF_OPT_LUA) $(CONF_OPT_LUA_PREFIX) \
|
||||
$(CONF_OPT_SYSMOUSE) $(CONF_OPT_CANBERRA); \
|
||||
$(CONF_OPT_SYSMOUSE) $(CONF_OPT_CANBERRA) $(CONF_OPT_SODIUM); \
|
||||
fi
|
||||
|
||||
# Use "make reconfig" to rerun configure without cached values.
|
||||
|
||||
Vendored
+46
@@ -13379,6 +13379,52 @@ if test "x$vim_cv_stat_ignores_slash" = "xyes" ; then
|
||||
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for nanoseconds field of struct stat" >&5
|
||||
$as_echo_n "checking for nanoseconds field of struct stat... " >&6; }
|
||||
if ${ac_cv_struct_st_mtim_nsec+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
ac_save_CPPFLAGS="$CPPFLAGS"
|
||||
ac_cv_struct_st_mtim_nsec=no
|
||||
# st_mtim.tv_nsec -- the usual case
|
||||
# st_mtim._tv_nsec -- Solaris 2.6, if
|
||||
# (defined _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED == 1
|
||||
# && !defined __EXTENSIONS__)
|
||||
# st_mtim.st__tim.tv_nsec -- UnixWare 2.1.2
|
||||
# st_mtime_n -- AIX 5.2 and above
|
||||
# st_mtimespec.tv_nsec -- Darwin (Mac OSX)
|
||||
for ac_val in st_mtim.tv_nsec st_mtim._tv_nsec st_mtim.st__tim.tv_nsec st_mtime_n st_mtimespec.tv_nsec; do
|
||||
CPPFLAGS="$ac_save_CPPFLAGS -DST_MTIM_NSEC=$ac_val"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
struct stat s; s.ST_MTIM_NSEC;
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_compile "$LINENO"; then :
|
||||
ac_cv_struct_st_mtim_nsec=$ac_val; break
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||
done
|
||||
CPPFLAGS="$ac_save_CPPFLAGS"
|
||||
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_st_mtim_nsec" >&5
|
||||
$as_echo "$ac_cv_struct_st_mtim_nsec" >&6; }
|
||||
if test $ac_cv_struct_st_mtim_nsec != no; then
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define ST_MTIM_NSEC $ac_cv_struct_st_mtim_nsec
|
||||
_ACEOF
|
||||
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for iconv_open()" >&5
|
||||
$as_echo_n "checking for iconv_open()... " >&6; }
|
||||
save_LIBS="$LIBS"
|
||||
|
||||
+2
-2
@@ -327,6 +327,7 @@ open_buffer(
|
||||
// Set last_changedtick to avoid triggering a TextChanged autocommand right
|
||||
// after it was added.
|
||||
curbuf->b_last_changedtick = CHANGEDTICK(curbuf);
|
||||
curbuf->b_last_changedtick_i = CHANGEDTICK(curbuf);
|
||||
curbuf->b_last_changedtick_pum = CHANGEDTICK(curbuf);
|
||||
|
||||
// require "!" to overwrite the file, because it wasn't read completely
|
||||
@@ -2367,6 +2368,7 @@ free_buf_options(
|
||||
#ifdef FEAT_COMPL_FUNC
|
||||
clear_string_option(&buf->b_p_cfu);
|
||||
clear_string_option(&buf->b_p_ofu);
|
||||
clear_string_option(&buf->b_p_tsrfu);
|
||||
#endif
|
||||
#ifdef FEAT_QUICKFIX
|
||||
clear_string_option(&buf->b_p_gp);
|
||||
@@ -3033,8 +3035,6 @@ buflist_setfpos(
|
||||
wip->wi_prev = NULL;
|
||||
if (wip->wi_next)
|
||||
wip->wi_next->wi_prev = wip;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef FEAT_DIFF
|
||||
|
||||
+4
-3
@@ -527,7 +527,7 @@ buf_write_bytes(struct bw_info *ip)
|
||||
check_mtime(buf_T *buf, stat_T *st)
|
||||
{
|
||||
if (buf->b_mtime_read != 0
|
||||
&& time_differs((long)st->st_mtime, buf->b_mtime_read))
|
||||
&& time_differs(st, buf->b_mtime_read, buf->b_mtime_read_ns))
|
||||
{
|
||||
msg_scroll = TRUE; // don't overwrite messages here
|
||||
msg_silent = 0; // must give this prompt
|
||||
@@ -2422,8 +2422,8 @@ restore_backup:
|
||||
&& (overwriting || vim_strchr(p_cpo, CPO_PLUS) != NULL))
|
||||
{
|
||||
unchanged(buf, TRUE, FALSE);
|
||||
// b:changedtick is may be incremented in unchanged() but that
|
||||
// should not trigger a TextChanged event.
|
||||
// b:changedtick may be incremented in unchanged() but that should not
|
||||
// trigger a TextChanged event.
|
||||
if (buf->b_last_changedtick + 1 == CHANGEDTICK(buf))
|
||||
buf->b_last_changedtick = CHANGEDTICK(buf);
|
||||
u_unchanged(buf);
|
||||
@@ -2558,6 +2558,7 @@ nofail:
|
||||
{
|
||||
buf_store_time(buf, &st_old, fname);
|
||||
buf->b_mtime_read = buf->b_mtime;
|
||||
buf->b_mtime_read_ns = buf->b_mtime_ns;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2013,8 +2013,6 @@ hex2nr(int c)
|
||||
return c - '0';
|
||||
}
|
||||
|
||||
#if defined(FEAT_TERMRESPONSE) || defined(FEAT_GUI_GTK) \
|
||||
|| defined(PROTO) || defined(FEAT_AUTOSHELLDIR)
|
||||
/*
|
||||
* Convert two hex characters to a byte.
|
||||
* Return -1 if one of the characters is not hex.
|
||||
@@ -2026,7 +2024,6 @@ hexhex2nr(char_u *p)
|
||||
return -1;
|
||||
return (hex2nr(p[0]) << 4) + hex2nr(p[1]);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Return TRUE if "str" starts with a backslash that should be removed.
|
||||
|
||||
+5
-2
@@ -48,6 +48,8 @@ ExpandEscape(
|
||||
{
|
||||
int i;
|
||||
char_u *p;
|
||||
int vse_what = xp->xp_context == EXPAND_BUFFERS
|
||||
? VSE_BUFFER : VSE_NONE;
|
||||
|
||||
// May change home directory back to "~"
|
||||
if (options & WILD_HOME_REPLACE)
|
||||
@@ -84,9 +86,10 @@ ExpandEscape(
|
||||
}
|
||||
}
|
||||
#ifdef BACKSLASH_IN_FILENAME
|
||||
p = vim_strsave_fnameescape(files[i], FALSE);
|
||||
p = vim_strsave_fnameescape(files[i], vse_what);
|
||||
#else
|
||||
p = vim_strsave_fnameescape(files[i], xp->xp_shell);
|
||||
p = vim_strsave_fnameescape(files[i],
|
||||
xp->xp_shell ? VSE_SHELL : vse_what);
|
||||
#endif
|
||||
if (p != NULL)
|
||||
{
|
||||
|
||||
@@ -144,6 +144,9 @@
|
||||
/* Define if stat() ignores a trailing slash */
|
||||
#undef STAT_IGNORES_SLASH
|
||||
|
||||
/* Define to nanoseconds field of struct stat */
|
||||
#undef ST_MTIM_NSEC
|
||||
|
||||
/* Define if tgetstr() has a second argument that is (char *) */
|
||||
#undef TGETSTR_CHAR_P
|
||||
|
||||
|
||||
@@ -4028,6 +4028,31 @@ main() {struct stat st; exit(stat("configure/", &st) != 0); }
|
||||
if test "x$vim_cv_stat_ignores_slash" = "xyes" ; then
|
||||
AC_DEFINE(STAT_IGNORES_SLASH)
|
||||
fi
|
||||
|
||||
dnl nanoseconds field of struct stat
|
||||
AC_CACHE_CHECK([for nanoseconds field of struct stat],
|
||||
ac_cv_struct_st_mtim_nsec,
|
||||
[ac_save_CPPFLAGS="$CPPFLAGS"
|
||||
ac_cv_struct_st_mtim_nsec=no
|
||||
# st_mtim.tv_nsec -- the usual case
|
||||
# st_mtim._tv_nsec -- Solaris 2.6, if
|
||||
# (defined _XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED == 1
|
||||
# && !defined __EXTENSIONS__)
|
||||
# st_mtim.st__tim.tv_nsec -- UnixWare 2.1.2
|
||||
# st_mtime_n -- AIX 5.2 and above
|
||||
# st_mtimespec.tv_nsec -- Darwin (Mac OSX)
|
||||
for ac_val in st_mtim.tv_nsec st_mtim._tv_nsec st_mtim.st__tim.tv_nsec st_mtime_n st_mtimespec.tv_nsec; do
|
||||
CPPFLAGS="$ac_save_CPPFLAGS -DST_MTIM_NSEC=$ac_val"
|
||||
AC_TRY_COMPILE([#include <sys/types.h>
|
||||
#include <sys/stat.h>], [struct stat s; s.ST_MTIM_NSEC;],
|
||||
[ac_cv_struct_st_mtim_nsec=$ac_val; break])
|
||||
done
|
||||
CPPFLAGS="$ac_save_CPPFLAGS"
|
||||
])
|
||||
if test $ac_cv_struct_st_mtim_nsec != no; then
|
||||
AC_DEFINE_UNQUOTED([ST_MTIM_NSEC], [$ac_cv_struct_st_mtim_nsec],
|
||||
[Define if struct stat contains a nanoseconds field])
|
||||
fi
|
||||
|
||||
dnl Link with iconv for charset translation, if not found without library.
|
||||
dnl check for iconv() requires including iconv.h
|
||||
|
||||
+5
-5
@@ -464,13 +464,13 @@ win_redr_status(win_T *wp, int ignore_pum UNUSED)
|
||||
*(p + len++) = ' ';
|
||||
if (bt_help(wp->w_buffer))
|
||||
{
|
||||
STRCPY(p + len, _("[Help]"));
|
||||
vim_snprintf((char *)p + len, MAXPATHL - len, "%s", _("[Help]"));
|
||||
len += (int)STRLEN(p + len);
|
||||
}
|
||||
#ifdef FEAT_QUICKFIX
|
||||
if (wp->w_p_pvw)
|
||||
{
|
||||
STRCPY(p + len, _("[Preview]"));
|
||||
vim_snprintf((char *)p + len, MAXPATHL - len, "%s", _("[Preview]"));
|
||||
len += (int)STRLEN(p + len);
|
||||
}
|
||||
#endif
|
||||
@@ -480,12 +480,12 @@ win_redr_status(win_T *wp, int ignore_pum UNUSED)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
STRCPY(p + len, "[+]");
|
||||
len += 3;
|
||||
vim_snprintf((char *)p + len, MAXPATHL - len, "%s", "[+]");
|
||||
len += (int)STRLEN(p + len);
|
||||
}
|
||||
if (wp->w_buffer->b_p_ro)
|
||||
{
|
||||
STRCPY(p + len, _("[RO]"));
|
||||
vim_snprintf((char *)p + len, MAXPATHL - len, "%s", _("[RO]"));
|
||||
len += (int)STRLEN(p + len);
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -1486,9 +1486,9 @@ ins_redraw(int ready) // not busy with something
|
||||
last_cursormoved = curwin->w_cursor;
|
||||
}
|
||||
|
||||
// Trigger TextChangedI if b_changedtick differs.
|
||||
// Trigger TextChangedI if b_changedtick_i differs.
|
||||
if (ready && has_textchangedI()
|
||||
&& curbuf->b_last_changedtick != CHANGEDTICK(curbuf)
|
||||
&& curbuf->b_last_changedtick_i != CHANGEDTICK(curbuf)
|
||||
&& !pum_visible())
|
||||
{
|
||||
aco_save_T aco;
|
||||
@@ -1498,15 +1498,15 @@ ins_redraw(int ready) // not busy with something
|
||||
aucmd_prepbuf(&aco, curbuf);
|
||||
apply_autocmds(EVENT_TEXTCHANGEDI, NULL, NULL, FALSE, curbuf);
|
||||
aucmd_restbuf(&aco);
|
||||
curbuf->b_last_changedtick = CHANGEDTICK(curbuf);
|
||||
curbuf->b_last_changedtick_i = CHANGEDTICK(curbuf);
|
||||
if (tick != CHANGEDTICK(curbuf)) // see ins_apply_autocmds()
|
||||
u_save(curwin->w_cursor.lnum,
|
||||
(linenr_T)(curwin->w_cursor.lnum + 1));
|
||||
}
|
||||
|
||||
// Trigger TextChangedP if b_changedtick differs. When the popupmenu closes
|
||||
// TextChangedI will need to trigger for backwards compatibility, thus use
|
||||
// different b_last_changedtick* variables.
|
||||
// Trigger TextChangedP if b_changedtick_pum differs. When the popupmenu
|
||||
// closes TextChangedI will need to trigger for backwards compatibility,
|
||||
// thus use different b_last_changedtick* variables.
|
||||
if (ready && has_textchangedP()
|
||||
&& curbuf->b_last_changedtick_pum != CHANGEDTICK(curbuf)
|
||||
&& pum_visible())
|
||||
|
||||
@@ -664,3 +664,11 @@ EXTERN char e_blob_required_for_argument_nr[]
|
||||
INIT(= N_("E1238: Blob required for argument %d"));
|
||||
EXTERN char e_invalid_value_for_blob_nr[]
|
||||
INIT(= N_("E1239: Invalid value for blob: %d"));
|
||||
EXTERN char e_resulting_text_too_long[]
|
||||
INIT(= N_("E1240: Resulting text too long"));
|
||||
EXTERN char e_separator_not_supported_str[]
|
||||
INIT(= N_("E1241: Separator not supported: %s"));
|
||||
EXTERN char e_no_white_space_allowed_before_separator_str[]
|
||||
INIT(= N_("E1242: No white space allowed before separator: %s"));
|
||||
EXTERN char e_ascii_code_not_in_range[]
|
||||
INIT(= N_("E1243: ASCII code not in 32-127 range"));
|
||||
|
||||
+8
-1
@@ -3886,7 +3886,7 @@ f_fnameescape(typval_T *argvars, typval_T *rettv)
|
||||
return;
|
||||
|
||||
rettv->vval.v_string = vim_strsave_fnameescape(
|
||||
tv_get_string(&argvars[0]), FALSE);
|
||||
tv_get_string(&argvars[0]), VSE_NONE);
|
||||
rettv->v_type = VAR_STRING;
|
||||
}
|
||||
|
||||
@@ -5493,6 +5493,13 @@ f_has(typval_T *argvars, typval_T *rettv)
|
||||
0
|
||||
#endif
|
||||
},
|
||||
{"nanotime",
|
||||
#ifdef ST_MTIM_NSEC
|
||||
1
|
||||
#else
|
||||
0
|
||||
#endif
|
||||
},
|
||||
{"num64", 1},
|
||||
{"ole",
|
||||
#ifdef FEAT_OLE
|
||||
|
||||
+3
-2
@@ -3321,7 +3321,7 @@ set_var_const(
|
||||
goto failed;
|
||||
}
|
||||
|
||||
if (var_in_vim9script)
|
||||
if (var_in_vim9script && (flags & ASSIGN_FOR_LOOP) == 0)
|
||||
{
|
||||
where_T where = WHERE_INIT;
|
||||
|
||||
@@ -3333,7 +3333,8 @@ set_var_const(
|
||||
goto failed;
|
||||
}
|
||||
|
||||
if (var_check_permission(di, name) == FAIL)
|
||||
if ((flags & ASSIGN_FOR_LOOP) == 0
|
||||
&& var_check_permission(di, name) == FAIL)
|
||||
goto failed;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -3724,6 +3724,11 @@ ex_substitute(exarg_T *eap)
|
||||
// don't accept alphanumeric for separator
|
||||
if (check_regexp_delim(*cmd) == FAIL)
|
||||
return;
|
||||
#ifdef FEAT_EVAL
|
||||
if (in_vim9script() && check_global_and_subst(eap->cmd, eap->arg)
|
||||
== FAIL)
|
||||
return;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* undocumented vi feature:
|
||||
@@ -4899,6 +4904,11 @@ ex_global(exarg_T *eap)
|
||||
cmd = eap->arg;
|
||||
which_pat = RE_LAST; // default: use last used regexp
|
||||
|
||||
#ifdef FEAT_EVAL
|
||||
if (in_vim9script() && check_global_and_subst(eap->cmd, eap->arg) == FAIL)
|
||||
return;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* undocumented vi feature:
|
||||
* "\/" and "\?": use previous search pattern.
|
||||
|
||||
+13
-2
@@ -3606,6 +3606,15 @@ find_ex_command(
|
||||
}
|
||||
}
|
||||
|
||||
// "g:", "s:" and "l:" are always assumed to be a variable, thus start
|
||||
// an expression. A global/substitute/list command needs to use a
|
||||
// longer name.
|
||||
if (vim_strchr((char_u *)"gsl", *p) != NULL && p[1] == ':')
|
||||
{
|
||||
eap->cmdidx = CMD_eval;
|
||||
return eap->cmd;
|
||||
}
|
||||
|
||||
// If it is an ID it might be a variable with an operator on the next
|
||||
// line, if the variable exists it can't be an Ex command.
|
||||
if (p > eap->cmd && ends_excmd(*skipwhite(p))
|
||||
@@ -4235,8 +4244,10 @@ get_address(
|
||||
|
||||
// When '/' or '?' follows another address, start from
|
||||
// there.
|
||||
if (lnum != MAXLNUM)
|
||||
curwin->w_cursor.lnum = lnum;
|
||||
if (lnum > 0 && lnum != MAXLNUM)
|
||||
curwin->w_cursor.lnum =
|
||||
lnum > curbuf->b_ml.ml_line_count
|
||||
? curbuf->b_ml.ml_line_count : lnum;
|
||||
|
||||
// Start a forward search at the end of the line (unless
|
||||
// before the first line).
|
||||
|
||||
+12
-7
@@ -3906,27 +3906,32 @@ ccheck_abbr(int c)
|
||||
}
|
||||
|
||||
/*
|
||||
* Escape special characters in "fname" for when used as a file name argument
|
||||
* after a Vim command, or, when "shell" is non-zero, a shell command.
|
||||
* Escape special characters in "fname", depending on "what":
|
||||
* VSE_NONE: for when used as a file name argument after a Vim command.
|
||||
* VSE_SHELL: for a shell command.
|
||||
* VSE_BUFFER: for the ":buffer" command.
|
||||
* Returns the result in allocated memory.
|
||||
*/
|
||||
char_u *
|
||||
vim_strsave_fnameescape(char_u *fname, int shell UNUSED)
|
||||
vim_strsave_fnameescape(char_u *fname, int what)
|
||||
{
|
||||
char_u *p;
|
||||
#ifdef BACKSLASH_IN_FILENAME
|
||||
char_u buf[20];
|
||||
int j = 0;
|
||||
|
||||
// Don't escape '[', '{' and '!' if they are in 'isfname'.
|
||||
for (p = PATH_ESC_CHARS; *p != NUL; ++p)
|
||||
// Don't escape '[', '{' and '!' if they are in 'isfname' and for the
|
||||
// ":buffer" command.
|
||||
for (p = what == VSE_BUFFER ? BUFFER_ESC_CHARS : PATH_ESC_CHARS;
|
||||
*p != NUL; ++p)
|
||||
if ((*p != '[' && *p != '{' && *p != '!') || !vim_isfilec(*p))
|
||||
buf[j++] = *p;
|
||||
buf[j] = NUL;
|
||||
p = vim_strsave_escaped(fname, buf);
|
||||
#else
|
||||
p = vim_strsave_escaped(fname, shell ? SHELL_ESC_CHARS : PATH_ESC_CHARS);
|
||||
if (shell && csh_like_shell() && p != NULL)
|
||||
p = vim_strsave_escaped(fname, what == VSE_SHELL ? SHELL_ESC_CHARS
|
||||
: what == VSE_BUFFER ? BUFFER_ESC_CHARS : PATH_ESC_CHARS);
|
||||
if (what == VSE_SHELL && csh_like_shell() && p != NULL)
|
||||
{
|
||||
char_u *s;
|
||||
|
||||
|
||||
+26
-9
@@ -408,6 +408,7 @@ readfile(
|
||||
{
|
||||
buf_store_time(curbuf, &st, fname);
|
||||
curbuf->b_mtime_read = curbuf->b_mtime;
|
||||
curbuf->b_mtime_read_ns = curbuf->b_mtime_ns;
|
||||
filesize_disk = st.st_size;
|
||||
#ifdef UNIX
|
||||
/*
|
||||
@@ -432,7 +433,9 @@ readfile(
|
||||
else
|
||||
{
|
||||
curbuf->b_mtime = 0;
|
||||
curbuf->b_mtime_ns = 0;
|
||||
curbuf->b_mtime_read = 0;
|
||||
curbuf->b_mtime_read_ns = 0;
|
||||
curbuf->b_orig_size = 0;
|
||||
curbuf->b_orig_mode = 0;
|
||||
}
|
||||
@@ -2569,6 +2572,7 @@ failed:
|
||||
{
|
||||
buf_store_time(curbuf, &st, fname);
|
||||
curbuf->b_mtime_read = curbuf->b_mtime;
|
||||
curbuf->b_mtime_read_ns = curbuf->b_mtime_ns;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -3115,16 +3119,21 @@ msg_add_eol(void)
|
||||
}
|
||||
|
||||
int
|
||||
time_differs(long t1, long t2)
|
||||
time_differs(stat_T *st, long mtime, long mtime_ns UNUSED)
|
||||
{
|
||||
#if defined(__linux__) || defined(MSWIN)
|
||||
// On a FAT filesystem, esp. under Linux, there are only 5 bits to store
|
||||
// the seconds. Since the roundoff is done when flushing the inode, the
|
||||
// time may change unexpectedly by one second!!!
|
||||
return (t1 - t2 > 1 || t2 - t1 > 1);
|
||||
#else
|
||||
return (t1 != t2);
|
||||
return
|
||||
#ifdef ST_MTIM_NSEC
|
||||
(long)st->ST_MTIM_NSEC != mtime_ns ||
|
||||
#endif
|
||||
#if defined(__linux__) || defined(MSWIN)
|
||||
// On a FAT filesystem, esp. under Linux, there are only 5 bits to store
|
||||
// the seconds. Since the roundoff is done when flushing the inode, the
|
||||
// time may change unexpectedly by one second!!!
|
||||
(long)st->st_mtime - mtime > 1 || mtime - (long)st->st_mtime > 1
|
||||
#else
|
||||
(long)st->st_mtime != mtime
|
||||
#endif
|
||||
;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -4082,7 +4091,7 @@ buf_check_timestamp(
|
||||
if ( !(buf->b_flags & BF_NOTEDITED)
|
||||
&& buf->b_mtime != 0
|
||||
&& ((stat_res = mch_stat((char *)buf->b_ffname, &st)) < 0
|
||||
|| time_differs((long)st.st_mtime, buf->b_mtime)
|
||||
|| time_differs(&st, buf->b_mtime, buf->b_mtime_ns)
|
||||
|| st.st_size != buf->b_orig_size
|
||||
#ifdef HAVE_ST_MODE
|
||||
|| (int)st.st_mode != buf->b_orig_mode
|
||||
@@ -4197,9 +4206,12 @@ buf_check_timestamp(
|
||||
mesg2 = _("See \":help W16\" for more info.");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Only timestamp changed, store it to avoid a warning
|
||||
// in check_mtime() later.
|
||||
buf->b_mtime_read = buf->b_mtime;
|
||||
buf->b_mtime_read_ns = buf->b_mtime_ns;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4503,6 +4515,11 @@ buf_reload(buf_T *buf, int orig_mode)
|
||||
buf_store_time(buf_T *buf, stat_T *st, char_u *fname UNUSED)
|
||||
{
|
||||
buf->b_mtime = (long)st->st_mtime;
|
||||
#ifdef ST_MTIM_NSEC
|
||||
buf->b_mtime_ns = (long)st->ST_MTIM_NSEC;
|
||||
#else
|
||||
buf->b_mtime_ns = 0;
|
||||
#endif
|
||||
buf->b_orig_size = st->st_size;
|
||||
#ifdef HAVE_ST_MODE
|
||||
buf->b_orig_mode = (int)st->st_mode;
|
||||
|
||||
@@ -243,7 +243,6 @@ add_buff(
|
||||
buf->bh_curr->b_next = p;
|
||||
buf->bh_curr = p;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -460,6 +460,10 @@ gui_init_check(void)
|
||||
gui.scrollbar_width = gui.scrollbar_height = SB_DEFAULT_WIDTH;
|
||||
gui.prev_wrap = -1;
|
||||
|
||||
# ifdef FEAT_GUI_GTK
|
||||
CLEAR_FIELD(gui.ligatures_map);
|
||||
#endif
|
||||
|
||||
#if defined(ALWAYS_USE_GUI) || defined(VIMDLL)
|
||||
result = OK;
|
||||
#else
|
||||
@@ -1084,6 +1088,36 @@ gui_get_wide_font(void)
|
||||
return OK;
|
||||
}
|
||||
|
||||
#if defined(FEAT_GUI_GTK) || defined(PROTO)
|
||||
/*
|
||||
* Set list of ascii characters that combined can create ligature.
|
||||
* Store them in char map for quick access from gui_gtk2_draw_string.
|
||||
*/
|
||||
void
|
||||
gui_set_ligatures(void)
|
||||
{
|
||||
char_u *p;
|
||||
|
||||
if (*p_guiligatures != NUL)
|
||||
{
|
||||
// check for invalid characters
|
||||
for (p = p_guiligatures; *p != NUL; ++p)
|
||||
if (*p < 32 || *p > 127)
|
||||
{
|
||||
emsg(_(e_ascii_code_not_in_range));
|
||||
return;
|
||||
}
|
||||
|
||||
// store valid setting into ligatures_map
|
||||
CLEAR_FIELD(gui.ligatures_map);
|
||||
for (p = p_guiligatures; *p != NUL; ++p)
|
||||
gui.ligatures_map[*p] = 1;
|
||||
}
|
||||
else
|
||||
CLEAR_FIELD(gui.ligatures_map);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
gui_set_cursor(int row, int col)
|
||||
{
|
||||
|
||||
@@ -418,6 +418,9 @@ typedef struct Gui
|
||||
char_u *browse_fname; // file name from filedlg
|
||||
|
||||
guint32 event_time;
|
||||
|
||||
char_u ligatures_map[256]; // ascii map for characters 0-255, value is
|
||||
// 1 if in 'guiligatures'
|
||||
#endif // FEAT_GUI_GTK
|
||||
|
||||
#if defined(FEAT_GUI_TABLINE) \
|
||||
|
||||
+137
-14
@@ -5595,18 +5595,22 @@ draw_under(int flags, int row, int col, int cells)
|
||||
int
|
||||
gui_gtk2_draw_string(int row, int col, char_u *s, int len, int flags)
|
||||
{
|
||||
GdkRectangle area; // area for clip mask
|
||||
PangoGlyphString *glyphs; // glyphs of current item
|
||||
int column_offset = 0; // column offset in cells
|
||||
int i;
|
||||
char_u *conv_buf = NULL; // result of UTF-8 conversion
|
||||
char_u *new_conv_buf;
|
||||
int convlen;
|
||||
char_u *sp, *bp;
|
||||
int plen;
|
||||
#if GTK_CHECK_VERSION(3,0,0)
|
||||
cairo_t *cr;
|
||||
#endif
|
||||
char_u *conv_buf = NULL; // result of UTF-8 conversion
|
||||
char_u *new_conv_buf;
|
||||
int convlen;
|
||||
char_u *sp, *bp;
|
||||
int plen;
|
||||
int len_sum; // return value needs to add up since we are
|
||||
// printing substrings
|
||||
int byte_sum; // byte position in string
|
||||
char_u *cs; // current *s pointer
|
||||
int needs_pango; // look ahead, 0=ascii 1=unicode/ligatures
|
||||
int should_need_pango = FALSE;
|
||||
int slen;
|
||||
int is_ligature;
|
||||
int next_is_ligature;
|
||||
int is_utf8;
|
||||
char_u backup_ch;
|
||||
|
||||
if (gui.text_context == NULL || gtk_widget_get_window(gui.drawarea) == NULL)
|
||||
return len;
|
||||
@@ -5652,6 +5656,125 @@ gui_gtk2_draw_string(int row, int col, char_u *s, int len, int flags)
|
||||
len = convlen;
|
||||
}
|
||||
|
||||
/*
|
||||
* Ligature support and complex utf-8 char optimization:
|
||||
* String received to output to screen can print using pre-cached glyphs
|
||||
* (fast) or Pango (slow). Ligatures and multibype utf-8 must use Pango.
|
||||
* Since we receive mixed content string, split it into logical segments
|
||||
* that are guaranteed to go trough glyphs as much as possible. Since
|
||||
* single ligature char prints as ascii, print it that way.
|
||||
*/
|
||||
len_sum = 0; // return value needs to add up since we are printing
|
||||
// substrings
|
||||
byte_sum = 0;
|
||||
cs = s;
|
||||
// look ahead, 0=ascii 1=unicode/ligatures
|
||||
needs_pango = ((*cs & 0x80) || gui.ligatures_map[*cs]);
|
||||
|
||||
// split string into ascii and non-ascii (ligatures + utf-8) substrings,
|
||||
// print glyphs or use Pango
|
||||
while (cs < s + len)
|
||||
{
|
||||
slen = 0;
|
||||
while (slen < (len - byte_sum))
|
||||
{
|
||||
is_ligature = gui.ligatures_map[*(cs + slen)];
|
||||
// look ahead, single ligature char between ascii is ascii
|
||||
if (is_ligature && !needs_pango)
|
||||
{
|
||||
if ((slen + 1) < (len - byte_sum))
|
||||
{
|
||||
next_is_ligature = gui.ligatures_map[*(cs + slen + 1)];
|
||||
if (!next_is_ligature)
|
||||
is_ligature = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
is_ligature = 0;
|
||||
}
|
||||
}
|
||||
is_utf8 = *(cs + slen) & 0x80;
|
||||
should_need_pango = (is_ligature || is_utf8);
|
||||
if (needs_pango != should_need_pango) // mode switch
|
||||
break;
|
||||
if (needs_pango)
|
||||
{
|
||||
if (is_ligature)
|
||||
{
|
||||
slen++; // ligature char by char
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((*(cs + slen) & 0xC0) == 0x80)
|
||||
{
|
||||
// a continuation, find next 0xC0 != 0x80 but don't
|
||||
// include it
|
||||
while ((slen < (len - byte_sum))
|
||||
&& ((*(cs + slen) & 0xC0) == 0x80))
|
||||
{
|
||||
slen++;
|
||||
}
|
||||
}
|
||||
else if ((*(cs + slen) & 0xE0) == 0xC0)
|
||||
{
|
||||
// + one byte utf8
|
||||
slen++;
|
||||
}
|
||||
else if ((*(cs + slen) & 0xF0) == 0xE0)
|
||||
{
|
||||
// + two bytes utf8
|
||||
slen += 2;
|
||||
}
|
||||
else if ((*(cs + slen) & 0xF8) == 0xF0)
|
||||
{
|
||||
// + three bytes utf8
|
||||
slen += 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
// this should not happen, try moving forward, Pango
|
||||
// will catch it
|
||||
slen++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
slen++; // ascii
|
||||
}
|
||||
}
|
||||
|
||||
// temporarily zero terminate substring, print, restore char, wrap
|
||||
backup_ch = *(cs + slen);
|
||||
*(cs + slen) = 0;
|
||||
len_sum += gui_gtk2_draw_string_ext(row, col + len_sum,
|
||||
cs, slen, flags, needs_pango);
|
||||
*(cs + slen) = backup_ch;
|
||||
cs += slen;
|
||||
byte_sum += slen;
|
||||
needs_pango = should_need_pango;
|
||||
}
|
||||
vim_free(conv_buf);
|
||||
return len_sum;
|
||||
}
|
||||
|
||||
int
|
||||
gui_gtk2_draw_string_ext(
|
||||
int row,
|
||||
int col,
|
||||
char_u *s,
|
||||
int len,
|
||||
int flags,
|
||||
int force_pango)
|
||||
{
|
||||
GdkRectangle area; // area for clip mask
|
||||
PangoGlyphString *glyphs; // glyphs of current item
|
||||
int column_offset = 0; // column offset in cells
|
||||
int i;
|
||||
#if GTK_CHECK_VERSION(3,0,0)
|
||||
cairo_t *cr;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Restrict all drawing to the current screen line in order to prevent
|
||||
* fuzzy font lookups from messing up the screen.
|
||||
@@ -5679,7 +5802,8 @@ gui_gtk2_draw_string(int row, int col, char_u *s, int len, int flags)
|
||||
*/
|
||||
if (!(flags & DRAW_ITALIC)
|
||||
&& !((flags & DRAW_BOLD) && gui.font_can_bold)
|
||||
&& gui.ascii_glyphs != NULL)
|
||||
&& gui.ascii_glyphs != NULL
|
||||
&& !force_pango)
|
||||
{
|
||||
char_u *p;
|
||||
|
||||
@@ -5883,7 +6007,6 @@ skipitall:
|
||||
#endif
|
||||
|
||||
pango_glyph_string_free(glyphs);
|
||||
vim_free(conv_buf);
|
||||
|
||||
#if GTK_CHECK_VERSION(3,0,0)
|
||||
cairo_destroy(cr);
|
||||
|
||||
@@ -641,9 +641,6 @@ do_highlight(
|
||||
int error = FALSE;
|
||||
int color;
|
||||
int is_normal_group = FALSE; // "Normal" group
|
||||
#ifdef FEAT_TERMINAL
|
||||
int is_terminal_group = FALSE; // "Terminal" group
|
||||
#endif
|
||||
#ifdef FEAT_GUI_X11
|
||||
int is_menu_group = FALSE; // "Menu" group
|
||||
int is_scrollbar_group = FALSE; // "Scrollbar" group
|
||||
@@ -883,10 +880,6 @@ do_highlight(
|
||||
|
||||
if (STRCMP(HL_TABLE()[idx].sg_name_u, "NORMAL") == 0)
|
||||
is_normal_group = TRUE;
|
||||
#ifdef FEAT_TERMINAL
|
||||
else if (STRCMP(HL_TABLE()[idx].sg_name_u, "TERMINAL") == 0)
|
||||
is_terminal_group = TRUE;
|
||||
#endif
|
||||
#ifdef FEAT_GUI_X11
|
||||
else if (STRCMP(HL_TABLE()[idx].sg_name_u, "MENU") == 0)
|
||||
is_menu_group = TRUE;
|
||||
@@ -1535,11 +1528,6 @@ do_highlight(
|
||||
control_console_color_rgb();
|
||||
#endif
|
||||
}
|
||||
#ifdef FEAT_TERMINAL
|
||||
else if (is_terminal_group)
|
||||
set_terminal_default_colors(
|
||||
HL_TABLE()[idx].sg_cterm_fg, HL_TABLE()[idx].sg_cterm_bg);
|
||||
#endif
|
||||
#ifdef FEAT_GUI_X11
|
||||
# ifdef FEAT_MENU
|
||||
else if (is_menu_group)
|
||||
|
||||
+51
-7
@@ -299,7 +299,11 @@ has_compl_option(int dict_opt)
|
||||
&& !curwin->w_p_spell
|
||||
#endif
|
||||
)
|
||||
: (*curbuf->b_p_tsr == NUL && *p_tsr == NUL))
|
||||
: (*curbuf->b_p_tsr == NUL && *p_tsr == NUL
|
||||
#ifdef FEAT_COMPL_FUNC
|
||||
&& *curbuf->b_p_tsrfu == NUL && *p_tsrfu == NUL
|
||||
#endif
|
||||
))
|
||||
{
|
||||
ctrl_x_mode = CTRL_X_NORMAL;
|
||||
edit_submode = NULL;
|
||||
@@ -2234,6 +2238,25 @@ ins_compl_next_buf(buf_T *buf, int flag)
|
||||
}
|
||||
|
||||
#ifdef FEAT_COMPL_FUNC
|
||||
/*
|
||||
* Get the user-defined completion function name for completion 'type'
|
||||
*/
|
||||
static char_u *
|
||||
get_complete_funcname(int type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case CTRL_X_FUNCTION:
|
||||
return curbuf->b_p_cfu;
|
||||
case CTRL_X_OMNI:
|
||||
return curbuf->b_p_ofu;
|
||||
case CTRL_X_THESAURUS:
|
||||
return *curbuf->b_p_tsrfu == NUL ? p_tsrfu : curbuf->b_p_tsrfu;
|
||||
default:
|
||||
return (char_u *)"";
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Execute user defined complete function 'completefunc' or 'omnifunc', and
|
||||
* get matches in "matches".
|
||||
@@ -2251,7 +2274,7 @@ expand_by_function(
|
||||
typval_T rettv;
|
||||
int save_State = State;
|
||||
|
||||
funcname = (type == CTRL_X_FUNCTION) ? curbuf->b_p_cfu : curbuf->b_p_ofu;
|
||||
funcname = get_complete_funcname(type);
|
||||
if (*funcname == NUL)
|
||||
return;
|
||||
|
||||
@@ -2725,6 +2748,20 @@ f_complete_info(typval_T *argvars, typval_T *rettv)
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Returns TRUE when using a user-defined function for thesaurus completion.
|
||||
*/
|
||||
static int
|
||||
thesaurus_func_complete(int type UNUSED)
|
||||
{
|
||||
#ifdef FEAT_COMPL_FUNC
|
||||
return type == CTRL_X_THESAURUS
|
||||
&& (*curbuf->b_p_tsrfu != NUL || *p_tsrfu != NUL);
|
||||
#else
|
||||
return FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the next expansion(s), using "compl_pattern".
|
||||
* The search starts at position "ini" in curbuf and in the direction
|
||||
@@ -2911,7 +2948,12 @@ ins_compl_get_exp(pos_T *ini)
|
||||
|
||||
case CTRL_X_DICTIONARY:
|
||||
case CTRL_X_THESAURUS:
|
||||
ins_compl_dictionaries(
|
||||
#ifdef FEAT_COMPL_FUNC
|
||||
if (thesaurus_func_complete(type))
|
||||
expand_by_function(type, compl_pattern);
|
||||
else
|
||||
#endif
|
||||
ins_compl_dictionaries(
|
||||
dict != NULL ? dict
|
||||
: (type == CTRL_X_THESAURUS
|
||||
? (*curbuf->b_p_tsr == NUL
|
||||
@@ -3765,7 +3807,9 @@ ins_complete(int c, int enable_pum)
|
||||
}
|
||||
|
||||
// Work out completion pattern and original text -- webb
|
||||
if (ctrl_x_mode == CTRL_X_NORMAL || (ctrl_x_mode & CTRL_X_WANT_IDENT))
|
||||
if (ctrl_x_mode == CTRL_X_NORMAL
|
||||
|| (ctrl_x_mode & CTRL_X_WANT_IDENT
|
||||
&& !thesaurus_func_complete(ctrl_x_mode)))
|
||||
{
|
||||
if ((compl_cont_status & CONT_SOL)
|
||||
|| ctrl_x_mode == CTRL_X_PATH_DEFINES)
|
||||
@@ -3915,7 +3959,8 @@ ins_complete(int c, int enable_pum)
|
||||
compl_col = (int)(compl_xp.xp_pattern - compl_pattern);
|
||||
compl_length = curs_col - compl_col;
|
||||
}
|
||||
else if (ctrl_x_mode == CTRL_X_FUNCTION || ctrl_x_mode == CTRL_X_OMNI)
|
||||
else if (ctrl_x_mode == CTRL_X_FUNCTION || ctrl_x_mode == CTRL_X_OMNI
|
||||
|| thesaurus_func_complete(ctrl_x_mode))
|
||||
{
|
||||
#ifdef FEAT_COMPL_FUNC
|
||||
// Call user defined function 'completefunc' with "a:findstart"
|
||||
@@ -3928,8 +3973,7 @@ ins_complete(int c, int enable_pum)
|
||||
|
||||
// Call 'completefunc' or 'omnifunc' and get pattern length as a
|
||||
// string
|
||||
funcname = ctrl_x_mode == CTRL_X_FUNCTION
|
||||
? curbuf->b_p_cfu : curbuf->b_p_ofu;
|
||||
funcname = get_complete_funcname(ctrl_x_mode);
|
||||
if (*funcname == NUL)
|
||||
{
|
||||
semsg(_(e_notset), ctrl_x_mode == CTRL_X_FUNCTION
|
||||
|
||||
+1
-3
@@ -181,10 +181,8 @@ checkpcmark(void)
|
||||
if (curwin->w_prev_pcmark.lnum != 0
|
||||
&& (EQUAL_POS(curwin->w_pcmark, curwin->w_cursor)
|
||||
|| curwin->w_pcmark.lnum == 0))
|
||||
{
|
||||
curwin->w_pcmark = curwin->w_prev_pcmark;
|
||||
curwin->w_prev_pcmark.lnum = 0; // Show it has been checked
|
||||
}
|
||||
curwin->w_prev_pcmark.lnum = 0; // it has been checked
|
||||
}
|
||||
|
||||
#if defined(FEAT_JUMPLIST) || defined(PROTO)
|
||||
|
||||
+6
-2
@@ -1032,6 +1032,7 @@ set_b0_fname(ZERO_BL *b0p, buf_T *buf)
|
||||
#endif
|
||||
buf_store_time(buf, &st, buf->b_ffname);
|
||||
buf->b_mtime_read = buf->b_mtime;
|
||||
buf->b_mtime_read_ns = buf->b_mtime_ns;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1040,7 +1041,9 @@ set_b0_fname(ZERO_BL *b0p, buf_T *buf)
|
||||
long_to_char(0L, b0p->b0_ino);
|
||||
#endif
|
||||
buf->b_mtime = 0;
|
||||
buf->b_mtime_ns = 0;
|
||||
buf->b_mtime_read = 0;
|
||||
buf->b_mtime_read_ns = 0;
|
||||
buf->b_orig_size = 0;
|
||||
buf->b_orig_mode = 0;
|
||||
}
|
||||
@@ -1786,7 +1789,6 @@ theend:
|
||||
apply_autocmds(EVENT_BUFREADPOST, NULL, curbuf->b_fname, FALSE, curbuf);
|
||||
apply_autocmds(EVENT_BUFWINENTER, NULL, curbuf->b_fname, FALSE, curbuf);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2437,6 +2439,9 @@ ml_sync_all(int check_file, int check_char)
|
||||
*/
|
||||
if (mch_stat((char *)buf->b_ffname, &st) == -1
|
||||
|| st.st_mtime != buf->b_mtime_read
|
||||
#ifdef ST_MTIM_NSEC
|
||||
|| st.ST_MTIM_NSEC != buf->b_mtime_read_ns
|
||||
#endif
|
||||
|| st.st_size != buf->b_orig_size)
|
||||
{
|
||||
ml_preserve(buf, FALSE);
|
||||
@@ -3930,7 +3935,6 @@ ml_clearmarked(void)
|
||||
}
|
||||
|
||||
lowest_marked = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -2682,7 +2682,6 @@ get_scroll_overlap(lineoff_T *lp, int dir)
|
||||
*lp = loff1; // 1 line overlap
|
||||
else
|
||||
*lp = loff2; // 2 lines overlap
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -1760,7 +1760,10 @@ nb_do_cmd(
|
||||
if (buf == NULL || buf->bufp == NULL)
|
||||
nbdebug((" invalid buffer identifier in setModtime\n"));
|
||||
else
|
||||
{
|
||||
buf->bufp->b_mtime = atoi((char *)args);
|
||||
buf->bufp->b_mtime_ns = 0;
|
||||
}
|
||||
// =====================================================================
|
||||
}
|
||||
else if (streq((char *)cmd, "setReadOnly"))
|
||||
|
||||
+2
-3
@@ -3753,7 +3753,7 @@ nv_ident(cmdarg_T *cap)
|
||||
ptr = vim_strnsave(ptr, n);
|
||||
if (kp_ex)
|
||||
// Escape the argument properly for an Ex command
|
||||
p = vim_strsave_fnameescape(ptr, FALSE);
|
||||
p = vim_strsave_fnameescape(ptr, VSE_NONE);
|
||||
else
|
||||
// Escape the argument properly for a shell command
|
||||
p = vim_strsave_shellescape(ptr, TRUE, TRUE);
|
||||
@@ -5683,8 +5683,7 @@ nv_visual(cmdarg_T *cap)
|
||||
{
|
||||
curwin->w_cursor.lnum +=
|
||||
resel_VIsual_line_count * cap->count0 - 1;
|
||||
if (curwin->w_cursor.lnum > curbuf->b_ml.ml_line_count)
|
||||
curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
|
||||
check_cursor();
|
||||
}
|
||||
VIsual_mode = resel_VIsual_mode;
|
||||
if (VIsual_mode == 'v')
|
||||
|
||||
+15
-2
@@ -5239,6 +5239,11 @@ unset_global_local_option(char_u *name, void *from)
|
||||
case PV_TSR:
|
||||
clear_string_option(&buf->b_p_tsr);
|
||||
break;
|
||||
#ifdef FEAT_COMPL_FUNC
|
||||
case PV_TSRFU:
|
||||
clear_string_option(&buf->b_p_tsrfu);
|
||||
break;
|
||||
#endif
|
||||
case PV_FP:
|
||||
clear_string_option(&buf->b_p_fp);
|
||||
break;
|
||||
@@ -5333,6 +5338,9 @@ get_varp_scope(struct vimoption *p, int opt_flags)
|
||||
#endif
|
||||
case PV_DICT: return (char_u *)&(curbuf->b_p_dict);
|
||||
case PV_TSR: return (char_u *)&(curbuf->b_p_tsr);
|
||||
#ifdef FEAT_COMPL_FUNC
|
||||
case PV_TSRFU: return (char_u *)&(curbuf->b_p_tsrfu);
|
||||
#endif
|
||||
#if defined(FEAT_BEVAL) && defined(FEAT_EVAL)
|
||||
case PV_BEXPR: return (char_u *)&(curbuf->b_p_bexpr);
|
||||
#endif
|
||||
@@ -5413,6 +5421,10 @@ get_varp(struct vimoption *p)
|
||||
? (char_u *)&(curbuf->b_p_dict) : p->var;
|
||||
case PV_TSR: return *curbuf->b_p_tsr != NUL
|
||||
? (char_u *)&(curbuf->b_p_tsr) : p->var;
|
||||
#ifdef FEAT_COMPL_FUNC
|
||||
case PV_TSRFU: return *curbuf->b_p_tsrfu != NUL
|
||||
? (char_u *)&(curbuf->b_p_tsrfu) : p->var;
|
||||
#endif
|
||||
case PV_FP: return *curbuf->b_p_fp != NUL
|
||||
? (char_u *)&(curbuf->b_p_fp) : p->var;
|
||||
#ifdef FEAT_QUICKFIX
|
||||
@@ -6191,6 +6203,9 @@ buf_copy_options(buf_T *buf, int flags)
|
||||
#endif
|
||||
buf->b_p_dict = empty_option;
|
||||
buf->b_p_tsr = empty_option;
|
||||
#ifdef FEAT_COMPL_FUNC
|
||||
buf->b_p_tsrfu = empty_option;
|
||||
#endif
|
||||
#ifdef FEAT_TEXTOBJ
|
||||
buf->b_p_qe = vim_strsave(p_qe);
|
||||
COPY_OPT_SCTX(buf, BV_QE);
|
||||
@@ -6505,8 +6520,6 @@ set_context_in_set_cmd(
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
@@ -404,6 +404,7 @@ EXTERN char_u *p_cinw; // 'cinwords'
|
||||
#ifdef FEAT_COMPL_FUNC
|
||||
EXTERN char_u *p_cfu; // 'completefunc'
|
||||
EXTERN char_u *p_ofu; // 'omnifunc'
|
||||
EXTERN char_u *p_tsrfu; // 'thesaurusfunc'
|
||||
#endif
|
||||
EXTERN int p_ci; // 'copyindent'
|
||||
#ifdef FEAT_ANTIALIAS
|
||||
@@ -633,6 +634,9 @@ EXTERN char_u *p_guifontset; // 'guifontset'
|
||||
EXTERN char_u *p_guifontwide; // 'guifontwide'
|
||||
EXTERN int p_guipty; // 'guipty'
|
||||
#endif
|
||||
#ifdef FEAT_GUI_GTK
|
||||
EXTERN char_u *p_guiligatures; // 'guiligatures'
|
||||
# endif
|
||||
#if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11)
|
||||
EXTERN long p_ghr; // 'guiheadroom'
|
||||
#endif
|
||||
@@ -1246,6 +1250,9 @@ enum
|
||||
#endif
|
||||
, BV_TAGS
|
||||
, BV_TC
|
||||
#ifdef FEAT_COMPL_FUNC
|
||||
, BV_TSRFU
|
||||
#endif
|
||||
, BV_TS
|
||||
, BV_TW
|
||||
, BV_TX
|
||||
|
||||
@@ -143,6 +143,9 @@
|
||||
#ifdef FEAT_EVAL
|
||||
# define PV_TFU OPT_BUF(BV_TFU)
|
||||
#endif
|
||||
#ifdef FEAT_COMPL_FUNC
|
||||
# define PV_TSRFU OPT_BOTH(OPT_BUF(BV_TSRFU))
|
||||
#endif
|
||||
#define PV_TAGS OPT_BOTH(OPT_BUF(BV_TAGS))
|
||||
#define PV_TC OPT_BOTH(OPT_BUF(BV_TC))
|
||||
#define PV_TS OPT_BUF(BV_TS)
|
||||
@@ -1278,6 +1281,19 @@ static struct vimoption options[] =
|
||||
{(char_u *)NULL, (char_u *)0L}
|
||||
#endif
|
||||
SCTX_INIT},
|
||||
|
||||
|
||||
{"guiligatures", "gli", P_STRING|P_VI_DEF|P_RCLR|P_ONECOMMA|P_NODUP,
|
||||
#if defined(FEAT_GUI_GTK)
|
||||
(char_u *)&p_guiligatures, PV_NONE,
|
||||
{(char_u *)"", (char_u *)0L}
|
||||
#else
|
||||
(char_u *)NULL, PV_NONE,
|
||||
{(char_u *)NULL, (char_u *)0L}
|
||||
#endif
|
||||
SCTX_INIT},
|
||||
|
||||
|
||||
{"guiheadroom", "ghr", P_NUM|P_VI_DEF,
|
||||
#if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_X11)
|
||||
(char_u *)&p_ghr, PV_NONE,
|
||||
@@ -2728,6 +2744,15 @@ static struct vimoption options[] =
|
||||
{"thesaurus", "tsr", P_STRING|P_EXPAND|P_VI_DEF|P_ONECOMMA|P_NODUP|P_NDNAME,
|
||||
(char_u *)&p_tsr, PV_TSR,
|
||||
{(char_u *)"", (char_u *)0L} SCTX_INIT},
|
||||
{"thesaurusfunc", "tsrfu", P_STRING|P_ALLOCED|P_VI_DEF|P_SECURE,
|
||||
#ifdef FEAT_COMPL_FUNC
|
||||
(char_u *)&p_tsrfu, PV_TSRFU,
|
||||
{(char_u *)"", (char_u *)0L}
|
||||
#else
|
||||
(char_u *)NULL, PV_NONE,
|
||||
{(char_u *)0L, (char_u *)0L}
|
||||
#endif
|
||||
SCTX_INIT},
|
||||
{"tildeop", "top", P_BOOL|P_VI_DEF|P_VIM,
|
||||
(char_u *)&p_to, PV_NONE,
|
||||
{(char_u *)FALSE, (char_u *)0L} SCTX_INIT},
|
||||
|
||||
@@ -271,6 +271,7 @@ check_buf_options(buf_T *buf)
|
||||
#ifdef FEAT_COMPL_FUNC
|
||||
check_string_option(&buf->b_p_cfu);
|
||||
check_string_option(&buf->b_p_ofu);
|
||||
check_string_option(&buf->b_p_tsrfu);
|
||||
#endif
|
||||
#ifdef FEAT_EVAL
|
||||
check_string_option(&buf->b_p_tfu);
|
||||
@@ -1569,6 +1570,13 @@ ambw_end:
|
||||
redraw_gui_only = TRUE;
|
||||
}
|
||||
#endif
|
||||
# if defined(FEAT_GUI_GTK)
|
||||
else if (varp == &p_guiligatures)
|
||||
{
|
||||
gui_set_ligatures();
|
||||
redraw_gui_only = TRUE;
|
||||
}
|
||||
# endif
|
||||
|
||||
#ifdef CURSOR_SHAPE
|
||||
// 'guicursor'
|
||||
|
||||
@@ -4824,6 +4824,11 @@ mch_call_shell_fork(
|
||||
// push stream discipline modules
|
||||
if (options & SHELL_COOKED)
|
||||
setup_slavepty(pty_slave_fd);
|
||||
# ifdef TIOCSCTTY
|
||||
// Try to become controlling tty (probably doesn't work,
|
||||
// unless run by root)
|
||||
ioctl(pty_slave_fd, TIOCSCTTY, (char *)NULL);
|
||||
# endif
|
||||
}
|
||||
# endif
|
||||
set_default_child_environment(FALSE);
|
||||
|
||||
@@ -26,7 +26,7 @@ void redrawcmd(void);
|
||||
void compute_cmdrow(void);
|
||||
void cursorcmd(void);
|
||||
void gotocmdline(int clr);
|
||||
char_u *vim_strsave_fnameescape(char_u *fname, int shell);
|
||||
char_u *vim_strsave_fnameescape(char_u *fname, int what);
|
||||
void escape_fname(char_u **pp);
|
||||
void tilde_replace(char_u *orig_pat, int num_files, char_u **files);
|
||||
cmdline_info_T *get_cmdline_info(void);
|
||||
|
||||
@@ -12,7 +12,7 @@ void msg_add_fname(buf_T *buf, char_u *fname);
|
||||
int msg_add_fileformat(int eol_type);
|
||||
void msg_add_lines(int insert_space, long lnum, off_T nchars);
|
||||
void msg_add_eol(void);
|
||||
int time_differs(long t1, long t2);
|
||||
int time_differs(stat_T *st, long mtime, long mtime_ns);
|
||||
int need_conversion(char_u *fenc);
|
||||
int get_fio_flags(char_u *ptr);
|
||||
int get_win_fio_flags(char_u *ptr);
|
||||
|
||||
@@ -7,6 +7,7 @@ void gui_exit(int rc);
|
||||
void gui_shell_closed(void);
|
||||
int gui_init_font(char_u *font_list, int fontset);
|
||||
int gui_get_wide_font(void);
|
||||
void gui_set_ligatures(void);
|
||||
void gui_update_cursor(int force, int clear_selection);
|
||||
void gui_position_menu(void);
|
||||
int gui_get_base_width(void);
|
||||
|
||||
@@ -43,6 +43,7 @@ void gui_mch_set_fg_color(guicolor_T color);
|
||||
void gui_mch_set_bg_color(guicolor_T color);
|
||||
void gui_mch_set_sp_color(guicolor_T color);
|
||||
int gui_gtk2_draw_string(int row, int col, char_u *s, int len, int flags);
|
||||
int gui_gtk2_draw_string_ext(int row, int col, char_u *s, int len, int flags, int force_pango);
|
||||
int gui_mch_haskey(char_u *name);
|
||||
int gui_get_x11_windis(Window *win, Display **dis);
|
||||
Display *gui_mch_get_display(void);
|
||||
|
||||
@@ -19,7 +19,6 @@ cursorentry_T *term_get_cursor_shape(guicolor_T *fg, guicolor_T *bg);
|
||||
int term_use_loop(void);
|
||||
void term_win_entered(void);
|
||||
int terminal_loop(int blocking);
|
||||
void set_terminal_default_colors(int cterm_fg, int cterm_bg);
|
||||
int may_close_term_popup(void);
|
||||
void term_channel_closed(channel_T *ch);
|
||||
void term_check_channel_closed_recently(void);
|
||||
|
||||
@@ -17,6 +17,7 @@ void fill_exarg_from_cctx(exarg_T *eap, cctx_T *cctx);
|
||||
int assignment_len(char_u *p, int *heredoc);
|
||||
void vim9_declare_error(char_u *name);
|
||||
int check_vim9_unlet(char_u *name);
|
||||
int check_global_and_subst(char_u *cmd, char_u *arg);
|
||||
int compile_def_function(ufunc_T *ufunc, int check_return_type, compiletype_T compile_type, cctx_T *outer_cctx);
|
||||
void set_function_type(ufunc_T *ufunc);
|
||||
void delete_instr(isn_T *isn);
|
||||
|
||||
+9
-2
@@ -2011,8 +2011,15 @@ do_put(
|
||||
}
|
||||
|
||||
do {
|
||||
totlen = count * yanklen;
|
||||
if (totlen > 0)
|
||||
long multlen = count * yanklen;
|
||||
|
||||
totlen = multlen;
|
||||
if (totlen != multlen)
|
||||
{
|
||||
emsg(_(e_resulting_text_too_long));
|
||||
break;
|
||||
}
|
||||
else if (totlen > 0)
|
||||
{
|
||||
oldp = ml_get(lnum);
|
||||
if (lnum > start_lnum)
|
||||
|
||||
+34
-5
@@ -4817,6 +4817,35 @@ screen_screenrow(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Calls mb_ptr2char_adv(p) and returns the character.
|
||||
* If "p" starts with "\x", "\u" or "\U" the hex or unicode value is used.
|
||||
*/
|
||||
static int
|
||||
get_encoded_char_adv(char_u **p)
|
||||
{
|
||||
char_u *s = *p;
|
||||
|
||||
if (s[0] == '\\' && (s[1] == 'x' || s[1] == 'u' || s[1] == 'U'))
|
||||
{
|
||||
varnumber_T num = 0;
|
||||
int bytes;
|
||||
int n;
|
||||
|
||||
for (bytes = s[1] == 'x' ? 1 : s[1] == 'u' ? 2 : 4; bytes > 0; --bytes)
|
||||
{
|
||||
*p += 2;
|
||||
n = hexhex2nr(*p);
|
||||
if (n < 0)
|
||||
return 0;
|
||||
num = num * 256 + n;
|
||||
}
|
||||
*p += 2;
|
||||
return num;
|
||||
}
|
||||
return mb_ptr2char_adv(p);
|
||||
}
|
||||
|
||||
/*
|
||||
* Handle setting 'listchars' or 'fillchars'.
|
||||
* Assume monocell characters.
|
||||
@@ -4925,19 +4954,19 @@ set_chars_option(win_T *wp, char_u **varp)
|
||||
{
|
||||
c2 = c3 = 0;
|
||||
s = p + len + 1;
|
||||
c1 = mb_ptr2char_adv(&s);
|
||||
c1 = get_encoded_char_adv(&s);
|
||||
if (mb_char2cells(c1) > 1)
|
||||
return e_invarg;
|
||||
if (tab[i].cp == &lcs_chars.tab2)
|
||||
{
|
||||
if (*s == NUL)
|
||||
return e_invarg;
|
||||
c2 = mb_ptr2char_adv(&s);
|
||||
c2 = get_encoded_char_adv(&s);
|
||||
if (mb_char2cells(c2) > 1)
|
||||
return e_invarg;
|
||||
if (!(*s == ',' || *s == NUL))
|
||||
{
|
||||
c3 = mb_ptr2char_adv(&s);
|
||||
c3 = get_encoded_char_adv(&s);
|
||||
if (mb_char2cells(c3) > 1)
|
||||
return e_invarg;
|
||||
}
|
||||
@@ -4979,7 +5008,7 @@ set_chars_option(win_T *wp, char_u **varp)
|
||||
multispace_len = 0;
|
||||
while (*s != NUL && *s != ',')
|
||||
{
|
||||
c1 = mb_ptr2char_adv(&s);
|
||||
c1 = get_encoded_char_adv(&s);
|
||||
if (mb_char2cells(c1) > 1)
|
||||
return e_invarg;
|
||||
++multispace_len;
|
||||
@@ -4995,7 +5024,7 @@ set_chars_option(win_T *wp, char_u **varp)
|
||||
|
||||
while (*s != NUL && *s != ',')
|
||||
{
|
||||
c1 = mb_ptr2char_adv(&s);
|
||||
c1 = get_encoded_char_adv(&s);
|
||||
if (p == last_multispace)
|
||||
lcs_chars.multispace[multispace_pos++] = c1;
|
||||
}
|
||||
|
||||
+13
-32
@@ -84,15 +84,14 @@ static int lastc_bytelen = 1; // >1 for multi-byte char
|
||||
|
||||
// copy of spats[], for keeping the search patterns while executing autocmds
|
||||
static spat_T saved_spats[2];
|
||||
static char_u *saved_mr_pattern = NULL;
|
||||
# ifdef FEAT_SEARCH_EXTRA
|
||||
static int saved_spats_last_idx = 0;
|
||||
static int saved_spats_no_hlsearch = 0;
|
||||
# endif
|
||||
|
||||
static char_u *mr_pattern = NULL; // pattern used by search_regcomp()
|
||||
#ifdef FEAT_RIGHTLEFT
|
||||
static int mr_pattern_alloced = FALSE; // mr_pattern was allocated
|
||||
#endif
|
||||
// allocated copy of pattern used by search_regcomp()
|
||||
static char_u *mr_pattern = NULL;
|
||||
|
||||
#ifdef FEAT_FIND_ID
|
||||
/*
|
||||
@@ -161,29 +160,13 @@ search_regcomp(
|
||||
else if (options & SEARCH_HIS) // put new pattern in history
|
||||
add_to_history(HIST_SEARCH, pat, TRUE, NUL);
|
||||
|
||||
vim_free(mr_pattern);
|
||||
#ifdef FEAT_RIGHTLEFT
|
||||
if (mr_pattern_alloced)
|
||||
{
|
||||
vim_free(mr_pattern);
|
||||
mr_pattern_alloced = FALSE;
|
||||
}
|
||||
|
||||
if (curwin->w_p_rl && *curwin->w_p_rlc == 's')
|
||||
{
|
||||
char_u *rev_pattern;
|
||||
|
||||
rev_pattern = reverse_text(pat);
|
||||
if (rev_pattern == NULL)
|
||||
mr_pattern = pat; // out of memory, keep normal pattern.
|
||||
else
|
||||
{
|
||||
mr_pattern = rev_pattern;
|
||||
mr_pattern_alloced = TRUE;
|
||||
}
|
||||
}
|
||||
mr_pattern = reverse_text(pat);
|
||||
else
|
||||
#endif
|
||||
mr_pattern = pat;
|
||||
mr_pattern = vim_strsave(pat);
|
||||
|
||||
/*
|
||||
* Save the currently used pattern in the appropriate place,
|
||||
@@ -298,6 +281,10 @@ save_search_patterns(void)
|
||||
saved_spats[1] = spats[1];
|
||||
if (spats[1].pat != NULL)
|
||||
saved_spats[1].pat = vim_strsave(spats[1].pat);
|
||||
if (mr_pattern == NULL)
|
||||
saved_mr_pattern = NULL;
|
||||
else
|
||||
saved_mr_pattern = vim_strsave(mr_pattern);
|
||||
#ifdef FEAT_SEARCH_EXTRA
|
||||
saved_spats_last_idx = last_idx;
|
||||
saved_spats_no_hlsearch = no_hlsearch;
|
||||
@@ -317,6 +304,8 @@ restore_search_patterns(void)
|
||||
#endif
|
||||
vim_free(spats[1].pat);
|
||||
spats[1] = saved_spats[1];
|
||||
vim_free(mr_pattern);
|
||||
mr_pattern = saved_mr_pattern;
|
||||
#ifdef FEAT_SEARCH_EXTRA
|
||||
last_idx = saved_spats_last_idx;
|
||||
set_no_hlsearch(saved_spats_no_hlsearch);
|
||||
@@ -330,15 +319,7 @@ free_search_patterns(void)
|
||||
{
|
||||
vim_free(spats[0].pat);
|
||||
vim_free(spats[1].pat);
|
||||
|
||||
# ifdef FEAT_RIGHTLEFT
|
||||
if (mr_pattern_alloced)
|
||||
{
|
||||
vim_free(mr_pattern);
|
||||
mr_pattern_alloced = FALSE;
|
||||
mr_pattern = NULL;
|
||||
}
|
||||
# endif
|
||||
VIM_CLEAR(mr_pattern);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@ ses_put_fname(FILE *fd, char_u *name, unsigned *flagp)
|
||||
}
|
||||
|
||||
// escape special characters
|
||||
p = vim_strsave_fnameescape(sname, FALSE);
|
||||
p = vim_strsave_fnameescape(sname, VSE_NONE);
|
||||
vim_free(sname);
|
||||
if (p == NULL)
|
||||
return FAIL;
|
||||
|
||||
+8
-3
@@ -2704,10 +2704,10 @@ struct file_buffer
|
||||
// incremented for each change, also for undo
|
||||
#define CHANGEDTICK(buf) ((buf)->b_ct_di.di_tv.vval.v_number)
|
||||
|
||||
varnumber_T b_last_changedtick; // b:changedtick when TextChanged or
|
||||
// TextChangedI was last triggered.
|
||||
varnumber_T b_last_changedtick_pum; // b:changedtick when TextChangedP was
|
||||
varnumber_T b_last_changedtick; // b:changedtick when TextChanged was
|
||||
// last triggered.
|
||||
varnumber_T b_last_changedtick_pum; // b:changedtick for TextChangedP
|
||||
varnumber_T b_last_changedtick_i; // b:changedtick for TextChangedI
|
||||
|
||||
int b_saving; // Set to TRUE if we are in the middle of
|
||||
// saving the buffer.
|
||||
@@ -2727,7 +2727,9 @@ struct file_buffer
|
||||
wininfo_T *b_wininfo; // list of last used info for each window
|
||||
|
||||
long b_mtime; // last change time of original file
|
||||
long b_mtime_ns; // nanoseconds of last change time
|
||||
long b_mtime_read; // last change time when reading
|
||||
long b_mtime_read_ns; // nanoseconds of last read time
|
||||
off_T b_orig_size; // size of original file in bytes
|
||||
int b_orig_mode; // mode of original file
|
||||
#ifdef FEAT_VIMINFO
|
||||
@@ -2967,6 +2969,9 @@ struct file_buffer
|
||||
unsigned b_tc_flags; // flags for 'tagcase'
|
||||
char_u *b_p_dict; // 'dictionary' local value
|
||||
char_u *b_p_tsr; // 'thesaurus' local value
|
||||
#ifdef FEAT_COMPL_FUNC
|
||||
char_u *b_p_tsrfu; // 'thesaurusfunc' local value
|
||||
#endif
|
||||
long b_p_ul; // 'undolevels' local value
|
||||
#ifdef FEAT_PERSISTENT_UNDO
|
||||
int b_p_udf; // 'undofile'
|
||||
|
||||
+43
-85
@@ -204,10 +204,6 @@ static void handle_postponed_scrollback(term_T *term);
|
||||
// backspace key.
|
||||
static int term_backspace_char = BS;
|
||||
|
||||
// "Terminal" highlight group colors.
|
||||
static int term_default_cterm_fg = -1;
|
||||
static int term_default_cterm_bg = -1;
|
||||
|
||||
// Store the last set and the desired cursor properties, so that we only update
|
||||
// them when needed. Doing it unnecessary may result in flicker.
|
||||
static char_u *last_set_cursor_color = NULL;
|
||||
@@ -671,7 +667,7 @@ term_start(
|
||||
|
||||
if (s == NULL)
|
||||
break;
|
||||
p = vim_strsave_fnameescape(s, FALSE);
|
||||
p = vim_strsave_fnameescape(s, VSE_NONE);
|
||||
if (p == NULL)
|
||||
break;
|
||||
ga_concat(&ga, p);
|
||||
@@ -2726,48 +2722,6 @@ may_toggle_cursor(term_T *term)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Cache "Terminal" highlight group colors.
|
||||
*/
|
||||
void
|
||||
set_terminal_default_colors(int cterm_fg, int cterm_bg)
|
||||
{
|
||||
term_default_cterm_fg = cterm_fg - 1;
|
||||
term_default_cterm_bg = cterm_bg - 1;
|
||||
}
|
||||
|
||||
static int
|
||||
get_default_cterm_fg(term_T *term)
|
||||
{
|
||||
if (term->tl_highlight_name != NULL)
|
||||
{
|
||||
int id = syn_name2id(term->tl_highlight_name);
|
||||
int fg = -1;
|
||||
int bg = -1;
|
||||
|
||||
if (id > 0)
|
||||
syn_id2cterm_bg(id, &fg, &bg);
|
||||
return fg;
|
||||
}
|
||||
return term_default_cterm_fg;
|
||||
}
|
||||
|
||||
static int
|
||||
get_default_cterm_bg(term_T *term)
|
||||
{
|
||||
if (term->tl_highlight_name != NULL)
|
||||
{
|
||||
int id = syn_name2id(term->tl_highlight_name);
|
||||
int fg = -1;
|
||||
int bg = -1;
|
||||
|
||||
if (id > 0)
|
||||
syn_id2cterm_bg(id, &fg, &bg);
|
||||
return bg;
|
||||
}
|
||||
return term_default_cterm_bg;
|
||||
}
|
||||
|
||||
/*
|
||||
* Reverse engineer the RGB value into a cterm color index.
|
||||
* First color is 1. Return 0 if no match found (default color).
|
||||
@@ -2914,10 +2868,34 @@ cell2attr(
|
||||
#ifdef FEAT_TERMGUICOLORS
|
||||
if (p_tgc)
|
||||
{
|
||||
guicolor_T fg, bg;
|
||||
guicolor_T fg = INVALCOLOR;
|
||||
guicolor_T bg = INVALCOLOR;
|
||||
|
||||
fg = gui_get_rgb_color_cmn(cellfg.red, cellfg.green, cellfg.blue);
|
||||
bg = gui_get_rgb_color_cmn(cellbg.red, cellbg.green, cellbg.blue);
|
||||
// Use the 'wincolor' or "Terminal" highlighting for the default
|
||||
// colors.
|
||||
if (VTERM_COLOR_IS_DEFAULT_FG(&cellfg)
|
||||
|| VTERM_COLOR_IS_DEFAULT_BG(&cellbg))
|
||||
{
|
||||
int id = 0;
|
||||
|
||||
if (wp != NULL && *wp->w_p_wcr != NUL)
|
||||
id = syn_name2id(wp->w_p_wcr);
|
||||
if (id == 0)
|
||||
id = syn_name2id(term_get_highlight_name(term));
|
||||
if (id > 0)
|
||||
syn_id2colors(id, &fg, &bg);
|
||||
if (!VTERM_COLOR_IS_DEFAULT_FG(&cellfg))
|
||||
fg = gui_get_rgb_color_cmn(cellfg.red, cellfg.green,
|
||||
cellfg.blue);
|
||||
if (!VTERM_COLOR_IS_DEFAULT_BG(&cellbg))
|
||||
bg = gui_get_rgb_color_cmn(cellbg.red, cellbg.green,
|
||||
cellbg.blue);
|
||||
}
|
||||
else
|
||||
{
|
||||
fg = gui_get_rgb_color_cmn(cellfg.red, cellfg.green, cellfg.blue);
|
||||
bg = gui_get_rgb_color_cmn(cellbg.red, cellbg.green, cellbg.blue);
|
||||
}
|
||||
|
||||
return get_tgc_attr_idx(attr, fg, bg);
|
||||
}
|
||||
@@ -2932,41 +2910,20 @@ cell2attr(
|
||||
// colors.
|
||||
if ((fg == 0 || bg == 0) && t_colors >= 16)
|
||||
{
|
||||
int wincolor_fg = -1;
|
||||
int wincolor_bg = -1;
|
||||
int cterm_fg = -1;
|
||||
int cterm_bg = -1;
|
||||
int id = 0;
|
||||
|
||||
if (wp != NULL && *wp->w_p_wcr != NUL)
|
||||
{
|
||||
int id = syn_name2id(curwin->w_p_wcr);
|
||||
|
||||
// Get the 'wincolor' group colors.
|
||||
if (id > 0)
|
||||
syn_id2cterm_bg(id, &wincolor_fg, &wincolor_bg);
|
||||
}
|
||||
if (fg == 0)
|
||||
{
|
||||
if (wincolor_fg >= 0)
|
||||
fg = wincolor_fg + 1;
|
||||
else
|
||||
{
|
||||
int cterm_fg = get_default_cterm_fg(term);
|
||||
|
||||
if (cterm_fg >= 0)
|
||||
fg = cterm_fg + 1;
|
||||
}
|
||||
}
|
||||
if (bg == 0)
|
||||
{
|
||||
if (wincolor_bg >= 0)
|
||||
bg = wincolor_bg + 1;
|
||||
else
|
||||
{
|
||||
int cterm_bg = get_default_cterm_bg(term);
|
||||
|
||||
if (cterm_bg >= 0)
|
||||
bg = cterm_bg + 1;
|
||||
}
|
||||
}
|
||||
id = syn_name2id(wp->w_p_wcr);
|
||||
if (id == 0)
|
||||
id = syn_name2id(term_get_highlight_name(term));
|
||||
if (id > 0)
|
||||
syn_id2cterm_bg(id, &cterm_fg, &cterm_bg);
|
||||
if (fg == 0 && cterm_fg >= 0)
|
||||
fg = cterm_fg + 1;
|
||||
if (bg == 0 && cterm_bg >= 0)
|
||||
bg = cterm_bg + 1;
|
||||
}
|
||||
|
||||
// with 8 colors set the bold attribute to get a bright foreground
|
||||
@@ -4046,8 +4003,9 @@ init_default_colors(term_T *term, win_T *wp)
|
||||
#endif
|
||||
if (id != 0 && t_colors >= 16)
|
||||
{
|
||||
int cterm_fg = get_default_cterm_fg(term);
|
||||
int cterm_bg = get_default_cterm_bg(term);
|
||||
int cterm_fg = -1;
|
||||
int cterm_bg = -1;
|
||||
syn_id2cterm_bg(id, &cterm_fg, &cterm_bg);
|
||||
|
||||
if (cterm_fg >= 0)
|
||||
cterm_color2vterm(cterm_fg, fg);
|
||||
|
||||
@@ -217,6 +217,14 @@ func CheckNotAsan()
|
||||
endif
|
||||
endfunc
|
||||
|
||||
" Command to check for X11 based GUI
|
||||
command CheckX11BasedGui call CheckX11BasedGui()
|
||||
func CheckX11BasedGui()
|
||||
if !g:x11_based_gui
|
||||
throw 'Skipped: requires X11 based GUI'
|
||||
endif
|
||||
endfunc
|
||||
|
||||
" Command to check for satisfying any of the conditions.
|
||||
" e.g. CheckAnyOf Feature:bsd Feature:sun Linux
|
||||
command -nargs=+ CheckAnyOf call CheckAnyOf(<f-args>)
|
||||
|
||||
+1
-38
@@ -404,42 +404,6 @@ else
|
||||
endtry
|
||||
endif
|
||||
|
||||
" Names of flaky tests.
|
||||
let s:flaky_tests = [
|
||||
\ 'Test_BufWrite_lockmarks()',
|
||||
\ 'Test_autocmd_SafeState()',
|
||||
\ 'Test_bufunload_all()',
|
||||
\ 'Test_client_server()',
|
||||
\ 'Test_close_and_exit_cb()',
|
||||
\ 'Test_close_output_buffer()',
|
||||
\ 'Test_collapse_buffers()',
|
||||
\ 'Test_cwd()',
|
||||
\ 'Test_diff_screen()',
|
||||
\ 'Test_exit_callback_interval()',
|
||||
\ 'Test_map_timeout_with_timer_interrupt()',
|
||||
\ 'Test_out_cb()',
|
||||
\ 'Test_pipe_through_sort_all()',
|
||||
\ 'Test_pipe_through_sort_some()',
|
||||
\ 'Test_popup_and_window_resize()',
|
||||
\ 'Test_quoteplus()',
|
||||
\ 'Test_quotestar()',
|
||||
\ 'Test_reltime()',
|
||||
\ 'Test_state()',
|
||||
\ 'Test_terminal_composing_unicode()',
|
||||
\ 'Test_terminal_does_not_truncate_last_newlines()',
|
||||
\ 'Test_terminal_no_cmd()',
|
||||
\ 'Test_terminal_noblock()',
|
||||
\ 'Test_terminal_redir_file()',
|
||||
\ 'Test_termwinscroll()',
|
||||
\ 'Test_timer_oneshot()',
|
||||
\ 'Test_timer_paused()',
|
||||
\ 'Test_timer_repeat_many()',
|
||||
\ 'Test_timer_repeat_three()',
|
||||
\ 'Test_timer_stop_all_in_callback()',
|
||||
\ 'Test_timer_stop_in_callback()',
|
||||
\ 'Test_timer_with_partial_callback()',
|
||||
\ ]
|
||||
|
||||
" Locate Test_ functions and execute them.
|
||||
redir @q
|
||||
silent function /^Test_
|
||||
@@ -491,8 +455,7 @@ for g:testfunc in sort(s:tests)
|
||||
" - it fails five times (with a different message)
|
||||
if len(v:errors) > 0
|
||||
\ && $TEST_NO_RETRY == ''
|
||||
\ && (index(s:flaky_tests, g:testfunc) >= 0
|
||||
\ || g:test_is_flaky)
|
||||
\ && g:test_is_flaky
|
||||
while 1
|
||||
call add(s:messages, 'Found errors in ' . g:testfunc . ':')
|
||||
call extend(s:messages, v:errors)
|
||||
|
||||
@@ -5,7 +5,6 @@ let g:x11_based_gui = has('gui_athena') || has('gui_motif')
|
||||
|
||||
" Reasons for 'skipped'.
|
||||
let g:not_supported = "Skipped: Feature/Option not supported by this GUI: "
|
||||
let g:not_implemented = "Skipped: Test not implemented yet for this GUI"
|
||||
let g:not_hosted = "Skipped: Test not hosted by the system/environment"
|
||||
|
||||
" For KDE set a font, empty 'guifont' may cause a hang.
|
||||
|
||||
@@ -1490,6 +1490,7 @@ endfunc
|
||||
|
||||
" Test for BufUnload autocommand that unloads all the other buffers
|
||||
func Test_bufunload_all()
|
||||
let g:test_is_flaky = 1
|
||||
call writefile(['Test file Xxx1'], 'Xxx1')"
|
||||
call writefile(['Test file Xxx2'], 'Xxx2')"
|
||||
|
||||
@@ -1929,6 +1930,7 @@ func Test_ChangedP()
|
||||
let g:autocmd .= a:char
|
||||
endfunc
|
||||
|
||||
" TextChanged will not be triggered, only check that it isn't.
|
||||
au! TextChanged <buffer> :call TextChangedAutocmd('N')
|
||||
au! TextChangedI <buffer> :call TextChangedAutocmd('I')
|
||||
au! TextChangedP <buffer> :call TextChangedAutocmd('P')
|
||||
@@ -2377,6 +2379,7 @@ endfunc
|
||||
|
||||
func Test_autocmd_SafeState()
|
||||
CheckRunVimInTerminal
|
||||
let g:test_is_flaky = 1
|
||||
|
||||
let lines =<< trim END
|
||||
let g:safe = 0
|
||||
@@ -2457,6 +2460,7 @@ func Test_autocmd_was_using_freed_memory()
|
||||
endfunc
|
||||
|
||||
func Test_BufWrite_lockmarks()
|
||||
let g:test_is_flaky = 1
|
||||
edit! Xtest
|
||||
call setline(1, ['a', 'b', 'c', 'd'])
|
||||
|
||||
@@ -2863,5 +2867,42 @@ func Test_autocmd_with_block()
|
||||
augroup END
|
||||
endfunc
|
||||
|
||||
" Test TextChangedI and TextChanged
|
||||
func Test_Changed_ChangedI()
|
||||
new
|
||||
call test_override("char_avail", 1)
|
||||
let [g:autocmd_i, g:autocmd_n] = ['','']
|
||||
|
||||
func! TextChangedAutocmdI(char)
|
||||
let g:autocmd_{tolower(a:char)} = a:char .. b:changedtick
|
||||
endfunc
|
||||
|
||||
augroup Test_TextChanged
|
||||
au!
|
||||
au TextChanged <buffer> :call TextChangedAutocmdI('N')
|
||||
au TextChangedI <buffer> :call TextChangedAutocmdI('I')
|
||||
augroup END
|
||||
|
||||
call feedkeys("ifoo\<esc>", 'tnix')
|
||||
" TODO: Test test does not seem to trigger TextChanged autocommand, this
|
||||
" requires running Vim in a terminal window.
|
||||
" call assert_equal('N3', g:autocmd_n)
|
||||
call assert_equal('I3', g:autocmd_i)
|
||||
|
||||
call feedkeys("yyp", 'tnix')
|
||||
" TODO: Test test does not seem to trigger TextChanged autocommand.
|
||||
" call assert_equal('N4', g:autocmd_n)
|
||||
call assert_equal('I3', g:autocmd_i)
|
||||
|
||||
" CleanUp
|
||||
call test_override("char_avail", 0)
|
||||
au! TextChanged <buffer>
|
||||
au! TextChangedI <buffer>
|
||||
augroup! Test_TextChanged
|
||||
delfu TextChangedAutocmdI
|
||||
unlet! g:autocmd_i g:autocmd_n
|
||||
|
||||
bw!
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
||||
@@ -795,6 +795,7 @@ func Test_pipe_to_buffer_name_nomsg()
|
||||
endfunc
|
||||
|
||||
func Test_close_output_buffer()
|
||||
let g:test_is_flaky = 1
|
||||
enew!
|
||||
let test_lines = ['one', 'two']
|
||||
call setline(1, test_lines)
|
||||
@@ -935,6 +936,7 @@ endfunc
|
||||
|
||||
func Run_pipe_through_sort(all, use_buffer)
|
||||
CheckExecutable sort
|
||||
let g:test_is_flaky = 1
|
||||
|
||||
let options = {'out_io': 'buffer', 'out_name': 'sortout'}
|
||||
if a:use_buffer
|
||||
@@ -1206,6 +1208,7 @@ func Test_reuse_channel()
|
||||
endfunc
|
||||
|
||||
func Test_out_cb()
|
||||
let g:test_is_flaky = 1
|
||||
let dict = {'thisis': 'dict: '}
|
||||
func dict.outHandler(chan, msg) dict
|
||||
if type(a:msg) == v:t_string
|
||||
@@ -1333,6 +1336,7 @@ func Test_out_cb_lambda()
|
||||
endfunc
|
||||
|
||||
func Test_close_and_exit_cb()
|
||||
let g:test_is_flaky = 1
|
||||
let g:retdict = {'ret': {}}
|
||||
func g:retdict.close_cb(ch) dict
|
||||
let self.ret['close_cb'] = a:ch->ch_getjob()->job_status()
|
||||
@@ -1560,6 +1564,7 @@ endfunction
|
||||
|
||||
func Test_exit_callback_interval()
|
||||
CheckFunction reltimefloat
|
||||
let g:test_is_flaky = 1
|
||||
|
||||
let g:exit_cb_val = {'start': reltime(), 'end': 0, 'process': 0}
|
||||
let job = [s:python, '-c', 'import time;time.sleep(0.5)']->job_start({'exit_cb': 'MyExitTimeCb'})
|
||||
@@ -1742,6 +1747,7 @@ func Test_using_freed_memory()
|
||||
endfunc
|
||||
|
||||
func Test_collapse_buffers()
|
||||
let g:test_is_flaky = 1
|
||||
CheckExecutable cat
|
||||
|
||||
sp test_channel.vim
|
||||
@@ -1884,6 +1890,7 @@ func Test_env()
|
||||
endfunc
|
||||
|
||||
func Test_cwd()
|
||||
let g:test_is_flaky = 1
|
||||
let g:envstr = ''
|
||||
if has('win32')
|
||||
let expect = $TEMP
|
||||
|
||||
@@ -32,6 +32,7 @@ func Check_X11_Connection()
|
||||
endfunc
|
||||
|
||||
func Test_client_server()
|
||||
let g:test_is_flaky = 1
|
||||
let cmd = GetVimCommand()
|
||||
if cmd == ''
|
||||
throw 'GetVimCommand() failed'
|
||||
|
||||
@@ -900,6 +900,15 @@ func Test_cmdline_complete_various()
|
||||
call feedkeys(":unlet one two\<C-A>\<C-B>\"\<CR>", 'xt')
|
||||
call assert_equal("\"unlet one two", @:)
|
||||
|
||||
" completion for the :buffer command with curlies
|
||||
" FIXME: what should happen on MS-Windows?
|
||||
if !has('win32')
|
||||
edit \{someFile}
|
||||
call feedkeys(":buf someFile\<C-A>\<C-B>\"\<CR>", 'xt')
|
||||
call assert_equal("\"buf {someFile}", @:)
|
||||
bwipe {someFile}
|
||||
endif
|
||||
|
||||
" completion for the :bdelete command
|
||||
call feedkeys(":bdel a b c\<C-A>\<C-B>\"\<CR>", 'xt')
|
||||
call assert_equal("\"bdel a b c", @:)
|
||||
|
||||
@@ -3,6 +3,13 @@
|
||||
source check.vim
|
||||
CheckFeature cryptv
|
||||
|
||||
let s:xxd_cmd = ''
|
||||
if empty($XXDPROG) && executable('..\xxd\xxd.exe')
|
||||
let s:xxd_cmd = '..\xxd\xxd.exe'
|
||||
elseif !empty($XXDPROG) && executable($XXDPROG)
|
||||
let s:xxd_cmd = $XXDPROG
|
||||
endif
|
||||
|
||||
func Common_head_only(text)
|
||||
" This was crashing Vim
|
||||
split Xtest.txt
|
||||
@@ -81,8 +88,11 @@ func Uncrypt_stable(method, crypted_text, key, uncrypted_text)
|
||||
endfunc
|
||||
|
||||
func Uncrypt_stable_xxd(method, hex, key, uncrypted_text)
|
||||
if empty(s:xxd_cmd)
|
||||
throw 'Skipped: xxd program missing'
|
||||
endif
|
||||
" use xxd to write the binary content
|
||||
call system('xxd -r >Xtest.txt', a:hex)
|
||||
call system(s:xxd_cmd .. ' -r >Xtest.txt', a:hex)
|
||||
call feedkeys(":split Xtest.txt\<CR>" . a:key . "\<CR>", 'xt')
|
||||
call assert_equal(a:uncrypted_text, getline(1, len(a:uncrypted_text)))
|
||||
bwipe!
|
||||
|
||||
@@ -845,6 +845,7 @@ func VerifyInternal(buf, dumpfile, extra)
|
||||
endfunc
|
||||
|
||||
func Test_diff_screen()
|
||||
let g:test_is_flaky = 1
|
||||
CheckScreendump
|
||||
CheckFeature menu
|
||||
|
||||
|
||||
@@ -890,6 +890,56 @@ func Test_edit_CTRL_T()
|
||||
bw!
|
||||
endfunc
|
||||
|
||||
" Test 'thesaurusfunc'
|
||||
func MyThesaurus(findstart, base)
|
||||
let mythesaurus = [
|
||||
\ #{word: "happy",
|
||||
\ synonyms: "cheerful,blissful,flying high,looking good,peppy"},
|
||||
\ #{word: "kind",
|
||||
\ synonyms: "amiable,bleeding-heart,heart in right place"}]
|
||||
if a:findstart
|
||||
" locate the start of the word
|
||||
let line = getline('.')
|
||||
let start = col('.') - 1
|
||||
while start > 0 && line[start - 1] =~ '\a'
|
||||
let start -= 1
|
||||
endwhile
|
||||
return start
|
||||
else
|
||||
" find strings matching with "a:base"
|
||||
let res = []
|
||||
for w in mythesaurus
|
||||
if w.word =~ '^' . a:base
|
||||
call add(res, w.word)
|
||||
call extend(res, split(w.synonyms, ","))
|
||||
endif
|
||||
endfor
|
||||
return res
|
||||
endif
|
||||
endfunc
|
||||
|
||||
func Test_thesaurus_func()
|
||||
new
|
||||
set thesaurus=notused
|
||||
set thesaurusfunc=NotUsed
|
||||
setlocal thesaurusfunc=MyThesaurus
|
||||
call setline(1, "an ki")
|
||||
call cursor(1, 1)
|
||||
call feedkeys("A\<c-x>\<c-t>\<c-n>\<cr>\<esc>", 'tnix')
|
||||
call assert_equal(['an amiable', ''], getline(1, '$'))
|
||||
|
||||
setlocal thesaurusfunc=NonExistingFunc
|
||||
call assert_fails("normal $a\<C-X>\<C-T>", 'E117:')
|
||||
|
||||
setlocal thesaurusfunc=
|
||||
set thesaurusfunc=NonExistingFunc
|
||||
call assert_fails("normal $a\<C-X>\<C-T>", 'E117:')
|
||||
%bw!
|
||||
|
||||
set thesaurusfunc=
|
||||
set thesaurus=
|
||||
endfunc
|
||||
|
||||
func Test_edit_CTRL_U()
|
||||
" Test 'completefunc'
|
||||
new
|
||||
|
||||
@@ -112,7 +112,7 @@ let s:filename_checks = {
|
||||
\ 'coco': ['file.atg'],
|
||||
\ 'conaryrecipe': ['file.recipe'],
|
||||
\ 'conf': ['auto.master'],
|
||||
\ 'config': ['configure.in', 'configure.ac', 'Pipfile', '/etc/hostname.file'],
|
||||
\ 'config': ['configure.in', 'configure.ac', '/etc/hostname.file'],
|
||||
\ 'context': ['tex/context/any/file.tex', 'file.mkii', 'file.mkiv', 'file.mkvi', 'file.mkxl', 'file.mklx'],
|
||||
\ 'cpp': ['file.cxx', 'file.c++', 'file.hh', 'file.hxx', 'file.hpp', 'file.ipp', 'file.moc', 'file.tcc', 'file.inl', 'file.tlh'],
|
||||
\ 'crm': ['file.crm'],
|
||||
@@ -504,8 +504,8 @@ let s:filename_checks = {
|
||||
\ 'tidy': ['.tidyrc', 'tidyrc', 'tidy.conf'],
|
||||
\ 'tilde': ['file.t.html'],
|
||||
\ 'tli': ['file.tli'],
|
||||
\ 'tmux': ['tmuxfile.conf', '.tmuxfile.conf', '.tmux-file.conf', '.tmux.conf', 'tmux-file.conf', 'tmux.conf'],
|
||||
\ 'toml': ['file.toml'],
|
||||
\ 'tmux': ['tmuxfile.conf', '.tmuxfile.conf', '.tmux-file.conf', '.tmux.conf', 'tmux-file.conf', 'tmux.conf', 'tmux.conf.local'],
|
||||
\ 'toml': ['file.toml', 'Gopkg.lock', 'Pipfile', '/home/user/.cargo/config'],
|
||||
\ 'tpp': ['file.tpp'],
|
||||
\ 'treetop': ['file.treetop'],
|
||||
\ 'trustees': ['trustees.conf'],
|
||||
@@ -555,6 +555,7 @@ let s:filename_checks = {
|
||||
\ 'xml': ['/etc/blkid.tab', '/etc/blkid.tab.old', 'file.xmi', 'file.csproj', 'file.csproj.user', 'file.ui', 'file.tpm', '/etc/xdg/menus/file.menu', 'fglrxrc', 'file.xlf', 'file.xliff', 'file.xul', 'file.wsdl', 'file.wpl', 'any/etc/blkid.tab', 'any/etc/blkid.tab.old', 'any/etc/xdg/menus/file.menu', 'file.atom', 'file.rss', 'file.cdxml', 'file.psc1', 'file.mpd'],
|
||||
\ 'xmodmap': ['anyXmodmap', 'Xmodmap', 'some-Xmodmap', 'some-xmodmap', 'some-xmodmap-file', 'xmodmap', 'xmodmap-file'],
|
||||
\ 'xf86conf': ['xorg.conf', 'xorg.conf-4'],
|
||||
\ 'xpm': ['file.xpm'],
|
||||
\ 'xpm2': ['file.xpm2'],
|
||||
\ 'xquery': ['file.xq', 'file.xql', 'file.xqm', 'file.xquery', 'file.xqy'],
|
||||
\ 'xs': ['file.xs'],
|
||||
@@ -569,7 +570,6 @@ let s:filename_checks = {
|
||||
\ 'zsh': ['.zprofile', '/etc/zprofile', '.zfbfmarks', 'file.zsh', '.zcompdump', '.zlogin', '.zlogout', '.zshenv', '.zshrc', '.zcompdump-file', '.zlog', '.zlog-file', '.zsh', '.zsh-file', 'any/etc/zprofile', 'zlog', 'zlog-file', 'zsh', 'zsh-file'],
|
||||
\
|
||||
\ 'help': [$VIMRUNTIME . '/doc/help.txt'],
|
||||
\ 'xpm': ['file.xpm'],
|
||||
\ }
|
||||
|
||||
let s:filename_case_checks = {
|
||||
@@ -943,4 +943,17 @@ func Test_m_file()
|
||||
call delete('Xfile.m')
|
||||
filetype off
|
||||
endfunc
|
||||
|
||||
func Test_xpm_file()
|
||||
filetype on
|
||||
|
||||
call writefile(['this is XPM2'], 'file.xpm')
|
||||
split file.xpm
|
||||
call assert_equal('xpm2', &filetype)
|
||||
bwipe!
|
||||
|
||||
call delete('file.xpm')
|
||||
filetype off
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
||||
@@ -2286,6 +2286,7 @@ endfunc
|
||||
|
||||
func Test_state()
|
||||
CheckRunVimInTerminal
|
||||
let g:test_is_flaky = 1
|
||||
|
||||
let getstate = ":echo 'state: ' .. g:state .. '; mode: ' .. g:mode\<CR>"
|
||||
|
||||
|
||||
+80
-98
@@ -61,11 +61,9 @@ func Test_colorscheme()
|
||||
endfunc
|
||||
|
||||
func Test_getfontname_with_arg()
|
||||
let skipped = ''
|
||||
CheckX11BasedGui
|
||||
|
||||
if !g:x11_based_gui
|
||||
let skipped = g:not_implemented
|
||||
elseif has('gui_athena') || has('gui_motif')
|
||||
if has('gui_athena') || has('gui_motif')
|
||||
" Invalid font name. The result should be an empty string.
|
||||
call assert_equal('', getfontname('notexist'))
|
||||
|
||||
@@ -82,20 +80,14 @@ func Test_getfontname_with_arg()
|
||||
let fname = 'Bitstream Vera Sans Mono 12'
|
||||
call assert_equal(fname, getfontname(fname))
|
||||
endif
|
||||
|
||||
if !empty(skipped)
|
||||
throw skipped
|
||||
endif
|
||||
endfunc
|
||||
|
||||
func Test_getfontname_without_arg()
|
||||
let skipped = ''
|
||||
CheckX11BasedGui
|
||||
|
||||
let fname = getfontname()
|
||||
|
||||
if !g:x11_based_gui
|
||||
let skipped = g:not_implemented
|
||||
elseif has('gui_kde')
|
||||
if has('gui_kde')
|
||||
" 'expected' is the value specified by SetUp() above.
|
||||
call assert_equal('Courier 10 Pitch/8/-1/5/50/0/0/0/0/0', fname)
|
||||
elseif has('gui_athena') || has('gui_motif')
|
||||
@@ -106,10 +98,6 @@ func Test_getfontname_without_arg()
|
||||
" 'expected' is DEFAULT_FONT of gui_gtk_x11.c.
|
||||
call assert_equal('Monospace 10', fname)
|
||||
endif
|
||||
|
||||
if !empty(skipped)
|
||||
throw skipped
|
||||
endif
|
||||
endfunc
|
||||
|
||||
func Test_getwinpos()
|
||||
@@ -120,47 +108,41 @@ func Test_getwinpos()
|
||||
endfunc
|
||||
|
||||
func Test_quoteplus()
|
||||
let skipped = ''
|
||||
CheckX11BasedGui
|
||||
|
||||
if !g:x11_based_gui
|
||||
let skipped = g:not_supported . 'quoteplus'
|
||||
else
|
||||
let quoteplus_saved = @+
|
||||
let g:test_is_flaky = 1
|
||||
|
||||
let test_call = 'Can you hear me?'
|
||||
let test_response = 'Yes, I can.'
|
||||
let vim_exe = GetVimCommand()
|
||||
let testee = 'VIMRUNTIME=' . $VIMRUNTIME . '; export VIMRUNTIME;'
|
||||
\ . vim_exe . ' --noplugin --not-a-term -c ''%s'''
|
||||
" Ignore the "failed to create input context" error.
|
||||
let cmd = 'call test_ignore_error("E285") | '
|
||||
\ . 'gui -f | '
|
||||
\ . 'call feedkeys("'
|
||||
\ . '\"+p'
|
||||
\ . ':s/' . test_call . '/' . test_response . '/\<CR>'
|
||||
\ . '\"+yis'
|
||||
\ . ':q!\<CR>", "tx")'
|
||||
let run_vimtest = printf(testee, cmd)
|
||||
let quoteplus_saved = @+
|
||||
|
||||
" Set the quoteplus register to test_call, and another gvim will launched.
|
||||
" Then, it first tries to paste the content of its own quotedplus register
|
||||
" onto it. Second, it tries to substitute test_response for the pasted
|
||||
" sentence. If the sentence is identical to test_call, the substitution
|
||||
" should succeed. Third, it tries to yank the result of the substitution
|
||||
" to its own quoteplus register, and last it quits. When system()
|
||||
" returns, the content of the quoteplus register should be identical to
|
||||
" test_response if those quoteplus registers are synchronized properly
|
||||
" with/through the X11 clipboard.
|
||||
let @+ = test_call
|
||||
call system(run_vimtest)
|
||||
call assert_equal(test_response, @+)
|
||||
let test_call = 'Can you hear me?'
|
||||
let test_response = 'Yes, I can.'
|
||||
let vim_exe = GetVimCommand()
|
||||
let testee = 'VIMRUNTIME=' . $VIMRUNTIME . '; export VIMRUNTIME;'
|
||||
\ . vim_exe . ' --noplugin --not-a-term -c ''%s'''
|
||||
" Ignore the "failed to create input context" error.
|
||||
let cmd = 'call test_ignore_error("E285") | '
|
||||
\ . 'gui -f | '
|
||||
\ . 'call feedkeys("'
|
||||
\ . '\"+p'
|
||||
\ . ':s/' . test_call . '/' . test_response . '/\<CR>'
|
||||
\ . '\"+yis'
|
||||
\ . ':q!\<CR>", "tx")'
|
||||
let run_vimtest = printf(testee, cmd)
|
||||
|
||||
let @+ = quoteplus_saved
|
||||
endif
|
||||
" Set the quoteplus register to test_call, and another gvim will launched.
|
||||
" Then, it first tries to paste the content of its own quotedplus register
|
||||
" onto it. Second, it tries to substitute test_response for the pasted
|
||||
" sentence. If the sentence is identical to test_call, the substitution
|
||||
" should succeed. Third, it tries to yank the result of the substitution
|
||||
" to its own quoteplus register, and last it quits. When system()
|
||||
" returns, the content of the quoteplus register should be identical to
|
||||
" test_response if those quoteplus registers are synchronized properly
|
||||
" with/through the X11 clipboard.
|
||||
let @+ = test_call
|
||||
call system(run_vimtest)
|
||||
call assert_equal(test_response, @+)
|
||||
|
||||
if !empty(skipped)
|
||||
throw skipped
|
||||
endif
|
||||
let @+ = quoteplus_saved
|
||||
endfunc
|
||||
|
||||
func Test_set_background()
|
||||
@@ -332,8 +314,29 @@ func Test_set_guicursor()
|
||||
let &guicursor = guicursor_saved
|
||||
endfunc
|
||||
|
||||
func Test_set_guifont_errors()
|
||||
if has('win32')
|
||||
" Invalid font names are accepted in GTK GUI
|
||||
call assert_fails('set guifont=xa1bc23d7f', 'E596:')
|
||||
endif
|
||||
|
||||
" This only works if 'renderoptions' exists and does not work for Windows XP
|
||||
" and older.
|
||||
if exists('+renderoptions') && windowsversion() !~ '^[345]\.'
|
||||
" doing this four times used to cause a crash
|
||||
set renderoptions=type:directx
|
||||
for i in range(5)
|
||||
set guifont=
|
||||
endfor
|
||||
set renderoptions=
|
||||
for i in range(5)
|
||||
set guifont=
|
||||
endfor
|
||||
endif
|
||||
endfunc
|
||||
|
||||
func Test_set_guifont()
|
||||
let skipped = ''
|
||||
CheckX11BasedGui
|
||||
|
||||
let guifont_saved = &guifont
|
||||
if has('xfontset')
|
||||
@@ -342,9 +345,7 @@ func Test_set_guifont()
|
||||
set guifontset=
|
||||
endif
|
||||
|
||||
if !g:x11_based_gui
|
||||
let skipped = g:not_implemented
|
||||
elseif has('gui_athena') || has('gui_motif')
|
||||
if has('gui_athena') || has('gui_motif')
|
||||
" Non-empty font list with invalid font names.
|
||||
"
|
||||
" This test is twofold: (1) It checks if the command fails as expected
|
||||
@@ -383,33 +384,10 @@ func Test_set_guifont()
|
||||
call assert_equal('Monospace 10', getfontname())
|
||||
endif
|
||||
|
||||
if has('win32')
|
||||
" Invalid font names are accepted in GTK GUI
|
||||
call assert_fails('set guifont=xa1bc23d7f', 'E596:')
|
||||
endif
|
||||
|
||||
" This only works if 'renderoptions' exists and does not work for Windows XP
|
||||
" and older.
|
||||
if exists('+renderoptions') && windowsversion() !~ '^[345]\.'
|
||||
" doing this four times used to cause a crash
|
||||
set renderoptions=type:directx
|
||||
for i in range(5)
|
||||
set guifont=
|
||||
endfor
|
||||
set renderoptions=
|
||||
for i in range(5)
|
||||
set guifont=
|
||||
endfor
|
||||
endif
|
||||
|
||||
if has('xfontset')
|
||||
let &guifontset = guifontset_saved
|
||||
endif
|
||||
let &guifont = guifont_saved
|
||||
|
||||
if !empty(skipped)
|
||||
throw skipped
|
||||
endif
|
||||
endfunc
|
||||
|
||||
func Test_set_guifontset()
|
||||
@@ -484,12 +462,11 @@ func Test_set_guifontset()
|
||||
endfunc
|
||||
|
||||
func Test_set_guifontwide()
|
||||
call assert_fails('set guifontwide=*', 'E533:')
|
||||
let skipped = ''
|
||||
CheckX11BasedGui
|
||||
|
||||
if !g:x11_based_gui
|
||||
let skipped = g:not_implemented
|
||||
elseif has('gui_gtk')
|
||||
call assert_fails('set guifontwide=*', 'E533:')
|
||||
|
||||
if has('gui_gtk')
|
||||
let guifont_saved = &guifont
|
||||
let guifontwide_saved = &guifontwide
|
||||
|
||||
@@ -560,26 +537,31 @@ func Test_set_guifontwide()
|
||||
let &encoding = encoding_saved
|
||||
endif
|
||||
endif
|
||||
endfunc
|
||||
|
||||
if !empty(skipped)
|
||||
throw skipped
|
||||
func Test_set_guiligatures()
|
||||
CheckX11BasedGui
|
||||
|
||||
if has('gui_gtk') || has('gui_gtk2') || has('gui_gnome') || has('gui_gtk3')
|
||||
" Try correct value
|
||||
set guiligatures=<>=ab
|
||||
call assert_equal("<>=ab", &guiligatures)
|
||||
" Try to throw error
|
||||
try
|
||||
set guiligatures=<>=šab
|
||||
call assert_report("'set guiligatures=<>=šab should have failed")
|
||||
catch
|
||||
call assert_exception('E1243:')
|
||||
endtry
|
||||
endif
|
||||
endfunc
|
||||
|
||||
func Test_set_guiheadroom()
|
||||
let skipped = ''
|
||||
CheckX11BasedGui
|
||||
|
||||
if !g:x11_based_gui
|
||||
let skipped = g:not_supported . 'guiheadroom'
|
||||
else
|
||||
" Since this script is to be read together with '-U NONE', the default
|
||||
" value must be preserved.
|
||||
call assert_equal(50, &guiheadroom)
|
||||
endif
|
||||
|
||||
if !empty(skipped)
|
||||
throw skipped
|
||||
endif
|
||||
" Since this script is to be read together with '-U NONE', the default
|
||||
" value must be preserved.
|
||||
call assert_equal(50, &guiheadroom)
|
||||
endfunc
|
||||
|
||||
func Test_set_guioptions()
|
||||
|
||||
@@ -22,19 +22,11 @@ call test_ignore_error('E285:')
|
||||
gui -f
|
||||
|
||||
func Test_set_guiheadroom()
|
||||
let skipped = ''
|
||||
CheckX11BasedGui
|
||||
|
||||
if !g:x11_based_gui
|
||||
let skipped = g:not_supported . 'guiheadroom'
|
||||
else
|
||||
" The 'expected' value must be consistent with the value specified with
|
||||
" gui_init.vim.
|
||||
call assert_equal(0, &guiheadroom)
|
||||
endif
|
||||
|
||||
if !empty(skipped)
|
||||
throw skipped
|
||||
endif
|
||||
" The 'expected' value must be consistent with the value specified with
|
||||
" gui_init.vim.
|
||||
call assert_equal(0, &guiheadroom)
|
||||
endfunc
|
||||
|
||||
func Test_set_guioptions_for_M()
|
||||
@@ -44,19 +36,11 @@ func Test_set_guioptions_for_M()
|
||||
endfunc
|
||||
|
||||
func Test_set_guioptions_for_p()
|
||||
let skipped = ''
|
||||
CheckX11BasedGui
|
||||
|
||||
if !g:x11_based_gui
|
||||
let skipped = g:not_supported . '''p'' of guioptions'
|
||||
else
|
||||
sleep 200ms
|
||||
" Check if the 'p' option is included.
|
||||
call assert_match('.*p.*', &guioptions)
|
||||
endif
|
||||
|
||||
if !empty(skipped)
|
||||
throw skipped
|
||||
endif
|
||||
sleep 200ms
|
||||
" Check if the 'p' option is included.
|
||||
call assert_match('.*p.*', &guioptions)
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
||||
@@ -288,6 +288,10 @@ func Test_listchars_unicode()
|
||||
call cursor(1, 1)
|
||||
call assert_equal(expected, ScreenLines(1, virtcol('$')))
|
||||
|
||||
set listchars=eol:\\u21d4,space:\\u2423,multispace:≡\\u2262\\U00002263,nbsp:\\U00002260,tab:←↔\\u2192
|
||||
redraw!
|
||||
call assert_equal(expected, ScreenLines(1, virtcol('$')))
|
||||
|
||||
set listchars+=lead:⇨,trail:⇦
|
||||
let expected = ['⇨⇨⇨⇨⇨⇨⇨⇨a←↔↔↔↔↔→b␣c≠d⇦⇦⇔']
|
||||
redraw!
|
||||
|
||||
@@ -289,6 +289,7 @@ endfunc
|
||||
func Test_map_timeout_with_timer_interrupt()
|
||||
CheckFeature job
|
||||
CheckFeature timers
|
||||
let g:test_is_flaky = 1
|
||||
|
||||
" Confirm the timer invoked in exit_cb of the job doesn't disturb mapped key
|
||||
" sequence.
|
||||
@@ -1155,7 +1156,7 @@ func Test_map_cmdkey_visual_mode()
|
||||
call feedkeys("v\<F4>", 'xt!')
|
||||
call assert_equal(['v', 1, 12], [mode(1), col('v'), col('.')])
|
||||
|
||||
" can invoke an opeartor, ending the visual mode
|
||||
" can invoke an operator, ending the visual mode
|
||||
let @a = ''
|
||||
call feedkeys("\<F5>", 'xt!')
|
||||
call assert_equal('n', mode(1))
|
||||
|
||||
@@ -26,6 +26,16 @@ func Test_Incr_Marks()
|
||||
enew!
|
||||
endfunc
|
||||
|
||||
func Test_previous_jump_mark()
|
||||
new
|
||||
call setline(1, ['']->repeat(6))
|
||||
normal Ggg
|
||||
call assert_equal(6, getpos("''")[1])
|
||||
normal jjjjj
|
||||
call assert_equal(6, getpos("''")[1])
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_setpos()
|
||||
new Xone
|
||||
let onebuf = bufnr('%')
|
||||
|
||||
@@ -256,7 +256,7 @@ func Test_set_completion()
|
||||
|
||||
" Expand abbreviation of options.
|
||||
call feedkeys(":set ts\<C-A>\<C-B>\"\<CR>", 'tx')
|
||||
call assert_equal('"set tabstop thesaurus ttyscroll', @:)
|
||||
call assert_equal('"set tabstop thesaurus thesaurusfunc ttyscroll', @:)
|
||||
|
||||
" Expand current value
|
||||
call feedkeys(":set fileencodings=\<C-A>\<C-B>\"\<CR>", 'tx')
|
||||
|
||||
@@ -136,6 +136,8 @@ endfunc
|
||||
|
||||
func Test_xrestore()
|
||||
CheckFeature xterm_clipboard
|
||||
let g:test_is_flaky = 1
|
||||
|
||||
let display = $DISPLAY
|
||||
new
|
||||
call CheckCopyPaste()
|
||||
|
||||
@@ -665,6 +665,7 @@ func Test_popup_and_window_resize()
|
||||
CheckFeature terminal
|
||||
CheckFeature quickfix
|
||||
CheckNotGui
|
||||
let g:test_is_flaky = 1
|
||||
|
||||
let h = winheight(0)
|
||||
if h < 15
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
" Tests for put commands, e.g. ":put", "p", "gp", "P", "gP", etc.
|
||||
|
||||
source check.vim
|
||||
|
||||
func Test_put_block()
|
||||
new
|
||||
call feedkeys("i\<C-V>u2500\<CR>x\<ESC>", 'x')
|
||||
@@ -134,4 +136,15 @@ func Test_gp_with_count_leaves_cursor_at_end()
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_very_large_count()
|
||||
" FIXME: should actually check if sizeof(int) == sizeof(long)
|
||||
CheckNotMSWindows
|
||||
|
||||
new
|
||||
let @" = 'x'
|
||||
call assert_fails('norm 44444444444444p', 'E1240:')
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
||||
@@ -131,6 +131,7 @@ func Do_test_quotestar_for_x11()
|
||||
endfunc
|
||||
|
||||
func Test_quotestar()
|
||||
let g:test_is_flaky = 1
|
||||
let skipped = ''
|
||||
|
||||
let quotestar_saved = @*
|
||||
|
||||
@@ -208,9 +208,11 @@ func Test_recover_corrupted_swap_file()
|
||||
" Not all fields are written in a system-independent manner. Detect whether
|
||||
" the test is running on a little or big-endian system, so the correct
|
||||
" corruption values can be set.
|
||||
let little_endian = b[1008:1011] == 0z33323130
|
||||
" The swap file header fields can be either 32-bit or 64-bit.
|
||||
let system_64bit = b[1012:1015] == 0z00000000
|
||||
" The B0_MAGIC_LONG field may be 32-bit or 64-bit, depending on the system,
|
||||
" even though the value stored is only 32-bits. Therefore, need to check
|
||||
" both the high and low 32-bits to compute these values.
|
||||
let little_endian = (b[1008:1011] == 0z33323130) || (b[1012:1015] == 0z33323130)
|
||||
let system_64bit = little_endian ? (b[1012:1015] == 0z00000000) : (b[1008:1011] == 0z00000000)
|
||||
|
||||
" clear the B0_MAGIC_LONG field
|
||||
if system_64bit
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user