mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-07 15:37:14 +02:00
Compare commits
103 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b0f7e1f006 | |||
| e2090aa9fb | |||
| bbfa7164d7 | |||
| fa3b48c6a5 | |||
| 6458d0b6bd | |||
| 936eef5ed7 | |||
| 3dfad5901a | |||
| d46539b451 | |||
| bbfebc8793 | |||
| dc708f3025 | |||
| f0377b844a | |||
| 3417d483e3 | |||
| a5ebfbc999 | |||
| 4475b62396 | |||
| beb9cb19c6 | |||
| 66c0e70b80 | |||
| 45cf6e910c | |||
| 29ae377ea7 | |||
| 45d2cca1ea | |||
| 8f77c5a4ec | |||
| a21ccb7a97 | |||
| 1a9020d4cb | |||
| 0635ee6824 | |||
| 696cbd224b | |||
| 5b04c1386d | |||
| b7637c44c2 | |||
| 86e5792906 | |||
| 94237495c0 | |||
| d788f6fe89 | |||
| b11c826ddc | |||
| 4638209904 | |||
| 5b276aa80e | |||
| 94be619e30 | |||
| f1d21c8cc8 | |||
| 9b77016545 | |||
| 7a85b0f028 | |||
| bfe75bfe0f | |||
| fb12ba89f7 | |||
| 97db5541a6 | |||
| 1d4be82c7d | |||
| a701b3b6f0 | |||
| 99895eac1c | |||
| 91b6e4591a | |||
| 6de5e12601 | |||
| a364cdb648 | |||
| c03944151f | |||
| 62cf09b5dc | |||
| 60402d68da | |||
| 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 |
@@ -36,11 +36,6 @@ script:
|
||||
- grep -q -- "-DDYNAMIC_PYTHON_DLL=\\\\\"$vi_cv_dll_name_python\\\\\"" src/auto/config.mk
|
||||
- grep -q -- "-DDYNAMIC_PYTHON3_DLL=\\\\\"$vi_cv_dll_name_python3\\\\\"" src/auto/config.mk
|
||||
- make -j$NPROC
|
||||
- BINPATH=src/MacVim/build/Release/MacVim.app/Contents/bin
|
||||
- mkdir -p $BINPATH
|
||||
- sed -e 's/^# VIM_APP_DIR=.*/if [ -L $0 ]; then VIM_APP_DIR=`dirname "$(readlink $0)"`\/..\/..\/..; else VIM_APP_DIR=`dirname "$0"`\/..\/..\/..; fi/' src/MacVim/mvim > $BINPATH/mvim
|
||||
- chmod 755 $BINPATH/mvim
|
||||
- (cd $BINPATH; for f in vim vimdiff view gvim gvimdiff gview mvimdiff mview; do ln -s mvim $f; done)
|
||||
- rm -f result; $VIMCMD -g -f -c "redir>result" -c "lua 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 "perl VIM::Msg(\"Test\")" -c "redir END" -c q; cat result; echo; grep -q -w Test result
|
||||
- rm -f result; $VIMCMD -g -f -c "redir>result" -c "py import sys; print(\"Test\")" -c "redir END" -c q; cat result; echo; grep -q -w Test result
|
||||
|
||||
@@ -24,6 +24,7 @@ SRC_ALL = \
|
||||
src/edit.c \
|
||||
src/eval.c \
|
||||
src/evalfunc.c \
|
||||
src/ex_cmdidxs.h \
|
||||
src/ex_cmds.c \
|
||||
src/ex_cmds.h \
|
||||
src/ex_cmds2.c \
|
||||
@@ -215,7 +216,7 @@ SRC_UNIX = \
|
||||
src/config.mk.in \
|
||||
src/configure \
|
||||
src/configure.ac \
|
||||
src/create_cmdidxs.pl \
|
||||
src/create_cmdidxs.vim \
|
||||
src/gui_at_fs.c \
|
||||
src/gui_at_sb.c \
|
||||
src/gui_at_sb.h \
|
||||
@@ -239,7 +240,7 @@ SRC_UNIX = \
|
||||
src/link.sh \
|
||||
src/installman.sh \
|
||||
src/installml.sh \
|
||||
src/mkinstalldirs \
|
||||
src/install-sh \
|
||||
src/os_unix.c \
|
||||
src/os_unix.h \
|
||||
src/os_unixx.h \
|
||||
@@ -725,7 +726,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
|
||||
|
||||
|
||||
@@ -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*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*editing.txt* For Vim version 8.0. Last change: 2016 Nov 24
|
||||
*editing.txt* For Vim version 8.0. Last change: 2017 Apr 10
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -1558,6 +1558,13 @@ If you want to automatically reload a file when it has been changed outside of
|
||||
Vim, set the 'autoread' option. This doesn't work at the moment you write the
|
||||
file though, only when the file wasn't changed inside of Vim.
|
||||
|
||||
If you do not want to be asked or automatically reload the file, you can use
|
||||
this: >
|
||||
set buftype=nofile
|
||||
|
||||
Or, when starting gvim from a shell: >
|
||||
gvim file.log -c "set buftype=nofile"
|
||||
|
||||
Note that if a FileChangedShell autocommand is defined you will not get a
|
||||
warning message or prompt. The autocommand is expected to handle this.
|
||||
|
||||
|
||||
+73
-23
@@ -1,4 +1,4 @@
|
||||
*eval.txt* For Vim version 8.0. Last change: 2017 Mar 27
|
||||
*eval.txt* For Vim version 8.0. Last change: 2017 Apr 29
|
||||
|
||||
|
||||
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
|
||||
@@ -4582,6 +4584,7 @@ getqflist([{what}]) *getqflist()*
|
||||
If the optional {what} dictionary argument is supplied, then
|
||||
returns only the items listed in {what} as a dictionary. The
|
||||
following string items are supported in {what}:
|
||||
context get the context stored with |setqflist()|
|
||||
nr get information for this quickfix list; zero
|
||||
means the current quickfix list
|
||||
title get the list title
|
||||
@@ -4593,6 +4596,7 @@ getqflist([{what}]) *getqflist()*
|
||||
returned.
|
||||
|
||||
The returned dictionary contains the following entries:
|
||||
context context information stored with |setqflist()|
|
||||
nr quickfix list number
|
||||
title quickfix list title text
|
||||
winid quickfix |window-ID| (if opened)
|
||||
@@ -4682,13 +4686,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.
|
||||
@@ -5260,9 +5267,14 @@ job_stop({job} [, {how}]) *job_stop()*
|
||||
0 if "how" is not supported on the system.
|
||||
Note that even when the operation was executed, whether the
|
||||
job was actually stopped needs to be checked with
|
||||
job_status().
|
||||
The status of the job isn't checked, the operation will even
|
||||
be done when Vim thinks the job isn't running.
|
||||
|job_status()|.
|
||||
|
||||
If the status of the job is "dead", the signal will not be
|
||||
sent. This is to avoid to stop the wrong job (esp. on Unix,
|
||||
where process numbers are recycled).
|
||||
|
||||
When using "kill" Vim will assume the job will die and close
|
||||
the channel.
|
||||
|
||||
{only available when compiled with the |+job| feature}
|
||||
|
||||
@@ -5304,13 +5316,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 +5441,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
|
||||
@@ -6922,6 +6952,7 @@ setqflist({list} [, {action}[, {what}]]) *setqflist()*
|
||||
nr error number
|
||||
text description of the error
|
||||
type single-character error type, 'E', 'W', etc.
|
||||
valid recognized error message
|
||||
|
||||
The "col", "vcol", "nr", "type" and "text" entries are
|
||||
optional. Either "lnum" or "pattern" entry can be used to
|
||||
@@ -6931,6 +6962,8 @@ setqflist({list} [, {action}[, {what}]]) *setqflist()*
|
||||
item will not be handled as an error line.
|
||||
If both "pattern" and "lnum" are present then "pattern" will
|
||||
be used.
|
||||
If the "valid" entry is not supplied, then the valid flag is
|
||||
set when "bufnr" is a valid buffer or "filename" exists.
|
||||
If you supply an empty {list}, the quickfix list will be
|
||||
cleared.
|
||||
Note that the list is not exactly the same as what
|
||||
@@ -6956,6 +6989,7 @@ setqflist({list} [, {action}[, {what}]]) *setqflist()*
|
||||
only the items listed in {what} are set. The first {list}
|
||||
argument is ignored. The following items can be specified in
|
||||
{what}:
|
||||
context any Vim type can be stored as a context
|
||||
nr list number in the quickfix stack
|
||||
title quickfix list title text
|
||||
Unsupported keys in {what} are ignored.
|
||||
@@ -6970,7 +7004,7 @@ setqflist({list} [, {action}[, {what}]]) *setqflist()*
|
||||
|
||||
This function can be used to create a quickfix list
|
||||
independent of the 'errorformat' setting. Use a command like
|
||||
":cc 1" to jump to the first position.
|
||||
`:cc 1` to jump to the first position.
|
||||
|
||||
|
||||
*setreg()*
|
||||
@@ -7877,7 +7911,6 @@ test_override({name}, {val}) *test_override()*
|
||||
|
||||
name effect when {val} is non-zero ~
|
||||
redraw disable the redrawing() function
|
||||
silent_mode enable silent mode (like using |-s| after |-e|)
|
||||
char_avail disable the char_avail() function
|
||||
ALL clear all overrides ({val} is not used)
|
||||
|
||||
@@ -8473,9 +8506,9 @@ 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.
|
||||
macunix Compiled for OS X, with darwin
|
||||
osx Compiled for OS X, with or without darwin
|
||||
mac Any Macintosh version of Vim, but not all OS X.
|
||||
macunix Compiled for OS X, with |mac-darwin-feature|
|
||||
osx Compiled for OS X, with or w/o |mac-darwin-feature|
|
||||
menu Compiled with support for |:menu|.
|
||||
mksession Compiled with support for |:mksession|.
|
||||
modify_fname Compiled with file name modifiers. |filename-modifiers|
|
||||
@@ -10652,6 +10685,23 @@ 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: >
|
||||
|
||||
silent! while 0
|
||||
set history=111
|
||||
silent! endwhile
|
||||
|
||||
When the |+eval| feature is available the command is skipped because of the
|
||||
"while 0". Without the |+eval| feature the "while 0" is an error, which is
|
||||
silently ignored, and the command is executed.
|
||||
|
||||
The "<CR>" here is a real CR character, type CTRL-V Enter to get it.
|
||||
|
||||
When the |+eval| feature is available the ":" is remapped to add a double
|
||||
quote, which has the effect of commenting-out the command. Without the
|
||||
|+eval| feature the nnoremap command is skipped and the command is executed.
|
||||
|
||||
==============================================================================
|
||||
11. The sandbox *eval-sandbox* *sandbox* *E48*
|
||||
|
||||
|
||||
+20
-38
@@ -158,55 +158,36 @@ have files open in e.g. splits by changing the "Open files from applications"
|
||||
option in the General preference pane). Finally, you can use Mac OS X System
|
||||
Services to open files in MacVim, see |macvim-services|.
|
||||
|
||||
There are essentially two ways to start MacVim from Terminal: either call the
|
||||
Vim binary with the -g switch >
|
||||
/Applications/MacVim.app/Contents/MacOS/Vim -g file ...
|
||||
or use the "open" command (this method can not be used to pass parameters to
|
||||
Use |mvim| script to start MacVim from Terminal.
|
||||
|
||||
Or use the "open" command (this method can not be used to pass parameters to
|
||||
Vim) >
|
||||
open -a MacVim file ...
|
||||
The advantage of using the latter method is that the settings relating to file
|
||||
opening in the preferences panel are respected, and files open instantly if
|
||||
|Quickstart| is enabled.
|
||||
|
||||
To save yourself from having to type the entire path to the Vim binary each
|
||||
time you start MacVim, you could create an alias such as >
|
||||
alias gvim='/Applications/MacVim.app/Contents/MacOS/Vim -g'
|
||||
and add that to "~/.profile".
|
||||
|
||||
Note: Do NOT call the MacVim binary inside the app bundle to start MacVim.
|
||||
|
||||
*mvim*
|
||||
A more flexible way to start MacVim is to use the shell script "mvim" which
|
||||
comes bundled with MacVim. Put this script in a folder in your path and then
|
||||
simply type "mvim" to start MacVim. This script will try to find MacVim.app
|
||||
in various typical folders such as >
|
||||
~/Applications ~/Applications/vim
|
||||
/Applications /Applications/vim
|
||||
/Applications/Utilities /Applications/Utilities/vim
|
||||
If you would rather put MacVim.app in some other directory then that is also
|
||||
possible, simply set the environment variable VIM_APP_DIR to whatever folder
|
||||
you have placed MacVim.app in.
|
||||
|
||||
The "mvim" script can be symlinked to in order to start up MacVim in different
|
||||
modes as follows (assuming you placed "mvim" in "/usr/local/bin"): >
|
||||
* Diff: ln -s /usr/local/bin/mvim mvimdiff
|
||||
* Read-only: ln -s /usr/local/bin/mvim mview
|
||||
* Ex: ln -s /usr/local/bin/mvim mex
|
||||
* Restricted: ln -s /usr/local/bin/mvim rmvim
|
||||
If the symlink destination starts with "m" (or "g"), Vim will start in GUI
|
||||
mode. Removing the initial "m" from the above destination names makes Vim
|
||||
start without the GUI. (In the last case, the destination name can be
|
||||
"rmvim", "rgvim" or "rvim".)
|
||||
|
||||
Note: Starting MacVim by creating a symlink to >
|
||||
.../MacVim.app/Contents/MacOS/Vim
|
||||
with 'ln -s' does not work.
|
||||
|
||||
Once in terminal Vim it is possible to start MacVim by using the following
|
||||
command:
|
||||
:gui [++opt] [+cmd] [-f|-b] [files...]
|
||||
Note: Forking ("-b") currently does not work.
|
||||
|
||||
*mvim*
|
||||
The "mvim" shell script bundled with MacVim. >
|
||||
/Applications/MacVim.app/Contents/bin/mvim
|
||||
This is a wrapper script to launch Vim executable in the bundle. Put this
|
||||
folder >
|
||||
/Applications/MacVim.app/Contents/bin
|
||||
in your path and then simply type "mvim" to start MacVim from Terminal. >
|
||||
$ mvim
|
||||
You can also specify files to open with. >
|
||||
$ mvim file ...
|
||||
Also the bin folder has convenient scripts for diffing and opening file as the file is read-only. >
|
||||
* Diff: mvimdiff
|
||||
* Read-only: mview
|
||||
|
||||
You can use "vim", "vimdiff", and "view" if you want to use non-GUI Vim.
|
||||
|
||||
*Quickstart*
|
||||
Quickstart ensures that new windows open instantaneously e.g. when <D-n> is
|
||||
pressed. This feature can be enabled from the Advanced preferences pane (it
|
||||
@@ -261,6 +242,7 @@ MMLoginShellArgument login shell parameter [string]
|
||||
MMLoginShellCommand which shell to use to launch Vim [string]
|
||||
MMNoFontSubstitution disable automatic font substitution [bool]
|
||||
MMNoTitleBarWindow hide title bar [bool]
|
||||
MMShareFindPboard share search text to Find Pasteboard [bool]
|
||||
MMShowAddTabButton enable "add tab" button on tabline [bool]
|
||||
MMTabMaxWidth maximum width of a tab [int]
|
||||
MMTabMinWidth minimum width of a tab [int]
|
||||
|
||||
+16
-16
@@ -1,4 +1,4 @@
|
||||
*index.txt* For Vim version 8.0. Last change: 2017 Feb 23
|
||||
*index.txt* For Vim version 8.0. Last change: 2017 Apr 22
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -309,10 +309,10 @@ tag char note action in Normal mode ~
|
||||
|B| B 1 cursor N WORDS backward
|
||||
|C| ["x]C 2 change from the cursor position to the end
|
||||
of the line, and N-1 more lines [into
|
||||
buffer x]; synonym for "c$"
|
||||
register x]; synonym for "c$"
|
||||
|D| ["x]D 2 delete the characters under the cursor
|
||||
until the end of the line and N-1 more
|
||||
lines [into buffer x]; synonym for "d$"
|
||||
lines [into register x]; synonym for "d$"
|
||||
|E| E 1 cursor forward to the end of WORD N
|
||||
|F| F{char} 1 cursor to the Nth occurrence of {char} to
|
||||
the left
|
||||
@@ -329,13 +329,13 @@ tag char note action in Normal mode ~
|
||||
opposite direction
|
||||
|O| O 2 begin a new line above the cursor and
|
||||
insert text, repeat N times
|
||||
|P| ["x]P 2 put the text [from buffer x] before the
|
||||
|P| ["x]P 2 put the text [from register x] before the
|
||||
cursor N times
|
||||
|Q| Q switch to "Ex" mode
|
||||
|R| R 2 enter replace mode: overtype existing
|
||||
characters, repeat the entered text N-1
|
||||
times
|
||||
|S| ["x]S 2 delete N lines [into buffer x] and start
|
||||
|S| ["x]S 2 delete N lines [into register x] and start
|
||||
insert; synonym for "cc".
|
||||
|T| T{char} 1 cursor till after Nth occurrence of {char}
|
||||
to the left
|
||||
@@ -343,8 +343,8 @@ tag char note action in Normal mode ~
|
||||
|V| V start linewise Visual mode
|
||||
|W| W 1 cursor N WORDS forward
|
||||
|X| ["x]X 2 delete N characters before the cursor [into
|
||||
buffer x]
|
||||
|Y| ["x]Y yank N lines [into buffer x]; synonym for
|
||||
register x]
|
||||
|Y| ["x]Y yank N lines [into register x]; synonym for
|
||||
"yy"
|
||||
|ZZ| ZZ store current file if modified, and exit
|
||||
|ZQ| ZQ exit current file always
|
||||
@@ -367,12 +367,12 @@ tag char note action in Normal mode ~
|
||||
|`}| `} 1 cursor to the end of the current paragraph
|
||||
|a| a 2 append text after the cursor N times
|
||||
|b| b 1 cursor N words backward
|
||||
|c| ["x]c{motion} 2 delete Nmove text [into buffer x] and start
|
||||
|c| ["x]c{motion} 2 delete Nmove text [into register x] and
|
||||
start insert
|
||||
|cc| ["x]cc 2 delete N lines [into register x] and start
|
||||
insert
|
||||
|cc| ["x]cc 2 delete N lines [into buffer x] and start
|
||||
insert
|
||||
|d| ["x]d{motion} 2 delete Nmove text [into buffer x]
|
||||
|dd| ["x]dd 2 delete N lines [into buffer x]
|
||||
|d| ["x]d{motion} 2 delete Nmove text [into register x]
|
||||
|dd| ["x]dd 2 delete N lines [into register x]
|
||||
|do| do 2 same as ":diffget"
|
||||
|dp| dp 2 same as ":diffput"
|
||||
|e| e 1 cursor forward to the end of word N
|
||||
@@ -398,16 +398,16 @@ tag char note action in Normal mode ~
|
||||
|q?| q? edit ? command-line in command-line window
|
||||
|r| r{char} 2 replace N chars with {char}
|
||||
|s| ["x]s 2 (substitute) delete N characters [into
|
||||
buffer x] and start insert
|
||||
register x] and start insert
|
||||
|t| t{char} 1 cursor till before Nth occurrence of {char}
|
||||
to the right
|
||||
|u| u 2 undo changes
|
||||
|v| v start characterwise Visual mode
|
||||
|w| w 1 cursor N words forward
|
||||
|x| ["x]x 2 delete N characters under and after the
|
||||
cursor [into buffer x]
|
||||
|y| ["x]y{motion} yank Nmove text [into buffer x]
|
||||
|yy| ["x]yy yank N lines [into buffer x]
|
||||
cursor [into register x]
|
||||
|y| ["x]y{motion} yank Nmove text [into register x]
|
||||
|yy| ["x]yy yank N lines [into register x]
|
||||
|z| z{char} commands starting with 'z', see |z| below
|
||||
|{| { 1 cursor N paragraphs backward
|
||||
|bar| | 1 cursor to column N
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -8001,7 +8001,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
'timeout' 'to' boolean (default on)
|
||||
global
|
||||
*'ttimeout'* *'nottimeout'*
|
||||
'ttimeout' boolean (default off, set in |defaults.vim|))
|
||||
'ttimeout' boolean (default off, set in |defaults.vim|)
|
||||
global
|
||||
{not in Vi}
|
||||
These two options together determine the behavior when part of a
|
||||
@@ -8036,7 +8036,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
||||
global
|
||||
{not in all versions of Vi}
|
||||
*'ttimeoutlen'* *'ttm'*
|
||||
'ttimeoutlen' 'ttm' number (default -1, set to 100 in |defaults.vim|))
|
||||
'ttimeoutlen' 'ttm' number (default -1, set to 100 in |defaults.vim|)
|
||||
global
|
||||
{not in Vi}
|
||||
The time in milliseconds that is waited for a key code or mapped key
|
||||
|
||||
+52
-1
@@ -1,4 +1,4 @@
|
||||
*os_mac.txt* For Vim version 8.0. Last change: 2006 Apr 30
|
||||
*os_mac.txt* For Vim version 8.0. Last change: 2017 Apr 28
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar et al.
|
||||
@@ -22,6 +22,7 @@ Carbon version of Vim here:
|
||||
5. Known Lack |mac-lack|
|
||||
6. Mac Bug Report |mac-bug|
|
||||
7. Compiling Vim |mac-compile|
|
||||
8. The darwin feature |mac-darwin-feature|
|
||||
|
||||
There was a Mac port for version 3.0 of Vim. Here are the first few lines
|
||||
from the old file:
|
||||
@@ -130,5 +131,55 @@ send a message to the current MacVim maintainers:
|
||||
|
||||
See the file "src/INSTALLmac.txt" that comes with the source files.
|
||||
|
||||
==============================================================================
|
||||
8. The Darwin Feature *mac-darwin-feature*
|
||||
|
||||
If you have a Mac that isn't very old, you will be running OS X, also called
|
||||
Darwin. The last pre-Darwin OS was Mac OS 9. The darwin feature makes Vim
|
||||
use Darwin-specific properties.
|
||||
|
||||
What is accomplished with this feature is two-fold:
|
||||
|
||||
- Make Vim interoperable with the system clipboard.
|
||||
- Incorporate into Vim a converter module that bridges the gap between some
|
||||
character encodings specific to the platform and those known to Vim.
|
||||
|
||||
Needless to say, both are not to be missed for any decent text editor to work
|
||||
nicely with other applications running on the same desktop environment.
|
||||
|
||||
As Vim is not an application dedicated only to macOS, we need an extra feature
|
||||
to add in order for it to offer the same user experience that our users on
|
||||
other platforms enjoy to people on macOS.
|
||||
|
||||
For brevity, the feature is referred to as "darwin" to signify it one of the
|
||||
Vim features that are specific to that particular platform.
|
||||
|
||||
The feature is a configuration option. Accordingly, whether it is enabled or
|
||||
not is determined at build time; once it is selected to be enabled, it is
|
||||
compiled in and hence cannot be disabled at runtime.
|
||||
|
||||
The feature is enabled by default. For most macOS users, that should be
|
||||
sufficient unless they have specific needs mentioned briefly below.
|
||||
|
||||
If you want to disable it, pass `--disable-darwin` to the configure script: >
|
||||
|
||||
./configure --disable-darwin <other options>
|
||||
|
||||
and then run `make` to build Vim. The order of the options doesn't matter.
|
||||
|
||||
To make sure at runtime whether or not the darwin feature is compiled in, you
|
||||
can use `has('macunix')` which returns 1 if the feature is compiled in; 0
|
||||
otherwise.
|
||||
|
||||
Notable use cases where `--disable-darwin` is turned out to be useful are:
|
||||
|
||||
- When you want to use |x11-selection| instead of the system clipboard.
|
||||
- When you want to use |x11-clientserver|.
|
||||
|
||||
Since both have to make use of X11 inter-client communication for them to work
|
||||
properly, and since the communication mechanism can come into conflict with
|
||||
the system clipboard, the darwin feature should be disabled to prevent Vim
|
||||
from hanging at runtime.
|
||||
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -965,6 +965,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
|
||||
't_F7' term.txt /*'t_F7'*
|
||||
't_F8' term.txt /*'t_F8'*
|
||||
't_F9' term.txt /*'t_F9'*
|
||||
't_GP' term.txt /*'t_GP'*
|
||||
't_IE' term.txt /*'t_IE'*
|
||||
't_IS' term.txt /*'t_IS'*
|
||||
't_K1' term.txt /*'t_K1'*
|
||||
@@ -7244,6 +7245,7 @@ m` motion.txt /*m`*
|
||||
mac os_mac.txt /*mac*
|
||||
mac-bug os_mac.txt /*mac-bug*
|
||||
mac-compile os_mac.txt /*mac-compile*
|
||||
mac-darwin-feature os_mac.txt /*mac-darwin-feature*
|
||||
mac-faq os_mac.txt /*mac-faq*
|
||||
mac-filename os_mac.txt /*mac-filename*
|
||||
mac-lack os_mac.txt /*mac-lack*
|
||||
@@ -8627,6 +8629,7 @@ t_F6 term.txt /*t_F6*
|
||||
t_F7 term.txt /*t_F7*
|
||||
t_F8 term.txt /*t_F8*
|
||||
t_F9 term.txt /*t_F9*
|
||||
t_GP term.txt /*t_GP*
|
||||
t_IE term.txt /*t_IE*
|
||||
t_IS term.txt /*t_IS*
|
||||
t_K1 term.txt /*t_K1*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*term.txt* For Vim version 8.0. Last change: 2017 Feb 02
|
||||
*term.txt* For Vim version 8.0. Last change: 2017 Apr 11
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -314,6 +314,7 @@ Added by Vim (there are no standard codes for these):
|
||||
t_IS set icon text start *t_IS* *'t_IS'*
|
||||
t_IE set icon text end *t_IE* *'t_IE'*
|
||||
t_WP set window position (Y, X) in pixels *t_WP* *'t_WP'*
|
||||
t_GP get window position (Y, X) in pixels *t_GP* *'t_GP'*
|
||||
t_WS set window size (height, width) in characters *t_WS* *'t_WS'*
|
||||
t_SI start insert mode (bar cursor shape) *t_SI* *'t_SI'*
|
||||
t_SR start replace mode (underline cursor shape) *t_SR* *'t_SR'*
|
||||
|
||||
+37
-29
@@ -1,4 +1,4 @@
|
||||
*todo.txt* For Vim version 8.0. Last change: 2017 Mar 29
|
||||
*todo.txt* For Vim version 8.0. Last change: 2017 Apr 28
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -35,7 +35,13 @@ entered there will not be repeated below, unless there is extra information.
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
Remove the Farsi code?
|
||||
|
||||
+channel:
|
||||
- job_stop() should not always close the channel, e.g. for "int".
|
||||
(Martin Gammelsæter, 2017 Apr 11, #1632)
|
||||
Only assume killed on "kill".
|
||||
Check job->jv_status not to be JOB_ENDED.
|
||||
- Try out background make plugin:
|
||||
https://github.com/AndrewVos/vim-make-background
|
||||
- Problem with stderr on Windows? (Vincent Rischmann, 2016 Aug 31, #1026)
|
||||
@@ -105,13 +111,19 @@ Regexp problems:
|
||||
- Difference between two engines: ".*\zs\/\@>\/" on text "///"
|
||||
(Chris Paul, 2016 Nov 13) New engine not greedy enough?
|
||||
|
||||
With foldmethod=syntax and nofoldenable comment highlighting isn't removed.
|
||||
(Marcin Szewczyk, 2017 Apr 26)
|
||||
|
||||
Running test_gui and test_gui_init with Motif sometimes kills the window
|
||||
manager. Problem with Motif?
|
||||
|
||||
Memory leak in test97? The string is actually freed. Weird.
|
||||
|
||||
Patch for deleting the quickfix lists and a test for it. (Yegappan, 2017 Mar
|
||||
21)
|
||||
Patch for shellescape(). (Christian Brabandt, 2017 Apr 20, #1590)
|
||||
|
||||
Patch for flickering redraw. (Hirohito Higashi, 2017 Apr 23, #1637)
|
||||
|
||||
New value "uselast" for 'switchbuf'. (Lemonboy, 2017 Apr 23, #1652)
|
||||
|
||||
Add a toolbar in the terminal. Can be global, above all windows, or specific
|
||||
for one window.
|
||||
@@ -122,16 +134,8 @@ Use tb_set(winid, [{'text': 'stop', 'cb': callback, 'hi': 'Green'}])
|
||||
json_encode(): should convert to utf-8. (Nikolai Pavlov, 2016 Jan 23)
|
||||
What if there is an invalid character?
|
||||
|
||||
Patch for broken foldtext. (Christian 2017 Mar 22, #1567, 2nd one)
|
||||
|
||||
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.
|
||||
@@ -139,10 +143,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
|
||||
@@ -150,21 +150,12 @@ Another example in #1309
|
||||
Patch to change all use of &sw to shiftwidth(). (Tyru, 2017 Feb 19)
|
||||
Wait until maintainers integrate it.
|
||||
|
||||
Patch to change mb_char2len() to utf_char2len(c) when known to use UTF.
|
||||
(Dominique, 2017 Mar 21, #1582)
|
||||
|
||||
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
|
||||
|
||||
Suggestion to improve pt-br spell checking. (Marcelo D Montu, 2016 Dec 15,
|
||||
#1330)
|
||||
|
||||
Patch to Modernize GtkForm Implmentation. (Kazuki Kuriyama, 2017 Mar 26)
|
||||
Any objections?
|
||||
|
||||
Error in test_startup_utf8 on Solaris. (Danek Duvall, 2016 Aug 17)
|
||||
|
||||
Completion for :!cmd shows each match twice. #1435
|
||||
@@ -215,6 +206,9 @@ Patch for restoring wide characters in the console buffer.
|
||||
Patch to fix escaping of job arguments. (Yasuhiro Matsumoto, 2016 Oct 5)
|
||||
Update Oct 14: https://gist.github.com/mattn/d47e7d3bfe5ade4be86062b565a4bfca
|
||||
|
||||
Characters deleted on completion. (Adrià Farrés, 2017 Apr 20, #1645)
|
||||
Remarks from Christian Brabandt (Apr 21)
|
||||
|
||||
The TermResponse event is not triggered when a plugin has set 'eventignore' to
|
||||
"all". Netrw does this. (Gary Johnson, 2017 Jan 24)
|
||||
Postpone the event until 'eventignore' is reset.
|
||||
@@ -222,6 +216,8 @@ Postpone the event until 'eventignore' is reset.
|
||||
Patch to make urxvt mouse work better, recognize Esc[*M termcap code.
|
||||
(Maurice Bos, 2017 Feb 17, #1486)
|
||||
|
||||
Expanding /**/ is slow. Idea by Luc Hermitte, 2017 Apr 14.
|
||||
|
||||
Once .exe with updated installer is available: Add remark to download page
|
||||
about /S and /D options (Ken Takata, 2016 Apr 13)
|
||||
Or point to nightly builds: https://github.com/vim/vim-win32-installer/releases
|
||||
@@ -255,6 +251,9 @@ Does this also fix #1408 ?
|
||||
|
||||
Patch for 'cursorlinenr' option. (Ozaki Kiichi, 2016 Nov 30)
|
||||
|
||||
When 'completeopt' has "noselect" does not insert a newline. (Lifepillar, 2017
|
||||
Apr 23, #1653)
|
||||
|
||||
Window resizing with 'winfixheight': With a vertical split the height changes
|
||||
anyway. (Tommy allen, 2017 Feb 21, #1502)
|
||||
|
||||
@@ -299,11 +298,21 @@ Patch to add "cmdline" completion to getcompletion(). (Shougo, Oct 1, #1140)
|
||||
Feature request: Complete members of a dictionary. (Luc Hermitte, 2017 Jan 4,
|
||||
#1350)
|
||||
|
||||
Undo message is not always properly displayed. Patch by Ken Takata, 2013 oct
|
||||
3. Doesn't work properly according to Yukihiro Nakadaira.
|
||||
Also see #1635.
|
||||
|
||||
Patch for systemlist(), add empty item. (thinca, Sep 30, #1135)
|
||||
Add an argument to choose binary or non-binary (like readfile()), when omitted
|
||||
use the current behavior.
|
||||
Include the test.
|
||||
|
||||
Patch to add tagfunc(). Cleaned up by Christian Brabandt, 2013 Jun 22.
|
||||
New update 2017 Apr 10, #1628
|
||||
|
||||
Unnamed register only contains the last deleted text when appending deleted
|
||||
text to a register. (Wolfgang Jeltsch, reproduced by Ben Fritz, 2017 Apr 10)
|
||||
|
||||
When 'keywordprg' starts with ":" the argument is still escaped as a shell
|
||||
command argument. (Romain Lafourcade, 2016 Oct 16, #1175)
|
||||
|
||||
@@ -354,6 +363,10 @@ names, shell commands and the like. (Kikuchan, 2010 Oct 14)
|
||||
Assume the system converts between the actual encoding of the filesystem to
|
||||
the system encoding (usually utf-8).
|
||||
|
||||
Using ":tab drop file" does not trigger BufEnter or TabEnter events.
|
||||
(Andy Stewart, 2017 Apr 27, #1660)
|
||||
Autocommands blocked in do_arg_all(). Supposed to happen later?
|
||||
|
||||
'hlsearch' interferes with a Conceal match. (Rom Grk, 2016 Aug 9)
|
||||
|
||||
Patch to add context information to quickfix/location list. (Yegappan
|
||||
@@ -917,9 +930,6 @@ Patch to handle integer overflow. (Aaron Burrow, 2013 Dec 12)
|
||||
Patch to add "ntab" item in 'listchars' to repeat first character. (Nathaniel
|
||||
Braun, pragm, 2013 Oct 13) A better solution 2014 Mar 5.
|
||||
|
||||
Undo message is not always properly displayed. Patch by Ken Takata, 2013 oct
|
||||
3. Doesn't work properly according to Yukihiro Nakadaira.
|
||||
|
||||
/[b-a] gives error E16, should probably be E769.
|
||||
|
||||
7 Windows XP: When using "ClearType" for text smoothing, a column of yellow
|
||||
@@ -1084,8 +1094,6 @@ MS-Windows resizing problems:
|
||||
Patch to append regexp to tag commands to make it possible to select one out
|
||||
of many matches. (Cody Cutler, 2013 Mar 28)
|
||||
|
||||
Patch to add tagfunc(). Cleaned up by Christian Brabandt, 2013 Jun 22.
|
||||
|
||||
The input map for CTRL-O in mswin.vim causes problems after CTRL-X CTRL-O.
|
||||
Suggestion for another map. (Philip Mat, 2012 Jun 18)
|
||||
But use "gi" instead of "a". Or use CTRL-\ CTRL-O.
|
||||
|
||||
+3108
-1
File diff suppressed because it is too large
Load Diff
+13
-4
@@ -1,7 +1,7 @@
|
||||
" Vim support file to detect file types
|
||||
"
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2017 Mar 27
|
||||
" Last Change: 2017 Apr 20
|
||||
|
||||
" Listen very carefully, I will say this only once
|
||||
if exists("did_load_filetypes")
|
||||
@@ -310,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
|
||||
@@ -2132,7 +2133,10 @@ au BufNewFile,BufRead ssh_config,*/.ssh/config setf sshconfig
|
||||
au BufNewFile,BufRead sshd_config setf sshdconfig
|
||||
|
||||
" Stata
|
||||
au BufNewFile,BufRead *.ado,*.class,*.do,*.imata,*.mata setf stata
|
||||
au BufNewFile,BufRead *.ado,*.do,*.imata,*.mata setf stata
|
||||
" Also *.class, but not when it's a Java bytecode file
|
||||
au BufNewFile,BufRead *.class
|
||||
\ if getline(1) !~ "^\xca\xfe\xba\xbe" | setf stata | endif
|
||||
|
||||
" SMCL
|
||||
au BufNewFile,BufRead *.hlp,*.ihlp,*.smcl setf smcl
|
||||
@@ -2602,6 +2606,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')
|
||||
|
||||
|
||||
+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("$")
|
||||
|
||||
@@ -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
|
||||
|
||||
+23
-27
@@ -1,7 +1,7 @@
|
||||
" Vim syntax file
|
||||
" Language: php PHP 3/4/5/7
|
||||
" Maintainer: Jason Woofenden <jason@jasonwoof.com>
|
||||
" Last Change: Dec 11, 2016
|
||||
" Last Change: Apr 28, 2017
|
||||
" URL: https://jasonwoof.com/gitweb/?p=vim-syntax.git;a=blob;f=php.vim;hb=HEAD
|
||||
" Former Maintainers: Peter Hodge <toomuchphp-vim@yahoo.com>
|
||||
" Debian VIM Maintainers <pkg-vim-maintainers@lists.alioth.debian.org>
|
||||
@@ -11,32 +11,28 @@
|
||||
" colourscheme, because elflord's colours will better highlight the break-points
|
||||
" (Statements) in your code.
|
||||
"
|
||||
" Options: php_sql_query = 1 for SQL syntax highlighting inside strings
|
||||
" php_htmlInStrings = 1 for HTML syntax highlighting inside strings
|
||||
" php_baselib = 1 for highlighting baselib functions
|
||||
" php_asp_tags = 1 for highlighting ASP-style short tags
|
||||
" php_parent_error_close = 1 for highlighting parent error ] or )
|
||||
" php_parent_error_open = 1 for skipping an php end tag, if there exists an open ( or [ without a closing one
|
||||
" php_oldStyle = 1 for using old colorstyle
|
||||
" php_noShortTags = 1 don't sync <? ?> as php
|
||||
" php_folding = 1 for folding classes and functions
|
||||
" php_folding = 2 for folding all { } regions
|
||||
" php_sync_method = x
|
||||
" x=-1 to sync by search ( default )
|
||||
" x>0 to sync at least x lines backwards
|
||||
" x=0 to sync from start
|
||||
"
|
||||
" Added by Peter Hodge On June 9, 2006:
|
||||
" php_special_functions = 1|0 to highlight functions with abnormal behaviour
|
||||
" php_alt_comparisons = 1|0 to highlight comparison operators in an alternate colour
|
||||
" php_alt_assignByReference = 1|0 to highlight '= &' in an alternate colour
|
||||
"
|
||||
" Note: these all default to 1 (On), so you would set them to '0' to turn them off.
|
||||
" E.g., in your .vimrc or _vimrc file:
|
||||
" let php_special_functions = 0
|
||||
" let php_alt_comparisons = 0
|
||||
" let php_alt_assignByReference = 0
|
||||
" Unletting these variables will revert back to their default (On).
|
||||
" Options:
|
||||
" Set to anything to enable:
|
||||
" php_sql_query SQL syntax highlighting inside strings
|
||||
" php_htmlInStrings HTML syntax highlighting inside strings
|
||||
" php_baselib highlighting baselib functions
|
||||
" php_asp_tags highlighting ASP-style short tags
|
||||
" php_parent_error_close highlighting parent error ] or )
|
||||
" php_parent_error_open skipping an php end tag, if there exists
|
||||
" an open ( or [ without a closing one
|
||||
" php_oldStyle use old colorstyle
|
||||
" php_noShortTags don't sync <? ?> as php
|
||||
" Set to a specific value:
|
||||
" php_folding = 1 fold classes and functions
|
||||
" php_folding = 2 fold all { } regions
|
||||
" php_sync_method = x where x is an integer:
|
||||
" -1 sync by search ( default )
|
||||
" >0 sync at least x lines backwards
|
||||
" 0 sync from start
|
||||
" Set to 0 to _disable_: (Added by Peter Hodge On June 9, 2006)
|
||||
" php_special_functions = 0 highlight functions with abnormal behaviour
|
||||
" php_alt_comparisons = 0 comparison operators in an alternate colour
|
||||
" php_alt_assignByReference = 0 '= &' in an alternate colour
|
||||
"
|
||||
"
|
||||
" Note:
|
||||
|
||||
+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"
|
||||
|
||||
+25
-201
File diff suppressed because one or more lines are too long
@@ -1255,7 +1255,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>130</string>
|
||||
<string>132</string>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
<dict>
|
||||
<key>NSAllowsArbitraryLoads</key>
|
||||
|
||||
@@ -234,6 +234,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
[NSNumber numberWithBool:YES], MMNativeFullScreenKey,
|
||||
[NSNumber numberWithDouble:0.25], MMFullScreenFadeTimeKey,
|
||||
[NSNumber numberWithBool:NO], MMUseCGLayerAlwaysKey,
|
||||
[NSNumber numberWithBool:YES], MMShareFindPboardKey,
|
||||
nil];
|
||||
|
||||
[[NSUserDefaults standardUserDefaults] registerDefaults:dict];
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
BOOL antialias;
|
||||
BOOL ligatures;
|
||||
BOOL thinStrokes;
|
||||
BOOL drawPending;
|
||||
NSMutableArray *drawData;
|
||||
|
||||
MMTextViewHelper *helper;
|
||||
@@ -96,6 +97,7 @@
|
||||
//
|
||||
// NSTextView methods
|
||||
//
|
||||
- (void)setFrameSize:(NSSize)newSize;
|
||||
- (void)keyDown:(NSEvent *)event;
|
||||
- (void)insertText:(id)string;
|
||||
- (void)doCommandBySelector:(SEL)selector;
|
||||
|
||||
@@ -446,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];
|
||||
@@ -650,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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
@@ -697,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];
|
||||
@@ -1034,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) {
|
||||
@@ -1569,10 +1544,14 @@
|
||||
|
||||
// See gui_macvim_add_to_find_pboard() for an explanation of these
|
||||
// types.
|
||||
if ([bestType isEqual:VimFindPboardType])
|
||||
if ([bestType isEqual:VimFindPboardType]) {
|
||||
query = [pb stringForType:VimFindPboardType];
|
||||
else
|
||||
query = [pb stringForType:NSStringPboardType];
|
||||
} else {
|
||||
BOOL shareFindPboard = [[NSUserDefaults standardUserDefaults]
|
||||
boolForKey:MMShareFindPboardKey];
|
||||
if (shareFindPboard)
|
||||
query = [pb stringForType:NSStringPboardType];
|
||||
}
|
||||
}
|
||||
|
||||
NSString *input = nil;
|
||||
|
||||
@@ -314,6 +314,9 @@ extern NSString *MMLogToStdErrKey;
|
||||
// (techincally this is a user default but should not be used as such).
|
||||
extern NSString *MMNoWindowKey;
|
||||
|
||||
// Argument used to control MacVim sharing search text via the Find Pasteboard.
|
||||
extern NSString *MMShareFindPboardKey;
|
||||
|
||||
extern NSString *MMAutosaveRowsKey;
|
||||
extern NSString *MMAutosaveColumnsKey;
|
||||
extern NSString *MMRendererKey;
|
||||
|
||||
@@ -118,6 +118,8 @@ NSString *MMLogToStdErrKey = @"MMLogToStdErr";
|
||||
// (techincally this is a user default but should not be used as such).
|
||||
NSString *MMNoWindowKey = @"MMNoWindow";
|
||||
|
||||
NSString *MMShareFindPboardKey = @"MMShareFindPboard";
|
||||
|
||||
NSString *MMAutosaveRowsKey = @"MMAutosaveRows";
|
||||
NSString *MMAutosaveColumnsKey = @"MMAutosaveColumns";
|
||||
NSString *MMRendererKey = @"MMRenderer";
|
||||
|
||||
@@ -64,11 +64,11 @@
|
||||
1DE9B9500D341AB8008FEDD4 /* MMWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 1DE9B94E0D341AB8008FEDD4 /* MMWindow.m */; };
|
||||
1DED78600C6DE43D0079945F /* vimrc in Copy Vim Runtime Files */ = {isa = PBXBuildFile; fileRef = 1DED785F0C6DE43D0079945F /* vimrc */; };
|
||||
1DFE25A50C527BC4003000F7 /* PSMTabBarControl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D493DB90C52533B00AB718C /* PSMTabBarControl.framework */; };
|
||||
52818B031C1C08CE00F59085 /* QLStephen.qlgenerator in Copy QuickLookPlugin */ = {isa = PBXBuildFile; fileRef = 52818AFF1C1C075300F59085 /* QLStephen.qlgenerator */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
|
||||
528DA66A1426D4F9003380F1 /* macvim-askpass in Copy Scripts */ = {isa = PBXBuildFile; fileRef = 528DA6691426D4EB003380F1 /* macvim-askpass */; };
|
||||
52A364731C4A5789005757EC /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52A364721C4A5789005757EC /* Sparkle.framework */; };
|
||||
52A364761C4A57C1005757EC /* Sparkle.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 52A364721C4A5789005757EC /* Sparkle.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
52B7ED9B1C4A4D6900AFFF15 /* dsa_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = 52B7ED9A1C4A4D6900AFFF15 /* dsa_pub.pem */; };
|
||||
52818B031C1C08CE00F59085 /* QLStephen.qlgenerator in Copy QuickLookPlugin */ = {isa = PBXBuildFile; fileRef = 52818AFF1C1C075300F59085 /* QLStephen.qlgenerator */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
|
||||
528DA66A1426D4F9003380F1 /* macvim-askpass in Copy Scripts */ = {isa = PBXBuildFile; fileRef = 528DA6691426D4EB003380F1 /* macvim-askpass */; };
|
||||
8D11072A0486CEB800E47090 /* MainMenu.nib in Resources */ = {isa = PBXBuildFile; fileRef = 29B97318FDCFA39411CA2CEA /* MainMenu.nib */; };
|
||||
8D11072B0486CEB800E47090 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165CFE840E0CC02AAC07 /* InfoPlist.strings */; };
|
||||
8D11072D0486CEB800E47090 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
|
||||
@@ -467,14 +467,6 @@
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
528DA6681426D477003380F1 /* Scripts */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
528DA6691426D4EB003380F1 /* macvim-askpass */,
|
||||
);
|
||||
name = Scripts;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
@@ -491,6 +483,7 @@
|
||||
1DE608B80C58807F0055263D /* Copy Vim Runtime Files */,
|
||||
1D1C31F00EFFBFD6003FE9A5 /* Make Document Icons */,
|
||||
528DA6671426D456003380F1 /* Copy Scripts */,
|
||||
52283AB71EBA200C00A6F6B9 /* Copy mvim scripts */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
@@ -620,6 +613,21 @@
|
||||
shellScript = "# Clear deployment target, else the python script always thinks we're building on Tiger\nunset MACOSX_DEPLOYMENT_TARGET\n\n# Generate the icons (redirect stderr to ignore warnings)\ncd \"$PROJECT_DIR\"/icons/\nmake OUTDIR=\"$TARGET_BUILD_DIR\"/$UNLOCALIZED_RESOURCES_FOLDER_PATH 2> /dev/null\n";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
52283AB71EBA200C00A6F6B9 /* Copy mvim scripts */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
inputPaths = (
|
||||
);
|
||||
name = "Copy mvim scripts";
|
||||
outputPaths = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "BINPATH=$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/bin\nmkdir -p $BINPATH\ncp -a $SRCROOT/mvim $BINPATH/mvim\nchmod 755 $BINPATH/mvim\n(cd $BINPATH; for f in vim vimdiff view gvim gvimdiff gview mvimdiff mview; do ln -fs mvim $f; done)";
|
||||
showEnvVarsInLog = 0;
|
||||
};
|
||||
/* End PBXShellScriptBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
|
||||
+12
-1
@@ -36,6 +36,7 @@ static int MMDefaultFontSize = 11;
|
||||
static int MMMinFontSize = 6;
|
||||
static int MMMaxFontSize = 100;
|
||||
|
||||
static BOOL MMShareFindPboard = YES;
|
||||
|
||||
static GuiFont gui_macvim_font_with_name(char_u *name);
|
||||
static int specialKeyToNSKey(int key);
|
||||
@@ -198,6 +199,15 @@ gui_macvim_after_fork_init()
|
||||
// signs.
|
||||
use_graphical_sign = (val == MMRendererCoreText);
|
||||
}
|
||||
|
||||
// Check to use the Find Pasteboard.
|
||||
MMShareFindPboard = CFPreferencesGetAppBooleanValue((CFStringRef)MMShareFindPboardKey,
|
||||
kCFPreferencesCurrentApplication,
|
||||
&keyValid);
|
||||
if (!keyValid) {
|
||||
// Share text via the Find Pasteboard by default.
|
||||
MMShareFindPboard = YES;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1816,7 +1826,8 @@ gui_macvim_add_to_find_pboard(char_u *pat)
|
||||
// The second entry will be used by other applications when taking entries
|
||||
// off the Find pasteboard, whereas MacVim will use the first if present.
|
||||
[pb setString:s forType:VimFindPboardType];
|
||||
[pb setString:[s stringByRemovingFindPatterns] forType:NSStringPboardType];
|
||||
if (MMShareFindPboard)
|
||||
[pb setString:[s stringByRemovingFindPatterns] forType:NSStringPboardType];
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
+17
-29
@@ -8,40 +8,28 @@
|
||||
# Based on a script by Wout Mertens and suggestions from Laurent Bihanic. This
|
||||
# version is the fault of Benji Fisher, 16 May 2005 (with modifications by Nico
|
||||
# Weber and Bjorn Winckler, Aug 13 2007).
|
||||
# First, check "All the Usual Suspects" for the location of the Vim.app bundle.
|
||||
# You can short-circuit this by setting the VIM_APP_DIR environment variable
|
||||
# or by un-commenting and editing the following line:
|
||||
# VIM_APP_DIR=/Applications
|
||||
#
|
||||
|
||||
if [ -z "$VIM_APP_DIR" ]
|
||||
then
|
||||
myDir="`dirname "$0"`"
|
||||
myAppDir="$myDir/../Applications"
|
||||
suspects=(
|
||||
/Applications
|
||||
~/Applications
|
||||
/Applications/vim
|
||||
~/Applications/vim
|
||||
$myDir
|
||||
$myDir/vim
|
||||
$myAppDir
|
||||
$myAppDir/vim
|
||||
/Applications/Utilities
|
||||
/Applications/Utilities/vim
|
||||
)
|
||||
for i in ${suspects[@]}; do
|
||||
if [ -x "$i/MacVim.app" ]; then
|
||||
VIM_APP_DIR="$i"
|
||||
break
|
||||
fi
|
||||
# Find Vim executable
|
||||
if [ -L $0 ]; then
|
||||
# readlink -f
|
||||
curdir=`pwd -P`
|
||||
self_path=$0
|
||||
cd `dirname $self_path`
|
||||
while [ -L $self_path ]; do
|
||||
self_path=`readlink $self_path`
|
||||
cd `dirname $self_path`
|
||||
self_path=`basename $self_path`
|
||||
done
|
||||
binary="`pwd -P`/../MacOS/Vim"
|
||||
cd $curdir
|
||||
else
|
||||
binary="`dirname "$0"`/../MacOS/Vim"
|
||||
fi
|
||||
if [ -z "$VIM_APP_DIR" ]
|
||||
then
|
||||
echo "Sorry, cannot find MacVim.app. Try setting the VIM_APP_DIR environment variable to the directory containing MacVim.app."
|
||||
if ! [ -x $binary ]; then
|
||||
echo "Sorry, cannot find Vim executable."
|
||||
exit 1
|
||||
fi
|
||||
binary="$VIM_APP_DIR/MacVim.app/Contents/MacOS/Vim"
|
||||
|
||||
# Next, peek at the name used to invoke this script, and set options
|
||||
# accordingly.
|
||||
|
||||
+39
-40
@@ -207,7 +207,7 @@
|
||||
#SunOS 4.1.x +X11 -GUI 5.1b (J) Bram Moolenaar
|
||||
#SunOS 4.1.3_U1 (sun4c) gcc +X11 +GUI Athena 5.0w (J) Darren Hiebert
|
||||
#SUPER-UX 6.2 (NEC SX-4) cc +X11R6 Motif,Athena4.6b (P) Lennart Schultz
|
||||
#Tandem/NSK (c) Matthew Woehlke
|
||||
#Tandem/NSK (c) Matthew Woehlke
|
||||
#Unisys 6035 cc +X11 Motif 5.3 (8) Glauber Ribeiro
|
||||
#ESIX V4.2 cc +X11 6.0 (a) Reinhard Wobst
|
||||
#Mac OS X 10.[23] gcc Carbon 6.2 (x) Bram Moolenaar
|
||||
@@ -403,6 +403,7 @@ CClink = $(CC)
|
||||
# First one is for static linking, second one for dynamic loading.
|
||||
# Use --with-luajit if you want to use LuaJIT instead of Lua.
|
||||
# Set PATH environment variable to find lua or luajit executable.
|
||||
# This requires at least "normal" features, "tiny" and "small" don't work.
|
||||
#CONF_OPT_LUA = --enable-luainterp
|
||||
#CONF_OPT_LUA = --enable-luainterp=dynamic
|
||||
#CONF_OPT_LUA = --enable-luainterp --with-luajit
|
||||
@@ -429,16 +430,15 @@ CClink = $(CC)
|
||||
# the next line.
|
||||
# When you get an error for a missing "perl.exp" file, try creating an empty
|
||||
# one: "touch perl.exp".
|
||||
# This requires at least "small" features, "tiny" doesn't work.
|
||||
# This requires at least "normal" features, "tiny" and "small" don't work.
|
||||
#CONF_OPT_PERL = --enable-perlinterp
|
||||
#CONF_OPT_PERL = --enable-perlinterp=dynamic
|
||||
|
||||
# PYTHON
|
||||
# Uncomment this when you want to include the Python interface.
|
||||
# Requires small features or better, fails with tiny features.
|
||||
# Uncomment lines here when you want to include the Python interface.
|
||||
# This requires at least "normal" features, "tiny" and "small" don't work.
|
||||
# NOTE: This may cause threading to be enabled, which has side effects (such
|
||||
# as using different libraries and debugging becomes more difficult).
|
||||
# NOTE: Using this together with Perl may cause a crash in initialization.
|
||||
# For Python3 support make a symbolic link in /usr/local/bin:
|
||||
# ln -s python3 python3.1
|
||||
# If both python2.x and python3.x are enabled then the linking will be via
|
||||
@@ -454,6 +454,7 @@ CClink = $(CC)
|
||||
# Uncomment this when you want to include the Ruby interface.
|
||||
# First one for static linking, second one for loading when used.
|
||||
# Note: you need the development package (e.g., ruby1.9.1-dev on Ubuntu).
|
||||
# This requires at least "normal" features, "tiny" and "small" don't work.
|
||||
#CONF_OPT_RUBY = --enable-rubyinterp
|
||||
#CONF_OPT_RUBY = --enable-rubyinterp=dynamic
|
||||
#CONF_OPT_RUBY = --enable-rubyinterp --with-ruby-command=ruby1.9.1
|
||||
@@ -617,7 +618,7 @@ AUTOCONF = autoconf
|
||||
#PURIFY = purify
|
||||
|
||||
# VALGRIND - remove the # to use valgrind for memory leaks and access errors.
|
||||
# Used for the unittest targets.
|
||||
# Used for the unittest targets.
|
||||
# VALGRIND = valgrind --tool=memcheck --leak-check=yes --num-callers=25 --log-file=valgrind.$@
|
||||
|
||||
# NBDEBUG - debugging the netbeans interface.
|
||||
@@ -649,15 +650,15 @@ LINT_OPTIONS = -beprxzF
|
||||
# coverage information. (provided by Yegappan Lakshmanan)
|
||||
# 1. make clean, run configure and build Vim as usual.
|
||||
# 2. Generate the baseline code coverage information:
|
||||
# $ lcov -c -i -b . -d objects -o objects/coverage_base.info
|
||||
# $ lcov -c -i -b . -d objects -o objects/coverage_base.info
|
||||
# 3. Run "make test" to run the unit tests. The code coverage information will
|
||||
# be generated in the src/objects directory.
|
||||
# 4. Generate the code coverage information from the tests:
|
||||
# $ lcov -c -b . -d objects/ -o objects/coverage_test.info
|
||||
# $ lcov -c -b . -d objects/ -o objects/coverage_test.info
|
||||
# 5. Combine the baseline and test code coverage data:
|
||||
# $ lcov -a objects/coverage_base.info -a objects/coverage_test.info -o objects/coverage_total.info
|
||||
# $ lcov -a objects/coverage_base.info -a objects/coverage_test.info -o objects/coverage_total.info
|
||||
# 6. Process the test coverage data and generate a report in html:
|
||||
# $ genhtml objects/coverage_total.info -o objects
|
||||
# $ genhtml objects/coverage_total.info -o objects
|
||||
# 7. Open the objects/index.html file in a web browser to view the coverage
|
||||
# information.
|
||||
#
|
||||
@@ -1424,6 +1425,11 @@ PROTO_FLAGS = -d -E"$(CPP)" $(NO_ATTR)
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
# We would normally use "mkdir -p" but it doesn't work properly everywhere.
|
||||
# Using AC_PROG_MKDIR_P in configure.ac has a problem with the "auto"
|
||||
# directory. Always use the install-sh script, it's slower but reliable.
|
||||
MKDIR_P = $(SHELL) install-sh -c -d
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .o .pro
|
||||
|
||||
@@ -1901,20 +1907,12 @@ 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
|
||||
# Run vim script to generate the Ex command lookup table.
|
||||
# This only needs to be run when a command name has been added or changed.
|
||||
# If this fails because you don't have Vim yet, first build and install Vim
|
||||
# without changes.
|
||||
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:
|
||||
$(MAKE) -f Makefile all
|
||||
vim -u NONE -i NONE -X -S create_cmdidxs.vim
|
||||
|
||||
|
||||
# The normal command to compile a .c file to its .o file.
|
||||
@@ -2139,10 +2137,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 \
|
||||
@@ -2159,6 +2157,7 @@ test_arglist \
|
||||
test_fnameescape \
|
||||
test_fnamemodify \
|
||||
test_fold \
|
||||
test_functions \
|
||||
test_ga \
|
||||
test_gf \
|
||||
test_glob2regpat \
|
||||
@@ -2582,7 +2581,7 @@ DESKTOPPATH = $(DESTDIR)$(DATADIR)/applications
|
||||
KDEPATH = $(HOME)/.kde/share/icons
|
||||
install-icons:
|
||||
if test -n "$(DESTDIR)"; then \
|
||||
$(SHELL) ./mkinstalldirs $(ICON48PATH) $(ICON32PATH) \
|
||||
$(MKDIR_P) $(ICON48PATH) $(ICON32PATH) \
|
||||
$(ICON16PATH) $(DESKTOPPATH); \
|
||||
fi
|
||||
|
||||
@@ -2623,7 +2622,7 @@ $(DESTDIR)$(exec_prefix) $(DEST_BIN) \
|
||||
$(DEST_LANG) $(DEST_KMAP) $(DEST_COMP) $(DEST_MACRO) \
|
||||
$(DEST_PACK) $(DEST_TOOLS) $(DEST_TUTOR) $(DEST_SPELL) \
|
||||
$(DEST_AUTO) $(DEST_AUTO)/xml $(DEST_PLUG):
|
||||
-$(SHELL) ./mkinstalldirs $@
|
||||
$(MKDIR_P) $@
|
||||
-chmod $(DIRMOD) $@
|
||||
|
||||
# create links from various names to vim. This is only done when the links
|
||||
@@ -2786,7 +2785,8 @@ uninstall_runtime:
|
||||
# Clean up all the files that have been produced, except configure's.
|
||||
# We support common typing mistakes for Juergen! :-)
|
||||
clean celan: testclean macvimclean
|
||||
-rm -f *.o objects/* core $(VIMTARGET).core $(VIMTARGET) vim xxd/*.o
|
||||
-rm -f *.o core $(VIMTARGET).core $(VIMTARGET) vim xxd/*.o
|
||||
-rm -rf objects
|
||||
-rm -f $(TOOLS) auto/osdef.h auto/pathdef.c auto/if_perl.c auto/gui_gtk_gresources.c auto/gui_gtk_gresources.h
|
||||
-rm -f conftest* *~ auto/link.sed
|
||||
-rm -f testdir/opt_test.vim
|
||||
@@ -2803,25 +2803,25 @@ clean celan: testclean macvimclean
|
||||
SHADOWDIR = shadow
|
||||
|
||||
shadow: runtime pixmaps
|
||||
mkdir $(SHADOWDIR)
|
||||
cd $(SHADOWDIR); ln -s ../*.[chm] ../*.in ../*.sh ../*.xs ../*.xbm ../gui_gtk_res.xml ../toolcheck ../proto ../vimtutor ../gvimtutor ../mkinstalldirs .
|
||||
$(MKDIR_P) $(SHADOWDIR)
|
||||
cd $(SHADOWDIR); ln -s ../*.[chm] ../*.in ../*.sh ../*.xs ../*.xbm ../gui_gtk_res.xml ../toolcheck ../proto ../vimtutor ../gvimtutor ../install-sh .
|
||||
mkdir $(SHADOWDIR)/auto
|
||||
cd $(SHADOWDIR)/auto; ln -s ../../auto/configure .
|
||||
mkdir $(SHADOWDIR)/po
|
||||
$(MKDIR_P) $(SHADOWDIR)/po
|
||||
cd $(SHADOWDIR)/po; ln -s ../../po/*.po ../../po/*.mak ../../po/*.vim ../../po/Makefile .
|
||||
cd $(SHADOWDIR); rm -f auto/link.sed
|
||||
cp Makefile configure $(SHADOWDIR)
|
||||
rm -f $(SHADOWDIR)/auto/config.mk $(SHADOWDIR)/config.mk.dist
|
||||
cp config.mk.dist $(SHADOWDIR)/auto/config.mk
|
||||
cp config.mk.dist $(SHADOWDIR)
|
||||
mkdir $(SHADOWDIR)/xxd
|
||||
$(MKDIR_P) $(SHADOWDIR)/xxd
|
||||
cd $(SHADOWDIR)/xxd; ln -s ../../xxd/*.[ch] ../../xxd/Make* .
|
||||
if test -d $(RSRC_DIR); then \
|
||||
cd $(SHADOWDIR); \
|
||||
ln -s ../infplist.xml .; \
|
||||
ln -s ../$(RSRC_DIR) ../os_mac.rsr.hqx ../dehqx.py .; \
|
||||
fi
|
||||
mkdir $(SHADOWDIR)/testdir
|
||||
$(MKDIR_P) $(SHADOWDIR)/testdir
|
||||
cd $(SHADOWDIR)/testdir; ln -s ../../testdir/Makefile \
|
||||
../../testdir/Make_all.mak \
|
||||
../../testdir/README.txt \
|
||||
@@ -2958,7 +2958,7 @@ auto/gui_gtk_gresources.h: gui_gtk_res.xml $(GUI_GTK_RES_INPUTS)
|
||||
objects: objects/.dirstamp
|
||||
|
||||
objects/.dirstamp:
|
||||
mkdir -p objects
|
||||
$(MKDIR_P) objects
|
||||
touch objects/.dirstamp
|
||||
|
||||
# All object files depend on the objects directory, so that parallel make
|
||||
@@ -3298,8 +3298,7 @@ install_macosx: gui_bundle
|
||||
# Generate the help tags file now, it won't work with "make installruntime".
|
||||
-@srcdir=`pwd`; cd $(HELPSOURCE); $(MAKE) VIMEXE=$$srcdir/$(VIMTARGET) vimtags
|
||||
# Install the runtime files. Recursive!
|
||||
-mkdir -p $(DESTDIR)$(prefix)/$(RESDIR)/vim/runtime
|
||||
# -mkdir $(DESTDIR)$(prefix)/$(APPDIR)/bin
|
||||
$(MKDIR_P) $(DESTDIR)$(prefix)/$(RESDIR)/vim/runtime
|
||||
srcdir=`pwd`; $(MAKE) -f Makefile installruntime \
|
||||
VIMEXE=$$srcdir/$(VIMTARGET) \
|
||||
prefix=$(DESTDIR)$(prefix)/$(RESDIR)$(VIMDIR) \
|
||||
@@ -3317,16 +3316,16 @@ gui_bundle: $(RESDIR) bundle-dir bundle-executable bundle-info bundle-resource \
|
||||
bundle-language
|
||||
|
||||
$(RESDIR):
|
||||
mkdir -p $@
|
||||
$(MKDIR_P) $@
|
||||
|
||||
bundle-dir: $(APPDIR)/Contents $(VIMTARGET)
|
||||
# Make a link to the runtime directory, so that we can try out the executable
|
||||
# without installing it.
|
||||
mkdir -p $(RESDIR)/vim
|
||||
$(MKDIR_P) $(RESDIR)/vim
|
||||
-ln -s `pwd`/../runtime $(RESDIR)/vim
|
||||
|
||||
bundle-executable: $(VIMTARGET)
|
||||
mkdir -p $(APPDIR)/Contents/MacOS
|
||||
$(MKDIR_P) $(APPDIR)/Contents/MacOS
|
||||
cp $(VIMTARGET) $(APPDIR)/Contents/MacOS/$(VIMTARGET)
|
||||
|
||||
bundle-info: bundle-dir
|
||||
@@ -3357,8 +3356,8 @@ bundle-rsrc: os_mac.rsr.hqx
|
||||
bundle-language: bundle-dir
|
||||
|
||||
$(APPDIR)/Contents:
|
||||
-$(SHELL) ./mkinstalldirs $(APPDIR)/Contents/MacOS
|
||||
-$(SHELL) ./mkinstalldirs $(RESDIR)/English.lproj
|
||||
$(MKDIR_P) $(APPDIR)/Contents/MacOS
|
||||
$(MKDIR_P) $(RESDIR)/English.lproj
|
||||
|
||||
|
||||
##############################################################################
|
||||
|
||||
Vendored
+11
-13
@@ -3456,7 +3456,7 @@ ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
||||
ac_ext=c
|
||||
ac_ext=c
|
||||
ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
@@ -3733,7 +3733,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
|
||||
|
||||
fi
|
||||
rm -f conftest*
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
|
||||
$as_echo_n "checking for fgrep... " >&6; }
|
||||
if ${ac_cv_path_FGREP+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
@@ -3799,7 +3799,7 @@ fi
|
||||
$as_echo "$ac_cv_path_FGREP" >&6; }
|
||||
FGREP="$ac_cv_path_FGREP"
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing strerror" >&5
|
||||
$as_echo_n "checking for library containing strerror... " >&6; }
|
||||
if ${ac_cv_search_strerror+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
@@ -3854,7 +3854,7 @@ if test "$ac_res" != no; then :
|
||||
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
|
||||
|
||||
fi
|
||||
for ac_prog in gawk mawk nawk awk
|
||||
for ac_prog in gawk mawk nawk awk
|
||||
do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
@@ -11630,16 +11630,15 @@ if test "x$vim_cv_terminfo" = "xyes" ; then
|
||||
|
||||
fi
|
||||
|
||||
if test "x$olibs" != "x$LIBS"; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking what tgetent() returns for an unknown terminal" >&5
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking what tgetent() returns for an unknown terminal" >&5
|
||||
$as_echo_n "checking what tgetent() returns for an unknown terminal... " >&6; }
|
||||
if ${vim_cv_tgent+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
|
||||
if test "$cross_compiling" = yes; then :
|
||||
if test "$cross_compiling" = yes; then :
|
||||
|
||||
as_fn_error $? "failed to compile test program." "$LINENO" 5
|
||||
as_fn_error $? "failed to compile test program." "$LINENO" 5
|
||||
|
||||
else
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
@@ -11659,11 +11658,11 @@ main()
|
||||
_ACEOF
|
||||
if ac_fn_c_try_run "$LINENO"; then :
|
||||
|
||||
vim_cv_tgent=zero
|
||||
vim_cv_tgent=zero
|
||||
|
||||
else
|
||||
|
||||
vim_cv_tgent=non-zero
|
||||
vim_cv_tgent=non-zero
|
||||
|
||||
fi
|
||||
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
|
||||
@@ -11675,10 +11674,9 @@ fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $vim_cv_tgent" >&5
|
||||
$as_echo "$vim_cv_tgent" >&6; }
|
||||
|
||||
if test "x$vim_cv_tgent" = "xzero" ; then
|
||||
$as_echo "#define TGETENT_ZERO_ERR 0" >>confdefs.h
|
||||
if test "x$vim_cv_tgent" = "xzero" ; then
|
||||
$as_echo "#define TGETENT_ZERO_ERR 0" >>confdefs.h
|
||||
|
||||
fi
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether termcap.h contains ospeed" >&5
|
||||
|
||||
+15
-5
@@ -2425,7 +2425,7 @@ append_to_buffer(buf_T *buffer, char_u *msg, channel_T *channel, ch_part_T part)
|
||||
curbuf = curwin->w_buffer;
|
||||
}
|
||||
}
|
||||
redraw_buf_later(buffer, VALID);
|
||||
redraw_buf_and_status_later(buffer, VALID);
|
||||
channel_need_redraw = TRUE;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
@@ -5168,12 +5173,17 @@ job_stop(job_T *job, typval_T *argvars)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (job->jv_status == JOB_ENDED)
|
||||
{
|
||||
ch_log(job->jv_channel, "Job has already ended, job_stop() skipped");
|
||||
return 0;
|
||||
}
|
||||
ch_logs(job->jv_channel, "Stopping job with '%s'", (char *)arg);
|
||||
if (mch_stop_job(job, arg) == FAIL)
|
||||
return 0;
|
||||
|
||||
/* Assume that "hup" does not kill the job. */
|
||||
if (job->jv_channel != NULL && STRCMP(arg, "hup") != 0)
|
||||
/* Assume that only "kill" will kill the job. */
|
||||
if (job->jv_channel != NULL && STRCMP(arg, "kill") == 0)
|
||||
job->jv_channel->ch_job_killed = TRUE;
|
||||
|
||||
/* We don't try freeing the job, obviously the caller still has a
|
||||
|
||||
+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
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
the first targets to make vim are: scratch config myself
|
||||
the first target to make vim is: reconfig
|
||||
srcdir = .
|
||||
VIMNAME = vim
|
||||
EXNAME = ex
|
||||
|
||||
+19
-21
@@ -11,12 +11,12 @@ AC_DEFINE(UNIX)
|
||||
AC_PROG_MAKE_SET
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CC dnl required by almost everything
|
||||
AC_PROG_CPP dnl required by header file checks
|
||||
AC_PROGRAM_EGREP dnl required by AC_EGREP_CPP
|
||||
AC_PROG_FGREP dnl finds working grep -F
|
||||
AC_ISC_POSIX dnl required by AC_C_CROSS
|
||||
AC_PROG_AWK dnl required for "make html" in ../doc
|
||||
AC_PROG_CC dnl required by almost everything
|
||||
AC_PROG_CPP dnl required by header file checks
|
||||
AC_PROGRAM_EGREP dnl required by AC_EGREP_CPP
|
||||
AC_PROG_FGREP dnl finds working grep -F
|
||||
AC_ISC_POSIX dnl required by AC_C_CROSS
|
||||
AC_PROG_AWK dnl required for "make html" in ../doc
|
||||
|
||||
dnl Don't strip if we don't have it
|
||||
AC_CHECK_PROG(STRIP, strip, strip, :)
|
||||
@@ -3440,10 +3440,9 @@ if test "x$vim_cv_terminfo" = "xyes" ; then
|
||||
AC_DEFINE(TERMINFO)
|
||||
fi
|
||||
|
||||
if test "x$olibs" != "x$LIBS"; then
|
||||
AC_CACHE_CHECK([what tgetent() returns for an unknown terminal], [vim_cv_tgent],
|
||||
[
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
AC_CACHE_CHECK([what tgetent() returns for an unknown terminal], [vim_cv_tgent],
|
||||
[
|
||||
AC_RUN_IFELSE([AC_LANG_SOURCE([[
|
||||
#include "confdefs.h"
|
||||
#ifdef HAVE_TERMCAP_H
|
||||
# include <termcap.h>
|
||||
@@ -3454,18 +3453,17 @@ if test "x$olibs" != "x$LIBS"; then
|
||||
#endif
|
||||
main()
|
||||
{char s[10000]; int res = tgetent(s, "thisterminaldoesnotexist"); exit(res != 0); }
|
||||
]])],[
|
||||
vim_cv_tgent=zero
|
||||
],[
|
||||
vim_cv_tgent=non-zero
|
||||
],[
|
||||
AC_MSG_ERROR(failed to compile test program.)
|
||||
])
|
||||
]])],[
|
||||
vim_cv_tgent=zero
|
||||
],[
|
||||
vim_cv_tgent=non-zero
|
||||
],[
|
||||
AC_MSG_ERROR(failed to compile test program.)
|
||||
])
|
||||
|
||||
if test "x$vim_cv_tgent" = "xzero" ; then
|
||||
AC_DEFINE(TGETENT_ZERO_ERR, 0)
|
||||
fi
|
||||
])
|
||||
|
||||
if test "x$vim_cv_tgent" = "xzero" ; then
|
||||
AC_DEFINE(TGETENT_ZERO_ERR, 0)
|
||||
fi
|
||||
|
||||
AC_MSG_CHECKING(whether termcap.h contains ospeed)
|
||||
|
||||
@@ -1,75 +0,0 @@
|
||||
#!/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";
|
||||
@@ -0,0 +1,81 @@
|
||||
" 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".
|
||||
|
||||
let cmds = []
|
||||
let skipped_cmds = 0
|
||||
|
||||
for line in readfile('ex_cmds.h')
|
||||
if line =~ '^EX(CMD_'
|
||||
let m = matchlist(line, '^EX(CMD_\S*,\s*"\([a-z][^"]*\)"')
|
||||
if len(m) >= 2
|
||||
let cmds += [ m[1] ]
|
||||
else
|
||||
let skipped_cmds += 1
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
|
||||
let cmdidxs1 = {}
|
||||
let cmdidxs2 = {}
|
||||
|
||||
for i in range(len(cmds) - 1, 0, -1)
|
||||
let cmd = cmds[i]
|
||||
let c1 = cmd[0] " First character of command
|
||||
let c2 = cmd[1] " Second character of command (if any)
|
||||
|
||||
let cmdidxs1{c1} = i
|
||||
if c2 >= 'a' && c2 <= 'z'
|
||||
let cmdidxs2{c1}{c2} = i
|
||||
endif
|
||||
endfor
|
||||
|
||||
let output = [ '/* Automatically generated code by create_cmdidxs.vim' ]
|
||||
let output += [ ' *' ]
|
||||
let output += [ ' * Table giving the index of the first command in cmdnames[] to lookup' ]
|
||||
let output += [ ' * based on the first letter of a command.' ]
|
||||
let output += [ ' */' ]
|
||||
let output += [ 'static const unsigned short cmdidxs1[26] =' ]
|
||||
let output += [ '{' ]
|
||||
|
||||
let a_to_z = map(range(char2nr('a'), char2nr('z')), 'nr2char(v:val)')
|
||||
for c1 in a_to_z
|
||||
let line = ' /* ' . c1 . ' */ ' . cmdidxs1{c1} . ((c1 == 'z') ? '' : ',')
|
||||
let output += [ line ]
|
||||
endfor
|
||||
let output += [ '};' ]
|
||||
let output += [ '' ]
|
||||
let output += [ '/*' ]
|
||||
let output += [ ' * Table giving the index of the first command in cmdnames[] to lookup' ]
|
||||
let output += [ ' * based on the first 2 letters of a command.' ]
|
||||
let output += [ ' * Values in cmdidxs2[c1][c2] are relative to cmdidxs1[c1] so that they' ]
|
||||
let output += [ ' * fit in a byte.' ]
|
||||
let output += [ ' */' ]
|
||||
let output += [ 'static const unsigned char cmdidxs2[26][26] =' ]
|
||||
let output += [ '{ /* 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 */' ]
|
||||
|
||||
for c1 in a_to_z
|
||||
let line = ' /* ' . c1 . ' */ {'
|
||||
for c2 in a_to_z
|
||||
if exists('cmdidxs2{c1}{c2}')
|
||||
let line .= printf('%3d', cmdidxs2{c1}{c2} - cmdidxs1{c1})
|
||||
else
|
||||
let line .= ' 0'
|
||||
endif
|
||||
let line .= (c2 == 'z') ? '' : ','
|
||||
endfor
|
||||
let line .= ' }' . ((c1 == 'z') ? '' : ',')
|
||||
let output += [ line ]
|
||||
endfor
|
||||
|
||||
let output += [ '};' ]
|
||||
let output += [ '' ]
|
||||
let output += [ 'static const int command_count = ' . (len(cmds) + skipped_cmds) . ';' ]
|
||||
|
||||
call writefile(output, "ex_cmdidxs.h")
|
||||
quit
|
||||
+14
-8
@@ -59,13 +59,23 @@ rettv_dict_alloc(typval_T *rettv)
|
||||
if (d == NULL)
|
||||
return FAIL;
|
||||
|
||||
rettv->vval.v_dict = d;
|
||||
rettv->v_type = VAR_DICT;
|
||||
rettv_dict_set(rettv, d);
|
||||
rettv->v_lock = 0;
|
||||
++d->dv_refcount;
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set a dictionary as the return value
|
||||
*/
|
||||
void
|
||||
rettv_dict_set(typval_T *rettv, dict_T *d)
|
||||
{
|
||||
rettv->v_type = VAR_DICT;
|
||||
rettv->vval.v_dict = d;
|
||||
if (d != NULL)
|
||||
++d->dv_refcount;
|
||||
}
|
||||
|
||||
/*
|
||||
* Free a Dictionary, including all non-container items it contains.
|
||||
* Ignores the reference count.
|
||||
@@ -646,11 +656,7 @@ failret:
|
||||
|
||||
*arg = skipwhite(*arg + 1);
|
||||
if (evaluate)
|
||||
{
|
||||
rettv->v_type = VAR_DICT;
|
||||
rettv->vval.v_dict = d;
|
||||
++d->dv_refcount;
|
||||
}
|
||||
rettv_dict_set(rettv, d);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
+46
-23
@@ -96,6 +96,7 @@ struct compl_S
|
||||
static compl_T *compl_first_match = NULL;
|
||||
static compl_T *compl_curr_match = NULL;
|
||||
static compl_T *compl_shown_match = NULL;
|
||||
static compl_T *compl_old_match = NULL;
|
||||
|
||||
/* After using a cursor key <Enter> selects a match in the popup menu,
|
||||
* otherwise it inserts a line break. */
|
||||
@@ -3440,6 +3441,7 @@ ins_compl_free(void)
|
||||
} while (compl_curr_match != NULL && compl_curr_match != compl_first_match);
|
||||
compl_first_match = compl_curr_match = NULL;
|
||||
compl_shown_match = NULL;
|
||||
compl_old_match = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -4286,7 +4288,6 @@ ins_compl_get_exp(pos_T *ini)
|
||||
char_u *ptr;
|
||||
char_u *dict = NULL;
|
||||
int dict_f = 0;
|
||||
compl_T *old_match;
|
||||
int set_match_pos;
|
||||
|
||||
if (!compl_started)
|
||||
@@ -4300,7 +4301,7 @@ ins_compl_get_exp(pos_T *ini)
|
||||
last_match_pos = first_match_pos = *ini;
|
||||
}
|
||||
|
||||
old_match = compl_curr_match; /* remember the last current match */
|
||||
compl_old_match = compl_curr_match; /* remember the last current match */
|
||||
pos = (compl_direction == FORWARD) ? &last_match_pos : &first_match_pos;
|
||||
/* For ^N/^P loop over all the flags/windows/buffers in 'complete' */
|
||||
for (;;)
|
||||
@@ -4402,6 +4403,11 @@ ins_compl_get_exp(pos_T *ini)
|
||||
}
|
||||
}
|
||||
|
||||
/* If complete() was called then compl_pattern has been reset. The
|
||||
* following won't work then, bail out. */
|
||||
if (compl_pattern == NULL)
|
||||
break;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case -1:
|
||||
@@ -4635,7 +4641,7 @@ ins_compl_get_exp(pos_T *ini)
|
||||
|
||||
/* check if compl_curr_match has changed, (e.g. other type of
|
||||
* expansion added something) */
|
||||
if (type != 0 && compl_curr_match != old_match)
|
||||
if (type != 0 && compl_curr_match != compl_old_match)
|
||||
found_new_match = OK;
|
||||
|
||||
/* break the loop for specialized modes (use 'complete' just for the
|
||||
@@ -4674,13 +4680,16 @@ ins_compl_get_exp(pos_T *ini)
|
||||
|| (ctrl_x_mode != 0 && !CTRL_X_MODE_LINE_OR_EVAL(ctrl_x_mode)))
|
||||
i = ins_compl_make_cyclic();
|
||||
|
||||
/* If several matches were added (FORWARD) or the search failed and has
|
||||
* just been made cyclic then we have to move compl_curr_match to the next
|
||||
* or previous entry (if any) -- Acevedo */
|
||||
compl_curr_match = compl_direction == FORWARD ? old_match->cp_next
|
||||
: old_match->cp_prev;
|
||||
if (compl_curr_match == NULL)
|
||||
compl_curr_match = old_match;
|
||||
if (compl_old_match != NULL)
|
||||
{
|
||||
/* If several matches were added (FORWARD) or the search failed and has
|
||||
* just been made cyclic then we have to move compl_curr_match to the
|
||||
* next or previous entry (if any) -- Acevedo */
|
||||
compl_curr_match = compl_direction == FORWARD ? compl_old_match->cp_next
|
||||
: compl_old_match->cp_prev;
|
||||
if (compl_curr_match == NULL)
|
||||
compl_curr_match = compl_old_match;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
@@ -4770,7 +4779,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 +4970,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 +9040,7 @@ ins_bs(
|
||||
#endif
|
||||
|
||||
/*
|
||||
* delete newline!
|
||||
* Delete newline!
|
||||
*/
|
||||
if (curwin->w_cursor.col == 0)
|
||||
{
|
||||
@@ -9032,7 +9055,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 +9566,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. */
|
||||
|
||||
+11
-9
@@ -4665,9 +4665,7 @@ eval_index(
|
||||
item = item->li_next;
|
||||
}
|
||||
clear_tv(rettv);
|
||||
rettv->v_type = VAR_LIST;
|
||||
rettv->vval.v_list = l;
|
||||
++l->lv_refcount;
|
||||
rettv_list_set(rettv, l);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -5327,6 +5325,10 @@ garbage_collect(int testing)
|
||||
abort = abort || set_ref_in_timer(copyID);
|
||||
#endif
|
||||
|
||||
#ifdef FEAT_QUICKFIX
|
||||
abort = abort || set_ref_in_quickfix(copyID);
|
||||
#endif
|
||||
|
||||
if (!abort)
|
||||
{
|
||||
/*
|
||||
@@ -6120,13 +6122,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 +8330,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)
|
||||
@@ -8480,9 +8484,7 @@ getwinvar(
|
||||
|
||||
if (opts != NULL)
|
||||
{
|
||||
rettv->v_type = VAR_DICT;
|
||||
rettv->vval.v_dict = opts;
|
||||
++opts->dv_refcount;
|
||||
rettv_dict_set(rettv, opts);
|
||||
done = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
+49
-50
@@ -3005,8 +3005,7 @@ f_expand(typval_T *argvars, typval_T *rettv)
|
||||
&& get_tv_number_chk(&argvars[2], &error)
|
||||
&& !error)
|
||||
{
|
||||
rettv->v_type = VAR_LIST;
|
||||
rettv->vval.v_list = NULL;
|
||||
rettv_list_set(rettv, NULL);
|
||||
}
|
||||
|
||||
s = get_tv_string(&argvars[0]);
|
||||
@@ -3909,12 +3908,7 @@ f_get(typval_T *argvars, typval_T *rettv)
|
||||
}
|
||||
}
|
||||
else if (STRCMP(what, "dict") == 0)
|
||||
{
|
||||
rettv->v_type = VAR_DICT;
|
||||
rettv->vval.v_dict = pt->pt_dict;
|
||||
if (pt->pt_dict != NULL)
|
||||
++pt->pt_dict->dv_refcount;
|
||||
}
|
||||
rettv_dict_set(rettv, pt->pt_dict);
|
||||
else if (STRCMP(what, "args") == 0)
|
||||
{
|
||||
rettv->v_type = VAR_LIST;
|
||||
@@ -4214,9 +4208,7 @@ f_getbufvar(typval_T *argvars, typval_T *rettv)
|
||||
|
||||
if (opts != NULL)
|
||||
{
|
||||
rettv->v_type = VAR_DICT;
|
||||
rettv->vval.v_dict = opts;
|
||||
++opts->dv_refcount;
|
||||
rettv_dict_set(rettv, opts);
|
||||
done = TRUE;
|
||||
}
|
||||
}
|
||||
@@ -5248,24 +5240,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 +5287,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 +5328,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
|
||||
}
|
||||
@@ -5361,8 +5371,7 @@ f_glob(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
if (get_tv_number_chk(&argvars[2], &error))
|
||||
{
|
||||
rettv->v_type = VAR_LIST;
|
||||
rettv->vval.v_list = NULL;
|
||||
rettv_list_set(rettv, NULL);
|
||||
}
|
||||
if (argvars[3].v_type != VAR_UNKNOWN
|
||||
&& get_tv_number_chk(&argvars[3], &error))
|
||||
@@ -5418,8 +5427,7 @@ f_globpath(typval_T *argvars, typval_T *rettv)
|
||||
{
|
||||
if (get_tv_number_chk(&argvars[3], &error))
|
||||
{
|
||||
rettv->v_type = VAR_LIST;
|
||||
rettv->vval.v_list = NULL;
|
||||
rettv_list_set(rettv, NULL);
|
||||
}
|
||||
if (argvars[4].v_type != VAR_UNKNOWN
|
||||
&& get_tv_number_chk(&argvars[4], &error))
|
||||
@@ -7718,6 +7726,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)
|
||||
@@ -9160,9 +9169,7 @@ f_reverse(typval_T *argvars, typval_T *rettv)
|
||||
list_append(l, li);
|
||||
li = ni;
|
||||
}
|
||||
rettv->vval.v_list = l;
|
||||
rettv->v_type = VAR_LIST;
|
||||
++l->lv_refcount;
|
||||
rettv_list_set(rettv, l);
|
||||
l->lv_idx = l->lv_len - l->lv_idx - 1;
|
||||
}
|
||||
}
|
||||
@@ -10750,9 +10757,7 @@ do_sort_uniq(typval_T *argvars, typval_T *rettv, int sort)
|
||||
(char_u *)(sort ? N_("sort() argument") : N_("uniq() argument")),
|
||||
TRUE))
|
||||
goto theend;
|
||||
rettv->vval.v_list = l;
|
||||
rettv->v_type = VAR_LIST;
|
||||
++l->lv_refcount;
|
||||
rettv_list_set(rettv, l);
|
||||
|
||||
len = list_len(l);
|
||||
if (len <= 1)
|
||||
@@ -11840,8 +11845,7 @@ f_synconcealed(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
char_u str[NUMBUFLEN];
|
||||
#endif
|
||||
|
||||
rettv->v_type = VAR_LIST;
|
||||
rettv->vval.v_list = NULL;
|
||||
rettv_list_set(rettv, NULL);
|
||||
|
||||
#if defined(FEAT_SYN_HL) && defined(FEAT_CONCEAL)
|
||||
lnum = get_tv_lnum(argvars); /* -1 on type error */
|
||||
@@ -11898,8 +11902,7 @@ f_synstack(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
int id;
|
||||
#endif
|
||||
|
||||
rettv->v_type = VAR_LIST;
|
||||
rettv->vval.v_list = NULL;
|
||||
rettv_list_set(rettv, NULL);
|
||||
|
||||
#ifdef FEAT_SYN_HL
|
||||
lnum = get_tv_lnum(argvars); /* -1 on type error */
|
||||
@@ -12065,9 +12068,7 @@ get_cmd_output_as_rettv(
|
||||
list_append(list, li);
|
||||
}
|
||||
|
||||
++list->lv_refcount;
|
||||
rettv->v_type = VAR_LIST;
|
||||
rettv->vval.v_list = list;
|
||||
rettv_list_set(rettv, list);
|
||||
list = NULL;
|
||||
}
|
||||
else
|
||||
@@ -12473,8 +12474,7 @@ f_test_null_channel(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
static void
|
||||
f_test_null_dict(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
{
|
||||
rettv->v_type = VAR_DICT;
|
||||
rettv->vval.v_dict = NULL;
|
||||
rettv_dict_set(rettv, NULL);
|
||||
}
|
||||
|
||||
#ifdef FEAT_JOB_CHANNEL
|
||||
@@ -12489,8 +12489,7 @@ f_test_null_job(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
static void
|
||||
f_test_null_list(typval_T *argvars UNUSED, typval_T *rettv)
|
||||
{
|
||||
rettv->v_type = VAR_LIST;
|
||||
rettv->vval.v_list = NULL;
|
||||
rettv_list_set(rettv, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
/* Automatically generated code by create_cmdidxs.vim
|
||||
*
|
||||
* Table giving the index of the first command in cmdnames[] to lookup
|
||||
* based on the first letter of a command.
|
||||
*/
|
||||
static const unsigned short cmdidxs1[26] =
|
||||
{
|
||||
/* 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 */ { 2, 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 */ { 3, 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 */ { 1, 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 */ { 5, 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 */ { 1, 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 */ { 3, 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 */ { 1, 0, 0, 0, 9, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18 },
|
||||
/* 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 */ { 1, 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 */ { 2, 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 */ { 2, 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 */ { 2, 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 */ { 2, 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 */ { 1, 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;
|
||||
+14
-3
@@ -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;
|
||||
@@ -4659,6 +4664,8 @@ ex_z(exarg_T *eap)
|
||||
|
||||
if (curs > curbuf->b_ml.ml_line_count)
|
||||
curs = curbuf->b_ml.ml_line_count;
|
||||
else if (curs < 1)
|
||||
curs = 1;
|
||||
|
||||
for (i = start; i <= end; i++)
|
||||
{
|
||||
@@ -4681,7 +4688,11 @@ ex_z(exarg_T *eap)
|
||||
}
|
||||
}
|
||||
|
||||
curwin->w_cursor.lnum = curs;
|
||||
if (curwin->w_cursor.lnum != curs)
|
||||
{
|
||||
curwin->w_cursor.lnum = curs;
|
||||
curwin->w_cursor.col = 0;
|
||||
}
|
||||
ex_no_reprint = TRUE;
|
||||
}
|
||||
|
||||
|
||||
+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,
|
||||
|
||||
+4
-75
@@ -501,81 +501,7 @@ static void ex_folddo(exarg_T *eap);
|
||||
*/
|
||||
#define DO_DECLARE_EXCMD
|
||||
#include "ex_cmds.h"
|
||||
|
||||
/* 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 const unsigned short cmdidxs1[26] =
|
||||
{
|
||||
/* 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 */
|
||||
#include "ex_cmdidxs.h"
|
||||
|
||||
static char_u dollar_command[2] = {'$', 0};
|
||||
|
||||
@@ -3053,7 +2979,10 @@ do_one_cmd(
|
||||
|
||||
doend:
|
||||
if (curwin->w_cursor.lnum == 0) /* can happen with zero line number */
|
||||
{
|
||||
curwin->w_cursor.lnum = 1;
|
||||
curwin->w_cursor.col = 0;
|
||||
}
|
||||
|
||||
if (errormsg != NULL && *errormsg != NUL && !did_emsg)
|
||||
{
|
||||
|
||||
+14
-7
@@ -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
|
||||
@@ -3347,11 +3347,18 @@ cmdline_del(int from)
|
||||
*/
|
||||
void
|
||||
redrawcmdline(void)
|
||||
{
|
||||
redrawcmdline_ex(TRUE);
|
||||
}
|
||||
|
||||
void
|
||||
redrawcmdline_ex(int do_compute_cmdrow)
|
||||
{
|
||||
if (cmd_silent)
|
||||
return;
|
||||
need_wait_return = FALSE;
|
||||
compute_cmdrow();
|
||||
if (do_compute_cmdrow)
|
||||
compute_cmdrow();
|
||||
redrawcmd();
|
||||
cursorcmd();
|
||||
}
|
||||
@@ -4158,7 +4165,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 +6817,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 +6862,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 +6879,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)
|
||||
{
|
||||
|
||||
+11
-5
@@ -2928,7 +2928,7 @@ foldRemove(garray_T *gap, linenr_T top, linenr_T bot)
|
||||
{
|
||||
/* 2: or 3: need to delete nested folds */
|
||||
foldRemove(&fp->fd_nested, top - fp->fd_top, bot - fp->fd_top);
|
||||
if (fp->fd_top + fp->fd_len > bot + 1)
|
||||
if (fp->fd_top + fp->fd_len - 1 > bot)
|
||||
{
|
||||
/* 3: need to split it. */
|
||||
foldSplit(gap, (int)(fp - (fold_T *)gap->ga_data), top, bot);
|
||||
@@ -2970,10 +2970,12 @@ foldRemove(garray_T *gap, linenr_T top, linenr_T bot)
|
||||
|
||||
/* foldReverseOrder() {{{2 */
|
||||
static void
|
||||
foldReverseOrder(garray_T *gap, linenr_T start, linenr_T end)
|
||||
foldReverseOrder(garray_T *gap, linenr_T start_arg, linenr_T end_arg)
|
||||
{
|
||||
fold_T *left, *right;
|
||||
fold_T tmp;
|
||||
linenr_T start = start_arg;
|
||||
linenr_T end = end_arg;
|
||||
|
||||
for (; start < end; start++, end--)
|
||||
{
|
||||
@@ -3133,10 +3135,14 @@ foldMoveRange(garray_T *gap, linenr_T line1, linenr_T line2, linenr_T dest)
|
||||
dest_index = fold_index(fp, gap);
|
||||
|
||||
/*
|
||||
* All folds are now correct, but they are not necessarily in the correct
|
||||
* order. We have to swap folds in the range [move_end, dest_index) with
|
||||
* those in the range [move_start, move_end).
|
||||
* All folds are now correct, but not necessarily in the correct order. We
|
||||
* must swap folds in the range [move_end, dest_index) with those in the
|
||||
* range [move_start, move_end).
|
||||
*/
|
||||
if (move_end == 0)
|
||||
/* There are no folds after those moved, hence no folds have been moved
|
||||
* out of order. */
|
||||
return;
|
||||
foldReverseOrder(gap, (linenr_T)move_start, (linenr_T)dest_index - 1);
|
||||
foldReverseOrder(gap, (linenr_T)move_start,
|
||||
(linenr_T)(move_start + dest_index - move_end - 1));
|
||||
|
||||
+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;
|
||||
|
||||
@@ -97,6 +97,7 @@ EXTERN int cmdline_row;
|
||||
EXTERN int redraw_cmdline INIT(= FALSE); /* cmdline must be redrawn */
|
||||
EXTERN int clear_cmdline INIT(= FALSE); /* cmdline must be cleared */
|
||||
EXTERN int mode_displayed INIT(= FALSE); /* mode is being displayed */
|
||||
EXTERN int no_win_do_lines_ins INIT(= FALSE); /* don't insert lines */
|
||||
#if defined(FEAT_CRYPT) || defined(FEAT_EVAL)
|
||||
EXTERN int cmdline_star INIT(= FALSE); /* cmdline is crypted */
|
||||
#endif
|
||||
|
||||
@@ -92,11 +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,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);
|
||||
@@ -370,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);
|
||||
@@ -845,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.
|
||||
@@ -879,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
|
||||
@@ -999,16 +978,6 @@ gtk_form_position_children(GtkForm *form)
|
||||
gtk_form_position_child(form, tmp_list->data, FALSE);
|
||||
}
|
||||
|
||||
#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)
|
||||
|
||||
+15
-1
@@ -2627,7 +2627,9 @@ gui_mch_set_curtab(int nr)
|
||||
void
|
||||
ex_simalt(exarg_T *eap)
|
||||
{
|
||||
char_u *keys = eap->arg;
|
||||
char_u *keys = eap->arg;
|
||||
int fill_typebuf = FALSE;
|
||||
char_u key_name[4];
|
||||
|
||||
PostMessage(s_hwnd, WM_SYSCOMMAND, (WPARAM)SC_KEYMENU, (LPARAM)0);
|
||||
while (*keys)
|
||||
@@ -2636,6 +2638,18 @@ ex_simalt(exarg_T *eap)
|
||||
*keys = ' '; /* for showing system menu */
|
||||
PostMessage(s_hwnd, WM_CHAR, (WPARAM)*keys, (LPARAM)0);
|
||||
keys++;
|
||||
fill_typebuf = TRUE;
|
||||
}
|
||||
if (fill_typebuf)
|
||||
{
|
||||
/* Put a NOP in the typeahead buffer so that the message will get
|
||||
* processed. */
|
||||
key_name[0] = K_SPECIAL;
|
||||
key_name[1] = KS_EXTRA;
|
||||
key_name[2] = KE_NOP;
|
||||
key_name[3] = NUL;
|
||||
typebuf_was_filled = TRUE;
|
||||
(void)ins_typebuf(key_name, REMAP_NONE, 0, TRUE, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-6
@@ -1136,9 +1136,7 @@ perl_to_vim(SV *sv, typval_T *rettv)
|
||||
}
|
||||
}
|
||||
|
||||
list->lv_refcount++;
|
||||
rettv->v_type = VAR_LIST;
|
||||
rettv->vval.v_list = list;
|
||||
rettv_list_set(rettv, list);
|
||||
break;
|
||||
}
|
||||
case SVt_PVHV: /* dictionary */
|
||||
@@ -1192,9 +1190,7 @@ perl_to_vim(SV *sv, typval_T *rettv)
|
||||
}
|
||||
}
|
||||
|
||||
dict->dv_refcount++;
|
||||
rettv->v_type = VAR_DICT;
|
||||
rettv->vval.v_dict = dict;
|
||||
rettv_dict_set(rettv, dict);
|
||||
break;
|
||||
}
|
||||
default: /* not convertible */
|
||||
|
||||
+501
@@ -0,0 +1,501 @@
|
||||
#!/bin/sh
|
||||
# install - install a program, script, or datafile
|
||||
|
||||
scriptversion=2013-12-25.23; # UTC
|
||||
|
||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||
# following copyright and license.
|
||||
#
|
||||
# Copyright (C) 1994 X Consortium
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
||||
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# Except as contained in this notice, the name of the X Consortium shall not
|
||||
# be used in advertising or otherwise to promote the sale, use or other deal-
|
||||
# ings in this Software without prior written authorization from the X Consor-
|
||||
# tium.
|
||||
#
|
||||
#
|
||||
# FSF changes to this file are in the public domain.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# 'make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch.
|
||||
|
||||
tab=' '
|
||||
nl='
|
||||
'
|
||||
IFS=" $tab$nl"
|
||||
|
||||
# Set DOITPROG to "echo" to test this script.
|
||||
|
||||
doit=${DOITPROG-}
|
||||
doit_exec=${doit:-exec}
|
||||
|
||||
# Put in absolute file names if you don't have them in your path;
|
||||
# or use environment vars.
|
||||
|
||||
chgrpprog=${CHGRPPROG-chgrp}
|
||||
chmodprog=${CHMODPROG-chmod}
|
||||
chownprog=${CHOWNPROG-chown}
|
||||
cmpprog=${CMPPROG-cmp}
|
||||
cpprog=${CPPROG-cp}
|
||||
mkdirprog=${MKDIRPROG-mkdir}
|
||||
mvprog=${MVPROG-mv}
|
||||
rmprog=${RMPROG-rm}
|
||||
stripprog=${STRIPPROG-strip}
|
||||
|
||||
posix_mkdir=
|
||||
|
||||
# Desired mode of installed file.
|
||||
mode=0755
|
||||
|
||||
chgrpcmd=
|
||||
chmodcmd=$chmodprog
|
||||
chowncmd=
|
||||
mvcmd=$mvprog
|
||||
rmcmd="$rmprog -f"
|
||||
stripcmd=
|
||||
|
||||
src=
|
||||
dst=
|
||||
dir_arg=
|
||||
dst_arg=
|
||||
|
||||
copy_on_change=false
|
||||
is_target_a_directory=possibly
|
||||
|
||||
usage="\
|
||||
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
||||
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
||||
or: $0 [OPTION]... -d DIRECTORIES...
|
||||
|
||||
In the 1st form, copy SRCFILE to DSTFILE.
|
||||
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
||||
In the 4th, create DIRECTORIES.
|
||||
|
||||
Options:
|
||||
--help display this help and exit.
|
||||
--version display version info and exit.
|
||||
|
||||
-c (ignored)
|
||||
-C install only if different (preserve the last data modification time)
|
||||
-d create directories instead of installing files.
|
||||
-g GROUP $chgrpprog installed files to GROUP.
|
||||
-m MODE $chmodprog installed files to MODE.
|
||||
-o USER $chownprog installed files to USER.
|
||||
-s $stripprog installed files.
|
||||
-t DIRECTORY install into DIRECTORY.
|
||||
-T report an error if DSTFILE is a directory.
|
||||
|
||||
Environment variables override the default commands:
|
||||
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
|
||||
RMPROG STRIPPROG
|
||||
"
|
||||
|
||||
while test $# -ne 0; do
|
||||
case $1 in
|
||||
-c) ;;
|
||||
|
||||
-C) copy_on_change=true;;
|
||||
|
||||
-d) dir_arg=true;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift;;
|
||||
|
||||
--help) echo "$usage"; exit $?;;
|
||||
|
||||
-m) mode=$2
|
||||
case $mode in
|
||||
*' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
|
||||
echo "$0: invalid mode: $mode" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
shift;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift;;
|
||||
|
||||
-s) stripcmd=$stripprog;;
|
||||
|
||||
-t)
|
||||
is_target_a_directory=always
|
||||
dst_arg=$2
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $dst_arg in
|
||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
||||
esac
|
||||
shift;;
|
||||
|
||||
-T) is_target_a_directory=never;;
|
||||
|
||||
--version) echo "$0 $scriptversion"; exit $?;;
|
||||
|
||||
--) shift
|
||||
break;;
|
||||
|
||||
-*) echo "$0: invalid option: $1" >&2
|
||||
exit 1;;
|
||||
|
||||
*) break;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
# We allow the use of options -d and -T together, by making -d
|
||||
# take the precedence; this is for compatibility with GNU install.
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
if test -n "$dst_arg"; then
|
||||
echo "$0: target directory not allowed when installing a directory." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
||||
# When -d is used, all remaining arguments are directories to create.
|
||||
# When -t is used, the destination is already specified.
|
||||
# Otherwise, the last argument is the destination. Remove it from $@.
|
||||
for arg
|
||||
do
|
||||
if test -n "$dst_arg"; then
|
||||
# $@ is not empty: it contains at least $arg.
|
||||
set fnord "$@" "$dst_arg"
|
||||
shift # fnord
|
||||
fi
|
||||
shift # arg
|
||||
dst_arg=$arg
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $dst_arg in
|
||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
||||
if test $# -eq 0; then
|
||||
if test -z "$dir_arg"; then
|
||||
echo "$0: no input file specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
# It's OK to call 'install-sh -d' without argument.
|
||||
# This can happen when creating conditional directories.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if test -z "$dir_arg"; then
|
||||
if test $# -gt 1 || test "$is_target_a_directory" = always; then
|
||||
if test ! -d "$dst_arg"; then
|
||||
echo "$0: $dst_arg: Is not a directory." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$dir_arg"; then
|
||||
do_exit='(exit $ret); exit $ret'
|
||||
trap "ret=129; $do_exit" 1
|
||||
trap "ret=130; $do_exit" 2
|
||||
trap "ret=141; $do_exit" 13
|
||||
trap "ret=143; $do_exit" 15
|
||||
|
||||
# Set umask so as not to create temps with too-generous modes.
|
||||
# However, 'strip' requires both read and write access to temps.
|
||||
case $mode in
|
||||
# Optimize common cases.
|
||||
*644) cp_umask=133;;
|
||||
*755) cp_umask=22;;
|
||||
|
||||
*[0-7])
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw='% 200'
|
||||
fi
|
||||
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
|
||||
*)
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw=,u+rw
|
||||
fi
|
||||
cp_umask=$mode$u_plus_rw;;
|
||||
esac
|
||||
fi
|
||||
|
||||
for src
|
||||
do
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $src in
|
||||
-* | [=\(\)!]) src=./$src;;
|
||||
esac
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
dst=$src
|
||||
dstdir=$dst
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
||||
# might cause directories to be created, which would be especially bad
|
||||
# if $src (and thus $dsttmp) contains '*'.
|
||||
if test ! -f "$src" && test ! -d "$src"; then
|
||||
echo "$0: $src does not exist." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if test -z "$dst_arg"; then
|
||||
echo "$0: no destination specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
dst=$dst_arg
|
||||
|
||||
# If destination is a directory, append the input filename; won't work
|
||||
# if double slashes aren't ignored.
|
||||
if test -d "$dst"; then
|
||||
if test "$is_target_a_directory" = never; then
|
||||
echo "$0: $dst_arg: Is a directory" >&2
|
||||
exit 1
|
||||
fi
|
||||
dstdir=$dst
|
||||
dst=$dstdir/`basename "$src"`
|
||||
dstdir_status=0
|
||||
else
|
||||
dstdir=`dirname "$dst"`
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
fi
|
||||
fi
|
||||
|
||||
obsolete_mkdir_used=false
|
||||
|
||||
if test $dstdir_status != 0; then
|
||||
case $posix_mkdir in
|
||||
'')
|
||||
# Create intermediate dirs using mode 755 as modified by the umask.
|
||||
# This is like FreeBSD 'install' as of 1997-10-28.
|
||||
umask=`umask`
|
||||
case $stripcmd.$umask in
|
||||
# Optimize common cases.
|
||||
*[2367][2367]) mkdir_umask=$umask;;
|
||||
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
|
||||
|
||||
*[0-7])
|
||||
mkdir_umask=`expr $umask + 22 \
|
||||
- $umask % 100 % 40 + $umask % 20 \
|
||||
- $umask % 10 % 4 + $umask % 2
|
||||
`;;
|
||||
*) mkdir_umask=$umask,go-w;;
|
||||
esac
|
||||
|
||||
# With -d, create the new directory with the user-specified mode.
|
||||
# Otherwise, rely on $mkdir_umask.
|
||||
if test -n "$dir_arg"; then
|
||||
mkdir_mode=-m$mode
|
||||
else
|
||||
mkdir_mode=
|
||||
fi
|
||||
|
||||
posix_mkdir=false
|
||||
case $umask in
|
||||
*[123567][0-7][0-7])
|
||||
# POSIX mkdir -p sets u+wx bits regardless of umask, which
|
||||
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
|
||||
;;
|
||||
*)
|
||||
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
||||
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
|
||||
|
||||
if (umask $mkdir_umask &&
|
||||
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
|
||||
then
|
||||
if test -z "$dir_arg" || {
|
||||
# Check for POSIX incompatibilities with -m.
|
||||
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||
# other-writable bit of parent directory when it shouldn't.
|
||||
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||
ls_ld_tmpdir=`ls -ld "$tmpdir"`
|
||||
case $ls_ld_tmpdir in
|
||||
d????-?r-*) different_mode=700;;
|
||||
d????-?--*) different_mode=755;;
|
||||
*) false;;
|
||||
esac &&
|
||||
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
|
||||
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
|
||||
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
||||
}
|
||||
}
|
||||
then posix_mkdir=:
|
||||
fi
|
||||
rmdir "$tmpdir/d" "$tmpdir"
|
||||
else
|
||||
# Remove any dirs left behind by ancient mkdir implementations.
|
||||
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
|
||||
fi
|
||||
trap '' 0;;
|
||||
esac;;
|
||||
esac
|
||||
|
||||
if
|
||||
$posix_mkdir && (
|
||||
umask $mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
||||
)
|
||||
then :
|
||||
else
|
||||
|
||||
# The umask is ridiculous, or mkdir does not conform to POSIX,
|
||||
# or it failed possibly due to a race condition. Create the
|
||||
# directory the slow way, step by step, checking for races as we go.
|
||||
|
||||
case $dstdir in
|
||||
/*) prefix='/';;
|
||||
[-=\(\)!]*) prefix='./';;
|
||||
*) prefix='';;
|
||||
esac
|
||||
|
||||
oIFS=$IFS
|
||||
IFS=/
|
||||
set -f
|
||||
set fnord $dstdir
|
||||
shift
|
||||
set +f
|
||||
IFS=$oIFS
|
||||
|
||||
prefixes=
|
||||
|
||||
for d
|
||||
do
|
||||
test X"$d" = X && continue
|
||||
|
||||
prefix=$prefix$d
|
||||
if test -d "$prefix"; then
|
||||
prefixes=
|
||||
else
|
||||
if $posix_mkdir; then
|
||||
(umask=$mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
||||
# Don't fail if two instances are running concurrently.
|
||||
test -d "$prefix" || exit 1
|
||||
else
|
||||
case $prefix in
|
||||
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
||||
*) qprefix=$prefix;;
|
||||
esac
|
||||
prefixes="$prefixes '$qprefix'"
|
||||
fi
|
||||
fi
|
||||
prefix=$prefix/
|
||||
done
|
||||
|
||||
if test -n "$prefixes"; then
|
||||
# Don't fail if two instances are running concurrently.
|
||||
(umask $mkdir_umask &&
|
||||
eval "\$doit_exec \$mkdirprog $prefixes") ||
|
||||
test -d "$dstdir" || exit 1
|
||||
obsolete_mkdir_used=true
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
|
||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
|
||||
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
|
||||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
|
||||
else
|
||||
|
||||
# Make a couple of temp file names in the proper directory.
|
||||
dsttmp=$dstdir/_inst.$$_
|
||||
rmtmp=$dstdir/_rm.$$_
|
||||
|
||||
# Trap to clean up those temp files at exit.
|
||||
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
||||
|
||||
# Copy the file name to the temp name.
|
||||
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits.
|
||||
#
|
||||
# If any of these fail, we abort the whole thing. If we want to
|
||||
# ignore errors from any of these, just make sure not to ignore
|
||||
# errors from the above "$doit $cpprog $src $dsttmp" command.
|
||||
#
|
||||
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
|
||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
|
||||
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
|
||||
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
|
||||
|
||||
# If -C, don't bother to copy if it wouldn't change the file.
|
||||
if $copy_on_change &&
|
||||
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
|
||||
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
|
||||
set -f &&
|
||||
set X $old && old=:$2:$4:$5:$6 &&
|
||||
set X $new && new=:$2:$4:$5:$6 &&
|
||||
set +f &&
|
||||
test "$old" = "$new" &&
|
||||
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
|
||||
then
|
||||
rm -f "$dsttmp"
|
||||
else
|
||||
# Rename the file to the real destination.
|
||||
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
|
||||
|
||||
# The rename failed, perhaps because mv can't rename something else
|
||||
# to itself, or perhaps because mv is so ancient that it does not
|
||||
# support -f.
|
||||
{
|
||||
# Now remove or move aside any old file at destination location.
|
||||
# We try this two ways since rm can't unlink itself on some
|
||||
# systems and the destination file might be busy for other
|
||||
# reasons. In this case, the final cleanup might fail but the new
|
||||
# file should still install successfully.
|
||||
{
|
||||
test ! -f "$dst" ||
|
||||
$doit $rmcmd -f "$dst" 2>/dev/null ||
|
||||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
|
||||
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
|
||||
} ||
|
||||
{ echo "$0: cannot unlink or rename $dst" >&2
|
||||
(exit 1); exit 1
|
||||
}
|
||||
} &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dst"
|
||||
}
|
||||
fi || exit 1
|
||||
|
||||
trap '' 0
|
||||
fi
|
||||
done
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
+1
-1
@@ -39,7 +39,7 @@ tutorsubloc=$scriptloc/tutor
|
||||
if test $what = "install" -o $what = "xxd"; then
|
||||
if test ! -d $destdir; then
|
||||
echo creating $destdir
|
||||
./mkinstalldirs $destdir
|
||||
/bin/sh install-sh -c -d $destdir
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ eviewname=$9
|
||||
if test $what = "install" -a \( -f $destdir/$vimname.1 -o -f $destdir/$vimdiffname.1 -o -f $destdir/$eviewname.1 \); then
|
||||
if test ! -d $destdir; then
|
||||
echo creating $destdir
|
||||
./mkinstalldirs $destdir
|
||||
/bin/sh install-sh -c -d $destdir
|
||||
fi
|
||||
|
||||
# ex
|
||||
|
||||
+14
-8
@@ -97,13 +97,23 @@ rettv_list_alloc(typval_T *rettv)
|
||||
if (l == NULL)
|
||||
return FAIL;
|
||||
|
||||
rettv->vval.v_list = l;
|
||||
rettv->v_type = VAR_LIST;
|
||||
rettv->v_lock = 0;
|
||||
++l->lv_refcount;
|
||||
rettv_list_set(rettv, l);
|
||||
return OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set a list as the return value
|
||||
*/
|
||||
void
|
||||
rettv_list_set(typval_T *rettv, list_T *l)
|
||||
{
|
||||
rettv->v_type = VAR_LIST;
|
||||
rettv->vval.v_list = l;
|
||||
if (l != NULL)
|
||||
++l->lv_refcount;
|
||||
}
|
||||
|
||||
/*
|
||||
* Unreference a list: decrement the reference count and free it when it
|
||||
* becomes zero.
|
||||
@@ -875,11 +885,7 @@ failret:
|
||||
|
||||
*arg = skipwhite(*arg + 1);
|
||||
if (evaluate)
|
||||
{
|
||||
rettv->v_type = VAR_LIST;
|
||||
rettv->vval.v_list = l;
|
||||
++l->lv_refcount;
|
||||
}
|
||||
rettv_list_set(rettv, l);
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
+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
|
||||
|
||||
@@ -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;
|
||||
|
||||
+12
-2
@@ -9257,7 +9257,8 @@ find_match(int lookfor, linenr_T ourscope)
|
||||
int
|
||||
get_expr_indent(void)
|
||||
{
|
||||
int indent;
|
||||
int indent = -1;
|
||||
char_u *inde_copy;
|
||||
pos_T save_pos;
|
||||
colnr_T save_curswant;
|
||||
int save_set_curswant;
|
||||
@@ -9274,7 +9275,16 @@ get_expr_indent(void)
|
||||
if (use_sandbox)
|
||||
++sandbox;
|
||||
++textlock;
|
||||
indent = (int)eval_to_number(curbuf->b_p_inde);
|
||||
|
||||
/* Need to make a copy, the 'indentexpr' option could be changed while
|
||||
* evaluating it. */
|
||||
inde_copy = vim_strsave(curbuf->b_p_inde);
|
||||
if (inde_copy != NULL)
|
||||
{
|
||||
indent = (int)eval_to_number(inde_copy);
|
||||
vim_free(inde_copy);
|
||||
}
|
||||
|
||||
if (use_sandbox)
|
||||
--sandbox;
|
||||
--textlock;
|
||||
|
||||
+1
-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)
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
#! /bin/sh
|
||||
# mkinstalldirs --- make directory hierarchy
|
||||
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
|
||||
# Created: 1993-05-16
|
||||
# Public domain
|
||||
|
||||
errstatus=0
|
||||
|
||||
for file
|
||||
do
|
||||
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
|
||||
shift
|
||||
|
||||
pathcomp=
|
||||
for d
|
||||
do
|
||||
pathcomp="$pathcomp$d"
|
||||
case "$pathcomp" in
|
||||
-* ) pathcomp=./$pathcomp ;;
|
||||
esac
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
echo "mkdir $pathcomp" 1>&2
|
||||
|
||||
mkdir "$pathcomp" || lasterr=$?
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
errstatus=$lasterr
|
||||
fi
|
||||
fi
|
||||
|
||||
pathcomp="$pathcomp/"
|
||||
done
|
||||
done
|
||||
|
||||
exit $errstatus
|
||||
|
||||
# mkinstalldirs ends here
|
||||
@@ -4376,7 +4376,12 @@ find_decl(
|
||||
if ((pos = findmatchlimit(NULL, '}', FM_FORWARD,
|
||||
(int)(old_pos.lnum - curwin->w_cursor.lnum + 1))) != NULL
|
||||
&& pos->lnum < old_pos.lnum)
|
||||
{
|
||||
/* There can't be a useful match before the end of this block.
|
||||
* Skip to the end. */
|
||||
curwin->w_cursor = *pos;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (t == FAIL)
|
||||
@@ -8345,6 +8350,7 @@ nv_g_cmd(cmdarg_T *cap)
|
||||
break;
|
||||
#endif
|
||||
|
||||
/* "g<": show scrollback text */
|
||||
case '<':
|
||||
show_sb_text();
|
||||
break;
|
||||
|
||||
+3
-2
@@ -3271,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)
|
||||
@@ -6528,7 +6529,7 @@ did_set_string_option(
|
||||
#if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
|
||||
else if (varp == &p_imak)
|
||||
{
|
||||
if (gui.in_use && !im_xim_isvalid_imactivate())
|
||||
if (!im_xim_isvalid_imactivate())
|
||||
errmsg = e_invarg;
|
||||
}
|
||||
#endif
|
||||
@@ -11285,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
|
||||
|
||||
+8
-2
@@ -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);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/* dict.c */
|
||||
dict_T *dict_alloc(void);
|
||||
int rettv_dict_alloc(typval_T *rettv);
|
||||
void rettv_dict_set(typval_T *rettv, dict_T *d);
|
||||
void dict_unref(dict_T *d);
|
||||
int dict_free_nonref(int copyID);
|
||||
void dict_free_items(int copyID);
|
||||
|
||||
@@ -19,6 +19,7 @@ char_u *save_cmdline_alloc(void);
|
||||
void restore_cmdline_alloc(char_u *p);
|
||||
void cmdline_paste_str(char_u *s, int literally);
|
||||
void redrawcmdline(void);
|
||||
void redrawcmdline_ex(int do_compute_cmdrow);
|
||||
void redrawcmd(void);
|
||||
void compute_cmdrow(void);
|
||||
void gotocmdline(int clr);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -4,6 +4,7 @@ void list_rem_watch(list_T *l, listwatch_T *lwrem);
|
||||
void list_fix_watch(list_T *l, listitem_T *item);
|
||||
list_T *list_alloc(void);
|
||||
int rettv_list_alloc(typval_T *rettv);
|
||||
void rettv_list_set(typval_T *rettv, list_T *l);
|
||||
void list_unref(list_T *l);
|
||||
int list_free_nonref(int copyID);
|
||||
void list_free_items(int copyID);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -29,6 +29,7 @@ void ex_vimgrep(exarg_T *eap);
|
||||
int get_errorlist(win_T *wp, int qf_idx, list_T *list);
|
||||
int get_errorlist_properties(win_T *wp, dict_T *what, dict_T *retdict);
|
||||
int set_errorlist(win_T *wp, list_T *list, int action, char_u *title, dict_T *what);
|
||||
int set_ref_in_quickfix(int copyID);
|
||||
void ex_cbuffer(exarg_T *eap);
|
||||
void ex_cexpr(exarg_T *eap);
|
||||
void ex_helpgrep(exarg_T *eap);
|
||||
|
||||
@@ -5,11 +5,12 @@ void redraw_later_clear(void);
|
||||
void redraw_all_later(int type);
|
||||
void redraw_curbuf_later(int type);
|
||||
void redraw_buf_later(buf_T *buf, int type);
|
||||
void redraw_buf_and_status_later(buf_T *buf, int type);
|
||||
int redraw_asap(int type);
|
||||
void redraw_after_callback(void);
|
||||
void redrawWinline(linenr_T lnum, int invalid);
|
||||
void update_curbuf(int type);
|
||||
void update_screen(int type);
|
||||
void update_screen(int type_arg);
|
||||
int conceal_cursor_line(win_T *wp);
|
||||
void conceal_check_cursur_line(void);
|
||||
void update_single_line(win_T *wp, linenr_T lnum);
|
||||
|
||||
@@ -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);
|
||||
|
||||
+155
@@ -57,6 +57,7 @@ typedef struct qf_list_S
|
||||
int qf_nonevalid; /* TRUE if not a single valid entry found */
|
||||
char_u *qf_title; /* title derived from the command that created
|
||||
* the error list */
|
||||
typval_T *qf_ctx; /* context set by setqflist/setloclist */
|
||||
} qf_list_T;
|
||||
|
||||
struct qf_info_S
|
||||
@@ -1596,6 +1597,14 @@ copy_loclist(win_T *from, win_T *to)
|
||||
to_qfl->qf_title = vim_strsave(from_qfl->qf_title);
|
||||
else
|
||||
to_qfl->qf_title = NULL;
|
||||
if (from_qfl->qf_ctx != NULL)
|
||||
{
|
||||
to_qfl->qf_ctx = alloc_tv();
|
||||
if (to_qfl->qf_ctx != NULL)
|
||||
copy_tv(from_qfl->qf_ctx, to_qfl->qf_ctx);
|
||||
}
|
||||
else
|
||||
to_qfl->qf_ctx = NULL;
|
||||
|
||||
if (from_qfl->qf_count)
|
||||
{
|
||||
@@ -2749,12 +2758,21 @@ qf_free(qf_info_T *qi, int idx)
|
||||
}
|
||||
vim_free(qi->qf_lists[idx].qf_title);
|
||||
qi->qf_lists[idx].qf_title = NULL;
|
||||
free_tv(qi->qf_lists[idx].qf_ctx);
|
||||
qi->qf_lists[idx].qf_ctx = NULL;
|
||||
qi->qf_lists[idx].qf_index = 0;
|
||||
qi->qf_lists[idx].qf_start = NULL;
|
||||
qi->qf_lists[idx].qf_last = NULL;
|
||||
qi->qf_lists[idx].qf_ptr = NULL;
|
||||
qi->qf_lists[idx].qf_nonevalid = TRUE;
|
||||
|
||||
qf_clean_dir_stack(&qi->qf_dir_stack);
|
||||
qi->qf_directory = NULL;
|
||||
qf_clean_dir_stack(&qi->qf_file_stack);
|
||||
qi->qf_currfile = NULL;
|
||||
qi->qf_multiline = FALSE;
|
||||
qi->qf_multiignore = FALSE;
|
||||
qi->qf_multiscan = FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -4622,6 +4640,7 @@ enum {
|
||||
QF_GETLIST_ITEMS = 0x2,
|
||||
QF_GETLIST_NR = 0x4,
|
||||
QF_GETLIST_WINID = 0x8,
|
||||
QF_GETLIST_CONTEXT = 0x10,
|
||||
QF_GETLIST_ALL = 0xFF
|
||||
};
|
||||
|
||||
@@ -4674,6 +4693,9 @@ get_errorlist_properties(win_T *wp, dict_T *what, dict_T *retdict)
|
||||
if (dict_find(what, (char_u *)"winid", -1) != NULL)
|
||||
flags |= QF_GETLIST_WINID;
|
||||
|
||||
if (dict_find(what, (char_u *)"context", -1) != NULL)
|
||||
flags |= QF_GETLIST_CONTEXT;
|
||||
|
||||
if (flags & QF_GETLIST_TITLE)
|
||||
{
|
||||
char_u *t;
|
||||
@@ -4692,6 +4714,22 @@ get_errorlist_properties(win_T *wp, dict_T *what, dict_T *retdict)
|
||||
status = dict_add_nr_str(retdict, "winid", win->w_id, NULL);
|
||||
}
|
||||
|
||||
if ((status == OK) && (flags & QF_GETLIST_CONTEXT))
|
||||
{
|
||||
if (qi->qf_lists[qf_idx].qf_ctx != NULL)
|
||||
{
|
||||
di = dictitem_alloc((char_u *)"context");
|
||||
if (di != NULL)
|
||||
{
|
||||
copy_tv(qi->qf_lists[qf_idx].qf_ctx, &di->di_tv);
|
||||
if (dict_add(retdict, di) == FAIL)
|
||||
dictitem_free(di);
|
||||
}
|
||||
}
|
||||
else
|
||||
status = dict_add_nr_str(retdict, "context", 0L, (char_u *)"");
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -4772,6 +4810,10 @@ qf_add_entries(
|
||||
bufnum = 0;
|
||||
}
|
||||
|
||||
/* If the 'valid' field is present it overrules the detected value. */
|
||||
if ((dict_find(d, (char_u *)"valid", -1)) != NULL)
|
||||
valid = (int)get_dict_number(d, (char_u *)"valid");
|
||||
|
||||
status = qf_add_entry(qi,
|
||||
NULL, /* dir */
|
||||
filename,
|
||||
@@ -4863,12 +4905,63 @@ qf_set_properties(qf_info_T *qi, dict_T *what, int action)
|
||||
}
|
||||
}
|
||||
|
||||
if ((di = dict_find(what, (char_u *)"context", -1)) != NULL)
|
||||
{
|
||||
typval_T *ctx;
|
||||
free_tv(qi->qf_lists[qi->qf_curlist].qf_ctx);
|
||||
ctx = alloc_tv();
|
||||
if (ctx != NULL)
|
||||
copy_tv(&di->di_tv, ctx);
|
||||
qi->qf_lists[qi->qf_curlist].qf_ctx = ctx;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
@@ -4876,6 +4969,22 @@ qf_free_stack(win_T *wp, qf_info_T *qi)
|
||||
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();
|
||||
|
||||
/* first free the list reference in the location list window */
|
||||
ll_free_all(&orig_wp->w_llist_ref);
|
||||
|
||||
orig_wp->w_llist_ref = new_ll;
|
||||
if (llwin != NULL)
|
||||
{
|
||||
llwin->w_llist = new_ll;
|
||||
new_ll->qf_refcount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -4913,6 +5022,52 @@ set_errorlist(
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int
|
||||
mark_quickfix_ctx(qf_info_T *qi, int copyID)
|
||||
{
|
||||
int i;
|
||||
int abort = FALSE;
|
||||
typval_T *ctx;
|
||||
|
||||
for (i = 0; i < LISTCOUNT && !abort; ++i)
|
||||
{
|
||||
ctx = qi->qf_lists[i].qf_ctx;
|
||||
if (ctx != NULL && ctx->v_type != VAR_NUMBER &&
|
||||
ctx->v_type != VAR_STRING && ctx->v_type != VAR_FLOAT)
|
||||
abort = set_ref_in_item(ctx, copyID, NULL, NULL);
|
||||
}
|
||||
|
||||
return abort;
|
||||
}
|
||||
|
||||
/*
|
||||
* Mark the context of the quickfix list and the location lists (if present) as
|
||||
* "in use". So that garabage collection doesn't free the context.
|
||||
*/
|
||||
int
|
||||
set_ref_in_quickfix(int copyID)
|
||||
{
|
||||
int abort = FALSE;
|
||||
tabpage_T *tp;
|
||||
win_T *win;
|
||||
|
||||
abort = mark_quickfix_ctx(&ql_info, copyID);
|
||||
if (abort)
|
||||
return abort;
|
||||
|
||||
FOR_ALL_TAB_WINDOWS(tp, win)
|
||||
{
|
||||
if (win->w_llist != NULL)
|
||||
{
|
||||
abort = mark_quickfix_ctx(win->w_llist, copyID);
|
||||
if (abort)
|
||||
return abort;
|
||||
}
|
||||
}
|
||||
|
||||
return abort;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
+66
-8
@@ -265,6 +265,23 @@ redraw_buf_later(buf_T *buf, int type)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
redraw_buf_and_status_later(buf_T *buf, int type)
|
||||
{
|
||||
win_T *wp;
|
||||
|
||||
FOR_ALL_WINDOWS(wp)
|
||||
{
|
||||
if (wp->w_buffer == buf)
|
||||
{
|
||||
redraw_win_later(wp, type);
|
||||
#ifdef FEAT_WINDOWS
|
||||
wp->w_redr_status = TRUE;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Redraw as soon as possible. When the command line is not scrolled redraw
|
||||
* right away and restore what was on the command line.
|
||||
@@ -421,10 +438,29 @@ redraw_after_callback(void)
|
||||
if (State == HITRETURN || State == ASKMORE)
|
||||
; /* do nothing */
|
||||
else if (State & CMDLINE)
|
||||
redrawcmdline();
|
||||
{
|
||||
/* Redrawing only works when the screen didn't scroll. */
|
||||
if (msg_scrolled == 0)
|
||||
{
|
||||
update_screen(0);
|
||||
compute_cmdrow();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Redraw in the same position, so that the user can continue
|
||||
* editing the command. */
|
||||
compute_cmdrow();
|
||||
if (cmdline_row > msg_scrolled)
|
||||
cmdline_row -= msg_scrolled;
|
||||
else
|
||||
cmdline_row = 0;
|
||||
}
|
||||
redrawcmdline_ex(FALSE);
|
||||
}
|
||||
else if (State & (NORMAL | INSERT))
|
||||
{
|
||||
update_screen(0);
|
||||
/* keep the command line if possible */
|
||||
update_screen(VALID_NO_UPDATE);
|
||||
setcursor();
|
||||
}
|
||||
cursor_on();
|
||||
@@ -476,7 +512,7 @@ redrawWinline(
|
||||
}
|
||||
|
||||
/*
|
||||
* update all windows that are editing the current buffer
|
||||
* Update all windows that are editing the current buffer.
|
||||
*/
|
||||
void
|
||||
update_curbuf(int type)
|
||||
@@ -490,8 +526,9 @@ update_curbuf(int type)
|
||||
* of stuff from Filemem to ScreenLines[], and update curwin->w_botline.
|
||||
*/
|
||||
void
|
||||
update_screen(int type)
|
||||
update_screen(int type_arg)
|
||||
{
|
||||
int type = type_arg;
|
||||
win_T *wp;
|
||||
static int did_intro = FALSE;
|
||||
#if defined(FEAT_SEARCH_EXTRA) || defined(FEAT_CLIPBOARD)
|
||||
@@ -502,11 +539,18 @@ update_screen(int type)
|
||||
int gui_cursor_col;
|
||||
int gui_cursor_row;
|
||||
#endif
|
||||
int no_update = FALSE;
|
||||
|
||||
/* Don't do anything if the screen structures are (not yet) valid. */
|
||||
if (!screen_valid(TRUE))
|
||||
return;
|
||||
|
||||
if (type == VALID_NO_UPDATE)
|
||||
{
|
||||
no_update = TRUE;
|
||||
type = 0;
|
||||
}
|
||||
|
||||
if (must_redraw)
|
||||
{
|
||||
if (type < must_redraw) /* use maximal type */
|
||||
@@ -539,6 +583,8 @@ update_screen(int type)
|
||||
++display_tick; /* let syntax code know we're in a next round of
|
||||
* display updating */
|
||||
#endif
|
||||
if (no_update)
|
||||
++no_win_do_lines_ins;
|
||||
|
||||
/*
|
||||
* if the screen was scrolled up when displaying a message, scroll it down
|
||||
@@ -576,7 +622,8 @@ update_screen(int type)
|
||||
}
|
||||
}
|
||||
}
|
||||
redraw_cmdline = TRUE;
|
||||
if (!no_update)
|
||||
redraw_cmdline = TRUE;
|
||||
#ifdef FEAT_WINDOWS
|
||||
redraw_tabline = TRUE;
|
||||
#endif
|
||||
@@ -748,6 +795,9 @@ update_screen(int type)
|
||||
if (clear_cmdline || redraw_cmdline)
|
||||
showmode();
|
||||
|
||||
if (no_update)
|
||||
--no_win_do_lines_ins;
|
||||
|
||||
/* May put up an introductory message when not editing a file */
|
||||
if (!did_intro)
|
||||
maybe_intro_message();
|
||||
@@ -9503,6 +9553,11 @@ win_do_lines(
|
||||
if (!redrawing() || line_count <= 0)
|
||||
return FAIL;
|
||||
|
||||
/* When inserting lines would result in loss of command output, just redraw
|
||||
* the lines. */
|
||||
if (no_win_do_lines_ins && !del)
|
||||
return FAIL;
|
||||
|
||||
/* only a few lines left: redraw is faster */
|
||||
if (mayclear && Rows - line_count < 5
|
||||
#ifdef FEAT_WINDOWS
|
||||
@@ -9510,7 +9565,8 @@ win_do_lines(
|
||||
#endif
|
||||
)
|
||||
{
|
||||
screenclear(); /* will set wp->w_lines_valid to 0 */
|
||||
if (!no_win_do_lines_ins)
|
||||
screenclear(); /* will set wp->w_lines_valid to 0 */
|
||||
return FAIL;
|
||||
}
|
||||
|
||||
@@ -9526,10 +9582,12 @@ win_do_lines(
|
||||
}
|
||||
|
||||
/*
|
||||
* when scrolling, the message on the command line should be cleared,
|
||||
* When scrolling, the message on the command line should be cleared,
|
||||
* otherwise it will stay there forever.
|
||||
* Don't do this when avoiding to insert lines.
|
||||
*/
|
||||
clear_cmdline = TRUE;
|
||||
if (!no_win_do_lines_ins)
|
||||
clear_cmdline = TRUE;
|
||||
|
||||
/*
|
||||
* If the terminal can set a scroll region, use that.
|
||||
|
||||
+20
-22
@@ -3123,7 +3123,7 @@ spell_iswordp(
|
||||
|
||||
if (has_mbyte)
|
||||
{
|
||||
l = MB_BYTE2LEN(*p);
|
||||
l = MB_PTR2LEN(p);
|
||||
s = p;
|
||||
if (l == 1)
|
||||
{
|
||||
@@ -3808,6 +3808,10 @@ spell_find_suggest(
|
||||
vim_strncpy(su->su_badword, su->su_badptr, su->su_badlen);
|
||||
(void)spell_casefold(su->su_badptr, su->su_badlen,
|
||||
su->su_fbadword, MAXWLEN);
|
||||
/* TODO: make this work if the case-folded text is longer than the original
|
||||
* text. Currently an illegal byte causes wrong pointer computations. */
|
||||
su->su_fbadword[su->su_badlen] = NUL;
|
||||
|
||||
/* get caps flags for bad word */
|
||||
su->su_badflags = badword_captype(su->su_badptr,
|
||||
su->su_badptr + su->su_badlen);
|
||||
@@ -4937,12 +4941,7 @@ suggest_trie_walk(
|
||||
{
|
||||
int l;
|
||||
|
||||
#ifdef FEAT_MBYTE
|
||||
if (has_mbyte)
|
||||
l = MB_BYTE2LEN(fword[sp->ts_fidx]);
|
||||
else
|
||||
#endif
|
||||
l = 1;
|
||||
l = MB_PTR2LEN(fword + sp->ts_fidx);
|
||||
if (fword_ends)
|
||||
{
|
||||
/* Copy the skipped character to preword. */
|
||||
@@ -5109,9 +5108,8 @@ suggest_trie_walk(
|
||||
/* Correct ts_fidx for the byte length of the
|
||||
* character (we didn't check that before). */
|
||||
sp->ts_fidx = sp->ts_fcharstart
|
||||
+ MB_BYTE2LEN(
|
||||
fword[sp->ts_fcharstart]);
|
||||
|
||||
+ MB_PTR2LEN(
|
||||
fword + sp->ts_fcharstart);
|
||||
/* For changing a composing character adjust
|
||||
* the score from SCORE_SUBST to
|
||||
* SCORE_SUBCOMP. */
|
||||
@@ -5232,7 +5230,7 @@ suggest_trie_walk(
|
||||
if (has_mbyte)
|
||||
{
|
||||
c = mb_ptr2char(fword + sp->ts_fidx);
|
||||
stack[depth].ts_fidx += MB_BYTE2LEN(fword[sp->ts_fidx]);
|
||||
stack[depth].ts_fidx += MB_PTR2LEN(fword + sp->ts_fidx);
|
||||
if (enc_utf8 && utf_iscomposing(c))
|
||||
stack[depth].ts_score -= SCORE_DEL - SCORE_DELCOMP;
|
||||
else if (c == mb_ptr2char(fword + stack[depth].ts_fidx))
|
||||
@@ -5456,9 +5454,9 @@ suggest_trie_walk(
|
||||
#ifdef FEAT_MBYTE
|
||||
if (has_mbyte)
|
||||
{
|
||||
n = MB_BYTE2LEN(*p);
|
||||
n = MB_PTR2LEN(p);
|
||||
c = mb_ptr2char(p + n);
|
||||
mch_memmove(p + MB_BYTE2LEN(p[n]), p, n);
|
||||
mch_memmove(p + MB_PTR2LEN(p + n), p, n);
|
||||
mb_char2bytes(c, p);
|
||||
}
|
||||
else
|
||||
@@ -5550,11 +5548,11 @@ suggest_trie_walk(
|
||||
#ifdef FEAT_MBYTE
|
||||
if (has_mbyte)
|
||||
{
|
||||
n = MB_BYTE2LEN(*p);
|
||||
n = MB_PTR2LEN(p);
|
||||
c2 = mb_ptr2char(p + n);
|
||||
fl = MB_BYTE2LEN(p[n]);
|
||||
fl = MB_PTR2LEN(p + n);
|
||||
c = mb_ptr2char(p + n + fl);
|
||||
tl = MB_BYTE2LEN(p[n + fl]);
|
||||
tl = MB_PTR2LEN(p + n + fl);
|
||||
mch_memmove(p + fl + tl, p, n);
|
||||
mb_char2bytes(c, p);
|
||||
mb_char2bytes(c2, p + tl);
|
||||
@@ -5627,10 +5625,10 @@ suggest_trie_walk(
|
||||
#ifdef FEAT_MBYTE
|
||||
if (has_mbyte)
|
||||
{
|
||||
n = MB_BYTE2LEN(*p);
|
||||
n += MB_BYTE2LEN(p[n]);
|
||||
n = MB_PTR2LEN(p);
|
||||
n += MB_PTR2LEN(p + n);
|
||||
c = mb_ptr2char(p + n);
|
||||
tl = MB_BYTE2LEN(p[n]);
|
||||
tl = MB_PTR2LEN(p + n);
|
||||
mch_memmove(p + tl, p, n);
|
||||
mb_char2bytes(c, p);
|
||||
}
|
||||
@@ -5693,9 +5691,9 @@ suggest_trie_walk(
|
||||
if (has_mbyte)
|
||||
{
|
||||
c = mb_ptr2char(p);
|
||||
tl = MB_BYTE2LEN(*p);
|
||||
n = MB_BYTE2LEN(p[tl]);
|
||||
n += MB_BYTE2LEN(p[tl + n]);
|
||||
tl = MB_PTR2LEN(p);
|
||||
n = MB_PTR2LEN(p + tl);
|
||||
n += MB_PTR2LEN(p + tl + n);
|
||||
mch_memmove(p, p + tl, n);
|
||||
mb_char2bytes(c, p + n);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -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;
|
||||
|
||||
+108
-28
@@ -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)
|
||||
{
|
||||
@@ -3130,15 +3187,19 @@ settmode(int tmode)
|
||||
#endif
|
||||
#ifdef FEAT_MOUSE_TTY
|
||||
if (tmode != TMODE_RAW)
|
||||
mch_setmouse(FALSE); /* switch mouse off */
|
||||
mch_setmouse(FALSE); /* switch mouse off */
|
||||
#endif
|
||||
if (tmode != TMODE_RAW)
|
||||
out_str(T_BD); /* disable bracketed paste mode */
|
||||
out_flush();
|
||||
mch_settmode(tmode); /* machine specific function */
|
||||
mch_settmode(tmode); /* machine specific function */
|
||||
cur_tmode = tmode;
|
||||
#ifdef FEAT_MOUSE
|
||||
if (tmode == TMODE_RAW)
|
||||
setmouse(); /* may switch mouse on */
|
||||
setmouse(); /* may switch mouse on */
|
||||
#endif
|
||||
if (tmode == TMODE_RAW)
|
||||
out_str(T_BE); /* enable bracketed paste mode */
|
||||
out_flush();
|
||||
}
|
||||
#ifdef FEAT_TERMRESPONSE
|
||||
@@ -3234,14 +3295,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 +3323,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 +3350,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 +3358,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 +3372,6 @@ may_req_bg_color(void)
|
||||
(void)vpeekc_nomap();
|
||||
}
|
||||
}
|
||||
# endif
|
||||
|
||||
# ifdef DEBUG_TERMRESPONSE
|
||||
static void
|
||||
@@ -4141,10 +4184,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 +4328,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 */
|
||||
|
||||
@@ -96,6 +96,7 @@ let test_values = {
|
||||
\ 'guifontwide': [['', 'fixedsys'], []],
|
||||
\ 'helplang': [['', 'de', 'de,it'], ['xxx']],
|
||||
\ 'highlight': [['', 'e:Error'], ['xxx']],
|
||||
\ 'imactivatekey': [['', 'S-space'], ['xxx']],
|
||||
\ 'isfname': [['', '@', '@,48-52'], ['xxx', '@48']],
|
||||
\ 'isident': [['', '@', '@,48-52'], ['xxx', '@48']],
|
||||
\ 'iskeyword': [['', '@', '@,48-52'], ['xxx', '@48']],
|
||||
|
||||
@@ -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
|
||||
@@ -30,9 +31,9 @@ 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
|
||||
|
||||
@@ -65,6 +65,10 @@ 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')
|
||||
@@ -412,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&
|
||||
|
||||
@@ -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,85 @@
|
||||
" 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_overflow()
|
||||
" This used to access invalid memory as a result of an integer overflow
|
||||
" and freeze vim.
|
||||
normal ox
|
||||
normal Heat
|
||||
z777777776666666
|
||||
')
|
||||
endfunc
|
||||
|
||||
func Test_z_negative_lnum()
|
||||
new
|
||||
z^
|
||||
call assert_equal(1, line('.'))
|
||||
bwipe!
|
||||
endfunc
|
||||
+52
-19
@@ -1,10 +1,10 @@
|
||||
" Test for folding
|
||||
|
||||
func! PrepIndent(arg)
|
||||
func PrepIndent(arg)
|
||||
return [a:arg] + repeat(["\t".a:arg], 5)
|
||||
endfu
|
||||
|
||||
func! Test_address_fold()
|
||||
func Test_address_fold()
|
||||
new
|
||||
call setline(1, ['int FuncName() {/*{{{*/', 1, 2, 3, 4, 5, '}/*}}}*/',
|
||||
\ 'after fold 1', 'after fold 2', 'after fold 3'])
|
||||
@@ -68,17 +68,7 @@ func! Test_address_fold()
|
||||
quit!
|
||||
endfunc
|
||||
|
||||
func! Test_indent_fold()
|
||||
new
|
||||
call setline(1, ['', 'a', ' b', ' c'])
|
||||
setl fen fdm=indent
|
||||
2
|
||||
norm! >>
|
||||
let a=map(range(1,4), 'foldclosed(v:val)')
|
||||
call assert_equal([-1,-1,-1,-1], a)
|
||||
endfunc
|
||||
|
||||
func! Test_indent_fold()
|
||||
func Test_indent_fold()
|
||||
new
|
||||
call setline(1, ['', 'a', ' b', ' c'])
|
||||
setl fen fdm=indent
|
||||
@@ -89,7 +79,7 @@ func! Test_indent_fold()
|
||||
bw!
|
||||
endfunc
|
||||
|
||||
func! Test_indent_fold2()
|
||||
func Test_indent_fold2()
|
||||
new
|
||||
call setline(1, ['', '{{{', '}}}', '{{{', '}}}'])
|
||||
setl fen fdm=marker
|
||||
@@ -122,7 +112,7 @@ func Test_manual_fold_with_filter()
|
||||
endfor
|
||||
endfunc
|
||||
|
||||
func! Test_indent_fold_with_read()
|
||||
func Test_indent_fold_with_read()
|
||||
new
|
||||
set foldmethod=indent
|
||||
call setline(1, repeat(["\<Tab>a"], 4))
|
||||
@@ -224,7 +214,11 @@ func Test_update_folds_expr_read()
|
||||
set foldmethod& foldexpr&
|
||||
endfunc
|
||||
|
||||
func! Test_move_folds_around_manual()
|
||||
func Check_foldlevels(expected)
|
||||
call assert_equal(a:expected, map(range(1, line('$')), 'foldlevel(v:val)'))
|
||||
endfunc
|
||||
|
||||
func Test_move_folds_around_manual()
|
||||
new
|
||||
let input = PrepIndent("a") + PrepIndent("b") + PrepIndent("c")
|
||||
call setline(1, PrepIndent("a") + PrepIndent("b") + PrepIndent("c"))
|
||||
@@ -293,11 +287,50 @@ func! Test_move_folds_around_manual()
|
||||
6m$
|
||||
" The first fold has been truncated to the 5'th line.
|
||||
" Second fold has been moved up because the moved line is now below it.
|
||||
call assert_equal([0, 1, 1, 1, 1, 0, 0, 0, 1, 0], map(range(1, line('$')), 'foldlevel(v:val)'))
|
||||
call Check_foldlevels([0, 1, 1, 1, 1, 0, 0, 0, 1, 0])
|
||||
|
||||
%delete
|
||||
set fdm=indent foldlevel=0
|
||||
call setline(1, [
|
||||
\ "a",
|
||||
\ "\ta",
|
||||
\ "\t\ta",
|
||||
\ "\t\ta",
|
||||
\ "\t\ta",
|
||||
\ "a",
|
||||
\ "a"])
|
||||
set fdm=manual
|
||||
%foldopen!
|
||||
4,5m6
|
||||
call Check_foldlevels([0, 1, 2, 0, 0, 0, 0])
|
||||
|
||||
%delete
|
||||
set fdm=indent
|
||||
call setline(1, [
|
||||
\ "\ta",
|
||||
\ "\t\ta",
|
||||
\ "\t\ta",
|
||||
\ "\t\ta",
|
||||
\ "\ta",
|
||||
\ "\t\ta",
|
||||
\ "\t\ta",
|
||||
\ "\t\ta",
|
||||
\ "\ta",
|
||||
\ "\t\ta",
|
||||
\ "\t\ta",
|
||||
\ "\t\ta",
|
||||
\ "\t\ta",
|
||||
\ "\ta",
|
||||
\ "a"])
|
||||
set fdm=manual
|
||||
%foldopen!
|
||||
13m7
|
||||
call Check_foldlevels([1, 2, 2, 2, 1, 2, 2, 1, 1, 1, 2, 2, 2, 1, 0])
|
||||
|
||||
bw!
|
||||
endfunc
|
||||
|
||||
func! Test_move_folds_around_indent()
|
||||
func Test_move_folds_around_indent()
|
||||
new
|
||||
let input = PrepIndent("a") + PrepIndent("b") + PrepIndent("c")
|
||||
call setline(1, PrepIndent("a") + PrepIndent("b") + PrepIndent("c"))
|
||||
@@ -357,7 +390,7 @@ func! Test_move_folds_around_indent()
|
||||
6m$
|
||||
" The first fold has been truncated to the 5'th line.
|
||||
" Second fold has been moved up because the moved line is now below it.
|
||||
call assert_equal([0, 1, 1, 1, 1, 0, 0, 0, 1, 1], map(range(1, line('$')), 'foldlevel(v:val)'))
|
||||
call Check_foldlevels([0, 1, 1, 1, 1, 0, 0, 0, 1, 1])
|
||||
bw!
|
||||
endfunc
|
||||
|
||||
|
||||
@@ -756,3 +756,31 @@ func Test_setbufvar_options()
|
||||
call win_gotoid(dum1_id)
|
||||
bwipe!
|
||||
endfunc
|
||||
|
||||
func Test_redo_in_nested_functions()
|
||||
nnoremap g. :set opfunc=Operator<CR>g@
|
||||
function Operator( type, ... )
|
||||
let @x = 'XXX'
|
||||
execute 'normal! g`[' . (a:type ==# 'line' ? 'V' : 'v') . 'g`]' . '"xp'
|
||||
endfunction
|
||||
|
||||
function! Apply()
|
||||
5,6normal! .
|
||||
endfunction
|
||||
|
||||
new
|
||||
call setline(1, repeat(['some "quoted" text', 'more "quoted" text'], 3))
|
||||
1normal g.i"
|
||||
call assert_equal('some "XXX" text', getline(1))
|
||||
3,4normal .
|
||||
call assert_equal('some "XXX" text', getline(3))
|
||||
call assert_equal('more "XXX" text', getline(4))
|
||||
call Apply()
|
||||
call assert_equal('some "XXX" text', getline(5))
|
||||
call assert_equal('more "XXX" text', getline(6))
|
||||
bwipe!
|
||||
|
||||
nunmap g.
|
||||
delfunc Operator
|
||||
delfunc Apply
|
||||
endfunc
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user