Compare commits

...

48 Commits

Author SHA1 Message Date
Kazuki Sakamoto b0f7e1f006 MacVim Snapshot 131
Binary targets macOS 10.8+

- Vim patch 8.0.0596
- Fix mvim script to allow symbolic link it properly
- Add MMShareFindPboard to control sharing search text to the Find Pasteboard

Script interfaces have compatibility with these versions

- Lua 5.2
- Perl 5.16
- Python2 2.7
- Python3 3.6.1
- Ruby 2.0
2017-05-04 19:52:22 -07:00
Kazuki Sakamoto e2090aa9fb Merge pull request #502 from macvim-dev/MMShareFindPboard
Control sharing the find pasteboard with defaults
2017-05-04 18:17:14 -07:00
Kazuki Sakamoto bbfa7164d7 Update gui_mac.txt for MMShareFindPboard 2017-05-04 18:16:34 -07:00
Kazuki Sakamoto fa3b48c6a5 Control sharing the find pasteboard with defaults
`MMShareFindPboard` default is `YES`.

    $ defaults write org.vim.MacVim MMShareFindPboard -bool NO
2017-05-04 13:18:02 -07:00
Kazuki Sakamoto 6458d0b6bd Update mvim script document 2017-05-03 16:18:29 -07:00
Kazuki Sakamoto 936eef5ed7 Use ln with -f option for creating mvim symbolic link 2017-05-03 08:22:58 -07:00
Kazuki Sakamoto 3dfad5901a Delete installing mvim scripts from Travis CI build 2017-05-03 07:56:44 -07:00
Kazuki Sakamoto d46539b451 mvim.sh is no longer needed 2017-05-03 07:56:09 -07:00
Kazuki Sakamoto bbfebc8793 Add build phase for copying mvim scripts 2017-05-03 07:54:33 -07:00
Kazuki Sakamoto dc708f3025 Emulate "readlink -f" to get real $0 2017-05-03 07:51:05 -07:00
Kazuki Sakamoto f0377b844a Use the new mvim script for binary release 2017-05-02 10:26:10 -07:00
Kazuki Sakamoto 3417d483e3 Add mvim script for MacVim.app/Contents/bin/mvim 2017-05-02 10:24:05 -07:00
Kazuki Sakamoto a5ebfbc999 Merge remote-tracking branch 'vim/master' 2017-05-01 15:01:30 -07:00
Bram Moolenaar 4475b62396 patch 8.0.0596: crash when complete() called after complete_add()
Problem:    Crash when complete() is called after complete_add() in
            'completefunc'. (Lifepillar)
Solution:   Bail out if compl_pattern is NULL. (closes #1668)
            Also avoid using freed memory.
2017-05-01 20:46:52 +02:00
Bram Moolenaar beb9cb19c6 patch 8.0.0595: Coverity warning for not checking return value
Problem:    Coverity warning for not checking return value of dict_add().
Solution:   Check the return value for FAIL.
2017-05-01 14:14:04 +02:00
Bram Moolenaar 66c0e70b80 patch 8.0.0594: build failure when windows feature is missing
Problem:    Build failure when windows feature is missing.
Solution:   Add #ifdef.
2017-04-30 20:46:32 +02:00
Bram Moolenaar 45cf6e910c patch 8.0.0593: duplication of code for adding a list or dict return value
Problem:    Duplication of code for adding a list or dict return value.
Solution:   Add rettv_dict_set() and rettv_list_set(). (Yegappan Lakshmanan)
2017-04-30 20:25:19 +02:00
Bram Moolenaar 29ae377ea7 patch 8.0.0592: if a job writes to a buffer screen is not updated
Problem:    If a job writes to a buffer and the user is typing a command, the
            screen isn't updated. When a message is displayed the changed
            buffer may cause it to be cleared. (Ramel Eshed)
Solution:   Update the screen and then the command line if the screen didn't
            scroll. Avoid inserting screen lines, as it clears any message.
            Update the status line when the buffer changed.
2017-04-30 19:39:39 +02:00
Bram Moolenaar 45d2cca1ea patch 8.0.0591: changes to eval functionality not documented
Problem:    Changes to eval functionality not documented.
Solution:   Include all the changes.
2017-04-30 16:36:05 +02:00
Bram Moolenaar 8f77c5a4ec patch 8.0.0590: cannot add a context to locations
Problem:    Cannot add a context to locations.
Solution:   Add the "context" entry in location entries. (Yegappan Lakshmanan,
            closes #1012)
2017-04-30 14:21:00 +02:00
Bram Moolenaar a21ccb7a97 patch 8.0.0589: :simalt still does not work
Problem:    :simalt still does not work.
Solution:   Use K_NOP instead of K_IGNORE. (Christian Brabandt)
2017-04-29 17:40:22 +02:00
Bram Moolenaar 1a9020d4cb patch 8.0.0588: job_stop() often assumes the channel will be closed
Problem:    job_stop() often assumes the channel will be closed, while the job
            may not actually be stopped. (Martin Gammelsæter)
Solution:   Only assume the job stops on "kill".  Don't send a signal if the
            job has already ended. (closes #1632)
2017-04-29 16:24:38 +02:00
Bram Moolenaar 0635ee6824 Runtime file updates 2017-04-28 20:32:33 +02:00
Bram Moolenaar 696cbd224b patch 8.0.0587: configure check for return value of tgetent skipped
Problem:    Configure check for return value of tgetent is skipped.
Solution:   Always perform the check. (Marvin Schmidt, closes #1664)
2017-04-28 15:45:46 +02:00
Kazuki Sakamoto 5b04c1386d Merge remote-tracking branch 'vim/master' 2017-04-23 21:27:02 -07:00
Bram Moolenaar b7637c44c2 patch 8.0.0586: no test for mapping timing out
Problem:    No test for mapping timing out.
Solution:   Add a test.
2017-04-23 18:49:36 +02:00
Bram Moolenaar 86e5792906 patch 8.0.0585: test_options fails when run in the GUI
Problem:    Test_options fails when run in the GUI.
Solution:   Also check the 'imactivatekey' value when the GUI is not running.
            Specify test values that work and that fail.
2017-04-23 18:44:26 +02:00
Bram Moolenaar 94237495c0 Updated runtime files. 2017-04-23 18:40:21 +02:00
Bram Moolenaar d788f6fe89 patch 8.0.0584: memory leak when executing quickfix tests
Problem:    Memory leak when executing quickfix tests.
Solution:   Free the list reference. (Yegappan Lakshmanan)
2017-04-23 17:19:43 +02:00
Bram Moolenaar b11c826ddc patch 8.0.0583: fold test hangs on MS-Windows
Problem:    Fold test hangs on MS-Windows.
Solution:   Avoid overflow in compare.
2017-04-23 16:48:20 +02:00
Kazuki Sakamoto 4638209904 Merge remote-tracking branch 'vim/master' 2017-04-22 20:32:50 -07:00
Bram Moolenaar 5b276aa80e patch 8.0.0582: illegal memory access with z= command
Problem:    Illegal memory access with z= command. (Dominique Pelle)
Solution:   Avoid case folded text to be longer than the original text.  Use
            MB_PTR2LEN() instead of MB_BYTE2LEN().
2017-04-22 23:49:52 +02:00
Bram Moolenaar 94be619e30 patch 8.0.0581: moving folded text is sometimes not correct
Problem:    Moving folded text is sometimes not correct.
Solution:   Bail out when "move_end" is zero. (Matthew Malcomson)
2017-04-22 22:40:11 +02:00
Bram Moolenaar f1d21c8cc8 patch 8.0.0580: cannot set the valid flag with setqflist()
Problem:    Cannot set the valid flag with setqflist().
Solution:   Add the "valid" argument. (Yegappan Lakshmanan, closes #1642)
2017-04-22 21:20:46 +02:00
Bram Moolenaar 9b77016545 patch 8.0.0579: duplicate test case for quickfix
Problem:    Duplicate test case for quickfix.
Solution:   Remove the function. (Yegappan Lakshmanan)
2017-04-22 15:42:53 +02:00
Bram Moolenaar 7a85b0f028 patch 8.0.0578: :simalt on MS-Windows does not work properly
Problem:    :simalt on MS-Windows does not work properly.
Solution:   Put something in the typeahead buffer. (Christian Brabandt)
2017-04-22 15:17:40 +02:00
Kazuki Sakamoto bfe75bfe0f make cmdidxs 2017-04-21 20:13:06 -07:00
Kazuki Sakamoto fb12ba89f7 Merge remote-tracking branch 'vim/master' 2017-04-21 20:04:41 -07:00
Bram Moolenaar 97db5541a6 patch 8.0.0577: warning for uninitialized variable
Problem:    Warning for uninitialized variable. (John Marriott)
Solution:   Initialize "indent".
2017-04-21 23:18:26 +02:00
Bram Moolenaar 1d4be82c7d patch 8.0.0576: can't build when configure choses "install-sh"
Problem:    Can't build when configure choses "install-sh". (Daniel Hahler)
Solution:   Always use install-sh.  Fix remaining use of mkinstalldirs.
            (closes #1647)
2017-04-21 23:00:02 +02:00
Bram Moolenaar a701b3b6f0 patch 8.0.0575: using freed memory when resetting 'indentexpr'
Problem:    Using freed memory when resetting 'indentexpr' while evaluating
            it. (Dominique Pelle)
Solution:   Make a copy of 'indentexpr'.
2017-04-20 22:57:27 +02:00
Bram Moolenaar 99895eac1c patch 8.0.0574: get only one quickfix list after :caddbuf
Problem:    Get only one quickfix list after :caddbuf.
Solution:   Reset qf_multiline. (Yegappan Lakshmanan)
2017-04-20 22:44:47 +02:00
Bram Moolenaar 91b6e4591a patch 8.0.0573: running parallel make after distclean fails
Problem:    Running parallel make after distclean fails. (Manuel Ortega)
Solution:   Instead of using targets "scratch config myself" use "reconfig".
2017-04-20 22:32:24 +02:00
Bram Moolenaar 6de5e12601 patch 8.0.0572: building the command table requires Perl
Problem:    Building the command table requires Perl.
Solution:   Use a Vim script solution. (Dominique Pelle, closes #1641)
2017-04-20 21:55:44 +02:00
Bram Moolenaar a364cdb648 patch 8.0.0571: negative line number when using :z^ in an empty buffer
Problem:    The cursor line number becomes negative when using :z^ in an empty
            buffer. (neovim #6557)
Solution:   Correct the line number.  Also reset the column.
2017-04-20 21:12:30 +02:00
Bram Moolenaar c03944151f patch 8.0.0570: can't run make with several jobs
Problem:    Can't run make with several jobs, creating directories has a race
            condition.
Solution:   Use the MKDIR_P autoconf mechanism. (Eric N. Vander Weele,
            closes #1639)
2017-04-20 20:20:23 +02:00
Bram Moolenaar 62cf09b5dc patch 8.0.0569: bracketed paste is still enabled in a shell command
Problem:    Bracketed paste is still enabled when executing a shell command.
            (Michael Smith)
Solution:   Disable brackted paste when going into cooked mode. (closes #1638)
2017-04-20 19:44:09 +02:00
Bram Moolenaar 60402d68da patch 8.0.0568: 1gd may hang
Problem:    "1gd" may hang.
Solution:   Don't get stuck in one position. (Christian Brabandt, closes #1643)
2017-04-20 18:54:50 +02:00
70 changed files with 4802 additions and 779 deletions
-5
View File
@@ -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
+3 -2
View File
@@ -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 \
+8 -1
View File
@@ -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.
+27 -15
View File
@@ -1,4 +1,4 @@
*eval.txt* For Vim version 8.0. Last change: 2017 Apr 09
*eval.txt* For Vim version 8.0. Last change: 2017 Apr 29
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -4584,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
@@ -4595,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)
@@ -5265,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}
@@ -6945,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
@@ -6954,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
@@ -6979,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.
@@ -6993,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()*
@@ -8496,8 +8507,8 @@ listcmds Compiled with commands for the buffer list |:files|
localmap Compiled with local mappings and abbr. |:map-local|
lua Compiled with Lua interface |Lua|.
mac Any Macintosh version of Vim, but not all OS X.
macunix Compiled for OS X, with darwin
osx Compiled for OS X, with or without darwin
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|
@@ -10676,18 +10687,19 @@ missing: >
To execute a command only when the |+eval| feature is disabled requires a trick,
as this example shows: >
if 1
nnoremap : :"
endif
normal :set history=111<CR>
if 1
nunmap :
endif
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 commenging-out the command. without the
quote, which has the effect of commenting-out the command. Without the
|+eval| feature the nnoremap command is skipped and the command is executed.
==============================================================================
+20 -38
View File
@@ -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
View File
@@ -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
+2 -2
View File
@@ -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
View File
@@ -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:
+3
View File
@@ -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*
+2 -1
View File
@@ -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'*
+36 -6
View File
@@ -1,4 +1,4 @@
*todo.txt* For Vim version 8.0. Last change: 2017 Apr 09
*todo.txt* For Vim version 8.0. Last change: 2017 Apr 28
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -38,6 +38,10 @@ entered there will not be repeated below, unless there is extra information.
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)
@@ -107,11 +111,20 @@ 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 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.
Use tb_set(winid, [{'text': 'stop', 'cb': callback, 'hi': 'Green'}])
@@ -193,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.
@@ -200,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
@@ -233,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)
@@ -277,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)
@@ -332,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
@@ -895,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
@@ -1062,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
View File
File diff suppressed because it is too large Load Diff
+5 -2
View File
@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2017 Apr 15
" Last Change: 2017 Apr 20
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
@@ -2133,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
+23 -27
View File
@@ -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:
+25 -201
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1255,7 +1255,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>131</string>
<string>132</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
+1
View File
@@ -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];
+7 -3
View File
@@ -1544,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;
+3
View File
@@ -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;
+2
View File
@@ -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";
+18 -10
View File
@@ -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
View File
@@ -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
View File
@@ -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.
+37 -39
View File
@@ -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.
@@ -2583,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
@@ -2624,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
@@ -2787,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
@@ -2804,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 \
@@ -2959,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
@@ -3299,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) \
@@ -3318,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
@@ -3358,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
##############################################################################
+11 -13
View File
@@ -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
+8 -3
View File
@@ -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;
}
@@ -5173,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
+1 -1
View File
@@ -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
View File
@@ -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)
-75
View File
@@ -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";
+81
View File
@@ -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
View File
@@ -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;
}
+19 -10
View File
@@ -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;
}
+6 -6
View File
@@ -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)
{
/*
@@ -8482,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;
}
}
+12 -32
View File
@@ -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;
}
}
@@ -5379,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))
@@ -5436,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))
@@ -9179,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;
}
}
@@ -10769,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)
@@ -11859,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 */
@@ -11917,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 */
@@ -12084,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
@@ -12492,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
@@ -12508,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
+72
View File
@@ -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;
+7 -1
View File
@@ -4664,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++)
{
@@ -4686,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;
}
+4 -75
View File
@@ -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)
{
+8 -1
View File
@@ -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();
}
+11 -5
View File
@@ -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));
+1
View File
@@ -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
+15 -1
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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
View File
@@ -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;
}
+12 -2
View File
@@ -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;
-38
View File
@@ -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
+6
View File
@@ -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;
+1 -1
View File
@@ -6529,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
+1
View File
@@ -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);
+1
View File
@@ -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);
+1
View File
@@ -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
View File
@@ -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);
+2 -1
View File
@@ -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);
+101
View File
@@ -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,13 +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;
}
/*
@@ -4623,6 +4640,7 @@ enum {
QF_GETLIST_ITEMS = 0x2,
QF_GETLIST_NR = 0x4,
QF_GETLIST_WINID = 0x8,
QF_GETLIST_CONTEXT = 0x10,
QF_GETLIST_ALL = 0xFF
};
@@ -4675,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;
@@ -4693,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;
}
@@ -4773,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,
@@ -4864,6 +4905,16 @@ 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;
}
@@ -4923,6 +4974,10 @@ qf_free_stack(win_T *wp, qf_info_T *qi)
/* 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)
{
@@ -4967,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
View File
@@ -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
View File
@@ -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);
}
+7 -3
View File
@@ -3187,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
+1
View File
@@ -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 -1
View File
@@ -68,7 +68,7 @@ func Test_z()
bw!
endfunc
func Test_z_bug()
func Test_z_overflow()
" This used to access invalid memory as a result of an integer overflow
" and freeze vim.
normal ox
@@ -76,3 +76,10 @@ func Test_z_bug()
z777777776666666
')
endfunc
func Test_z_negative_lnum()
new
z^
call assert_equal(1, line('.'))
bwipe!
endfunc
+52 -19
View File
@@ -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
+21
View File
@@ -288,3 +288,24 @@ func Test_cursorline_keep_col()
set nocursorline
endfunc
func Test_gd_local_block()
let lines = [
\ ' int main()',
\ '{',
\ ' char *a = "NOT NULL";',
\ ' if(a)',
\ ' {',
\ ' char *b = a;',
\ ' printf("%s\n", b);',
\ ' }',
\ ' else',
\ ' {',
\ ' char *b = "NULL";',
\ ' return b;',
\ ' }',
\ '',
\ ' return 0;',
\ '}',
\ ]
call XTest_goto_decl('1gd', lines, 11, 11)
endfunc
+27
View File
@@ -171,3 +171,30 @@ func Test_abbr_after_line_join()
unabbr foo
set backspace&
endfunc
func Test_map_timeout()
nnoremap aaaa :let got_aaaa = 1<CR>
nnoremap bb :let got_bb = 1<CR>
nmap b aaa
new
func ExitInsert(timer)
let g:line = getline(1)
call feedkeys("\<Esc>", "t")
endfunc
set timeout timeoutlen=200
call timer_start(300, 'ExitInsert')
" After the 'b' Vim waits for another character to see if it matches 'bb'.
" When it times out it is expanded to "aaa", but there is no wait for
" "aaaa". Can't check that reliably though.
call feedkeys("b", "xt!")
call assert_equal("aa", g:line)
call assert_false(exists('got_aaa'))
call assert_false(exists('got_bb'))
bwipe!
nunmap aaaa
nunmap bb
nunmap b
set timeoutlen&
delfunc ExitInsert
endfunc
+13
View File
@@ -319,3 +319,16 @@ func Test_set_values()
throw 'Skipped: opt_test.vim does not exist'
endif
endfunc
func ResetIndentexpr()
set indentexpr=
endfunc
func Test_set_indentexpr()
" this was causing usage of freed memory
set indentexpr=ResetIndentexpr()
new
call feedkeys("i\<c-f>", 'x')
call assert_equal('', &indentexpr)
bwipe!
endfunc
+43
View File
@@ -570,4 +570,47 @@ func Test_completion_comment_formatting()
bwipe!
endfunc
fun MessCompleteMonths()
for m in split("Jan Feb Mar Apr May Jun Jul Aug Sep")
call complete_add(m)
if complete_check()
break
endif
endfor
return []
endfun
fun MessCompleteMore()
call complete(1, split("Oct Nov Dec"))
return []
endfun
fun MessComplete(findstart, base)
if a:findstart
let line = getline('.')
let start = col('.') - 1
while start > 0 && line[start - 1] =~ '\a'
let start -= 1
endwhile
return start
else
call MessCompleteMonths()
call MessCompleteMore()
return []
endif
endf
func Test_complete_func_mess()
" Calling complete() after complete_add() in 'completefunc' is wrong, but it
" should not crash.
set completefunc=MessComplete
new
call setline(1, 'Ju')
call feedkeys("A\<c-x>\<c-u>/\<esc>", 'tx')
call assert_equal('Oct/Oct', getline(1))
bwipe!
set completefunc=
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+113 -15
View File
@@ -24,8 +24,8 @@ func s:setup_commands(cchar)
command! -nargs=* Xgetbuffer <mods>cgetbuffer <args>
command! -nargs=* Xaddbuffer <mods>caddbuffer <args>
command! -nargs=* Xrewind <mods>crewind <args>
command! -nargs=* -bang Xnext <mods>cnext<bang> <args>
command! -nargs=* -bang Xprev <mods>cprev<bang> <args>
command! -count -nargs=* -bang Xnext <mods><count>cnext<bang> <args>
command! -count -nargs=* -bang Xprev <mods><count>cprev<bang> <args>
command! -nargs=* -bang Xfirst <mods>cfirst<bang> <args>
command! -nargs=* -bang Xlast <mods>clast<bang> <args>
command! -nargs=* -bang Xnfile <mods>cnfile<bang> <args>
@@ -56,8 +56,8 @@ func s:setup_commands(cchar)
command! -nargs=* Xgetbuffer <mods>lgetbuffer <args>
command! -nargs=* Xaddbuffer <mods>laddbuffer <args>
command! -nargs=* Xrewind <mods>lrewind <args>
command! -nargs=* -bang Xnext <mods>lnext<bang> <args>
command! -nargs=* -bang Xprev <mods>lprev<bang> <args>
command! -count -nargs=* -bang Xnext <mods><count>lnext<bang> <args>
command! -count -nargs=* -bang Xprev <mods><count>lprev<bang> <args>
command! -nargs=* -bang Xfirst <mods>lfirst<bang> <args>
command! -nargs=* -bang Xlast <mods>llast<bang> <args>
command! -nargs=* -bang Xnfile <mods>lnfile<bang> <args>
@@ -395,7 +395,9 @@ func Xtest_browse(cchar)
Xgetexpr ['Xqftestfile1:5:Line5',
\ 'Xqftestfile1:6:Line6',
\ 'Xqftestfile2:10:Line10',
\ 'Xqftestfile2:11:Line11']
\ 'Xqftestfile2:11:Line11',
\ 'RegularLine1',
\ 'RegularLine2']
Xfirst
call assert_fails('Xprev', 'E553')
@@ -407,6 +409,7 @@ func Xtest_browse(cchar)
call assert_equal('Xqftestfile1', bufname('%'))
call assert_equal(6, line('.'))
Xlast
Xprev
call assert_equal('Xqftestfile2', bufname('%'))
call assert_equal(11, line('.'))
call assert_fails('Xnext', 'E553')
@@ -415,6 +418,13 @@ func Xtest_browse(cchar)
call assert_equal('Xqftestfile1', bufname('%'))
call assert_equal(5, line('.'))
10Xnext
call assert_equal('Xqftestfile2', bufname('%'))
call assert_equal(11, line('.'))
10Xprev
call assert_equal('Xqftestfile1', bufname('%'))
call assert_equal(5, line('.'))
Xexpr ""
call assert_fails('Xnext', 'E42:')
@@ -455,9 +465,30 @@ func s:test_xhelpgrep(cchar)
let title_text = ':lhelpgrep quickfix'
endif
call assert_true(w:quickfix_title =~ title_text, w:quickfix_title)
" Jumping to a help topic should open the help window
only
Xnext
call assert_true(&buftype == 'help')
call assert_true(winnr('$') == 2)
" Jumping to the next match should reuse the help window
Xnext
call assert_true(&buftype == 'help')
call assert_true(winnr() == 1)
call assert_true(winnr('$') == 2)
" Jumping to the next match from the quickfix window should reuse the help
" window
Xopen
Xnext
call assert_true(&buftype == 'help')
call assert_true(winnr() == 1)
call assert_true(winnr('$') == 2)
" This wipes out the buffer, make sure that doesn't cause trouble.
Xclose
new | only
" Search for non existing help string
call assert_fails('Xhelpgrep a1b2c3', 'E480:')
endfunc
@@ -596,10 +627,7 @@ func Test_locationlist()
lrewind
enew
lopen
lnext
lnext
lnext
lnext
4lnext
vert split
wincmd L
lopen
@@ -1057,6 +1085,25 @@ func Test_efm2()
call assert_equal(1, l[4].valid)
call assert_equal('unittests/dbfacadeTest.py', bufname(l[4].bufnr))
" The following sequence of commands used to crash Vim
set efm=%W%m
cgetexpr ['msg1']
let l = getqflist()
call assert_equal(1, len(l), string(l))
call assert_equal('msg1', l[0].text)
set efm=%C%m
lexpr 'msg2'
let l = getloclist(0)
call assert_equal(1, len(l), string(l))
call assert_equal('msg2', l[0].text)
lopen
call setqflist([], 'r')
caddbuf
let l = getqflist()
call assert_equal(1, len(l), string(l))
call assert_equal('|| msg2', l[0].text)
new | only
let &efm = save_efm
endfunc
@@ -1154,6 +1201,25 @@ func SetXlistTests(cchar, bnum)
let l = g:Xgetlist()
call assert_equal(0, len(l))
" Tests for setting the 'valid' flag
call g:Xsetlist([{'bufnr':a:bnum, 'lnum':4, 'valid':0}])
Xwindow
call assert_equal(1, winnr('$'))
let l = g:Xgetlist()
call g:Xsetlist(l)
call assert_equal(0, g:Xgetlist()[0].valid)
call g:Xsetlist([{'text':'Text1', 'valid':1}])
Xwindow
call assert_equal(2, winnr('$'))
Xclose
let save_efm = &efm
set efm=%m
Xgetexpr 'TestMessage'
let l = g:Xgetlist()
call g:Xsetlist(l)
call assert_equal(1, g:Xgetlist()[0].valid)
let &efm = save_efm
" Error cases:
" Refer to a non-existing buffer and pass a non-dictionary type
call assert_fails("call g:Xsetlist([{'bufnr':998, 'lnum':4}," .
@@ -1387,18 +1453,18 @@ func Test_switchbuf()
let winid = win_getid()
cfirst | cnext
call assert_equal(winid, win_getid())
cnext | cnext
2cnext
call assert_equal(winid, win_getid())
cnext | cnext
2cnext
call assert_equal(winid, win_getid())
enew
set switchbuf=useopen
cfirst | cnext
call assert_equal(file1_winid, win_getid())
cnext | cnext
2cnext
call assert_equal(file2_winid, win_getid())
cnext | cnext
2cnext
call assert_equal(file2_winid, win_getid())
enew | only
@@ -1408,9 +1474,9 @@ func Test_switchbuf()
tabfirst
cfirst | cnext
call assert_equal(2, tabpagenr())
cnext | cnext
2cnext
call assert_equal(3, tabpagenr())
cnext | cnext
2cnext
call assert_equal(3, tabpagenr())
tabfirst | tabonly | enew
@@ -1706,6 +1772,38 @@ func Xproperty_tests(cchar)
if a:cchar == 'l'
call assert_equal({}, getloclist(99, {'title': 1}))
endif
" Context related tests
call g:Xsetlist([], 'a', {'context':[1,2,3]})
call test_garbagecollect_now()
let d = g:Xgetlist({'context':1})
call assert_equal([1,2,3], d.context)
call g:Xsetlist([], 'a', {'context':{'color':'green'}})
let d = g:Xgetlist({'context':1})
call assert_equal({'color':'green'}, d.context)
call g:Xsetlist([], 'a', {'context':"Context info"})
let d = g:Xgetlist({'context':1})
call assert_equal("Context info", d.context)
call g:Xsetlist([], 'a', {'context':246})
let d = g:Xgetlist({'context':1})
call assert_equal(246, d.context)
if a:cchar == 'l'
" Test for copying context across two different location lists
new | only
let w1_id = win_getid()
let l = [1]
call setloclist(0, [], 'a', {'context':l})
new
let w2_id = win_getid()
call add(l, 2)
call assert_equal([1, 2], getloclist(w1_id, {'context':1}).context)
call assert_equal([1, 2], getloclist(w2_id, {'context':1}).context)
unlet! l
call assert_equal([1, 2], getloclist(w2_id, {'context':1}).context)
only
call setloclist(0, [], 'f')
call assert_equal({}, getloclist(0, {'context':1}))
endif
endfunc
func Test_qf_property()
+9
View File
@@ -18,3 +18,12 @@ func Test_wrap_search()
bwipe!
set nospell
endfunc
func Test_z_equal_on_invalid_utf8_word()
split
set spell
call setline(1, "\xff")
norm z=
set nospell
bwipe!
endfunc
+58
View File
@@ -779,6 +779,64 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
596,
/**/
595,
/**/
594,
/**/
593,
/**/
592,
/**/
591,
/**/
590,
/**/
589,
/**/
588,
/**/
587,
/**/
586,
/**/
585,
/**/
584,
/**/
583,
/**/
582,
/**/
581,
/**/
580,
/**/
579,
/**/
578,
/**/
577,
/**/
576,
/**/
575,
/**/
574,
/**/
573,
/**/
572,
/**/
571,
/**/
570,
/**/
569,
/**/
568,
/**/
567,
/**/
+2
View File
@@ -632,6 +632,8 @@ extern int (*dyn_libintl_putenv)(const char *envstring);
* flags for update_screen()
* The higher the value, the higher the priority
*/
#define VALID_NO_UPDATE 5 /* no new changes, keep the command line if
possible */
#define VALID 10 /* buffer not changed, or changes marked
with b_mod_* */
#define INVERTED 20 /* redisplay inverted part that changed */