mirror of
https://github.com/zoriya/vim.git
synced 2025-12-13 02:36:16 +00:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
80627cf51f | ||
|
|
ddf662a1c8 | ||
|
|
24c2e48ef8 | ||
|
|
dea2570740 | ||
|
|
2f72c70657 | ||
|
|
c9b56b2ceb | ||
|
|
e0b66da691 | ||
|
|
690afe1fef | ||
|
|
3a29abcb61 | ||
|
|
f13e00b2cf | ||
|
|
c7b831ca15 | ||
|
|
36ae89c550 |
1
Filelist
1
Filelist
@@ -45,6 +45,7 @@ SRC_ALL = \
|
||||
src/hashtab.c \
|
||||
src/json.c \
|
||||
src/json_test.c \
|
||||
src/kword_test.c \
|
||||
src/list.c \
|
||||
src/keymap.h \
|
||||
src/macros.h \
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 8.0. Last change: 2017 Jan 14
|
||||
*eval.txt* For Vim version 8.0. Last change: 2017 Jan 28
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -2222,8 +2222,8 @@ matchstr({expr}, {pat}[, {start}[, {count}]])
|
||||
String {count}'th match of {pat} in {expr}
|
||||
matchstrpos({expr}, {pat}[, {start}[, {count}]])
|
||||
List {count}'th match of {pat} in {expr}
|
||||
max({list}) Number maximum value of items in {list}
|
||||
min({list}) Number minimum value of items in {list}
|
||||
max({expr}) Number maximum value of items in {expr}
|
||||
min({expr}) Number minimum value of items in {expr}
|
||||
mkdir({name} [, {path} [, {prot}]])
|
||||
Number create directory {name}
|
||||
mode([expr]) String current editing mode
|
||||
@@ -4172,6 +4172,10 @@ getchar([expr]) *getchar()*
|
||||
exe "normal " . v:mouse_col . "|"
|
||||
endif
|
||||
<
|
||||
When using bracketed paste only the first character is
|
||||
returned, the rest of the pasted text is dropped.
|
||||
|xterm-bracketed-paste|.
|
||||
|
||||
There is no prompt, you will somehow have to make clear to the
|
||||
user that a character has to be typed.
|
||||
There is no mapping for the character.
|
||||
@@ -5797,16 +5801,20 @@ matchstrpos({expr}, {pat}[, {start}[, {count}]]) *matchstrpos()*
|
||||
The type isn't changed, it's not necessarily a String.
|
||||
|
||||
*max()*
|
||||
max({list}) Return the maximum value of all items in {list}.
|
||||
If {list} is not a list or one of the items in {list} cannot
|
||||
be used as a Number this results in an error.
|
||||
An empty |List| results in zero.
|
||||
max({expr}) Return the maximum value of all items in {expr}.
|
||||
{expr} can be a list or a dictionary. For a dictionary,
|
||||
it returns the maximum of all values in the dictionary.
|
||||
If {expr} is neither a list nor a dictionary, or one of the
|
||||
items in {expr} cannot be used as a Number this results in
|
||||
an error. An empty |List| or |Dictionary| results in zero.
|
||||
|
||||
*min()*
|
||||
min({list}) Return the minimum value of all items in {list}.
|
||||
If {list} is not a list or one of the items in {list} cannot
|
||||
be used as a Number this results in an error.
|
||||
An empty |List| results in zero.
|
||||
min({expr}) Return the minimum value of all items in {expr}.
|
||||
{expr} can be a list or a dictionary. For a dictionary,
|
||||
it returns the minimum of all values in the dictionary.
|
||||
If {expr} is neither a list nor a dictionary, or one of the
|
||||
items in {expr} cannot be used as a Number this results in
|
||||
an error. An empty |List| or |Dictionary| results in zero.
|
||||
|
||||
*mkdir()* *E739*
|
||||
mkdir({name} [, {path} [, {prot}]])
|
||||
@@ -6798,10 +6806,12 @@ setpos({expr}, {list})
|
||||
[bufnum, lnum, col, off, curswant]
|
||||
|
||||
"bufnum" is the buffer number. Zero can be used for the
|
||||
current buffer. Setting the cursor is only possible for
|
||||
the current buffer. To set a mark in another buffer you can
|
||||
use the |bufnr()| function to turn a file name into a buffer
|
||||
number.
|
||||
current buffer. When setting an uppercase mark "bufnum" is
|
||||
used for the mark position. For other marks it specifies the
|
||||
buffer to set the mark in. You can use the |bufnr()| function
|
||||
to turn a file name into a buffer number.
|
||||
For setting the cursor and the ' mark "bufnum" is ignored,
|
||||
since these are associated with a window, not a buffer.
|
||||
Does not change the jumplist.
|
||||
|
||||
"lnum" and "col" are the position in the buffer. The first
|
||||
@@ -8144,7 +8154,7 @@ winnr([{arg}]) The result is a Number, which is the number of the current
|
||||
is returned.
|
||||
The number can be used with |CTRL-W_w| and ":wincmd w"
|
||||
|:wincmd|.
|
||||
Also see |tabpagewinnr()|.
|
||||
Also see |tabpagewinnr()| and |win_getid()|.
|
||||
|
||||
*winrestcmd()*
|
||||
winrestcmd() Returns a sequence of |:resize| commands that should restore
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*if_pyth.txt* For Vim version 8.0. Last change: 2016 Sep 17
|
||||
*if_pyth.txt* For Vim version 8.0. Last change: 2017 Jan 28
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Paul Moore
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 8.0. Last change: 2017 Jan 15
|
||||
*options.txt* For Vim version 8.0. Last change: 2017 Jan 28
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*syntax.txt* For Vim version 8.0. Last change: 2016 Oct 30
|
||||
*syntax.txt* For Vim version 8.0. Last change: 2017 Jan 17
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -3479,6 +3479,8 @@ DEFINING CASE *:syn-case* *E390*
|
||||
"ignore". Note that any items before this are not affected, and all
|
||||
items until the next ":syntax case" command are affected.
|
||||
|
||||
:sy[ntax] case
|
||||
Show either "syntax case match" or "syntax case ignore" (translated).
|
||||
|
||||
SPELL CHECKING *:syn-spell*
|
||||
|
||||
@@ -3496,6 +3498,11 @@ SPELL CHECKING *:syn-spell*
|
||||
|
||||
To activate spell checking the 'spell' option must be set.
|
||||
|
||||
:sy[ntax] spell
|
||||
Show either "syntax spell toplevel", "syntax spell notoplevel" or
|
||||
"syntax spell default" (translated).
|
||||
|
||||
|
||||
SYNTAX ISKEYWORD SETTING *:syn-iskeyword*
|
||||
|
||||
:sy[ntax] iskeyword [clear | {option}]
|
||||
@@ -4089,6 +4096,9 @@ IMPLICIT CONCEAL *:syn-conceal-implicit*
|
||||
off" returns to the normal state where the "conceal" flag must be
|
||||
given explicitly.
|
||||
|
||||
:sy[ntax] conceal
|
||||
Show either "syntax conceal on" or "syntax conceal off" (translated).
|
||||
|
||||
==============================================================================
|
||||
7. Syntax patterns *:syn-pattern* *E401* *E402*
|
||||
|
||||
|
||||
@@ -774,6 +774,8 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
'pvw' options.txt /*'pvw'*
|
||||
'pythondll' options.txt /*'pythondll'*
|
||||
'pythonthreedll' options.txt /*'pythonthreedll'*
|
||||
'pyx' options.txt /*'pyx'*
|
||||
'pyxversion' options.txt /*'pyxversion'*
|
||||
'qe' options.txt /*'qe'*
|
||||
'quote motion.txt /*'quote*
|
||||
'quoteescape' options.txt /*'quoteescape'*
|
||||
@@ -923,6 +925,8 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
't_AB' term.txt /*'t_AB'*
|
||||
't_AF' term.txt /*'t_AF'*
|
||||
't_AL' term.txt /*'t_AL'*
|
||||
't_BD' term.txt /*'t_BD'*
|
||||
't_BE' term.txt /*'t_BE'*
|
||||
't_CS' term.txt /*'t_CS'*
|
||||
't_CV' term.txt /*'t_CV'*
|
||||
't_Ce' term.txt /*'t_Ce'*
|
||||
@@ -2722,6 +2726,10 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
:pyfile if_pyth.txt /*:pyfile*
|
||||
:python if_pyth.txt /*:python*
|
||||
:python3 if_pyth.txt /*:python3*
|
||||
:pythonx if_pyth.txt /*:pythonx*
|
||||
:pyx if_pyth.txt /*:pyx*
|
||||
:pyxdo if_pyth.txt /*:pyxdo*
|
||||
:pyxfile if_pyth.txt /*:pyxfile*
|
||||
:q editing.txt /*:q*
|
||||
:qa editing.txt /*:qa*
|
||||
:qall editing.txt /*:qall*
|
||||
@@ -4770,6 +4778,8 @@ W16 message.txt /*W16*
|
||||
W17 arabic.txt /*W17*
|
||||
W18 syntax.txt /*W18*
|
||||
W19 autocmd.txt /*W19*
|
||||
W20 if_pyth.txt /*W20*
|
||||
W21 if_pyth.txt /*W21*
|
||||
WORD motion.txt /*WORD*
|
||||
WWW intro.txt /*WWW*
|
||||
Win32 os_win32.txt /*Win32*
|
||||
@@ -6603,6 +6613,7 @@ hangulin.txt hangulin.txt /*hangulin.txt*
|
||||
has() eval.txt /*has()*
|
||||
has-patch eval.txt /*has-patch*
|
||||
has-python if_pyth.txt /*has-python*
|
||||
has-pythonx if_pyth.txt /*has-pythonx*
|
||||
has_key() eval.txt /*has_key()*
|
||||
haskell.vim syntax.txt /*haskell.vim*
|
||||
haslocaldir() eval.txt /*haslocaldir()*
|
||||
@@ -7901,7 +7912,11 @@ python.vim syntax.txt /*python.vim*
|
||||
python2-directory if_pyth.txt /*python2-directory*
|
||||
python3 if_pyth.txt /*python3*
|
||||
python3-directory if_pyth.txt /*python3-directory*
|
||||
python_x if_pyth.txt /*python_x*
|
||||
python_x-special-comments if_pyth.txt /*python_x-special-comments*
|
||||
pythonx if_pyth.txt /*pythonx*
|
||||
pythonx-directory if_pyth.txt /*pythonx-directory*
|
||||
pyxeval() eval.txt /*pyxeval()*
|
||||
q repeat.txt /*q*
|
||||
q/ cmdline.txt /*q\/*
|
||||
q: cmdline.txt /*q:*
|
||||
@@ -8443,6 +8458,8 @@ t_@7 term.txt /*t_@7*
|
||||
t_AB term.txt /*t_AB*
|
||||
t_AF term.txt /*t_AF*
|
||||
t_AL term.txt /*t_AL*
|
||||
t_BD term.txt /*t_BD*
|
||||
t_BE term.txt /*t_BE*
|
||||
t_CS term.txt /*t_CS*
|
||||
t_CV term.txt /*t_CV*
|
||||
t_Ce term.txt /*t_Ce*
|
||||
@@ -8481,6 +8498,8 @@ t_KI term.txt /*t_KI*
|
||||
t_KJ term.txt /*t_KJ*
|
||||
t_KK term.txt /*t_KK*
|
||||
t_KL term.txt /*t_KL*
|
||||
t_PE term.txt /*t_PE*
|
||||
t_PS term.txt /*t_PS*
|
||||
t_RB term.txt /*t_RB*
|
||||
t_RI term.txt /*t_RI*
|
||||
t_RV term.txt /*t_RV*
|
||||
@@ -9332,6 +9351,7 @@ xterm-8-bit term.txt /*xterm-8-bit*
|
||||
xterm-8bit term.txt /*xterm-8bit*
|
||||
xterm-blink syntax.txt /*xterm-blink*
|
||||
xterm-blinking-cursor syntax.txt /*xterm-blinking-cursor*
|
||||
xterm-bracketed-paste term.txt /*xterm-bracketed-paste*
|
||||
xterm-clipboard term.txt /*xterm-clipboard*
|
||||
xterm-codes term.txt /*xterm-codes*
|
||||
xterm-color syntax.txt /*xterm-color*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*term.txt* For Vim version 8.0. Last change: 2016 Sep 02
|
||||
*term.txt* For Vim version 8.0. Last change: 2017 Jan 27
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -99,7 +99,12 @@ is used.
|
||||
|
||||
Note that in some situations Vim will not recognize the bracketed paste and
|
||||
you will get the raw text. In other situations Vim will only get the first
|
||||
pasted character and drop the rest, e.g. when using the "r" command.
|
||||
pasted character and drop the rest, e.g. when using the "r" command. If you
|
||||
have a problem with this, disable bracketed paste by putting this in your
|
||||
.vimrc: >
|
||||
set t_BE=
|
||||
If this is done while Vim is running the 't_BD' will be sent to the terminal
|
||||
to disable bracketed paste.
|
||||
|
||||
*cs7-problem*
|
||||
Note: If the terminal settings are changed after running Vim, you might have
|
||||
@@ -414,7 +419,7 @@ Note: Use the <> form if possible
|
||||
t_KK <k8> keypad 8 *<k8>* *t_KK* *'t_KK'*
|
||||
t_KL <k9> keypad 9 *<k9>* *t_KL* *'t_KL'*
|
||||
<Mouse> leader of mouse code *<Mouse>*
|
||||
t_PS start of brackted paste |xterm-bracketed-paste| *t_PS* 't_PS'
|
||||
t_PS start of bracketed paste |xterm-bracketed-paste| *t_PS* 't_PS'
|
||||
t_PE end of bracketed paste |xterm-bracketed-paste| *t_PE* 't_PE'
|
||||
|
||||
Note about t_so and t_mr: When the termcap entry "so" is not present the
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 8.0. Last change: 2017 Jan 16
|
||||
*todo.txt* For Vim version 8.0. Last change: 2017 Jan 28
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -35,8 +35,6 @@ entered there will not be repeated below, unless there is extra information.
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
get_syn_options() does not respect skip in else part. (Zyx)
|
||||
|
||||
+channel:
|
||||
- Try out background make plugin:
|
||||
https://github.com/AndrewVos/vim-make-background
|
||||
@@ -60,6 +58,7 @@ get_syn_options() does not respect skip in else part. (Zyx)
|
||||
connecting in the main loop with zero timeout.
|
||||
- job_start(): run job in a newly opened terminal.
|
||||
With xterm could use -S{pty}.
|
||||
Although user could use "xterm -e 'cmd arg'".
|
||||
|
||||
Regexp problems:
|
||||
- Since 7.4.704 the old regex engine fails to match [[:print:]] in 0xf6.
|
||||
@@ -108,40 +107,27 @@ Regexp problems:
|
||||
|
||||
'] mark invalid after undoing insert "hello".
|
||||
|
||||
Make html indent file use javascript indent, now that it's not just cindent.
|
||||
#1220
|
||||
|
||||
Concatenation with null string causes an error: 'a'[1:0] .. 'b'
|
||||
Might as well handle it like an empty string.
|
||||
|
||||
When using symbolic links, a package path will not be inserted at the right
|
||||
position in 'runtimepath'. (Dugan Chen, 2016 Nov 18)
|
||||
|
||||
json_encode(): should convert to utf-8. (Nikolai Pavlov, 2016 Jan 23)
|
||||
What if there is an invalid character?
|
||||
|
||||
Include rust files. (Klabnik, #1356)
|
||||
|
||||
Allow using json with empty key? Dict already has it.
|
||||
|
||||
Json string with trailing \u should be an error. (Lcd)
|
||||
|
||||
Patch to deal with changed configure events in GTK 3. (Jan Alexander Steffens,
|
||||
2016 Oct 23 #1193)
|
||||
Remarks from nuko8, 2016 Nov 2.
|
||||
|
||||
Multi-byte bug: dv} splits char. (Urtica Dioica, 2017 Jan 9)
|
||||
|
||||
Patch to change order of compiler flags. (Yousong Zhou, 2016 Sep 19, #1100)
|
||||
Patch: Make mode() return "ix" or "Rx" when in completion mode.
|
||||
(Yegappan Lakshmanan, 2017 Jan 19, #1397, update Jan 22)
|
||||
|
||||
Patch to add command line completion for :cexpr commands. (Yegappan
|
||||
Lakshmanan, 2016 Dec 13)
|
||||
With Visual selection of a multi-byte character the '] mark is on the last
|
||||
byte, should be first byte?
|
||||
|
||||
Patch for :pyx, run python commands depending on the supported version.
|
||||
(Marc Weber, update from Ken Takata, 2016 Sep 19, 2017 Jan 6)
|
||||
|
||||
Patch to avoid warnings for overflow. (Mike Williams, 2016 Dec 16)
|
||||
Update Dec 19.
|
||||
When session file has name in argument list but the buffer was deleted, the
|
||||
buffer is not deleted when using the session file. (#1393)
|
||||
Should add the buffer in hidden state.
|
||||
|
||||
When an item in the quickfix list has a file name that does not exist, behave
|
||||
like the item was not a match for :cnext.
|
||||
@@ -150,18 +136,13 @@ Wrong diff highlighting with three files. (2016 Oct 20, #1186)
|
||||
Also get E749 on exit.
|
||||
Another example in #1309
|
||||
|
||||
Patch to fix vim_iswordp() works differently on chars <256 that are two bytes.
|
||||
Ozaki Kiichi, 2016 Dec 11.
|
||||
Completion for user-defined commands does not work if a few chararacters were
|
||||
already typed. (Dominique, 2017 Jan 26)
|
||||
|
||||
When deleting a mark or register, leave a tombstone, so that it's also deleted
|
||||
when writing viminfo (and the delete was the most recent action). #1339
|
||||
|
||||
Relevant neovim patch:
|
||||
https://github.com/neovim/neovim/pull/5717
|
||||
test case:
|
||||
https://github.com/neovim/neovim/pull/5717#issuecomment-264845481
|
||||
Others:
|
||||
https://github.com/neovim/neovim/issues/5713#issuecomment-265136186
|
||||
https://github.com/neovim/neovim/pull/5737#issuecomment-266055165
|
||||
|
||||
Patch for better explanation of 'compatible' side effects.
|
||||
@@ -199,6 +180,10 @@ Patch for restoring wide characters in the console buffer.
|
||||
Patch to fix escaping of job arguments. (Yasuhiro Matsumoto, 2016 Oct 5)
|
||||
Update Oct 14: https://gist.github.com/mattn/d47e7d3bfe5ade4be86062b565a4bfca
|
||||
|
||||
The TermResponse event is not triggered when a plugin has set 'eventignore' to
|
||||
"all". Netrw does this. (Gary Johnson, 2017 Jan 24)
|
||||
Postpone the event until 'eventignore' is reset.
|
||||
|
||||
Once .exe with updated installer is available: Add remark to download page
|
||||
about /S and /D options (Ken Takata, 2016 Apr 13)
|
||||
Or point to nightly builds: https://github.com/vim/vim-win32-installer/releases
|
||||
@@ -220,6 +205,7 @@ lines: :g/^/normal yyp On Unix it works OK. (Bryce Orgill, 2016 Nov 5)
|
||||
|
||||
Patch for wrong cursor position on wrapped line, involving breakindent.
|
||||
(Ozaki Kiichi, 2016 Nov 25)
|
||||
Does this also fix #1408 ?
|
||||
|
||||
Patch for 'cursorlinenr' option. (Ozaki Kiichi, 2016 Nov 30)
|
||||
|
||||
@@ -569,6 +555,9 @@ Patch to add :mapgroup, put mappings in a group like augroup.
|
||||
Value returned by virtcol() changes depending on how lines wrap. This is
|
||||
inconsistent with the documentation.
|
||||
|
||||
Value of virtcol() for '[ and '] depend on multi-byte character.
|
||||
(Luchr, #277)
|
||||
|
||||
Can we cache the syntax attributes, so that updates for 'relativenumber' and
|
||||
'cursorline'/'cursorcolumn' are a lot faster?
|
||||
|
||||
@@ -1061,9 +1050,6 @@ Aug 16)
|
||||
When there are no command line arguments ":next" and ":argu" give E163, which
|
||||
is confusing. Should say "the argument list is empty".
|
||||
|
||||
xterm supports escape sequences to mark a paste operation. Need to be
|
||||
enabled. (Bruno Sutic, 2014 Jul 11) How to know the terminal supports this?
|
||||
|
||||
URXVT:
|
||||
- will get stuck if byte sequence does not contain the expected semicolon.
|
||||
- Use urxvt mouse support also in xterm. Explanations:
|
||||
|
||||
@@ -1000,6 +1000,7 @@ Various: *various-functions*
|
||||
perleval() evaluate Perl expression (|+perl|)
|
||||
py3eval() evaluate Python expression (|+python3|)
|
||||
pyeval() evaluate Python expression (|+python|)
|
||||
pyxeval() evaluate |python_x| expression
|
||||
|
||||
==============================================================================
|
||||
*41.7* Defining a function
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim filetype plugin file
|
||||
" Language: man
|
||||
" Maintainer: SungHyun Nam <goweol@gmail.com>
|
||||
" Last Change: 2017 Jan 04
|
||||
" Last Change: 2017 Jan 18
|
||||
|
||||
" To make the ":Man" command available before editing a manual page, source
|
||||
" this script from your startup vimrc file.
|
||||
@@ -97,7 +97,7 @@ func <SID>GetCmdArg(sect, page)
|
||||
endfunc
|
||||
|
||||
func <SID>FindPage(sect, page)
|
||||
let where = system("/usr/bin/man ".s:man_find_arg.' '.s:GetCmdArg(a:sect, a:page))
|
||||
let where = system("man ".s:man_find_arg.' '.s:GetCmdArg(a:sect, a:page))
|
||||
if where !~ "^/"
|
||||
if matchstr(where, " [^ ]*$") !~ "^ /"
|
||||
return 0
|
||||
@@ -176,7 +176,7 @@ func <SID>GetPage(...)
|
||||
let $MANWIDTH = winwidth(0)
|
||||
let unsetwidth = 1
|
||||
endif
|
||||
silent exec "r!/usr/bin/man ".s:GetCmdArg(sect, page)." | col -b"
|
||||
silent exec "r !man ".s:GetCmdArg(sect, page)." | col -b"
|
||||
if unsetwidth
|
||||
let $MANWIDTH = ''
|
||||
endif
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" Header: "{{{
|
||||
" Maintainer: Bram Moolenaar
|
||||
" Original Author: Andy Wokula <anwoku@yahoo.de>
|
||||
" Last Change: 2016 Mar 30
|
||||
" Last Change: 2017 Jan 17
|
||||
" Version: 1.0
|
||||
" Description: HTML indent script with cached state for faster indenting on a
|
||||
" range of lines.
|
||||
@@ -25,27 +25,22 @@
|
||||
if exists("b:did_indent") "{{{
|
||||
finish
|
||||
endif
|
||||
|
||||
" Load the Javascript indent script first, it defines GetJavascriptIndent().
|
||||
" Undo the rest.
|
||||
" Load base python indent.
|
||||
if !exists('*GetJavascriptIndent')
|
||||
runtime! indent/javascript.vim
|
||||
endif
|
||||
let b:did_indent = 1
|
||||
|
||||
setlocal indentexpr=HtmlIndent()
|
||||
setlocal indentkeys=o,O,<Return>,<>>,{,},!^F
|
||||
|
||||
" "j1" is included to make cindent() work better with Javascript.
|
||||
setlocal cino=j1
|
||||
" "J1" should be included, but it doen't work properly before 7.4.355.
|
||||
if has("patch-7.4.355")
|
||||
setlocal cino+=J1
|
||||
endif
|
||||
" Before patch 7.4.355 indenting after "(function() {" does not work well, add
|
||||
" )2 to limit paren search.
|
||||
if !has("patch-7.4.355")
|
||||
setlocal cino+=)2
|
||||
endif
|
||||
|
||||
" Needed for % to work when finding start/end of a tag.
|
||||
setlocal matchpairs+=<:>
|
||||
|
||||
let b:undo_indent = "setlocal inde< indk< cino<"
|
||||
let b:undo_indent = "setlocal inde< indk<"
|
||||
|
||||
" b:hi_indent keeps state to speed up indenting consecutive lines.
|
||||
let b:hi_indent = {"lnum": -1}
|
||||
@@ -596,7 +591,7 @@ func! s:Alien3()
|
||||
return eval(b:hi_js1indent)
|
||||
endif
|
||||
if b:hi_indent.scripttype == "javascript"
|
||||
return cindent(v:lnum)
|
||||
return GetJavascriptIndent()
|
||||
else
|
||||
return -1
|
||||
endif
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
" Vim syntax file
|
||||
" Language: AutoHotkey script file
|
||||
" Maintainer: SungHyun Nam <goweol@gmail.com>
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2015-10-29
|
||||
" Maintainer: Michael Wong
|
||||
" https://github.com/mmikeww/autohotkey.vim
|
||||
" Latest Revision: 2017-01-23
|
||||
" Previous Maintainers: SungHyun Nam <goweol@gmail.com>
|
||||
" Nikolai Weibull <now@bitwi.se>
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
@@ -17,68 +19,11 @@ syn keyword autohotkeyTodo
|
||||
\ contained
|
||||
\ TODO FIXME XXX NOTE
|
||||
|
||||
syn cluster autohotkeyCommentGroup
|
||||
\ contains=
|
||||
\ autohotkeyTodo,
|
||||
\ @Spell
|
||||
|
||||
syn match autohotkeyComment
|
||||
\ display
|
||||
\ contains=@autohotkeyCommentGroup
|
||||
\ '`\@<!;.*$'
|
||||
|
||||
syn region autohotkeyComment
|
||||
\ contains=@autohotkeyCommentGroup
|
||||
\ matchgroup=autohotkeyCommentStart
|
||||
\ start='/\*'
|
||||
\ end='\*/'
|
||||
|
||||
" only these chars are valid as escape sequences: ,%`;nrbtvaf
|
||||
" https://autohotkey.com/docs/commands/_EscapeChar.htm
|
||||
syn match autohotkeyEscape
|
||||
\ display
|
||||
\ '`.'
|
||||
|
||||
syn match autohotkeyHotkey
|
||||
\ contains=autohotkeyKey,
|
||||
\ autohotkeyHotkeyDelimiter
|
||||
\ display
|
||||
\ '^.\{-}::'
|
||||
|
||||
syn match autohotkeyKey
|
||||
\ contained
|
||||
\ display
|
||||
\ '^.\{-}'
|
||||
|
||||
syn match autohotkeyDelimiter
|
||||
\ contained
|
||||
\ display
|
||||
\ '::'
|
||||
|
||||
syn match autohotkeyHotstringDefinition
|
||||
\ contains=autohotkeyHotstring,
|
||||
\ autohotkeyHotstringDelimiter
|
||||
\ display
|
||||
\ '^:\%(B0\|C1\|K\d\+\|P\d\+\|S[IPE]\|Z\d\=\|[*?COR]\)*:.\{-}::'
|
||||
|
||||
syn match autohotkeyHotstring
|
||||
\ contained
|
||||
\ display
|
||||
\ '.\{-}'
|
||||
|
||||
syn match autohotkeyHotstringDelimiter
|
||||
\ contained
|
||||
\ display
|
||||
\ '::'
|
||||
|
||||
syn match autohotkeyHotstringDelimiter
|
||||
\ contains=autohotkeyHotstringOptions
|
||||
\ contained
|
||||
\ display
|
||||
\ ':\%(B0\|C1\|K\d\+\|P\d\+\|S[IPE]\|Z\d\=\|[*?COR]\):'
|
||||
|
||||
syn match autohotkeyHotstringOptions
|
||||
\ contained
|
||||
\ display
|
||||
\ '\%(B0\|C1\|K\d\+\|P\d\+\|S[IPE]\|Z\d\=\|[*?COR]\)'
|
||||
\ '`[,%`;nrbtvaf]'
|
||||
|
||||
syn region autohotkeyString
|
||||
\ display
|
||||
@@ -88,39 +33,46 @@ syn region autohotkeyString
|
||||
\ end=+"+
|
||||
\ contains=autohotkeyEscape
|
||||
|
||||
syn region autohotkeyVariable
|
||||
syn match autohotkeyVariable
|
||||
\ display
|
||||
\ oneline
|
||||
\ contains=autohotkeyBuiltinVariable
|
||||
\ matchgroup=autohotkeyVariableDelimiter
|
||||
\ start="%"
|
||||
\ end="%"
|
||||
\ keepend
|
||||
\ '%\S\{-}%'
|
||||
|
||||
syn keyword autohotkeyBuiltinVariable
|
||||
\ A_Space A_Tab
|
||||
\ A_WorkingDir A_ScriptDir A_ScriptName A_ScriptFullPath A_LineNumber
|
||||
\ A_LineFile A_AhkVersion A_AhkPAth A_IsCompiled A_ExitReason
|
||||
\ A_YYYY A_MM A_DD A_MMMM A_MMM A_DDDD A_DDD A_WDay A_YWeek A_Hour A_Min
|
||||
\ A_WorkingDir A_ScriptDir A_ScriptName A_ScriptFullPath A_ScriptHwnd A_LineNumber
|
||||
\ A_LineFile A_ThisFunc A_ThisLabel A_AhkVersion A_AhkPath A_IsUnicode A_IsCompiled A_ExitReason
|
||||
\ A_YYYY A_MM A_DD A_MMMM A_MMM A_DDDD A_DDD A_WDay A_YDay A_YWeek A_Hour A_Min
|
||||
\ A_Mon A_Year A_MDay A_NumBatchLines
|
||||
\ A_Sec A_MSec A_Now A_NowUTC A_TickCount
|
||||
\ A_IsSuspended A_BatchLines A_TitleMatchMode A_TitleMatchModeSpeed
|
||||
\ A_DetectHiddenWindows A_DetectHiddenText A_AutoTrim A_STringCaseSense
|
||||
\ A_FormatInteger A_FormatFloat A_KeyDelay A_WinDelay A_ControlDelay
|
||||
\ A_MouseDelay A_DefaultMouseSpeed A_IconHidden A_IconTip A_IconFile
|
||||
\ A_IsSuspended A_IsPaused A_IsCritical A_BatchLines A_TitleMatchMode A_TitleMatchModeSpeed
|
||||
\ A_DetectHiddenWindows A_DetectHiddenText A_AutoTrim A_StringCaseSense
|
||||
\ A_FileEncoding A_FormatInteger A_FormatFloat A_KeyDelay A_WinDelay A_ControlDelay
|
||||
\ A_SendMode A_SendLevel A_StoreCapsLockMode A_KeyDelay A_KeyDelayDuration
|
||||
\ A_KeyDelayPlay A_KeyDelayPlayDuration A_MouseDelayPlay
|
||||
\ A_MouseDelay A_DefaultMouseSpeed A_RegView A_IconHidden A_IconTip A_IconFile
|
||||
\ A_CoordModeToolTip A_CoordModePixel A_CoordModeMouse A_CoordModeCaret A_CoordModeMenu
|
||||
\ A_IconNumber
|
||||
\ A_TimeIdle A_TimeIdlePhysical
|
||||
\ A_TimeIdle A_TimeIdlePhysical A_DefaultGui A_DefaultListView A_DefaultTreeView
|
||||
\ A_Gui A_GuiControl A_GuiWidth A_GuiHeight A_GuiX A_GuiY A_GuiEvent
|
||||
\ A_GuiControlEvent A_EventInfo
|
||||
\ A_ThisMenuItem A_ThisMenu A_ThisMenuItemPos A_ThisHotkey A_PriorHotkey
|
||||
\ A_TimeSinceThisHotkey A_TimeSincePriorHotkey A_EndChar
|
||||
\ A_PriorKey A_TimeSinceThisHotkey A_TimeSincePriorHotkey A_EndChar
|
||||
\ ComSpec A_Temp A_OSType A_OSVersion A_Language A_ComputerName A_UserName
|
||||
\ A_Is64BitOS A_PtrSize
|
||||
\ A_WinDir A_ProgramFiles ProgramFiles A_AppData A_AppDataCommon A_Desktop
|
||||
\ A_DesktopCommon A_StartMenu A_StartMenuCommon A_Programs
|
||||
\ A_ProgramsCommon A_Startup A_StartupCommon A_MyDocuments A_IsAdmin
|
||||
\ A_ScreenWidth A_ScreenHeight A_IPAddress1 A_IPAddress2 A_IPAddress3
|
||||
\ A_ScreenWidth A_ScreenHeight A_ScreenDPI A_IPAddress1 A_IPAddress2 A_IPAddress3
|
||||
\ A_IPAddress4
|
||||
\ A_Cursor A_CaretX A_CaretY Clipboard ClipboardAll ErrorLevel A_LastError
|
||||
\ A_Index A_LoopFileName A_LoopRegName A_LoopReadLine A_LoopField
|
||||
\ A_LoopFileExt A_LoopFileFullPath A_LoopFileLongPath A_LoopFileShortPath
|
||||
\ A_LoopFileShortName A_LoopFileDir A_LoopFileTimeModified A_LoopFileTimeCreated
|
||||
\ A_LoopFileTimeAccessed A_LoopFileAttrib A_LoopFileSize A_LoopFileSizeKB A_LoopFileSizeMB
|
||||
\ A_LoopRegType A_LoopRegKey A_LoopRegSubKey A_LoopRegTimeModified
|
||||
|
||||
syn match autohotkeyBuiltinVariable
|
||||
\ contained
|
||||
@@ -130,7 +82,7 @@ syn match autohotkeyBuiltinVariable
|
||||
syn keyword autohotkeyCommand
|
||||
\ ClipWait EnvGet EnvSet EnvUpdate
|
||||
\ Drive DriveGet DriveSpaceFree FileAppend FileCopy FileCopyDir
|
||||
\ FileCreateDir FileCreateShortcut FileDelete FileGetAttrib
|
||||
\ FileCreateDir FileCreateShortcut FileDelete FileGetAttrib FileEncoding
|
||||
\ FileGetShortcut FileGetSize FileGetTime FileGetVersion FileInstall
|
||||
\ FileMove FileMoveDir FileReadLine FileRead FileRecycle FileRecycleEmpty
|
||||
\ FileRemoveDir FileSelectFolder FileSelectFile FileSetAttrib FileSetTime
|
||||
@@ -153,7 +105,7 @@ syn keyword autohotkeyCommand
|
||||
\ SoundSetWaveVolume
|
||||
\ FormatTime IfInString IfNotInString Sort StringCaseSense StringGetPos
|
||||
\ StringLeft StringRight StringLower StringUpper StringMid StringReplace
|
||||
\ StringSplit StringTrimLeft StringTrimRight
|
||||
\ StringSplit StringTrimLeft StringTrimRight StringLen
|
||||
\ Control ControlClick ControlFocus ControlGet ControlGetFocus
|
||||
\ ControlGetPos ControlGetText ControlMove ControlSend ControlSendRaw
|
||||
\ ControlSetText Menu PostMessage SendMessage SetControlDelay
|
||||
@@ -164,12 +116,16 @@ syn keyword autohotkeyCommand
|
||||
\ WinGetText WinGetTitle WinHide WinKill WinMaximize WinMinimize
|
||||
\ WinMinimizeAll WinMinimizeAllUndo WinMove WinRestore WinSet
|
||||
\ WinSetTitle WinShow WinWait WinWaitActive WinWaitNotActive WinWaitClose
|
||||
\ SetCapsLockState SetNumLockState SetScrollLockState
|
||||
|
||||
syn keyword autohotkeyFunction
|
||||
\ InStr RegExMatch RegExReplace StrLen SubStr Asc Chr
|
||||
\ DllCall VarSetCapacity WinActive WinExist IsLabel OnMessage
|
||||
\ Abs Ceil Exp Floor Log Ln Mod Round Sqrt Sin Cos Tan ASin ACos ATan
|
||||
\ FileExist GetKeyState
|
||||
\ FileExist GetKeyState NumGet NumPut StrGet StrPut RegisterCallback
|
||||
\ IsFunc Trim LTrim RTrim IsObject Object Array FileOpen
|
||||
\ ComObjActive ComObjArray ComObjConnect ComObjCreate ComObjGet
|
||||
\ ComObjError ComObjFlags ComObjQuery ComObjType ComObjValue ComObject
|
||||
|
||||
syn keyword autohotkeyStatement
|
||||
\ Break Continue Exit ExitApp Gosub Goto OnExit Pause Return
|
||||
@@ -180,7 +136,9 @@ syn keyword autohotkeyRepeat
|
||||
|
||||
syn keyword autohotkeyConditional
|
||||
\ IfExist IfNotExist If IfEqual IfLess IfGreater Else
|
||||
\ IfWinExist IfWinNotExist
|
||||
\ IfWinExist IfWinNotExist IfWinActive IfWinNotActive
|
||||
\ IfNotEqual IfLessOrEqual IfGreaterOrEqual
|
||||
\ while until for in
|
||||
|
||||
syn match autohotkeyPreProcStart
|
||||
\ nextgroup=
|
||||
@@ -200,6 +158,7 @@ syn keyword autohotkeyPreProc
|
||||
\ HotkeyInterval HotKeyModifierTimeout
|
||||
\ Hotstring
|
||||
\ IfWinActive IfWinNotActive IfWinExist IfWinNotExist
|
||||
\ If IfTimeout
|
||||
\ MaxHotkeysPerInterval MaxThreads MaxThreadsBuffer MaxThreadsPerHotkey
|
||||
\ UseHook InstallKeybdHook InstallMouseHook
|
||||
\ KeyHistory
|
||||
@@ -213,6 +172,10 @@ syn keyword autohotkeyPreProc
|
||||
\ MaxMem
|
||||
\ NoEnv
|
||||
\ Persistent
|
||||
\ LTrim
|
||||
\ InputLevel
|
||||
\ MenuMaskKey
|
||||
\ Warn
|
||||
|
||||
syn keyword autohotkeyMatchClass
|
||||
\ ahk_group ahk_class ahk_id ahk_pid
|
||||
@@ -243,11 +206,74 @@ syn match autohotkeyFloat
|
||||
syn keyword autohotkeyType
|
||||
\ local
|
||||
\ global
|
||||
\ static
|
||||
\ byref
|
||||
|
||||
syn keyword autohotkeyBoolean
|
||||
\ true
|
||||
\ false
|
||||
|
||||
syn match autohotkeyHotkey
|
||||
\ contains=autohotkeyKey,
|
||||
\ autohotkeyHotkeyDelimiter
|
||||
\ display
|
||||
\ '^.\{-}::'
|
||||
|
||||
syn match autohotkeyKey
|
||||
\ contained
|
||||
\ display
|
||||
\ '^.\{-}'
|
||||
|
||||
syn match autohotkeyDelimiter
|
||||
\ contained
|
||||
\ display
|
||||
\ '::'
|
||||
|
||||
" allowable hotstring options:
|
||||
" https://autohotkey.com/docs/Hotstrings.htm
|
||||
syn match autohotkeyHotstringDefinition
|
||||
\ contains=autohotkeyHotstring,
|
||||
\ autohotkeyHotstringDelimiter
|
||||
\ display
|
||||
\ '^\s*:\%([*?]\|[BORZ]0\?\|C[01]\?\|K\d\+\|P\d\+\|S[IPE]\)*:.\{-}::'
|
||||
|
||||
syn match autohotkeyHotstring
|
||||
\ contained
|
||||
\ display
|
||||
\ '.\{-}'
|
||||
|
||||
syn match autohotkeyHotstringDelimiter
|
||||
\ contained
|
||||
\ display
|
||||
\ '::'
|
||||
|
||||
syn match autohotkeyHotstringDelimiter
|
||||
\ contains=autohotkeyHotstringOptions
|
||||
\ contained
|
||||
\ display
|
||||
\ ':\%([*?]\|[BORZ]0\?\|C[01]\?\|K\d\+\|P\d\+\|S[IPE]\)*:'
|
||||
|
||||
syn match autohotkeyHotstringOptions
|
||||
\ contained
|
||||
\ display
|
||||
\ '\%([*?]\|[BORZ]0\?\|C[01]\?\|K\d\+\|P\d\+\|S[IPE]\)*'
|
||||
|
||||
syn cluster autohotkeyCommentGroup
|
||||
\ contains=
|
||||
\ autohotkeyTodo,
|
||||
\ @Spell
|
||||
|
||||
syn match autohotkeyComment
|
||||
\ display
|
||||
\ contains=@autohotkeyCommentGroup
|
||||
\ '\%(^;\|\s\+;\).*$'
|
||||
|
||||
syn region autohotkeyComment
|
||||
\ contains=@autohotkeyCommentGroup
|
||||
\ matchgroup=autohotkeyCommentStart
|
||||
\ start='^\s*/\*'
|
||||
\ end='^\s*\*/'
|
||||
|
||||
" TODO: Shouldn't we look for g:, b:, variables before defaulting to
|
||||
" something?
|
||||
if exists("g:autohotkey_syntax_sync_minlines")
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
" Maintainer: Jorge Maldonado Ventura <jorgesumle@freakspot.net>
|
||||
" Previous Maintainer: Claudio Fleiner <claudio@fleiner.com>
|
||||
" Repository: https://notabug.org/jorgesumle/vim-html-syntax
|
||||
" Last Change: 2017 Jan 04
|
||||
" Last Change: 2017 Jan 21
|
||||
" included patch from Jorge Maldonado Ventura
|
||||
|
||||
" Please check :help html.vim for some comments and a description of the options
|
||||
@@ -55,9 +55,9 @@ syn keyword htmlTagName contained colgroup del fieldset iframe ins legend
|
||||
syn keyword htmlTagName contained object optgroup q s tbody tfoot thead
|
||||
|
||||
" new html 5 tags
|
||||
syn keyword htmlTagName contained article aside audio bdi canvas datalist
|
||||
syn keyword htmlTagName contained details embed figcaption figure
|
||||
syn keyword htmlTagName contained footer header hgroup main mark
|
||||
syn keyword htmlTagName contained article aside audio bdi canvas data
|
||||
syn keyword htmlTagName contained datalist details embed figcaption figure
|
||||
syn keyword htmlTagName contained footer header hgroup keygen main mark
|
||||
syn keyword htmlTagName contained menuitem meter nav output picture
|
||||
syn keyword htmlTagName contained progress rb rp rt rtc ruby section
|
||||
syn keyword htmlTagName contained slot source template time track video wbr
|
||||
@@ -97,8 +97,17 @@ syn keyword htmlArg contained rules scheme scope span standby style
|
||||
syn keyword htmlArg contained summary tabindex valuetype version
|
||||
|
||||
" html 5 arg names
|
||||
syn keyword htmlArg contained contenteditable contextmenu draggable dropzone
|
||||
syn keyword htmlArg contained hidden spellcheck title translate
|
||||
syn keyword htmlArg contained allowfullscreen async autocomplete autofocus
|
||||
syn keyword htmlArg contained autoplay challenge contenteditable contextmenu
|
||||
syn keyword htmlArg contained controls crossorigin default dirname download
|
||||
syn keyword htmlArg contained draggable dropzone form formaction formenctype
|
||||
syn keyword htmlArg contained formmethod formnovalidate formtarget hidden
|
||||
syn keyword htmlArg contained high icon inputmode keytype kind list loop low
|
||||
syn keyword htmlArg contained max min minlength muted nonce novalidate open
|
||||
syn keyword htmlArg contained optimum pattern placeholder poster preload
|
||||
syn keyword htmlArg contained radiogroup required reversed sandbox spellcheck
|
||||
syn keyword htmlArg contained sizes srcset srcdoc srclang step title translate
|
||||
syn keyword htmlArg contained typemustmatch
|
||||
|
||||
" special characters
|
||||
syn match htmlSpecialChar "&#\=[0-9A-Za-z]\{1,8};"
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
" Vim syntax file
|
||||
" Language: Matlab
|
||||
" Maintainer: Maurizio Tranchero - maurizio(.)tranchero(@)gmail(.)com
|
||||
" Maintainer: Alex Burka <vim@alexburka.com>
|
||||
" Credits: Preben 'Peppe' Guldberg <peppe-vim@wielders.org>
|
||||
" Maurizio Tranchero - maurizio(.)tranchero(@)gmail(.)com
|
||||
" Original author: Mario Eusebio
|
||||
" Last Change: Wed Jan 13 11:12:34 CET 2010
|
||||
" sinh added to matlab implicit commands
|
||||
" Last Change: Mon Jan 23 2017
|
||||
" added support for cell mode
|
||||
" Change History:
|
||||
" - now highlights cell-mode separator comments
|
||||
" - 'global' and 'persistent' keyword are now recognized
|
||||
|
||||
" quit when a syntax file was already loaded
|
||||
@@ -60,6 +62,7 @@ syn match matlabComment "%.*$" contains=matlabTodo,matlabTab
|
||||
" MT_ADDON - correctly highlights words after '...' as comments
|
||||
syn match matlabComment "\.\.\..*$" contains=matlabTodo,matlabTab
|
||||
syn region matlabMultilineComment start=+%{+ end=+%}+ contains=matlabTodo,matlabTab
|
||||
syn match matlabCellComment "^%%.*$"
|
||||
|
||||
syn keyword matlabOperator break zeros default margin round ones rand
|
||||
syn keyword matlabOperator ceil floor size clear zeros eye mean std cov
|
||||
@@ -96,6 +99,7 @@ hi def link matlabOO Statement
|
||||
hi def link matlabSemicolon SpecialChar
|
||||
hi def link matlabComment Comment
|
||||
hi def link matlabMultilineComment Comment
|
||||
hi def link matlabCellComment Todo
|
||||
hi def link matlabScope Type
|
||||
|
||||
hi def link matlabArithmeticOperator matlabOperator
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
" Vim syntax file
|
||||
" Language: NASM - The Netwide Assembler (v0.98)
|
||||
" Maintainer: Andriy Sokolov <andriy145@gmail.com>
|
||||
" Maintainer: Andrii Sokolov <andriy145@gmail.com>
|
||||
" Original Author: Manuel M.H. Stol <Manuel.Stol@allieddata.nl>
|
||||
" Former Maintainer: Manuel M.H. Stol <Manuel.Stol@allieddata.nl>
|
||||
" Last Change: 2012 Feb 7
|
||||
" Contributors: Leonard König <leonard.r.koenig@gmail.com> (C string highlighting)
|
||||
" Last Change: 2017 Jan 23
|
||||
" NASM Home: http://www.nasm.us/
|
||||
|
||||
|
||||
@@ -67,8 +68,23 @@ syn match nasmLabelError "\<\~\s*\(\k*\s*:\|\$\=\.\k*\)"
|
||||
|
||||
|
||||
" Constants:
|
||||
syn match nasmStringError +["']+
|
||||
syn match nasmStringError +["'`]+
|
||||
" NASM is case sensitive here: eg. u-prefix allows for 4-digit, U-prefix for
|
||||
" 8-digit Unicode characters
|
||||
syn case match
|
||||
" one-char escape-sequences
|
||||
syn match nasmCStringEscape display contained "\\[’"‘\\\?abtnvfre]"
|
||||
" hex and octal numbers
|
||||
syn match nasmCStringEscape display contained "\\\(x\x\{2}\|\o\{1,3}\)"
|
||||
" Unicode characters
|
||||
syn match nasmCStringEscape display contained "\\\(u\x\{4}\|U\x\{8}\)"
|
||||
" ISO C99 format strings (copied from cFormat in runtime/syntax/c.vim)
|
||||
syn match nasmCStringFormat display "%\(\d\+\$\)\=[-+' #0*]*\(\d*\|\*\|\*\d\+\$\)\(\.\(\d*\|\*\|\*\d\+\$\)\)\=\([hlLjzt]\|ll\|hh\)\=\([aAbdiuoxXDOUfFeEgGcCsSpn]\|\[\^\=.[^]]*\]\)" contained
|
||||
syn match nasmCStringFormat display "%%" contained
|
||||
syn match nasmString +\("[^"]\{-}"\|'[^']\{-}'\)+
|
||||
" Highlight C escape- and format-sequences within ``-strings
|
||||
syn match nasmCString +\(`[^`]\{-}`\)+ contains=nasmCStringEscape,nasmCStringFormat extend
|
||||
syn case ignore
|
||||
syn match nasmBinNumber "\<[0-1]\+b\>"
|
||||
syn match nasmBinNumber "\<\~[0-1]\+b\>"lc=1
|
||||
syn match nasmOctNumber "\<\o\+q\>"
|
||||
@@ -443,7 +459,10 @@ hi def link nasmInCommentTodo Todo
|
||||
|
||||
" Constant Group:
|
||||
hi def link nasmString String
|
||||
hi def link nasmCString String
|
||||
hi def link nasmStringError Error
|
||||
hi def link nasmCStringEscape SpecialChar
|
||||
hi def link nasmCStringFormat SpecialChar
|
||||
hi def link nasmBinNumber Number
|
||||
hi def link nasmOctNumber Number
|
||||
hi def link nasmDecNumber Number
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
" Language: shell (sh) Korn shell (ksh) bash (sh)
|
||||
" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
|
||||
" Previous Maintainer: Lennart Schultz <Lennart.Schultz@ecmwf.int>
|
||||
" Last Change: Sep 22, 2016
|
||||
" Version: 165
|
||||
" Last Change: Jan 03, 2017
|
||||
" Version: 167
|
||||
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_SH
|
||||
" For options and settings, please use: :help ft-sh-syntax
|
||||
" This file includes many ideas from Eric Brunet (eric.brunet@ens.fr)
|
||||
@@ -386,7 +386,7 @@ ShFoldHereDoc syn region shHereDoc matchgroup=shHereDoc15 start="<<-\s*\\\z([^ \
|
||||
" Here Strings: {{{1
|
||||
" =============
|
||||
" available for: bash; ksh (really should be ksh93 only) but not if its a posix
|
||||
if exists("b:is_bash") || (exists("b:is_kornshell") && !exists("g:is_posix"))
|
||||
if exists("b:is_bash") || (exists("b:is_kornshell") && !exists("b:is_posix"))
|
||||
syn match shHereString "<<<" skipwhite nextgroup=shCmdParenRegion
|
||||
endif
|
||||
|
||||
@@ -407,7 +407,7 @@ else
|
||||
endif
|
||||
|
||||
" Functions: {{{1
|
||||
if !exists("g:is_posix")
|
||||
if !exists("b:is_posix")
|
||||
syn keyword shFunctionKey function skipwhite skipnl nextgroup=shFunctionTwo
|
||||
endif
|
||||
|
||||
@@ -533,7 +533,7 @@ endif
|
||||
" ====================
|
||||
if exists("b:is_kornshell") || exists("b:is_bash")
|
||||
syn keyword shStatement autoload bg false fc fg functions getopts hash history integer jobs let nohup printf r stop suspend times true type unalias whence
|
||||
if exists("g:is_posix")
|
||||
if exists("b:is_posix")
|
||||
syn keyword shStatement command
|
||||
else
|
||||
syn keyword shStatement time
|
||||
@@ -542,7 +542,7 @@ if exists("b:is_kornshell") || exists("b:is_bash")
|
||||
" Useful bash Keywords: {{{1
|
||||
" =====================
|
||||
if exists("b:is_bash")
|
||||
syn keyword shStatement bind builtin dirs disown enable help local logout popd pushd shopt source
|
||||
syn keyword shStatement bind builtin dirs disown enable help logout popd pushd shopt source
|
||||
else
|
||||
syn keyword shStatement login newgrp
|
||||
endif
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
" Vim syntax file
|
||||
" Language: TeX
|
||||
" Maintainer: Charles E. Campbell <NdrchipO@ScampbellPfamily.AbizM>
|
||||
" Last Change: Sep 20, 2016
|
||||
" Version: 101
|
||||
" Last Change: Dec 07, 2016
|
||||
" Version: 102
|
||||
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_TEX
|
||||
"
|
||||
" Notes: {{{1
|
||||
@@ -494,13 +494,11 @@ if !exists("g:tex_no_math")
|
||||
\ ['\\backslash' , '\'] ,
|
||||
\ ['\\downarrow' , '↓'] ,
|
||||
\ ['\\Downarrow' , '⇓'] ,
|
||||
\ ['\\langle' , '<'] ,
|
||||
\ ['\\lbrace' , '['] ,
|
||||
\ ['\\lceil' , '⌈'] ,
|
||||
\ ['\\lfloor' , '⌊'] ,
|
||||
\ ['\\lgroup' , '⌊'] ,
|
||||
\ ['\\lmoustache' , '⎛'] ,
|
||||
\ ['\\rangle' , '>'] ,
|
||||
\ ['\\rbrace' , ']'] ,
|
||||
\ ['\\rceil' , '⌉'] ,
|
||||
\ ['\\rfloor' , '⌋'] ,
|
||||
@@ -510,6 +508,15 @@ if !exists("g:tex_no_math")
|
||||
\ ['\\Uparrow' , '↑'] ,
|
||||
\ ['\\updownarrow', '↕'] ,
|
||||
\ ['\\Updownarrow', '⇕']]
|
||||
if &ambw == "double" || exists("g:tex_usedblwidth")
|
||||
let s:texMathDelimList= s:texMathDelimList + [
|
||||
\ ['\\langle' , '〈'] ,
|
||||
\ ['\\rangle' , '〉'] ,
|
||||
else
|
||||
let s:texMathDelimList= s:texMathDelimList + [
|
||||
\ ['\\langle' , '<'] ,
|
||||
\ ['\\rangle' , '>']]
|
||||
endif
|
||||
syn match texMathDelim '\\[bB]igg\=[lr]' contained nextgroup=texMathDelimBad
|
||||
for texmath in s:texMathDelimList
|
||||
exe "syn match texMathDelim '\\\\[bB]igg\\=[lr]\\=".texmath[0]."' contained conceal cchar=".texmath[1]
|
||||
@@ -680,6 +687,7 @@ if has("conceal") && &enc == 'utf-8'
|
||||
\ ['backslash' , '∖'],
|
||||
\ ['barwedge' , '⊼'],
|
||||
\ ['because' , '∵'],
|
||||
\ ['beth' , 'ܒ'],
|
||||
\ ['between' , '≬'],
|
||||
\ ['bigcap' , '∩'],
|
||||
\ ['bigcirc' , '○'],
|
||||
@@ -699,6 +707,7 @@ if has("conceal") && &enc == 'utf-8'
|
||||
\ ['boxminus' , '⊟'],
|
||||
\ ['boxplus' , '⊞'],
|
||||
\ ['boxtimes' , '⊠'],
|
||||
\ ['Box' , '☐'],
|
||||
\ ['bullet' , '•'],
|
||||
\ ['bumpeq' , '≏'],
|
||||
\ ['Bumpeq' , '≎'],
|
||||
@@ -748,6 +757,7 @@ if has("conceal") && &enc == 'utf-8'
|
||||
\ ['eqslantgtr' , '⪖'],
|
||||
\ ['eqslantless' , '⪕'],
|
||||
\ ['equiv' , '≡'],
|
||||
\ ['eth' , 'ð'],
|
||||
\ ['exists' , '∃'],
|
||||
\ ['fallingdotseq' , '≒'],
|
||||
\ ['flat' , '♭'],
|
||||
@@ -757,6 +767,7 @@ if has("conceal") && &enc == 'utf-8'
|
||||
\ ['geq' , '≥'],
|
||||
\ ['geqq' , '≧'],
|
||||
\ ['gets' , '←'],
|
||||
\ ['gimel' , 'ℷ'],
|
||||
\ ['gg' , '⟫'],
|
||||
\ ['gneqq' , '≩'],
|
||||
\ ['gtrdot' , '⋗'],
|
||||
@@ -767,13 +778,17 @@ if has("conceal") && &enc == 'utf-8'
|
||||
\ ['heartsuit' , '♡'],
|
||||
\ ['hookleftarrow' , '↩'],
|
||||
\ ['hookrightarrow' , '↪'],
|
||||
\ ['iff' , '⇔'],
|
||||
\ ['iiint' , '∭'],
|
||||
\ ['iint' , '∬'],
|
||||
\ ['Im' , 'ℑ'],
|
||||
\ ['imath' , 'ɩ'],
|
||||
\ ['implies' , '⇒'],
|
||||
\ ['in' , '∈'],
|
||||
\ ['infty' , '∞'],
|
||||
\ ['int' , '∫'],
|
||||
\ ['jmath' , '𝚥'],
|
||||
\ ['land' , '∧'],
|
||||
\ ['lceil' , '⌈'],
|
||||
\ ['ldots' , '…'],
|
||||
\ ['le' , '≤'],
|
||||
@@ -800,6 +815,7 @@ if has("conceal") && &enc == 'utf-8'
|
||||
\ ['ll' , '≪'],
|
||||
\ ['lmoustache' , '╭'],
|
||||
\ ['lneqq' , '≨'],
|
||||
\ ['lor' , '∨'],
|
||||
\ ['ltimes' , '⋉'],
|
||||
\ ['mapsto' , '↦'],
|
||||
\ ['measuredangle' , '∡'],
|
||||
@@ -826,6 +842,7 @@ if has("conceal") && &enc == 'utf-8'
|
||||
\ ['nless' , '≮'],
|
||||
\ ['nmid' , '∤'],
|
||||
\ ['notin' , '∉'],
|
||||
\ ['nparallel' , '∦'],
|
||||
\ ['nprec' , '⊀'],
|
||||
\ ['nrightarrow' , '↛'],
|
||||
\ ['nRightarrow' , '⇏'],
|
||||
@@ -927,10 +944,12 @@ if has("conceal") && &enc == 'utf-8'
|
||||
\ ['trianglerighteq', '⊵'],
|
||||
\ ['twoheadleftarrow', '↞'],
|
||||
\ ['twoheadrightarrow', '↠'],
|
||||
\ ['ulcorner' , '⌜'],
|
||||
\ ['uparrow' , '↑'],
|
||||
\ ['Uparrow' , '⇑'],
|
||||
\ ['updownarrow' , '↕'],
|
||||
\ ['Updownarrow' , '⇕'],
|
||||
\ ['urcorner' , '⌝'],
|
||||
\ ['varnothing' , '∅'],
|
||||
\ ['vartriangle' , '∆'],
|
||||
\ ['vdash' , '⊢'],
|
||||
@@ -946,6 +965,15 @@ if has("conceal") && &enc == 'utf-8'
|
||||
" \ ['jmath' , 'X']
|
||||
" \ ['uminus' , 'X']
|
||||
" \ ['uplus' , 'X']
|
||||
if &ambw == "double" || exists("g:tex_usedblwidth")
|
||||
let s:texMathList= s:texMathList + [
|
||||
\ ['right\\rangle' , '〉'],
|
||||
\ ['left\\langle' , '〈']]
|
||||
else
|
||||
let s:texMathList= s:texMathList + [
|
||||
\ ['right\\rangle' , '>'],
|
||||
\ ['left\\langle' , '<']]
|
||||
endif
|
||||
for texmath in s:texMathList
|
||||
if texmath[0] =~# '\w$'
|
||||
exe "syn match texMathSymbol '\\\\".texmath[0]."\\>' contained conceal cchar=".texmath[1]
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
" Vim syntax file
|
||||
" Language: Vim 8.0 script
|
||||
" Maintainer: Charles E. Campbell <NdrOchipS@PcampbellAfamily.Mbiz>
|
||||
" Last Change: September 29, 2016
|
||||
" Version: 8.0-01
|
||||
" Last Change: Jan 19, 2017
|
||||
" Version: 8.0-02
|
||||
" URL: http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM
|
||||
" Automatically generated keyword lists: {{{1
|
||||
|
||||
@@ -164,6 +164,7 @@ endif
|
||||
syn match vimNumber "\<\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\=" skipwhite nextgroup=vimGlobal,vimSubst,vimCommand
|
||||
syn match vimNumber "-\d\+\%(\.\d\+\%([eE][+-]\=\d\+\)\=\)\=" skipwhite nextgroup=vimGlobal,vimSubst,vimCommand
|
||||
syn match vimNumber "\<0[xX]\x\+"
|
||||
syn match vimNumber "\<0[bB][01]\+"
|
||||
syn match vimNumber "\%(^\|[^a-zA-Z]\)\zs#\x\{6}"
|
||||
|
||||
" All vimCommands are contained by vimIsCommands. {{{2
|
||||
@@ -225,7 +226,7 @@ endif
|
||||
" Functions : Tag is provided for those who wish to highlight tagged functions {{{2
|
||||
" =========
|
||||
syn cluster vimFuncList contains=vimCommand,vimFunctionError,vimFuncKey,Tag,vimFuncSID
|
||||
syn cluster vimFuncBodyList contains=vimAbb,vimAddress,vimAugroupKey,vimAutoCmd,vimCmplxRepeat,vimComment,vimComment,vimContinue,vimCtrlChar,vimEcho,vimEchoHL,vimExecute,vimIf,vimIsCommand,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimGlobal,vimHighlight,vimIsCommand,vimLet,vimLineComment,vimMap,vimMark,vimNorm,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSet,vimSpecFile,vimString,vimSubst,vimSynLine,vimUnmap,vimUserCommand
|
||||
syn cluster vimFuncBodyList contains=vimAbb,vimAddress,vimAugroupKey,vimAutoCmd,vimCmplxRepeat,vimComment,vimContinue,vimCtrlChar,vimEcho,vimEchoHL,vimExecute,vimIf,vimIsCommand,vimFBVar,vimFunc,vimFunction,vimFuncVar,vimGlobal,vimHighlight,vimIsCommand,vimLet,vimLineComment,vimMap,vimMark,vimNorm,vimNotation,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegion,vimRegister,vimSet,vimSpecFile,vimString,vimSubst,vimSynLine,vimUnmap,vimUserCommand
|
||||
syn match vimFunction "\<fu\%[nction]!\=\s\+\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)*\ze\s*(" contains=@vimFuncList nextgroup=vimFuncBody
|
||||
|
||||
if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f'
|
||||
|
||||
@@ -6166,6 +6166,9 @@ insertchar(
|
||||
&& (!has_mbyte || MB_BYTE2LEN_CHECK(c) == 1)
|
||||
#endif
|
||||
&& i < INPUT_BUFLEN
|
||||
# ifdef FEAT_FKMAP
|
||||
&& !(p_fkmap && KeyTyped) /* Farsi mode mapping moves cursor */
|
||||
# endif
|
||||
&& (textwidth == 0
|
||||
|| (virtcol += byte2cells(buf[i - 1])) < (colnr_T)textwidth)
|
||||
&& !(!no_abbr && !vim_iswordc(c) && vim_iswordc(buf[i - 1])))
|
||||
@@ -6174,10 +6177,6 @@ insertchar(
|
||||
c = vgetc();
|
||||
if (p_hkmap && KeyTyped)
|
||||
c = hkmap(c); /* Hebrew mode mapping */
|
||||
# ifdef FEAT_FKMAP
|
||||
if (p_fkmap && KeyTyped)
|
||||
c = fkmap(c); /* Farsi mode mapping */
|
||||
# endif
|
||||
buf[i++] = c;
|
||||
#else
|
||||
buf[i++] = vgetc();
|
||||
|
||||
@@ -9240,11 +9240,11 @@ fill_assert_error(
|
||||
|
||||
if (opt_msg_tv->v_type != VAR_UNKNOWN)
|
||||
{
|
||||
ga_concat(gap, tv2string(opt_msg_tv, &tofree, numbuf, 0));
|
||||
ga_concat(gap, echo_string(opt_msg_tv, &tofree, numbuf, 0));
|
||||
vim_free(tofree);
|
||||
ga_concat(gap, (char_u *)": ");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (atype == ASSERT_MATCH || atype == ASSERT_NOTMATCH)
|
||||
ga_concat(gap, (char_u *)"Pattern ");
|
||||
else if (atype == ASSERT_NOTEQUAL)
|
||||
@@ -9269,7 +9269,6 @@ fill_assert_error(
|
||||
ga_concat_esc(gap, tv2string(got_tv, &tofree, numbuf, 0));
|
||||
vim_free(tofree);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -10136,9 +10136,7 @@ f_setpos(typval_T *argvars, typval_T *rettv)
|
||||
pos.col = 0;
|
||||
if (name[0] == '.' && name[1] == NUL)
|
||||
{
|
||||
/* set cursor */
|
||||
if (fnum == curbuf->b_fnum)
|
||||
{
|
||||
/* set cursor; "fnum" is ignored */
|
||||
curwin->w_cursor = pos;
|
||||
if (curswant >= 0)
|
||||
{
|
||||
@@ -10148,9 +10146,6 @@ f_setpos(typval_T *argvars, typval_T *rettv)
|
||||
check_cursor();
|
||||
rettv->vval.v_number = 0;
|
||||
}
|
||||
else
|
||||
EMSG(_(e_invarg));
|
||||
}
|
||||
else if (name[0] == '\'' && name[1] != NUL && name[2] == NUL)
|
||||
{
|
||||
/* set mark */
|
||||
|
||||
@@ -65,7 +65,8 @@
|
||||
#define ADDR_LOADED_BUFFERS 3
|
||||
#define ADDR_BUFFERS 4
|
||||
#define ADDR_TABS 5
|
||||
#define ADDR_QUICKFIX 6
|
||||
#define ADDR_TABS_RELATIVE 6 /* Tab page that only relative */
|
||||
#define ADDR_QUICKFIX 7
|
||||
#define ADDR_OTHER 99
|
||||
|
||||
#ifndef DO_DECLARE_EXCMD
|
||||
@@ -1425,9 +1426,9 @@ EX(CMD_tags, "tags", do_tags,
|
||||
ADDR_LINES),
|
||||
EX(CMD_tab, "tab", ex_wrongmodifier,
|
||||
NEEDARG|EXTRA|NOTRLCOM,
|
||||
ADDR_LINES),
|
||||
ADDR_TABS),
|
||||
EX(CMD_tabclose, "tabclose", ex_tabclose,
|
||||
RANGE|NOTADR|COUNT|BANG|TRLBAR|CMDWIN,
|
||||
BANG|RANGE|NOTADR|ZEROR|EXTRA|NOSPC|TRLBAR|CMDWIN,
|
||||
ADDR_TABS),
|
||||
EX(CMD_tabdo, "tabdo", ex_listdo,
|
||||
NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL,
|
||||
@@ -1440,34 +1441,34 @@ EX(CMD_tabfind, "tabfind", ex_splitview,
|
||||
ADDR_TABS),
|
||||
EX(CMD_tabfirst, "tabfirst", ex_tabnext,
|
||||
TRLBAR,
|
||||
ADDR_LINES),
|
||||
ADDR_TABS),
|
||||
EX(CMD_tabmove, "tabmove", ex_tabmove,
|
||||
RANGE|NOTADR|ZEROR|EXTRA|NOSPC|TRLBAR,
|
||||
ADDR_TABS),
|
||||
EX(CMD_tablast, "tablast", ex_tabnext,
|
||||
TRLBAR,
|
||||
ADDR_LINES),
|
||||
ADDR_TABS),
|
||||
EX(CMD_tabnext, "tabnext", ex_tabnext,
|
||||
RANGE|NOTADR|COUNT|TRLBAR,
|
||||
ADDR_LINES),
|
||||
RANGE|NOTADR|ZEROR|EXTRA|NOSPC|TRLBAR,
|
||||
ADDR_TABS),
|
||||
EX(CMD_tabnew, "tabnew", ex_splitview,
|
||||
BANG|FILE1|RANGE|NOTADR|ZEROR|EDITCMD|ARGOPT|TRLBAR,
|
||||
ADDR_TABS),
|
||||
EX(CMD_tabonly, "tabonly", ex_tabonly,
|
||||
BANG|RANGE|NOTADR|TRLBAR|CMDWIN,
|
||||
BANG|RANGE|NOTADR|ZEROR|EXTRA|NOSPC|TRLBAR|CMDWIN,
|
||||
ADDR_TABS),
|
||||
EX(CMD_tabprevious, "tabprevious", ex_tabnext,
|
||||
RANGE|NOTADR|COUNT|TRLBAR,
|
||||
ADDR_LINES),
|
||||
RANGE|NOTADR|ZEROR|EXTRA|NOSPC|TRLBAR,
|
||||
ADDR_TABS_RELATIVE),
|
||||
EX(CMD_tabNext, "tabNext", ex_tabnext,
|
||||
RANGE|NOTADR|COUNT|TRLBAR,
|
||||
ADDR_LINES),
|
||||
RANGE|NOTADR|ZEROR|EXTRA|NOSPC|TRLBAR,
|
||||
ADDR_TABS_RELATIVE),
|
||||
EX(CMD_tabrewind, "tabrewind", ex_tabnext,
|
||||
TRLBAR,
|
||||
ADDR_LINES),
|
||||
ADDR_TABS),
|
||||
EX(CMD_tabs, "tabs", ex_tabs,
|
||||
TRLBAR|CMDWIN,
|
||||
ADDR_LINES),
|
||||
ADDR_TABS),
|
||||
EX(CMD_tcl, "tcl", ex_tcl,
|
||||
RANGE|EXTRA|NEEDARG|CMDWIN,
|
||||
ADDR_LINES),
|
||||
|
||||
262
src/ex_docmd.c
262
src/ex_docmd.c
@@ -2162,8 +2162,7 @@ do_one_cmd(
|
||||
ea.line2 = curwin->w_cursor.lnum;
|
||||
break;
|
||||
case ADDR_WINDOWS:
|
||||
lnum = CURRENT_WIN_NR;
|
||||
ea.line2 = lnum;
|
||||
ea.line2 = CURRENT_WIN_NR;
|
||||
break;
|
||||
case ADDR_ARGUMENTS:
|
||||
ea.line2 = curwin->w_arg_idx + 1;
|
||||
@@ -2175,8 +2174,10 @@ do_one_cmd(
|
||||
ea.line2 = curbuf->b_fnum;
|
||||
break;
|
||||
case ADDR_TABS:
|
||||
lnum = CURRENT_TAB_NR;
|
||||
ea.line2 = lnum;
|
||||
ea.line2 = CURRENT_TAB_NR;
|
||||
break;
|
||||
case ADDR_TABS_RELATIVE:
|
||||
ea.line2 = 1;
|
||||
break;
|
||||
#ifdef FEAT_QUICKFIX
|
||||
case ADDR_QUICKFIX:
|
||||
@@ -2235,6 +2236,10 @@ do_one_cmd(
|
||||
goto doend;
|
||||
}
|
||||
break;
|
||||
case ADDR_TABS_RELATIVE:
|
||||
errormsg = (char_u *)_(e_invrange);
|
||||
goto doend;
|
||||
break;
|
||||
case ADDR_ARGUMENTS:
|
||||
if (ARGCOUNT == 0)
|
||||
ea.line1 = ea.line2 = 0;
|
||||
@@ -2710,6 +2715,9 @@ do_one_cmd(
|
||||
case ADDR_TABS:
|
||||
ea.line2 = LAST_TAB_NR;
|
||||
break;
|
||||
case ADDR_TABS_RELATIVE:
|
||||
ea.line2 = 1;
|
||||
break;
|
||||
case ADDR_ARGUMENTS:
|
||||
if (ARGCOUNT == 0)
|
||||
ea.line1 = ea.line2 = 0;
|
||||
@@ -2786,7 +2794,8 @@ do_one_cmd(
|
||||
/*
|
||||
* Be vi compatible: no error message for out of range.
|
||||
*/
|
||||
if (ea.line2 > curbuf->b_ml.ml_line_count)
|
||||
if (ea.addr_type == ADDR_LINES
|
||||
&& ea.line2 > curbuf->b_ml.ml_line_count)
|
||||
ea.line2 = curbuf->b_ml.ml_line_count;
|
||||
}
|
||||
}
|
||||
@@ -4427,6 +4436,11 @@ get_address(
|
||||
case ADDR_TABS:
|
||||
lnum = CURRENT_TAB_NR;
|
||||
break;
|
||||
case ADDR_TABS_RELATIVE:
|
||||
EMSG(_(e_invrange));
|
||||
cmd = NULL;
|
||||
goto error;
|
||||
break;
|
||||
#ifdef FEAT_QUICKFIX
|
||||
case ADDR_QUICKFIX:
|
||||
lnum = qf_get_cur_valid_idx(eap);
|
||||
@@ -4464,6 +4478,11 @@ get_address(
|
||||
case ADDR_TABS:
|
||||
lnum = LAST_TAB_NR;
|
||||
break;
|
||||
case ADDR_TABS_RELATIVE:
|
||||
EMSG(_(e_invrange));
|
||||
cmd = NULL;
|
||||
goto error;
|
||||
break;
|
||||
#ifdef FEAT_QUICKFIX
|
||||
case ADDR_QUICKFIX:
|
||||
lnum = qf_get_size(eap);
|
||||
@@ -4646,6 +4665,9 @@ get_address(
|
||||
case ADDR_TABS:
|
||||
lnum = CURRENT_TAB_NR;
|
||||
break;
|
||||
case ADDR_TABS_RELATIVE:
|
||||
lnum = 1;
|
||||
break;
|
||||
#ifdef FEAT_QUICKFIX
|
||||
case ADDR_QUICKFIX:
|
||||
lnum = qf_get_cur_valid_idx(eap);
|
||||
@@ -4662,7 +4684,14 @@ get_address(
|
||||
n = 1;
|
||||
else
|
||||
n = getdigits(&cmd);
|
||||
if (addr_type == ADDR_LOADED_BUFFERS
|
||||
|
||||
if (addr_type == ADDR_TABS_RELATIVE)
|
||||
{
|
||||
EMSG(_(e_invrange));
|
||||
cmd = NULL;
|
||||
goto error;
|
||||
}
|
||||
else if (addr_type == ADDR_LOADED_BUFFERS
|
||||
|| addr_type == ADDR_BUFFERS)
|
||||
lnum = compute_buffer_local_count(
|
||||
addr_type, lnum, (i == '-') ? -1 * n : n);
|
||||
@@ -4795,6 +4824,9 @@ invalid_range(exarg_T *eap)
|
||||
if (eap->line2 > LAST_TAB_NR)
|
||||
return (char_u *)_(e_invrange);
|
||||
break;
|
||||
case ADDR_TABS_RELATIVE:
|
||||
/* Do nothing */
|
||||
break;
|
||||
#ifdef FEAT_QUICKFIX
|
||||
case ADDR_QUICKFIX:
|
||||
if (eap->line2 != 1 && eap->line2 > qf_get_size(eap))
|
||||
@@ -7436,6 +7468,104 @@ ex_win_close(
|
||||
win_close_othertab(win, !need_hide && !P_HID(buf), tp);
|
||||
}
|
||||
|
||||
/*
|
||||
* Handle the argument for a tabpage related ex command.
|
||||
* Returns a tabpage number.
|
||||
* When an error is encountered then eap->errmsg is set.
|
||||
*/
|
||||
static int
|
||||
get_tabpage_arg(exarg_T *eap)
|
||||
{
|
||||
int tab_number;
|
||||
int unaccept_arg0 = (eap->cmdidx == CMD_tabmove) ? 0 : 1;
|
||||
|
||||
if (eap->arg && *eap->arg != NUL)
|
||||
{
|
||||
char_u *p = eap->arg;
|
||||
char_u *p_save;
|
||||
int relative = 0; /* argument +N/-N means: go to N places to the
|
||||
* right/left relative to the current position. */
|
||||
|
||||
if (*p == '-')
|
||||
{
|
||||
relative = -1;
|
||||
p++;
|
||||
}
|
||||
else if (*p == '+')
|
||||
{
|
||||
relative = 1;
|
||||
p++;
|
||||
}
|
||||
|
||||
p_save = p;
|
||||
tab_number = getdigits(&p);
|
||||
|
||||
if (relative == 0)
|
||||
{
|
||||
if (STRCMP(p, "$") == 0)
|
||||
tab_number = LAST_TAB_NR;
|
||||
else if (p == p_save || *p_save == '-' || *p != NUL
|
||||
|| tab_number > LAST_TAB_NR)
|
||||
{
|
||||
/* No numbers as argument. */
|
||||
eap->errmsg = e_invarg;
|
||||
goto theend;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (*p_save == NUL)
|
||||
tab_number = 1;
|
||||
else if (p == p_save || *p_save == '-' || *p != NUL
|
||||
|| tab_number == 0)
|
||||
{
|
||||
/* No numbers as argument. */
|
||||
eap->errmsg = e_invarg;
|
||||
goto theend;
|
||||
}
|
||||
tab_number = tab_number * relative + tabpage_index(curtab);
|
||||
if (!unaccept_arg0 && relative == -1)
|
||||
--tab_number;
|
||||
}
|
||||
if (tab_number < unaccept_arg0 || tab_number > LAST_TAB_NR)
|
||||
eap->errmsg = e_invarg;
|
||||
}
|
||||
else if (eap->addr_count > 0)
|
||||
{
|
||||
if (unaccept_arg0 && eap->line2 == 0)
|
||||
eap->errmsg = e_invrange;
|
||||
else
|
||||
{
|
||||
tab_number = eap->line2;
|
||||
if (!unaccept_arg0 && **eap->cmdlinep == '-')
|
||||
{
|
||||
--tab_number;
|
||||
if (tab_number < unaccept_arg0)
|
||||
eap->errmsg = e_invarg;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (eap->cmdidx)
|
||||
{
|
||||
case CMD_tabnext:
|
||||
tab_number = tabpage_index(curtab) + 1;
|
||||
if (tab_number > LAST_TAB_NR)
|
||||
tab_number = 1;
|
||||
break;
|
||||
case CMD_tabmove:
|
||||
tab_number = LAST_TAB_NR;
|
||||
break;
|
||||
default:
|
||||
tab_number = tabpage_index(curtab);
|
||||
}
|
||||
}
|
||||
|
||||
theend:
|
||||
return tab_number;
|
||||
}
|
||||
|
||||
/*
|
||||
* ":tabclose": close current tab page, unless it is the last one.
|
||||
* ":tabclose N": close tab page N.
|
||||
@@ -7444,6 +7574,7 @@ ex_win_close(
|
||||
ex_tabclose(exarg_T *eap)
|
||||
{
|
||||
tabpage_T *tp;
|
||||
int tab_number;
|
||||
|
||||
# ifdef FEAT_CMDWIN
|
||||
if (cmdwin_type != 0)
|
||||
@@ -7454,9 +7585,10 @@ ex_tabclose(exarg_T *eap)
|
||||
EMSG(_("E784: Cannot close last tab page"));
|
||||
else
|
||||
{
|
||||
if (eap->addr_count > 0)
|
||||
tab_number = get_tabpage_arg(eap);
|
||||
if (eap->errmsg == NULL)
|
||||
{
|
||||
tp = find_tabpage((int)eap->line2);
|
||||
tp = find_tabpage(tab_number);
|
||||
if (tp == NULL)
|
||||
{
|
||||
beep_flush();
|
||||
@@ -7467,14 +7599,14 @@ ex_tabclose(exarg_T *eap)
|
||||
tabpage_close_other(tp, eap->forceit);
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (!text_locked()
|
||||
else if (!text_locked()
|
||||
#ifdef FEAT_AUTOCMD
|
||||
&& !curbuf_locked()
|
||||
#endif
|
||||
)
|
||||
tabpage_close(eap->forceit);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -7485,6 +7617,7 @@ ex_tabonly(exarg_T *eap)
|
||||
{
|
||||
tabpage_T *tp;
|
||||
int done;
|
||||
int tab_number;
|
||||
|
||||
# ifdef FEAT_CMDWIN
|
||||
if (cmdwin_type != 0)
|
||||
@@ -7495,10 +7628,12 @@ ex_tabonly(exarg_T *eap)
|
||||
MSG(_("Already only one tab page"));
|
||||
else
|
||||
{
|
||||
if (eap->addr_count > 0)
|
||||
goto_tabpage(eap->line2);
|
||||
/* Repeat this up to a 1000 times, because autocommands may mess
|
||||
* up the lists. */
|
||||
tab_number = get_tabpage_arg(eap);
|
||||
if (eap->errmsg == NULL)
|
||||
{
|
||||
goto_tabpage(tab_number);
|
||||
/* Repeat this up to a 1000 times, because autocommands may
|
||||
* mess up the lists. */
|
||||
for (done = 0; done < 1000; ++done)
|
||||
{
|
||||
FOR_ALL_TABPAGES(tp)
|
||||
@@ -7515,6 +7650,7 @@ ex_tabonly(exarg_T *eap)
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -8254,6 +8390,8 @@ tabpage_new(void)
|
||||
static void
|
||||
ex_tabnext(exarg_T *eap)
|
||||
{
|
||||
int tab_number;
|
||||
|
||||
switch (eap->cmdidx)
|
||||
{
|
||||
case CMD_tabfirst:
|
||||
@@ -8265,10 +8403,40 @@ ex_tabnext(exarg_T *eap)
|
||||
break;
|
||||
case CMD_tabprevious:
|
||||
case CMD_tabNext:
|
||||
goto_tabpage(eap->addr_count == 0 ? -1 : -(int)eap->line2);
|
||||
if (eap->arg && *eap->arg != NUL)
|
||||
{
|
||||
char_u *p = eap->arg;
|
||||
char_u *p_save = p;
|
||||
|
||||
tab_number = getdigits(&p);
|
||||
if (p == p_save || *p_save == '-' || *p != NUL
|
||||
|| tab_number == 0)
|
||||
{
|
||||
/* No numbers as argument. */
|
||||
eap->errmsg = e_invarg;
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (eap->addr_count == 0)
|
||||
tab_number = 1;
|
||||
else
|
||||
{
|
||||
tab_number = eap->line2;
|
||||
if (tab_number < 1)
|
||||
{
|
||||
eap->errmsg = e_invrange;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
goto_tabpage(-tab_number);
|
||||
break;
|
||||
default: /* CMD_tabnext */
|
||||
goto_tabpage(eap->addr_count == 0 ? 0 : (int)eap->line2);
|
||||
tab_number = get_tabpage_arg(eap);
|
||||
if (eap->errmsg == NULL)
|
||||
goto_tabpage(tab_number);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -8281,58 +8449,8 @@ ex_tabmove(exarg_T *eap)
|
||||
{
|
||||
int tab_number;
|
||||
|
||||
if (eap->arg && *eap->arg != NUL)
|
||||
{
|
||||
char_u *p = eap->arg;
|
||||
int relative = 0; /* argument +N/-N means: move N places to the
|
||||
* right/left relative to the current position. */
|
||||
|
||||
if (*eap->arg == '-')
|
||||
{
|
||||
relative = -1;
|
||||
p = eap->arg + 1;
|
||||
}
|
||||
else if (*eap->arg == '+')
|
||||
{
|
||||
relative = 1;
|
||||
p = eap->arg + 1;
|
||||
}
|
||||
else
|
||||
p = eap->arg;
|
||||
|
||||
if (relative == 0)
|
||||
{
|
||||
if (STRCMP(p, "$") == 0)
|
||||
tab_number = LAST_TAB_NR;
|
||||
else if (p == skipdigits(p))
|
||||
{
|
||||
/* No numbers as argument. */
|
||||
eap->errmsg = e_invarg;
|
||||
return;
|
||||
}
|
||||
else
|
||||
tab_number = getdigits(&p);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (*p != NUL)
|
||||
tab_number = getdigits(&p);
|
||||
else
|
||||
tab_number = 1;
|
||||
tab_number = tab_number * relative + tabpage_index(curtab);
|
||||
if (relative == -1)
|
||||
--tab_number;
|
||||
}
|
||||
}
|
||||
else if (eap->addr_count != 0)
|
||||
{
|
||||
tab_number = eap->line2;
|
||||
if (**eap->cmdlinep == '-')
|
||||
--tab_number;
|
||||
}
|
||||
else
|
||||
tab_number = LAST_TAB_NR;
|
||||
|
||||
tab_number = get_tabpage_arg(eap);
|
||||
if (eap->errmsg == NULL)
|
||||
tabpage_move(tab_number);
|
||||
}
|
||||
|
||||
@@ -11197,8 +11315,10 @@ makeopens(
|
||||
* resized when moving between windows.
|
||||
* Do this before restoring the view, so that the topline and the
|
||||
* cursor can be set. This is done again below.
|
||||
* winminheight and winminwidth need to be set to avoid an error if the
|
||||
* user has set winheight or winwidth.
|
||||
*/
|
||||
if (put_line(fd, "set winheight=1 winwidth=1") == FAIL)
|
||||
if (put_line(fd, "set winminheight=1 winheight=1 winminwidth=1 winwidth=1") == FAIL)
|
||||
return FAIL;
|
||||
if (nr > 1 && ses_winsizes(fd, restore_size, tab_firstwin) == FAIL)
|
||||
return FAIL;
|
||||
@@ -11268,6 +11388,10 @@ makeopens(
|
||||
if (fprintf(fd, "set winheight=%ld winwidth=%ld shortmess=%s",
|
||||
p_wh, p_wiw, p_shm) < 0 || put_eol(fd) == FAIL)
|
||||
return FAIL;
|
||||
/* Re-apply 'winminheight' and 'winminwidth'. */
|
||||
if (fprintf(fd, "set winminheight=%ld winminwidth=%ld",
|
||||
p_wmh, p_wmw) < 0 || put_eol(fd) == FAIL)
|
||||
return FAIL;
|
||||
|
||||
/*
|
||||
* Lastly, execute the x.vim file if it exists.
|
||||
|
||||
122
src/farsi.c
122
src/farsi.c
@@ -15,30 +15,11 @@
|
||||
|
||||
#if defined(FEAT_FKMAP) || defined(PROTO)
|
||||
|
||||
static int toF_Xor_X_(int c);
|
||||
static int F_is_TyE(int c);
|
||||
static int F_is_TyC_TyD(int c);
|
||||
static int F_is_TyB_TyC_TyD(int src, int offset);
|
||||
static int toF_TyB(int c);
|
||||
static void put_curr_and_l_to_X(int c);
|
||||
static void put_and_redo(int c);
|
||||
static void chg_c_toX_orX(void);
|
||||
static void chg_c_to_X_orX_(void);
|
||||
static void chg_c_to_X_or_X(void);
|
||||
static void chg_l_to_X_orX_(void);
|
||||
static void chg_l_toXor_X(void);
|
||||
static void chg_r_to_Xor_X_(void);
|
||||
static int toF_leading(int c);
|
||||
static int toF_Rjoin(int c);
|
||||
static int canF_Ljoin(int c);
|
||||
static int canF_Rjoin(int c);
|
||||
static int F_isterm(int c);
|
||||
static int toF_ending(int c);
|
||||
static void lrswapbuf(char_u *buf, int len);
|
||||
|
||||
/*
|
||||
* Convert the given Farsi character into a _X or _X_ type
|
||||
*/
|
||||
*/
|
||||
static int
|
||||
toF_Xor_X_(int c)
|
||||
{
|
||||
@@ -105,7 +86,7 @@ toF_Xor_X_(int c)
|
||||
|
||||
/*
|
||||
* Convert the given Farsi character into Farsi capital character.
|
||||
*/
|
||||
*/
|
||||
static int
|
||||
toF_TyA(int c)
|
||||
{
|
||||
@@ -156,7 +137,7 @@ toF_TyA(int c)
|
||||
* Is the character under the cursor+offset in the given buffer a join type.
|
||||
* That is a character that is combined with the others.
|
||||
* Note: the offset is used only for command line buffer.
|
||||
*/
|
||||
*/
|
||||
static int
|
||||
F_is_TyB_TyC_TyD(int src, int offset)
|
||||
{
|
||||
@@ -207,7 +188,7 @@ F_is_TyB_TyC_TyD(int src, int offset)
|
||||
|
||||
/*
|
||||
* Is the Farsi character one of the terminating only type.
|
||||
*/
|
||||
*/
|
||||
static int
|
||||
F_is_TyE(int c)
|
||||
{
|
||||
@@ -230,7 +211,7 @@ F_is_TyE(int c)
|
||||
|
||||
/*
|
||||
* Is the Farsi character one of the none leading type.
|
||||
*/
|
||||
*/
|
||||
static int
|
||||
F_is_TyC_TyD(int c)
|
||||
{
|
||||
@@ -254,7 +235,7 @@ F_is_TyC_TyD(int c)
|
||||
|
||||
/*
|
||||
* Convert a none leading Farsi char into a leading type.
|
||||
*/
|
||||
*/
|
||||
static int
|
||||
toF_TyB(int c)
|
||||
{
|
||||
@@ -275,9 +256,18 @@ toF_TyB(int c)
|
||||
return c;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
put_and_redo(int c)
|
||||
{
|
||||
pchar_cursor(c);
|
||||
AppendCharToRedobuff(K_BS);
|
||||
AppendCharToRedobuff(c);
|
||||
}
|
||||
|
||||
/*
|
||||
* Overwrite the current redo and cursor characters + left adjust.
|
||||
*/
|
||||
*/
|
||||
static void
|
||||
put_curr_and_l_to_X(int c)
|
||||
{
|
||||
@@ -312,17 +302,9 @@ put_curr_and_l_to_X(int c)
|
||||
put_and_redo(c);
|
||||
}
|
||||
|
||||
static void
|
||||
put_and_redo(int c)
|
||||
{
|
||||
pchar_cursor(c);
|
||||
AppendCharToRedobuff(K_BS);
|
||||
AppendCharToRedobuff(c);
|
||||
}
|
||||
|
||||
/*
|
||||
* Change the char. under the cursor to a X_ or X type
|
||||
*/
|
||||
*/
|
||||
static void
|
||||
chg_c_toX_orX(void)
|
||||
{
|
||||
@@ -446,8 +428,7 @@ chg_c_toX_orX(void)
|
||||
|
||||
/*
|
||||
* Change the char. under the cursor to a _X_ or X_ type
|
||||
*/
|
||||
|
||||
*/
|
||||
static void
|
||||
chg_c_to_X_orX_(void)
|
||||
{
|
||||
@@ -498,9 +479,9 @@ chg_c_to_X_orX_(void)
|
||||
|
||||
/*
|
||||
* Change the char. under the cursor to a _X_ or _X type
|
||||
*/
|
||||
*/
|
||||
static void
|
||||
chg_c_to_X_or_X (void)
|
||||
chg_c_to_X_or_X(void)
|
||||
{
|
||||
int tempc;
|
||||
|
||||
@@ -529,7 +510,7 @@ chg_c_to_X_or_X (void)
|
||||
|
||||
/*
|
||||
* Change the character left to the cursor to a _X_ or X_ type
|
||||
*/
|
||||
*/
|
||||
static void
|
||||
chg_l_to_X_orX_(void)
|
||||
{
|
||||
@@ -597,10 +578,9 @@ chg_l_to_X_orX_(void)
|
||||
|
||||
/*
|
||||
* Change the character left to the cursor to a X or _X type
|
||||
*/
|
||||
|
||||
*/
|
||||
static void
|
||||
chg_l_toXor_X (void)
|
||||
chg_l_toXor_X(void)
|
||||
{
|
||||
int tempc;
|
||||
|
||||
@@ -666,8 +646,7 @@ chg_l_toXor_X (void)
|
||||
|
||||
/*
|
||||
* Change the character right to the cursor to a _X or _X_ type
|
||||
*/
|
||||
|
||||
*/
|
||||
static void
|
||||
chg_r_to_Xor_X_(void)
|
||||
{
|
||||
@@ -691,20 +670,23 @@ chg_r_to_Xor_X_(void)
|
||||
|
||||
/*
|
||||
* Map Farsi keyboard when in fkmap mode.
|
||||
*/
|
||||
|
||||
*/
|
||||
int
|
||||
fkmap(int c)
|
||||
{
|
||||
int tempc;
|
||||
static int revins;
|
||||
int insert_mode = (State & INSERT);
|
||||
static int revins = 0;
|
||||
|
||||
if (IS_SPECIAL(c))
|
||||
return c;
|
||||
|
||||
if (insert_mode)
|
||||
{
|
||||
if (VIM_ISDIGIT(c) || ((c == '.' || c == '+' || c == '-' ||
|
||||
c == '^' || c == '%' || c == '#' || c == '=') && revins))
|
||||
{
|
||||
/* Numbers are entered left-to-right. */
|
||||
if (!revins)
|
||||
{
|
||||
if (curwin->w_cursor.col)
|
||||
@@ -727,12 +709,11 @@ fkmap(int c)
|
||||
inc_cursor();
|
||||
|
||||
++revins;
|
||||
p_ri=1;
|
||||
p_ri = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (revins)
|
||||
else if (revins)
|
||||
{
|
||||
/* Stop entering number. */
|
||||
arrow_used = TRUE;
|
||||
(void)stop_arrow();
|
||||
|
||||
@@ -773,14 +754,14 @@ fkmap(int c)
|
||||
if (!revins)
|
||||
{
|
||||
if (curwin->w_p_rl)
|
||||
p_ri=0;
|
||||
p_ri = 0;
|
||||
if (!curwin->w_p_rl)
|
||||
p_ri=1;
|
||||
p_ri = 1;
|
||||
}
|
||||
|
||||
if ((c < 0x100) && (isalpha(c) || c == '&' || c == '^' || c == ';' ||
|
||||
c == '\''|| c == ',' || c == '[' ||
|
||||
c == ']' || c == '{' || c == '}' ))
|
||||
c == ']' || c == '{' || c == '}'))
|
||||
chg_r_to_Xor_X_();
|
||||
|
||||
tempc = 0;
|
||||
@@ -844,13 +825,12 @@ fkmap(int c)
|
||||
case NL:
|
||||
case TAB:
|
||||
|
||||
if (p_ri && c == NL && curwin->w_cursor.col)
|
||||
if (p_ri && c == NL && curwin->w_cursor.col && insert_mode)
|
||||
{
|
||||
/*
|
||||
* If the char before the cursor is _X_ or X_ do not change
|
||||
* the one under the cursor with X type.
|
||||
*/
|
||||
|
||||
dec_cursor();
|
||||
|
||||
if (F_isalpha(gchar_cursor()))
|
||||
@@ -920,6 +900,9 @@ fkmap(int c)
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (insert_mode)
|
||||
{
|
||||
if (!p_ri)
|
||||
dec_cursor();
|
||||
|
||||
@@ -1040,6 +1023,7 @@ fkmap(int c)
|
||||
|
||||
if (!p_ri)
|
||||
inc_cursor();
|
||||
}
|
||||
|
||||
tempc = 0;
|
||||
|
||||
@@ -1376,14 +1360,14 @@ fkmap(int c)
|
||||
break;
|
||||
}
|
||||
|
||||
if ((F_isalpha(tempc) || F_isdigit(tempc)))
|
||||
if (F_isalpha(tempc) || F_isdigit(tempc))
|
||||
{
|
||||
if (!curwin->w_cursor.col && STRLEN(ml_get_curline()))
|
||||
{
|
||||
if (!p_ri && !F_is_TyE(tempc))
|
||||
chg_c_to_X_orX_ ();
|
||||
chg_c_to_X_orX_();
|
||||
if (p_ri)
|
||||
chg_c_to_X_or_X ();
|
||||
chg_c_to_X_or_X();
|
||||
}
|
||||
|
||||
if (curwin->w_cursor.col)
|
||||
@@ -1392,9 +1376,9 @@ fkmap(int c)
|
||||
dec_cursor();
|
||||
|
||||
if (F_is_TyE(tempc))
|
||||
chg_l_toXor_X ();
|
||||
chg_l_toXor_X();
|
||||
else
|
||||
chg_l_to_X_orX_ ();
|
||||
chg_l_to_X_orX_();
|
||||
|
||||
if (!p_ri)
|
||||
inc_cursor();
|
||||
@@ -1407,7 +1391,7 @@ fkmap(int c)
|
||||
|
||||
/*
|
||||
* Convert a none leading Farsi char into a leading type.
|
||||
*/
|
||||
*/
|
||||
static int
|
||||
toF_leading(int c)
|
||||
{
|
||||
@@ -1461,7 +1445,7 @@ toF_leading(int c)
|
||||
|
||||
/*
|
||||
* Convert a given Farsi char into right joining type.
|
||||
*/
|
||||
*/
|
||||
static int
|
||||
toF_Rjoin(int c)
|
||||
{
|
||||
@@ -1517,7 +1501,7 @@ toF_Rjoin(int c)
|
||||
|
||||
/*
|
||||
* Can a given Farsi character join via its left edj.
|
||||
*/
|
||||
*/
|
||||
static int
|
||||
canF_Ljoin(int c)
|
||||
{
|
||||
@@ -1591,7 +1575,7 @@ canF_Ljoin(int c)
|
||||
|
||||
/*
|
||||
* Can a given Farsi character join via its right edj.
|
||||
*/
|
||||
*/
|
||||
static int
|
||||
canF_Rjoin(int c)
|
||||
{
|
||||
@@ -1619,7 +1603,7 @@ canF_Rjoin(int c)
|
||||
|
||||
/*
|
||||
* is a given Farsi character a terminating type.
|
||||
*/
|
||||
*/
|
||||
static int
|
||||
F_isterm(int c)
|
||||
{
|
||||
@@ -1646,7 +1630,7 @@ F_isterm(int c)
|
||||
|
||||
/*
|
||||
* Convert the given Farsi character into a ending type .
|
||||
*/
|
||||
*/
|
||||
static int
|
||||
toF_ending(int c)
|
||||
{
|
||||
@@ -1691,7 +1675,7 @@ toF_ending(int c)
|
||||
|
||||
/*
|
||||
* Convert the Farsi 3342 standard into Farsi VIM.
|
||||
*/
|
||||
*/
|
||||
static void
|
||||
conv_to_pvim(void)
|
||||
{
|
||||
|
||||
24
src/mark.c
24
src/mark.c
@@ -57,6 +57,7 @@ setmark(int c)
|
||||
setmark_pos(int c, pos_T *pos, int fnum)
|
||||
{
|
||||
int i;
|
||||
buf_T *buf;
|
||||
|
||||
/* Check for a special key (may cause islower() to crash). */
|
||||
if (c < 0)
|
||||
@@ -75,9 +76,13 @@ setmark_pos(int c, pos_T *pos, int fnum)
|
||||
return OK;
|
||||
}
|
||||
|
||||
buf = buflist_findnr(fnum);
|
||||
if (buf == NULL)
|
||||
return FAIL;
|
||||
|
||||
if (c == '"')
|
||||
{
|
||||
curbuf->b_last_cursor = *pos;
|
||||
buf->b_last_cursor = *pos;
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -85,31 +90,31 @@ setmark_pos(int c, pos_T *pos, int fnum)
|
||||
* file. */
|
||||
if (c == '[')
|
||||
{
|
||||
curbuf->b_op_start = *pos;
|
||||
buf->b_op_start = *pos;
|
||||
return OK;
|
||||
}
|
||||
if (c == ']')
|
||||
{
|
||||
curbuf->b_op_end = *pos;
|
||||
buf->b_op_end = *pos;
|
||||
return OK;
|
||||
}
|
||||
|
||||
if (c == '<' || c == '>')
|
||||
{
|
||||
if (c == '<')
|
||||
curbuf->b_visual.vi_start = *pos;
|
||||
buf->b_visual.vi_start = *pos;
|
||||
else
|
||||
curbuf->b_visual.vi_end = *pos;
|
||||
if (curbuf->b_visual.vi_mode == NUL)
|
||||
buf->b_visual.vi_end = *pos;
|
||||
if (buf->b_visual.vi_mode == NUL)
|
||||
/* Visual_mode has not yet been set, use a sane default. */
|
||||
curbuf->b_visual.vi_mode = 'v';
|
||||
buf->b_visual.vi_mode = 'v';
|
||||
return OK;
|
||||
}
|
||||
|
||||
if (ASCII_ISLOWER(c))
|
||||
{
|
||||
i = c - 'a';
|
||||
curbuf->b_namedm[i] = *pos;
|
||||
buf->b_namedm[i] = *pos;
|
||||
return OK;
|
||||
}
|
||||
if (ASCII_ISUPPER(c) || VIM_ISDIGIT(c))
|
||||
@@ -396,7 +401,8 @@ getmark_buf_fnum(
|
||||
{
|
||||
startp = &buf->b_visual.vi_start;
|
||||
endp = &buf->b_visual.vi_end;
|
||||
if ((c == '<') == lt(*startp, *endp))
|
||||
if (((c == '<') == lt(*startp, *endp) || endp->lnum == 0)
|
||||
&& startp->lnum != 0)
|
||||
posp = startp;
|
||||
else
|
||||
posp = endp;
|
||||
|
||||
@@ -2894,7 +2894,8 @@ msgstr "-X\t\t\t不连接到 X Server"
|
||||
msgid "--remote <files>\tEdit <files> in a Vim server if possible"
|
||||
msgstr "--remote <files>\t如有可能,在 Vim 服务器上编辑文件 <files>"
|
||||
|
||||
msgid "--remote-silent <files> Same, don't complain if there is no server"
|
||||
msgid ""
|
||||
"--remote-silent <files> Same, don't complain if there is no server"
|
||||
msgstr "--remote-silent <files> 同上,找不到服务器时不抱怨"
|
||||
|
||||
msgid ""
|
||||
|
||||
@@ -241,9 +241,8 @@ msgstr "
|
||||
msgid " Tag completion (^]^N^P)"
|
||||
msgstr " Tag <20><>ȫ (^]^N^P)"
|
||||
|
||||
#, fuzzy
|
||||
#~ msgid " Path pattern completion (^N^P)"
|
||||
#~ msgstr " ·<><C2B7>ģʽ<C4A3><CABD>ȫ (^N^P)"
|
||||
msgid " Path pattern completion (^N^P)"
|
||||
msgstr " ͷ<>ļ<EFBFBD>ģʽ<C4A3><CABD>ȫ (^N^P)"
|
||||
|
||||
msgid " Definition completion (^D^N^P)"
|
||||
msgstr " <20><><EFBFBD>岹ȫ (^D^N^P)"
|
||||
@@ -2896,7 +2895,7 @@ msgid "--remote <files>\tEdit <files> in a Vim server if possible"
|
||||
msgstr "--remote <files>\t<><74><EFBFBD>п<EFBFBD><D0BF>ܣ<EFBFBD><DCA3><EFBFBD> Vim <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϱ༭<CFB1>ļ<EFBFBD> <files>"
|
||||
|
||||
msgid "--remote-silent <files> Same, don't complain if there is no server"
|
||||
msgstr "--remote-silent <files> ͬ<>ϣ<EFBFBD><CFA3>Ҳ<EFBFBD><D2B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>Թ"
|
||||
msgstr "--remote-silent <files> ͬ<>ϣ<EFBFBD><CFA3>Ҳ<EFBFBD><D2B2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD>Թ"
|
||||
|
||||
msgid ""
|
||||
"--remote-wait <files> As --remote but wait for files to have been edited"
|
||||
@@ -5284,7 +5283,7 @@ msgstr "Vim:
|
||||
|
||||
#. must display the prompt
|
||||
msgid "No undo possible; continue anyway"
|
||||
msgstr "<22><EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
msgstr "<22><EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
|
||||
msgid "Already at oldest change"
|
||||
msgstr "<22><>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD>ɵĸı<C4B8>"
|
||||
@@ -5601,13 +5600,13 @@ msgid "type :help cp-default<Enter> for info on this"
|
||||
msgstr "<22><><EFBFBD><EFBFBD> :help cp-default<Enter> <20>鿴<EFBFBD><E9BFB4><EFBFBD><EFBFBD>˵<EFBFBD><CBB5> "
|
||||
|
||||
msgid "menu Help->Orphans for information "
|
||||
msgstr "<22>˵<EFBFBD> Help->Orphans <20>鿴˵<E9BFB4><CBB5> "
|
||||
msgstr "<22>˵<EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD>-><3E>¶<EFBFBD> <20>鿴˵<E9BFB4><CBB5> "
|
||||
|
||||
msgid "Running modeless, typed text is inserted"
|
||||
msgstr "<22><>ģʽ<C4A3><CABD><EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ּ<EFBFBD><D6BC><EFBFBD><EFBFBD><EFBFBD>"
|
||||
|
||||
msgid "menu Edit->Global Settings->Toggle Insert Mode "
|
||||
msgstr "<22>˵<EFBFBD> Edit->Global Settings->Toggle Insert Mode "
|
||||
msgstr "<22>˵<EFBFBD> <EFBFBD>༭->ȫ<><C8AB><EFBFBD>趨-><3E><>/<2F>ز<EFBFBD><D8B2><EFBFBD>ģʽ "
|
||||
|
||||
#, fuzzy
|
||||
#~ msgid " for two modes "
|
||||
|
||||
@@ -121,6 +121,12 @@ func Test_assert_inrange()
|
||||
call assert_fails('call assert_inrange(1, 1)', 'E119:')
|
||||
endfunc
|
||||
|
||||
func Test_assert_with_msg()
|
||||
call assert_equal('foo', 'bar', 'testing')
|
||||
call assert_match("testing: Expected 'foo' but got 'bar'", v:errors[0])
|
||||
call remove(v:errors, 0)
|
||||
endfunc
|
||||
|
||||
func Test_user_is_happy()
|
||||
smile
|
||||
sleep 300m
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
" Simplistic testing of Farsi mode.
|
||||
" Note: must be edited with latin1 encoding.
|
||||
|
||||
if !has('farsi')
|
||||
finish
|
||||
@@ -82,3 +83,51 @@ func Test_farsi_map()
|
||||
set noaltkeymap
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_input_farsi()
|
||||
new
|
||||
setlocal rightleft fkmap
|
||||
" numbers switch input direction
|
||||
call feedkeys("aabc0123456789.+-^%#=xyz\<Esc>", 'tx')
|
||||
call assert_equal("\x8c<38>ν<EFBFBD><CEBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\x93<39>", getline('.'))
|
||||
|
||||
" all non-number special chars with spaces
|
||||
call feedkeys("oB E F H I K L M O P Q R T U W Y ` ! @ # $ % ^ & * () - _ = + \\ | : \" . / < > ? \<Esc>", 'tx')
|
||||
call assert_equal("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> [<5B>]<5D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F1A0A2A0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>蠨<EFBFBD><E8A0A8><EFBFBD><EFBFBD>頽<EFBFBD><E9A0BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EAA0BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", getline('.'))
|
||||
|
||||
" all non-number special chars without spaces
|
||||
call feedkeys("oBEFHIKLMOPQRTUWY`!@#$%^&*()-_=+\\|:\"./<>?\<Esc>",'tx')
|
||||
call assert_equal("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>[]<5D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F1A2A3A7><EFBFBD><EFBFBD><EFBFBD>訩<EFBFBD>齫<EFBFBD>꺻<EFBFBD><EABABB><EFBFBD><EFBFBD><EFBFBD>", getline('.'))
|
||||
|
||||
" all letter chars with spaces
|
||||
call feedkeys("oa A b c C d D e f g G h i j J k l m n N o p q r s S t u v V w x X y z Z ; \ , [ ] \<Esc>", 'tx')
|
||||
call assert_equal("Ѡ<><D1A0>̠ΠϠ<CEA0><CFA0><EFBFBD><EFBFBD>Ơàܠ<C3A0><DCA0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Š<EFBFBD><C5A0>ޠݠĠˠˠʠɠӠ٠Р<D9A0><D0A0>ؠ֠͠͠ҠԠԠנՠ<D7A0><D5A0>ڠ<EFBFBD>ߠǠȠ", getline('.'))
|
||||
|
||||
" all letter chars without spaces
|
||||
call feedkeys("oaAbcCdDefgGhijJklmnNopqrsStuvVwxXyzZ;\,[]\<Esc>", 'tx')
|
||||
call assert_equal("\x8c<38><63><EFBFBD><EFBFBD>\x9f<39>\x86\x83<38><33><EFBFBD>\x9d\x85\x80\x9c\x9b\x84<38><34>\x8a\x89\x8e\x96\x8b<38>\x95\x90<39><30>\x8d<38><64>\x93<39><33>\x97<39>\x87\x88", getline('.'))
|
||||
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_command_line_farsi()
|
||||
set allowrevins altkeymap
|
||||
|
||||
" letter characters with spaces
|
||||
call feedkeys(":\"\<C-_>a A b c C d D e f g G h i j J k l m n N o p q r s S t u v V w x X y z Z ; \\ , [ ]\<CR>", 'tx')
|
||||
call assert_equal("\"\x88<38>Ǡߠ<C7A0><DFA0>ڠՠՠנԠԠҠ֠͠͠ؠ<D6A0><D8A0>Р٠ӠɠʠˠˠĠݠޠ<DDA0><DEA0>Š<EFBFBD><C5A0><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܠàƠ<C3A0><C6A0><EFBFBD><EFBFBD>ϠΠ̠<CEA0><CCA0><EFBFBD>", getreg(':'))
|
||||
|
||||
" letter characters without spaces
|
||||
call feedkeys(":\"\<C-_>aAbcCdDefgGhijJklmnNopqrsStuvVwxXyzZ;\\,[]\<CR>", 'tx')
|
||||
call assert_equal("\"\x88\x87<38><37><EFBFBD><EFBFBD><EFBFBD>\x93<39><33>\x8d<38><64>\x90\x95<39>\x8b\x96\x8e\x89\x8a<38><61>\x84\x9b\x9c\x80\x85\x9d<39><64><EFBFBD>\x83\x86<38>\x9f<39><66><EFBFBD><EFBFBD>\x8c", getreg(':'))
|
||||
|
||||
" other characters with spaces
|
||||
call feedkeys(":\"\<C-_>0 1 2 3 4 5 6 7 8 9 ` . ! \" $ % ^ & / () = \\ ? + - _ * : # ~ @ < > { } | B E F H I K L M O P Q R T U W Y\<CR>", 'tx')
|
||||
call assert_equal("\"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>]<5D>[<5B> <EFBFBD><C2A0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>}<7D>{<7B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>~<7E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>頭<EFBFBD><E9A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>렽<EFBFBD><EBA0BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", getreg(':'))
|
||||
|
||||
" other characters without spaces
|
||||
call feedkeys(":\"\<C-_>0123456789`.!\"$%^&/()=\\?+-_*:#~@<>{}|BEFHIKLMOPQRTUWY\<CR>", 'tx')
|
||||
call assert_equal("\"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>][<5B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>}{<7B><><EFBFBD>~<7E><><EFBFBD>魫<EFBFBD>뽩<EFBFBD><EBBDA9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", getreg(':'))
|
||||
|
||||
set noallowrevins noaltkeymap
|
||||
endfunc
|
||||
|
||||
@@ -1,5 +1,78 @@
|
||||
" Tests for various functions.
|
||||
|
||||
func Test_empty()
|
||||
call assert_equal(1, empty(''))
|
||||
call assert_equal(0, empty('a'))
|
||||
|
||||
call assert_equal(1, empty(0))
|
||||
call assert_equal(1, empty(-0))
|
||||
call assert_equal(0, empty(1))
|
||||
call assert_equal(0, empty(-1))
|
||||
|
||||
call assert_equal(1, empty(0.0))
|
||||
call assert_equal(1, empty(-0.0))
|
||||
call assert_equal(0, empty(1.0))
|
||||
call assert_equal(0, empty(-1.0))
|
||||
call assert_equal(0, empty(1.0/0.0))
|
||||
call assert_equal(0, empty(0.0/0.0))
|
||||
|
||||
call assert_equal(1, empty([]))
|
||||
call assert_equal(0, empty(['a']))
|
||||
|
||||
call assert_equal(1, empty({}))
|
||||
call assert_equal(0, empty({'a':1}))
|
||||
|
||||
call assert_equal(1, empty(v:null))
|
||||
call assert_equal(1, empty(v:none))
|
||||
call assert_equal(1, empty(v:false))
|
||||
call assert_equal(0, empty(v:true))
|
||||
|
||||
call assert_equal(0, empty(function('Test_empty')))
|
||||
endfunc
|
||||
|
||||
func Test_len()
|
||||
call assert_equal(1, len(0))
|
||||
call assert_equal(2, len(12))
|
||||
|
||||
call assert_equal(0, len(''))
|
||||
call assert_equal(2, len('ab'))
|
||||
|
||||
call assert_equal(0, len([]))
|
||||
call assert_equal(2, len([2, 1]))
|
||||
|
||||
call assert_equal(0, len({}))
|
||||
call assert_equal(2, len({'a': 1, 'b': 2}))
|
||||
|
||||
call assert_fails('call len(v:none)', 'E701:')
|
||||
call assert_fails('call len({-> 0})', 'E701:')
|
||||
endfunc
|
||||
|
||||
func Test_max()
|
||||
call assert_equal(0, max([]))
|
||||
call assert_equal(2, max([2]))
|
||||
call assert_equal(2, max([1, 2]))
|
||||
call assert_equal(2, max([1, 2, v:null]))
|
||||
|
||||
call assert_equal(0, max({}))
|
||||
call assert_equal(2, max({'a':1, 'b':2}))
|
||||
|
||||
call assert_fails('call max(1)', 'E712:')
|
||||
call assert_fails('call max(v:none)', 'E712:')
|
||||
endfunc
|
||||
|
||||
func Test_min()
|
||||
call assert_equal(0, min([]))
|
||||
call assert_equal(2, min([2]))
|
||||
call assert_equal(1, min([1, 2]))
|
||||
call assert_equal(0, min([1, 2, v:null]))
|
||||
|
||||
call assert_equal(0, min({}))
|
||||
call assert_equal(1, min({'a':1, 'b':2}))
|
||||
|
||||
call assert_fails('call min(1)', 'E712:')
|
||||
call assert_fails('call min(v:none)', 'E712:')
|
||||
endfunc
|
||||
|
||||
func Test_str2nr()
|
||||
call assert_equal(0, str2nr(''))
|
||||
call assert_equal(1, str2nr('1'))
|
||||
@@ -15,6 +88,77 @@ func Test_str2nr()
|
||||
|
||||
call assert_equal(123456789, str2nr('123456789'))
|
||||
call assert_equal(-123456789, str2nr('-123456789'))
|
||||
|
||||
call assert_equal(5, str2nr('101', 2))
|
||||
call assert_equal(5, str2nr('0b101', 2))
|
||||
call assert_equal(5, str2nr('0B101', 2))
|
||||
call assert_equal(-5, str2nr('-101', 2))
|
||||
call assert_equal(-5, str2nr('-0b101', 2))
|
||||
call assert_equal(-5, str2nr('-0B101', 2))
|
||||
|
||||
call assert_equal(65, str2nr('101', 8))
|
||||
call assert_equal(65, str2nr('0101', 8))
|
||||
call assert_equal(-65, str2nr('-101', 8))
|
||||
call assert_equal(-65, str2nr('-0101', 8))
|
||||
|
||||
call assert_equal(11259375, str2nr('abcdef', 16))
|
||||
call assert_equal(11259375, str2nr('ABCDEF', 16))
|
||||
call assert_equal(-11259375, str2nr('-ABCDEF', 16))
|
||||
call assert_equal(11259375, str2nr('0xabcdef', 16))
|
||||
call assert_equal(11259375, str2nr('0Xabcdef', 16))
|
||||
call assert_equal(11259375, str2nr('0XABCDEF', 16))
|
||||
call assert_equal(-11259375, str2nr('-0xABCDEF', 16))
|
||||
|
||||
call assert_equal(0, str2nr('0x10'))
|
||||
call assert_equal(0, str2nr('0b10'))
|
||||
call assert_equal(1, str2nr('12', 2))
|
||||
call assert_equal(1, str2nr('18', 8))
|
||||
call assert_equal(1, str2nr('1g', 16))
|
||||
|
||||
call assert_equal(0, str2nr(v:null))
|
||||
call assert_equal(0, str2nr(v:none))
|
||||
|
||||
call assert_fails('call str2nr([])', 'E730:')
|
||||
call assert_fails('call str2nr({->2})', 'E729:')
|
||||
call assert_fails('call str2nr(1.2)', 'E806:')
|
||||
call assert_fails('call str2nr(10, [])', 'E474:')
|
||||
endfunc
|
||||
|
||||
func Test_strftime()
|
||||
if !exists('*strftime')
|
||||
return
|
||||
endif
|
||||
" Format of strftime() depends on system. We assume
|
||||
" that basic formats tested here are available and
|
||||
" identical on all systems which support strftime().
|
||||
"
|
||||
" The 2nd parameter of strftime() is a local time, so the output day
|
||||
" of strftime() can be 17 or 18, depending on timezone.
|
||||
call assert_match('^2017-01-1[78]$', strftime('%Y-%m-%d', 1484695512))
|
||||
"
|
||||
call assert_match('^\d\d\d\d-\(0\d\|1[012]\)-\([012]\d\|3[01]\) \([01]\d\|2[0-3]\):[0-5]\d:\([0-5]\d\|60\)$', strftime('%Y-%m-%d %H:%M:%S'))
|
||||
|
||||
call assert_fails('call strftime([])', 'E730:')
|
||||
call assert_fails('call strftime("%Y", [])', 'E745:')
|
||||
endfunc
|
||||
|
||||
func Test_simplify()
|
||||
call assert_equal('', simplify(''))
|
||||
call assert_equal('/', simplify('/'))
|
||||
call assert_equal('/', simplify('/.'))
|
||||
call assert_equal('/', simplify('/..'))
|
||||
call assert_equal('/...', simplify('/...'))
|
||||
call assert_equal('./dir/file', simplify('./dir/file'))
|
||||
call assert_equal('./dir/file', simplify('.///dir//file'))
|
||||
call assert_equal('./dir/file', simplify('./dir/./file'))
|
||||
call assert_equal('./file', simplify('./dir/../file'))
|
||||
call assert_equal('../dir/file', simplify('dir/../../dir/file'))
|
||||
call assert_equal('./file', simplify('dir/.././file'))
|
||||
|
||||
call assert_fails('call simplify({->0})', 'E729:')
|
||||
call assert_fails('call simplify([])', 'E730:')
|
||||
call assert_fails('call simplify({})', 'E731:')
|
||||
call assert_fails('call simplify(1.2)', 'E806:')
|
||||
endfunc
|
||||
|
||||
func Test_tolower()
|
||||
@@ -157,7 +301,7 @@ func Test_toupper()
|
||||
call assert_equal("YÝŶŸẎỲỶỸ", toupper("YÝŶŸẎỲỶỸ"))
|
||||
call assert_equal("ZŹŻŽƵẐẔ", toupper("ZŹŻŽƵẐẔ"))
|
||||
|
||||
call assert_equal("ⱥ ⱦ", tolower("Ⱥ Ⱦ"))
|
||||
call assert_equal("Ⱥ Ⱦ", toupper("ⱥ ⱦ"))
|
||||
endfunc
|
||||
|
||||
|
||||
|
||||
@@ -24,3 +24,47 @@ function! Test_Incr_Marks()
|
||||
call assert_equal("XXX 123 123", getline(3))
|
||||
enew!
|
||||
endfunction
|
||||
|
||||
func Test_setpos()
|
||||
new one
|
||||
let onebuf = bufnr('%')
|
||||
let onewin = win_getid()
|
||||
call setline(1, ['aaa', 'bbb', 'ccc'])
|
||||
new two
|
||||
let twobuf = bufnr('%')
|
||||
let twowin = win_getid()
|
||||
call setline(1, ['aaa', 'bbb', 'ccc'])
|
||||
|
||||
" for the cursor the buffer number is ignored
|
||||
call setpos(".", [0, 2, 1, 0])
|
||||
call assert_equal([0, 2, 1, 0], getpos("."))
|
||||
call setpos(".", [onebuf, 3, 3, 0])
|
||||
call assert_equal([0, 3, 3, 0], getpos("."))
|
||||
|
||||
call setpos("''", [0, 1, 3, 0])
|
||||
call assert_equal([0, 1, 3, 0], getpos("''"))
|
||||
call setpos("''", [onebuf, 2, 2, 0])
|
||||
call assert_equal([0, 2, 2, 0], getpos("''"))
|
||||
|
||||
" buffer-local marks
|
||||
for mark in ["'a", "'\"", "'[", "']", "'<", "'>"]
|
||||
call win_gotoid(twowin)
|
||||
call setpos(mark, [0, 2, 1, 0])
|
||||
call assert_equal([0, 2, 1, 0], getpos(mark), "for mark " . mark)
|
||||
call setpos(mark, [onebuf, 1, 3, 0])
|
||||
call win_gotoid(onewin)
|
||||
call assert_equal([0, 1, 3, 0], getpos(mark), "for mark " . mark)
|
||||
endfor
|
||||
|
||||
" global marks
|
||||
call win_gotoid(twowin)
|
||||
call setpos("'N", [0, 2, 1, 0])
|
||||
call assert_equal([twobuf, 2, 1, 0], getpos("'N"))
|
||||
call setpos("'N", [onebuf, 1, 3, 0])
|
||||
call assert_equal([onebuf, 1, 3, 0], getpos("'N"))
|
||||
|
||||
call win_gotoid(onewin)
|
||||
bwipe!
|
||||
call win_gotoid(twowin)
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
@@ -22,7 +22,7 @@ func Test_mksession()
|
||||
\ 'a<> <20> two multiByte characters',
|
||||
\ 'A<><41><EFBFBD> three mulTibyte characters'
|
||||
\ ])
|
||||
let tmpfile = tempname()
|
||||
let tmpfile = 'Xtemp'
|
||||
exec 'w! ' . tmpfile
|
||||
/^start:
|
||||
set wrap
|
||||
@@ -63,8 +63,8 @@ func Test_mksession()
|
||||
norm! j016|3zl
|
||||
split
|
||||
call wincol()
|
||||
mksession! test_mks.out
|
||||
let li = filter(readfile('test_mks.out'), 'v:val =~# "\\(^ *normal! 0\\|^ *exe ''normal!\\)"')
|
||||
mksession! Xtest_mks.out
|
||||
let li = filter(readfile('Xtest_mks.out'), 'v:val =~# "\\(^ *normal! 0\\|^ *exe ''normal!\\)"')
|
||||
let expected = [
|
||||
\ 'normal! 016|',
|
||||
\ 'normal! 016|',
|
||||
@@ -96,9 +96,18 @@ func Test_mksession()
|
||||
call assert_equal(expected, li)
|
||||
tabclose!
|
||||
|
||||
call delete('test_mks.out')
|
||||
call delete('Xtest_mks.out')
|
||||
call delete(tmpfile)
|
||||
let &wrap = wrap_save
|
||||
endfunc
|
||||
|
||||
func Test_mksession_winheight()
|
||||
new
|
||||
set winheight=10 winminheight=2
|
||||
mksession! Xtest_mks.out
|
||||
source Xtest_mks.out
|
||||
|
||||
call delete('Xtest_mks.out')
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
||||
@@ -94,10 +94,6 @@ function Test_tabpage()
|
||||
call assert_equal(7, tabpagenr())
|
||||
tabmove
|
||||
call assert_equal(10, tabpagenr())
|
||||
tabmove -20
|
||||
call assert_equal(1, tabpagenr())
|
||||
tabmove +20
|
||||
call assert_equal(10, tabpagenr())
|
||||
0tabmove
|
||||
call assert_equal(1, tabpagenr())
|
||||
$tabmove
|
||||
@@ -110,7 +106,16 @@ function Test_tabpage()
|
||||
call assert_equal(4, tabpagenr())
|
||||
7tabmove 5
|
||||
call assert_equal(5, tabpagenr())
|
||||
call assert_fails("99tabmove", 'E16:')
|
||||
call assert_fails("+99tabmove", 'E16:')
|
||||
call assert_fails("-99tabmove", 'E16:')
|
||||
call assert_fails("tabmove foo", 'E474:')
|
||||
call assert_fails("tabmove 99", 'E474:')
|
||||
call assert_fails("tabmove +99", 'E474:')
|
||||
call assert_fails("tabmove -99", 'E474:')
|
||||
call assert_fails("tabmove -3+", 'E474:')
|
||||
call assert_fails("tabmove $3", 'E474:')
|
||||
1tabonly!
|
||||
endfunc
|
||||
|
||||
" Test autocommands
|
||||
@@ -118,7 +123,6 @@ function Test_tabpage_with_autocmd()
|
||||
if !has('autocmd')
|
||||
return
|
||||
endif
|
||||
tabonly!
|
||||
command -nargs=1 -bar C :call add(s:li, '=== ' . <q-args> . ' ===')|<args>
|
||||
augroup TestTabpageGroup
|
||||
au!
|
||||
@@ -183,8 +187,10 @@ function Test_tabpage_with_autocmd()
|
||||
|
||||
autocmd TabDestructive TabEnter * nested :C tabnext 2 | C tabclose 3
|
||||
let s:li = []
|
||||
C tabnext 3
|
||||
call assert_equal(['=== tabnext 3 ===', 'BufLeave', 'WinLeave', 'TabLeave', 'WinEnter', 'TabEnter', '=== tabnext 2 ===', 'BufLeave', 'WinLeave', 'TabLeave', 'WinEnter', 'TabEnter', '=== tabnext 2 ===', '=== tabclose 3 ===', 'BufEnter', '=== tabclose 3 ==='], s:li)
|
||||
call assert_equal(3, tabpagenr('$'))
|
||||
C tabnext 2
|
||||
call assert_equal(2, tabpagenr('$'))
|
||||
call assert_equal(['=== tabnext 2 ===', 'WinLeave', 'TabLeave', 'WinEnter', 'TabEnter', '=== tabnext 2 ===', '=== tabclose 3 ==='], s:li)
|
||||
call assert_equal(['2/2'], [tabpagenr().'/'.tabpagenr('$')])
|
||||
|
||||
delcommand C
|
||||
@@ -192,8 +198,7 @@ function Test_tabpage_with_autocmd()
|
||||
augroup! TabDestructive
|
||||
autocmd! TestTabpageGroup
|
||||
augroup! TestTabpageGroup
|
||||
tabonly!
|
||||
bw!
|
||||
1tabonly!
|
||||
endfunction
|
||||
|
||||
function Test_tabpage_with_tab_modifier()
|
||||
@@ -224,8 +229,223 @@ function Test_tabpage_with_tab_modifier()
|
||||
call assert_fails('-99tab help', 'E16:')
|
||||
|
||||
delfunction s:check_tab
|
||||
tabonly!
|
||||
bw!
|
||||
1tabonly!
|
||||
endfunction
|
||||
|
||||
function Check_tab_count(pre_nr, cmd, post_nr)
|
||||
exec 'tabnext' a:pre_nr
|
||||
normal! G
|
||||
exec a:cmd
|
||||
call assert_equal(a:post_nr, tabpagenr(), a:cmd)
|
||||
endfunc
|
||||
|
||||
" Test for [count] of tabnext
|
||||
function Test_tabpage_with_tabnext()
|
||||
for n in range(4)
|
||||
tabedit
|
||||
call setline(1, ['', '', '3'])
|
||||
endfor
|
||||
|
||||
call Check_tab_count(1, 'tabnext', 2)
|
||||
call Check_tab_count(1, '3tabnext', 3)
|
||||
call Check_tab_count(1, '.tabnext', 1)
|
||||
call Check_tab_count(1, '.+1tabnext', 2)
|
||||
call Check_tab_count(2, '+tabnext', 3)
|
||||
call Check_tab_count(2, '+2tabnext', 4)
|
||||
call Check_tab_count(4, '-tabnext', 3)
|
||||
call Check_tab_count(4, '-2tabnext', 2)
|
||||
call Check_tab_count(3, '$tabnext', 5)
|
||||
call assert_fails('0tabnext', 'E16:')
|
||||
call assert_fails('99tabnext', 'E16:')
|
||||
call assert_fails('+99tabnext', 'E16:')
|
||||
call assert_fails('-99tabnext', 'E16:')
|
||||
call Check_tab_count(1, 'tabnext 3', 3)
|
||||
call Check_tab_count(2, 'tabnext +', 3)
|
||||
call Check_tab_count(2, 'tabnext +2', 4)
|
||||
call Check_tab_count(4, 'tabnext -', 3)
|
||||
call Check_tab_count(4, 'tabnext -2', 2)
|
||||
call Check_tab_count(3, 'tabnext $', 5)
|
||||
call assert_fails('tabnext 0', 'E474:')
|
||||
call assert_fails('tabnext .', 'E474:')
|
||||
call assert_fails('tabnext -+', 'E474:')
|
||||
call assert_fails('tabnext +2-', 'E474:')
|
||||
call assert_fails('tabnext $3', 'E474:')
|
||||
call assert_fails('tabnext 99', 'E474:')
|
||||
call assert_fails('tabnext +99', 'E474:')
|
||||
call assert_fails('tabnext -99', 'E474:')
|
||||
|
||||
1tabonly!
|
||||
endfunction
|
||||
|
||||
" Test for [count] of tabprevious
|
||||
function Test_tabpage_with_tabprevious()
|
||||
for n in range(5)
|
||||
tabedit
|
||||
call setline(1, ['', '', '3'])
|
||||
endfor
|
||||
|
||||
for cmd in ['tabNext', 'tabprevious']
|
||||
call Check_tab_count(6, cmd, 5)
|
||||
call Check_tab_count(6, '3' . cmd, 3)
|
||||
call Check_tab_count(6, '8' . cmd, 4)
|
||||
call Check_tab_count(6, cmd . ' 3', 3)
|
||||
call Check_tab_count(6, cmd . ' 8', 4)
|
||||
for n in range(2)
|
||||
for c in ['0', '.+3', '+', '+2' , '-', '-2' , '$', '+99', '-99']
|
||||
if n == 0 " pre count
|
||||
let entire_cmd = c . cmd
|
||||
let err_code = 'E16:'
|
||||
else
|
||||
let entire_cmd = cmd . ' ' . c
|
||||
let err_code = 'E474:'
|
||||
endif
|
||||
call assert_fails(entire_cmd, err_code)
|
||||
endfor
|
||||
endfor
|
||||
endfor
|
||||
|
||||
1tabonly!
|
||||
endfunction
|
||||
|
||||
function s:reconstruct_tabpage_for_test(nr)
|
||||
let n = (a:nr > 2) ? a:nr - 2 : 1
|
||||
1tabonly!
|
||||
0tabedit n0
|
||||
for n in range(1, n)
|
||||
exec '$tabedit n' . n
|
||||
if n == 1
|
||||
call setline(1, ['', '', '3'])
|
||||
endif
|
||||
endfor
|
||||
endfunc
|
||||
|
||||
" Test for [count] of tabclose
|
||||
function Test_tabpage_with_tabclose()
|
||||
|
||||
" pre count
|
||||
call s:reconstruct_tabpage_for_test(6)
|
||||
call Check_tab_count(3, 'tabclose!', 3)
|
||||
call Check_tab_count(1, '3tabclose', 1)
|
||||
call Check_tab_count(4, '4tabclose', 3)
|
||||
call Check_tab_count(3, '1tabclose', 2)
|
||||
call Check_tab_count(2, 'tabclose', 1)
|
||||
call assert_equal(1, tabpagenr('$'))
|
||||
call assert_equal('', bufname(''))
|
||||
|
||||
call s:reconstruct_tabpage_for_test(6)
|
||||
call Check_tab_count(2, '$tabclose', 2)
|
||||
call Check_tab_count(4, '.tabclose', 4)
|
||||
call Check_tab_count(3, '.+tabclose', 3)
|
||||
call Check_tab_count(3, '.-2tabclose', 2)
|
||||
call Check_tab_count(1, '.+1tabclose!', 1)
|
||||
call assert_equal(1, tabpagenr('$'))
|
||||
call assert_equal('', bufname(''))
|
||||
|
||||
" post count
|
||||
call s:reconstruct_tabpage_for_test(6)
|
||||
call Check_tab_count(3, 'tabclose!', 3)
|
||||
call Check_tab_count(1, 'tabclose 3', 1)
|
||||
call Check_tab_count(4, 'tabclose 4', 3)
|
||||
call Check_tab_count(3, 'tabclose 1', 2)
|
||||
call Check_tab_count(2, 'tabclose', 1)
|
||||
call assert_equal(1, tabpagenr('$'))
|
||||
call assert_equal('', bufname(''))
|
||||
|
||||
call s:reconstruct_tabpage_for_test(6)
|
||||
call Check_tab_count(2, 'tabclose $', 2)
|
||||
call Check_tab_count(4, 'tabclose', 4)
|
||||
call Check_tab_count(3, 'tabclose +', 3)
|
||||
call Check_tab_count(3, 'tabclose -2', 2)
|
||||
call Check_tab_count(1, 'tabclose! +1', 1)
|
||||
call assert_equal(1, tabpagenr('$'))
|
||||
call assert_equal('', bufname(''))
|
||||
|
||||
call s:reconstruct_tabpage_for_test(6)
|
||||
for n in range(2)
|
||||
for c in ['0', '$3', '99', '+99', '-99']
|
||||
if n == 0 " pre count
|
||||
let entire_cmd = c . 'tabclose'
|
||||
let err_code = 'E16:'
|
||||
else
|
||||
let entire_cmd = 'tabclose ' . c
|
||||
let err_code = 'E474:'
|
||||
endif
|
||||
call assert_fails(entire_cmd, err_code)
|
||||
call assert_equal(6, tabpagenr('$'))
|
||||
endfor
|
||||
endfor
|
||||
|
||||
call assert_fails('3tabclose', 'E37:')
|
||||
call assert_fails('tabclose 3', 'E37:')
|
||||
call assert_fails('tabclose -+', 'E474:')
|
||||
call assert_fails('tabclose +2-', 'E474:')
|
||||
call assert_equal(6, tabpagenr('$'))
|
||||
|
||||
1tabonly!
|
||||
endfunction
|
||||
|
||||
" Test for [count] of tabonly
|
||||
function Test_tabpage_with_tabonly()
|
||||
|
||||
" Test for the normal behavior (pre count only)
|
||||
let tc = [ [4, '.', '!'], [2, '.+', ''], [3, '.-2', '!'], [1, '.+1', '!'] ]
|
||||
for c in tc
|
||||
call s:reconstruct_tabpage_for_test(6)
|
||||
let entire_cmd = c[1] . 'tabonly' . c[2]
|
||||
call Check_tab_count(c[0], entire_cmd, 1)
|
||||
call assert_equal(1, tabpagenr('$'))
|
||||
endfor
|
||||
|
||||
" Test for the normal behavior
|
||||
let tc2 = [ [3, '', ''], [1, '3', ''], [4, '4', '!'], [3, '1', '!'],
|
||||
\ [2, '', '!'],
|
||||
\ [2, '$', '!'], [3, '+', '!'], [3, '-2', '!'], [3, '+1', '!']
|
||||
\ ]
|
||||
for n in range(2)
|
||||
for c in tc2
|
||||
call s:reconstruct_tabpage_for_test(6)
|
||||
if n == 0 " pre count
|
||||
let entire_cmd = c[1] . 'tabonly' . c[2]
|
||||
else
|
||||
let entire_cmd = 'tabonly' . c[2] . ' ' . c[1]
|
||||
endif
|
||||
call Check_tab_count(c[0], entire_cmd, 1)
|
||||
call assert_equal(1, tabpagenr('$'))
|
||||
endfor
|
||||
endfor
|
||||
|
||||
" Test for the error behavior
|
||||
for n in range(2)
|
||||
for c in ['0', '$3', '99', '+99', '-99']
|
||||
call s:reconstruct_tabpage_for_test(6)
|
||||
if n == 0 " pre count
|
||||
let entire_cmd = c . 'tabonly'
|
||||
let err_code = 'E16:'
|
||||
else
|
||||
let entire_cmd = 'tabonly ' . c
|
||||
let err_code = 'E474:'
|
||||
endif
|
||||
call assert_fails(entire_cmd, err_code)
|
||||
call assert_equal(6, tabpagenr('$'))
|
||||
endfor
|
||||
endfor
|
||||
|
||||
" Test for the error behavior (post count only)
|
||||
for c in tc
|
||||
call s:reconstruct_tabpage_for_test(6)
|
||||
let entire_cmd = 'tabonly' . c[2] . ' ' . c[1]
|
||||
let err_code = 'E474:'
|
||||
call assert_fails(entire_cmd, err_code)
|
||||
call assert_equal(6, tabpagenr('$'))
|
||||
endfor
|
||||
|
||||
call assert_fails('tabonly -+', 'E474:')
|
||||
call assert_fails('tabonly +2-', 'E474:')
|
||||
call assert_equal(6, tabpagenr('$'))
|
||||
|
||||
1tabonly!
|
||||
new
|
||||
only!
|
||||
endfunction
|
||||
|
||||
func Test_tabnext_on_buf_unload1()
|
||||
|
||||
@@ -764,6 +764,28 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
263,
|
||||
/**/
|
||||
262,
|
||||
/**/
|
||||
261,
|
||||
/**/
|
||||
260,
|
||||
/**/
|
||||
259,
|
||||
/**/
|
||||
258,
|
||||
/**/
|
||||
257,
|
||||
/**/
|
||||
256,
|
||||
/**/
|
||||
255,
|
||||
/**/
|
||||
254,
|
||||
/**/
|
||||
253,
|
||||
/**/
|
||||
252,
|
||||
/**/
|
||||
|
||||
Reference in New Issue
Block a user