mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-02 11:19:22 +02:00
Compare commits
95 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1afdb997de | |||
| 701ac80cae | |||
| fc8f1118e7 | |||
| 52a9a472de | |||
| 43d1ac6e81 | |||
| 31bdd13c33 | |||
| 39170e2d97 | |||
| 957bedab9c | |||
| 9f92886277 | |||
| 4f54a3d2c2 | |||
| ea588154d0 | |||
| 478af67dd6 | |||
| 451a4a1cb7 | |||
| 23c70e0101 | |||
| 487dd9d27b | |||
| f803a76978 | |||
| cd5c8f8250 | |||
| f8ec998613 | |||
| 59053e1d9f | |||
| 7860bac57b | |||
| d2381a2cad | |||
| 1cc482069a | |||
| 9f4de1f543 | |||
| 3317d5ebbe | |||
| d34f9b1155 | |||
| 9585a1655b | |||
| 395b6bab33 | |||
| d4863aa99e | |||
| 52604f2454 | |||
| 3bab93998d | |||
| 15ecbd6f3d | |||
| 866c688610 | |||
| ba6ec18297 | |||
| a1d5fa65bc | |||
| 04000560ca | |||
| 6d2e8f8dca | |||
| a604429529 | |||
| 08f88b139d | |||
| 85045a73db | |||
| fa0ad0bb0b | |||
| 69f40be645 | |||
| 6914c64ee5 | |||
| 33ccb24cf7 | |||
| 878c263a48 | |||
| c77d675747 | |||
| 9b81079ddd | |||
| 658a3a2caf | |||
| 30f517fd68 | |||
| 5daca9c5c6 | |||
| 32e1fc9b2d | |||
| 3fb41ccae8 | |||
| 13489b9c41 | |||
| ef8eb08978 | |||
| ce5c274201 | |||
| 85325f839a | |||
| 98496b9aa2 | |||
| 547ad47ddc | |||
| ba14141413 | |||
| a33ddbbd04 | |||
| 8da1e6cedf | |||
| bf3d58073f | |||
| 3fcfa35f82 | |||
| 99a6e8dd82 | |||
| ace95989ed | |||
| 0c078fc7db | |||
| c6cd8409c2 | |||
| b6fa30ccc3 | |||
| e0720cbf63 | |||
| b1e04fca37 | |||
| 1366a517ab | |||
| d5d37537d1 | |||
| 1a53ab66f8 | |||
| 980128c369 | |||
| c96272e30e | |||
| 46753d91c5 | |||
| d6d17c8f9f | |||
| 1572e30607 | |||
| a683ec44c3 | |||
| fce3a430c3 | |||
| 8a0141d4e7 | |||
| dd00851e07 | |||
| d722fd74d8 | |||
| a2845b8f5a | |||
| 6c0c1e8052 | |||
| ba6ad17378 | |||
| e5e0fbcd42 | |||
| 64fbbbb849 | |||
| 9d20ce6970 | |||
| d057c8b909 | |||
| 6959bce946 | |||
| 08b0bdeb91 | |||
| 95620d6b49 | |||
| 36d5d3059b | |||
| a7b867189e | |||
| 6b7c0ef216 |
+2
-2
@@ -47,8 +47,8 @@ script:
|
||||
- rm -f result; $VIMCMD -g -f -c "redir>result" -c "py3 import sys; print(\"Test\")" -c "redir END" -c q; cat result; echo; grep -q -w Test result
|
||||
- rm -f result; $VIMCMD -g -f -c "redir>result" -c "ruby puts(\"Test\")" -c "redir END" -c q; cat result; echo; grep -q -w Test result
|
||||
- make test
|
||||
#- make -C src/testdir clean
|
||||
#- make -C src testgui
|
||||
- make -C src/testdir clean
|
||||
- make -C src testgui
|
||||
|
||||
before_deploy:
|
||||
- make -C src macvim-dmg
|
||||
|
||||
@@ -215,6 +215,7 @@ SRC_UNIX = \
|
||||
src/config.mk.in \
|
||||
src/configure \
|
||||
src/configure.ac \
|
||||
src/create_cmdidxs.pl \
|
||||
src/gui_at_fs.c \
|
||||
src/gui_at_sb.c \
|
||||
src/gui_at_sb.h \
|
||||
@@ -724,7 +725,6 @@ EXTRA = \
|
||||
farsi/README.txt \
|
||||
farsi/fonts/*/far-* \
|
||||
runtime/vimlogo.xpm \
|
||||
src/swis.s \
|
||||
src/tee/Makefile \
|
||||
src/tee/Make_mvc.mak \
|
||||
src/tee/tee.c \
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
" Vim compiler file
|
||||
" Compiler: reStructuredText Documentation Format
|
||||
" Compiler: sphinx >= 1.0.8, http://www.sphinx-doc.org
|
||||
" Description: reStructuredText Documentation Format
|
||||
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
|
||||
" Latest Revision: 2006-04-19
|
||||
" Latest Revision: 2017-03-31
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
@@ -11,12 +12,18 @@ let current_compiler = "rst"
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
setlocal errorformat=
|
||||
\%f:%l:\ (%tEBUG/0)\ %m,
|
||||
\%f:%l:\ (%tNFO/1)\ %m,
|
||||
\%f:%l:\ (%tARNING/2)\ %m,
|
||||
\%f:%l:\ (%tRROR/3)\ %m,
|
||||
\%f:%l:\ (%tEVERE/3)\ %m,
|
||||
if exists(":CompilerSet") != 2
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
CompilerSet errorformat=
|
||||
\%f\\:%l:\ %tEBUG:\ %m,
|
||||
\%f\\:%l:\ %tNFO:\ %m,
|
||||
\%f\\:%l:\ %tARNING:\ %m,
|
||||
\%f\\:%l:\ %tRROR:\ %m,
|
||||
\%f\\:%l:\ %tEVERE:\ %m,
|
||||
\%f\\:%s:\ %tARNING:\ %m,
|
||||
\%f\\:%s:\ %tRROR:\ %m,
|
||||
\%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
|
||||
\%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
|
||||
\%DMaking\ %*\\a\ in\ %f
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" The default vimrc file.
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last change: 2017 Mar 08
|
||||
" Last change: 2017 Apr 12
|
||||
"
|
||||
" This is loaded if no vimrc file was found.
|
||||
" Except when Vim is run with "-u NONE" or "-C".
|
||||
@@ -26,6 +26,12 @@ if &compatible
|
||||
set nocompatible
|
||||
endif
|
||||
|
||||
" When the +eval feature is missing, the set command above will be skipped.
|
||||
" Use a trick to reset compatible only when the +eval feature is missing.
|
||||
silent! while 0
|
||||
set nocompatible
|
||||
silent! endwhile
|
||||
|
||||
" Allow backspacing over everything in insert mode.
|
||||
set backspace=indent,eol,start
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ DOCS = \
|
||||
ft_rust.txt \
|
||||
ft_sql.txt \
|
||||
gui.txt \
|
||||
gui_mac.txt \
|
||||
gui_w32.txt \
|
||||
gui_x11.txt \
|
||||
hangulin.txt \
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*autocmd.txt* For Vim version 8.0. Last change: 2017 Jan 14
|
||||
*autocmd.txt* For Vim version 8.0. Last change: 2017 Apr 07
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -621,7 +621,7 @@ FileChangedShell When Vim notices that the modification time of
|
||||
to tell Vim what to do next.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer that was changed "<afile>".
|
||||
buffer that was changed, which is in "<afile>".
|
||||
NOTE: The commands must not change the current
|
||||
buffer, jump to another buffer or delete a
|
||||
buffer. *E246* *E811*
|
||||
|
||||
+66
-24
@@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 8.0. Last change: 2017 Mar 21
|
||||
*eval.txt* For Vim version 8.0. Last change: 2017 Apr 09
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -4379,12 +4379,14 @@ getcurpos() Get the position of the cursor. This is like getpos('.'), but
|
||||
includes an extra item in the list:
|
||||
[bufnum, lnum, col, off, curswant] ~
|
||||
The "curswant" number is the preferred column when moving the
|
||||
cursor vertically.
|
||||
cursor vertically. Also see |getpos()|.
|
||||
|
||||
This can be used to save and restore the cursor position: >
|
||||
let save_cursor = getcurpos()
|
||||
MoveTheCursorAround
|
||||
call setpos('.', save_cursor)
|
||||
<
|
||||
< Note that this only works within the window. See
|
||||
|winrestview()| for restoring more state.
|
||||
*getcwd()*
|
||||
getcwd([{winnr} [, {tabnr}]])
|
||||
The result is a String, which is the name of the current
|
||||
@@ -4682,13 +4684,16 @@ gettabwinvar({tabnr}, {winnr}, {varname} [, {def}]) *gettabwinvar()*
|
||||
<
|
||||
*getwinposx()*
|
||||
getwinposx() The result is a Number, which is the X coordinate in pixels of
|
||||
the left hand side of the GUI Vim window. The result will be
|
||||
-1 if the information is not available.
|
||||
the left hand side of the GUI Vim window. Also works for an
|
||||
xterm.
|
||||
The result will be -1 if the information is not available.
|
||||
The value can be used with `:winpos`.
|
||||
|
||||
*getwinposy()*
|
||||
getwinposy() The result is a Number, which is the Y coordinate in pixels of
|
||||
the top of the GUI Vim window. The result will be -1 if the
|
||||
information is not available.
|
||||
the top of the GUI Vim window. Also works for an xterm.
|
||||
The result will be -1 if the information is not available.
|
||||
The value can be used with `:winpos`.
|
||||
|
||||
getwininfo([{winid}]) *getwininfo()*
|
||||
Returns information about windows as a List with Dictionaries.
|
||||
@@ -5304,13 +5309,29 @@ json_decode({string}) *json_decode()*
|
||||
in Vim values. See |json_encode()| for the relation between
|
||||
JSON and Vim values.
|
||||
The decoding is permissive:
|
||||
- A trailing comma in an array and object is ignored.
|
||||
- A trailing comma in an array and object is ignored, e.g.
|
||||
"[1, 2, ]" is the same as "[1, 2]".
|
||||
- More floating point numbers are recognized, e.g. "1." for
|
||||
"1.0".
|
||||
However, a duplicate key in an object is not allowed. *E938*
|
||||
The result must be a valid Vim type:
|
||||
- An empty object member name is not allowed.
|
||||
- Duplicate object member names are not allowed.
|
||||
"1.0", or "001.2" for "1.2". Special floating point values
|
||||
"Infinity" and "NaN" (capitalization ignored) are accepted.
|
||||
- Leading zeroes in integer numbers are ignored, e.g. "012"
|
||||
for "12" or "-012" for "-12".
|
||||
- Capitalization is ignored in literal names null, true or
|
||||
false, e.g. "NULL" for "null", "True" for "true".
|
||||
- Control characters U+0000 through U+001F which are not
|
||||
escaped in strings are accepted, e.g. " " (tab
|
||||
character in string) for "\t".
|
||||
- Backslash in an invalid 2-character sequence escape is
|
||||
ignored, e.g. "\a" is decoded as "a".
|
||||
- A correct surrogate pair in JSON strings should normally be
|
||||
a 12 character sequence such as "\uD834\uDD1E", but
|
||||
json_decode() silently accepts truncated surrogate pairs
|
||||
such as "\uD834" or "\uD834\u"
|
||||
*E938*
|
||||
A duplicate key in an object, valid in rfc7159, is not
|
||||
accepted by json_decode() as the result must be a valid Vim
|
||||
type, e.g. this fails: {"a":"b", "a":"c"}
|
||||
|
||||
|
||||
json_encode({expr}) *json_encode()*
|
||||
Encode {expr} as JSON and return this as a string.
|
||||
@@ -5413,8 +5434,10 @@ line({expr}) The result is a Number, which is the line number of the file
|
||||
$ the last line in the current buffer
|
||||
'x position of mark x (if the mark is not set, 0 is
|
||||
returned)
|
||||
w0 first line visible in current window
|
||||
w$ last line visible in current window
|
||||
w0 first line visible in current window (one if the
|
||||
display isn't updated, e.g. in silent Ex mode)
|
||||
w$ last line visible in current window (this is one
|
||||
less than "w0" if no lines are visible)
|
||||
v In Visual mode: the start of the Visual area (the
|
||||
cursor is the end). When not in Visual mode
|
||||
returns the cursor position. Differs from |'<| in
|
||||
@@ -6936,16 +6959,19 @@ setqflist({list} [, {action}[, {what}]]) *setqflist()*
|
||||
Note that the list is not exactly the same as what
|
||||
|getqflist()| returns.
|
||||
|
||||
*E927*
|
||||
If {action} is set to 'a', then the items from {list} are
|
||||
added to the existing quickfix list. If there is no existing
|
||||
list, then a new list is created.
|
||||
{action} values: *E927*
|
||||
'a' The items from {list} are added to the existing
|
||||
quickfix list. If there is no existing list, then a
|
||||
new list is created.
|
||||
|
||||
If {action} is set to 'r', then the items from the current
|
||||
quickfix list are replaced with the items from {list}. This
|
||||
can also be used to clear the list: >
|
||||
:call setqflist([], 'r')
|
||||
'r' The items from the current quickfix list are replaced
|
||||
with the items from {list}. This can also be used to
|
||||
clear the list: >
|
||||
:call setqflist([], 'r')
|
||||
<
|
||||
'f' All the quickfix lists in the quickfix stack are
|
||||
freed.
|
||||
|
||||
If {action} is not present or is set to ' ', then a new list
|
||||
is created.
|
||||
|
||||
@@ -8469,7 +8495,7 @@ listcmds Compiled with commands for the buffer list |:files|
|
||||
and the argument list |arglist|.
|
||||
localmap Compiled with local mappings and abbr. |:map-local|
|
||||
lua Compiled with Lua interface |Lua|.
|
||||
mac Any Macintosh version of Vim.
|
||||
mac Any Macintosh version of Vim, but not all OS X.
|
||||
macunix Compiled for OS X, with darwin
|
||||
osx Compiled for OS X, with or without darwin
|
||||
menu Compiled with support for |:menu|.
|
||||
@@ -10648,6 +10674,22 @@ missing: >
|
||||
: echo "You will _never_ see this message"
|
||||
:endif
|
||||
|
||||
To execute a command only when the |+eval| feature is disabled requires a trick,
|
||||
as this example shows: >
|
||||
if 1
|
||||
nnoremap : :"
|
||||
endif
|
||||
normal :set history=111<CR>
|
||||
if 1
|
||||
nunmap :
|
||||
endif
|
||||
|
||||
The "<CR>" here is a real CR character, type CTRL-V Enter to get it.
|
||||
|
||||
When the |+eval| feature is available the ":" is remapped to add a double
|
||||
quote, which has the effect of commenging-out the command. without the
|
||||
|+eval| feature the nnoremap command is skipped and the command is executed.
|
||||
|
||||
==============================================================================
|
||||
11. The sandbox *eval-sandbox* *sandbox* *E48*
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*filetype.txt* For Vim version 8.0. Last change: 2017 Mar 21
|
||||
*filetype.txt* For Vim version 8.0. Last change: 2017 Mar 28
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -353,12 +353,12 @@ define yourself. There are a few ways to avoid this:
|
||||
You need to define your own mapping before the plugin is loaded (before
|
||||
editing a file of that type). The plugin will then skip installing the
|
||||
default mapping.
|
||||
|
||||
*no_mail_maps*
|
||||
3. Disable defining mappings for a specific filetype by setting a variable,
|
||||
which contains the name of the filetype. For the "mail" filetype this
|
||||
would be: >
|
||||
:let no_mail_maps = 1
|
||||
|
||||
< *no_plugin_maps*
|
||||
4. Disable defining mappings for all filetypes by setting a variable: >
|
||||
:let no_plugin_maps = 1
|
||||
<
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
*ft_rust.txt* Filetype plugin for Rust
|
||||
|
||||
==============================================================================
|
||||
CONTENTS *rust* *ft-rust*
|
||||
CONTENTS *rust*
|
||||
|
||||
1. Introduction |rust-intro|
|
||||
2. Settings |rust-settings|
|
||||
|
||||
@@ -704,7 +704,7 @@ prominent bugs/missing features.
|
||||
- The toolbar looks ugly and is not very useful.
|
||||
|
||||
If you find new bugs then please post your findings to the vim_mac mailing
|
||||
list: *vim_mac* >
|
||||
list: *vim_mac_group* >
|
||||
http://groups.google.com/group/vim_mac
|
||||
|
||||
This is also the best place for making feature requests as well as for asking
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*insert.txt* For Vim version 8.0. Last change: 2016 Jan 31
|
||||
*insert.txt* For Vim version 8.0. Last change: 2017 Apr 07
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -159,7 +159,8 @@ CTRL-R CTRL-R {0-9a-z"%#*+/:.-=} *i_CTRL-R_CTRL-R*
|
||||
CTRL-R CTRL-O {0-9a-z"%#*+/:.-=} *i_CTRL-R_CTRL-O*
|
||||
Insert the contents of a register literally and don't
|
||||
auto-indent. Does the same as pasting with the mouse
|
||||
|<MiddleMouse>|.
|
||||
|<MiddleMouse>|. When the register is linewise this will
|
||||
insert the text above the current line, like with `P`.
|
||||
Does not replace characters!
|
||||
The '.' register (last inserted text) is still inserted as
|
||||
typed. {not in Vi}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*message.txt* For Vim version 8.0. Last change: 2017 Jan 02
|
||||
*message.txt* For Vim version 8.0. Last change: 2017 Mar 25
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -768,6 +768,13 @@ Example: >
|
||||
You tried to execute a command that is neither an Ex command nor
|
||||
a user-defined command.
|
||||
|
||||
*E943* >
|
||||
Command table needs to be updated, run 'make cmdidxs'
|
||||
|
||||
This can only happen when changing the source code, when adding a command in
|
||||
src/ex_cmds.h. The lookup table then needs to be updated, by running: >
|
||||
make cmdidxs
|
||||
|
||||
==============================================================================
|
||||
3. Messages *messages*
|
||||
|
||||
|
||||
+12
-3
@@ -1,4 +1,4 @@
|
||||
*options.txt* For Vim version 8.0. Last change: 2017 Mar 09
|
||||
*options.txt* For Vim version 8.0. Last change: 2017 Mar 22
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1700,6 +1700,16 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
:set columns=9999
|
||||
< Minimum value is 12, maximum value is 10000.
|
||||
|
||||
*'columnspace'* *'csp'*
|
||||
'columnspace' 'csp' number (default 0)
|
||||
global
|
||||
{not in Vi}
|
||||
{only in the MacVim GUI}
|
||||
Number of pixel columns inserted between characters. With some fonts
|
||||
there can be too much room between characters. Then it makes sense
|
||||
to set 'columnspace' to a negative value. This may cause display
|
||||
problems though!
|
||||
|
||||
*'comments'* *'com'* *E524* *E525*
|
||||
'comments' 'com' string (default
|
||||
"s1:/*,mb:*,ex:*/,://,b:#,:%,:XCOMM,n:>,fb:-")
|
||||
@@ -6672,8 +6682,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
Flag passed to the shell to execute "!" and ":!" commands; e.g.,
|
||||
"bash.exe -c ls" or "command.com /c dir". For the MS-DOS-like
|
||||
systems, the default is set according to the value of 'shell', to
|
||||
reduce the need to set this option by the user. It's not used for
|
||||
OS/2 (EMX figures this out itself).
|
||||
reduce the need to set this option by the user.
|
||||
On Unix it can have more than one flag. Each white space separated
|
||||
part is passed as an argument to the shell command.
|
||||
See |option-backslash| about including spaces and backslashes.
|
||||
|
||||
+21
-9
@@ -16,11 +16,12 @@ Carbon version of Vim here:
|
||||
http://macvim.org/
|
||||
|
||||
1. Filename Convention |mac-filename|
|
||||
2. .vimrc an .vim files |mac-vimfile|
|
||||
3. FAQ |mac-faq|
|
||||
4. Known Lack |mac-lack|
|
||||
5. Mac Bug Report |mac-bug|
|
||||
6. Compiling Vim |mac-compile|
|
||||
2. .vimrc and .vim files |mac-vimfile|
|
||||
3. Standard mappings |mac-standard-mappings|
|
||||
4. FAQ |mac-faq|
|
||||
5. Known Lack |mac-lack|
|
||||
6. Mac Bug Report |mac-bug|
|
||||
7. Compiling Vim |mac-compile|
|
||||
|
||||
There was a Mac port for version 3.0 of Vim. Here are the first few lines
|
||||
from the old file:
|
||||
@@ -76,7 +77,18 @@ the |'nocompatible'| option is set, otherwise it will only handle mac format
|
||||
files.
|
||||
|
||||
==============================================================================
|
||||
3. Mac FAQ *mac-faq*
|
||||
3. Standard mappings *mac-standard-mappings*
|
||||
|
||||
The following mappings are available for cut/copy/paste from/to clipboard.
|
||||
|
||||
key Normal Visual Insert Description ~
|
||||
Command-v "*P "-d"*P <C-R>* paste text *<D-v>*
|
||||
Command-c "*y copy Visual text *<D-c>*
|
||||
Command-x "*d cut Visual text *<D-x>*
|
||||
Backspace "*d cut Visual text
|
||||
|
||||
==============================================================================
|
||||
4. Mac FAQ *mac-faq*
|
||||
|
||||
On the internet: http://macvim.org/OSX/index.php#FAQ
|
||||
|
||||
@@ -99,13 +111,13 @@ A: The following trick works with most shells. Put it in your vimrc file.
|
||||
let $PATH = matchstr(s:path, 'VIMPATH\zs.\{-}\ze\n')
|
||||
|
||||
==============================================================================
|
||||
4. Mac Lack *mac-lack*
|
||||
5. Mac Lack *mac-lack*
|
||||
|
||||
In a terminal CTRL-^ needs to be entered as Shift-Control-6. CTRL-@ as
|
||||
Shift-Control-2.
|
||||
|
||||
==============================================================================
|
||||
5. Mac Bug Report *mac-bug*
|
||||
6. Mac Bug Report *mac-bug*
|
||||
|
||||
When reporting any Mac specific bug or feature change, please use the vim-mac
|
||||
maillist |vim-mac|. However, you need to be subscribed. An alternative is to
|
||||
@@ -114,7 +126,7 @@ send a message to the current MacVim maintainers:
|
||||
mac@vim.org
|
||||
|
||||
==============================================================================
|
||||
6. Compiling Vim *mac-compile*
|
||||
7. Compiling Vim *mac-compile*
|
||||
|
||||
See the file "src/INSTALLmac.txt" that comes with the source files.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*os_win32.txt* For Vim version 8.0. Last change: 2016 Oct 12
|
||||
*os_win32.txt* For Vim version 8.0. Last change: 2017 Mar 21
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by George Reilly
|
||||
|
||||
+27
-18
@@ -1,4 +1,4 @@
|
||||
*pattern.txt* For Vim version 8.0. Last change: 2017 Mar 05
|
||||
*pattern.txt* For Vim version 8.0. Last change: 2017 Mar 29
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1085,25 +1085,27 @@ x A single character, with no special meaning, matches itself
|
||||
- A character class expression is evaluated to the set of characters
|
||||
belonging to that character class. The following character classes
|
||||
are supported:
|
||||
Name Contents ~
|
||||
*[:alnum:]* [:alnum:] ASCII letters and digits
|
||||
*[:alpha:]* [:alpha:] ASCII letters
|
||||
*[:blank:]* [:blank:] space and tab characters
|
||||
*[:cntrl:]* [:cntrl:] control characters
|
||||
*[:digit:]* [:digit:] decimal digits
|
||||
*[:graph:]* [:graph:] printable characters excluding space
|
||||
*[:lower:]* [:lower:] lowercase letters (all letters when
|
||||
Name Func Contents ~
|
||||
*[:alnum:]* [:alnum:] isalnum ASCII letters and digits
|
||||
*[:alpha:]* [:alpha:] isalpha ASCII letters
|
||||
*[:blank:]* [:blank:] space and tab
|
||||
*[:cntrl:]* [:cntrl:] iscntrl ASCII control characters
|
||||
*[:digit:]* [:digit:] decimal digits '0' to '9'
|
||||
*[:graph:]* [:graph:] isgraph ASCII printable characters excluding
|
||||
space
|
||||
*[:lower:]* [:lower:] (1) lowercase letters (all letters when
|
||||
'ignorecase' is used)
|
||||
*[:print:]* [:print:] printable characters including space
|
||||
*[:punct:]* [:punct:] ASCII punctuation characters
|
||||
*[:space:]* [:space:] whitespace characters
|
||||
*[:upper:]* [:upper:] uppercase letters (all letters when
|
||||
*[:print:]* [:print:] (2) printable characters including space
|
||||
*[:punct:]* [:punct:] ispunct ASCII punctuation characters
|
||||
*[:space:]* [:space:] whitespace characters: space, tab, CR,
|
||||
NL, vertical tab, form feed
|
||||
*[:upper:]* [:upper:] (3) uppercase letters (all letters when
|
||||
'ignorecase' is used)
|
||||
*[:xdigit:]* [:xdigit:] hexadecimal digits
|
||||
*[:return:]* [:return:] the <CR> character
|
||||
*[:tab:]* [:tab:] the <Tab> character
|
||||
*[:escape:]* [:escape:] the <Esc> character
|
||||
*[:backspace:]* [:backspace:] the <BS> character
|
||||
*[:xdigit:]* [:xdigit:] hexadecimal digits: 0-9, a-f, A-F
|
||||
*[:return:]* [:return:] the <CR> character
|
||||
*[:tab:]* [:tab:] the <Tab> character
|
||||
*[:escape:]* [:escape:] the <Esc> character
|
||||
*[:backspace:]* [:backspace:] the <BS> character
|
||||
The brackets in character class expressions are additional to the
|
||||
brackets delimiting a collection. For example, the following is a
|
||||
plausible pattern for a UNIX filename: "[-./[:alnum:]_~]\+" That is,
|
||||
@@ -1114,6 +1116,13 @@ x A single character, with no special meaning, matches itself
|
||||
regexp engine. See |two-engines|. In the future these items may
|
||||
work for multi-byte characters. For now, to get all "alpha"
|
||||
characters you can use: [[:lower:][:upper:]].
|
||||
|
||||
The "Func" column shows what library function is used. The
|
||||
implementation depends on the system. Otherwise:
|
||||
(1) Uses islower() for ASCII and Vim builtin rules for other
|
||||
characters when built with the |+multi_byte| feature.
|
||||
(2) Uses Vim builtin rules
|
||||
(3) As with (1) but using isupper()
|
||||
*/[[=* *[==]*
|
||||
- An equivalence class. This means that characters are matched that
|
||||
have almost the same meaning, e.g., when ignoring accents. This
|
||||
|
||||
@@ -645,6 +645,7 @@ Short explanation of each option: *option-list*
|
||||
'cmdwinheight' 'cwh' height of the command-line window
|
||||
'colorcolumn' 'cc' columns to highlight
|
||||
'columns' 'co' number of columns in the display
|
||||
'columnspace' 'csp' number of pixel columns to use between characters
|
||||
'comments' 'com' patterns that can start a comment line
|
||||
'commentstring' 'cms' template for comments; used for fold marker
|
||||
'compatible' 'cp' behave Vi-compatible as much as possible
|
||||
|
||||
+14
-3
@@ -141,6 +141,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
'cole' options.txt /*'cole'*
|
||||
'colorcolumn' options.txt /*'colorcolumn'*
|
||||
'columns' options.txt /*'columns'*
|
||||
'columnspace' options.txt /*'columnspace'*
|
||||
'com' options.txt /*'com'*
|
||||
'comments' options.txt /*'comments'*
|
||||
'commentstring' options.txt /*'commentstring'*
|
||||
@@ -168,6 +169,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
'cscopetag' options.txt /*'cscopetag'*
|
||||
'cscopetagorder' options.txt /*'cscopetagorder'*
|
||||
'cscopeverbose' options.txt /*'cscopeverbose'*
|
||||
'csp' options.txt /*'csp'*
|
||||
'cspc' options.txt /*'cspc'*
|
||||
'csprg' options.txt /*'csprg'*
|
||||
'csqf' options.txt /*'csqf'*
|
||||
@@ -791,7 +793,9 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
'pvh' options.txt /*'pvh'*
|
||||
'pvw' options.txt /*'pvw'*
|
||||
'pythondll' options.txt /*'pythondll'*
|
||||
'pythonhome' options.txt /*'pythonhome'*
|
||||
'pythonthreedll' options.txt /*'pythonthreedll'*
|
||||
'pythonthreehome' options.txt /*'pythonthreehome'*
|
||||
'pyx' options.txt /*'pyx'*
|
||||
'pyxversion' options.txt /*'pyxversion'*
|
||||
'qe' options.txt /*'qe'*
|
||||
@@ -3308,6 +3312,9 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
<D-Right> gui_mac.txt /*<D-Right>*
|
||||
<D-Up> gui_mac.txt /*<D-Up>*
|
||||
<D-`> gui_mac.txt /*<D-`>*
|
||||
<D-c> os_mac.txt /*<D-c>*
|
||||
<D-v> os_mac.txt /*<D-v>*
|
||||
<D-x> os_mac.txt /*<D-x>*
|
||||
<Del> change.txt /*<Del>*
|
||||
<Down> motion.txt /*<Down>*
|
||||
<Drop> change.txt /*<Drop>*
|
||||
@@ -4565,6 +4572,7 @@ E94 windows.txt /*E94*
|
||||
E940 eval.txt /*E940*
|
||||
E941 eval.txt /*E941*
|
||||
E942 eval.txt /*E942*
|
||||
E943 message.txt /*E943*
|
||||
E95 message.txt /*E95*
|
||||
E96 diff.txt /*E96*
|
||||
E97 diff.txt /*E97*
|
||||
@@ -6197,7 +6205,6 @@ ft-rst-syntax syntax.txt /*ft-rst-syntax*
|
||||
ft-ruby-omni insert.txt /*ft-ruby-omni*
|
||||
ft-ruby-syntax syntax.txt /*ft-ruby-syntax*
|
||||
ft-rust filetype.txt /*ft-rust*
|
||||
ft-rust ft_rust.txt /*ft-rust*
|
||||
ft-scheme-syntax syntax.txt /*ft-scheme-syntax*
|
||||
ft-sdl-syntax syntax.txt /*ft-sdl-syntax*
|
||||
ft-sed-syntax syntax.txt /*ft-sed-syntax*
|
||||
@@ -6684,7 +6691,7 @@ gui.txt gui.txt /*gui.txt*
|
||||
gui_mac.txt gui_mac.txt /*gui_mac.txt*
|
||||
gui_w32.txt gui_w32.txt /*gui_w32.txt*
|
||||
gui_x11.txt gui_x11.txt /*gui_x11.txt*
|
||||
guifontwide_gtk options.txt /*guifontwide_gtk*
|
||||
guifontwide_gtk2 options.txt /*guifontwide_gtk2*
|
||||
guifontwide_macvim options.txt /*guifontwide_macvim*
|
||||
guifontwide_win_mbyte options.txt /*guifontwide_win_mbyte*
|
||||
guioptions_a options.txt /*guioptions_a*
|
||||
@@ -7240,6 +7247,7 @@ mac-compile os_mac.txt /*mac-compile*
|
||||
mac-faq os_mac.txt /*mac-faq*
|
||||
mac-filename os_mac.txt /*mac-filename*
|
||||
mac-lack os_mac.txt /*mac-lack*
|
||||
mac-standard-mappings os_mac.txt /*mac-standard-mappings*
|
||||
mac-vimfile os_mac.txt /*mac-vimfile*
|
||||
macintosh os_mac.txt /*macintosh*
|
||||
macro map.txt /*macro*
|
||||
@@ -7784,6 +7792,8 @@ nice todo.txt /*nice*
|
||||
no-eval-feature eval.txt /*no-eval-feature*
|
||||
no-type-checking eval.txt /*no-type-checking*
|
||||
no_buffers_menu gui.txt /*no_buffers_menu*
|
||||
no_mail_maps filetype.txt /*no_mail_maps*
|
||||
no_plugin_maps filetype.txt /*no_plugin_maps*
|
||||
non-greedy pattern.txt /*non-greedy*
|
||||
non-zero-arg eval.txt /*non-zero-arg*
|
||||
none-variable eval.txt /*none-variable*
|
||||
@@ -9299,7 +9309,8 @@ vim: options.txt /*vim:*
|
||||
vim_announce intro.txt /*vim_announce*
|
||||
vim_dev intro.txt /*vim_dev*
|
||||
vim_did_enter-variable eval.txt /*vim_did_enter-variable*
|
||||
vim_mac gui_mac.txt /*vim_mac*
|
||||
vim_mac intro.txt /*vim_mac*
|
||||
vim_mac_group gui_mac.txt /*vim_mac_group*
|
||||
vim_starting eval.txt /*vim_starting*
|
||||
vim_use intro.txt /*vim_use*
|
||||
vimball pi_vimball.txt /*vimball*
|
||||
|
||||
+4
-26
@@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 8.0. Last change: 2017 Mar 21
|
||||
*todo.txt* For Vim version 8.0. Last change: 2017 Apr 09
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -35,6 +35,8 @@ entered there will not be repeated below, unless there is extra information.
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
Remove the Farsi code?
|
||||
|
||||
+channel:
|
||||
- Try out background make plugin:
|
||||
https://github.com/AndrewVos/vim-make-background
|
||||
@@ -110,9 +112,6 @@ manager. Problem with Motif?
|
||||
|
||||
Memory leak in test97? The string is actually freed. Weird.
|
||||
|
||||
Patch to make "start" work better: Use ShellExecute in !start (Katsuya Hino,
|
||||
#1570)
|
||||
|
||||
Add a toolbar in the terminal. Can be global, above all windows, or specific
|
||||
for one window.
|
||||
Use tb_set(winid, [{'text': 'stop', 'cb': callback, 'hi': 'Green'}])
|
||||
@@ -124,12 +123,6 @@ What if there is an invalid character?
|
||||
|
||||
Json string with trailing \u should be an error. (Lcd)
|
||||
|
||||
On MS-Windows with 'clipboard' set to "unnamed" this doesn't work to double
|
||||
lines: :g/^/normal yyp On Unix it works OK. (Bryce Orgill, 2016 Nov 5)
|
||||
Another example 2017 Mar 10.
|
||||
|
||||
Multi-byte bug: dv} splits char. (Urtica Dioica, 2017 Jan 9)
|
||||
|
||||
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.
|
||||
@@ -137,10 +130,6 @@ 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.
|
||||
|
||||
Patch to test regexp classes. (Dominique, 2017 Mar 13, #1560)
|
||||
Do we need to adjust the implementation?
|
||||
Make different classes that depend on the system and that don't.
|
||||
|
||||
Wrong diff highlighting with three files. (2016 Oct 20, #1186)
|
||||
Also get E749 on exit.
|
||||
Another example in #1309
|
||||
@@ -148,9 +137,6 @@ Another example in #1309
|
||||
Patch to change all use of &sw to shiftwidth(). (Tyru, 2017 Feb 19)
|
||||
Wait until maintainers integrate it.
|
||||
|
||||
Completion for user-defined commands does not work if a few characters 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
|
||||
|
||||
@@ -341,14 +327,6 @@ Jul 25, #948)
|
||||
Patch to fix wrong encoding of error message on Cygwin/MSYS terminal.
|
||||
(Ken Takata, 2016 Oct 4)
|
||||
|
||||
Patch to introduce 'cmdencoding'. (Ken Takata, Aug 18?)
|
||||
Better help Aug 19.
|
||||
Problem: applies to too many commands, such as :cbuffer.
|
||||
Updated patch with three options, 2016 Sep 8.
|
||||
Win32: When running ":make" and 'encoding' differs from the system locale,
|
||||
the output should be converted. Esp. when 'encoding' is "utf-8". (Yongwei
|
||||
Wu) Should we use 'termencoding' for this?
|
||||
|
||||
Patch to add 'systemencoding', convert between 'encoding' and this for file
|
||||
names, shell commands and the like. (Kikuchan, 2010 Oct 14)
|
||||
Assume the system converts between the actual encoding of the filesystem to
|
||||
@@ -421,7 +399,7 @@ When doing "vi buf.md" a BufNew autocommand for *.md is not triggered.
|
||||
Because of using the initial buffer? (Dun Peal, 2016 May 12)
|
||||
|
||||
Patch to add the :bvimgrep command. (Christian Brabandt, 2014 Nov 12)
|
||||
Updated 2016 Jun 10, #858
|
||||
Updated 2016 Jun 10, #858 Update 2017 Mar 28: use <buffer>
|
||||
|
||||
Add redrawtabline command. (Naruhiko Nishino, 2016 Jun 11)
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*usr_41.txt* For Vim version 8.0. Last change: 2017 Mar 18
|
||||
*usr_41.txt* For Vim version 8.0. Last change: 2017 Mar 28
|
||||
|
||||
VIM USER MANUAL - by Bram Moolenaar
|
||||
|
||||
@@ -2277,8 +2277,8 @@ plugin for the mail filetype: >
|
||||
endif
|
||||
|
||||
Two global variables are used:
|
||||
no_plugin_maps disables mappings for all filetype plugins
|
||||
no_mail_maps disables mappings for a specific filetype
|
||||
|no_plugin_maps| disables mappings for all filetype plugins
|
||||
|no_mail_maps| disables mappings for the "mail" filetype
|
||||
|
||||
|
||||
USER COMMANDS
|
||||
|
||||
+11
-4
@@ -1,7 +1,7 @@
|
||||
" Vim support file to detect file types
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2017 Mar 13
|
||||
" Last Change: 2017 Apr 15
|
||||
|
||||
" Listen very carefully, I will say this only once
|
||||
if exists("did_load_filetypes")
|
||||
@@ -288,7 +288,8 @@ au BufNewFile,BufRead *.bib setf bib
|
||||
au BufNewFile,BufRead *.bst setf bst
|
||||
|
||||
" BIND configuration
|
||||
au BufNewFile,BufRead named.conf,rndc.conf setf named
|
||||
" sudoedit uses namedXXXX.conf
|
||||
au BufNewFile,BufRead named*.conf,rndc*.conf setf named
|
||||
|
||||
" BIND zone
|
||||
au BufNewFile,BufRead named.root setf bindzone
|
||||
@@ -309,9 +310,10 @@ au BufNewFile,BufRead *.bl setf blank
|
||||
au BufNewFile,BufRead */etc/blkid.tab,*/etc/blkid.tab.old setf xml
|
||||
|
||||
" Bazel (http://bazel.io)
|
||||
autocmd BufRead,BufNewFile *.bzl,WORKSPACE setfiletype bzl
|
||||
autocmd BufRead,BufNewFile *.bzl,WORKSPACE setf bzl
|
||||
if has("fname_case")
|
||||
autocmd BufRead,BufNewFile BUILD setfiletype bzl
|
||||
" There is another check for BUILD further below.
|
||||
autocmd BufRead,BufNewFile BUILD setf bzl
|
||||
endif
|
||||
|
||||
" C or lpc
|
||||
@@ -2601,6 +2603,11 @@ au BufNewFile,BufRead *asterisk*/*voicemail.conf* call s:StarSetf('asteriskvm')
|
||||
" Bazaar version control
|
||||
au BufNewFile,BufRead bzr_log.* setf bzr
|
||||
|
||||
" Bazel build file
|
||||
if !has("fname_case")
|
||||
au BufNewFile,BufRead BUILD setf bzl
|
||||
endif
|
||||
|
||||
" BIND zone
|
||||
au BufNewFile,BufRead */named/db.*,*/bind/db.* call s:StarSetf('bindzone')
|
||||
|
||||
|
||||
+54
-19
@@ -3,8 +3,8 @@
|
||||
" Author: John Wellesz <John.wellesz (AT) teaser (DOT) fr>
|
||||
" URL: http://www.2072productions.com/vim/indent/php.vim
|
||||
" Home: https://github.com/2072/PHP-Indenting-for-VIm
|
||||
" Last Change: 2015 September 8th
|
||||
" Version: 1.60
|
||||
" Last Change: 2017 March 12th
|
||||
" Version: 1.62
|
||||
"
|
||||
"
|
||||
" Type :help php-indent for available options
|
||||
@@ -141,11 +141,13 @@ let s:PHP_validVariable = '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'
|
||||
let s:notPhpHereDoc = '\%(break\|return\|continue\|exit\|die\|else\)'
|
||||
let s:blockstart = '\%(\%(\%(}\s*\)\=else\%(\s\+\)\=\)\=if\>\|\%(}\s*\)\?else\>\|do\>\|while\>\|switch\>\|case\>\|default\>\|for\%(each\)\=\>\|declare\>\|class\>\|trait\>\|use\>\|interface\>\|abstract\>\|final\>\|try\>\|\%(}\s*\)\=catch\>\|\%(}\s*\)\=finally\>\)'
|
||||
let s:functionDecl = '\<function\>\%(\s\+'.s:PHP_validVariable.'\)\=\s*(.*'
|
||||
let s:endline= '\s*\%(//.*\|#.*\|/\*.*\*/\s*\)\=$'
|
||||
let s:endline = '\s*\%(//.*\|#.*\|/\*.*\*/\s*\)\=$'
|
||||
let s:unstated = '\%(^\s*'.s:blockstart.'.*)\|\%(//.*\)\@<!\<e'.'lse\>\)'.s:endline
|
||||
|
||||
|
||||
let s:terminated = '\%(\%(;\%(\s*\%(?>\|}\)\)\=\|<<<\s*[''"]\=\a\w*[''"]\=$\|^\s*}\|^\s*'.s:PHP_validVariable.':\)'.s:endline.'\)\|^[^''"`]*[''"`]$'
|
||||
let s:terminated = '\%(\%(;\%(\s*\%(?>\|}\)\)\=\|<<<\s*[''"]\=\a\w*[''"]\=$\|^\s*}\|^\s*'.s:PHP_validVariable.':\)'.s:endline.'\)'
|
||||
let s:PHP_startindenttag = '<?\%(.*?>\)\@!\|<script[^>]*>\%(.*<\/script>\)\@!'
|
||||
let s:structureHead = '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . s:endline . '\|\<new\s\+class\>'
|
||||
|
||||
|
||||
|
||||
@@ -214,10 +216,28 @@ function! GetLastRealCodeLNum(startline) " {{{
|
||||
let lnum = lnum - 1
|
||||
endwhile
|
||||
elseif lastline =~ '^[^''"`]*[''"`][;,]'.s:endline
|
||||
let tofind=substitute( lastline, '^.*\([''"`]\)[;,].*$', '^[^\1]\\+[\1]$', '')
|
||||
while getline(lnum) !~? tofind && lnum > 1
|
||||
let lnum = lnum - 1
|
||||
|
||||
let tofind=substitute( lastline, '^.*\([''"`]\)[;,].*$', '^[^\1]\\+[\1]$\\|^[^\1]\\+[=([]\\s*[\1]', '')
|
||||
let trylnum = lnum
|
||||
while getline(trylnum) !~? tofind && trylnum > 1
|
||||
let trylnum = trylnum - 1
|
||||
endwhile
|
||||
|
||||
if trylnum == 1
|
||||
break
|
||||
else
|
||||
if lastline =~ ';'.s:endline
|
||||
while getline(trylnum) !~? s:terminated && getline(trylnum) !~? '{'.s:endline && trylnum > 1
|
||||
let trylnum = prevnonblank(trylnum - 1)
|
||||
endwhile
|
||||
|
||||
|
||||
if trylnum == 1
|
||||
break
|
||||
end
|
||||
end
|
||||
let lnum = trylnum
|
||||
end
|
||||
else
|
||||
break
|
||||
endif
|
||||
@@ -262,7 +282,7 @@ function! FindOpenBracket(lnum, blockStarter) " {{{
|
||||
while line > 1
|
||||
let linec = getline(line)
|
||||
|
||||
if linec =~ s:terminated || linec =~ '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . s:endline
|
||||
if linec =~ s:terminated || linec =~ s:structureHead
|
||||
break
|
||||
endif
|
||||
|
||||
@@ -273,6 +293,20 @@ function! FindOpenBracket(lnum, blockStarter) " {{{
|
||||
return line
|
||||
endfun " }}}
|
||||
|
||||
let s:blockChars = {'{':1, '[': 1, '(': 1, ')':-1, ']':-1, '}':-1}
|
||||
function! BalanceDirection (str)
|
||||
|
||||
let balance = 0
|
||||
|
||||
for c in split(a:str, '\zs')
|
||||
if has_key(s:blockChars, c)
|
||||
let balance += s:blockChars[c]
|
||||
endif
|
||||
endfor
|
||||
|
||||
return balance
|
||||
endfun
|
||||
|
||||
function! FindTheIfOfAnElse (lnum, StopAfterFirstPrevElse) " {{{
|
||||
|
||||
if getline(a:lnum) =~# '^\s*}\s*else\%(if\)\=\>'
|
||||
@@ -457,7 +491,7 @@ function! GetPhpIndent()
|
||||
|
||||
if synname!=""
|
||||
if synname == "SpecStringEntrails"
|
||||
let b:InPHPcode = -1
|
||||
let b:InPHPcode = -1 " thumb down
|
||||
let b:InPHPcode_tofind = ""
|
||||
elseif synname != "phpHereDoc" && synname != "phpHereDocDelimiter"
|
||||
let b:InPHPcode = 1
|
||||
@@ -540,7 +574,7 @@ function! GetPhpIndent()
|
||||
let b:InPHPcode_and_script = 1
|
||||
endif
|
||||
|
||||
elseif last_line =~ '^[^''"`]\+[''"`]$'
|
||||
elseif last_line =~ '^[^''"`]\+[''"`]$' " a string identifier with nothing after it and no other string identifier before
|
||||
let b:InPHPcode = -1
|
||||
let b:InPHPcode_tofind = substitute( last_line, '^.*\([''"`]\).*$', '^[^\1]*\1[;,]$', '')
|
||||
elseif last_line =~? '<<<\s*[''"]\=\a\w*[''"]\=$'
|
||||
@@ -660,7 +694,8 @@ function! GetPhpIndent()
|
||||
|
||||
let terminated = s:terminated
|
||||
|
||||
let unstated = '\%(^\s*'.s:blockstart.'.*)\|\%(//.*\)\@<!\<e'.'lse\>\)'.endline
|
||||
let unstated = s:unstated
|
||||
|
||||
|
||||
if ind != b:PHP_default_indenting && cline =~# '^\s*else\%(if\)\=\>'
|
||||
let b:PHP_CurrentIndentLevel = b:PHP_default_indenting
|
||||
@@ -673,7 +708,7 @@ function! GetPhpIndent()
|
||||
|
||||
while last_line_num > 1
|
||||
|
||||
if previous_line =~ terminated || previous_line =~ '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . endline
|
||||
if previous_line =~ terminated || previous_line =~ s:structureHead
|
||||
|
||||
let ind = indent(last_line_num)
|
||||
|
||||
@@ -689,7 +724,7 @@ function! GetPhpIndent()
|
||||
endwhile
|
||||
|
||||
elseif last_line =~# unstated && cline !~ '^\s*);\='.endline
|
||||
let ind = ind + s:sw()
|
||||
let ind = ind + s:sw() " we indent one level further when the preceding line is not stated
|
||||
return ind + addSpecial
|
||||
|
||||
elseif (ind != b:PHP_default_indenting || last_line =~ '^[)\]]' ) && last_line =~ terminated
|
||||
@@ -699,7 +734,7 @@ function! GetPhpIndent()
|
||||
|
||||
let isSingleLineBlock = 0
|
||||
while 1
|
||||
if ! isSingleLineBlock && previous_line =~ '^\s*}\|;\s*}'.endline
|
||||
if ! isSingleLineBlock && previous_line =~ '^\s*}\|;\s*}'.endline " XXX
|
||||
|
||||
call cursor(last_line_num, 1)
|
||||
if previous_line !~ '^}'
|
||||
@@ -780,10 +815,10 @@ function! GetPhpIndent()
|
||||
if !LastLineClosed
|
||||
|
||||
|
||||
if last_line =~# '[{(\[]'.endline || last_line =~? '\h\w*\s*(.*,$' && AntepenultimateLine !~ '[,(\[]'.endline
|
||||
if last_line =~# '[{(\[]'.endline || last_line =~? '\h\w*\s*(.*,$' && AntepenultimateLine !~ '[,(\[]'.endline && BalanceDirection(last_line) > 0
|
||||
|
||||
let dontIndent = 0
|
||||
if last_line =~ '\S\+\s*{'.endline && last_line !~ '^\s*)\s*{'.endline && last_line !~ '^\s*\%(' . s:blockstart . '\)\|'. s:functionDecl . s:endline
|
||||
if last_line =~ '\S\+\s*{'.endline && last_line !~ '^\s*[)\]]\+\s*{'.endline && last_line !~ s:structureHead
|
||||
let dontIndent = 1
|
||||
endif
|
||||
|
||||
@@ -797,9 +832,9 @@ function! GetPhpIndent()
|
||||
return ind + addSpecial
|
||||
endif
|
||||
|
||||
elseif last_line =~ '\S\+\s*),'.endline
|
||||
elseif last_line =~ '\S\+\s*),'.endline && BalanceDirection(last_line) < 0
|
||||
call cursor(lnum, 1)
|
||||
call search('),'.endline, 'W')
|
||||
call search('),'.endline, 'W') " line never begins with ) so no need for 'c' flag
|
||||
let openedparent = searchpair('(', '', ')', 'bW', 'Skippmatch()')
|
||||
if openedparent != lnum
|
||||
let ind = indent(openedparent)
|
||||
@@ -809,7 +844,7 @@ function! GetPhpIndent()
|
||||
let ind = ind + s:sw()
|
||||
|
||||
|
||||
elseif AntepenultimateLine =~ '{'.endline || AntepenultimateLine =~ terminated || AntepenultimateLine =~# s:defaultORcase
|
||||
elseif AntepenultimateLine =~ '{'.endline && AntepenultimateLine !~? '^\s*use\>' || AntepenultimateLine =~ terminated || AntepenultimateLine =~# s:defaultORcase
|
||||
let ind = ind + s:sw()
|
||||
endif
|
||||
|
||||
|
||||
+14
-14
@@ -274,7 +274,7 @@ function GetRIndent()
|
||||
let nlnum = s:Get_prev_line(nlnum)
|
||||
let nline = SanitizeRLine(getline(nlnum)) . nline
|
||||
endwhile
|
||||
if nline =~ '^\s*function\s*(' && indent(nlnum) == &sw
|
||||
if nline =~ '^\s*function\s*(' && indent(nlnum) == shiftwidth()
|
||||
return 0
|
||||
endif
|
||||
endif
|
||||
@@ -285,7 +285,7 @@ function GetRIndent()
|
||||
|
||||
" line is an incomplete command:
|
||||
if line =~ '\<\(if\|while\|for\|function\)\s*()$' || line =~ '\<else$' || line =~ '<-$' || line =~ '->$'
|
||||
return indent(lnum) + &sw
|
||||
return indent(lnum) + shiftwidth()
|
||||
endif
|
||||
|
||||
" Deal with () and []
|
||||
@@ -293,14 +293,14 @@ function GetRIndent()
|
||||
let pb = s:Get_paren_balance(line, '(', ')')
|
||||
|
||||
if line =~ '^\s*{$' || line =~ '(\s*{' || (pb == 0 && (line =~ '{$' || line =~ '(\s*{$'))
|
||||
return indent(lnum) + &sw
|
||||
return indent(lnum) + shiftwidth()
|
||||
endif
|
||||
|
||||
let s:curtabstop = repeat(' ', &tabstop)
|
||||
|
||||
if g:r_indent_align_args == 1
|
||||
if pb > 0 && line =~ '{$'
|
||||
return s:Get_last_paren_idx(line, '(', ')', pb) + &sw
|
||||
return s:Get_last_paren_idx(line, '(', ')', pb) + shiftwidth()
|
||||
endif
|
||||
|
||||
let bb = s:Get_paren_balance(line, '[', ']')
|
||||
@@ -364,11 +364,11 @@ function GetRIndent()
|
||||
if oline =~ g:r_indent_op_pattern && s:Get_paren_balance(line, "(", ")") == 0
|
||||
return indent(lnum)
|
||||
else
|
||||
return indent(lnum) + &sw
|
||||
return indent(lnum) + shiftwidth()
|
||||
endif
|
||||
else
|
||||
if oline =~ g:r_indent_op_pattern && s:Get_paren_balance(line, "(", ")") == 0
|
||||
return indent(lnum) - &sw
|
||||
return indent(lnum) - shiftwidth()
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
@@ -383,7 +383,7 @@ function GetRIndent()
|
||||
let line = linepiece . line
|
||||
endwhile
|
||||
if line =~ '{$' && post_block == 0
|
||||
return indent(lnum) + &sw
|
||||
return indent(lnum) + shiftwidth()
|
||||
endif
|
||||
|
||||
" Now we can do some tests again
|
||||
@@ -393,19 +393,19 @@ function GetRIndent()
|
||||
if post_block == 0
|
||||
let newl = SanitizeRLine(line)
|
||||
if newl =~ '\<\(if\|while\|for\|function\)\s*()$' || newl =~ '\<else$' || newl =~ '<-$'
|
||||
return indent(lnum) + &sw
|
||||
return indent(lnum) + shiftwidth()
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
if cline =~ '^\s*else'
|
||||
if line =~ '<-\s*if\s*()'
|
||||
return indent(lnum) + &sw
|
||||
return indent(lnum) + shiftwidth()
|
||||
else
|
||||
if line =~ '\<if\s*()'
|
||||
return indent(lnum)
|
||||
else
|
||||
return indent(lnum) - &sw
|
||||
return indent(lnum) - shiftwidth()
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
@@ -474,12 +474,12 @@ function GetRIndent()
|
||||
let ind = indent(lnum)
|
||||
|
||||
if g:r_indent_align_args == 0 && pb != 0
|
||||
let ind += pb * &sw
|
||||
let ind += pb * shiftwidth()
|
||||
return ind
|
||||
endif
|
||||
|
||||
if g:r_indent_align_args == 0 && bb != 0
|
||||
let ind += bb * &sw
|
||||
let ind += bb * shiftwidth()
|
||||
return ind
|
||||
endif
|
||||
|
||||
@@ -489,7 +489,7 @@ function GetRIndent()
|
||||
let pind = 0
|
||||
endif
|
||||
|
||||
if ind == pind || (ind == (pind + &sw) && pline =~ '{$' && ppost_else == 0)
|
||||
if ind == pind || (ind == (pind + shiftwidth()) && pline =~ '{$' && ppost_else == 0)
|
||||
return ind
|
||||
endif
|
||||
|
||||
@@ -509,7 +509,7 @@ function GetRIndent()
|
||||
let pbb = s:Get_paren_balance(pline, '[', ']')
|
||||
endwhile
|
||||
let pind = indent(plnum)
|
||||
if ind == (pind + &sw) && pline =~ '{$'
|
||||
if ind == (pind + shiftwidth()) && pline =~ '{$'
|
||||
return ind
|
||||
endif
|
||||
endwhile
|
||||
|
||||
@@ -82,7 +82,7 @@ function GetRHelpIndent()
|
||||
let closeb = strlen(line2) - strlen(line3)
|
||||
let bb = openb - closeb
|
||||
|
||||
let ind = indent(lnum) + (bb * &sw)
|
||||
let ind = indent(lnum) + (bb * shiftwidth())
|
||||
|
||||
if line =~ '^\s*}\s*$'
|
||||
let ind = indent(lnum)
|
||||
|
||||
+10
-2
@@ -1,6 +1,6 @@
|
||||
" Vim script to work like "less"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2015 Nov 15
|
||||
" Last Change: 2017 Mar 31
|
||||
|
||||
" Avoid loading this file twice, allow the user to define his own script.
|
||||
if exists("loaded_less")
|
||||
@@ -81,6 +81,10 @@ fun! s:Help()
|
||||
echo "\n"
|
||||
echo "/pattern Search for pattern ?pattern Search backward for pattern"
|
||||
echo "n next pattern match N Previous pattern match"
|
||||
if &foldmethod != "manual"
|
||||
echo "\n"
|
||||
echo "zR open all folds zm increase fold level"
|
||||
endif
|
||||
echo "\n"
|
||||
echo ":n<Enter> Next file :p<Enter> Previous file"
|
||||
echo "\n"
|
||||
@@ -96,7 +100,11 @@ map <C-F> <Space>
|
||||
map <PageDown> <Space>
|
||||
map <kPageDown> <Space>
|
||||
map <S-Down> <Space>
|
||||
map z <Space>
|
||||
" If 'foldmethod' was changed keep the "z" commands, e.g. "zR" to open all
|
||||
" folds.
|
||||
if &foldmethod == "manual"
|
||||
map z <Space>
|
||||
endif
|
||||
map <Esc><Space> <Space>
|
||||
fun! s:NextPage()
|
||||
if line(".") == line("$")
|
||||
|
||||
@@ -638,6 +638,8 @@ if has("gui")
|
||||
endif
|
||||
call append("$", "linespace\tnumber of pixel lines to use between characters")
|
||||
call append("$", " \tset lsp=" . &lsp)
|
||||
call append("$", "columnspace\tnumber of pixel columns to use between characters")
|
||||
call append("$", " \tset csp=" . &csp)
|
||||
if has("balloon_eval")
|
||||
call append("$", "balloondelay\tdelay in milliseconds before a balloon may pop up")
|
||||
call append("$", " \tset bdlay=" . &bdlay)
|
||||
|
||||
+15
-9
@@ -1,7 +1,7 @@
|
||||
" matchit.vim: (global plugin) Extended "%" matching
|
||||
" Last Change: 2016 Aug 21
|
||||
" Last Change: 2017 March 26
|
||||
" Maintainer: Benji Fisher PhD <benji@member.AMS.org>
|
||||
" Version: 1.13.2, for Vim 6.3+
|
||||
" Version: 1.13.3, for Vim 6.3+
|
||||
" Fix from Fernando Torres included.
|
||||
" Improvement from Ken Takata included.
|
||||
" URL: http://www.vim.org/script.php?script_id=39
|
||||
@@ -89,12 +89,15 @@ let s:notslash = '\\\@<!\%(\\\\\)*'
|
||||
|
||||
function! s:Match_wrapper(word, forward, mode) range
|
||||
" In s:CleanUp(), :execute "set" restore_options .
|
||||
let restore_options = (&ic ? " " : " no") . "ignorecase"
|
||||
if exists("b:match_ignorecase")
|
||||
let restore_options = ""
|
||||
if exists("b:match_ignorecase") && b:match_ignorecase != &ic
|
||||
let restore_options .= (&ic ? " " : " no") . "ignorecase"
|
||||
let &ignorecase = b:match_ignorecase
|
||||
endif
|
||||
let restore_options = " ve=" . &ve . restore_options
|
||||
set ve=
|
||||
if &ve != ''
|
||||
let restore_options = " ve=" . &ve . restore_options
|
||||
set ve=
|
||||
endif
|
||||
" If this function was called from Visual mode, make sure that the cursor
|
||||
" is at the correct end of the Visual range:
|
||||
if a:mode == "v"
|
||||
@@ -287,7 +290,9 @@ endfun
|
||||
" Restore options and do some special handling for Operator-pending mode.
|
||||
" The optional argument is the tail of the matching group.
|
||||
fun! s:CleanUp(options, mode, startline, startcol, ...)
|
||||
execute "set" a:options
|
||||
if strlen(a:options)
|
||||
execute "set" a:options
|
||||
endif
|
||||
" Open folds, if appropriate.
|
||||
if a:mode != "o"
|
||||
if &foldopen =~ "percent"
|
||||
@@ -639,8 +644,9 @@ fun! s:MultiMatch(spflag, mode)
|
||||
if !exists("b:match_words") || b:match_words == ""
|
||||
return ""
|
||||
end
|
||||
let restore_options = (&ic ? "" : "no") . "ignorecase"
|
||||
if exists("b:match_ignorecase")
|
||||
let restore_options = ""
|
||||
if exists("b:match_ignorecase") && b:match_ignorecase != &ic
|
||||
let restore_options .= (&ic ? " " : " no") . "ignorecase"
|
||||
let &ignorecase = b:match_ignorecase
|
||||
endif
|
||||
let startline = line(".")
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" Language: AutoHotkey script file
|
||||
" Maintainer: Michael Wong
|
||||
" https://github.com/mmikeww/autohotkey.vim
|
||||
" Latest Revision: 2017-01-23
|
||||
" Latest Revision: 2017-04-03
|
||||
" Previous Maintainers: SungHyun Nam <goweol@gmail.com>
|
||||
" Nikolai Weibull <now@bitwi.se>
|
||||
|
||||
@@ -106,6 +106,7 @@ syn keyword autohotkeyCommand
|
||||
\ FormatTime IfInString IfNotInString Sort StringCaseSense StringGetPos
|
||||
\ StringLeft StringRight StringLower StringUpper StringMid StringReplace
|
||||
\ StringSplit StringTrimLeft StringTrimRight StringLen
|
||||
\ StrSplit StrReplace Throw
|
||||
\ Control ControlClick ControlFocus ControlGet ControlGetFocus
|
||||
\ ControlGetPos ControlGetText ControlMove ControlSend ControlSendRaw
|
||||
\ ControlSetText Menu PostMessage SendMessage SetControlDelay
|
||||
@@ -119,17 +120,18 @@ syn keyword autohotkeyCommand
|
||||
\ SetCapsLockState SetNumLockState SetScrollLockState
|
||||
|
||||
syn keyword autohotkeyFunction
|
||||
\ InStr RegExMatch RegExReplace StrLen SubStr Asc Chr
|
||||
\ InStr RegExMatch RegExReplace StrLen SubStr Asc Chr Func
|
||||
\ DllCall VarSetCapacity WinActive WinExist IsLabel OnMessage
|
||||
\ Abs Ceil Exp Floor Log Ln Mod Round Sqrt Sin Cos Tan ASin ACos ATan
|
||||
\ 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
|
||||
\ Format Exception
|
||||
|
||||
syn keyword autohotkeyStatement
|
||||
\ Break Continue Exit ExitApp Gosub Goto OnExit Pause Return
|
||||
\ Suspend Reload
|
||||
\ Suspend Reload new class extends
|
||||
|
||||
syn keyword autohotkeyRepeat
|
||||
\ Loop
|
||||
@@ -138,7 +140,7 @@ syn keyword autohotkeyConditional
|
||||
\ IfExist IfNotExist If IfEqual IfLess IfGreater Else
|
||||
\ IfWinExist IfWinNotExist IfWinActive IfWinNotActive
|
||||
\ IfNotEqual IfLessOrEqual IfGreaterOrEqual
|
||||
\ while until for in
|
||||
\ while until for in try catch finally
|
||||
|
||||
syn match autohotkeyPreProcStart
|
||||
\ nextgroup=
|
||||
@@ -178,7 +180,7 @@ syn keyword autohotkeyPreProc
|
||||
\ Warn
|
||||
|
||||
syn keyword autohotkeyMatchClass
|
||||
\ ahk_group ahk_class ahk_id ahk_pid
|
||||
\ ahk_group ahk_class ahk_id ahk_pid ahk_exe
|
||||
|
||||
syn match autohotkeyNumbers
|
||||
\ display
|
||||
@@ -217,7 +219,7 @@ syn match autohotkeyHotkey
|
||||
\ contains=autohotkeyKey,
|
||||
\ autohotkeyHotkeyDelimiter
|
||||
\ display
|
||||
\ '^.\{-}::'
|
||||
\ '^\s*\S*\%( Up\)\?::'
|
||||
|
||||
syn match autohotkeyKey
|
||||
\ contained
|
||||
|
||||
+145
-28
@@ -5,10 +5,10 @@
|
||||
" Tom Payne <tom@tompayne.org>
|
||||
" Contributor: Johannes Ranke <jranke@uni-bremen.de>
|
||||
" Homepage: https://github.com/jalvesaq/R-Vim-runtime
|
||||
" Last Change: Thu Aug 25, 2016 08:52PM
|
||||
" Last Change: Sat Apr 08, 2017 07:01PM
|
||||
" Filenames: *.R *.r *.Rhistory *.Rt
|
||||
"
|
||||
" NOTE: The highlighting of R functions is defined in
|
||||
" NOTE: The highlighting of R functions might be defined in
|
||||
" runtime files created by a filetype plugin, if installed.
|
||||
"
|
||||
" CONFIGURATION:
|
||||
@@ -18,7 +18,7 @@
|
||||
"
|
||||
" ROxygen highlighting can be turned off by
|
||||
"
|
||||
" let r_hl_roxygen = 0
|
||||
" let r_syntax_hl_roxygen = 0
|
||||
"
|
||||
" Some lines of code were borrowed from Zhuojun Chen.
|
||||
|
||||
@@ -26,13 +26,25 @@ if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
syn iskeyword @,48-57,_,.
|
||||
if has("patch-7.4.1142")
|
||||
syn iskeyword @,48-57,_,.
|
||||
else
|
||||
setlocal iskeyword=@,48-57,_,.
|
||||
endif
|
||||
|
||||
" The variables g:r_hl_roxygen and g:r_syn_minlines were renamed on April 8, 2017.
|
||||
if exists("g:r_hl_roxygen")
|
||||
let g:r_syntax_hl_roxygen = g:r_hl_roxygen
|
||||
endif
|
||||
if exists("g:r_syn_minlines")
|
||||
let g:r_syntax_minlines = g:r_syn_minlines
|
||||
endif
|
||||
|
||||
if exists("g:r_syntax_folding") && g:r_syntax_folding
|
||||
setlocal foldmethod=syntax
|
||||
endif
|
||||
if !exists("g:r_hl_roxygen")
|
||||
let g:r_hl_roxygen = 1
|
||||
if !exists("g:r_syntax_hl_roxygen")
|
||||
let g:r_syntax_hl_roxygen = 1
|
||||
endif
|
||||
|
||||
syn case match
|
||||
@@ -42,19 +54,106 @@ syn match rCommentTodo contained "\(BUG\|FIXME\|NOTE\|TODO\):"
|
||||
syn match rComment contains=@Spell,rCommentTodo,rOBlock "#.*"
|
||||
|
||||
" Roxygen
|
||||
if g:r_hl_roxygen
|
||||
syn region rOBlock start="^\s*\n#\{1,2}' " start="\%^#\{1,2}' " end="^\(#\{1,2}'\)\@!" contains=rOTitle,rOKeyword,rOExamples,@Spell keepend
|
||||
syn region rOTitle start="^\s*\n#\{1,2}' " start="\%^#\{1,2}' " end="^\(#\{1,2}'\s*$\)\@=" contained contains=rOCommentKey
|
||||
syn match rOCommentKey "#\{1,2}'" containedin=rOTitle contained
|
||||
if g:r_syntax_hl_roxygen
|
||||
" A roxygen block can start at the beginning of a file (first version) and
|
||||
" after a blank line (second version). It ends when a line that does not
|
||||
" contain a roxygen comment. In the following comments, any line containing
|
||||
" a roxygen comment marker (one or two hash signs # followed by a single
|
||||
" quote ' and preceded only by whitespace) is called a roxygen line. A
|
||||
" roxygen line containing only a roxygen comment marker, optionally followed
|
||||
" by whitespace is called an empty roxygen line.
|
||||
|
||||
syn region rOExamples start="^#\{1,2}' @examples.*"rs=e+1,hs=e+1 end="^\(#\{1,2}' @.*\)\@=" end="^\(#\{1,2}'\)\@!" contained contains=rOKeyword
|
||||
" First we match all roxygen blocks as containing only a title. In case an
|
||||
" empty roxygen line ending the title or a tag is found, this will be
|
||||
" overriden later by the definitions of rOBlock.
|
||||
syn match rOTitleBlock "\%^\(\s*#\{1,2}' .*\n\)\{1,}" contains=rOCommentKey,rOTitleTag
|
||||
syn match rOTitleBlock "^\s*\n\(\s*#\{1,2}' .*\n\)\{1,}" contains=rOCommentKey,rOTitleTag
|
||||
|
||||
syn match rOKeyword contained "@\(param\|return\|name\|rdname\|examples\|example\|include\|docType\)"
|
||||
syn match rOKeyword contained "@\(S3method\|TODO\|aliases\|alias\|assignee\|author\|callGraphDepth\|callGraph\)"
|
||||
syn match rOKeyword contained "@\(callGraphPrimitives\|concept\|exportClass\|exportMethod\|exportPattern\|export\|formals\)"
|
||||
syn match rOKeyword contained "@\(format\|importClassesFrom\|importFrom\|importMethodsFrom\|import\|keywords\|useDynLib\)"
|
||||
syn match rOKeyword contained "@\(method\|noRd\|note\|references\|seealso\|setClass\|slot\|source\|title\|usage\)"
|
||||
syn match rOKeyword contained "@\(family\|template\|templateVar\|description\|details\|inheritParams\|field\)"
|
||||
" When a roxygen block has a title and additional content, the title
|
||||
" consists of one or more roxygen lines (as little as possible are matched),
|
||||
" followed either by an empty roxygen line
|
||||
syn region rOBlock start="\%^\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*$" end="^\s*\(#\{1,2}'\)\@!" contains=rOTitle,rOTag,rOExamples,@Spell keepend fold
|
||||
syn region rOBlock start="^\s*\n\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*$" end="^\s*\(#\{1,2}'\)\@!" contains=rOTitle,rOTag,rOExamples,@Spell keepend fold
|
||||
|
||||
" or by a roxygen tag (we match everything starting with @ but not @@ which is used as escape sequence for a literal @).
|
||||
syn region rOBlock start="\%^\(\s*#\{1,2}' .*\n\)\{-}\s*#\{1,2}' @\(@\)\@!" end="^\s*\(#\{1,2}'\)\@!" contains=rOTitle,rOTag,rOExamples,@Spell keepend fold
|
||||
syn region rOBlock start="^\s*\n\(\s*#\{1,2}' .*\n\)\{-}\s*#\{1,2}' @\(@\)\@!" end="^\s*\(#\{1,2}'\)\@!" contains=rOTitle,rOTag,rOExamples,@Spell keepend fold
|
||||
|
||||
" If a block contains an @rdname, @describeIn tag, it may have paragraph breaks, but does not have a title
|
||||
syn region rOBlockNoTitle start="\%^\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*\n\(\s*#\{1,2}'.*\n\)\{-}\s*#\{1,2}' @rdname" end="^\s*\(#\{1,2}'\)\@!" contains=rOTag,rOExamples,@Spell keepend fold
|
||||
syn region rOBlockNoTitle start="^\s*\n\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*\n\(\s*#\{1,2}'.*\n\)\{-}\s*#\{1,2}' @rdname" end="^\s*\(#\{1,2}'\)\@!" contains=rOTag,rOExamples,@Spell keepend fold
|
||||
syn region rOBlockNoTitle start="\%^\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*\n\(\s*#\{1,2}'.*\n\)\{-}\s*#\{1,2}' @describeIn" end="^\s*\(#\{1,2}'\)\@!" contains=rOTag,rOExamples,@Spell keepend fold
|
||||
syn region rOBlockNoTitle start="^\s*\n\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*\n\(\s*#\{1,2}'.*\n\)\{-}\s*#\{1,2}' @describeIn" end="^\s*\(#\{1,2}'\)\@!" contains=rOTag,rOExamples,@Spell keepend fold
|
||||
|
||||
" A title as part of a block is always at the beginning of the block, i.e.
|
||||
" either at the start of a file or after a completely empty line.
|
||||
syn match rOTitle "\%^\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*$" contained contains=rOCommentKey,rOTitleTag
|
||||
syn match rOTitle "^\s*\n\(\s*#\{1,2}' .*\n\)\{-1,}\s*#\{1,2}'\s*$" contained contains=rOCommentKey,rOTitleTag
|
||||
syn match rOTitleTag contained "@title"
|
||||
|
||||
syn match rOCommentKey "#\{1,2}'" contained
|
||||
syn region rOExamples start="^#\{1,2}' @examples.*"rs=e+1,hs=e+1 end="^\(#\{1,2}' @.*\)\@=" end="^\(#\{1,2}'\)\@!" contained contains=rOTag fold
|
||||
|
||||
" rOTag list generated from the lists in
|
||||
" https://github.com/klutometis/roxygen/R/rd.R and
|
||||
" https://github.com/klutometis/roxygen/R/namespace.R
|
||||
" using s/^ \([A-Za-z0-9]*\) = .*/ syn match rOTag contained "@\1"/
|
||||
" Plus we need the @include tag
|
||||
|
||||
" rd.R
|
||||
syn match rOTag contained "@aliases"
|
||||
syn match rOTag contained "@author"
|
||||
syn match rOTag contained "@backref"
|
||||
syn match rOTag contained "@concept"
|
||||
syn match rOTag contained "@describeIn"
|
||||
syn match rOTag contained "@description"
|
||||
syn match rOTag contained "@details"
|
||||
syn match rOTag contained "@docType"
|
||||
syn match rOTag contained "@encoding"
|
||||
syn match rOTag contained "@evalRd"
|
||||
syn match rOTag contained "@example"
|
||||
syn match rOTag contained "@examples"
|
||||
syn match rOTag contained "@family"
|
||||
syn match rOTag contained "@field"
|
||||
syn match rOTag contained "@format"
|
||||
syn match rOTag contained "@inherit"
|
||||
syn match rOTag contained "@inheritParams"
|
||||
syn match rOTag contained "@inheritDotParams"
|
||||
syn match rOTag contained "@inheritSection"
|
||||
syn match rOTag contained "@keywords"
|
||||
syn match rOTag contained "@method"
|
||||
syn match rOTag contained "@name"
|
||||
syn match rOTag contained "@md"
|
||||
syn match rOTag contained "@noMd"
|
||||
syn match rOTag contained "@noRd"
|
||||
syn match rOTag contained "@note"
|
||||
syn match rOTag contained "@param"
|
||||
syn match rOTag contained "@rdname"
|
||||
syn match rOTag contained "@rawRd"
|
||||
syn match rOTag contained "@references"
|
||||
syn match rOTag contained "@return"
|
||||
syn match rOTag contained "@section"
|
||||
syn match rOTag contained "@seealso"
|
||||
syn match rOTag contained "@slot"
|
||||
syn match rOTag contained "@source"
|
||||
syn match rOTag contained "@template"
|
||||
syn match rOTag contained "@templateVar"
|
||||
syn match rOTag contained "@title"
|
||||
syn match rOTag contained "@usage"
|
||||
" namespace.R
|
||||
syn match rOTag contained "@export"
|
||||
syn match rOTag contained "@exportClass"
|
||||
syn match rOTag contained "@exportMethod"
|
||||
syn match rOTag contained "@exportPattern"
|
||||
syn match rOTag contained "@import"
|
||||
syn match rOTag contained "@importClassesFrom"
|
||||
syn match rOTag contained "@importFrom"
|
||||
syn match rOTag contained "@importMethodsFrom"
|
||||
syn match rOTag contained "@rawNamespace"
|
||||
syn match rOTag contained "@S3method"
|
||||
syn match rOTag contained "@useDynLib"
|
||||
" other
|
||||
syn match rOTag contained "@include"
|
||||
endif
|
||||
|
||||
|
||||
@@ -168,12 +267,28 @@ syn match rBraceError "[)}]" contained
|
||||
syn match rCurlyError "[)\]]" contained
|
||||
syn match rParenError "[\]}]" contained
|
||||
|
||||
if !exists("g:R_hi_fun")
|
||||
let g:R_hi_fun = 1
|
||||
" Use Nvim-R to highlight functions dynamically if it is installed
|
||||
if !exists("g:r_syntax_fun_pattern")
|
||||
let s:ff = split(substitute(globpath(&rtp, "R/functions.vim"), "functions.vim", "", "g"), "\n")
|
||||
if len(s:ff) > 0
|
||||
let g:r_syntax_fun_pattern = 0
|
||||
else
|
||||
let g:r_syntax_fun_pattern = 1
|
||||
endif
|
||||
endif
|
||||
if g:R_hi_fun
|
||||
" Nvim-R:
|
||||
runtime R/functions.vim
|
||||
|
||||
" Only use Nvim-R to highlight functions if they should not be highlighted
|
||||
" according to a generic pattern
|
||||
if g:r_syntax_fun_pattern == 1
|
||||
syn match rFunction '[0-9a-zA-Z_\.]\+\s*\ze('
|
||||
else
|
||||
if !exists("g:R_hi_fun")
|
||||
let g:R_hi_fun = 1
|
||||
endif
|
||||
if g:R_hi_fun
|
||||
" Nvim-R:
|
||||
runtime R/functions.vim
|
||||
endif
|
||||
endif
|
||||
|
||||
syn match rDollar display contained "\$"
|
||||
@@ -205,8 +320,8 @@ if &filetype == "rhelp"
|
||||
syn match rhSection "\\dontrun\>"
|
||||
endif
|
||||
|
||||
if exists("r_syn_minlines")
|
||||
exe "syn sync minlines=" . r_syn_minlines
|
||||
if exists("r_syntax_minlines")
|
||||
exe "syn sync minlines=" . r_syntax_minlines
|
||||
else
|
||||
syn sync minlines=40
|
||||
endif
|
||||
@@ -243,15 +358,17 @@ hi def link rStatement Statement
|
||||
hi def link rString String
|
||||
hi def link rStrError Error
|
||||
hi def link rType Type
|
||||
if g:r_hl_roxygen
|
||||
hi def link rOKeyword Title
|
||||
hi def link rOBlock Comment
|
||||
if g:r_syntax_hl_roxygen
|
||||
hi def link rOTitleTag Operator
|
||||
hi def link rOTag Operator
|
||||
hi def link rOTitleBlock Title
|
||||
hi def link rOBlock Comment
|
||||
hi def link rOBlockNoTitle Comment
|
||||
hi def link rOTitle Title
|
||||
hi def link rOCommentKey Comment
|
||||
hi def link rOExamples SpecialComment
|
||||
endif
|
||||
|
||||
|
||||
let b:current_syntax="r"
|
||||
|
||||
" vim: ts=8 sw=2
|
||||
|
||||
+66
-28
@@ -1,17 +1,26 @@
|
||||
" markdown Text with R statements
|
||||
" Language: markdown with R code chunks
|
||||
" Homepage: https://github.com/jalvesaq/R-Vim-runtime
|
||||
" Last Change: Tue Jun 28, 2016 10:09AM
|
||||
" Last Change: Sat Jan 28, 2017 10:06PM
|
||||
"
|
||||
" CONFIGURATION:
|
||||
" To highlight chunk headers as R code, put in your vimrc:
|
||||
" To highlight chunk headers as R code, put in your vimrc (e.g. .config/nvim/init.vim):
|
||||
" let rmd_syn_hl_chunk = 1
|
||||
"
|
||||
" For highlighting pandoc extensions to markdown like citations and TeX and
|
||||
" many other advanced features like folding of markdown sections, it is
|
||||
" recommended to install the vim-pandoc filetype plugin as well as the
|
||||
" vim-pandoc-syntax filetype plugin from https://github.com/vim-pandoc.
|
||||
"
|
||||
" TODO:
|
||||
" - Provide highlighting for rmarkdown parameters in yaml header
|
||||
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
endif
|
||||
|
||||
" load all of pandoc info
|
||||
" load all of pandoc info, e.g. from
|
||||
" https://github.com/vim-pandoc/vim-pandoc-syntax
|
||||
runtime syntax/pandoc.vim
|
||||
if exists("b:current_syntax")
|
||||
let rmdIsPandoc = 1
|
||||
@@ -22,28 +31,54 @@ else
|
||||
if exists("b:current_syntax")
|
||||
unlet b:current_syntax
|
||||
endif
|
||||
|
||||
" load all of the yaml syntax highlighting rules into @yaml
|
||||
syntax include @yaml syntax/yaml.vim
|
||||
if exists("b:current_syntax")
|
||||
unlet b:current_syntax
|
||||
endif
|
||||
|
||||
" highlight yaml block commonly used for front matter
|
||||
syntax region rmdYamlBlock matchgroup=rmdYamlBlockDelim start="^---" matchgroup=rmdYamlBlockDelim end="^---" contains=@yaml keepend fold
|
||||
endif
|
||||
|
||||
" load all of the r syntax highlighting rules into @R
|
||||
syntax include @R syntax/r.vim
|
||||
if exists("b:current_syntax")
|
||||
unlet b:current_syntax
|
||||
endif
|
||||
|
||||
if exists("g:rmd_syn_hl_chunk")
|
||||
" highlight R code inside chunk header
|
||||
syntax match rmdChunkDelim "^[ \t]*```{r" contained
|
||||
syntax match rmdChunkDelim "}$" contained
|
||||
if !exists("g:rmd_syn_langs")
|
||||
let g:rmd_syn_langs = ["r"]
|
||||
else
|
||||
syntax match rmdChunkDelim "^[ \t]*```{r.*}$" contained
|
||||
let s:hasr = 0
|
||||
for s:lng in g:rmd_syn_langs
|
||||
if s:lng == "r"
|
||||
let s:hasr = 1
|
||||
endif
|
||||
endfor
|
||||
if s:hasr == 0
|
||||
let g:rmd_syn_langs += ["r"]
|
||||
endif
|
||||
endif
|
||||
syntax match rmdChunkDelim "^[ \t]*```$" contained
|
||||
syntax region rmdChunk start="^[ \t]*``` *{r.*}$" end="^[ \t]*```$" contains=@R,rmdChunkDelim keepend fold
|
||||
|
||||
for s:lng in g:rmd_syn_langs
|
||||
exe 'syntax include @' . toupper(s:lng) . ' syntax/'. s:lng . '.vim'
|
||||
if exists("b:current_syntax")
|
||||
unlet b:current_syntax
|
||||
endif
|
||||
exe 'syntax region rmd' . toupper(s:lng) . 'Chunk start="^[ \t]*``` *{\(' . s:lng . '\|r.*engine\s*=\s*["' . "']" . s:lng . "['" . '"]\).*}$" end="^[ \t]*```$" contains=@' . toupper(s:lng) . ',rmd' . toupper(s:lng) . 'ChunkDelim keepend fold'
|
||||
|
||||
if exists("g:rmd_syn_hl_chunk") && s:lng == "r"
|
||||
" highlight R code inside chunk header
|
||||
syntax match rmdRChunkDelim "^[ \t]*```{r" contained
|
||||
syntax match rmdRChunkDelim "}$" contained
|
||||
else
|
||||
exe 'syntax match rmd' . toupper(s:lng) . 'ChunkDelim "^[ \t]*```{\(' . s:lng . '\|r.*engine\s*=\s*["' . "']" . s:lng . "['" . '"]\).*}$" contained'
|
||||
endif
|
||||
exe 'syntax match rmd' . toupper(s:lng) . 'ChunkDelim "^[ \t]*```$" contained'
|
||||
endfor
|
||||
|
||||
|
||||
" also match and syntax highlight in-line R code
|
||||
syntax match rmdEndInline "`" contained
|
||||
syntax match rmdBeginInline "`r " contained
|
||||
syntax region rmdrInline start="`r " end="`" contains=@R,rmdBeginInline,rmdEndInline keepend
|
||||
syntax region rmdrInline matchgroup=rmdInlineDelim start="`r " end="`" contains=@R containedin=pandocLaTeXRegion,yamlFlowString keepend
|
||||
" I was not able to highlight rmdrInline inside a pandocLaTeXCommand, although
|
||||
" highlighting works within pandocLaTeXRegion and yamlFlowString.
|
||||
syntax cluster texMathZoneGroup add=rmdrInline
|
||||
|
||||
" match slidify special marker
|
||||
syntax match rmdSlidifySpecial "\*\*\*"
|
||||
@@ -56,8 +91,6 @@ if rmdIsPandoc == 0
|
||||
if exists("b:current_syntax")
|
||||
unlet b:current_syntax
|
||||
endif
|
||||
" Extend cluster
|
||||
syn cluster texMathZoneGroup add=rmdrInline
|
||||
" Inline
|
||||
syntax match rmdLaTeXInlDelim "\$"
|
||||
syntax match rmdLaTeXInlDelim "\\\$"
|
||||
@@ -65,19 +98,24 @@ if rmdIsPandoc == 0
|
||||
" Region
|
||||
syntax match rmdLaTeXRegDelim "\$\$" contained
|
||||
syntax match rmdLaTeXRegDelim "\$\$latex$" contained
|
||||
syntax region rmdLaTeXRegion start="^\$\$" skip="\\\$" end="\$\$$" contains=@LaTeX,rmdLaTeXSt,rmdLaTeXRegDelim keepend
|
||||
syntax region rmdLaTeXRegion2 start="^\\\[" end="\\\]" contains=@LaTeX,rmdLaTeXSt,rmdLaTeXRegDelim keepend
|
||||
syntax match rmdLaTeXSt "\\[a-zA-Z]\+"
|
||||
syntax region rmdLaTeXRegion start="^\$\$" skip="\\\$" end="\$\$$" contains=@LaTeX,rmdLaTeXRegDelim keepend
|
||||
syntax region rmdLaTeXRegion2 start="^\\\[" end="\\\]" contains=@LaTeX,rmdLaTeXRegDelim keepend
|
||||
hi def link rmdBlockQuote Comment
|
||||
hi def link rmdLaTeXSt Statement
|
||||
hi def link rmdLaTeXInlDelim Special
|
||||
hi def link rmdLaTeXRegDelim Special
|
||||
endif
|
||||
|
||||
syn sync match rmdSyncChunk grouphere rmdChunk "^[ \t]*``` *{r"
|
||||
for s:lng in g:rmd_syn_langs
|
||||
exe 'syn sync match rmd' . toupper(s:lng) . 'SyncChunk grouphere rmd' . toupper(s:lng) . 'Chunk /^[ \t]*``` *{\(' . s:lng . '\|r.*engine\s*=\s*["' . "']" . s:lng . "['" . '"]\)/'
|
||||
endfor
|
||||
|
||||
hi def link rmdChunkDelim Special
|
||||
hi def link rmdBeginInline Special
|
||||
hi def link rmdEndInline Special
|
||||
hi def link rmdBlockQuote Comment
|
||||
hi def link rmdYamlBlockDelim Delim
|
||||
for s:lng in g:rmd_syn_langs
|
||||
exe 'hi def link rmd' . toupper(s:lng) . 'ChunkDelim Special'
|
||||
endfor
|
||||
hi def link rmdInlineDelim Special
|
||||
hi def link rmdSlidifySpecial Special
|
||||
|
||||
let b:current_syntax = "rmd"
|
||||
|
||||
+240
-242
@@ -1,262 +1,259 @@
|
||||
" Vim syntax file
|
||||
" Language: SAS
|
||||
" Maintainer: James Kidd <james.kidd@covance.com>
|
||||
" Last Change: 2012 Apr 20
|
||||
" Corrected bug causing some keywords to appear as strings instead
|
||||
" 18 Jul 2008 by Paulo Tanimoto <ptanimoto@gmail.com>
|
||||
" Fixed comments with * taking multiple lines.
|
||||
" Fixed highlighting of macro keywords.
|
||||
" Added words to cases that didn't fit anywhere.
|
||||
" 02 Jun 2003
|
||||
" Added highlighting for additional keywords and such;
|
||||
" Attempted to match SAS default syntax colors;
|
||||
" Changed syncing so it doesn't lose colors on large blocks;
|
||||
" Much thanks to Bob Heckel for knowledgeable tweaking.
|
||||
" quit when a syntax file was already loaded
|
||||
if exists("b:current_syntax")
|
||||
finish
|
||||
" Language: SAS
|
||||
" Maintainer: Zhen-Huan Hu <wildkeny@gmail.com>
|
||||
" Original Maintainer: James Kidd <james.kidd@covance.com>
|
||||
" Version: 3.0.0
|
||||
" Last Change: Mar 10, 2017
|
||||
"
|
||||
" 2017 Mar 7
|
||||
"
|
||||
" Upgrade version number to 3.0. Improvements include:
|
||||
" - Improve sync speed
|
||||
" - Largely enhance precision
|
||||
" - Update keywords in the latest SAS (as of Mar 2017)
|
||||
" - Add syntaxes for date/time constants
|
||||
" - Add syntax for data lines
|
||||
" - Add (back) syntax for TODO in comments
|
||||
"
|
||||
" 2017 Feb 9
|
||||
"
|
||||
" Add syntax folding
|
||||
"
|
||||
" 2016 Oct 10
|
||||
"
|
||||
" Add highlighting for functions
|
||||
"
|
||||
" 2016 Sep 14
|
||||
"
|
||||
" Change the implementation of syntaxing
|
||||
" macro function names so that macro parameters same
|
||||
" as SAS keywords won't be highlighted
|
||||
" (Thank Joug Raw for the suggestion)
|
||||
" Add section highlighting:
|
||||
" - Use /** and **/ to define a section
|
||||
" - It functions the same as a comment but
|
||||
" with different highlighting
|
||||
"
|
||||
" 2016 Jun 14
|
||||
"
|
||||
" Major changes so upgrade version number to 2.0
|
||||
" Overhaul the entire script (again). Improvements include:
|
||||
" - Higher precision
|
||||
" - Faster synchronization
|
||||
" - Separate color for control statements
|
||||
" - Highlight hash and java objects
|
||||
" - Highlight macro variables in double quoted strings
|
||||
" - Update all syntaxes based on SAS 9.4
|
||||
" - Add complete SAS/GRAPH and SAS/STAT procedure syntaxes
|
||||
" - Add Proc TEMPLATE and GTL syntaxes
|
||||
" - Add complete DS2 syntaxes
|
||||
" - Add basic IML syntaxes
|
||||
" - Many other improvements and bug fixes
|
||||
" Drop support for VIM version < 600
|
||||
|
||||
if version < 600
|
||||
syntax clear
|
||||
elseif exists('b:current_syntax')
|
||||
finish
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo&vim
|
||||
|
||||
syn case ignore
|
||||
|
||||
syn region sasString start=+"+ skip=+\\\\\|\\"+ end=+"+
|
||||
syn region sasString start=+'+ skip=+\\\\\|\\"+ end=+'+
|
||||
" Basic SAS syntaxes
|
||||
syn keyword sasOperator and eq ge gt in le lt ne not of or
|
||||
syn keyword sasReserved _all_ _automatic_ _char_ _character_ _data_ _infile_ _last_ _n_ _name_ _null_ _num_ _numeric_ _temporary_ _user_ _webout_
|
||||
" Strings
|
||||
syn region sasString start=+'+ skip=+''+ end=+'+ contains=@Spell
|
||||
syn region sasString start=+"+ skip=+""+ end=+"+ contains=sasMacroVariable,@Spell
|
||||
" Constants
|
||||
syn match sasNumber /\v<\d+%(\.\d+)=%(>|e[\-+]=\d+>)/ display
|
||||
syn match sasDateTime /\v(['"])\d{2}%(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d{2}%(\d{2})=:\d{2}:\d{2}%(:\d{2})=%(am|pm)\1dt>/ display
|
||||
syn match sasDateTime /\v(['"])\d{2}%(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\d{2}%(\d{2})=\1d>/ display
|
||||
syn match sasDateTime /\v(['"])\d{2}:\d{2}%(:\d{2})=%(am|pm)\1t>/ display
|
||||
" Comments
|
||||
syn keyword sasTodo todo tbd fixme contained
|
||||
syn region sasComment start='/\*' end='\*/' contains=sasTodo
|
||||
syn region sasComment start='\v%(^|;)\s*\zs\%=\*' end=';'me=s-1 contains=sasTodo
|
||||
syn region sasSectLbl matchgroup=sasSectLblEnds start='/\*\*\s*' end='\s*\*\*/' concealends
|
||||
" Macros
|
||||
syn match sasMacroVariable '\v\&+\w+%(\.\w+)=' display
|
||||
syn match sasMacroReserved '\v\%%(abort|by|copy|display|do|else|end|global|goto|if|include|input|let|list|local|macro|mend|put|return|run|symdel|syscall|sysexec|syslput|sysrput|then|to|until|window|while)>' display
|
||||
syn region sasMacroFunction matchgroup=sasMacroFunctionName start='\v\%\w+\ze\(' end=')'he=s-1 contains=@sasBasicSyntax,sasMacroFunction
|
||||
syn region sasMacroFunction matchgroup=sasMacroFunctionName start='\v\%q=sysfunc\ze\(' end=')'he=s-1 contains=@sasBasicSyntax,sasMacroFunction,sasDataStepFunction
|
||||
" Syntax cluster for basic SAS syntaxes
|
||||
syn cluster sasBasicSyntax contains=sasOperator,sasReserved,sasNumber,sasDateTime,sasString,sasComment,sasMacroReserved,sasMacroFunction,sasMacroVariable,sasSectLbl
|
||||
|
||||
" Want region from 'cards;' to ';' to be captured (Bob Heckel)
|
||||
syn region sasCards start="^\s*CARDS.*" end="^\s*;\s*$"
|
||||
syn region sasCards start="^\s*DATALINES.*" end="^\s*;\s*$"
|
||||
" Formats
|
||||
syn match sasFormat '\v\$\w+\.' display contained
|
||||
syn match sasFormat '\v<\w+\.%(\d+>)=' display contained
|
||||
syn region sasFormatContext start='.' end=';'me=s-1 contained contains=@sasBasicSyntax,sasFormat
|
||||
|
||||
syn match sasNumber "-\=\<\d*\.\=[0-9_]\>"
|
||||
" Define global statements that can be accessed out of data step or procedures
|
||||
syn keyword sasGlobalStatementKeyword catname dm endsas filename footnote footnote1 footnote2 footnote3 footnote4 footnote5 footnote6 footnote7 footnote8 footnote9 footnote10 missing libname lock ods options page quit resetline run sasfile skip sysecho title title1 title2 title3 title4 title5 title6 title7 title8 title9 title10 contained
|
||||
syn keyword sasGlobalStatementODSKeyword chtml csvall docbook document escapechar epub epub2 epub3 exclude excel graphics html html3 html5 htmlcss imode listing markup output package path pcl pdf preferences phtml powerpoint printer proclabel proctitle ps results rtf select show tagsets trace usegopt verify wml contained
|
||||
syn match sasGlobalStatement '\v%(^|;)\s*\zs\h\w*>' display transparent contains=sasGlobalStatementKeyword
|
||||
syn match sasGlobalStatement '\v%(^|;)\s*\zsods>' display transparent contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
|
||||
|
||||
" Block comment
|
||||
syn region sasComment start="/\*" end="\*/" contains=sasTodo
|
||||
" Data step statements, 9.4
|
||||
syn keyword sasDataStepFunctionName abs addr addrlong airy allcomb allperm anyalnum anyalpha anycntrl anydigit anyfirst anygraph anylower anyname anyprint anypunct anyspace anyupper anyxdigit arcos arcosh arsin arsinh artanh atan atan2 attrc attrn band beta betainv blackclprc blackptprc blkshclprc blkshptprc blshift bnot bor brshift bxor byte cat catq cats catt catx cdf ceil ceilz cexist char choosec choosen cinv close cmiss cnonct coalesce coalescec collate comb compare compbl compfuzz compged complev compound compress constant convx convxp cos cosh cot count countc countw csc css cumipmt cumprinc curobs cv daccdb daccdbsl daccsl daccsyd dacctab dairy datdif date datejul datepart datetime day dclose dcreate depdb depdbsl depsl depsyd deptab dequote deviance dhms dif digamma dim dinfo divide dnum dopen doptname doptnum dosubl dread dropnote dsname dsncatlgd dur durp effrate envlen erf erfc euclid exist exp fact fappend fclose fcol fcopy fdelete fetch fetchobs fexist fget fileexist filename fileref finance find findc findw finfo finv fipname fipnamel fipstate first floor floorz fmtinfo fnonct fnote fopen foptname foptnum fpoint fpos fput fread frewind frlen fsep fuzz fwrite gaminv gamma garkhclprc garkhptprc gcd geodist geomean geomeanz getoption getvarc getvarn graycode harmean harmeanz hbound hms holiday holidayck holidaycount holidayname holidaynx holidayny holidaytest hour htmldecode htmlencode ibessel ifc ifn index indexc indexw input inputc inputn int intcindex intck intcycle intfit intfmt intget intindex intnx intrr intseas intshift inttest intz iorcmsg ipmt iqr irr jbessel juldate juldate7 kurtosis lag largest lbound lcm lcomb left length lengthc lengthm lengthn lexcomb lexcombi lexperk lexperm lfact lgamma libname libref log log1px log10 log2 logbeta logcdf logistic logpdf logsdf lowcase lperm lpnorm mad margrclprc margrptprc max md5 mdy mean median min minute missing mod modexist module modulec modulen modz month mopen mort msplint mvalid contained
|
||||
syn keyword sasDataStepFunctionName n netpv nliteral nmiss nomrate normal notalnum notalpha notcntrl notdigit note notfirst notgraph notlower notname notprint notpunct notspace notupper notxdigit npv nvalid nwkdom open ordinal pathname pctl pdf peek peekc peekclong peeklong perm pmt point poisson ppmt probbeta probbnml probbnrm probchi probf probgam probhypr probit probmc probnegb probnorm probt propcase prxchange prxmatch prxparen prxparse prxposn ptrlongadd put putc putn pvp qtr quantile quote ranbin rancau rand ranexp rangam range rank rannor ranpoi rantbl rantri ranuni rename repeat resolve reverse rewind right rms round rounde roundz saving savings scan sdf sec second sha256 sha256hex sha256hmachex sign sin sinh skewness sleep smallest soapweb soapwebmeta soapwipservice soapwipsrs soapws soapwsmeta soundex spedis sqrt squantile std stderr stfips stname stnamel strip subpad substr substrn sum sumabs symexist symget symglobl symlocal sysexist sysget sysmsg sysparm sysprocessid sysprocessname sysprod sysrc system tan tanh time timepart timevalue tinv tnonct today translate transtrn tranwrd trigamma trim trimn trunc tso typeof tzoneid tzonename tzoneoff tzones2u tzoneu2s uniform upcase urldecode urlencode uss uuidgen var varfmt varinfmt varlabel varlen varname varnum varray varrayx vartype verify vformat vformatd vformatdx vformatn vformatnx vformatw vformatwx vformatx vinarray vinarrayx vinformat vinformatd vinformatdx vinformatn vinformatnx vinformatw vinformatwx vinformatx vlabel vlabelx vlength vlengthx vname vnamex vtype vtypex vvalue vvaluex week weekday whichc whichn wto year yieldp yrdif yyq zipcity zipcitydistance zipfips zipname zipnamel zipstate contained
|
||||
syn keyword sasDataStepCallRoutineName allcomb allcombi allperm cats catt catx compcost execute graycode is8601_convert label lexcomb lexcombi lexperk lexperm logistic missing module poke pokelong prxchange prxdebug prxfree prxnext prxposn prxsubstr ranbin rancau rancomb ranexp rangam rannor ranperk ranperm ranpoi rantbl rantri ranuni scan set sleep softmax sortc sortn stdize streaminit symput symputx system tanh tso vname vnext wto contained
|
||||
syn region sasDataStepFunctionContext start='(' end=')' contained contains=@sasBasicSyntax,sasDataStepFunction
|
||||
syn region sasDataStepFunctionFormatContext start='(' end=')' contained contains=@sasBasicSyntax,sasDataStepFunction,sasFormat
|
||||
syn match sasDataStepFunction '\v<\w+\ze\(' contained contains=sasDataStepFunctionName,sasDataStepCallRoutineName nextgroup=sasDataStepFunctionContext
|
||||
syn match sasDataStepFunction '\v%(input|put)\ze\(' contained contains=sasDataStepFunctionName nextgroup=sasDataStepFunctionFormatContext
|
||||
syn keyword sasDataStepHashMethodName add check clear definedata definedone definekey delete do_over equals find find_next find_prev first has_next has_prev last next output prev ref remove removedup replace replacedup reset_dup setcur sum sumdup contained
|
||||
syn region sasDataStepHashMethodContext start='(' end=')' contained contains=@sasBasicSyntax,sasDataStepFunction
|
||||
syn match sasDataStepHashMethod '\v\.\w+\ze\(' contained contains=sasDataStepHashMethodName nextgroup=sasDataStepHashMethodContext
|
||||
syn keyword sasDataStepHashAttributeName item_size num_items contained
|
||||
syn match sasDataStepHashAttribute '\v\.\w+>\ze\_[^(]' display contained contains=sasDataStepHashAttributeName
|
||||
syn keyword sasDataStepControl continue do end go goto if leave link otherwise over return select to until when while contained
|
||||
syn keyword sasDataStepControl else then contained nextgroup=sasDataStepStatementKeyword skipwhite skipnl skipempty
|
||||
syn keyword sasDataStepHashOperator _new_ contained
|
||||
syn keyword sasDataStepStatementKeyword abort array attrib by call cards cards4 datalines datalines4 dcl declare delete describe display drop error execute file format infile informat input keep label length lines lines4 list lostcard merge modify output put putlog redirect remove rename replace retain set stop update where window contained
|
||||
syn keyword sasDataStepStatementHashKeyword hash hiter javaobj contained
|
||||
syn match sasDataStepStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasDataStepStatementKeyword,sasGlobalStatementKeyword
|
||||
syn match sasDataStepStatement '\v%(^|;)\s*\zs%(dcl|declare)>' display contained contains=sasDataStepStatementKeyword nextgroup=sasDataStepStatementHashKeyword skipwhite skipnl skipempty
|
||||
syn match sasDataStepStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
|
||||
syn match sasDataStepStatement '\v%(^|;)\s*\zs%(format|informat|input|put)>' display contained contains=sasDataStepStatementKeyword nextgroup=sasFormatContext skipwhite skipnl skipempty
|
||||
syn match sasDataStepStatement '\v%(^|;)\s*\zs%(cards|datalines|lines)4=\s*;' display contained contains=sasDataStepStatementKeyword nextgroup=sasDataLine skipwhite skipnl skipempty
|
||||
syn region sasDataLine start='^' end='^;'me=s-1 contained
|
||||
syn region sasDataStep matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsdata>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,@sasDataStepSyntax
|
||||
syn cluster sasDataStepSyntax contains=sasDataStepFunction,sasDataStepHashOperator,sasDataStepHashAttribute,sasDataStepHashMethod,sasDataStepControl,sasDataStepStatement
|
||||
|
||||
" Ignore misleading //JCL SYNTAX... (Bob Heckel)
|
||||
syn region sasComment start="[^/][^/]/\*" end="\*/" contains=sasTodo
|
||||
" Procedures, base SAS, 9.4
|
||||
syn keyword sasProcStatementKeyword abort age append array attrib audit block break by calid cdfplot change checkbox class classlev column compute contents copy create datarow dbencoding define delete deletefunc deletesubr delimiter device dialog dur endcomp exact exchange exclude explore fin fmtlib fontfile fontpath format formats freq function getnames guessingrows hbar hdfs histogram holidur holifin holistart holivar id idlabel informat inset invalue item key keylabel keyword label line link listfunc listsubr mapmiss mapreduce mean menu messages meta modify opentype outargs outdur outfin output outstart pageby partial picture pie pig plot ppplot printer probplot profile prompter qqplot radiobox ranks rbreak rbutton rebuild record remove rename repair report roptions save select selection separator source star start statistics struct submenu subroutine sum sumby table tables test text trantab truetype type1 types value var vbar ways weight where with write contained
|
||||
syn match sasProcStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasProcStatementKeyword,sasGlobalStatementKeyword
|
||||
syn match sasProcStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
|
||||
syn match sasProcStatement '\v%(^|;)\s*\zs%(format|informat)>' display contained contains=sasProcStatementKeyword nextgroup=sasFormatContext skipwhite skipnl skipempty
|
||||
syn region sasProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc%(\s+\h\w*)=>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepFunction,sasProcStatement
|
||||
syn region sasProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(catalog|chart|datasets|document|plot)>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepFunction,sasProcStatement
|
||||
|
||||
" Previous code for comments was written by Bob Heckel
|
||||
" Comments with * may take multiple lines (Paulo Tanimoto)
|
||||
syn region sasComment start=";\s*\*"hs=s+1 end=";" contains=sasTodo
|
||||
" Procedures, SAS/GRAPH, 9.4
|
||||
syn keyword sasGraphProcStatementKeyword add area axis bar block bubble2 byline cc ccopy cdef cdelete chart cmap choro copy delete device dial donut exclude flow format fs goptions gout grid group hbar hbar3d hbullet hslider htrafficlight id igout label legend list modify move nobyline note pattern pie pie3d plot plot2 preview prism quit rename replay select scatter speedometer star surface symbol tc tcopy tdef tdelete template tile toggle treplay vbar vbar3d vtrafficlight vbullet vslider where contained
|
||||
syn match sasGraphProcStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasGraphProcStatementKeyword,sasGlobalStatementKeyword
|
||||
syn match sasGraphProcStatement '\v%(^|;)\s*\zsformat>' display contained contains=sasGraphProcStatementKeyword nextgroup=sasFormatContext skipwhite skipnl skipempty
|
||||
syn region sasGraphProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(g3d|g3grid|ganno|gcontour|gdevice|geocode|gfont|ginside|goptions|gproject|greduce|gremove|mapimport)>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepFunction,sasGraphProcStatement
|
||||
syn region sasGraphProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(gareabar|gbarline|gchart|gkpi|gmap|gplot|gradar|greplay|gslide|gtile)>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepFunction,sasGraphProcStatement
|
||||
|
||||
" Comments with * starting after a semicolon (Paulo Tanimoto)
|
||||
syn region sasComment start="^\s*\*" end=";" contains=sasTodo
|
||||
" Procedures, SAS/STAT, 14.1
|
||||
syn keyword sasAnalyticalProcStatementKeyword absorb add array assess baseline bayes beginnodata bivar bootstrap bounds by cdfplot cells class cluster code compute condition contrast control coordinates copy cosan cov covtest coxreg der design determ deviance direct directions domain effect effectplot effpart em endnodata equality estimate exact exactoptions factor factors fcs filter fitindex format freq fwdlink gender grid group grow hazardratio height hyperprior id impjoint inset insetgroup invar invlink ippplot lincon lineqs lismod lmtests location logistic loglin lpredplot lsmeans lsmestimate manova matings matrix mcmc mean means missmodel mnar model modelaverage modeleffects monotone mstruct mtest multreg name nlincon nloptions oddsratio onecorr onesamplefreq onesamplemeans onewayanova outfiles output paired pairedfreq pairedmeans parameters parent parms partial partition path pathdiagram pcov performance plot population poststrata power preddist predict predpplot priors process probmodel profile prune pvar ram random ratio reference refit refmodel renameparm repeated replicate repweights response restore restrict retain reweight ridge rmsstd roc roccontrast rules samplesize samplingunit seed size scale score selection show simtests simulate slice std stderr store strata structeq supplementary table tables test testclass testfreq testfunc testid time transform treatments trend twosamplefreq twosamplemeans towsamplesurvival twosamplewilcoxon uds units univar var variance varnames weight where with zeromodel contained
|
||||
syn match sasAnalyticalProcStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasAnalyticalProcStatementKeyword,sasGlobalStatementKeyword
|
||||
syn match sasAnalyticalProcStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
|
||||
syn match sasAnalyticalProcStatement '\v%(^|;)\s*\zsformat>' display contained contains=sasAnalyticalProcStatementKeyword nextgroup=sasFormatContext skipwhite skipnl skipempty
|
||||
syn region sasAnalyticalProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(aceclus|adaptivereg|bchoice|boxplot|calis|cancorr|candisc|cluster|corresp|discrim|distance|factor|fastclus|fmm|freq|gam|gampl|gee|genmod|glimmix|glmmod|glmpower|glmselect|hpcandisc|hpfmm|hpgenselect|hplmixed|hplogistic|hpmixed|hpnlmod|hppls|hpprincomp|hpquantselect|hpreg|hpsplit|iclifetest|icphreg|inbreed|irt|kde|krige2d|lattice|lifereg|lifetest|loess|logistic|mcmc|mds|mi|mianalyze|mixed|modeclus|multtest|nested|nlin|nlmixed|npar1way|orthoreg|phreg|plm|pls|power|princomp|prinqual|probit|quantlife|quantreg|quantselect|robustreg|rsreg|score|seqdesign|seqtest|sim2d|simnormal|spp|stdize|stdrate|stepdisc|surveyfreq|surveyimpute|surveylogistic|surveymeans|surveyphreg|surveyreg|surveyselect|tpspline|transreg|tree|ttest|varclus|varcomp|variogram)>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepControl,sasDataStepFunction,sasAnalyticalProcStatement
|
||||
syn region sasAnalyticalProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(anova|arima|catmod|factex|glm|model|optex|plan|reg)>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepControl,sasDataStepFunction,sasAnalyticalProcStatement
|
||||
|
||||
" This line defines macro variables in code. "hi def link" at end of file
|
||||
" defines the color scheme. Begin region with ampersand and end with
|
||||
" any non-word character offset by -1; put ampersand in the skip list
|
||||
" just in case it is used to concatenate macro variable values.
|
||||
" Procedures, ODS graphics, 9.4
|
||||
syn keyword sasODSGraphicsProcStatementKeyword band block bubble by colaxis compare dattrvar density dot dropline dynamic ellipse ellipseparm format fringe gradlegend hbar hbarbasic hbarparm hbox heatmap heatmapparm highlow histogram hline inset keylegend label lineparm loess matrix needle parent panelby pbspline plot polygon refline reg rowaxis scatter series spline step style styleattrs symbolchar symbolimage text vbar vbarbasic vbarparm vbox vector vline waterfall where xaxis x2axis yaxis y2axis yaxistable contained
|
||||
syn match sasODSGraphicsProcStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasODSGraphicsProcStatementKeyword,sasGlobalStatementKeyword
|
||||
syn match sasODSGraphicsProcStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
|
||||
syn match sasODSGraphicsProcStatement '\v%(^|;)\s*\zsformat>' display contained contains=sasODSGraphicsProcStatementKeyword nextgroup=sasFormatContext skipwhite skipnl skipempty
|
||||
syn region sasODSGraphicsProc matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+%(sgdesign|sgpanel|sgplot|sgrender|sgscatter)>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDataStepFunction,sasODSGraphicsProcStatement
|
||||
|
||||
" Thanks to ronald höllwarth for this fix to an intra-versioning
|
||||
" problem with this little feature
|
||||
" Proc TEMPLATE, 9.4
|
||||
syn keyword sasProcTemplateClause as into
|
||||
syn keyword sasProcTemplateStatementKeyword block break cellstyle class close column compute continue define delete delstream do done dynamic edit else end eval flush footer header import iterate link list mvar ndent next nmvar notes open path put putl putlog putq putstream putvars replace set source stop style test text text2 text3 translate trigger unblock unset xdent contained
|
||||
syn keyword sasProcTemplateStatementComplexKeyword cellvalue column crosstabs event footer header statgraph style table tagset contained
|
||||
syn keyword sasProcTemplateGTLStatementKeyword axislegend axistable bandplot barchart barchartparm begingraph beginpolygon beginpolyline bihistogram3dparm blockplot boxplot boxplotparm bubbleplot continuouslegend contourplotparm dendrogram discretelegend drawarrow drawimage drawline drawoval drawrectangle drawtext dropline ellipse ellipseparm endgraph endinnermargin endlayout endpolygon endpolyline endsidebar entry entryfootnote entrytitle fringeplot heatmap heatmapparm highlowplot histogram histogramparm innermargin layout legenditem legendtextitems linechart lineparm loessplot mergedlegend modelband needleplot pbsplineplot polygonplot referenceline regressionplot scatterplot seriesplot sidebar stepplot surfaceplotparm symbolchar symbolimage textplot vectorplot waterfallchart contained
|
||||
syn keyword sasProcTemplateGTLComplexKeyword datalattice datapanel globallegend gridded lattice overlay overlayequated overlay3d region contained
|
||||
syn match sasProcTemplateStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasProcTemplateStatementKeyword,sasProcTemplateGTLStatementKeyword,sasGlobalStatementKeyword
|
||||
syn match sasProcTemplateStatement '\v%(^|;)\s*\zsdefine>' display contained contains=sasProcTemplateStatementKeyword nextgroup=sasProcTemplateStatementComplexKeyword skipwhite skipnl skipempty
|
||||
syn match sasProcTemplateStatement '\v%(^|;)\s*\zslayout>' display contained contains=sasProcTemplateGTLStatementKeyword nextgroup=sasProcTemplateGTLComplexKeyword skipwhite skipnl skipempty
|
||||
syn match sasProcTemplateStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
|
||||
syn region sasProcTemplate matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+template>' end='\v%(^|;)\s*%(run|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasProcTemplateClause,sasProcTemplateStatement
|
||||
|
||||
syn region sasMacroVar start="&" skip="[_&]" end="\W"he=e-1
|
||||
" Proc SQL, 9.4
|
||||
syn keyword sasProcSQLFunctionName avg count css cv freq max mean median min n nmiss prt range std stderr sum sumwgt t uss var contained
|
||||
syn region sasProcSQLFunctionContext start='(' end=')' contained contains=@sasBasicSyntax,sasProcSQLFunction
|
||||
syn match sasProcSQLFunction '\v<\w+\ze\(' contained contains=sasProcSQLFunctionName,sasDataStepFunctionName nextgroup=sasProcSQLFunctionContext
|
||||
syn keyword sasProcSQLClause add asc between by calculated cascade case check connection constraint cross desc distinct drop else end escape except exists foreign from full group having in inner intersect into is join key left libname like modify natural newline notrim null on order outer primary references restrict right separated set then to trimmed union unique user using values when where contained
|
||||
syn keyword sasProcSQLClause as contained nextgroup=sasProcSQLStatementKeyword skipwhite skipnl skipempty
|
||||
syn keyword sasProcSQLStatementKeyword connect delete disconnect execute insert reset select update validate contained
|
||||
syn keyword sasProcSQLStatementComplexKeyword alter create describe drop contained nextgroup=sasProcSQLStatementNextKeyword skipwhite skipnl skipempty
|
||||
syn keyword sasProcSQLStatementNextKeyword index table view contained
|
||||
syn match sasProcSQLStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasProcSQLStatementKeyword,sasGlobalStatementKeyword
|
||||
syn match sasProcSQLStatement '\v%(^|;)\s*\zs%(alter|create|describe|drop)>' display contained contains=sasProcSQLStatementComplexKeyword nextgroup=sasProcSQLStatementNextKeyword skipwhite skipnl skipempty
|
||||
syn match sasProcSQLStatement '\v%(^|;)\s*\zsvalidate>' display contained contains=sasProcSQLStatementKeyword nextgroup=sasProcSQLStatementKeyword,sasProcSQLStatementComplexKeyword skipwhite skipnl skipempty
|
||||
syn match sasProcSQLStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
|
||||
syn region sasProcSQL matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+sql>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasProcSQLFunction,sasProcSQLClause,sasProcSQLStatement
|
||||
|
||||
" SAS/DS2, 9.4
|
||||
syn keyword sasDS2FunctionName abs anyalnum anyalpha anycntrl anydigit anyfirst anygraph anylower anyname anyprint anypunct anyspace anyupper anyxdigit arcos arcosh arsin arsinh artanh atan atan2 band beta betainv blackclprc blackptprc blkshclprc blkshptprc blshift bnot bor brshift bxor byte cat cats catt catx ceil ceilz choosec choosen cmp cmpt coalesce coalescec comb compare compbl compfuzz compound compress constant convx convxp cos cosh count countc countw css cumipmt cumprinc cv datdif date datejul datepart datetime day dequote deviance dhms dif digamma dim divide dur durp effrate erf erfc exp fact find findc findw floor floorz fmtinfo fuzz gaminv gamma garkhclprc garkhptprc gcd geodist geomean geomeanz harmean harmeanz hbound hms holiday hour index indexc indexw inputc inputn int intcindex intck intcycle intdt intfit intget intindex intnest intnx intrr intseas intshift inttest intts intz ipmt iqr irr juldate juldate7 kcount kstrcat kstrip kupdate kupdates kurtosis lag largest lbound lcm left length lengthc lengthm lengthn lgamma log logbeta log10 log1px log2 lowcase mad margrclprc margrptprc max md5 mdy mean median min minute missing mod modz month mort n ndims netpv nmiss nomrate notalnum notalpha notcntrl notdigit notfirst notgraph notlower notname notprint notpunct notspace notupper notxdigit npv null nwkdom ordinal pctl perm pmt poisson power ppmt probbeta probbnml probbnrm probchi probdf probf probgam probhypr probit probmc probmed probnegb probnorm probt prxchange prxmatch prxparse prxposn put pvp qtr quote ranbin rancau rand ranexp rangam range rank rannor ranpoi rantbl rantri ranuni repeat reverse right rms round rounde roundz savings scan sec second sha256hex sha256hmachex sign sin sinh skewness sleep smallest sqlexec sqrt std stderr streaminit strip substr substrn sum sumabs tan tanh time timepart timevalue tinv to_date to_double to_time to_timestamp today translate transtrn tranwrd trigamma trim trimn trunc uniform upcase uss uuidgen var verify vformat vinarray vinformat vlabel vlength vname vtype week weekday whichc whichn year yieldp yrdif yyq contained
|
||||
syn region sasDS2FunctionContext start='(' end=')' contained contains=@sasBasicSyntax,sasDS2Function
|
||||
syn match sasDS2Function '\v<\w+\ze\(' contained contains=sasDS2FunctionName nextgroup=sasDS2FunctionContext
|
||||
syn keyword sasDS2Control continue data dcl declare do drop else end enddata endpackage endthread from go goto if leave method otherwise package point return select then thread to until when while contained
|
||||
syn keyword sasDS2StatementKeyword array by forward keep merge output put rename retain set stop vararray varlist contained
|
||||
syn keyword sasDS2StatementComplexKeyword package thread contained
|
||||
syn match sasDS2Statement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasDS2StatementKeyword,sasGlobalStatementKeyword
|
||||
syn match sasDS2Statement '\v%(^|;)\s*\zs%(dcl|declare|drop)>' display contained contains=sasDS2StatementKeyword nextgroup=sasDS2StatementComplexKeyword skipwhite skipnl skipempty
|
||||
syn match sasDS2Statement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
|
||||
syn region sasDS2 matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+ds2>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasDS2Function,sasDS2Control,sasDS2Statement
|
||||
|
||||
" I dont think specific PROCs need to be listed if use this line (Bob Heckel).
|
||||
syn match sasProc "^\s*PROC \w\+"
|
||||
syn keyword sasStep RUN QUIT DATA
|
||||
" SAS/IML, 14.1
|
||||
syn keyword sasIMLFunctionName abs all allcomb allperm any apply armasim bin blankstr block branks bspline btran byte char choose col colvec concat contents convexit corr corr2cov countmiss countn countunique cov cov2corr covlag cshape cusum cuprod cv cvexhull datasets design designf det diag dif dimension distance do duration echelon eigval eigvec element exp expmatrix expandgrid fft forward froot full gasetup geomean ginv hadamard half hankel harmean hdir hermite homogen i ifft insert int inv invupdt isempty isskipped j jroot kurtosis lag length loc log logabsdet mad magic mahalanobis max mean median min mod moduleic modulein name ncol ndx2sub nleng norm normal nrow num opscal orpol parentname palette polyroot prod product pv quartile rancomb randdirichlet randfun randmultinomial randmvt randnormal randwishart ranperk ranperm range rank ranktie rates ratio remove repeat root row rowcat rowcatc rowvec rsubstr sample setdif shape shapecol skewness solve sparse splinev spot sqrsym sqrt sqrvech ssq standard std storage sub2ndx substr sum sweep symsqr t toeplitz trace trisolv type uniform union unique uniqueby value var vecdiag vech xmult xsect yield contained
|
||||
syn keyword sasIMLCallRoutineName appcort armacov armalik bar box change comport delete eigen execute exportdatasettor exportmatrixtor farmacov farmafit farmalik farmasim fdif gaend gagetmem gagetval gainit gareeval garegen gasetcro gasetmut gasetobj gasetsel gblkvp gblkvpd gclose gdelete gdraw gdrawl geneig ggrid ginclude gopen gpie gpiexy gpoint gpoly gport gportpop gportstk gscale gscript gset gshow gsorth gstart gstop gstrlen gtext gvtext gwindow gxaxis gyaxis heatmapcont heatmapdisc histogram importdatasetfromr importmatrixfromr ipf itsolver kalcvf kalcvs kaldff kaldfs lav lcp lms lp lpsolve lts lupdt marg maxqform mcd milpsolve modulei mve nlpcg nlpdd nlpfdd nlpfea nlphqn nlplm nlpnms nlpnra nlpnrr nlpqn nlpqua nlptr ode odsgraph ortvec pgraf push qntl qr quad queue randgen randseed rdodt rupdt rename rupdt rzlind scatter seq seqscale seqshift seqscale seqshift series solvelin sort sortndx sound spline splinec svd tabulate tpspline tpsplnev tsbaysea tsdecomp tsmlocar tsmlomar tsmulmar tspears tspred tsroot tstvcar tsunimar valset varmacov varmalik varmasim vnormal vtsroot wavft wavget wavift wavprint wavthrsh contained
|
||||
syn region sasIMLFunctionContext start='(' end=')' contained contains=@sasBasicSyntax,sasIMLFunction
|
||||
syn match sasIMLFunction '\v<\w+\ze\(' contained contains=sasIMLFunctionName,sasDataStepFunction nextgroup=sasIMLFunctionContext
|
||||
syn keyword sasIMLControl abort by do else end finish goto if link pause quit resume return run start stop then to until while contained
|
||||
syn keyword sasIMLStatementKeyword append call close closefile create delete display edit file find force free index infile input list load mattrib print purge read remove replace reset save setin setout show sort store summary use window contained
|
||||
syn match sasIMLStatement '\v%(^|;)\s*\zs\h\w*>' display contained contains=sasIMLStatementKeyword,sasGlobalStatementKeyword
|
||||
syn match sasIMLStatement '\v%(^|;)\s*\zsods>' display contained contains=sasGlobalStatementKeyword nextgroup=sasGlobalStatementODSKeyword skipwhite skipnl skipempty
|
||||
syn region sasIML matchgroup=sasSectionKeyword start='\v%(^|;)\s*\zsproc\s+iml>' end='\v%(^|;)\s*%(quit|data|proc|endsas)>'me=s-1 fold contains=@sasBasicSyntax,sasIMLFunction,sasIMLControl,sasIMLStatement
|
||||
|
||||
" Macro definition
|
||||
syn region sasMacro start='\v\%macro>' end='\v\%mend>' fold keepend contains=@sasBasicSyntax,@sasDataStepSyntax,sasDataStep,sasProc,sasODSGraphicsProc,sasGraphProc,sasAnalyticalProc,sasProcTemplate,sasProcSQL,sasDS2,sasIML
|
||||
|
||||
" Base SAS Procs - version 8.1
|
||||
|
||||
syn keyword sasConditional DO ELSE END IF THEN UNTIL WHILE
|
||||
|
||||
syn keyword sasStatement ABORT ARRAY ATTRIB BY CALL CARDS CARDS4 CATNAME
|
||||
syn keyword sasStatement CONTINUE DATALINES DATALINES4 DELETE DISPLAY
|
||||
syn keyword sasStatement DM DROP ENDSAS ERROR FILE FILENAME FOOTNOTE
|
||||
syn keyword sasStatement FORMAT GOTO INFILE INFORMAT INPUT KEEP
|
||||
syn keyword sasStatement LABEL LEAVE LENGTH LIBNAME LINK LIST LOSTCARD
|
||||
syn keyword sasStatement MERGE MISSING MODIFY OPTIONS OUTPUT PAGE
|
||||
syn keyword sasStatement PUT REDIRECT REMOVE RENAME REPLACE RETAIN
|
||||
syn keyword sasStatement RETURN SELECT SET SKIP STARTSAS STOP TITLE
|
||||
syn keyword sasStatement UPDATE WAITSAS WHERE WINDOW X SYSTASK
|
||||
|
||||
" Keywords that are used in Proc SQL
|
||||
" I left them as statements because SAS's enhanced editor highlights
|
||||
" them the same as normal statements used in data steps (Jim Kidd)
|
||||
|
||||
syn keyword sasStatement ADD AND ALTER AS CASCADE CHECK CREATE
|
||||
syn keyword sasStatement DELETE DESCRIBE DISTINCT DROP FOREIGN
|
||||
syn keyword sasStatement FROM GROUP HAVING INDEX INSERT INTO IN
|
||||
syn keyword sasStatement KEY LIKE MESSAGE MODIFY MSGTYPE NOT
|
||||
syn keyword sasStatement NULL ON OR ORDER PRIMARY REFERENCES
|
||||
syn keyword sasStatement RESET RESTRICT SELECT SET TABLE
|
||||
syn keyword sasStatement UNIQUE UPDATE VALIDATE VIEW WHERE
|
||||
|
||||
" Match declarations have to appear one per line (Paulo Tanimoto)
|
||||
syn match sasStatement "FOOTNOTE\d"
|
||||
syn match sasStatement "TITLE\d"
|
||||
|
||||
" Match declarations have to appear one per line (Paulo Tanimoto)
|
||||
syn match sasMacro "%BQUOTE"
|
||||
syn match sasMacro "%NRBQUOTE"
|
||||
syn match sasMacro "%CMPRES"
|
||||
syn match sasMacro "%QCMPRES"
|
||||
syn match sasMacro "%COMPSTOR"
|
||||
syn match sasMacro "%DATATYP"
|
||||
syn match sasMacro "%DISPLAY"
|
||||
syn match sasMacro "%DO"
|
||||
syn match sasMacro "%ELSE"
|
||||
syn match sasMacro "%END"
|
||||
syn match sasMacro "%EVAL"
|
||||
syn match sasMacro "%GLOBAL"
|
||||
syn match sasMacro "%GOTO"
|
||||
syn match sasMacro "%IF"
|
||||
syn match sasMacro "%INDEX"
|
||||
syn match sasMacro "%INPUT"
|
||||
syn match sasMacro "%KEYDEF"
|
||||
syn match sasMacro "%LABEL"
|
||||
syn match sasMacro "%LEFT"
|
||||
syn match sasMacro "%LENGTH"
|
||||
syn match sasMacro "%LET"
|
||||
syn match sasMacro "%LOCAL"
|
||||
syn match sasMacro "%LOWCASE"
|
||||
syn match sasMacro "%MACRO"
|
||||
syn match sasMacro "%MEND"
|
||||
syn match sasMacro "%NRBQUOTE"
|
||||
syn match sasMacro "%NRQUOTE"
|
||||
syn match sasMacro "%NRSTR"
|
||||
syn match sasMacro "%PUT"
|
||||
syn match sasMacro "%QCMPRES"
|
||||
syn match sasMacro "%QLEFT"
|
||||
syn match sasMacro "%QLOWCASE"
|
||||
syn match sasMacro "%QSCAN"
|
||||
syn match sasMacro "%QSUBSTR"
|
||||
syn match sasMacro "%QSYSFUNC"
|
||||
syn match sasMacro "%QTRIM"
|
||||
syn match sasMacro "%QUOTE"
|
||||
syn match sasMacro "%QUPCASE"
|
||||
syn match sasMacro "%SCAN"
|
||||
syn match sasMacro "%STR"
|
||||
syn match sasMacro "%SUBSTR"
|
||||
syn match sasMacro "%SUPERQ"
|
||||
syn match sasMacro "%SYSCALL"
|
||||
syn match sasMacro "%SYSEVALF"
|
||||
syn match sasMacro "%SYSEXEC"
|
||||
syn match sasMacro "%SYSFUNC"
|
||||
syn match sasMacro "%SYSGET"
|
||||
syn match sasMacro "%SYSLPUT"
|
||||
syn match sasMacro "%SYSPROD"
|
||||
syn match sasMacro "%SYSRC"
|
||||
syn match sasMacro "%SYSRPUT"
|
||||
syn match sasMacro "%THEN"
|
||||
syn match sasMacro "%TO"
|
||||
syn match sasMacro "%TRIM"
|
||||
syn match sasMacro "%UNQUOTE"
|
||||
syn match sasMacro "%UNTIL"
|
||||
syn match sasMacro "%UPCASE"
|
||||
syn match sasMacro "%VERIFY"
|
||||
syn match sasMacro "%WHILE"
|
||||
syn match sasMacro "%WINDOW"
|
||||
|
||||
" SAS Functions
|
||||
|
||||
syn keyword sasFunction ABS ADDR AIRY ARCOS ARSIN ATAN ATTRC ATTRN
|
||||
syn keyword sasFunction BAND BETAINV BLSHIFT BNOT BOR BRSHIFT BXOR
|
||||
syn keyword sasFunction BYTE CDF CEIL CEXIST CINV CLOSE CNONCT COLLATE
|
||||
syn keyword sasFunction COMPBL COMPOUND COMPRESS COS COSH CSS CUROBS
|
||||
syn keyword sasFunction CV DACCDB DACCDBSL DACCSL DACCSYD DACCTAB
|
||||
syn keyword sasFunction DAIRY DATE DATEJUL DATEPART DATETIME DAY
|
||||
syn keyword sasFunction DCLOSE DEPDB DEPDBSL DEPDBSL DEPSL DEPSL
|
||||
syn keyword sasFunction DEPSYD DEPSYD DEPTAB DEPTAB DEQUOTE DHMS
|
||||
syn keyword sasFunction DIF DIGAMMA DIM DINFO DNUM DOPEN DOPTNAME
|
||||
syn keyword sasFunction DOPTNUM DREAD DROPNOTE DSNAME ERF ERFC EXIST
|
||||
syn keyword sasFunction EXP FAPPEND FCLOSE FCOL FDELETE FETCH FETCHOBS
|
||||
syn keyword sasFunction FEXIST FGET FILEEXIST FILENAME FILEREF FINFO
|
||||
syn keyword sasFunction FINV FIPNAME FIPNAMEL FIPSTATE FLOOR FNONCT
|
||||
syn keyword sasFunction FNOTE FOPEN FOPTNAME FOPTNUM FPOINT FPOS
|
||||
syn keyword sasFunction FPUT FREAD FREWIND FRLEN FSEP FUZZ FWRITE
|
||||
syn keyword sasFunction GAMINV GAMMA GETOPTION GETVARC GETVARN HBOUND
|
||||
syn keyword sasFunction HMS HOSTHELP HOUR IBESSEL INDEX INDEXC
|
||||
syn keyword sasFunction INDEXW INPUT INPUTC INPUTN INT INTCK INTNX
|
||||
syn keyword sasFunction INTRR IRR JBESSEL JULDATE KURTOSIS LAG LBOUND
|
||||
syn keyword sasFunction LEFT LENGTH LGAMMA LIBNAME LIBREF LOG LOG10
|
||||
syn keyword sasFunction LOG2 LOGPDF LOGPMF LOGSDF LOWCASE MAX MDY
|
||||
syn keyword sasFunction MEAN MIN MINUTE MOD MONTH MOPEN MORT N
|
||||
syn keyword sasFunction NETPV NMISS NORMAL NOTE NPV OPEN ORDINAL
|
||||
syn keyword sasFunction PATHNAME PDF PEEK PEEKC PMF POINT POISSON POKE
|
||||
syn keyword sasFunction PROBBETA PROBBNML PROBCHI PROBF PROBGAM
|
||||
syn keyword sasFunction PROBHYPR PROBIT PROBNEGB PROBNORM PROBT PUT
|
||||
syn keyword sasFunction PUTC PUTN QTR QUOTE RANBIN RANCAU RANEXP
|
||||
syn keyword sasFunction RANGAM RANGE RANK RANNOR RANPOI RANTBL RANTRI
|
||||
syn keyword sasFunction RANUNI REPEAT RESOLVE REVERSE REWIND RIGHT
|
||||
syn keyword sasFunction ROUND SAVING SCAN SDF SECOND SIGN SIN SINH
|
||||
syn keyword sasFunction SKEWNESS SOUNDEX SPEDIS SQRT STD STDERR STFIPS
|
||||
syn keyword sasFunction STNAME STNAMEL SUBSTR SUM SYMGET SYSGET SYSMSG
|
||||
syn keyword sasFunction SYSPROD SYSRC SYSTEM TAN TANH TIME TIMEPART
|
||||
syn keyword sasFunction TINV TNONCT TODAY TRANSLATE TRANWRD TRIGAMMA
|
||||
syn keyword sasFunction TRIM TRIMN TRUNC UNIFORM UPCASE USS VAR
|
||||
syn keyword sasFunction VARFMT VARINFMT VARLABEL VARLEN VARNAME
|
||||
syn keyword sasFunction VARNUM VARRAY VARRAYX VARTYPE VERIFY VFORMAT
|
||||
syn keyword sasFunction VFORMATD VFORMATDX VFORMATN VFORMATNX VFORMATW
|
||||
syn keyword sasFunction VFORMATWX VFORMATX VINARRAY VINARRAYX VINFORMAT
|
||||
syn keyword sasFunction VINFORMATD VINFORMATDX VINFORMATN VINFORMATNX
|
||||
syn keyword sasFunction VINFORMATW VINFORMATWX VINFORMATX VLABEL
|
||||
syn keyword sasFunction VLABELX VLENGTH VLENGTHX VNAME VNAMEX VTYPE
|
||||
syn keyword sasFunction VTYPEX WEEKDAY YEAR YYQ ZIPFIPS ZIPNAME ZIPNAMEL
|
||||
syn keyword sasFunction ZIPSTATE
|
||||
|
||||
" Handy settings for using vim with log files
|
||||
syn keyword sasLogMsg NOTE
|
||||
syn keyword sasWarnMsg WARNING
|
||||
syn keyword sasErrMsg ERROR
|
||||
|
||||
" Always contained in a comment (Bob Heckel)
|
||||
syn keyword sasTodo TODO TBD FIXME contained
|
||||
|
||||
" These don't fit anywhere else (Bob Heckel).
|
||||
" Added others that were missing.
|
||||
syn keyword sasUnderscore _ALL_ _AUTOMATIC_ _CHARACTER_ _INFILE_ _N_ _NAME_ _NULL_ _NUMERIC_ _USER_ _WEBOUT_
|
||||
|
||||
" End of SAS Functions
|
||||
|
||||
" Define the default highlighting.
|
||||
" Only when an item doesn't have highlighting yet
|
||||
|
||||
|
||||
" Default sas enhanced editor color syntax
|
||||
hi sComment term=bold cterm=NONE ctermfg=Green ctermbg=Black gui=NONE guifg=DarkGreen guibg=White
|
||||
hi sCard term=bold cterm=NONE ctermfg=Black ctermbg=Yellow gui=NONE guifg=Black guibg=LightYellow
|
||||
hi sDate_Time term=NONE cterm=bold ctermfg=Green ctermbg=Black gui=bold guifg=SeaGreen guibg=White
|
||||
hi sKeyword term=NONE cterm=NONE ctermfg=Blue ctermbg=Black gui=NONE guifg=Blue guibg=White
|
||||
hi sFmtInfmt term=NONE cterm=NONE ctermfg=LightGreen ctermbg=Black gui=NONE guifg=SeaGreen guibg=White
|
||||
hi sString term=NONE cterm=NONE ctermfg=Magenta ctermbg=Black gui=NONE guifg=Purple guibg=White
|
||||
hi sText term=NONE cterm=NONE ctermfg=White ctermbg=Black gui=bold guifg=Black guibg=White
|
||||
hi sNumber term=NONE cterm=bold ctermfg=Green ctermbg=Black gui=bold guifg=SeaGreen guibg=White
|
||||
hi sProc term=NONE cterm=bold ctermfg=Blue ctermbg=Black gui=bold guifg=Navy guibg=White
|
||||
hi sSection term=NONE cterm=bold ctermfg=Blue ctermbg=Black gui=bold guifg=Navy guibg=White
|
||||
hi mDefine term=NONE cterm=bold ctermfg=White ctermbg=Black gui=bold guifg=Black guibg=White
|
||||
hi mKeyword term=NONE cterm=NONE ctermfg=Blue ctermbg=Black gui=NONE guifg=Blue guibg=White
|
||||
hi mReference term=NONE cterm=bold ctermfg=White ctermbg=Black gui=bold guifg=Blue guibg=White
|
||||
hi mSection term=NONE cterm=NONE ctermfg=Blue ctermbg=Black gui=bold guifg=Navy guibg=White
|
||||
hi mText term=NONE cterm=NONE ctermfg=White ctermbg=Black gui=bold guifg=Black guibg=White
|
||||
|
||||
" Colors that closely match SAS log colors for default color scheme
|
||||
hi lError term=NONE cterm=NONE ctermfg=Red ctermbg=Black gui=none guifg=Red guibg=White
|
||||
hi lWarning term=NONE cterm=NONE ctermfg=Green ctermbg=Black gui=none guifg=Green guibg=White
|
||||
hi lNote term=NONE cterm=NONE ctermfg=Cyan ctermbg=Black gui=none guifg=Blue guibg=White
|
||||
|
||||
|
||||
" Special hilighting for the SAS proc section
|
||||
|
||||
hi def link sasComment sComment
|
||||
hi def link sasConditional sKeyword
|
||||
hi def link sasStep sSection
|
||||
hi def link sasFunction sKeyword
|
||||
hi def link sasMacro mKeyword
|
||||
hi def link sasMacroVar NonText
|
||||
hi def link sasNumber sNumber
|
||||
hi def link sasStatement sKeyword
|
||||
hi def link sasString sString
|
||||
hi def link sasProc sProc
|
||||
" (Bob Heckel)
|
||||
hi def link sasTodo Todo
|
||||
hi def link sasErrMsg lError
|
||||
hi def link sasWarnMsg lWarning
|
||||
hi def link sasLogMsg lNote
|
||||
hi def link sasCards sCard
|
||||
" (Bob Heckel)
|
||||
hi def link sasUnderscore PreProc
|
||||
" Define default highlighting
|
||||
hi def link sasComment Comment
|
||||
hi def link sasTodo Delimiter
|
||||
hi def link sasSectLbl Title
|
||||
hi def link sasSectLblEnds Comment
|
||||
hi def link sasNumber Number
|
||||
hi def link sasDateTime Constant
|
||||
hi def link sasString String
|
||||
hi def link sasDataStepControl Keyword
|
||||
hi def link sasProcTemplateClause Keyword
|
||||
hi def link sasProcSQLClause Keyword
|
||||
hi def link sasDS2Control Keyword
|
||||
hi def link sasIMLControl Keyword
|
||||
hi def link sasOperator Operator
|
||||
hi def link sasGlobalStatementKeyword Statement
|
||||
hi def link sasGlobalStatementODSKeyword Statement
|
||||
hi def link sasSectionKeyword Statement
|
||||
hi def link sasDataStepFunctionName Function
|
||||
hi def link sasDataStepCallRoutineName Function
|
||||
hi def link sasDataStepStatementKeyword Statement
|
||||
hi def link sasDataStepStatementHashKeyword Statement
|
||||
hi def link sasDataStepHashOperator Operator
|
||||
hi def link sasDataStepHashMethodName Function
|
||||
hi def link sasDataStepHashAttributeName Identifier
|
||||
hi def link sasProcStatementKeyword Statement
|
||||
hi def link sasODSGraphicsProcStatementKeyword Statement
|
||||
hi def link sasGraphProcStatementKeyword Statement
|
||||
hi def link sasAnalyticalProcStatementKeyword Statement
|
||||
hi def link sasProcTemplateStatementKeyword Statement
|
||||
hi def link sasProcTemplateStatementComplexKeyword Statement
|
||||
hi def link sasProcTemplateGTLStatementKeyword Statement
|
||||
hi def link sasProcTemplateGTLComplexKeyword Statement
|
||||
hi def link sasProcSQLFunctionName Function
|
||||
hi def link sasProcSQLStatementKeyword Statement
|
||||
hi def link sasProcSQLStatementComplexKeyword Statement
|
||||
hi def link sasProcSQLStatementNextKeyword Statement
|
||||
hi def link sasDS2FunctionName Function
|
||||
hi def link sasDS2StatementKeyword Statement
|
||||
hi def link sasIMLFunctionName Function
|
||||
hi def link sasIMLCallRoutineName Function
|
||||
hi def link sasIMLStatementKeyword Statement
|
||||
hi def link sasMacroReserved PreProc
|
||||
hi def link sasMacroVariable Define
|
||||
hi def link sasMacroFunctionName Define
|
||||
hi def link sasDataLine SpecialChar
|
||||
hi def link sasFormat SpecialChar
|
||||
hi def link sasReserved Special
|
||||
|
||||
" Syncronize from beginning to keep large blocks from losing
|
||||
" syntax coloring while moving through code.
|
||||
@@ -264,4 +261,5 @@ syn sync fromstart
|
||||
|
||||
let b:current_syntax = "sas"
|
||||
|
||||
" vim: ts=8
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
@@ -1255,7 +1255,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>129</string>
|
||||
<string>131</string>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
|
||||
@@ -123,6 +123,7 @@ extern NSTimeInterval MMBalloonEvalInternalDelay;
|
||||
- (void)startBlink;
|
||||
- (void)stopBlink;
|
||||
- (void)adjustLinespace:(int)linespace;
|
||||
- (void)adjustColumnspace:(int)columnspace;
|
||||
- (void)activate;
|
||||
- (void)setPreEditRow:(int)row column:(int)col;
|
||||
|
||||
|
||||
@@ -1095,6 +1095,13 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
|
||||
[self queueMessage:AdjustLinespaceMsgID data:data];
|
||||
}
|
||||
|
||||
- (void)adjustColumnspace:(int)columnspace
|
||||
{
|
||||
NSMutableData *data = [NSMutableData data];
|
||||
[data appendBytes:&columnspace length:sizeof(int)];
|
||||
[self queueMessage:AdjustColumnspaceMsgID data:data];
|
||||
}
|
||||
|
||||
- (void)activate
|
||||
{
|
||||
[self queueMessage:ActivateMsgID data:nil];
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
NSFont *font;
|
||||
NSFont *fontWide;
|
||||
float linespace;
|
||||
float columnspace;
|
||||
|
||||
// From NSTextView
|
||||
NSSize insetSize;
|
||||
@@ -30,6 +31,7 @@
|
||||
BOOL antialias;
|
||||
BOOL ligatures;
|
||||
BOOL thinStrokes;
|
||||
BOOL drawPending;
|
||||
NSMutableArray *drawData;
|
||||
|
||||
MMTextViewHelper *helper;
|
||||
@@ -95,6 +97,7 @@
|
||||
//
|
||||
// NSTextView methods
|
||||
//
|
||||
- (void)setFrameSize:(NSSize)newSize;
|
||||
- (void)keyDown:(NSEvent *)event;
|
||||
- (void)insertText:(id)string;
|
||||
- (void)doCommandBySelector:(SEL)selector;
|
||||
|
||||
@@ -311,7 +311,7 @@ defaultAdvanceForFont(NSFont *font)
|
||||
// only render at integer sizes. Hence, we restrict the cell width to
|
||||
// an integer here, otherwise the window width and the actual text
|
||||
// width will not match.
|
||||
cellSize.width = ceil(em * cellWidthMultiplier);
|
||||
cellSize.width = columnspace + ceil(em * cellWidthMultiplier);
|
||||
cellSize.height = linespace + defaultLineHeightForFont(font);
|
||||
|
||||
fontDescent = ceil(CTFontGetDescent(fontRef));
|
||||
@@ -372,6 +372,17 @@ defaultAdvanceForFont(NSFont *font)
|
||||
cellSize.height = linespace + defaultLineHeightForFont(font);
|
||||
}
|
||||
|
||||
- (void)setColumnspace:(float)newColumnspace
|
||||
{
|
||||
columnspace = newColumnspace;
|
||||
|
||||
double em = round(defaultAdvanceForFont(font));
|
||||
float cellWidthMultiplier = [[NSUserDefaults standardUserDefaults]
|
||||
floatForKey:MMCellWidthMultiplierKey];
|
||||
|
||||
cellSize.width = columnspace + ceil(em * cellWidthMultiplier);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -435,6 +446,14 @@ defaultAdvanceForFont(NSFont *font)
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)setFrameSize:(NSSize)newSize {
|
||||
if (!drawPending && !NSEqualSizes(newSize, self.frame.size) && drawData.count == 0) {
|
||||
[NSAnimationContext beginGrouping];
|
||||
drawPending = YES;
|
||||
}
|
||||
[super setFrameSize:newSize];
|
||||
}
|
||||
|
||||
- (void)keyDown:(NSEvent *)event
|
||||
{
|
||||
[helper keyDown:event];
|
||||
@@ -639,11 +658,10 @@ defaultAdvanceForFont(NSFont *font)
|
||||
} else {
|
||||
[drawData addObject:data];
|
||||
[self setNeedsDisplay:YES];
|
||||
|
||||
// NOTE: During resizing, Cocoa only sends draw messages before Vim's rows
|
||||
// and columns are changed (due to ipc delays). Force a redraw here.
|
||||
if ([self inLiveResize])
|
||||
[self display];
|
||||
}
|
||||
if (drawPending) {
|
||||
[NSAnimationContext endGrouping];
|
||||
drawPending = NO;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -110,8 +110,8 @@ enum {
|
||||
// Each fade goes in and then out, so the fade hardware must be reserved accordingly and the
|
||||
// actual fade time can't exceed half the allowable reservation time... plus some slack to
|
||||
// prevent visual artifacts caused by defaulting on the fade hardware lease.
|
||||
fadeTime = MIN(fadeTime, 0.45 * kCGMaxDisplayReservationInterval);
|
||||
fadeReservationTime = 2.0 * fadeTime + 0.1;
|
||||
fadeTime = MIN(fadeTime, 0.5 * (kCGMaxDisplayReservationInterval - 1));
|
||||
fadeReservationTime = 2.0 * fadeTime + 1;
|
||||
|
||||
return self;
|
||||
}
|
||||
@@ -218,9 +218,11 @@ enum {
|
||||
|
||||
// fade back in
|
||||
if (didBlend) {
|
||||
CGDisplayFade(token, fadeTime, kCGDisplayBlendSolidColor,
|
||||
kCGDisplayBlendNormal, .0, .0, .0, false);
|
||||
CGReleaseDisplayFadeReservation(token);
|
||||
[NSAnimationContext currentContext].completionHandler = ^{
|
||||
CGDisplayFade(token, fadeTime, kCGDisplayBlendSolidColor,
|
||||
kCGDisplayBlendNormal, .0, .0, .0, false);
|
||||
CGReleaseDisplayFadeReservation(token);
|
||||
};
|
||||
}
|
||||
|
||||
state = InFullScreen;
|
||||
|
||||
@@ -41,6 +41,7 @@ typedef struct {
|
||||
NSColor *defaultForegroundColor;
|
||||
NSSize cellSize;
|
||||
float linespace;
|
||||
float columnspace;
|
||||
#if MM_USE_ROW_CACHE
|
||||
MMRowCacheEntry *rowCache;
|
||||
#endif
|
||||
@@ -59,7 +60,9 @@ typedef struct {
|
||||
- (int)actualRows;
|
||||
- (int)actualColumns;
|
||||
- (float)linespace;
|
||||
- (float)columnspace;
|
||||
- (void)setLinespace:(float)newLinespace;
|
||||
- (void)setColumnspace:(float)newColumnspace;
|
||||
- (void)getMaxRows:(int*)rows columns:(int*)cols;
|
||||
- (void)setMaxRows:(int)rows columns:(int)cols;
|
||||
- (void)drawString:(NSString *)string atRow:(int)row column:(int)col
|
||||
|
||||
@@ -202,6 +202,11 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
|
||||
return linespace;
|
||||
}
|
||||
|
||||
- (float)columnspace
|
||||
{
|
||||
return columnspace;
|
||||
}
|
||||
|
||||
- (void)setLinespace:(float)newLinespace
|
||||
{
|
||||
NSLayoutManager *lm = [[self layoutManagers] objectAtIndex:0];
|
||||
@@ -221,6 +226,25 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
|
||||
cellSize.height = linespace + [lm defaultLineHeightForFont:font];
|
||||
}
|
||||
|
||||
- (void)setColumnspace:(float)newColumnspace
|
||||
{
|
||||
NSLayoutManager *lm = [[self layoutManagers] objectAtIndex:0];
|
||||
if (!lm) {
|
||||
ASLogWarn(@"No layout manager available");
|
||||
return;
|
||||
}
|
||||
|
||||
columnspace = newColumnspace;
|
||||
|
||||
float em = [@"m" sizeWithAttributes:
|
||||
[NSDictionary dictionaryWithObject:font
|
||||
forKey:NSFontAttributeName]].width;
|
||||
float cellWidthMultiplier = [[NSUserDefaults standardUserDefaults]
|
||||
floatForKey:MMCellWidthMultiplierKey];
|
||||
|
||||
cellSize.width = columnspace + ceilf(em * cellWidthMultiplier);
|
||||
}
|
||||
|
||||
- (void)getMaxRows:(int*)rows columns:(int*)cols
|
||||
{
|
||||
if (rows) *rows = maxRows;
|
||||
@@ -662,6 +686,7 @@ static NSString *MMWideCharacterAttributeName = @"MMWideChar";
|
||||
NSLayoutManager *lm = [[self layoutManagers] objectAtIndex:0];
|
||||
if (lm) {
|
||||
cellSize.height = linespace + [lm defaultLineHeightForFont:font];
|
||||
cellSize.width = columnspace + ceilf(em * cellWidthMultiplier);
|
||||
} else {
|
||||
// Should never happen, set some bogus value for cell height.
|
||||
ASLogWarn(@"No layout manager available");
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
- (void)setWideFont:(NSFont *)newFont;
|
||||
- (NSSize)cellSize;
|
||||
- (void)setLinespace:(float)newLinespace;
|
||||
- (void)setColumnspace:(float)newColumnspace;
|
||||
- (int)maxRows;
|
||||
- (int)maxColumns;
|
||||
- (void)getMaxRows:(int*)rows columns:(int*)cols;
|
||||
|
||||
@@ -362,6 +362,11 @@
|
||||
return [(MMTextStorage*)[self textStorage] setLinespace:newLinespace];
|
||||
}
|
||||
|
||||
- (void)setColumnspace:(float)newColumnspace
|
||||
{
|
||||
return [(MMTextStorage*)[self textStorage] setColumnspace:newColumnspace];
|
||||
}
|
||||
|
||||
- (int)maxRows
|
||||
{
|
||||
MMTextStorage *ts = (MMTextStorage *)[self textStorage];
|
||||
|
||||
@@ -554,15 +554,9 @@ static BOOL isUnsafeMessage(int msgid);
|
||||
{
|
||||
if (OpenWindowMsgID == msgid) {
|
||||
[windowController openWindow];
|
||||
|
||||
// HACK: Delay actually presenting the window onscreen until after
|
||||
// processing the queue since it contains drawing commands that need to
|
||||
// be issued before presentation; otherwise the window may flash white
|
||||
// just as it opens.
|
||||
if (!isPreloading)
|
||||
[windowController performSelector:@selector(presentWindow:)
|
||||
withObject:nil
|
||||
afterDelay:0];
|
||||
if (!isPreloading) {
|
||||
[windowController presentWindow:nil];
|
||||
}
|
||||
} else if (BatchDrawMsgID == msgid) {
|
||||
[[[windowController vimView] textView] performBatchDrawWithData:data];
|
||||
} else if (SelectTabMsgID == msgid) {
|
||||
@@ -762,6 +756,11 @@ static BOOL isUnsafeMessage(int msgid);
|
||||
int linespace = *((int*)bytes);
|
||||
|
||||
[windowController adjustLinespace:linespace];
|
||||
} else if (AdjustColumnspaceMsgID == msgid) {
|
||||
const void *bytes = [data bytes];
|
||||
int columnspace = *((int*)bytes);
|
||||
|
||||
[windowController adjustColumnspace:columnspace];
|
||||
} else if (ActivateMsgID == msgid) {
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
[[windowController window] makeKeyAndOrderFront:self];
|
||||
|
||||
@@ -909,7 +909,7 @@ enum {
|
||||
"%dx%d (%s)", cols, rows, constrained[1], constrained[0],
|
||||
MessageStrings[msgid]);
|
||||
|
||||
[vimController sendMessage:msgid data:data];
|
||||
[vimController sendMessageNow:msgid data:data timeout:1];
|
||||
|
||||
// We only want to set the window title if this resize came from
|
||||
// a live-resize, not (for example) setting 'columns' or 'lines'.
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
int userCols;
|
||||
NSPoint userTopLeft;
|
||||
NSPoint defaultTopLeft;
|
||||
NSSize desiredWindowSize;
|
||||
NSToolbar *toolbar;
|
||||
BOOL resizingDueToMove;
|
||||
int blurRadius;
|
||||
@@ -77,6 +78,7 @@
|
||||
- (void)showToolbar:(BOOL)on size:(int)size mode:(int)mode;
|
||||
- (void)setMouseShape:(int)shape;
|
||||
- (void)adjustLinespace:(int)linespace;
|
||||
- (void)adjustColumnspace:(int)columnspace;
|
||||
- (void)liveResizeWillStart;
|
||||
- (void)liveResizeDidEnd;
|
||||
|
||||
|
||||
@@ -594,11 +594,12 @@
|
||||
// TODO: What if the resize message fails to make it back?
|
||||
if (!didMaximize) {
|
||||
NSSize originalSize = [vimView frame].size;
|
||||
NSSize contentSize = [vimView desiredSize];
|
||||
contentSize = [self constrainContentSizeToScreenSize:contentSize];
|
||||
int rows = 0, cols = 0;
|
||||
contentSize = [vimView constrainRows:&rows columns:&cols
|
||||
toSize:contentSize];
|
||||
NSSize contentSize = [vimView constrainRows:&rows columns:&cols
|
||||
toSize:
|
||||
fullScreenWindow ? [fullScreenWindow frame].size :
|
||||
fullScreenEnabled ? desiredWindowSize :
|
||||
[self constrainContentSizeToScreenSize:[vimView desiredSize]]];
|
||||
[vimView setFrameSize:contentSize];
|
||||
|
||||
if (fullScreenWindow) {
|
||||
@@ -660,6 +661,14 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (void)adjustColumnspace:(int)columnspace
|
||||
{
|
||||
if (vimView && [vimView textView]) {
|
||||
[[vimView textView] setColumnspace:(float)columnspace];
|
||||
shouldMaximizeWindow = shouldResizeVimView = YES;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)liveResizeWillStart
|
||||
{
|
||||
if (!setupDone) return;
|
||||
@@ -689,37 +698,6 @@
|
||||
NSConnection *connection = [(NSDistantObject*)proxy connectionForProxy];
|
||||
[connection removeRequestMode:NSEventTrackingRunLoopMode];
|
||||
|
||||
// NOTE: During live resize messages from MacVim to Vim are often dropped
|
||||
// (because too many messages are sent at once). This may lead to
|
||||
// inconsistent states between Vim and MacVim; to avoid this we send a
|
||||
// synchronous resize message to Vim now (this is not fool-proof, but it
|
||||
// does seem to work quite well).
|
||||
// Do NOT send a SetTextDimensionsMsgID message (as opposed to
|
||||
// LiveResizeMsgID) since then the view is constrained to not be larger
|
||||
// than the screen the window mostly occupies; this makes it impossible to
|
||||
// resize the window across multiple screens.
|
||||
|
||||
int constrained[2];
|
||||
NSSize textViewSize = [[vimView textView] frame].size;
|
||||
[[vimView textView] constrainRows:&constrained[0] columns:&constrained[1]
|
||||
toSize:textViewSize];
|
||||
|
||||
ASLogDebug(@"End of live resize, notify Vim that text dimensions are %dx%d",
|
||||
constrained[1], constrained[0]);
|
||||
|
||||
NSData *data = [NSData dataWithBytes:constrained length:2*sizeof(int)];
|
||||
BOOL sendOk = [vimController sendMessageNow:LiveResizeMsgID
|
||||
data:data
|
||||
timeout:.5];
|
||||
|
||||
if (!sendOk) {
|
||||
// Sending of synchronous message failed. Force the window size to
|
||||
// match the last dimensions received from Vim, otherwise we end up
|
||||
// with inconsistent states.
|
||||
[self resizeWindowToFitContentSize:[vimView desiredSize]
|
||||
keepOnScreen:NO];
|
||||
}
|
||||
|
||||
// If we saved the original title while resizing, restore it.
|
||||
if (lastSetTitle != nil) {
|
||||
[decoratedWindow setTitle:lastSetTitle];
|
||||
@@ -1026,6 +1004,11 @@
|
||||
[vimController sendMessage:SetWindowPositionMsgID data:data];
|
||||
}
|
||||
|
||||
- (NSSize)windowWillResize:(NSWindow *)sender toSize:(NSSize)frameSize {
|
||||
desiredWindowSize = frameSize;
|
||||
return frameSize;
|
||||
}
|
||||
|
||||
- (void)windowDidResize:(id)sender
|
||||
{
|
||||
if (resizingDueToMove) {
|
||||
|
||||
@@ -210,6 +210,7 @@ enum {
|
||||
MouseMovedMsgID,
|
||||
SetMouseShapeMsgID,
|
||||
AdjustLinespaceMsgID,
|
||||
AdjustColumnspaceMsgID,
|
||||
ActivateMsgID,
|
||||
SetServerNameMsgID,
|
||||
EnterFullScreenMsgID,
|
||||
|
||||
@@ -64,6 +64,7 @@ char *MessageStrings[] =
|
||||
"MouseMovedMsgID",
|
||||
"SetMouseShapeMsgID",
|
||||
"AdjustLinespaceMsgID",
|
||||
"AdjustColumnspaceMsgID",
|
||||
"ActivateMsgID",
|
||||
"SetServerNameMsgID",
|
||||
"EnterFullScreenMsgID",
|
||||
|
||||
@@ -252,6 +252,7 @@ gui_mch_init(void)
|
||||
// Ensure 'linespace' option is passed along to MacVim in case it was set
|
||||
// in [g]vimrc.
|
||||
gui_mch_adjust_charheight();
|
||||
gui_mch_adjust_charwidth();
|
||||
|
||||
if (!MMNoMRU && GARGCOUNT > 0) {
|
||||
// Add files passed on command line to MRU.
|
||||
@@ -1405,6 +1406,17 @@ gui_mch_adjust_charheight(void)
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Adjust gui.char_width (after 'columnspace' was changed).
|
||||
*/
|
||||
int
|
||||
gui_mch_adjust_charwidth(void)
|
||||
{
|
||||
[[MMBackend sharedInstance] adjustColumnspace:p_columnspace];
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gui_mch_beep(void)
|
||||
{
|
||||
|
||||
+13
-1
@@ -1901,6 +1901,16 @@ autoconf:
|
||||
-rm -rf autom4te.cache
|
||||
-rm -f auto/config.status auto/config.cache
|
||||
|
||||
# Run Perl to generate the Ex command lookup table. This only needs to be run
|
||||
# when a command name has been added or changed.
|
||||
# NOTE: Only works when perl and vim executables are available
|
||||
cmdidxs: ex_cmds.h
|
||||
if test X`perl -e "print 123"` = "X123"; then \
|
||||
vim ex_docmd.c -c '/Beginning.*create_cmdidxs/,/End.*create_cmdidxs/! perl create_cmdidxs.pl' -c wq; \
|
||||
else \
|
||||
echo Cannot run Perl; \
|
||||
fi
|
||||
|
||||
# Re-execute this Makefile to include the new auto/config.mk produced by
|
||||
# configure Only used when typing "make" with a fresh auto/config.mk.
|
||||
myself:
|
||||
@@ -2129,10 +2139,10 @@ test_arglist \
|
||||
test_delete \
|
||||
test_diffmode \
|
||||
test_digraph \
|
||||
test_functions \
|
||||
test_display \
|
||||
test_edit \
|
||||
test_ex_undo \
|
||||
test_ex_z \
|
||||
test_execute_func \
|
||||
test_expand \
|
||||
test_expand_dllpath \
|
||||
@@ -2149,9 +2159,11 @@ test_arglist \
|
||||
test_fnameescape \
|
||||
test_fnamemodify \
|
||||
test_fold \
|
||||
test_functions \
|
||||
test_ga \
|
||||
test_gf \
|
||||
test_glob2regpat \
|
||||
test_global \
|
||||
test_gn \
|
||||
test_goto \
|
||||
test_gui \
|
||||
|
||||
+7
-2
@@ -2592,9 +2592,14 @@ may_invoke_callback(channel_T *channel, ch_part_T part)
|
||||
if (nl == NULL)
|
||||
{
|
||||
/* Flush remaining message that is missing a NL. */
|
||||
buf = vim_realloc(buf, node->rq_buflen + 1);
|
||||
if (buf == NULL)
|
||||
char_u *new_buf;
|
||||
|
||||
new_buf = vim_realloc(buf, node->rq_buflen + 1);
|
||||
if (new_buf == NULL)
|
||||
/* This might fail over and over again, should the message
|
||||
* be dropped? */
|
||||
return FALSE;
|
||||
buf = new_buf;
|
||||
node->rq_buffer = buf;
|
||||
nl = buf + node->rq_buflen++;
|
||||
*nl = NUL;
|
||||
|
||||
+7
-3
@@ -960,7 +960,7 @@ vim_isfilec_or_wc(int c)
|
||||
}
|
||||
|
||||
/*
|
||||
* return TRUE if 'c' is a printable character
|
||||
* Return TRUE if 'c' is a printable character.
|
||||
* Assume characters above 0x100 are printable (multi-byte), except for
|
||||
* Unicode.
|
||||
*/
|
||||
@@ -1717,7 +1717,7 @@ vim_toupper(int c)
|
||||
{
|
||||
if (c <= '@')
|
||||
return c;
|
||||
if (c >= 0x80)
|
||||
if (c >= 0x80 || !(cmp_flags & CMP_KEEPASCII))
|
||||
{
|
||||
if (enc_utf8)
|
||||
return utf_toupper(c);
|
||||
@@ -1733,6 +1733,8 @@ vim_toupper(int c)
|
||||
if (enc_latin1like)
|
||||
return latin1upper[c];
|
||||
}
|
||||
if (c < 0x80 && (cmp_flags & CMP_KEEPASCII))
|
||||
return TOUPPER_ASC(c);
|
||||
return TOUPPER_LOC(c);
|
||||
}
|
||||
|
||||
@@ -1741,7 +1743,7 @@ vim_tolower(int c)
|
||||
{
|
||||
if (c <= '@')
|
||||
return c;
|
||||
if (c >= 0x80)
|
||||
if (c >= 0x80 || !(cmp_flags & CMP_KEEPASCII))
|
||||
{
|
||||
if (enc_utf8)
|
||||
return utf_tolower(c);
|
||||
@@ -1757,6 +1759,8 @@ vim_tolower(int c)
|
||||
if (enc_latin1like)
|
||||
return latin1lower[c];
|
||||
}
|
||||
if (c < 0x80 && (cmp_flags & CMP_KEEPASCII))
|
||||
return TOLOWER_ASC(c);
|
||||
return TOLOWER_LOC(c);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
#!/usr/bin/perl -w
|
||||
#
|
||||
# This script generates the tables cmdidxs1[] and cmdidxs2[][] which,
|
||||
# given a Ex command, determine the first value to probe to find
|
||||
# a matching command in cmdnames[] based on the first character
|
||||
# and the first 2 characters of the command.
|
||||
# This is used to speed up lookup in cmdnames[].
|
||||
#
|
||||
# Script should be run every time new Ex commands are added in Vim,
|
||||
# from the src/vim directory, since it reads commands from "ex_cmds.h".
|
||||
|
||||
use strict;
|
||||
|
||||
# Find the list of Vim commands from cmdnames[] table in ex_cmds.h
|
||||
my @cmds;
|
||||
my $skipped_cmds;
|
||||
open(IN, "< ex_cmds.h") or die "can't open ex_cmds.h: $!\n";
|
||||
while (<IN>) {
|
||||
if (/^EX\(CMD_\S*,\s*"([a-z][^"]*)"/) {
|
||||
push @cmds, $1;
|
||||
} elsif (/^EX\(CMD_/) {
|
||||
++$skipped_cmds;
|
||||
}
|
||||
}
|
||||
|
||||
my %cmdidxs1;
|
||||
my %cmdidxs2;
|
||||
|
||||
for (my $i = $#cmds; $i >= 0; --$i) {
|
||||
my $cmd = $cmds[$i];
|
||||
my $c1 = substr($cmd, 0, 1); # First character of command.
|
||||
|
||||
$cmdidxs1{$c1} = $i;
|
||||
|
||||
if (length($cmd) > 1) {
|
||||
my $c2 = substr($cmd, 1, 1); # Second character of command.
|
||||
$cmdidxs2{$c1}{$c2} = $i if (('a' lt $c2) and ($c2 lt 'z'));
|
||||
}
|
||||
}
|
||||
|
||||
print "/* Beginning of automatically generated code by create_cmdidxs.pl\n",
|
||||
" *\n",
|
||||
" * Table giving the index of the first command in cmdnames[] to lookup\n",
|
||||
" * based on the first letter of a command.\n",
|
||||
" */\n",
|
||||
"static const unsigned short cmdidxs1[26] =\n{\n",
|
||||
join(",\n", map(" /* $_ */ $cmdidxs1{$_}", ('a' .. 'z'))),
|
||||
"\n};\n",
|
||||
"\n",
|
||||
"/*\n",
|
||||
" * Table giving the index of the first command in cmdnames[] to lookup\n",
|
||||
" * based on the first 2 letters of a command.\n",
|
||||
" * Values in cmdidxs2[c1][c2] are relative to cmdidxs1[c1] so that they\n",
|
||||
" * fit in a byte.\n",
|
||||
" */\n",
|
||||
"static const unsigned char cmdidxs2[26][26] =\n",
|
||||
"{ /* a b c d e f g h i j k l m n o p q r s t u v w x y z */\n";
|
||||
for my $c1 ('a' .. 'z') {
|
||||
print " /* $c1 */ {";
|
||||
for my $c2 ('a' .. 'z') {
|
||||
if (exists $cmdidxs2{$c1}{$c2}) {
|
||||
printf "%3d,", $cmdidxs2{$c1}{$c2} - $cmdidxs1{$c1};
|
||||
} else {
|
||||
printf " 0,";
|
||||
}
|
||||
}
|
||||
print " }";
|
||||
print "," unless ($c1 eq 'z');
|
||||
print "\n";
|
||||
}
|
||||
print "};\n",
|
||||
"\n",
|
||||
"static const int command_count = ", scalar(@cmds) + $skipped_cmds, ";\n",
|
||||
"\n",
|
||||
"/* End of automatically generated code by create_cmdidxs.pl */\n";
|
||||
+27
-13
@@ -4770,7 +4770,6 @@ ins_compl_next(
|
||||
int in_compl_func) /* called from complete_check() */
|
||||
{
|
||||
int num_matches = -1;
|
||||
int i;
|
||||
int todo = count;
|
||||
compl_T *found_compl = NULL;
|
||||
int found_end = FALSE;
|
||||
@@ -4962,15 +4961,30 @@ ins_compl_next(
|
||||
*/
|
||||
if (compl_shown_match->cp_fname != NULL)
|
||||
{
|
||||
STRCPY(IObuff, "match in file ");
|
||||
i = (vim_strsize(compl_shown_match->cp_fname) + 16) - sc_col;
|
||||
if (i <= 0)
|
||||
i = 0;
|
||||
else
|
||||
STRCAT(IObuff, "<");
|
||||
STRCAT(IObuff, compl_shown_match->cp_fname + i);
|
||||
msg(IObuff);
|
||||
redraw_cmdline = FALSE; /* don't overwrite! */
|
||||
char *lead = _("match in file");
|
||||
int space = sc_col - vim_strsize((char_u *)lead) - 2;
|
||||
char_u *s;
|
||||
char_u *e;
|
||||
|
||||
if (space > 0)
|
||||
{
|
||||
/* We need the tail that fits. With double-byte encoding going
|
||||
* back from the end is very slow, thus go from the start and keep
|
||||
* the text that fits in "space" between "s" and "e". */
|
||||
for (s = e = compl_shown_match->cp_fname; *e != NUL; MB_PTR_ADV(e))
|
||||
{
|
||||
space -= ptr2cells(e);
|
||||
while (space < 0)
|
||||
{
|
||||
space += ptr2cells(s);
|
||||
MB_PTR_ADV(s);
|
||||
}
|
||||
}
|
||||
vim_snprintf((char *)IObuff, IOSIZE, "%s %s%s", lead,
|
||||
s > compl_shown_match->cp_fname ? "<" : "", s);
|
||||
msg(IObuff);
|
||||
redraw_cmdline = FALSE; /* don't overwrite! */
|
||||
}
|
||||
}
|
||||
|
||||
return num_matches;
|
||||
@@ -9017,7 +9031,7 @@ ins_bs(
|
||||
#endif
|
||||
|
||||
/*
|
||||
* delete newline!
|
||||
* Delete newline!
|
||||
*/
|
||||
if (curwin->w_cursor.col == 0)
|
||||
{
|
||||
@@ -9032,7 +9046,7 @@ ins_bs(
|
||||
(linenr_T)(curwin->w_cursor.lnum + 1)) == FAIL)
|
||||
return FALSE;
|
||||
--Insstart.lnum;
|
||||
Insstart.col = MAXCOL;
|
||||
Insstart.col = (colnr_T)STRLEN(ml_get(Insstart.lnum));
|
||||
}
|
||||
/*
|
||||
* In replace mode:
|
||||
@@ -9543,7 +9557,7 @@ bracketed_paste(paste_mode_T mode, int drop, garray_T *gap)
|
||||
#endif
|
||||
buf[idx++] = c;
|
||||
buf[idx] = NUL;
|
||||
if (end != NUL && STRNCMP(buf, end, idx) == 0)
|
||||
if (end != NULL && STRNCMP(buf, end, idx) == 0)
|
||||
{
|
||||
if (end[idx] == NUL)
|
||||
break; /* Found the end of paste code. */
|
||||
|
||||
+5
-3
@@ -6120,13 +6120,16 @@ var2fpos(
|
||||
if (name[1] == '0') /* "w0": first visible line */
|
||||
{
|
||||
update_topline();
|
||||
pos.lnum = curwin->w_topline;
|
||||
/* In silent Ex mode topline is zero, but that's not a valid line
|
||||
* number; use one instead. */
|
||||
pos.lnum = curwin->w_topline > 0 ? curwin->w_topline : 1;
|
||||
return &pos;
|
||||
}
|
||||
else if (name[1] == '$') /* "w$": last visible line */
|
||||
{
|
||||
validate_botline();
|
||||
pos.lnum = curwin->w_botline - 1;
|
||||
/* In silent Ex mode botline is zero, return zero then. */
|
||||
pos.lnum = curwin->w_botline > 0 ? curwin->w_botline - 1 : 0;
|
||||
return &pos;
|
||||
}
|
||||
}
|
||||
@@ -8325,7 +8328,6 @@ ex_execute(exarg_T *eap)
|
||||
* follows is displayed on a new line when scrolling back at the
|
||||
* more prompt. */
|
||||
msg_sb_eol();
|
||||
msg_start();
|
||||
}
|
||||
|
||||
if (eap->cmdidx == CMD_echomsg)
|
||||
|
||||
+40
-20
@@ -5248,24 +5248,6 @@ f_getwininfo(typval_T *argvars, typval_T *rettv)
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* "getwinposx()" function
|
||||
*/
|
||||
static void
|
||||
f_getwinposx(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
{
|
||||
rettv->vval.v_number = -1;
|
||||
#ifdef FEAT_GUI
|
||||
if (gui.in_use)
|
||||
{
|
||||
int x, y;
|
||||
|
||||
if (gui_mch_get_winpos(&x, &y) == OK)
|
||||
rettv->vval.v_number = x;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* "win_findbuf()" function
|
||||
*/
|
||||
@@ -5313,6 +5295,33 @@ f_win_id2win(typval_T *argvars, typval_T *rettv)
|
||||
rettv->vval.v_number = win_id2win(argvars);
|
||||
}
|
||||
|
||||
/*
|
||||
* "getwinposx()" function
|
||||
*/
|
||||
static void
|
||||
f_getwinposx(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
{
|
||||
rettv->vval.v_number = -1;
|
||||
#ifdef FEAT_GUI
|
||||
if (gui.in_use)
|
||||
{
|
||||
int x, y;
|
||||
|
||||
if (gui_mch_get_winpos(&x, &y) == OK)
|
||||
rettv->vval.v_number = x;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#if defined(HAVE_TGETENT) && defined(FEAT_TERMRESPONSE)
|
||||
{
|
||||
int x, y;
|
||||
|
||||
if (term_get_winpos(&x, &y) == OK)
|
||||
rettv->vval.v_number = x;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* "getwinposy()" function
|
||||
*/
|
||||
@@ -5327,6 +5336,15 @@ f_getwinposy(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
|
||||
if (gui_mch_get_winpos(&x, &y) == OK)
|
||||
rettv->vval.v_number = y;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#if defined(HAVE_TGETENT) && defined(FEAT_TERMRESPONSE)
|
||||
{
|
||||
int x, y;
|
||||
|
||||
if (term_get_winpos(&x, &y) == OK)
|
||||
rettv->vval.v_number = y;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -7718,6 +7736,7 @@ static int mkdir_recurse(char_u *dir, int prot);
|
||||
/*
|
||||
* Create the directory in which "dir" is located, and higher levels when
|
||||
* needed.
|
||||
* Return OK or FAIL.
|
||||
*/
|
||||
static int
|
||||
mkdir_recurse(char_u *dir, int prot)
|
||||
@@ -10065,7 +10084,8 @@ set_qf_ll_list(
|
||||
act = get_tv_string_chk(action_arg);
|
||||
if (act == NULL)
|
||||
return; /* type error; errmsg already given */
|
||||
if ((*act == 'a' || *act == 'r' || *act == ' ') && act[1] == NUL)
|
||||
if ((*act == 'a' || *act == 'r' || *act == ' ' || *act == 'f') &&
|
||||
act[1] == NUL)
|
||||
action = *act;
|
||||
else
|
||||
EMSG2(_(e_invact), act);
|
||||
@@ -11773,7 +11793,7 @@ f_synIDattr(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
break;
|
||||
|
||||
case 'n': /* name */
|
||||
p = get_highlight_name(NULL, id - 1);
|
||||
p = get_highlight_name_ext(NULL, id - 1, FALSE);
|
||||
break;
|
||||
|
||||
case 'r': /* reverse */
|
||||
|
||||
+9
-4
@@ -4564,7 +4564,7 @@ ex_change(exarg_T *eap)
|
||||
ex_z(exarg_T *eap)
|
||||
{
|
||||
char_u *x;
|
||||
int bigness;
|
||||
long bigness;
|
||||
char_u *kind;
|
||||
int minus = 0;
|
||||
linenr_T start, end, curs, i;
|
||||
@@ -4601,7 +4601,12 @@ ex_z(exarg_T *eap)
|
||||
}
|
||||
else
|
||||
{
|
||||
bigness = atoi((char *)x);
|
||||
bigness = atol((char *)x);
|
||||
|
||||
/* bigness could be < 0 if atol(x) overflows. */
|
||||
if (bigness > 2 * curbuf->b_ml.ml_line_count || bigness < 0)
|
||||
bigness = 2 * curbuf->b_ml.ml_line_count;
|
||||
|
||||
p_window = bigness;
|
||||
if (*kind == '=')
|
||||
bigness += 2;
|
||||
@@ -7962,7 +7967,7 @@ sign_list_defined(sign_T *sp)
|
||||
if (sp->sn_line_hl > 0)
|
||||
{
|
||||
MSG_PUTS(" linehl=");
|
||||
p = get_highlight_name(NULL, sp->sn_line_hl - 1);
|
||||
p = get_highlight_name_ext(NULL, sp->sn_line_hl - 1, FALSE);
|
||||
if (p == NULL)
|
||||
MSG_PUTS("NONE");
|
||||
else
|
||||
@@ -7971,7 +7976,7 @@ sign_list_defined(sign_T *sp)
|
||||
if (sp->sn_text_hl > 0)
|
||||
{
|
||||
MSG_PUTS(" texthl=");
|
||||
p = get_highlight_name(NULL, sp->sn_text_hl - 1);
|
||||
p = get_highlight_name_ext(NULL, sp->sn_text_hl - 1, FALSE);
|
||||
if (p == NULL)
|
||||
MSG_PUTS("NONE");
|
||||
else
|
||||
|
||||
+1
-1
@@ -1629,7 +1629,7 @@ EX(CMD_wincmd, "wincmd", ex_wincmd,
|
||||
NEEDARG|WORD1|RANGE|NOTADR,
|
||||
ADDR_WINDOWS),
|
||||
EX(CMD_windo, "windo", ex_listdo,
|
||||
BANG|NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL,
|
||||
NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL,
|
||||
ADDR_WINDOWS),
|
||||
EX(CMD_winpos, "winpos", ex_winpos,
|
||||
EXTRA|TRLBAR|CMDWIN,
|
||||
|
||||
+90
-34
@@ -502,40 +502,81 @@ static void ex_folddo(exarg_T *eap);
|
||||
#define DO_DECLARE_EXCMD
|
||||
#include "ex_cmds.h"
|
||||
|
||||
/*
|
||||
* Table used to quickly search for a command, based on its first character.
|
||||
/* Beginning of automatically generated code by create_cmdidxs.pl
|
||||
*
|
||||
* Table giving the index of the first command in cmdnames[] to lookup
|
||||
* based on the first letter of a command.
|
||||
*/
|
||||
static cmdidx_T cmdidxs[27] =
|
||||
static const unsigned short cmdidxs1[26] =
|
||||
{
|
||||
CMD_append,
|
||||
CMD_buffer,
|
||||
CMD_change,
|
||||
CMD_delete,
|
||||
CMD_edit,
|
||||
CMD_file,
|
||||
CMD_global,
|
||||
CMD_help,
|
||||
CMD_insert,
|
||||
CMD_join,
|
||||
CMD_k,
|
||||
CMD_list,
|
||||
CMD_move,
|
||||
CMD_next,
|
||||
CMD_open,
|
||||
CMD_print,
|
||||
CMD_quit,
|
||||
CMD_read,
|
||||
CMD_substitute,
|
||||
CMD_t,
|
||||
CMD_undo,
|
||||
CMD_vglobal,
|
||||
CMD_write,
|
||||
CMD_xit,
|
||||
CMD_yank,
|
||||
CMD_z,
|
||||
CMD_bang
|
||||
/* a */ 0,
|
||||
/* b */ 19,
|
||||
/* c */ 42,
|
||||
/* d */ 103,
|
||||
/* e */ 125,
|
||||
/* f */ 145,
|
||||
/* g */ 161,
|
||||
/* h */ 167,
|
||||
/* i */ 176,
|
||||
/* j */ 194,
|
||||
/* k */ 196,
|
||||
/* l */ 201,
|
||||
/* m */ 259,
|
||||
/* n */ 279,
|
||||
/* o */ 299,
|
||||
/* p */ 311,
|
||||
/* q */ 350,
|
||||
/* r */ 353,
|
||||
/* s */ 372,
|
||||
/* t */ 439,
|
||||
/* u */ 474,
|
||||
/* v */ 485,
|
||||
/* w */ 503,
|
||||
/* x */ 518,
|
||||
/* y */ 527,
|
||||
/* z */ 528
|
||||
};
|
||||
|
||||
/*
|
||||
* Table giving the index of the first command in cmdnames[] to lookup
|
||||
* based on the first 2 letters of a command.
|
||||
* Values in cmdidxs2[c1][c2] are relative to cmdidxs1[c1] so that they
|
||||
* fit in a byte.
|
||||
*/
|
||||
static const unsigned char cmdidxs2[26][26] =
|
||||
{ /* a b c d e f g h i j k l m n o p q r s t u v w x y z */
|
||||
/* a */ { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 6, 0, 0, 0, 7, 15, 0, 16, 0, 0, 0, 0, 0, },
|
||||
/* b */ { 0, 0, 0, 4, 5, 7, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 0, 13, 0, 0, 0, 0, 22, 0, 0, 0, },
|
||||
/* c */ { 0, 10, 12, 14, 16, 18, 21, 0, 0, 0, 0, 29, 33, 36, 42, 51, 53, 54, 55, 0, 57, 0, 60, 0, 0, 0, },
|
||||
/* d */ { 0, 0, 0, 0, 0, 0, 0, 0, 6, 15, 0, 16, 0, 0, 17, 0, 0, 19, 20, 0, 0, 0, 0, 0, 0, 0, },
|
||||
/* e */ { 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 7, 9, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, },
|
||||
/* f */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 15, 0, 0, 0, 0, 0, },
|
||||
/* g */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 2, 0, 0, 4, 5, 0, 0, 0, 0, },
|
||||
/* h */ { 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
|
||||
/* i */ { 0, 0, 0, 0, 0, 3, 0, 0, 0, 4, 0, 5, 6, 0, 0, 0, 0, 0, 13, 0, 15, 0, 0, 0, 0, 0, },
|
||||
/* j */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, },
|
||||
/* k */ { 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
|
||||
/* l */ { 0, 9, 11, 15, 16, 20, 23, 28, 0, 0, 0, 30, 33, 36, 40, 46, 0, 48, 57, 49, 50, 54, 56, 0, 0, 0, },
|
||||
/* m */ { 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
|
||||
/* n */ { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 8, 10, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, },
|
||||
/* o */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 5, 0, 0, 0, 0, 0, 0, 9, 0, 11, 0, 0, 0, },
|
||||
/* p */ { 0, 0, 3, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 9, 0, 0, 16, 17, 26, 0, 27, 0, 28, 0, },
|
||||
/* q */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
|
||||
/* r */ { 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 18, 0, 0, 0, 0, },
|
||||
/* s */ { 0, 6, 15, 0, 18, 22, 0, 24, 25, 0, 0, 28, 30, 34, 38, 40, 0, 48, 0, 49, 0, 61, 62, 0, 63, 0, },
|
||||
/* t */ { 0, 0, 19, 0, 22, 23, 0, 24, 0, 25, 0, 26, 27, 28, 29, 30, 0, 31, 33, 0, 34, 0, 0, 0, 0, 0, },
|
||||
/* u */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
|
||||
/* v */ { 0, 0, 0, 0, 1, 0, 0, 0, 4, 0, 0, 0, 9, 12, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 0, 0, },
|
||||
/* w */ { 0, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 8, 0, 9, 10, 0, 12, 0, 13, 14, 0, 0, 0, 0, },
|
||||
/* x */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, },
|
||||
/* y */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, },
|
||||
/* z */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }
|
||||
};
|
||||
|
||||
static const int command_count = 541;
|
||||
|
||||
/* End of automatically generated code by create_cmdidxs.pl */
|
||||
|
||||
static char_u dollar_command[2] = {'$', 0};
|
||||
|
||||
|
||||
@@ -621,7 +662,6 @@ restore_dbg_stuff(struct dbg_stuff *dsp)
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* do_exmode(): Repeatedly get commands for the "Ex" mode, until the ":vi"
|
||||
* command is given.
|
||||
@@ -3215,10 +3255,25 @@ find_command(exarg_T *eap, int *full UNUSED)
|
||||
}
|
||||
}
|
||||
|
||||
if (ASCII_ISLOWER(*eap->cmd))
|
||||
eap->cmdidx = cmdidxs[CharOrdLow(*eap->cmd)];
|
||||
if (ASCII_ISLOWER(eap->cmd[0]))
|
||||
{
|
||||
int c1 = eap->cmd[0];
|
||||
int c2 = eap->cmd[1];
|
||||
|
||||
if (command_count != (int)CMD_SIZE)
|
||||
{
|
||||
iemsg((char_u *)_("E943: Command table needs to be updated, run 'make cmdidxs'"));
|
||||
getout(1);
|
||||
}
|
||||
|
||||
/* Use a precomputed index for fast look-up in cmdnames[]
|
||||
* taking into account the first 2 letters of eap->cmd. */
|
||||
eap->cmdidx = cmdidxs1[CharOrdLow(c1)];
|
||||
if (ASCII_ISLOWER(c2))
|
||||
eap->cmdidx += cmdidxs2[CharOrdLow(c1)][CharOrdLow(c2)];
|
||||
}
|
||||
else
|
||||
eap->cmdidx = cmdidxs[26];
|
||||
eap->cmdidx = CMD_bang;
|
||||
|
||||
for ( ; (int)eap->cmdidx < (int)CMD_SIZE;
|
||||
eap->cmdidx = (cmdidx_T)((int)eap->cmdidx + 1))
|
||||
@@ -10333,6 +10388,7 @@ ex_normal(exarg_T *eap)
|
||||
{
|
||||
curwin->w_cursor.lnum = eap->line1++;
|
||||
curwin->w_cursor.col = 0;
|
||||
check_cursor_moved(curwin);
|
||||
}
|
||||
|
||||
exec_normal_cmd(
|
||||
|
||||
+6
-6
@@ -127,7 +127,7 @@ static void clear_hist_entry(histentry_T *hisptr);
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_CMDWIN
|
||||
static int ex_window(void);
|
||||
static int open_cmdwin(void);
|
||||
#endif
|
||||
|
||||
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
|
||||
@@ -773,7 +773,7 @@ getcmdline(
|
||||
/*
|
||||
* Open a window to edit the command line (and history).
|
||||
*/
|
||||
c = ex_window();
|
||||
c = open_cmdwin();
|
||||
some_key_typed = TRUE;
|
||||
}
|
||||
}
|
||||
@@ -1292,7 +1292,7 @@ getcmdline(
|
||||
goto cmdline_not_changed;
|
||||
|
||||
case K_IGNORE:
|
||||
/* Ignore mouse event or ex_window() result. */
|
||||
/* Ignore mouse event or open_cmdwin() result. */
|
||||
goto cmdline_not_changed;
|
||||
|
||||
#ifdef FEAT_GUI_W32
|
||||
@@ -4158,7 +4158,7 @@ showmatches(expand_T *xp, int wildmenu UNUSED)
|
||||
got_int = FALSE; /* only int. the completion, not the cmd line */
|
||||
#ifdef FEAT_WILDMENU
|
||||
else if (wildmenu)
|
||||
win_redr_status_matches(xp, num_files, files_found, 0, showtail);
|
||||
win_redr_status_matches(xp, num_files, files_found, -1, showtail);
|
||||
#endif
|
||||
else
|
||||
{
|
||||
@@ -6810,7 +6810,7 @@ cmd_gchar(int offset)
|
||||
* K_IGNORE if editing continues
|
||||
*/
|
||||
static int
|
||||
ex_window(void)
|
||||
open_cmdwin(void)
|
||||
{
|
||||
struct cmdline_info save_ccline;
|
||||
bufref_T old_curbuf;
|
||||
@@ -6855,6 +6855,7 @@ ex_window(void)
|
||||
# endif
|
||||
/* don't use a new tab page */
|
||||
cmdmod.tab = 0;
|
||||
cmdmod.noswapfile = 1;
|
||||
|
||||
/* Create a window for the command-line buffer. */
|
||||
if (win_split((int)p_cwh, WSP_BOT) == FAIL)
|
||||
@@ -6871,7 +6872,6 @@ ex_window(void)
|
||||
(void)do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE, NULL);
|
||||
(void)setfname(curbuf, (char_u *)"[Command Line]", NULL, TRUE);
|
||||
set_option_value((char_u *)"bt", 0L, (char_u *)"nofile", OPT_LOCAL);
|
||||
set_option_value((char_u *)"swf", 0L, NULL, OPT_LOCAL);
|
||||
curbuf->b_p_ma = TRUE;
|
||||
#ifdef FEAT_FOLDING
|
||||
curwin->w_p_fen = FALSE;
|
||||
|
||||
+1
-1
@@ -1695,7 +1695,7 @@ conv_to_pvim(void)
|
||||
ptr[i] = toF_leading(ptr[i]);
|
||||
++i;
|
||||
|
||||
while (canF_Rjoin(ptr[i]) && i < llen)
|
||||
while (i < llen && canF_Rjoin(ptr[i]))
|
||||
{
|
||||
ptr[i] = toF_Rjoin(ptr[i]);
|
||||
if (F_isterm(ptr[i]) || !F_isalpha(ptr[i]))
|
||||
|
||||
+3
-2
@@ -9354,6 +9354,7 @@ apply_autocmds_group(
|
||||
proftime_T wait_time;
|
||||
#endif
|
||||
int did_save_redobuff = FALSE;
|
||||
save_redo_T save_redo;
|
||||
|
||||
/*
|
||||
* Quickly return if there are no autocommands for this event or
|
||||
@@ -9559,7 +9560,7 @@ apply_autocmds_group(
|
||||
if (!ins_compl_active())
|
||||
#endif
|
||||
{
|
||||
saveRedobuff();
|
||||
saveRedobuff(&save_redo);
|
||||
did_save_redobuff = TRUE;
|
||||
}
|
||||
did_filetype = keep_filetype;
|
||||
@@ -9662,7 +9663,7 @@ apply_autocmds_group(
|
||||
{
|
||||
restore_search_patterns();
|
||||
if (did_save_redobuff)
|
||||
restoreRedobuff();
|
||||
restoreRedobuff(&save_redo);
|
||||
did_filetype = FALSE;
|
||||
while (au_pending_free_buf != NULL)
|
||||
{
|
||||
|
||||
+1
-1
@@ -2755,7 +2755,7 @@ foldUpdateIEMSRecurse(
|
||||
/* End of fold found, update the length when it got shorter. */
|
||||
if (fp->fd_len != flp->lnum - fp->fd_top)
|
||||
{
|
||||
if (fp->fd_top + fp->fd_len > bot + 1)
|
||||
if (fp->fd_top + fp->fd_len - 1 > bot)
|
||||
{
|
||||
/* fold continued below bot */
|
||||
if (getlevel == foldlevelMarker
|
||||
|
||||
+29
-31
@@ -42,10 +42,6 @@
|
||||
|
||||
static buffheader_T redobuff = {{NULL, {NUL}}, NULL, 0, 0};
|
||||
static buffheader_T old_redobuff = {{NULL, {NUL}}, NULL, 0, 0};
|
||||
#if defined(FEAT_AUTOCMD) || defined(FEAT_EVAL) || defined(PROTO)
|
||||
static buffheader_T save_redobuff = {{NULL, {NUL}}, NULL, 0, 0};
|
||||
static buffheader_T save_old_redobuff = {{NULL, {NUL}}, NULL, 0, 0};
|
||||
#endif
|
||||
static buffheader_T recordbuff = {{NULL, {NUL}}, NULL, 0, 0};
|
||||
|
||||
static int typeahead_char = 0; /* typeahead char that's not flushed */
|
||||
@@ -521,27 +517,22 @@ CancelRedo(void)
|
||||
* Save redobuff and old_redobuff to save_redobuff and save_old_redobuff.
|
||||
* Used before executing autocommands and user functions.
|
||||
*/
|
||||
static int save_level = 0;
|
||||
|
||||
void
|
||||
saveRedobuff(void)
|
||||
saveRedobuff(save_redo_T *save_redo)
|
||||
{
|
||||
char_u *s;
|
||||
|
||||
if (save_level++ == 0)
|
||||
{
|
||||
save_redobuff = redobuff;
|
||||
redobuff.bh_first.b_next = NULL;
|
||||
save_old_redobuff = old_redobuff;
|
||||
old_redobuff.bh_first.b_next = NULL;
|
||||
save_redo->sr_redobuff = redobuff;
|
||||
redobuff.bh_first.b_next = NULL;
|
||||
save_redo->sr_old_redobuff = old_redobuff;
|
||||
old_redobuff.bh_first.b_next = NULL;
|
||||
|
||||
/* Make a copy, so that ":normal ." in a function works. */
|
||||
s = get_buffcont(&save_redobuff, FALSE);
|
||||
if (s != NULL)
|
||||
{
|
||||
add_buff(&redobuff, s, -1L);
|
||||
vim_free(s);
|
||||
}
|
||||
/* Make a copy, so that ":normal ." in a function works. */
|
||||
s = get_buffcont(&save_redo->sr_redobuff, FALSE);
|
||||
if (s != NULL)
|
||||
{
|
||||
add_buff(&redobuff, s, -1L);
|
||||
vim_free(s);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -550,15 +541,12 @@ saveRedobuff(void)
|
||||
* Used after executing autocommands and user functions.
|
||||
*/
|
||||
void
|
||||
restoreRedobuff(void)
|
||||
restoreRedobuff(save_redo_T *save_redo)
|
||||
{
|
||||
if (--save_level == 0)
|
||||
{
|
||||
free_buff(&redobuff);
|
||||
redobuff = save_redobuff;
|
||||
free_buff(&old_redobuff);
|
||||
old_redobuff = save_old_redobuff;
|
||||
}
|
||||
free_buff(&redobuff);
|
||||
redobuff = save_redo->sr_redobuff;
|
||||
free_buff(&old_redobuff);
|
||||
old_redobuff = save_redo->sr_old_redobuff;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -932,7 +920,7 @@ init_typebuf(void)
|
||||
typebuf.tb_noremap = noremapbuf_init;
|
||||
typebuf.tb_buflen = TYPELEN_INIT;
|
||||
typebuf.tb_len = 0;
|
||||
typebuf.tb_off = 0;
|
||||
typebuf.tb_off = MAXMAPLEN + 4;
|
||||
typebuf.tb_change_cnt = 1;
|
||||
}
|
||||
}
|
||||
@@ -986,11 +974,21 @@ ins_typebuf(
|
||||
typebuf.tb_off -= addlen;
|
||||
mch_memmove(typebuf.tb_buf + typebuf.tb_off, str, (size_t)addlen);
|
||||
}
|
||||
else if (typebuf.tb_len == 0 && typebuf.tb_buflen
|
||||
>= addlen + 3 * (MAXMAPLEN + 4))
|
||||
{
|
||||
/*
|
||||
* Buffer is empty and string fits in the existing buffer.
|
||||
* Leave some space before and after, if possible.
|
||||
*/
|
||||
typebuf.tb_off = (typebuf.tb_buflen - addlen - 3 * (MAXMAPLEN + 4)) / 2;
|
||||
mch_memmove(typebuf.tb_buf + typebuf.tb_off, str, (size_t)addlen);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Need to allocate a new buffer.
|
||||
* In typebuf.tb_buf there must always be room for 3 * MAXMAPLEN + 4
|
||||
* In typebuf.tb_buf there must always be room for 3 * (MAXMAPLEN + 4)
|
||||
* characters. We add some extra room to avoid having to allocate too
|
||||
* often.
|
||||
*/
|
||||
@@ -1303,7 +1301,7 @@ alloc_typebuf(void)
|
||||
return FAIL;
|
||||
}
|
||||
typebuf.tb_buflen = TYPELEN_INIT;
|
||||
typebuf.tb_off = 0;
|
||||
typebuf.tb_off = MAXMAPLEN + 4; /* can insert without realloc */
|
||||
typebuf.tb_len = 0;
|
||||
typebuf.tb_maplen = 0;
|
||||
typebuf.tb_silent = 0;
|
||||
|
||||
+2
-3
@@ -532,7 +532,6 @@ EXTERN int clip_autoselect_plus INIT(= FALSE);
|
||||
EXTERN int clip_autoselectml INIT(= FALSE);
|
||||
EXTERN int clip_html INIT(= FALSE);
|
||||
EXTERN regprog_T *clip_exclude_prog INIT(= NULL);
|
||||
EXTERN int clip_did_set_selection INIT(= TRUE);
|
||||
EXTERN int clip_unnamed_saved INIT(= 0);
|
||||
#endif
|
||||
|
||||
@@ -934,10 +933,10 @@ EXTERN int State INIT(= NORMAL); /* This is the current state of the
|
||||
* command interpreter. */
|
||||
|
||||
EXTERN int finish_op INIT(= FALSE);/* TRUE while an operator is pending */
|
||||
EXTERN int opcount INIT(= 0); /* count for pending operator */
|
||||
EXTERN long opcount INIT(= 0); /* count for pending operator */
|
||||
|
||||
/*
|
||||
* ex mode (Q) state
|
||||
* Ex mode (Q) state
|
||||
*/
|
||||
EXTERN int exmode_active INIT(= 0); /* zero, EXMODE_NORMAL or EXMODE_VIM */
|
||||
EXTERN int ex_no_reprint INIT(= FALSE); /* no need to print after z or p */
|
||||
|
||||
+4
-184
@@ -92,19 +92,6 @@ static void gtk_form_position_child(GtkForm *form,
|
||||
gboolean force_allocate);
|
||||
static void gtk_form_position_children(GtkForm *form);
|
||||
|
||||
#if !GTK_CHECK_VERSION(3,0,0)
|
||||
static GdkFilterReturn gtk_form_filter(GdkXEvent *gdk_xevent,
|
||||
GdkEvent *event,
|
||||
gpointer data);
|
||||
static GdkFilterReturn gtk_form_main_filter(GdkXEvent *gdk_xevent,
|
||||
GdkEvent *event,
|
||||
gpointer data);
|
||||
#endif
|
||||
#if !GTK_CHECK_VERSION(3,16,0)
|
||||
static void gtk_form_set_static_gravity(GdkWindow *window,
|
||||
gboolean use_static);
|
||||
#endif
|
||||
|
||||
static void gtk_form_send_configure(GtkForm *form);
|
||||
|
||||
static void gtk_form_child_map(GtkWidget *widget, gpointer user_data);
|
||||
@@ -171,9 +158,6 @@ gtk_form_put(GtkForm *form,
|
||||
gtk_form_attach_child_window(form, child);
|
||||
|
||||
gtk_widget_set_parent(child_widget, GTK_WIDGET(form));
|
||||
#if !GTK_CHECK_VERSION(3,0,0)
|
||||
gtk_widget_size_request(child->widget, NULL);
|
||||
#endif
|
||||
|
||||
#if GTK_CHECK_VERSION(3,0,0)
|
||||
if (gtk_widget_get_realized(GTK_WIDGET(form))
|
||||
@@ -301,19 +285,7 @@ gtk_form_init(GtkForm *form)
|
||||
gtk_widget_set_has_window(GTK_WIDGET(form), TRUE);
|
||||
#endif
|
||||
form->children = NULL;
|
||||
|
||||
#if !GTK_CHECK_VERSION(3,0,0)
|
||||
form->width = 1;
|
||||
form->height = 1;
|
||||
#endif
|
||||
|
||||
form->bin_window = NULL;
|
||||
|
||||
#if !GTK_CHECK_VERSION(3,0,0)
|
||||
form->configure_serial = 0;
|
||||
form->visibility = GDK_VISIBILITY_PARTIAL;
|
||||
#endif
|
||||
|
||||
form->freeze_count = 0;
|
||||
}
|
||||
|
||||
@@ -393,10 +365,6 @@ gtk_form_realize(GtkWidget *widget)
|
||||
#endif
|
||||
gdk_window_set_user_data(form->bin_window, widget);
|
||||
|
||||
#if !GTK_CHECK_VERSION(3,16,0)
|
||||
gtk_form_set_static_gravity(form->bin_window, TRUE);
|
||||
#endif
|
||||
|
||||
#if GTK_CHECK_VERSION(3,0,0)
|
||||
{
|
||||
GtkStyleContext * const sctx = gtk_widget_get_style_context(widget);
|
||||
@@ -414,11 +382,6 @@ gtk_form_realize(GtkWidget *widget)
|
||||
gtk_style_set_background(widget->style, form->bin_window, GTK_STATE_NORMAL);
|
||||
#endif
|
||||
|
||||
#if !GTK_CHECK_VERSION(3,0,0)
|
||||
gdk_window_add_filter(widget->window, gtk_form_main_filter, form);
|
||||
gdk_window_add_filter(form->bin_window, gtk_form_filter, form);
|
||||
#endif
|
||||
|
||||
for (tmp_list = form->children; tmp_list; tmp_list = tmp_list->next)
|
||||
{
|
||||
GtkFormChild *child = tmp_list->data;
|
||||
@@ -540,33 +503,11 @@ gtk_form_unrealize(GtkWidget *widget)
|
||||
static void
|
||||
gtk_form_size_request(GtkWidget *widget, GtkRequisition *requisition)
|
||||
{
|
||||
#if !GTK_CHECK_VERSION(3,0,0)
|
||||
GList *tmp_list;
|
||||
GtkForm *form;
|
||||
#endif
|
||||
|
||||
g_return_if_fail(GTK_IS_FORM(widget));
|
||||
g_return_if_fail(requisition != NULL);
|
||||
|
||||
#if !GTK_CHECK_VERSION(3,0,0)
|
||||
form = GTK_FORM(widget);
|
||||
#endif
|
||||
|
||||
#if GTK_CHECK_VERSION(3,0,0)
|
||||
requisition->width = 1;
|
||||
requisition->height = 1;
|
||||
#else
|
||||
requisition->width = form->width;
|
||||
requisition->height = form->height;
|
||||
|
||||
tmp_list = form->children;
|
||||
|
||||
while (tmp_list)
|
||||
{
|
||||
GtkFormChild *child = tmp_list->data;
|
||||
gtk_widget_size_request(child->widget, NULL);
|
||||
tmp_list = tmp_list->next;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#if GTK_CHECK_VERSION(3,0,0)
|
||||
@@ -735,28 +676,9 @@ gtk_form_expose(GtkWidget *widget, GdkEventExpose *event)
|
||||
return FALSE;
|
||||
|
||||
for (tmp_list = form->children; tmp_list; tmp_list = tmp_list->next)
|
||||
{
|
||||
GtkFormChild *formchild = tmp_list->data;
|
||||
GtkWidget *child = formchild->widget;
|
||||
/*
|
||||
* The following chunk of code is taken from gtkcontainer.c. The
|
||||
* gtk1.x code synthesized expose events directly on the child widgets,
|
||||
* which can't be done in gtk2
|
||||
*/
|
||||
if (GTK_WIDGET_DRAWABLE(child) && GTK_WIDGET_NO_WINDOW(child)
|
||||
&& child->window == event->window)
|
||||
{
|
||||
GdkEventExpose child_event;
|
||||
child_event = *event;
|
||||
|
||||
child_event.region = gtk_widget_region_intersect(child, event->region);
|
||||
if (!gdk_region_empty(child_event.region))
|
||||
{
|
||||
gdk_region_get_clipbox(child_event.region, &child_event.area);
|
||||
gtk_widget_send_expose(child, (GdkEvent *)&child_event);
|
||||
}
|
||||
}
|
||||
}
|
||||
gtk_container_propagate_expose(GTK_CONTAINER(widget),
|
||||
GTK_WIDGET(((GtkFormChild *)tmp_list->data)->widget),
|
||||
event);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -914,9 +836,6 @@ gtk_form_attach_child_window(GtkForm *form, GtkFormChild *child)
|
||||
#endif
|
||||
|
||||
gtk_widget_set_parent_window(child->widget, child->window);
|
||||
#if !GTK_CHECK_VERSION(3,16,0)
|
||||
gtk_form_set_static_gravity(child->window, TRUE);
|
||||
#endif
|
||||
/*
|
||||
* Install signal handlers to map/unmap child->window
|
||||
* alongside with the actual widget.
|
||||
@@ -948,15 +867,6 @@ gtk_form_realize_child(GtkForm *form, GtkFormChild *child)
|
||||
{
|
||||
gtk_form_attach_child_window(form, child);
|
||||
gtk_widget_realize(child->widget);
|
||||
|
||||
#if !GTK_CHECK_VERSION(3,16,0)
|
||||
if (child->window == NULL) /* might be already set, see above */
|
||||
# if GTK_CHECK_VERSION(3,0,0)
|
||||
gtk_form_set_static_gravity(gtk_widget_get_window(child->widget), TRUE);
|
||||
# else
|
||||
gtk_form_set_static_gravity(child->widget->window, TRUE);
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1068,96 +978,6 @@ gtk_form_position_children(GtkForm *form)
|
||||
gtk_form_position_child(form, tmp_list->data, FALSE);
|
||||
}
|
||||
|
||||
/* Callbacks */
|
||||
|
||||
/* The main event filter. Actually, we probably don't really need
|
||||
* to install this as a filter at all, since we are calling it
|
||||
* directly above in the expose-handling hack.
|
||||
*
|
||||
* This routine identifies expose events that are generated when
|
||||
* we've temporarily moved the bin_window_origin, and translates
|
||||
* them or discards them, depending on whether we are obscured
|
||||
* or not.
|
||||
*/
|
||||
#if !GTK_CHECK_VERSION(3,0,0)
|
||||
static GdkFilterReturn
|
||||
gtk_form_filter(GdkXEvent *gdk_xevent, GdkEvent *event UNUSED, gpointer data)
|
||||
{
|
||||
XEvent *xevent;
|
||||
GtkForm *form;
|
||||
|
||||
xevent = (XEvent *) gdk_xevent;
|
||||
form = GTK_FORM(data);
|
||||
|
||||
switch (xevent->type)
|
||||
{
|
||||
case Expose:
|
||||
if (xevent->xexpose.serial == form->configure_serial)
|
||||
{
|
||||
if (form->visibility == GDK_VISIBILITY_UNOBSCURED)
|
||||
return GDK_FILTER_REMOVE;
|
||||
else
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case ConfigureNotify:
|
||||
if ((xevent->xconfigure.x != 0) || (xevent->xconfigure.y != 0))
|
||||
form->configure_serial = xevent->xconfigure.serial;
|
||||
break;
|
||||
}
|
||||
|
||||
return GDK_FILTER_CONTINUE;
|
||||
}
|
||||
|
||||
/* Although GDK does have a GDK_VISIBILITY_NOTIFY event,
|
||||
* there is no corresponding event in GTK, so we have
|
||||
* to get the events from a filter
|
||||
*/
|
||||
static GdkFilterReturn
|
||||
gtk_form_main_filter(GdkXEvent *gdk_xevent,
|
||||
GdkEvent *event UNUSED,
|
||||
gpointer data)
|
||||
{
|
||||
XEvent *xevent;
|
||||
GtkForm *form;
|
||||
|
||||
xevent = (XEvent *) gdk_xevent;
|
||||
form = GTK_FORM(data);
|
||||
|
||||
if (xevent->type == VisibilityNotify)
|
||||
{
|
||||
switch (xevent->xvisibility.state)
|
||||
{
|
||||
case VisibilityFullyObscured:
|
||||
form->visibility = GDK_VISIBILITY_FULLY_OBSCURED;
|
||||
break;
|
||||
|
||||
case VisibilityPartiallyObscured:
|
||||
form->visibility = GDK_VISIBILITY_PARTIAL;
|
||||
break;
|
||||
|
||||
case VisibilityUnobscured:
|
||||
form->visibility = GDK_VISIBILITY_UNOBSCURED;
|
||||
break;
|
||||
}
|
||||
|
||||
return GDK_FILTER_REMOVE;
|
||||
}
|
||||
return GDK_FILTER_CONTINUE;
|
||||
}
|
||||
#endif /* !GTK_CHECK_VERSION(3,0,0) */
|
||||
|
||||
#if !GTK_CHECK_VERSION(3,16,0)
|
||||
static void
|
||||
gtk_form_set_static_gravity(GdkWindow *window, gboolean use_static)
|
||||
{
|
||||
/* We don't check if static gravity is actually supported, because it
|
||||
* results in an annoying assertion error message. */
|
||||
gdk_window_set_static_gravities(window, use_static);
|
||||
}
|
||||
#endif /* !GTK_CHECK_VERSION(3,16,0) */
|
||||
|
||||
void
|
||||
gtk_form_move_resize(GtkForm *form, GtkWidget *widget,
|
||||
gint x, gint y, gint w, gint h)
|
||||
|
||||
@@ -43,19 +43,7 @@ struct _GtkForm
|
||||
GtkContainer container;
|
||||
|
||||
GList *children;
|
||||
|
||||
#ifndef USE_GTK3
|
||||
guint width;
|
||||
guint height;
|
||||
#endif
|
||||
|
||||
GdkWindow *bin_window;
|
||||
|
||||
#ifndef USE_GTK3
|
||||
GdkVisibilityState visibility;
|
||||
gulong configure_serial;
|
||||
#endif
|
||||
|
||||
gint freeze_count;
|
||||
};
|
||||
|
||||
|
||||
+11
-1
@@ -3509,7 +3509,7 @@ gui_mch_init_font(char_u *font_name, int fontset)
|
||||
GetFontInfo(&font_info);
|
||||
|
||||
gui.char_ascent = font_info.ascent;
|
||||
gui.char_width = CharWidth('_');
|
||||
gui.char_width = p_columnspace + CharWidth('_');
|
||||
gui.char_height = font_info.ascent + font_info.descent + p_linespace;
|
||||
|
||||
#ifdef USE_ATSUI_DRAWING
|
||||
@@ -3534,6 +3534,16 @@ gui_mch_adjust_charheight(void)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Adjust gui.char_width (after 'columnspace' was changed).
|
||||
*/
|
||||
int
|
||||
gui_mch_adjust_charwidth(void)
|
||||
{
|
||||
gui.char_width = p_columnspace + CharWidth('_');
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get a font structure for highlighting.
|
||||
*/
|
||||
|
||||
+18
-9
@@ -89,15 +89,16 @@ static char *(main_errors[]) =
|
||||
};
|
||||
|
||||
#ifndef PROTO /* don't want a prototype for main() */
|
||||
|
||||
/* Various parameters passed between main() and other functions. */
|
||||
static mparm_T params;
|
||||
|
||||
#ifndef NO_VIM_MAIN /* skip this for unittests */
|
||||
|
||||
static char_u *start_dir = NULL; /* current working dir on startup */
|
||||
|
||||
static int has_dash_c_arg = FALSE;
|
||||
|
||||
/* Various parameters passed between main() and other functions. */
|
||||
static mparm_T params;
|
||||
|
||||
int
|
||||
# ifdef VIMDLL
|
||||
_export
|
||||
@@ -688,12 +689,6 @@ vim_main2(void)
|
||||
|
||||
starttermcap(); /* start termcap if not done by wait_return() */
|
||||
TIME_MSG("start termcap");
|
||||
#if defined(FEAT_TERMRESPONSE)
|
||||
# if defined(FEAT_MBYTE)
|
||||
may_req_ambiguous_char_width();
|
||||
# endif
|
||||
may_req_bg_color();
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_MOUSE
|
||||
setmouse(); /* may start using the mouse */
|
||||
@@ -850,6 +845,11 @@ vim_main2(void)
|
||||
/* Requesting the termresponse is postponed until here, so that a "-c q"
|
||||
* argument doesn't make it appear in the shell Vim was started from. */
|
||||
may_req_termresponse();
|
||||
|
||||
# if defined(FEAT_MBYTE)
|
||||
may_req_ambiguous_char_width();
|
||||
# endif
|
||||
may_req_bg_color();
|
||||
#endif
|
||||
|
||||
/* start in insert mode */
|
||||
@@ -1075,6 +1075,15 @@ common_init(mparm_T *paramp)
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* Return TRUE when the --not-a-term argument was found.
|
||||
*/
|
||||
int
|
||||
is_not_a_term()
|
||||
{
|
||||
return params.not_a_term;
|
||||
}
|
||||
|
||||
/*
|
||||
* Main loop: Execute Normal mode commands until exiting Vim.
|
||||
* Also used to handle commands in the command-line window, until the window
|
||||
|
||||
+1
-1
@@ -315,7 +315,7 @@ trunc_string(
|
||||
for (;;)
|
||||
{
|
||||
do
|
||||
half = half - (*mb_head_off)(s, s + half - 1) - 1;
|
||||
half = half - utf_head_off(s, s + half - 1) - 1;
|
||||
while (half > 0 && utf_iscomposing(utf_ptr2char(s + half)));
|
||||
n = ptr2cells(s + half);
|
||||
if (len + n > room || half == 0)
|
||||
|
||||
@@ -96,8 +96,6 @@ test_trunc_string(void)
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
mparm_T params;
|
||||
|
||||
vim_memset(¶ms, 0, sizeof(params));
|
||||
params.argc = argc;
|
||||
params.argv = argv;
|
||||
|
||||
+2
-2
@@ -1874,7 +1874,7 @@ vim_strchr(char_u *string, int c)
|
||||
{
|
||||
while (*p != NUL)
|
||||
{
|
||||
int l = (*mb_ptr2len)(p);
|
||||
int l = utfc_ptr2len(p);
|
||||
|
||||
/* Avoid matching an illegal byte here. */
|
||||
if (utf_ptr2char(p) == c && l > 1)
|
||||
@@ -2129,7 +2129,7 @@ ga_concat(garray_T *gap, char_u *s)
|
||||
{
|
||||
int len;
|
||||
|
||||
if (s == NULL)
|
||||
if (s == NULL || *s == NUL)
|
||||
return;
|
||||
len = (int)STRLEN(s);
|
||||
if (ga_grow(gap, len) == OK)
|
||||
|
||||
+4
-5
@@ -203,11 +203,9 @@ update_topline(void)
|
||||
int save_so = p_so;
|
||||
#endif
|
||||
|
||||
if (!screen_valid(TRUE))
|
||||
return;
|
||||
|
||||
/* If the window height is zero just use the cursor line. */
|
||||
if (curwin->w_height == 0)
|
||||
/* If there is no valid screen and when the window height is zero just use
|
||||
* the cursor line. */
|
||||
if (!screen_valid(TRUE) || curwin->w_height == 0)
|
||||
{
|
||||
curwin->w_topline = curwin->w_cursor.lnum;
|
||||
curwin->w_botline = curwin->w_topline;
|
||||
@@ -2621,6 +2619,7 @@ halfpage(int flag, linenr_T Prenum)
|
||||
n = (curwin->w_p_scr <= curwin->w_height) ?
|
||||
curwin->w_p_scr : curwin->w_height;
|
||||
|
||||
update_topline();
|
||||
validate_botline();
|
||||
room = curwin->w_empty_rows;
|
||||
#ifdef FEAT_DIFF
|
||||
|
||||
@@ -6466,7 +6466,7 @@ clip_get_selection(VimClipboard *cbd)
|
||||
VIsual = old_visual;
|
||||
VIsual_mode = old_visual_mode;
|
||||
}
|
||||
else
|
||||
else if (!is_clipboard_needs_update())
|
||||
{
|
||||
clip_free_selection(cbd);
|
||||
|
||||
|
||||
+19
-1
@@ -855,6 +855,13 @@ static struct vimoption options[] =
|
||||
{"columns", "co", P_NUM|P_NODEFAULT|P_NO_MKRC|P_VI_DEF|P_RCLR,
|
||||
(char_u *)&Columns, PV_NONE,
|
||||
{(char_u *)80L, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"columnspace", "csp", P_NUM|P_VI_DEF|P_RCLR,
|
||||
#ifdef FEAT_GUI_MACVIM
|
||||
(char_u *)&p_columnspace, PV_NONE,
|
||||
#else
|
||||
(char_u *)NULL, PV_NONE,
|
||||
#endif
|
||||
{(char_u *)0L, (char_u *)0L} SCRIPTID_INIT},
|
||||
{"comments", "com", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA
|
||||
|P_NODUP|P_CURSWANT,
|
||||
#ifdef FEAT_COMMENTS
|
||||
@@ -3264,6 +3271,7 @@ static struct vimoption options[] =
|
||||
p_term("t_vi", T_VI)
|
||||
p_term("t_vs", T_VS)
|
||||
p_term("t_WP", T_CWP)
|
||||
p_term("t_GP", T_CGP)
|
||||
p_term("t_WS", T_CWS)
|
||||
p_term("t_xn", T_XN)
|
||||
p_term("t_xs", T_XS)
|
||||
@@ -8985,6 +8993,16 @@ set_num_option(
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_GUI_MACVIM
|
||||
else if (pp == &p_columnspace)
|
||||
{
|
||||
/* Recompute gui.char_width and resize the Vim window to keep the
|
||||
* same number of columns. */
|
||||
if (gui.in_use && gui_mch_adjust_charwidth() == OK)
|
||||
gui_set_shellsize(FALSE, FALSE, RESIZE_HOR);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_FOLDING
|
||||
/* 'foldlevel' */
|
||||
else if (pp == &curwin->w_p_fdl)
|
||||
@@ -11268,7 +11286,7 @@ buf_copy_options(buf_T *buf, int flags)
|
||||
buf->b_p_ml = p_ml;
|
||||
buf->b_p_ml_nobin = p_ml_nobin;
|
||||
buf->b_p_inf = p_inf;
|
||||
buf->b_p_swf = p_swf;
|
||||
buf->b_p_swf = cmdmod.noswapfile ? FALSE : p_swf;
|
||||
#ifdef FEAT_INS_EXPAND
|
||||
buf->b_p_cpt = vim_strsave(p_cpt);
|
||||
#endif
|
||||
|
||||
@@ -644,6 +644,7 @@ EXTERN int p_macatsui; /* 'macatsui' */
|
||||
#ifdef FEAT_GUI_MACVIM
|
||||
EXTERN int p_macligatures; /* 'macligatures' */
|
||||
EXTERN int p_macthinstrokes; /* 'macthinstrokes' */
|
||||
EXTERN long p_columnspace; /* 'columnspace' */
|
||||
#endif
|
||||
EXTERN int p_magic; /* 'magic' */
|
||||
#ifdef FEAT_MBYTE
|
||||
|
||||
+9
-3
@@ -511,7 +511,7 @@ mch_inchar(
|
||||
|| interrupted
|
||||
#endif
|
||||
|| wait_time > 0
|
||||
|| !did_start_blocking)
|
||||
|| (wtime < 0 && !did_start_blocking))
|
||||
continue;
|
||||
|
||||
/* no character available or interrupted */
|
||||
@@ -6028,6 +6028,7 @@ mch_expand_wildcards(
|
||||
{
|
||||
int i;
|
||||
size_t len;
|
||||
long llen;
|
||||
char_u *p;
|
||||
int dir;
|
||||
|
||||
@@ -6314,9 +6315,13 @@ mch_expand_wildcards(
|
||||
goto notfound;
|
||||
}
|
||||
fseek(fd, 0L, SEEK_END);
|
||||
len = ftell(fd); /* get size of temp file */
|
||||
llen = ftell(fd); /* get size of temp file */
|
||||
fseek(fd, 0L, SEEK_SET);
|
||||
buffer = alloc(len + 1);
|
||||
if (llen < 0)
|
||||
/* just in case ftell() would fail */
|
||||
buffer = NULL;
|
||||
else
|
||||
buffer = alloc(llen + 1);
|
||||
if (buffer == NULL)
|
||||
{
|
||||
/* out of memory */
|
||||
@@ -6325,6 +6330,7 @@ mch_expand_wildcards(
|
||||
fclose(fd);
|
||||
return FAIL;
|
||||
}
|
||||
len = llen;
|
||||
i = fread((char *)buffer, 1, len, fd);
|
||||
fclose(fd);
|
||||
mch_remove(tempname);
|
||||
|
||||
@@ -8,8 +8,8 @@ void typeahead_noflush(int c);
|
||||
void flush_buffers(int flush_typeahead);
|
||||
void ResetRedobuff(void);
|
||||
void CancelRedo(void);
|
||||
void saveRedobuff(void);
|
||||
void restoreRedobuff(void);
|
||||
void saveRedobuff(save_redo_T *save_redo);
|
||||
void restoreRedobuff(save_redo_T *save_redo);
|
||||
void AppendToRedobuff(char_u *s);
|
||||
void AppendToRedobuffLit(char_u *str, int len);
|
||||
void AppendCharToRedobuff(int c);
|
||||
|
||||
@@ -82,6 +82,8 @@ gui_mch_init_font(char_u *font_name, int fontset);
|
||||
gui_mch_set_font(GuiFont font);
|
||||
int
|
||||
gui_mch_adjust_charheight(void);
|
||||
int
|
||||
gui_mch_adjust_charwidth(void);
|
||||
void
|
||||
gui_mch_beep(void);
|
||||
char_u *
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/* main.c */
|
||||
int vim_main2(void);
|
||||
void common_init(mparm_T *paramp);
|
||||
int is_not_a_term(void);
|
||||
void main_loop(int cmdwin, int noexmode);
|
||||
void getout_preserve_modified(int exitval);
|
||||
void getout(int exitval);
|
||||
|
||||
@@ -52,5 +52,6 @@ void highlight_gui_started(void);
|
||||
int highlight_changed(void);
|
||||
void set_context_in_highlight_cmd(expand_T *xp, char_u *arg);
|
||||
char_u *get_highlight_name(expand_T *xp, int idx);
|
||||
char_u *get_highlight_name_ext(expand_T *xp, int idx, int skip_cleared);
|
||||
void free_highlight_fonts(void);
|
||||
/* vim: set ft=c : */
|
||||
|
||||
@@ -22,6 +22,7 @@ void term_cursor_right(int i);
|
||||
void term_append_lines(int line_count);
|
||||
void term_delete_lines(int line_count);
|
||||
void term_set_winpos(int x, int y);
|
||||
int term_get_winpos(int *x, int *y);
|
||||
void term_set_winsize(int width, int height);
|
||||
void term_fg_color(int n);
|
||||
void term_bg_color(int n);
|
||||
|
||||
@@ -16,6 +16,7 @@ void clip_update_selection(VimClipboard *clip);
|
||||
void clip_own_selection(VimClipboard *cbd);
|
||||
void clip_lose_selection(VimClipboard *cbd);
|
||||
void start_global_changes(void);
|
||||
int is_clipboard_needs_update(void);
|
||||
void end_global_changes(void);
|
||||
void clip_auto_select(void);
|
||||
int clip_isautosel_star(void);
|
||||
|
||||
+84
-7
@@ -717,7 +717,8 @@ qf_get_next_file_line(qfstate_T *state)
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
/* Convert a line if it contains a non-ASCII character. */
|
||||
if (state->vc.vc_type != CONV_NONE && has_non_ascii(state->linebuf)) {
|
||||
if (state->vc.vc_type != CONV_NONE && has_non_ascii(state->linebuf))
|
||||
{
|
||||
char_u *line;
|
||||
|
||||
line = string_convert(&state->vc, state->linebuf, &state->linelen);
|
||||
@@ -917,7 +918,8 @@ restofline:
|
||||
}
|
||||
if (fmt_ptr->flags == '+' && !qi->qf_multiscan) /* %+ */
|
||||
{
|
||||
if (linelen > fields->errmsglen) {
|
||||
if (linelen > fields->errmsglen)
|
||||
{
|
||||
/* linelen + null terminator */
|
||||
if ((fields->errmsg = vim_realloc(fields->errmsg,
|
||||
linelen + 1)) == NULL)
|
||||
@@ -931,7 +933,8 @@ restofline:
|
||||
if (regmatch.startp[i] == NULL || regmatch.endp[i] == NULL)
|
||||
continue;
|
||||
len = (int)(regmatch.endp[i] - regmatch.startp[i]);
|
||||
if (len > fields->errmsglen) {
|
||||
if (len > fields->errmsglen)
|
||||
{
|
||||
/* len + null terminator */
|
||||
if ((fields->errmsg = vim_realloc(fields->errmsg, len + 1))
|
||||
== NULL)
|
||||
@@ -1013,7 +1016,8 @@ restofline:
|
||||
fields->namebuf[0] = NUL; /* no match found, remove file name */
|
||||
fields->lnum = 0; /* don't jump to this line */
|
||||
fields->valid = FALSE;
|
||||
if (linelen > fields->errmsglen) {
|
||||
if (linelen > fields->errmsglen)
|
||||
{
|
||||
/* linelen + null terminator */
|
||||
if ((fields->errmsg = vim_realloc(fields->errmsg,
|
||||
linelen + 1)) == NULL)
|
||||
@@ -2746,6 +2750,7 @@ qf_free(qf_info_T *qi, int idx)
|
||||
vim_free(qi->qf_lists[idx].qf_title);
|
||||
qi->qf_lists[idx].qf_title = NULL;
|
||||
qi->qf_lists[idx].qf_index = 0;
|
||||
qi->qf_lists[idx].qf_last = NULL;
|
||||
|
||||
qf_clean_dir_stack(&qi->qf_dir_stack);
|
||||
qi->qf_directory = NULL;
|
||||
@@ -4798,7 +4803,8 @@ qf_add_entries(
|
||||
qi->qf_lists[qi->qf_curlist].qf_nonevalid = TRUE;
|
||||
else
|
||||
qi->qf_lists[qi->qf_curlist].qf_nonevalid = FALSE;
|
||||
if (action != 'a') {
|
||||
if (action != 'a')
|
||||
{
|
||||
qi->qf_lists[qi->qf_curlist].qf_ptr =
|
||||
qi->qf_lists[qi->qf_curlist].qf_start;
|
||||
if (qi->qf_lists[qi->qf_curlist].qf_count > 0)
|
||||
@@ -4861,6 +4867,71 @@ qf_set_properties(qf_info_T *qi, dict_T *what, int action)
|
||||
return retval;
|
||||
}
|
||||
|
||||
/*
|
||||
* Find the non-location list window with the specified location list.
|
||||
*/
|
||||
static win_T *
|
||||
find_win_with_ll(qf_info_T *qi)
|
||||
{
|
||||
win_T *wp = NULL;
|
||||
|
||||
FOR_ALL_WINDOWS(wp)
|
||||
if ((wp->w_llist == qi) && !bt_quickfix(wp->w_buffer))
|
||||
return wp;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* Free the entire quickfix/location list stack.
|
||||
* If the quickfix/location list window is open, then clear it.
|
||||
*/
|
||||
static void
|
||||
qf_free_stack(win_T *wp, qf_info_T *qi)
|
||||
{
|
||||
win_T *qfwin = qf_find_win(qi);
|
||||
win_T *llwin = NULL;
|
||||
win_T *orig_wp = wp;
|
||||
|
||||
if (qfwin != NULL)
|
||||
{
|
||||
/* If the quickfix/location list window is open, then clear it */
|
||||
if (qi->qf_curlist < qi->qf_listcount)
|
||||
qf_free(qi, qi->qf_curlist);
|
||||
qf_update_buffer(qi, NULL);
|
||||
}
|
||||
|
||||
if (wp != NULL && IS_LL_WINDOW(wp))
|
||||
{
|
||||
/* If in the location list window, then use the non-location list
|
||||
* window with this location list (if present)
|
||||
*/
|
||||
llwin = find_win_with_ll(qi);
|
||||
if (llwin != NULL)
|
||||
wp = llwin;
|
||||
}
|
||||
|
||||
qf_free_all(wp);
|
||||
if (wp == NULL)
|
||||
{
|
||||
/* quickfix list */
|
||||
qi->qf_curlist = 0;
|
||||
qi->qf_listcount = 0;
|
||||
}
|
||||
else if (IS_LL_WINDOW(orig_wp))
|
||||
{
|
||||
/* If the location list window is open, then create a new empty
|
||||
* location list */
|
||||
qf_info_T *new_ll = ll_new_list();
|
||||
orig_wp->w_llist_ref = new_ll;
|
||||
if (llwin != NULL)
|
||||
{
|
||||
llwin->w_llist = new_ll;
|
||||
new_ll->qf_refcount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Populate the quickfix list with the items supplied in the list
|
||||
* of dictionaries. "title" will be copied to w:quickfix_title.
|
||||
@@ -4884,7 +4955,12 @@ set_errorlist(
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
if (what != NULL)
|
||||
if (action == 'f')
|
||||
{
|
||||
/* Free the entire quickfix or location list stack */
|
||||
qf_free_stack(wp, qi);
|
||||
}
|
||||
else if (what != NULL)
|
||||
retval = qf_set_properties(qi, what, action);
|
||||
else
|
||||
retval = qf_add_entries(qi, list, title, action);
|
||||
@@ -5187,7 +5263,8 @@ ex_helpgrep(exarg_T *eap)
|
||||
/* Convert a line if 'encoding' is not utf-8 and
|
||||
* the line contains a non-ASCII character. */
|
||||
if (vc.vc_type != CONV_NONE
|
||||
&& has_non_ascii(IObuff)) {
|
||||
&& has_non_ascii(IObuff))
|
||||
{
|
||||
line = string_convert(&vc, IObuff, NULL);
|
||||
if (line == NULL)
|
||||
line = IObuff;
|
||||
|
||||
+6
-6
@@ -2555,17 +2555,17 @@ collection:
|
||||
regc('\t');
|
||||
break;
|
||||
case CLASS_CNTRL:
|
||||
for (cu = 1; cu <= 255; cu++)
|
||||
for (cu = 1; cu <= 127; cu++)
|
||||
if (iscntrl(cu))
|
||||
regmbc(cu);
|
||||
break;
|
||||
case CLASS_DIGIT:
|
||||
for (cu = 1; cu <= 255; cu++)
|
||||
for (cu = 1; cu <= 127; cu++)
|
||||
if (VIM_ISDIGIT(cu))
|
||||
regmbc(cu);
|
||||
break;
|
||||
case CLASS_GRAPH:
|
||||
for (cu = 1; cu <= 255; cu++)
|
||||
for (cu = 1; cu <= 127; cu++)
|
||||
if (isgraph(cu))
|
||||
regmbc(cu);
|
||||
break;
|
||||
@@ -4732,7 +4732,7 @@ regmatch(
|
||||
break;
|
||||
}
|
||||
if (enc_utf8)
|
||||
opndc = mb_ptr2char(opnd);
|
||||
opndc = utf_ptr2char(opnd);
|
||||
if (enc_utf8 && utf_iscomposing(opndc))
|
||||
{
|
||||
/* When only a composing char is given match at any
|
||||
@@ -4741,7 +4741,7 @@ regmatch(
|
||||
for (i = 0; reginput[i] != NUL;
|
||||
i += utf_ptr2len(reginput + i))
|
||||
{
|
||||
inpc = mb_ptr2char(reginput + i);
|
||||
inpc = utf_ptr2char(reginput + i);
|
||||
if (!utf_iscomposing(inpc))
|
||||
{
|
||||
if (i > 0)
|
||||
@@ -4750,7 +4750,7 @@ regmatch(
|
||||
else if (opndc == inpc)
|
||||
{
|
||||
/* Include all following composing chars. */
|
||||
len = i + mb_ptr2len(reginput + i);
|
||||
len = i + utfc_ptr2len(reginput + i);
|
||||
status = RA_MATCH;
|
||||
break;
|
||||
}
|
||||
|
||||
+3
-3
@@ -1974,7 +1974,7 @@ collection:
|
||||
nfa_do_multibyte:
|
||||
/* plen is length of current char with composing chars */
|
||||
if (enc_utf8 && ((*mb_char2len)(c)
|
||||
!= (plen = (*mb_ptr2len)(old_regparse))
|
||||
!= (plen = utfc_ptr2len(old_regparse))
|
||||
|| utf_iscomposing(c)))
|
||||
{
|
||||
int i = 0;
|
||||
@@ -4871,7 +4871,7 @@ check_char_class(int class, int c)
|
||||
return OK;
|
||||
break;
|
||||
case NFA_CLASS_CNTRL:
|
||||
if (c >= 1 && c <= 255 && iscntrl(c))
|
||||
if (c >= 1 && c <= 127 && iscntrl(c))
|
||||
return OK;
|
||||
break;
|
||||
case NFA_CLASS_DIGIT:
|
||||
@@ -4879,7 +4879,7 @@ check_char_class(int class, int c)
|
||||
return OK;
|
||||
break;
|
||||
case NFA_CLASS_GRAPH:
|
||||
if (c >= 1 && c <= 255 && isgraph(c))
|
||||
if (c >= 1 && c <= 127 && isgraph(c))
|
||||
return OK;
|
||||
break;
|
||||
case NFA_CLASS_LOWER:
|
||||
|
||||
+17
-11
@@ -2697,12 +2697,18 @@ fold_line(
|
||||
{
|
||||
ScreenLinesUC[off + col] = fill_fold;
|
||||
ScreenLinesC[0][off + col] = 0;
|
||||
ScreenLines[off + col] = 0x80; /* avoid storing zero */
|
||||
}
|
||||
else
|
||||
{
|
||||
ScreenLinesUC[off + col] = 0;
|
||||
ScreenLines[off + col] = fill_fold;
|
||||
}
|
||||
col++;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
ScreenLines[off + col++] = fill_fold;
|
||||
ScreenLines[off + col++] = fill_fold;
|
||||
}
|
||||
|
||||
if (text != buf)
|
||||
@@ -4116,7 +4122,7 @@ win_line(
|
||||
c = c_extra;
|
||||
#ifdef FEAT_MBYTE
|
||||
mb_c = c; /* doesn't handle non-utf-8 multi-byte! */
|
||||
if (enc_utf8 && (*mb_char2len)(c) > 1)
|
||||
if (enc_utf8 && utf_char2len(c) > 1)
|
||||
{
|
||||
mb_utf8 = TRUE;
|
||||
u8cc[0] = 0;
|
||||
@@ -4137,7 +4143,7 @@ win_line(
|
||||
{
|
||||
/* If the UTF-8 character is more than one byte:
|
||||
* Decode it into "mb_c". */
|
||||
mb_l = (*mb_ptr2len)(p_extra);
|
||||
mb_l = utfc_ptr2len(p_extra);
|
||||
mb_utf8 = FALSE;
|
||||
if (mb_l > n_extra)
|
||||
mb_l = 1;
|
||||
@@ -4216,7 +4222,7 @@ win_line(
|
||||
{
|
||||
/* If the UTF-8 character is more than one byte: Decode it
|
||||
* into "mb_c". */
|
||||
mb_l = (*mb_ptr2len)(ptr);
|
||||
mb_l = utfc_ptr2len(ptr);
|
||||
mb_utf8 = FALSE;
|
||||
if (mb_l > 1)
|
||||
{
|
||||
@@ -4609,7 +4615,7 @@ win_line(
|
||||
}
|
||||
#ifdef FEAT_MBYTE
|
||||
mb_c = c;
|
||||
if (enc_utf8 && (*mb_char2len)(c) > 1)
|
||||
if (enc_utf8 && utf_char2len(c) > 1)
|
||||
{
|
||||
mb_utf8 = TRUE;
|
||||
u8cc[0] = 0;
|
||||
@@ -4631,7 +4637,7 @@ win_line(
|
||||
}
|
||||
#ifdef FEAT_MBYTE
|
||||
mb_c = c;
|
||||
if (enc_utf8 && (*mb_char2len)(c) > 1)
|
||||
if (enc_utf8 && utf_char2len(c) > 1)
|
||||
{
|
||||
mb_utf8 = TRUE;
|
||||
u8cc[0] = 0;
|
||||
@@ -4762,7 +4768,7 @@ win_line(
|
||||
saved_attr2 = char_attr; /* save current attr */
|
||||
#ifdef FEAT_MBYTE
|
||||
mb_c = c;
|
||||
if (enc_utf8 && (*mb_char2len)(c) > 1)
|
||||
if (enc_utf8 && utf_char2len(c) > 1)
|
||||
{
|
||||
mb_utf8 = TRUE;
|
||||
u8cc[0] = 0;
|
||||
@@ -4836,7 +4842,7 @@ win_line(
|
||||
}
|
||||
#ifdef FEAT_MBYTE
|
||||
mb_c = c;
|
||||
if (enc_utf8 && (*mb_char2len)(c) > 1)
|
||||
if (enc_utf8 && utf_char2len(c) > 1)
|
||||
{
|
||||
mb_utf8 = TRUE;
|
||||
u8cc[0] = 0;
|
||||
@@ -5000,7 +5006,7 @@ win_line(
|
||||
}
|
||||
# ifdef FEAT_MBYTE
|
||||
mb_c = c;
|
||||
if (enc_utf8 && (*mb_char2len)(c) > 1)
|
||||
if (enc_utf8 && utf_char2len(c) > 1)
|
||||
{
|
||||
mb_utf8 = TRUE;
|
||||
u8cc[0] = 0;
|
||||
@@ -5112,7 +5118,7 @@ win_line(
|
||||
extra_attr = HL_ATTR(HLF_AT);
|
||||
}
|
||||
mb_c = c;
|
||||
if (enc_utf8 && (*mb_char2len)(c) > 1)
|
||||
if (enc_utf8 && utf_char2len(c) > 1)
|
||||
{
|
||||
mb_utf8 = TRUE;
|
||||
u8cc[0] = 0;
|
||||
@@ -5385,7 +5391,7 @@ win_line(
|
||||
char_attr = HL_ATTR(HLF_AT);
|
||||
#ifdef FEAT_MBYTE
|
||||
mb_c = c;
|
||||
if (enc_utf8 && (*mb_char2len)(c) > 1)
|
||||
if (enc_utf8 && utf_char2len(c) > 1)
|
||||
{
|
||||
mb_utf8 = TRUE;
|
||||
u8cc[0] = 0;
|
||||
|
||||
+9
-1
@@ -2860,9 +2860,17 @@ findpar(
|
||||
curwin->w_cursor.lnum = curr;
|
||||
if (curr == curbuf->b_ml.ml_line_count && what != '}')
|
||||
{
|
||||
if ((curwin->w_cursor.col = (colnr_T)STRLEN(ml_get(curr))) != 0)
|
||||
char_u *line = ml_get(curr);
|
||||
|
||||
/* Put the cursor on the last character in the last line and make the
|
||||
* motion inclusive. */
|
||||
if ((curwin->w_cursor.col = (colnr_T)STRLEN(line)) != 0)
|
||||
{
|
||||
--curwin->w_cursor.col;
|
||||
#ifdef FEAT_MBYTE
|
||||
curwin->w_cursor.col -=
|
||||
(*mb_head_off)(line, line + curwin->w_cursor.col);
|
||||
#endif
|
||||
*pincl = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -1208,7 +1208,7 @@ can_compound(slang_T *slang, char_u *word, char_u *flags)
|
||||
/* Need to convert the single byte flags to utf8 characters. */
|
||||
p = uflags;
|
||||
for (i = 0; flags[i] != NUL; ++i)
|
||||
p += mb_char2bytes(flags[i], p);
|
||||
p += utf_char2bytes(flags[i], p);
|
||||
*p = NUL;
|
||||
p = uflags;
|
||||
}
|
||||
@@ -5117,11 +5117,11 @@ suggest_trie_walk(
|
||||
* SCORE_SUBCOMP. */
|
||||
if (enc_utf8
|
||||
&& utf_iscomposing(
|
||||
mb_ptr2char(tword
|
||||
utf_ptr2char(tword
|
||||
+ sp->ts_twordlen
|
||||
- sp->ts_tcharlen))
|
||||
&& utf_iscomposing(
|
||||
mb_ptr2char(fword
|
||||
utf_ptr2char(fword
|
||||
+ sp->ts_fcharstart)))
|
||||
sp->ts_score -=
|
||||
SCORE_SUBST - SCORE_SUBCOMP;
|
||||
|
||||
@@ -515,6 +515,12 @@ struct buffheader
|
||||
int bh_space; /* space in bh_curr for appending */
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
buffheader_T sr_redobuff;
|
||||
buffheader_T sr_old_redobuff;
|
||||
} save_redo_T;
|
||||
|
||||
/*
|
||||
* used for completion on the command line
|
||||
*/
|
||||
|
||||
-143
@@ -1,143 +0,0 @@
|
||||
; Thomas Leonard
|
||||
; 24/5/98
|
||||
|
||||
ar0 rn 0
|
||||
ar1 rn 1
|
||||
ar2 rn 2
|
||||
ar3 rn 3
|
||||
ar4 rn 4
|
||||
ar5 rn 5
|
||||
ar6 rn 6
|
||||
ar7 rn 7
|
||||
ar10 rn 10
|
||||
ar11 rn 11
|
||||
lk rn 14
|
||||
ar15 rn 15
|
||||
|
||||
AREA DATA
|
||||
align 4
|
||||
|
||||
export |r0|
|
||||
r0: dcd 0
|
||||
|
||||
export |r1|
|
||||
r1: dcd 0
|
||||
|
||||
export |r2|
|
||||
r2: dcd 0
|
||||
|
||||
export |r3|
|
||||
r3: dcd 0
|
||||
|
||||
export |r4|
|
||||
r4: dcd 0
|
||||
|
||||
export |r5|
|
||||
r5: dcd 0
|
||||
|
||||
export |r6|
|
||||
r6: dcd 0
|
||||
|
||||
export |r7|
|
||||
r7: dcd 0
|
||||
|
||||
export |time_of_last_poll|
|
||||
time_of_last_poll: dcd 0
|
||||
|
||||
AREA CODE, READONLY
|
||||
align 4
|
||||
import |r0|
|
||||
export |swi|
|
||||
= "swi"
|
||||
align 4
|
||||
swi:
|
||||
; r0 = swi number
|
||||
stmfd sp!,{ar4-ar10,lk}
|
||||
orr ar10,ar0,#1<<17 ;always use the X form
|
||||
mov ar0,ar1
|
||||
mov ar1,ar2
|
||||
mov ar2,ar3
|
||||
add ar3,sp,#4*8
|
||||
ldmia ar3,{ar3-ar7}
|
||||
swi 0x6f ; OS_CallASWI
|
||||
ldr ar10,regs_addr
|
||||
stmia ar10,{ar0-ar7}
|
||||
ldmvcfd sp!,{ar4-ar10,pc}^
|
||||
; report the error and quit on Cancel
|
||||
mov r1,#0x17
|
||||
adr r2,s_title
|
||||
swi 0x400df ; Wimp_ReportError
|
||||
cmp r1,#1 ;OK selected?
|
||||
ldmeqfd sp!,{ar4-ar10,pc}^ ;yes - try to continue
|
||||
swi 0x11 ;no - die (OS_Exit)
|
||||
s_title:
|
||||
= "Nasty error - Cancel to quit"
|
||||
= 0
|
||||
|
||||
align 4
|
||||
export |xswi|
|
||||
= "xswi"
|
||||
align 4
|
||||
xswi:
|
||||
; r0 = swi number
|
||||
stmfd sp!,{ar4-ar10,lk}
|
||||
orr ar10,ar0,#1<<17 ;always use the X form
|
||||
mov ar0,ar1
|
||||
mov ar1,ar2
|
||||
mov ar2,ar3
|
||||
add ar3,sp,#4*8
|
||||
ldmia ar3,{ar3-ar7}
|
||||
swi 0x6f ; OS_CallASWI
|
||||
ldr ar10,regs_addr
|
||||
stmia ar10,{ar0-ar7}
|
||||
mov ar0,#0
|
||||
orr ar0,ar0,ar15
|
||||
ldmfd sp!,{ar4-ar10,pc}^
|
||||
|
||||
regs_addr:
|
||||
dcd r0
|
||||
|
||||
; The Wimp_Poll swis have to be done specially because,
|
||||
; for some reason, r13 sometimes gets corrupted by Wimp_Poll
|
||||
; (eg when running FileFind)
|
||||
AREA CODE, READONLY
|
||||
align 4
|
||||
import |time_of_last_poll|
|
||||
export |wimp_poll|
|
||||
= "wimp_poll"
|
||||
align 4
|
||||
wimp_poll:
|
||||
mov ar3,sp
|
||||
swi 0x400c7 ; Wimp_Poll
|
||||
mov sp,ar3
|
||||
|
||||
mov ar3,ar0
|
||||
swi 0x42 ; OS_ReadMonotonicTime
|
||||
ldr ar2,addr_time
|
||||
str ar0,[ar2]
|
||||
mov ar0,ar3
|
||||
|
||||
mov ar2,#0
|
||||
wfs ar2 ; Write floating point status. Needed?
|
||||
movs pc,lk
|
||||
|
||||
align 4
|
||||
export |wimp_pollidle|
|
||||
= "wimp_pollidle"
|
||||
align 4
|
||||
wimp_pollidle:
|
||||
mov ar3,sp
|
||||
swi 0x400e1 ; Wimp_PollIdle
|
||||
mov sp,ar3
|
||||
|
||||
mov ar3,ar0
|
||||
swi 0x42 ; OS_ReadMonotonicTime
|
||||
ldr ar2,addr_time
|
||||
str ar0,[ar2]
|
||||
mov ar0,ar3
|
||||
|
||||
mov ar2,#0
|
||||
wfs ar2 ; Write floating point status. Needed?
|
||||
movs pc,lk
|
||||
|
||||
addr_time: dcd time_of_last_poll
|
||||
+15
-5
@@ -9950,17 +9950,27 @@ highlight_list_two(int cnt, int attr)
|
||||
|| defined(FEAT_SIGNS) || defined(PROTO)
|
||||
/*
|
||||
* Function given to ExpandGeneric() to obtain the list of group names.
|
||||
* Also used for synIDattr() function.
|
||||
*/
|
||||
char_u *
|
||||
get_highlight_name(expand_T *xp UNUSED, int idx)
|
||||
{
|
||||
return get_highlight_name_ext(xp, idx, TRUE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Obtain a highlight group name.
|
||||
* When "skip_cleared" is TRUE don't return a cleared entry.
|
||||
*/
|
||||
char_u *
|
||||
get_highlight_name_ext(expand_T *xp UNUSED, int idx, int skip_cleared)
|
||||
{
|
||||
if (idx < 0)
|
||||
return NULL;
|
||||
/* Items are never removed from the table, skip the ones that were cleared.
|
||||
*/
|
||||
while (idx < highlight_ga.ga_len && HL_TABLE()[idx].sg_cleared)
|
||||
++idx;
|
||||
|
||||
/* Items are never removed from the table, skip the ones that were
|
||||
* cleared. */
|
||||
if (skip_cleared && idx < highlight_ga.ga_len && HL_TABLE()[idx].sg_cleared)
|
||||
return (char_u *)"";
|
||||
|
||||
#ifdef FEAT_CMDL_COMPL
|
||||
if (idx == highlight_ga.ga_len && include_none != 0)
|
||||
|
||||
@@ -2355,18 +2355,19 @@ parse_line:
|
||||
}
|
||||
else
|
||||
{
|
||||
#define TAG_SEP 0x01
|
||||
#define TAG_SEP 0x02
|
||||
size_t tag_fname_len = STRLEN(tag_fname);
|
||||
#ifdef FEAT_EMACS_TAGS
|
||||
size_t ebuf_len = 0;
|
||||
#endif
|
||||
|
||||
/* Save the tag in a buffer.
|
||||
* Use 0x01 to separate fields (Can't use NUL, because the
|
||||
* hash key is terminated by NUL).
|
||||
* Emacs tag: <mtt><tag_fname><0x01><ebuf><0x01><lbuf><NUL>
|
||||
* other tag: <mtt><tag_fname><0x01><0x01><lbuf><NUL>
|
||||
* without Emacs tags: <mtt><tag_fname><0x01><lbuf><NUL>
|
||||
* Use 0x02 to separate fields (Can't use NUL because the
|
||||
* hash key is terminated by NUL, or Ctrl_A because that is
|
||||
* part of some Emacs tag files -- see parse_tag_line).
|
||||
* Emacs tag: <mtt><tag_fname><0x02><ebuf><0x02><lbuf><NUL>
|
||||
* other tag: <mtt><tag_fname><0x02><0x02><lbuf><NUL>
|
||||
* without Emacs tags: <mtt><tag_fname><0x02><lbuf><NUL>
|
||||
* Here <mtt> is the "mtt" value plus 1 to avoid NUL.
|
||||
*/
|
||||
len = (int)tag_fname_len + (int)STRLEN(lbuf) + 3;
|
||||
@@ -3203,8 +3204,12 @@ jumpto_tag(
|
||||
* open a new tab page. */
|
||||
if (postponed_split || cmdmod.tab != 0)
|
||||
{
|
||||
win_split(postponed_split > 0 ? postponed_split : 0,
|
||||
postponed_split_flags);
|
||||
if (win_split(postponed_split > 0 ? postponed_split : 0,
|
||||
postponed_split_flags) == FAIL)
|
||||
{
|
||||
--RedrawingDisabled;
|
||||
goto erret;
|
||||
}
|
||||
RESET_BINDING(curwin);
|
||||
}
|
||||
#endif
|
||||
|
||||
+101
-25
@@ -845,9 +845,11 @@ static struct builtin_term builtin_termcaps[] =
|
||||
ESC_STR "[8;%p1%d;%p2%dt")},
|
||||
{(int)KS_CWP, IF_EB("\033[3;%p1%d;%p2%dt",
|
||||
ESC_STR "[3;%p1%d;%p2%dt")},
|
||||
{(int)KS_CGP, IF_EB("\033[13t", ESC_STR "[13t")},
|
||||
# else
|
||||
{(int)KS_CWS, IF_EB("\033[8;%d;%dt", ESC_STR "[8;%d;%dt")},
|
||||
{(int)KS_CWP, IF_EB("\033[3;%d;%dt", ESC_STR "[3;%d;%dt")},
|
||||
{(int)KS_CGP, IF_EB("\033[13t", ESC_STR "[13t")},
|
||||
# endif
|
||||
{(int)KS_CRV, IF_EB("\033[>c", ESC_STR "[>c")},
|
||||
{(int)KS_RBG, IF_EB("\033]11;?\007", ESC_STR "]11;?\007")},
|
||||
@@ -1711,7 +1713,8 @@ set_termname(char_u *term)
|
||||
{
|
||||
screen_start(); /* don't know where cursor is now */
|
||||
out_flush();
|
||||
ui_delay(2000L, TRUE);
|
||||
if (!is_not_a_term())
|
||||
ui_delay(2000L, TRUE);
|
||||
}
|
||||
set_string_option_direct((char_u *)"term", -1, term,
|
||||
OPT_FREE, 0);
|
||||
@@ -2586,6 +2589,60 @@ term_set_winpos(int x, int y)
|
||||
OUT_STR(tgoto((char *)T_CWP, y, x));
|
||||
}
|
||||
|
||||
# if defined(FEAT_TERMRESPONSE) || defined(PROTO)
|
||||
/*
|
||||
* Return TRUE if we can request the terminal for a response.
|
||||
*/
|
||||
static int
|
||||
can_get_termresponse()
|
||||
{
|
||||
return cur_tmode == TMODE_RAW
|
||||
&& termcap_active
|
||||
# ifdef UNIX
|
||||
&& (is_not_a_term() || (isatty(1) && isatty(read_cmd_fd)))
|
||||
# endif
|
||||
&& p_ek;
|
||||
}
|
||||
|
||||
static int winpos_x;
|
||||
static int winpos_y;
|
||||
static int waiting_for_winpos = FALSE;
|
||||
|
||||
/*
|
||||
* Try getting the Vim window position from the terminal.
|
||||
* Returns OK or FAIL.
|
||||
*/
|
||||
int
|
||||
term_get_winpos(int *x, int *y)
|
||||
{
|
||||
int count = 0;
|
||||
|
||||
if (*T_CGP == NUL || !can_get_termresponse())
|
||||
return FAIL;
|
||||
winpos_x = -1;
|
||||
winpos_y = -1;
|
||||
waiting_for_winpos = TRUE;
|
||||
OUT_STR(T_CGP);
|
||||
out_flush();
|
||||
|
||||
/* Try reading the result for 100 msec. */
|
||||
while (count++ < 10)
|
||||
{
|
||||
(void)vpeekc_nomap();
|
||||
if (winpos_x >= 0 && winpos_y >= 0)
|
||||
{
|
||||
*x = winpos_x;
|
||||
*y = winpos_y;
|
||||
waiting_for_winpos = FALSE;
|
||||
return OK;
|
||||
}
|
||||
ui_delay(10, FALSE);
|
||||
}
|
||||
waiting_for_winpos = FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
# endif
|
||||
|
||||
void
|
||||
term_set_winsize(int width, int height)
|
||||
{
|
||||
@@ -3234,14 +3291,8 @@ stoptermcap(void)
|
||||
may_req_termresponse(void)
|
||||
{
|
||||
if (crv_status == CRV_GET
|
||||
&& cur_tmode == TMODE_RAW
|
||||
&& can_get_termresponse()
|
||||
&& starting == 0
|
||||
&& termcap_active
|
||||
&& p_ek
|
||||
# ifdef UNIX
|
||||
&& isatty(1)
|
||||
&& isatty(read_cmd_fd)
|
||||
# endif
|
||||
&& *T_CRV != NUL)
|
||||
{
|
||||
LOG_TR("Sending CRV");
|
||||
@@ -3268,13 +3319,8 @@ may_req_termresponse(void)
|
||||
may_req_ambiguous_char_width(void)
|
||||
{
|
||||
if (u7_status == U7_GET
|
||||
&& cur_tmode == TMODE_RAW
|
||||
&& termcap_active
|
||||
&& p_ek
|
||||
# ifdef UNIX
|
||||
&& isatty(1)
|
||||
&& isatty(read_cmd_fd)
|
||||
# endif
|
||||
&& can_get_termresponse()
|
||||
&& starting == 0
|
||||
&& *T_U7 != NUL
|
||||
&& !option_was_set((char_u *)"ambiwidth"))
|
||||
{
|
||||
@@ -3300,7 +3346,6 @@ may_req_ambiguous_char_width(void)
|
||||
}
|
||||
# endif
|
||||
|
||||
#if defined(FEAT_TERMRESPONSE) || defined(PROTO)
|
||||
/*
|
||||
* Similar to requesting the version string: Request the terminal background
|
||||
* color when it is the right moment.
|
||||
@@ -3309,13 +3354,8 @@ may_req_ambiguous_char_width(void)
|
||||
may_req_bg_color(void)
|
||||
{
|
||||
if (rbg_status == RBG_GET
|
||||
&& cur_tmode == TMODE_RAW
|
||||
&& termcap_active
|
||||
&& p_ek
|
||||
# ifdef UNIX
|
||||
&& isatty(1)
|
||||
&& isatty(read_cmd_fd)
|
||||
# endif
|
||||
&& can_get_termresponse()
|
||||
&& starting == 0
|
||||
&& *T_RBG != NUL
|
||||
&& !option_was_set((char_u *)"bg"))
|
||||
{
|
||||
@@ -3328,7 +3368,6 @@ may_req_bg_color(void)
|
||||
(void)vpeekc_nomap();
|
||||
}
|
||||
}
|
||||
# endif
|
||||
|
||||
# ifdef DEBUG_TERMRESPONSE
|
||||
static void
|
||||
@@ -4141,10 +4180,12 @@ check_termcode(
|
||||
* - Cursor position report: <Esc>[{row};{col}R
|
||||
* The final byte must be 'R'. It is used for checking the
|
||||
* ambiguous-width character state.
|
||||
*
|
||||
* - window position reply: <Esc>[3;{x};{y}t
|
||||
*/
|
||||
char_u *argp = tp[0] == ESC ? tp + 2 : tp + 1;
|
||||
|
||||
if ((*T_CRV != NUL || *T_U7 != NUL)
|
||||
if ((*T_CRV != NUL || *T_U7 != NUL || waiting_for_winpos)
|
||||
&& ((tp[0] == ESC && len >= 3 && tp[1] == '[')
|
||||
|| (tp[0] == CSI && len >= 2))
|
||||
&& (VIM_ISDIGIT(*argp) || *argp == '>' || *argp == '?'))
|
||||
@@ -4283,6 +4324,41 @@ check_termcode(
|
||||
key_name[1] = (int)KE_IGNORE;
|
||||
slen = i + 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check for a window position response from the terminal:
|
||||
* {lead}3;{x}:{y}t
|
||||
*/
|
||||
else if (waiting_for_winpos
|
||||
&& ((len >= 4 && tp[0] == ESC && tp[1] == '[')
|
||||
|| (len >= 3 && tp[0] == CSI))
|
||||
&& tp[(j = 1 + (tp[0] == ESC))] == '3'
|
||||
&& tp[j + 1] == ';')
|
||||
{
|
||||
j += 2;
|
||||
for (i = j; i < len && vim_isdigit(tp[i]); ++i)
|
||||
;
|
||||
if (i < len && tp[i] == ';')
|
||||
{
|
||||
winpos_x = atoi((char *)tp + j);
|
||||
j = i + 1;
|
||||
for (i = j; i < len && vim_isdigit(tp[i]); ++i)
|
||||
;
|
||||
if (i < len && tp[i] == 't')
|
||||
{
|
||||
winpos_y = atoi((char *)tp + j);
|
||||
/* got finished code: consume it */
|
||||
key_name[0] = (int)KS_EXTRA;
|
||||
key_name[1] = (int)KE_IGNORE;
|
||||
slen = i + 1;
|
||||
}
|
||||
}
|
||||
if (i == len)
|
||||
{
|
||||
LOG_TR("not enough characters for winpos");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Check for background color response from the terminal:
|
||||
|
||||
+3
-1
@@ -77,6 +77,7 @@ enum SpecialKey
|
||||
KS_TS, /* set window title start (to status line)*/
|
||||
KS_FS, /* set window title end (from status line) */
|
||||
KS_CWP, /* set window position in pixels */
|
||||
KS_CGP, /* get window position */
|
||||
KS_CWS, /* set window size in characters */
|
||||
KS_CRV, /* request version string */
|
||||
KS_RBG, /* request background color */
|
||||
@@ -163,7 +164,8 @@ extern char_u *(term_strings[]); /* current terminal strings */
|
||||
#define T_CIE (TERM_STR(KS_CIE)) /* set icon text end */
|
||||
#define T_TS (TERM_STR(KS_TS)) /* set window title start */
|
||||
#define T_FS (TERM_STR(KS_FS)) /* set window title end */
|
||||
#define T_CWP (TERM_STR(KS_CWP)) /* window position */
|
||||
#define T_CWP (TERM_STR(KS_CWP)) /* set window position */
|
||||
#define T_CGP (TERM_STR(KS_CGP)) /* get window position */
|
||||
#define T_CWS (TERM_STR(KS_CWS)) /* window size */
|
||||
#define T_CSI (TERM_STR(KS_CSI)) /* start insert mode */
|
||||
#define T_CEI (TERM_STR(KS_CEI)) /* end insert mode */
|
||||
|
||||
@@ -8,10 +8,11 @@ source test_changedtick.vim
|
||||
source test_cursor_func.vim
|
||||
source test_delete.vim
|
||||
source test_ex_undo.vim
|
||||
source test_ex_z.vim
|
||||
source test_execute_func.vim
|
||||
source test_expand.vim
|
||||
source test_expr.vim
|
||||
source test_expand_dllpath.vim
|
||||
source test_expr.vim
|
||||
source test_feedkeys.vim
|
||||
source test_file_perm.vim
|
||||
source test_fileformat.vim
|
||||
@@ -21,17 +22,18 @@ source test_findfile.vim
|
||||
source test_float_func.vim
|
||||
source test_fnamemodify.vim
|
||||
source test_functions.vim
|
||||
source test_glob2regpat.vim
|
||||
source test_ga.vim
|
||||
source test_glob2regpat.vim
|
||||
source test_global.vim
|
||||
source test_goto.vim
|
||||
source test_help_tagjump.vim
|
||||
source test_join.vim
|
||||
source test_jumps.vim
|
||||
source test_lambda.vim
|
||||
source test_lispwords.vim
|
||||
source test_mapping.vim
|
||||
source test_match.vim
|
||||
source test_menu.vim
|
||||
source test_mapping.vim
|
||||
source test_messages.vim
|
||||
source test_partial.vim
|
||||
source test_popup.vim
|
||||
|
||||
@@ -11,6 +11,19 @@ func Test_client_server()
|
||||
if cmd == ''
|
||||
return
|
||||
endif
|
||||
if has('x11')
|
||||
if empty($DISPLAY)
|
||||
throw 'Skipped: $DISPLAY is not set'
|
||||
endif
|
||||
try
|
||||
call remote_send('xxx', '')
|
||||
catch
|
||||
if v:exception =~ 'E240:'
|
||||
throw 'Skipped: no connection to the X server'
|
||||
endif
|
||||
" ignore other errors
|
||||
endtry
|
||||
endif
|
||||
|
||||
let name = 'XVIMTEST'
|
||||
let cmd .= ' --servername ' . name
|
||||
|
||||
@@ -65,12 +65,24 @@ func Test_highlight_completion()
|
||||
hi Aardig ctermfg=green
|
||||
call feedkeys(":hi \<Tab>\<Home>\"\<CR>", 'xt')
|
||||
call assert_equal('"hi Aardig', getreg(':'))
|
||||
call feedkeys(":hi default \<Tab>\<Home>\"\<CR>", 'xt')
|
||||
call assert_equal('"hi default Aardig', getreg(':'))
|
||||
call feedkeys(":hi clear Aa\<Tab>\<Home>\"\<CR>", 'xt')
|
||||
call assert_equal('"hi clear Aardig', getreg(':'))
|
||||
call feedkeys(":hi li\<S-Tab>\<Home>\"\<CR>", 'xt')
|
||||
call assert_equal('"hi link', getreg(':'))
|
||||
call feedkeys(":hi d\<S-Tab>\<Home>\"\<CR>", 'xt')
|
||||
call assert_equal('"hi default', getreg(':'))
|
||||
call feedkeys(":hi c\<S-Tab>\<Home>\"\<CR>", 'xt')
|
||||
call assert_equal('"hi clear', getreg(':'))
|
||||
|
||||
" A cleared group does not show up in completions.
|
||||
hi Anders ctermfg=green
|
||||
call assert_equal(['Aardig', 'Anders'], getcompletion('A', 'highlight'))
|
||||
hi clear Aardig
|
||||
call assert_equal(['Anders'], getcompletion('A', 'highlight'))
|
||||
hi clear Anders
|
||||
call assert_equal([], getcompletion('A', 'highlight'))
|
||||
endfunc
|
||||
|
||||
func Test_expr_completion()
|
||||
@@ -340,6 +352,15 @@ func Test_cmdline_complete_wildoptions()
|
||||
bw!
|
||||
endfunc
|
||||
|
||||
func Test_cmdline_complete_user_cmd()
|
||||
command! -complete=color -nargs=1 Foo :
|
||||
call feedkeys(":Foo \<Tab>\<Home>\"\<cr>", 'tx')
|
||||
call assert_equal('"Foo blue', @:)
|
||||
call feedkeys(":Foo b\<Tab>\<Home>\"\<cr>", 'tx')
|
||||
call assert_equal('"Foo blue', @:)
|
||||
delcommand Foo
|
||||
endfunc
|
||||
|
||||
" using a leading backslash here
|
||||
set cpo+=C
|
||||
|
||||
@@ -395,4 +416,14 @@ func Test_getcmdtype()
|
||||
cunmap <F6>
|
||||
endfunc
|
||||
|
||||
func Test_verbosefile()
|
||||
set verbosefile=Xlog
|
||||
echomsg 'foo'
|
||||
echomsg 'bar'
|
||||
set verbosefile=
|
||||
let log = readfile('Xlog')
|
||||
call assert_match("foo\nbar", join(log, "\n"))
|
||||
call delete('Xlog')
|
||||
endfunc
|
||||
|
||||
set cpo&
|
||||
|
||||
@@ -3,18 +3,12 @@ if !has('gui_running') && has('unix')
|
||||
set term=ansi
|
||||
endif
|
||||
|
||||
function! s:screenline(lnum, nr) abort
|
||||
let line = []
|
||||
for j in range(a:nr)
|
||||
for c in range(1, winwidth(0))
|
||||
call add(line, nr2char(screenchar(a:lnum+j, c)))
|
||||
endfor
|
||||
call add(line, "\n")
|
||||
endfor
|
||||
return join(line, '')
|
||||
endfunction
|
||||
source view_util.vim
|
||||
|
||||
function! Test_display_foldcolumn()
|
||||
func! Test_display_foldcolumn()
|
||||
if !has("folding")
|
||||
return
|
||||
endif
|
||||
new
|
||||
vnew
|
||||
vert resize 25
|
||||
@@ -23,17 +17,53 @@ function! Test_display_foldcolumn()
|
||||
|
||||
1put='e more noise blah blah more stuff here'
|
||||
|
||||
let expect = "e more noise blah blah<82\n> more stuff here \n"
|
||||
let expect = [
|
||||
\ "e more noise blah blah<82",
|
||||
\ "> more stuff here "
|
||||
\ ]
|
||||
|
||||
call cursor(2, 1)
|
||||
norm! zt
|
||||
redraw!
|
||||
call assert_equal(expect, s:screenline(1,2))
|
||||
let lines=ScreenLines([1,2], winwidth(0))
|
||||
call assert_equal(expect, lines)
|
||||
set fdc=2
|
||||
redraw!
|
||||
let expect = " e more noise blah blah<\n 82> more stuff here \n"
|
||||
call assert_equal(expect, s:screenline(1,2))
|
||||
let lines=ScreenLines([1,2], winwidth(0))
|
||||
let expect = [
|
||||
\ " e more noise blah blah<",
|
||||
\ " 82> more stuff here "
|
||||
\ ]
|
||||
call assert_equal(expect, lines)
|
||||
|
||||
quit!
|
||||
quit!
|
||||
endfunction
|
||||
endfunc
|
||||
|
||||
func! Test_display_foldtext_mbyte()
|
||||
if !has("folding") || !has("multi_byte")
|
||||
return
|
||||
endif
|
||||
call NewWindow(10, 40)
|
||||
call append(0, range(1,20))
|
||||
exe "set foldmethod=manual foldtext=foldtext() fillchars=fold:\u2500,vert:\u2502 fdc=2"
|
||||
call cursor(2, 1)
|
||||
norm! zf13G
|
||||
let lines=ScreenLines([1,3], winwidth(0)+1)
|
||||
let expect=[
|
||||
\ " 1 \u2502",
|
||||
\ "+ +-- 12 lines: 2". repeat("\u2500", 23). "\u2502",
|
||||
\ " 14 \u2502",
|
||||
\ ]
|
||||
call assert_equal(expect, lines)
|
||||
|
||||
set fillchars=fold:-,vert:\|
|
||||
let lines=ScreenLines([1,3], winwidth(0)+1)
|
||||
let expect=[
|
||||
\ " 1 |",
|
||||
\ "+ +-- 12 lines: 2". repeat("-", 23). "|",
|
||||
\ " 14 |",
|
||||
\ ]
|
||||
call assert_equal(expect, lines)
|
||||
|
||||
set foldtext& fillchars& foldmethod& fdc&
|
||||
bw!
|
||||
endfunc
|
||||
|
||||
@@ -1054,7 +1054,7 @@ endfunc
|
||||
|
||||
func! Test_edit_MOUSE()
|
||||
" This is a simple test, since we not really using the mouse here
|
||||
if !has("mouse")
|
||||
if !has("mouse") || (has("gui_macvim") && has("gui_running"))
|
||||
return
|
||||
endif
|
||||
10new
|
||||
@@ -1322,3 +1322,44 @@ func! Test_edit_rightleft()
|
||||
set norightleft
|
||||
bw!
|
||||
endfunc
|
||||
|
||||
func Test_edit_complete_very_long_name()
|
||||
if !has('unix')
|
||||
" Long directory names only work on Unix.
|
||||
return
|
||||
endif
|
||||
|
||||
let dirname = getcwd() . "/Xdir"
|
||||
let longdirname = dirname . repeat('/' . repeat('d', 255), 4)
|
||||
try
|
||||
call mkdir(longdirname, 'p')
|
||||
catch /E739:/
|
||||
" Long directory name probably not supported.
|
||||
call delete(dirname, 'rf')
|
||||
return
|
||||
endtry
|
||||
|
||||
" Try to get the Vim window position before setting 'columns'.
|
||||
let winposx = getwinposx()
|
||||
let winposy = getwinposy()
|
||||
let save_columns = &columns
|
||||
" Need at least about 1100 columns to reproduce the problem.
|
||||
set columns=2000
|
||||
call assert_equal(2000, &columns)
|
||||
set noswapfile
|
||||
|
||||
let longfilename = longdirname . '/' . repeat('a', 255)
|
||||
call writefile(['Totum', 'Table'], longfilename)
|
||||
new
|
||||
exe "next Xfile " . longfilename
|
||||
exe "normal iT\<C-N>"
|
||||
|
||||
bwipe!
|
||||
exe 'bwipe! ' . longfilename
|
||||
call delete(dirname, 'rf')
|
||||
let &columns = save_columns
|
||||
if winposx >= 0 && winposy >= 0
|
||||
exe 'winpos ' . winposx . ' ' . winposy
|
||||
endif
|
||||
set swapfile&
|
||||
endfunc
|
||||
|
||||
@@ -0,0 +1,78 @@
|
||||
" Test :z
|
||||
|
||||
func Test_z()
|
||||
call setline(1, range(1, 100))
|
||||
|
||||
let a = execute('20z3')
|
||||
call assert_equal("\n20\n21\n22", a)
|
||||
call assert_equal(22, line('.'))
|
||||
" 'window' should be set to the {count} value.
|
||||
call assert_equal(3, &window)
|
||||
|
||||
" If there is only one window, then twice the amount of 'scroll' is used.
|
||||
set scroll=2
|
||||
let a = execute('20z')
|
||||
call assert_equal("\n20\n21\n22\n23", a)
|
||||
call assert_equal(23, line('.'))
|
||||
|
||||
let a = execute('20z+3')
|
||||
" FIXME: I would expect the same result as '20z3' but it
|
||||
" gives "\n21\n22\n23" instead. Bug in Vim or in ":help :z"?
|
||||
"call assert_equal("\n20\n21\n22", a)
|
||||
"call assert_equal(22, line('.'))
|
||||
|
||||
let a = execute('20z-3')
|
||||
call assert_equal("\n18\n19\n20", a)
|
||||
call assert_equal(20, line('.'))
|
||||
|
||||
let a = execute('20z=3')
|
||||
call assert_match("^\n18\n19\n-\\+\n20\n-\\+\n21\n22$", a)
|
||||
call assert_equal(20, line('.'))
|
||||
|
||||
let a = execute('20z^3')
|
||||
call assert_equal("\n14\n15\n16\n17", a)
|
||||
call assert_equal(17, line('.'))
|
||||
|
||||
let a = execute('20z.3')
|
||||
call assert_equal("\n19\n20\n21", a)
|
||||
call assert_equal(21, line('.'))
|
||||
|
||||
let a = execute('20z#3')
|
||||
call assert_equal("\n 20 20\n 21 21\n 22 22", a)
|
||||
call assert_equal(22, line('.'))
|
||||
|
||||
let a = execute('20z#-3')
|
||||
call assert_equal("\n 18 18\n 19 19\n 20 20", a)
|
||||
call assert_equal(20, line('.'))
|
||||
|
||||
let a = execute('20z#=3')
|
||||
call assert_match("^\n 18 18\n 19 19\n-\\+\n 20 20\n-\\+\n 21 21\n 22 22$", a)
|
||||
call assert_equal(20, line('.'))
|
||||
|
||||
" Test with {count} bigger than the number of lines in buffer.
|
||||
let a = execute('20z1000')
|
||||
call assert_match("^\n20\n21\n.*\n99\n100$", a)
|
||||
call assert_equal(100, line('.'))
|
||||
|
||||
let a = execute('20z-1000')
|
||||
call assert_match("^\n1\n2\n.*\n19\n20$", a)
|
||||
call assert_equal(20, line('.'))
|
||||
|
||||
let a = execute('20z=1000')
|
||||
call assert_match("^\n1\n.*\n-\\+\n20\n-\\\+\n.*\n100$", a)
|
||||
call assert_equal(20, line('.'))
|
||||
|
||||
call assert_fails('20z=a', 'E144:')
|
||||
|
||||
set window& scroll&
|
||||
bw!
|
||||
endfunc
|
||||
|
||||
func Test_z_bug()
|
||||
" This used to access invalid memory as a result of an integer overflow
|
||||
" and freeze vim.
|
||||
normal ox
|
||||
normal Heat
|
||||
z777777776666666
|
||||
')
|
||||
endfunc
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user