Merge remote-tracking branch 'vim/master'

This commit is contained in:
Yee Cheng Chin
2020-03-29 05:09:53 -07:00
184 changed files with 8821 additions and 4563 deletions
+18 -14
View File
@@ -12,6 +12,7 @@ SRC_ALL = \
appveyor.yml \
ci/appveyor.bat \
ci/if_ver*.vim \
ci/load-snd-dummy.sh \
src/Make_all.mak \
src/README.md \
src/alloc.h \
@@ -29,6 +30,7 @@ SRC_ALL = \
src/channel.c \
src/charset.c \
src/cindent.c \
src/clipboard.c \
src/cmdexpand.c \
src/cmdhist.c \
src/crypt.c \
@@ -150,17 +152,18 @@ SRC_ALL = \
src/testdir/*.py \
src/testdir/lsan-suppress.txt \
src/testdir/sautest/autoload/*.vim \
src/testdir/runtest.vim \
src/testdir/summarize.vim \
src/testdir/check.vim \
src/testdir/shared.vim \
src/testdir/screendump.vim \
src/testdir/view_util.vim \
src/testdir/term_util.vim \
src/testdir/setup.vim \
src/testdir/gui_init.vim \
src/testdir/setup_gui.vim \
src/testdir/gui_preinit.vim \
src/testdir/mouse.vim \
src/testdir/runtest.vim \
src/testdir/screendump.vim \
src/testdir/setup.vim \
src/testdir/setup_gui.vim \
src/testdir/shared.vim \
src/testdir/summarize.vim \
src/testdir/term_util.vim \
src/testdir/view_util.vim \
src/testdir/test[0-9]*.ok \
src/testdir/test[0-9]*a.ok \
src/testdir/test_[a-z]*.ok \
@@ -200,6 +203,7 @@ SRC_ALL = \
src/proto/channel.pro \
src/proto/charset.pro \
src/proto/cindent.pro \
src/proto/clipboard.pro \
src/proto/cmdexpand.pro \
src/proto/cmdhist.pro \
src/proto/crypt.pro \
@@ -784,20 +788,20 @@ RT_UNIX = \
README_unix.txt \
runtime/hi16-action-make.png \
runtime/hi22-action-make.png \
runtime/vim16x16.png \
runtime/vim16x16.xpm \
runtime/vim32x32.png \
runtime/vim32x32.xpm \
runtime/vim48x48.png \
runtime/vim48x48.xpm \
runtime/gvim.desktop \
runtime/vim.desktop \
# Unix and DOS runtime without CR-LF translation
RT_UNIX_DOS_BIN = \
runtime/vim16x16.gif \
runtime/vim16x16.png \
runtime/vim16x16.xpm \
runtime/vim32x32.gif \
runtime/vim32x32.png \
runtime/vim32x32.xpm \
runtime/vim48x48.gif \
runtime/vim48x48.png \
runtime/vim48x48.xpm \
# runtime not for unix or extra
RT_NO_UNIX = \
+2 -2
View File
@@ -25,9 +25,9 @@ test_script:
- cd src/testdir
# Testing with MSVC gvim
- path C:\Python35-x64;%PATH%
- nmake -f Make_dos.mak VIMPROG=..\gvim
- nmake -f Make_dos.mak POSTSCRIPT=yes VIMPROG=..\gvim
- nmake -f Make_dos.mak clean
# Testing with MingW console version
- nmake -f Make_dos.mak VIMPROG=..\vim
- nmake -f Make_dos.mak POSTSCRIPT=yes VIMPROG=..\vim
# vim: sw=2 sts=2 et ts=8 sr
+8
View File
@@ -0,0 +1,8 @@
#!/bin/bash
set -e
if ! modprobe snd-dummy; then
# snd-dummy is contained in linux-modules-extra (if exists)
apt install -y "linux-modules-extra-$(uname -r)"
modprobe snd-dummy
fi
+90 -11
View File
@@ -1,4 +1,4 @@
*eval.txt* For Vim version 8.2. Last change: 2020 Mar 14
*eval.txt* For Vim version 8.2. Last change: 2020 Mar 26
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -2527,7 +2527,7 @@ glob({expr} [, {nosuf} [, {list} [, {alllinks}]]])
glob2regpat({expr}) String convert a glob pat into a search pat
globpath({path}, {expr} [, {nosuf} [, {list} [, {alllinks}]]])
String do glob({expr}) for all dirs in {path}
has({feature}) Number |TRUE| if feature {feature} supported
has({feature} [, {check}]) Number |TRUE| if feature {feature} supported
has_key({dict}, {key}) Number |TRUE| if {dict} has entry {key}
haslocaldir([{winnr} [, {tabnr}]])
Number |TRUE| if the window executed |:lcd|
@@ -2613,6 +2613,7 @@ matchstr({expr}, {pat} [, {start} [, {count}]])
matchstrpos({expr}, {pat} [, {start} [, {count}]])
List {count}'th match of {pat} in {expr}
max({expr}) Number maximum value of items in {expr}
menu_info({name} [, {mode}]) Dict get menu item information
min({expr}) Number minimum value of items in {expr}
mkdir({name} [, {path} [, {prot}]])
Number create directory {name}
@@ -4113,8 +4114,12 @@ exists({expr}) The result is a Number, which is |TRUE| if {expr} is defined,
string)
*funcname built-in function (see |functions|)
or user defined function (see
|user-functions|). Also works for a
variable that is a Funcref.
|user-functions|) that is implemented.
Also works for a variable that is a
Funcref.
?funcname built-in function that could be
implemented; to be used to check if
"funcname" is valid
varname internal variable (see
|internal-variables|). Also works
for |curly-braces-names|, |Dictionary|
@@ -4369,8 +4374,8 @@ feedkeys({string} [, {mode}]) *feedkeys()*
'L' Lowlevel input. Only works for Unix or when using the
GUI. Keys are used as if they were coming from the
terminal. Other flags are not used. *E980*
When a CTRL-C interrupts it sets the internal
"got_int" flag.
When a CTRL-C interrupts and 't' is included it sets
the internal "got_int" flag.
'i' Insert the string instead of appending (see above).
'x' Execute commands until typeahead is empty. This is
similar to using ":normal!". You can call feedkeys()
@@ -5839,10 +5844,22 @@ globpath({path}, {expr} [, {nosuf} [, {list} [, {alllinks}]]])
GetExpr()->globpath(&rtp)
<
*has()*
has({feature}) The result is a Number, which is 1 if the feature {feature} is
supported, zero otherwise. The {feature} argument is a
string. See |feature-list| below.
has({feature} [, {check}])
When {check} is omitted or is zero: The result is a Number,
which is 1 if the feature {feature} is supported, zero
otherwise. The {feature} argument is a string, case is
ignored. See |feature-list| below.
When {check} is present and not zero: The result is a Number,
which is 1 if the feature {feature} could ever be supported,
zero otherwise. This is useful to check for a typo in
{feature} and to detect dead code. Keep in mind that an older
Vim version will not know about a feature added later and
features that have been abandoned will not be know by the
current Vim version.
Also see |exists()|.
Note that to skip code that has a syntax error when the
feature is not available, Vim may skip the rest of the line
and miss a following `endif`. Therfore put the `endif` on a
@@ -5850,8 +5867,8 @@ has({feature}) The result is a Number, which is 1 if the feature {feature} is
if has('feature')
let x = this->breaks->without->the->feature
endif
< If the `endif` would be in the second line it would not be
found.
< If the `endif` would be moved to the second line as "| endif" it
would not be found.
has_key({dict}, {key}) *has_key()*
@@ -7136,6 +7153,7 @@ matchstrpos({expr}, {pat} [, {start} [, {count}]]) *matchstrpos()*
Can also be used as a |method|: >
GetText()->matchstrpos('word')
<
*max()*
max({expr}) Return the maximum value of all items in {expr}.
{expr} can be a List or a Dictionary. For a Dictionary,
@@ -7147,6 +7165,66 @@ max({expr}) Return the maximum value of all items in {expr}.
Can also be used as a |method|: >
mylist->max()
menu_info({name} [, {mode}]) *menu_info()*
Return information about the specified menu {name} in
mode {mode}. The menu name should be specified without the
shortcut character ('&').
{mode} can be one of these strings:
"n" Normal
"v" Visual (including Select)
"o" Operator-pending
"i" Insert
"c" Cmd-line
"s" Select
"x" Visual
"t" Terminal-Job
"" Normal, Visual and Operator-pending
"!" Insert and Cmd-line
When {mode} is omitted, the modes for "" are used.
Returns a |Dictionary| containing the following items:
accel menu item accelerator text |menu-text|
display display name (name without '&')
enabled v:true if this menu item is enabled
Refer to |:menu-enable|
icon name of the icon file (for toolbar)
|toolbar-icon|
iconidx index of a built-in icon
modes modes for which the menu is defined. In
addition to the modes mentioned above, these
characters will be used:
" " Normal, Visual and Operator-pending
name menu item name.
noremenu v:true if the {rhs} of the menu item is not
remappable else v:false.
priority menu order priority |menu-priority|
rhs right-hand-side of the menu item. The returned
string has special characters translated like
in the output of the ":menu" command listing.
When the {rhs} of a menu item is empty, then
"<Nop>" is returned.
script v:true if script-local remapping of {rhs} is
allowed else v:false. See |:menu-script|.
shortcut shortcut key (character after '&' in
the menu name) |menu-shortcut|
silent v:true if the menu item is created
with <silent> argument |:menu-silent|
submenus |List| containing the names of
all the submenus. Present only if the menu
item has submenus.
Returns an empty dictionary if the menu item is not found.
Examples: >
:echo menu_info('Edit.Cut')
:echo menu_info('File.Save', 'n')
<
Can also be used as a |method|: >
GetMenuName()->menu_info('v')
< *min()*
min({expr}) Return the minimum value of all items in {expr}.
{expr} can be a List or a Dictionary. For a Dictionary,
@@ -8742,6 +8820,7 @@ setqflist({list} [, {action} [, {what}]]) *setqflist()*
*setreg()*
setreg({regname}, {value} [, {options}])
Set the register {regname} to {value}.
If {regname} is "" or "@", the unnamed register '"' is used.
{value} may be any value returned by |getreg()|, including
a |List|.
If {options} contains "a" or {regname} is upper case,
+6 -2
View File
@@ -1,4 +1,4 @@
*gui.txt* For Vim version 8.2. Last change: 2019 Nov 16
*gui.txt* For Vim version 8.2. Last change: 2020 Mar 16
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -578,9 +578,11 @@ tooltips for menus. See |terminal-typing|.
Special characters in a menu name:
*menu-shortcut*
& The next character is the shortcut key. Make sure each
shortcut key is only used once in a (sub)menu. If you want to
insert a literal "&" in the menu name use "&&".
*menu-text*
<Tab> Separates the menu name from right-aligned text. This can be
used to show the equivalent typed command. The text "<Tab>"
can be used here for convenience. If you are using a real
@@ -854,6 +856,8 @@ Special characters in the list, just before the rhs:
* The menu was defined with "nore" to disallow remapping.
& The menu was defined with "<script>" to allow remapping script-local
mappings only.
s The menu was defined with "<silent>" to avoid showing what it is
mapped to when triggered.
- The menu was disabled.
Note that hitting <Tab> while entering a menu name after a menu command may
@@ -955,7 +959,7 @@ item for the keyword under the cursor. The register "z" is used. >
mappings, or put these lines in your gvimrc; "<C-R>" is CTRL-R, "<CR>" is
the <CR> key. |<>|)
*tooltips* *menu-tips*
5.8 Tooltips & Menu tips
See section |42.4| in the user manual.
+7 -3
View File
@@ -1,4 +1,4 @@
*gui_w32.txt* For Vim version 8.2. Last change: 2019 May 05
*gui_w32.txt* For Vim version 8.2. Last change: 2020 Mar 25
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -456,8 +456,12 @@ See the Make_mvc.mak file for instructions, search for XPM.
To try out if XPM support works do this: >
:help
:exe 'sign define vimxpm icon=' . $VIMRUNTIME . '\\vim16x16.xpm'
:exe 'sign place 1 line=1 name=vimxpm file=' . expand('%:p')
:let runtime = escape($VIMRUNTIME, ' \')
:exe 'sign define vimxpm icon=' .. runtime .. '\\vim16x16.xpm'
:exe 'sign place 1 line=1 name=vimxpm file=' .. expand('%:p')
<
You may need to get the vim16x16.xpm file from github:
https://github.com/vim/vim/blob/master/runtime/vim16x16.xpm
vim:tw=78:sw=4:ts=8:noet:ft=help:norl:
+9 -4
View File
@@ -1,4 +1,4 @@
*index.txt* For Vim version 8.2. Last change: 2020 Jan 14
*index.txt* For Vim version 8.2. Last change: 2020 Mar 27
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1260,11 +1260,12 @@ tag command action ~
|:cunmenu| :cunme[nu] remove menu for Command-line mode
|:cwindow| :cw[indow] open or close quickfix window
|:delete| :d[elete] delete lines
|:delmarks| :delm[arks] delete marks
|:debug| :deb[ug] run a command in debugging mode
|:debuggreedy| :debugg[reedy] read debug mode commands from normal input
|:def| :def define a Vim9 user function
|:delcommand| :delc[ommand] delete user-defined command
|:delfunction| :delf[unction] delete a user function
|:delmarks| :delm[arks] delete marks
|:diffupdate| :dif[fupdate] update 'diff' buffers
|:diffget| :diffg[et] remove differences in current buffer
|:diffoff| :diffo[ff] switch off diff mode
@@ -1274,9 +1275,9 @@ tag command action ~
|:diffthis| :diffthis make current window a diff window
|:digraphs| :dig[raphs] show or enter digraphs
|:display| :di[splay] display registers
|:disassemble| :disa[ssemble] disassemble Vim9 user function
|:djump| :dj[ump] jump to #define
|:dl| :dl short for |:delete| with the 'l' flag
|:del| :del[ete]l short for |:delete| with the 'l' flag
|:dlist| :dli[st] list #defines
|:doautocmd| :do[autocmd] apply autocommands to current buffer
|:doautoall| :doautoa[ll] apply autocommands for all loaded buffers
@@ -1295,15 +1296,17 @@ tag command action ~
|:else| :el[se] part of an :if command
|:elseif| :elsei[f] part of an :if command
|:emenu| :em[enu] execute a menu by name
|:enddef| :enddef end of a user function started with :def
|:endif| :en[dif] end previous :if
|:endfor| :endfo[r] end previous :for
|:endfunction| :endf[unction] end of a user function
|:endfunction| :endf[unction] end of a user function started with :function
|:endtry| :endt[ry] end previous :try
|:endwhile| :endw[hile] end previous :while
|:enew| :ene[w] edit a new, unnamed buffer
|:ex| :ex same as ":edit"
|:execute| :exe[cute] execute result of expressions
|:exit| :exi[t] same as ":xit"
|:export| :exp[ort] Vim9: export an item from a script
|:exusage| :exu[sage] overview of Ex commands
|:file| :f[ile] show or set the current file name
|:files| :files list all files in the buffer list
@@ -1345,6 +1348,7 @@ tag command action ~
|:imap| :im[ap] like ":map" but for Insert mode
|:imapclear| :imapc[lear] like ":mapclear" but for Insert mode
|:imenu| :ime[nu] add menu for Insert mode
|:import| :imp[ort] Vim9: import an item from another script
|:inoremap| :ino[remap] like ":noremap" but for Insert mode
|:inoreabbrev| :inorea[bbrev] like ":noreabbrev" but for Insert mode
|:inoremenu| :inoreme[nu] like ":noremenu" but for Insert mode
@@ -1688,6 +1692,7 @@ tag command action ~
|:version| :ve[rsion] print version number and other info
|:verbose| :verb[ose] execute command with 'verbose' set
|:vertical| :vert[ical] make following command split vertically
|:vim9script| :vim9[script] indicates Vim9 script file
|:vimgrep| :vim[grep] search for pattern in files
|:vimgrepadd| :vimgrepa[dd] like :vimgrep, but append to current list
|:visual| :vi[sual] same as ":edit", but turns off "Ex" mode
+3 -3
View File
@@ -1,4 +1,4 @@
*insert.txt* For Vim version 8.2. Last change: 2020 Jan 26
*insert.txt* For Vim version 8.2. Last change: 2020 Mar 25
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -379,8 +379,8 @@ CTRL-\ CTRL-O like CTRL-O but don't move the cursor *i_CTRL-\_CTRL-O*
CTRL-L when 'insertmode' is set: go to Normal mode *i_CTRL-L*
CTRL-G u break undo sequence, start new change *i_CTRL-G_u*
CTRL-G U don't break undo with next left/right cursor *i_CTRL-G_U*
movement, if the cursor stays within
same the line
movement, if the cursor stays within the
same line
-----------------------------------------------------------------------
Note: If the cursor keys take you out of Insert mode, check the 'noesckeys'
+22 -16
View File
@@ -1,4 +1,4 @@
*os_haiku.txt* For Vim version 8.2. Last change: 2020 Feb 26
*os_haiku.txt* For Vim version 8.2. Last change: 2020 Mar 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -16,7 +16,7 @@ targets personal computing.
2. Compiling Vim |haiku-compiling|
3. The Haiku GUI |haiku-gui|
4. The $VIM directory |haiku-vimdir|
5. The $BE_USER_SETTINGS
5. The $USER_SETTINGS_DIR
directory |haiku-user-settings-dir|
6. Drag & Drop |haiku-dragndrop|
7. Single Launch vs. Multiple
@@ -26,7 +26,7 @@ targets personal computing.
10. Mouse key mappings |haiku-mouse|
11. Color names |haiku-colors|
12. Credits |haiku-support-credits|
13. Bugs & things To Do |haiku-bugs|
13. Bugs & to-do |haiku-bugs|
1. General *haiku-general*
@@ -44,8 +44,13 @@ Vim can be compiled using the standard configure/make approach. Running
vim with the Haiku GUI support. Run ./configure --help , to find out other
features you can enable/disable.
Haiku uses "ncurses6" as its terminal library, therefore you need to have
"ncurses6_devel" package installed from HaikuDepot in order to configure
the Haiku build. Just append "--with-tlib=ncurses6" to ./configure command
below for the initial build.
Now you should use "make" to compile Vim, then "make install" to install it.
For seamless integration into the Haiku the GUI-less vim binary should be
For seamless integration into Haiku, the GUI-less vim binary should be
additionally installed over the GUI version. Typical build commands are: >
./configure --prefix=`finddir B_SYSTEM_NONPACKAGED_DIRECTORY` \
@@ -78,8 +83,7 @@ Stuff that does not work yet:
still playing with the scrollbar it won't change it itself. I provided a
workaround which kicks in when the window is activated or deactivated (so it
works best with focus- follows-mouse turned on).
- The cursor does not flash (very low priority; I'm not sure I even like it
when it flashes)
- The cursor does not flash.
4. The $VIM directory *haiku-vimdir*
@@ -89,9 +93,10 @@ The default value for $VIM is set at compile time and can be determined with >
:version
The normal value is /boot/common/data/vim. If you don't like it you can
set the VIM environment variable to override this, or set 'helpfile' in your
.vimrc: >
The normal value is /boot/system/data/vim for Haikuports version,
/boot/system/non-packaged/data/vim for manual builds. If you don't like it
you can set the VIM environment variable to override this, or set 'helpfile'
in your .vimrc: >
:if version >= 500
: set helpfile=~/vim/runtime/doc/help.txt
@@ -216,13 +221,14 @@ All the changes and patches released under vim-license.
Thank you, all!
13. Bugs & things To Do *haiku-bugs*
The port is under development now and far away from the perfect state. Bug
reports, patches and wishes are welcome.
-Siarzhuk Zharski <imker@gmx.li>
13. Bugs & to-do *haiku-bugs*
The port is under development now and far away from the perfect state. For bug
reports, patches and wishes, please use the Vim mailing list or Vim Github
repository.
Mailing list: https://www.vim.org/maillist.php
Vim Github repository: https://github.com/vim/vim
vim:tw=78:ts=8:ft=help:norl:
+11 -4
View File
@@ -1,4 +1,4 @@
*popup.txt* For Vim version 8.2. Last change: 2020 Feb 20
*popup.txt* For Vim version 8.2. Last change: 2020 Mar 21
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -151,13 +151,19 @@ different: *E863*
- The popup window can be closed with `popup_close()`, the terminal buffer
then becomes hidden.
- The default Pmenu color is only used for the border and padding. To change
the color of the terminal itself set 'wincolor'.
the color of the terminal itself set the Terminal highlight group before
creating the terminal. Setting 'wincolor' later can work but requires the
program in the terminal to redraw everything.
- The default minimal size is 5 lines of 20 characters; Use the "minwidth" and
"minheight" parameters to set a different value.
- The terminal size will grow if the program running in the terminal writes
text. Set "maxheight" and "maxwidth" to restrict the size.
To run a terminal in a popup window, first create the terminal hidden. Then
pass the buffer number to popup_create(). Example: >
hi link Terminal Search
let buf = term_start(['picker', 'Something'], #{hidden: 1, term_finish: 'close'})
let winid = popup_create(buf, #{minwidth: 50, minheight: 20})
set wincolor=Search
==============================================================================
2. Functions *popup-functions*
@@ -566,7 +572,8 @@ properties. It is in one of four forms:
If you want to create a new buffer yourself use |bufadd()| and pass the buffer
number to popup_create().
It is not possible to use the buffer of a terminal window. *E278*
It is not possible to use the buffer of a terminal window. *E278* You CAN
create a hidden terminal buffer and use that one in a popup window.
The second argument of |popup_create()| is a dictionary with options:
line Screen line where to position the popup. Can use a
+2 -2
View File
@@ -1,4 +1,4 @@
*recover.txt* For Vim version 8.2. Last change: 2019 May 07
*recover.txt* For Vim version 8.2. Last change: 2020 Mar 24
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -125,7 +125,7 @@ If you want to make sure that your changes are in the swap file use this
command:
*:pre* *:preserve* *E313* *E314*
:pre[serve] Write all text for all buffers into swap file. The
:pre[serve] Write all text for all buffers into swap files. The
original file is no longer needed for recovery.
This sets a flag in the current buffer. When the '&'
flag is present in 'cpoptions' the swap file will not
+6
View File
@@ -1287,6 +1287,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
+X11 various.txt /*+X11*
+acl various.txt /*+acl*
+arabic various.txt /*+arabic*
+autochdir various.txt /*+autochdir*
+autocmd various.txt /*+autocmd*
+autoservername various.txt /*+autoservername*
+balloon_eval various.txt /*+balloon_eval*
@@ -7859,7 +7860,11 @@ menu-changes-5.4 version5.txt /*menu-changes-5.4*
menu-examples gui.txt /*menu-examples*
menu-priority gui.txt /*menu-priority*
menu-separator gui.txt /*menu-separator*
menu-shortcut gui.txt /*menu-shortcut*
menu-text gui.txt /*menu-text*
menu-tips gui.txt /*menu-tips*
menu.vim gui.txt /*menu.vim*
menu_info() eval.txt /*menu_info()*
menus gui.txt /*menus*
merge diff.txt /*merge*
message-history message.txt /*message-history*
@@ -9697,6 +9702,7 @@ toggle options.txt /*toggle*
toggle-revins version4.txt /*toggle-revins*
tolower() eval.txt /*tolower()*
toolbar-icon gui.txt /*toolbar-icon*
tooltips gui.txt /*tooltips*
toupper() eval.txt /*toupper()*
tr() eval.txt /*tr()*
trim() eval.txt /*trim()*
+9 -2
View File
@@ -1,4 +1,4 @@
*terminal.txt* For Vim version 8.2. Last change: 2020 Jan 30
*terminal.txt* For Vim version 8.2. Last change: 2020 Mar 26
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -148,7 +148,12 @@ terminal window will start with a white or black background.
To use a different color the Terminal highlight group can be used, for
example: >
hi Terminal ctermbg=lightgrey ctermfg=blue guibg=lightgrey guifg=blue
<
The highlight needs to be defined before the terminal is created. Doing it
later, or setting 'wincolor', will only have effect when the program running
in the terminal displays text or clears the terminal.
Instead of Terminal another group can be specified with the "term_highlight"
option for `term_start()`.
*g:terminal_ansi_colors*
In GUI mode or with 'termguicolors', the 16 ANSI colors used by default in new
terminal windows may be configured using the variable
@@ -857,6 +862,8 @@ term_start({cmd} [, {options}]) *term_start()*
have "%d" where the buffer number goes,
e.g. "10split|buffer %d"; when not
specified "botright sbuf %d" is used
"term_highlight" highlight group to use instead of
"Terminal"
"eof_chars" Text to send after all buffer lines were
written to the terminal. When not set
CTRL-D is used on MS-Windows. For Python
+23 -31
View File
@@ -1,4 +1,4 @@
*todo.txt* For Vim version 8.2. Last change: 2020 Mar 13
*todo.txt* For Vim version 8.2. Last change: 2020 Mar 27
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -38,21 +38,10 @@ browser use: https://github.com/vim/vim/issues/1234
*known-bugs*
-------------------- Known bugs and current work -----------------------
When starting a terminal popup the size defaults to nothing. Should have a
sensible default, e.g. four lines of 30 chars.
call popup_create(term_start(&shell, #{hidden: 1}), #{})
Test_terminal_in_popup() still sometimes fails with "All" instead of "Top".
Patch to fix vimtutor problems on Windows (Wu Yongwei, #5774)
Additional tests for menu. (Yegappan, #5760)
Introduces menu_info(), check that out.
Vim9 script:
- Add vim9 commands to index, so that vim.vim will get them automatically.
See email from Charles March 11 2020.
- "func" inside "vim9script" doesn't work? (Ben Jackson, #5670)
- "let x = x + 1" should say that "x" is not defined (declare local after
evaluating expresion).
- "echo Func()" is an error if Func() does not return anything.
- better implementation for partial and tests for that.
- Make "g:imported = Export.exported" work in Vim9 script.
@@ -66,8 +55,8 @@ Vim9 script:
- Check that import in legacy script works and puts item in s:
- Error in any command in "vim9script" aborts sourcing.
- Find a way to test expressions in legacy and Vim9 script without duplication
- Fix memory leaks for test_vim9_disassemble, test_vim9_expr, test_vim9_script
- Test each level of expressions properly, with type checking
- Test the
- Test try/catch and throw better, also nested.
Test return inside try/finally jumps to finally and then returns.
- call autoload function.
@@ -93,10 +82,13 @@ Vim9 script:
LOADVARARG (varags idx)
Popup windows:
- With some sequence get get hidden finished terminal buffer. (#5768)
Cannot close popup terminal (#5744)
Buffer can't be wiped, gets status "aF". (#5764)
Is buf->nwindows incorrect?
- popup_clear() and popup_close() should close the terminal popup, and
make the buffer hidden. #5745
- With terminal in popup, allow for popup_hide() to temporarily hide it.?
- With some sequence get get hidden finished terminal buffer. (#5768)
- Fire some autocommand event after a new popup window was created and
positioned? PopupNew? Could be used to set some options or move it out of
the way. (#5737)
@@ -190,6 +182,10 @@ E654, E856, E857, E861, E900
Patch to fix drawing error with DirectX. (James Grant, #5688)
Causes flicker on resizing.
Patch to make lambda functions faster (Ken Takata)
https://github.com/vim/vim/pull/5727
LGTM remark: size derived from user input (getenv). Don't see how.
Patch to use more FOR_ALL_ macros and use them. (Yegappan Lakshmanan, #5339)
Patch to explain use of "%" in :!. (David Briscoe, #5591)
@@ -201,6 +197,9 @@ Patch to add "-d" to xxd. (#5616)
Patch to add Turkish manual. (Emir Sarı, #5641)
Patch to support cindent option to handle pragmas differently.
(Max Rumpf, #5468)
File marks merging has duplicates since 7.4.1925. (Ingo Karkat, #5733)
Running test_gui and test_gui_init with Motif sometimes kills the window
@@ -222,6 +221,8 @@ Ready to include? Review the code.
When 'lazyredraw' is set sometimes the title is not updated.
(Jason Franklin, 2020 Feb 3) Looks like a race condition.
Patch to delete BeOS code. (#5817)
Strange sequence of BufWipeout and BufNew events while doing omni-complete.
(Paul Jolly, #5656)
Get BufDelete without preceding BufNew. (Paul Jolly, #5694)
@@ -252,8 +253,8 @@ remains equal? Then %argdel to clean it up. Do try this with 'hidden' set.
Also #4994: window-local options not always restored, related to using :badd.
Also #5326: netrw buffers are not restored.
Patch to support cindent option to handle pragmas differently.
(Max Rumpf, #5468)
When 'backupdir' has a path ending in double slash (meaning: use full path of
the file) combined with 'patchmode' the file name is wrong. (#5791)
Patch to make ":verbose pwd" show the scope of the directory. (Takuya
Fujiwara, #5469)
@@ -353,6 +354,8 @@ Patch to add MODIFIED_BY to MSVC build file. (Chen Lei, 2016 Nov 24, #1275)
Patch to support "0o" for octal numbers. (Ken Takata, #5304)
Patch to enable IXON, avoid that CTRL-S stops terminal output. (#5775)
When getting a focus event halfway a mapping this aborts the mapping. E.g.
when "qq" is mapped and after the first "q" the mouse is moved outside of the
gvim window (with focus follows mouse), then the K_FOCUSLOST key is put in the
@@ -636,19 +639,8 @@ Make ":interactive !cmd" stop termcap mode, also when used in an autocommand.
Add buffer argument to undotree(). (#4001)
Using uninitialized value in test_gn
Using uninitialized value in test_crypt.
memory leak in test_paste
Memory leak in test_terminal:
==23530== by 0x2640D7: alloc (misc2.c:874)
==23530== by 0x2646D6: vim_strsave (misc2.c:1315)
==23530== by 0x25841D: FullName_save (misc1.c:5443)
==23530== by 0x17CB4F: fix_fname (buffer.c:4794)
==23530== by 0x17CB9A: fname_expand (buffer.c:4838)
==23530== by 0x1759AB: buflist_new (buffer.c:1889)
==23530== by 0x35C923: term_start (terminal.c:421)
==23530== by 0x2AFF30: mch_call_shell_terminal (os_unix.c:4377)
==23530== by 0x2B16BE: mch_call_shell (os_unix.c:5383)
Using uninitialized value in test_crypt (can't explain why).
Memory leak in test_terminal_fail
TODO: be able to run all parts of test_alot with valgrind separately
Memory leak in test_alot with pyeval() (allocating partial)
Memory leak in test_alot with expand()
+3 -3
View File
@@ -1,4 +1,4 @@
*usr_07.txt* For Vim version 8.2. Last change: 2017 Sep 18
*usr_07.txt* For Vim version 8.2. Last change: 2020 Mar 23
VIM USER MANUAL - by Bram Moolenaar
@@ -227,8 +227,8 @@ the file.
FILE MARKS
In chapter 4 was explained how you can place a mark in a file with "mx" and
jump to that position with "`x". That works within one file. If you edit
In section |03.10| was explained how you can place a mark in a file with "mx"
and jump to that position with "`x". That works within one file. If you edit
another file and place marks there, these are specific for that file. Thus
each file has its own set of marks, they are local to the file.
So far we were using marks with a lowercase letter. There are also marks
+3 -2
View File
@@ -1,4 +1,4 @@
*usr_41.txt* For Vim version 8.2. Last change: 2019 Dec 17
*usr_41.txt* For Vim version 8.2. Last change: 2020 Mar 15
VIM USER MANUAL - by Bram Moolenaar
@@ -942,10 +942,11 @@ Window size and position: *window-size-functions*
winsaveview() get view of current window
winrestview() restore saved view of current window
Mappings: *mapping-functions*
Mappings and Menus: *mapping-functions*
hasmapto() check if a mapping exists
mapcheck() check if a matching mapping exists
maparg() get rhs of a mapping
menu_info() get information about a menu item
wildmenumode() check if the wildmode is active
Testing: *test-functions*
+2 -1
View File
@@ -1,4 +1,4 @@
*various.txt* For Vim version 8.2. Last change: 2020 Feb 22
*various.txt* For Vim version 8.2. Last change: 2020 Mar 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -317,6 +317,7 @@ g8 Print the hex values of the bytes used in the
*+acl* |ACL| support included
*+ARP* Amiga only: ARP support included
B *+arabic* |Arabic| language support
B *+autochdir* support 'autochdir' option
T *+autocmd* |:autocmd|, automatic commands
H *+autoservername* Automatically enable |clientserver|
m *+balloon_eval* |balloon-eval| support in the GUI. Included when
+2 -2
View File
@@ -1,4 +1,4 @@
*windows.txt* For Vim version 8.2. Last change: 2019 Dec 07
*windows.txt* For Vim version 8.2. Last change: 2020 Mar 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -215,7 +215,7 @@ CTRL-W CTRL_N *CTRL-W_CTRL-N*
height). Reduces the current window height to create room
(and others, if the 'equalalways' option is set).
:[N]sv[iew] [++opt] [+cmd] {file} *:sv* *:sview* *splitview*
:[N]sv[iew] [++opt] [+cmd] [file] *:sv* *:sview* *splitview*
Same as ":split", but set 'readonly' option for this buffer.
:[N]sf[ind] [++opt] [+cmd] {file} *:sf* *:sfi* *:sfind* *splitfind*
+5 -2
View File
@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2020 Jan 31
" Last Change: 2020 Mar 19
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
@@ -233,6 +233,9 @@ au BufNewFile,BufRead *.bl setf blank
" Blkid cache file
au BufNewFile,BufRead */etc/blkid.tab,*/etc/blkid.tab.old setf xml
" BSDL
au BufNewFile,BufRead *.bsdl setf bsdl
" Bazel (http://bazel.io)
autocmd BufRead,BufNewFile *.bzl,WORKSPACE,BUILD.bazel setf bzl
if has("fname_case")
@@ -1773,7 +1776,7 @@ au BufNewFile,BufRead *.va,*.vams setf verilogams
au BufNewFile,BufRead *.sv,*.svh setf systemverilog
" VHDL
au BufNewFile,BufRead *.hdl,*.vhd,*.vhdl,*.vbe,*.vst setf vhdl
au BufNewFile,BufRead *.hdl,*.vhd,*.vhdl,*.vbe,*.vst,*.vho setf vhdl
" Vim script
au BufNewFile,BufRead *.vim,*.vba,.exrc,_exrc setf vim
+2 -2
View File
@@ -1,7 +1,7 @@
" Vim filetype plugin file
" Language: man
" Maintainer: SungHyun Nam <goweol@gmail.com>
" Last Change: 2019 Sep 26
" Last Change: 2020 Mar 25
" (fix by Jason Franklin)
" To make the ":Man" command available before editing a manual page, source
@@ -96,7 +96,7 @@ func <SID>PreGetPage(cnt)
let sect = a:cnt
let page = expand("<cword>")
endif
call s:GetPage(sect, page)
call s:GetPage('', sect, page)
endfunc
func <SID>GetCmdArg(sect, page)
+1 -2
View File
@@ -10,6 +10,5 @@
setlocal comments=s1:/*,mb:*,ex:*/,:///,://
setlocal expandtab
setlocal ts=2
setlocal sw=2
setlocal sw=4 sts=4
setlocal smartindent
+60 -43
View File
@@ -2,7 +2,7 @@
" You can also use this as a start for your own set of menus.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2019 Dec 10
" Last Change: 2020 Mar 19
" Note that ":an" (short for ":anoremenu") is often used to make a menu work
" in all modes and avoid side effects from mappings defined by the user.
@@ -180,11 +180,11 @@ if !has("gui_macvim")
an 10.620 &File.E&xit<Tab>:qa :confirm qa<CR>
endif
func! <SID>SelectAll()
func s:SelectAll()
exe "norm! gg" . (&slm == "" ? "VG" : "gH\<C-O>G")
endfunc
func! s:FnameEscape(fname)
func s:FnameEscape(fname)
if exists('*fnameescape')
return fnameescape(a:fname)
endif
@@ -404,7 +404,7 @@ endfun
let s:did_setup_color_schemes = 0
" Setup the Edit.Color Scheme submenu
func! s:SetupColorSchemes() abort
func s:SetupColorSchemes() abort
if s:did_setup_color_schemes
return
endif
@@ -436,7 +436,7 @@ endif
if has("keymap")
let s:did_setup_keymaps = 0
func! s:SetupKeymaps() abort
func s:SetupKeymaps() abort
if s:did_setup_keymaps
return
endif
@@ -509,7 +509,7 @@ if has("spell")
an <silent> 40.335.270 &Tools.&Spelling.&Find\ More\ Languages :call <SID>SpellLang()<CR>
let s:undo_spellang = ['aun &Tools.&Spelling.&Find\ More\ Languages']
func! s:SpellLang()
func s:SpellLang()
for cmd in s:undo_spellang
exe "silent! " . cmd
endfor
@@ -621,7 +621,7 @@ an <silent> 40.540 &Tools.Conve&rt\ Back<Tab>:%!xxd\ -r
" Use a function to do the conversion, so that it also works with 'insertmode'
" set.
func! s:XxdConv()
func s:XxdConv()
let mod = &mod
if has("vms")
%!mc vim:xxd
@@ -635,7 +635,7 @@ func! s:XxdConv()
let &mod = mod
endfun
func! s:XxdBack()
func s:XxdBack()
let mod = &mod
if has("vms")
%!mc vim:xxd -r
@@ -648,7 +648,7 @@ func! s:XxdBack()
let &mod = mod
endfun
func! s:XxdFind()
func s:XxdFind()
if !exists("g:xxdprogram")
" On the PC xxd may not be in the path but in the install directory
if has("win32") && !executable("xxd")
@@ -665,7 +665,7 @@ endfun
let s:did_setup_compilers = 0
" Setup the Tools.Compiler submenu
func! s:SetupCompilers() abort
func s:SetupCompilers() abort
if s:did_setup_compilers
return
endif
@@ -689,7 +689,7 @@ endif
" Load ColorScheme, Compiler Setting and Keymap menus when idle.
if !exists("do_no_lazyload_menus")
func! s:SetupLazyloadMenus()
func s:SetupLazyloadMenus()
call s:SetupColorSchemes()
call s:SetupCompilers()
if has("keymap")
@@ -711,33 +711,34 @@ if !exists("no_buffers_menu")
" startup faster.
let s:bmenu_wait = 1
" dictionary of buffer ID to name. This helps prevent bugs where a buffer is
" somehow being renamed and we can't remove it from the menu because we are
" using the wrong menu name.
" Dictionary of buffer number to name. This helps prevent problems where a
" buffer as renamed and we didn't keep track of that.
let s:bmenu_items = {}
if !exists("bmenu_priority")
let bmenu_priority = 60
endif
func! s:BMAdd()
" invoked from a BufCreate or BufFilePost autocommand
func s:BMAdd()
if s:bmenu_wait == 0
" when adding too many buffers, redraw in short format
if s:bmenu_count == &menuitems && s:bmenu_short == 0
call s:BMShow()
else
call <SID>BMFilename(expand("<afile>"), expand("<abuf>"))
let s:bmenu_count = s:bmenu_count + 1
let name = expand("<afile>")
let num = expand("<abuf>")
if s:BMCanAdd(name, num)
call <SID>BMFilename(name, num)
let s:bmenu_count += 1
endif
endif
endif
endfunc
func! s:BMRemove()
" invoked from a BufDelete or BufFilePre autocommand
func s:BMRemove()
if s:bmenu_wait == 0
let name = expand("<afile>")
if isdirectory(name)
return
endif
let bufnum = expand("<abuf>")
if s:bmenu_items->has_key(bufnum)
let menu_name = s:bmenu_items[bufnum]
@@ -748,8 +749,26 @@ func! s:BMRemove()
endif
endfunc
" Return non-zero if buffer with number "name" / "num" is useful to add in the
" buffer menu.
func s:BMCanAdd(name, num)
" no directory or unlisted buffer
if isdirectory(a:name) || !buflisted(a:num)
return 0
endif
" no special buffer, such as terminal or popup
let buftype = getbufvar(a:num, '&buftype')
if buftype != '' && buftype != 'nofile' && buftype != 'nowrite'
return 0
endif
" only existing buffers
return bufexists(a:num)
endfunc
" Create the buffer menu (delete an existing one first).
func! s:BMShow(...)
func s:BMShow(...)
let s:bmenu_wait = 1
let s:bmenu_short = 1
let s:bmenu_count = 0
@@ -760,7 +779,7 @@ func! s:BMShow(...)
let g:bmenu_priority = a:1
endif
" Remove old menu, if exists; keep one entry to avoid a torn off menu to
" Remove old menu, if it exists; keep one entry to avoid a torn off menu to
" disappear. Use try/catch to avoid setting v:errmsg
try | unmenu &Buffers | catch | endtry
exe 'noremenu ' . g:bmenu_priority . ".1 &Buffers.Dummy l"
@@ -781,7 +800,7 @@ func! s:BMShow(...)
" figure out how many buffers there are
let buf = 1
while buf <= bufnr('$')
if bufexists(buf) && !isdirectory(bufname(buf)) && buflisted(buf)
if s:BMCanAdd(bufname(buf), buf)
let s:bmenu_count = s:bmenu_count + 1
endif
let buf = buf + 1
@@ -793,8 +812,9 @@ func! s:BMShow(...)
" iterate through buffer list, adding each buffer to the menu:
let buf = 1
while buf <= bufnr('$')
if bufexists(buf) && !isdirectory(bufname(buf)) && buflisted(buf)
call <SID>BMFilename(bufname(buf), buf)
let name = bufname(buf)
if s:BMCanAdd(name, buf)
call <SID>BMFilename(name, buf)
endif
let buf = buf + 1
endwhile
@@ -806,7 +826,7 @@ func! s:BMShow(...)
aug END
endfunc
func! s:BMHash(name)
func s:BMHash(name)
" Make name all upper case, so that chars are between 32 and 96
let nm = substitute(a:name, ".*", '\U\0', "")
if has("ebcdic")
@@ -821,7 +841,7 @@ func! s:BMHash(name)
return (char2nr(nm[0]) - sp) * 0x800000 + (char2nr(nm[1]) - sp) * 0x20000 + (char2nr(nm[2]) - sp) * 0x1000 + (char2nr(nm[3]) - sp) * 0x80 + (char2nr(nm[4]) - sp) * 0x20 + (char2nr(nm[5]) - sp)
endfunc
func! s:BMHash2(name)
func s:BMHash2(name)
let nm = substitute(a:name, ".", '\L\0', "")
" Not exactly right for EBCDIC...
if nm[0] < 'a' || nm[0] > 'z'
@@ -841,25 +861,22 @@ func! s:BMHash2(name)
endif
endfunc
" insert a buffer name into the buffer menu:
func! s:BMFilename(name, num)
if isdirectory(a:name)
return
endif
" Insert a buffer name into the buffer menu.
func s:BMFilename(name, num)
let munge = <SID>BMMunge(a:name, a:num)
let hash = <SID>BMHash(munge)
if s:bmenu_short == 0
let s:bmenu_items[a:num] = munge
let name = 'an ' . g:bmenu_priority . '.' . hash . ' &Buffers.' . munge
let cmd = 'an ' . g:bmenu_priority . '.' . hash . ' &Buffers.' . munge
else
let menu_name = <SID>BMHash2(munge) . munge
let s:bmenu_items[a:num] = l:menu_name
let name = 'an ' . g:bmenu_priority . '.' . hash . '.' . hash . ' &Buffers.' . menu_name
let s:bmenu_items[a:num] = menu_name
let cmd = 'an ' . g:bmenu_priority . '.' . hash . '.' . hash . ' &Buffers.' . menu_name
endif
" set 'cpo' to include the <CR>
let cpo_save = &cpo
set cpo&vim
exe name . ' :confirm b' . a:num . '<CR>'
exe cmd . ' :confirm b' . a:num . '<CR>'
let &cpo = cpo_save
endfunc
@@ -867,7 +884,7 @@ endfunc
if !exists("g:bmenu_max_pathlen")
let g:bmenu_max_pathlen = 35
endif
func! s:BMTruncName(fname)
func s:BMTruncName(fname)
let name = a:fname
if g:bmenu_max_pathlen < 5
let name = ""
@@ -887,7 +904,7 @@ func! s:BMTruncName(fname)
return name
endfunc
func! s:BMMunge(fname, bnum)
func s:BMMunge(fname, bnum)
let name = a:fname
if name == ''
if !exists("g:menutrans_no_file")
@@ -1007,7 +1024,7 @@ cnoremenu <script> <silent> 1.100 PopUp.Select\ &All <C-U>call <SID>SelectAll()<
if has("spell")
" Spell suggestions in the popup menu. Note that this will slow down the
" appearance of the menu!
func! <SID>SpellPopup()
func s:SpellPopup()
if exists("s:changeitem") && s:changeitem != ''
call <SID>SpellDel()
endif
@@ -1063,7 +1080,7 @@ if has("spell")
call cursor(0, curcol) " put the cursor back where it was
endfunc
func! <SID>SpellReplace(n)
func s:SpellReplace(n)
let l = getline('.')
" Move the cursor to the start of the word.
call spellbadword()
@@ -1071,7 +1088,7 @@ if has("spell")
\ . strpart(l, col('.') + len(s:fromword) - 1))
endfunc
func! <SID>SpellDel()
func s:SpellDel()
exe "aunmenu PopUp." . s:changeitem
exe "aunmenu PopUp." . s:additem
exe "aunmenu PopUp." . s:ignoreitem
+11 -6
View File
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: awk, nawk, gawk, mawk
" Maintainer: Antonio Colombo <azc100@gmail.com>
" Last Change: 2016 Sep 05
" Last Change: 2020 Mar 25
" AWK ref. is: Alfred V. Aho, Brian W. Kernighan, Peter J. Weinberger
" The AWK Programming Language, Addison-Wesley, 1988
@@ -9,7 +9,7 @@
" GAWK ref. is: Arnold D. Robbins
" Effective AWK Programming, Third Edition, O'Reilly, 2001
" Effective AWK Programming, Fourth Edition, O'Reilly, 2015
" (also available and updated with the gawk source distribution)
" (up-to-date version available with the gawk source distribution)
" MAWK is a "new awk" meaning it implements AWK ref.
" mawk conforms to the Posix 1003.2 (draft 11.3)
@@ -33,14 +33,19 @@ syn keyword awkStatement break continue delete exit
syn keyword awkStatement function getline next
syn keyword awkStatement print printf return
" GAWK ref. Chapter 7-9
syn keyword awkStatement switch nextfile
syn keyword awkStatement case default switch nextfile
syn keyword awkStatement func
" GAWK ref. Chapter 2.7, Including Other Files into Your Program
" GAWK ref. Chapter 2.8, Loading Dynamic Extensions into Your Program
" GAWK ref. Chapter 15, Namespaces
" Directives
syn keyword awkStatement @include @load @namespace
"
" GAWK ref. Chapter 9, Functions
" Numeric Functions
syn keyword awkFunction atan2 cos exp int intdiv log rand sin sqrt srand
syn keyword awkFunction atan2 cos exp int log rand sin sqrt srand
" String Manipulation Functions
syn keyword awkFunction asort asort1 gensub gsub index length match
syn keyword awkFunction asort asorti gensub gsub index length match
syn keyword awkFunction patsplit split sprintf strtonum sub substr
syn keyword awkFunction tolower toupper
" Input Output Functions
@@ -49,7 +54,7 @@ syn keyword awkFunction close fflush system
syn keyword awkFunction mktime strftime systime
" Bit Manipulation Functions
syn keyword awkFunction and compl lshift or rshift xor
" Getting Type Functions
" Getting Type Information Functions
syn keyword awkFunction isarray typeof
" String-Translation Functions
syn keyword awkFunction bindtextdomain dcgettext dcngetext
+17
View File
@@ -0,0 +1,17 @@
" Vim syntax file
" Language: Boundary Scan Description Language (BSDL)
" Maintainer: Daniel Kho <daniel.kho@logik.haus>
" Last Changed: 2020 Mar 19 by Daniel Kho
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
" Read in VHDL syntax files
runtime! syntax/vhdl.vim
unlet b:current_syntax
let b:current_syntax = "bsdl"
" vim: ts=8
+4 -3
View File
@@ -3,8 +3,8 @@
" Maintainer: Jorge Maldonado Ventura <jorgesumle@freakspot.net>
" Previous Maintainer: Claudio Fleiner <claudio@fleiner.com>
" Repository: https://notabug.org/jorgesumle/vim-html-syntax
" Last Change: 2019 Dec 24
" Included patch from Jorge Maldonado Ventura to add the dialog element
" Last Change: 2020 Mar 17
" Included patch from Florian Breisch to add the summary element
"
" Please check :help html.vim for some comments and a description of the options
@@ -61,7 +61,8 @@ syn keyword htmlTagName contained datalist details dialog embed figcaption
syn keyword htmlTagName contained figure footer header hgroup keygen main
syn keyword htmlTagName contained mark menuitem meter nav output picture
syn keyword htmlTagName contained progress rb rp rt rtc ruby section
syn keyword htmlTagName contained slot source template time track video wbr
syn keyword htmlTagName contained slot source summary template time track
syn keyword htmlTagName contained video wbr
" legal arg names
syn keyword htmlArg contained action
+10 -9
View File
@@ -1,23 +1,24 @@
" Vim syntax file
" Language: Jargon File
" Maintainer: Dan Church (https://github.com/h3xx)
" Last Change: 2019 Sep 27
" Last Change: 2020 Mar 16
"
" quit when a syntax file was already loaded
if exists("b:current_syntax")
finish
endif
syn match jargonChaptTitle /:[^:]*:/
syn match jargonEmailAddr /[^<@ ^I]*@[^ ^I>]*/
syn match jargonUrl +\(http\|ftp\)://[^\t )"]*+
syn region jargonMark start="{" end="}"
syn region jargonHeader start="^:" end="$" contains=jargonChaptTitle
syn match jargonChaptTitle /:[^:]*:/ contained
syn match jargonEmailAddr /[+._A-Za-z0-9-]\+@[+._A-Za-z0-9-]\+/
syn match jargonUrl +\(https\?\|ftp\)://[^\t )"]*+
syn region jargonMark start="{[^\t {}]" end="}"
" Define the default highlighting.
" Only when an item doesn't have highlighting yet
hi def link jargonChaptTitle Title
hi def link jargonEmailAddr Comment
hi def link jargonUrl Comment
hi def link jargonMark Label
hi def link jargonChaptTitle Title
hi def link jargonEmailAddr Comment
hi def link jargonUrl Comment
hi def link jargonMark Label
let b:current_syntax = "jargon"
+6 -6
View File
@@ -1,9 +1,9 @@
" Vim syntax file
" Language: VHDL [VHSIC (Very High Speed Integrated Circuit) Hardware Description Language]
" Maintainer: Daniel Kho <daniel.kho@tauhop.com>
" Maintainer: Daniel Kho <daniel.kho@logik.haus>
" Previous Maintainer: Czo <Olivier.Sirol@lip6.fr>
" Credits: Stephan Hegel <stephan.hegel@snc.siemens.com.cn>
" Last Changed: 2018 May 06 by Daniel Kho
" Last Changed: 2020 Mar 09 by Daniel Kho
" quit when a syntax file was already loaded
if exists("b:current_syntax")
@@ -43,7 +43,7 @@ syn keyword vhdlStatement sequence strong
syn keyword vhdlStatement then to transport type
syn keyword vhdlStatement unaffected units until use
syn keyword vhdlStatement variable
" VHDL-2017 interface
" VHDL-2019 interface
syn keyword vhdlStatement view
syn keyword vhdlStatement vmode vprop vunit
syn keyword vhdlStatement wait when while with
@@ -124,7 +124,7 @@ syn match vhdlAttribute "\'succ"
syn match vhdlAttribute "\'val"
syn match vhdlAttribute "\'image"
syn match vhdlAttribute "\'value"
" VHDL-2017 interface attribute
" VHDL-2019 interface attribute
syn match vhdlAttribute "\'converse"
syn keyword vhdlBoolean true false
@@ -167,7 +167,7 @@ syn match vhdlOperator "=\|\/=\|>\|<\|>="
syn match vhdlOperator "<=\|:="
syn match vhdlOperator "=>"
" VHDL-2017 concurrent signal association (spaceship) operator
" VHDL-202x concurrent signal association (spaceship) operator
syn match vhdlOperator "<=>"
" VHDL-2008 conversion, matching equality/non-equality operators
@@ -188,7 +188,7 @@ syn match vhdlError "\(<\)[&+\-\/\\]\+"
syn match vhdlError "[>=&+\-\/\\]\+\(<\)"
" Covers most operators
" support negative sign after operators. E.g. q<=-b;
" Supports VHDL-2017 spaceship (concurrent simple signal association).
" Supports VHDL-202x spaceship (concurrent simple signal association).
syn match vhdlError "\(<=\)[<=&+\*\\?:]\+"
syn match vhdlError "[>=&+\-\*\\:]\+\(=>\)"
syn match vhdlError "\(&\|+\|\-\|\*\*\|\/=\|??\|?=\|?\/=\|?<=\|?>=\|>=\|:=\|=>\)[<>=&+\*\\?:]\+"
+1
View File
@@ -710,6 +710,7 @@ OBJ = \
$(OUTDIR)/change.o \
$(OUTDIR)/charset.o \
$(OUTDIR)/cindent.o \
$(OUTDIR)/clipboard.o \
$(OUTDIR)/cmdexpand.o \
$(OUTDIR)/cmdhist.o \
$(OUTDIR)/crypt.o \
+1
View File
@@ -33,6 +33,7 @@ SRC = arabic.c \
change.c \
charset.c \
cindent.c \
clipboard.c \
cmdexpand.c \
cmdhist.c \
crypt.c \
+9 -4
View File
@@ -38,7 +38,8 @@
# is yes)
# Global IME support: GIME=yes (requires GUI=yes)
#
# Terminal support: TERMINAL=yes (default is yes)
# Terminal support: TERMINAL=yes (default is yes if FEATURES is HUGE)
# Will also enable CHANNEL
#
# Sound support: SOUND=yes (default is yes)
#
@@ -109,13 +110,13 @@
# PostScript printing: POSTSCRIPT=yes (default is no)
#
# Netbeans Support: NETBEANS=[yes or no] (default is yes if GUI is yes)
# Requires CHANNEL.
# Requires CHANNEL.
#
# Netbeans Debugging Support: NBDEBUG=[yes or no] (should be no, yes
# doesn't work)
#
# Inter process communication: CHANNEL=[yes or no] (default is yes if GUI
# is yes)
# is yes or TERMINAL is yes)
#
# XPM Image Support: XPM=[path to XPM directory]
# Default is "xpm", using the files included in the distribution.
@@ -388,7 +389,7 @@ NETBEANS = $(GUI)
!endif
!ifndef CHANNEL
! if "$(FEATURES)"=="HUGE"
! if "$(FEATURES)"=="HUGE" || "$(TERMINAL)"=="yes"
CHANNEL = yes
! else
CHANNEL = $(GUI)
@@ -729,6 +730,7 @@ OBJ = \
$(OUTDIR)\change.obj \
$(OUTDIR)\charset.obj \
$(OUTDIR)\cindent.obj \
$(OUTDIR)\clipboard.obj \
$(OUTDIR)\cmdexpand.obj \
$(OUTDIR)\cmdhist.obj \
$(OUTDIR)\crypt.obj \
@@ -1514,6 +1516,8 @@ $(OUTDIR)/charset.obj: $(OUTDIR) charset.c $(INCL)
$(OUTDIR)/cindent.obj: $(OUTDIR) cindent.c $(INCL)
$(OUTDIR)/clipboard.obj: $(OUTDIR) clipboard.c $(INCL)
$(OUTDIR)/cmdexpand.obj: $(OUTDIR) cmdexpand.c $(INCL)
$(OUTDIR)/cmdhist.obj: $(OUTDIR) cmdhist.c $(INCL)
@@ -1861,6 +1865,7 @@ proto.h: \
proto/change.pro \
proto/charset.pro \
proto/cindent.pro \
proto/clipboard.pro \
proto/cmdexpand.pro \
proto/cmdhist.pro \
proto/crypt.pro \
+6
View File
@@ -306,6 +306,7 @@ SRC = \
change.c \
charset.c \
cindent.c \
clipboard.c \
cmdexpand.c \
cmdhist.c \
crypt.c \
@@ -412,6 +413,7 @@ OBJ = \
change.obj \
charset.obj \
cindent.obj \
clipboard.obj \
cmdexpand.obj \
cmdhist.obj \
crypt.obj \
@@ -700,6 +702,10 @@ cindent.obj : cindent.c vim.h [.auto]config.h feature.h os_unix.h \
ascii.h keymap.h term.h macros.h structs.h regexp.h \
gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \
globals.h
clipboard.obj : clipboard.c vim.h [.auto]config.h feature.h os_unix.h \
ascii.h keymap.h term.h macros.h structs.h regexp.h \
gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \
globals.h
cmdexpand.obj : cmdexpand.c vim.h [.auto]config.h feature.h os_unix.h \
ascii.h keymap.h term.h macros.h structs.h regexp.h \
gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \
+10
View File
@@ -1616,6 +1616,7 @@ BASIC_SRC = \
change.c \
charset.c \
cindent.c \
clipboard.c \
cmdexpand.c \
cmdhist.c \
crypt.c \
@@ -1760,6 +1761,7 @@ OBJ_COMMON = \
objects/blob.o \
objects/blowfish.o \
objects/cindent.o \
objects/clipboard.o \
objects/cmdexpand.o \
objects/cmdhist.o \
objects/crypt.o \
@@ -1920,6 +1922,7 @@ PRO_AUTO = \
channel.pro \
charset.pro \
cindent.pro \
clipboard.pro \
cmdexpand.pro \
cmdhist.pro \
crypt.pro \
@@ -3140,6 +3143,9 @@ objects/charset.o: charset.c
objects/cindent.o: cindent.c
$(CCC) -o $@ cindent.c
objects/clipboard.o: clipboard.c
$(CCC) -o $@ clipboard.c
objects/cmdexpand.o: cmdexpand.c
$(CCC) -o $@ cmdexpand.c
@@ -3803,6 +3809,10 @@ objects/cindent.o: cindent.c vim.h protodef.h auto/config.h feature.h os_unix.h
auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \
proto.h globals.h
objects/clipboard.o: clipboard.c vim.h protodef.h auto/config.h feature.h os_unix.h \
auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \
proto.h globals.h
objects/cmdexpand.o: cmdexpand.c vim.h protodef.h auto/config.h feature.h \
os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \
+1
View File
@@ -30,6 +30,7 @@ buffer.c | manipulating buffers (loaded files)
bufwrite.c | writing a buffer to file
change.c | handling changes to text
cindent.c | C and Lisp indentation
clipboard.c | handling the clipboard
cmdexpand.c | command-line completion
cmdhist.c | command-line history
debugger.c | vim script debugger
+3
View File
@@ -2018,7 +2018,10 @@ buflist_new(
apply_autocmds(EVENT_BUFWIPEOUT, NULL, NULL, FALSE, curbuf);
#ifdef FEAT_EVAL
if (aborting()) // autocmds may abort script processing
{
vim_free(ffname);
return NULL;
}
#endif
if (buf == curbuf)
{
+54 -27
View File
@@ -399,6 +399,7 @@ channel_can_close(channel_T *channel)
/*
* Close a channel and free all its resources.
* The "channel" pointer remains valid.
*/
static void
channel_free_contents(channel_T *channel)
@@ -408,6 +409,9 @@ channel_free_contents(channel_T *channel)
ch_log(channel, "Freeing channel");
}
/*
* Unlink "channel" from the list of channels and free it.
*/
static void
channel_free_channel(channel_T *channel)
{
@@ -500,10 +504,8 @@ free_unused_channels(int copyID, int mask)
ch_next = ch->ch_next;
if (!channel_still_useful(ch)
&& (ch->ch_copyID & mask) != (copyID & mask))
{
// Free the channel struct itself.
channel_free_channel(ch);
}
}
}
@@ -4468,14 +4470,20 @@ channel_parse_messages(void)
int ret = FALSE;
int r;
ch_part_T part = PART_SOCK;
static int recursive = 0;
#ifdef ELAPSED_FUNC
elapsed_T start_tv;
ELAPSED_INIT(start_tv);
#endif
// The code below may invoke callbacks, which might call us back.
// In a recursive call channels will not be closed.
++recursive;
++safe_to_invoke_callback;
#ifdef ELAPSED_FUNC
ELAPSED_INIT(start_tv);
#endif
// Only do this message when another message was given, otherwise we get
// lots of them.
if ((did_repeated_msg & REPEATED_MSG_LOOKING) == 0)
@@ -4486,34 +4494,37 @@ channel_parse_messages(void)
}
while (channel != NULL)
{
if (channel_can_close(channel))
if (recursive == 1)
{
channel->ch_to_be_closed = (1U << PART_COUNT);
channel_close_now(channel);
// channel may have been freed, start over
channel = first_channel;
continue;
}
if (channel->ch_to_be_freed || channel->ch_killing)
{
if (channel->ch_killing)
if (channel_can_close(channel))
{
channel->ch_to_be_closed = (1U << PART_COUNT);
channel_close_now(channel);
// channel may have been freed, start over
channel = first_channel;
continue;
}
if (channel->ch_to_be_freed || channel->ch_killing)
{
channel_free_contents(channel);
channel->ch_job->jv_channel = NULL;
if (channel->ch_job != NULL)
channel->ch_job->jv_channel = NULL;
// free the channel and then start over
channel_free_channel(channel);
channel = first_channel;
continue;
}
if (channel->ch_refcount == 0 && !channel_still_useful(channel))
{
// channel is no longer useful, free it
channel_free(channel);
channel = first_channel;
part = PART_SOCK;
continue;
}
channel_free(channel);
// channel has been freed, start over
channel = first_channel;
continue;
}
if (channel->ch_refcount == 0 && !channel_still_useful(channel))
{
// channel is no longer useful, free it
channel_free(channel);
channel = first_channel;
part = PART_SOCK;
continue;
}
if (channel->ch_part[part].ch_fd != INVALID_FD
|| channel_has_readahead(channel, part))
{
@@ -4554,6 +4565,7 @@ channel_parse_messages(void)
}
--safe_to_invoke_callback;
--recursive;
return ret;
}
@@ -5200,6 +5212,21 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
memcpy(opt->jo_ansi_colors, rgb, sizeof(rgb));
}
# endif
else if (STRCMP(hi->hi_key, "term_highlight") == 0)
{
char_u *p;
if (!(supported2 & JO2_TERM_HIGHLIGHT))
break;
opt->jo_set2 |= JO2_TERM_HIGHLIGHT;
p = tv_get_string_buf_chk(item, opt->jo_term_highlight_buf);
if (p == NULL || *p == NUL)
{
semsg(_(e_invargval), "term_highlight");
return FAIL;
}
opt->jo_term_highlight = p;
}
else if (STRCMP(hi->hi_key, "term_api") == 0)
{
if (!(supported2 & JO2_TERM_API))
+2216
View File
File diff suppressed because it is too large Load Diff
+8 -4
View File
@@ -826,7 +826,8 @@ eval_dict(char_u **arg, typval_T *rettv, int evaluate, int literal)
if (**arg != ':')
{
semsg(_(e_missing_dict_colon), *arg);
if (evaluate)
semsg(_(e_missing_dict_colon), *arg);
clear_tv(&tvkey);
goto failret;
}
@@ -853,7 +854,8 @@ eval_dict(char_u **arg, typval_T *rettv, int evaluate, int literal)
item = dict_find(d, key, -1);
if (item != NULL)
{
semsg(_(e_duplicate_key), key);
if (evaluate)
semsg(_(e_duplicate_key), key);
clear_tv(&tvkey);
clear_tv(&tv);
goto failret;
@@ -873,7 +875,8 @@ eval_dict(char_u **arg, typval_T *rettv, int evaluate, int literal)
break;
if (**arg != ',')
{
semsg(_(e_missing_dict_comma), *arg);
if (evaluate)
semsg(_(e_missing_dict_comma), *arg);
goto failret;
}
*arg = skipwhite(*arg + 1);
@@ -881,7 +884,8 @@ eval_dict(char_u **arg, typval_T *rettv, int evaluate, int literal)
if (**arg != '}')
{
semsg(_(e_missing_dict_end), *arg);
if (evaluate)
semsg(_(e_missing_dict_end), *arg);
failret:
if (d != NULL)
dict_free(d);
+31 -72
View File
@@ -847,8 +847,7 @@ install_bat_choice(int idx)
/*
* Don't use double quotes for the "set" argument, also when it
* contains a space. The quotes would be included in the value
* for MSDOS and NT.
* contains a space. The quotes would be included in the value.
* The order of preference is:
* 1. $VIMRUNTIME/vim.exe (user preference)
* 2. $VIM/vim81/vim.exe (hard coded version)
@@ -861,92 +860,52 @@ install_bat_choice(int idx)
fprintf(fd, "\n");
// Give an error message when the executable could not be found.
fprintf(fd, "if exist \"%%VIM_EXE_DIR%%\\%s\" goto havevim\n",
exename);
fprintf(fd, "echo \"%%VIM_EXE_DIR%%\\%s\" not found\n", exename);
fprintf(fd, "goto eof\n");
fprintf(fd, "if not exist \"%%VIM_EXE_DIR%%\\%s\" (\n", exename);
fprintf(fd, " echo \"%%VIM_EXE_DIR%%\\%s\" not found\n", exename);
fprintf(fd, " goto :eof\n");
fprintf(fd, ")\n");
fprintf(fd, "\n");
fprintf(fd, ":havevim\n");
fprintf(fd, "rem collect the arguments in VIMARGS for Win95\n");
fprintf(fd, "set VIMARGS=\n");
if (*exename == 'g')
{
fprintf(fd, "rem check --nofork argument\n");
fprintf(fd, "set VIMNOFORK=\n");
fprintf(fd, ":loopstart\n");
fprintf(fd, "if .%%1==. goto loopend\n");
if (*exename == 'g')
{
fprintf(fd, "if NOT .%%1==.--nofork goto noforklongarg\n");
fprintf(fd, "set VIMNOFORK=1\n");
fprintf(fd, ":noforklongarg\n");
fprintf(fd, "if NOT .%%1==.-f goto noforkarg\n");
fprintf(fd, "set VIMNOFORK=1\n");
fprintf(fd, ":noforkarg\n");
}
fprintf(fd, "set VIMARGS=%%VIMARGS%% %%1\n");
fprintf(fd, "shift\n");
fprintf(fd, "goto loopstart\n");
fprintf(fd, ":loopend\n");
fprintf(fd, "\n");
fprintf(fd, "if .%%OS%%==.Windows_NT goto ntaction\n");
fprintf(fd, "\n");
// For gvim.exe use "start" to avoid that the console window stays
// open.
if (*exename == 'g')
{
fprintf(fd, "if .%%VIMNOFORK%%==.1 goto nofork\n");
fprintf(fd, "start ");
}
// Always use quotes, $VIM or $VIMRUNTIME might have a space.
fprintf(fd, "\"%%VIM_EXE_DIR%%\\%s\" %s %%VIMARGS%%\n",
exename, vimarg);
fprintf(fd, "goto eof\n");
fprintf(fd, "\n");
if (*exename == 'g')
{
fprintf(fd, ":nofork\n");
fprintf(fd, "start /w ");
// Always use quotes, $VIM or $VIMRUNTIME might have a space.
fprintf(fd, "\"%%VIM_EXE_DIR%%\\%s\" %s %%VIMARGS%%\n",
exename, vimarg);
fprintf(fd, "goto eof\n");
fprintf(fd, ":loopstart\n");
fprintf(fd, "if .%%1==. goto loopend\n");
fprintf(fd, "if .%%1==.--nofork (\n");
fprintf(fd, " set VIMNOFORK=1\n");
fprintf(fd, ") else if .%%1==.-f (\n");
fprintf(fd, " set VIMNOFORK=1\n");
fprintf(fd, ")\n");
fprintf(fd, "shift\n");
fprintf(fd, "goto loopstart\n");
fprintf(fd, ":loopend\n");
fprintf(fd, "\n");
}
fprintf(fd, ":ntaction\n");
fprintf(fd, "rem for WinNT we can use %%*\n");
// For gvim.exe use "start /b" to avoid that the console window
// stays open.
if (*exename == 'g')
{
fprintf(fd, "if .%%VIMNOFORK%%==.1 goto noforknt\n");
fprintf(fd, "start \"dummy\" /b ");
// For gvim.exe use "start /b" to avoid that the console window
// stays open.
fprintf(fd, "if .%%VIMNOFORK%%==.1 (\n");
fprintf(fd, " start \"dummy\" /b /wait ");
// Always use quotes, $VIM or $VIMRUNTIME might have a space.
fprintf(fd, "\"%%VIM_EXE_DIR%%\\%s\" %s %%*\n",
exename, vimarg);
fprintf(fd, ") else (\n");
fprintf(fd, " start \"dummy\" /b ");
// Always use quotes, $VIM or $VIMRUNTIME might have a space.
fprintf(fd, "\"%%VIM_EXE_DIR%%\\%s\" %s %%*\n",
exename, vimarg);
fprintf(fd, ")\n");
}
// Always use quotes, $VIM or $VIMRUNTIME might have a space.
fprintf(fd, "\"%%VIM_EXE_DIR%%\\%s\" %s %%*\n", exename, vimarg);
fprintf(fd, "goto eof\n");
fprintf(fd, "\n");
if (*exename == 'g')
else
{
fprintf(fd, ":noforknt\n");
fprintf(fd, "start \"dummy\" /b /wait ");
// Always use quotes, $VIM or $VIMRUNTIME might have a space.
fprintf(fd, "\"%%VIM_EXE_DIR%%\\%s\" %s %%*\n",
exename, vimarg);
}
fprintf(fd, "\n:eof\n");
fprintf(fd, "set VIMARGS=\n");
if (*exename == 'g')
fprintf(fd, "set VIMNOFORK=\n");
fclose(fd);
printf("%s has been %s\n", batpath,
oldname == NULL ? "created" : "overwritten");
+2 -1
View File
@@ -270,7 +270,6 @@ win_line(
int tocol = MAXCOL; // end of inverting
int fromcol_prev = -2; // start of inverting after cursor
int noinvcur = FALSE; // don't invert the cursor
pos_T *top, *bot;
int lnum_in_visual_area = FALSE;
pos_T pos;
long v;
@@ -535,6 +534,8 @@ win_line(
// handle Visual active in this window
if (VIsual_active && wp->w_buffer == curwin->w_buffer)
{
pos_T *top, *bot;
if (LTOREQ_POS(curwin->w_cursor, VIsual))
{
// Visual is after curwin->w_cursor
+2 -2
View File
@@ -2848,7 +2848,7 @@ eval_lambda(
if (verbose)
{
if (*skipwhite(*arg) == '(')
semsg(_(e_nowhitespace));
emsg(_(e_nowhitespace));
else
semsg(_(e_missing_paren), "lambda");
}
@@ -2910,7 +2910,7 @@ eval_method(
else if (VIM_ISWHITE((*arg)[-1]))
{
if (verbose)
semsg(_(e_nowhitespace));
emsg(_(e_nowhitespace));
ret = FAIL;
}
else
+1539 -757
View File
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -810,7 +810,8 @@ f_win_splitmove(typval_T *argvars, typval_T *rettv)
targetwin = find_win_by_nr_or_id(&argvars[1]);
if (wp == NULL || targetwin == NULL || wp == targetwin
|| !win_valid(wp) || !win_valid(targetwin))
|| !win_valid(wp) || !win_valid(targetwin)
|| win_valid_popup(wp) || win_valid_popup(targetwin))
{
emsg(_(e_invalwindow));
rettv->vval.v_number = -1;
+2 -5
View File
@@ -2074,8 +2074,8 @@ check_overwrite(
int other) // writing under other name
{
/*
* write to other file or b_flags set or not writing the whole file:
* overwriting only allowed with '!'
* Write to another file or b_flags set or not writing the whole file:
* overwriting only allowed with '!'.
*/
if ( (other
|| (buf->b_flags & BF_NOTEDITED)
@@ -2083,9 +2083,6 @@ check_overwrite(
&& vim_strchr(p_cpo, CPO_OVERNEW) == NULL)
|| (buf->b_flags & BF_READERR))
&& !p_wa
#ifdef FEAT_QUICKFIX
&& !bt_nofilename(buf)
#endif
&& vim_fexists(ffname))
{
if (!eap->forceit && !eap->append)
+2 -2
View File
@@ -584,7 +584,7 @@ EXCMD(CMD_filter, "filter", ex_wrongmodifier,
EX_BANG|EX_NEEDARG|EX_EXTRA|EX_NOTRLCOM,
ADDR_NONE),
EXCMD(CMD_find, "find", ex_find,
EX_RANGE|EX_BANG|EX_FILE1|EX_CMDARG|EX_ARGOPT|EX_TRLBAR,
EX_RANGE|EX_BANG|EX_FILE1|EX_CMDARG|EX_ARGOPT|EX_TRLBAR|EX_NEEDARG,
ADDR_OTHER),
EXCMD(CMD_finally, "finally", ex_finally,
EX_TRLBAR|EX_SBOXOK|EX_CMDWIN,
@@ -1340,7 +1340,7 @@ EXCMD(CMD_setlocal, "setlocal", ex_set,
EX_BANG|EX_TRLBAR|EX_EXTRA|EX_CMDWIN|EX_SBOXOK,
ADDR_NONE),
EXCMD(CMD_sfind, "sfind", ex_splitview,
EX_BANG|EX_FILE1|EX_RANGE|EX_CMDARG|EX_ARGOPT|EX_TRLBAR,
EX_BANG|EX_FILE1|EX_RANGE|EX_CMDARG|EX_ARGOPT|EX_TRLBAR|EX_NEEDARG,
ADDR_OTHER),
EXCMD(CMD_sfirst, "sfirst", ex_rewind,
EX_EXTRA|EX_BANG|EX_CMDARG|EX_ARGOPT|EX_TRLBAR,
+12
View File
@@ -1352,6 +1352,18 @@ do_cmdline(
restore_dbg_stuff(&debug_saved);
msg_list = saved_msg_list;
// Cleanup if "cs_emsg_silent_list" remains.
if (cstack.cs_emsg_silent_list != NULL)
{
eslist_T *elem, *temp;
for (elem = cstack.cs_emsg_silent_list; elem != NULL; elem = temp)
{
temp = elem->next;
vim_free(elem);
}
}
#endif // FEAT_EVAL
/*
+1
View File
@@ -4200,6 +4200,7 @@ open_cmdwin(void)
if (win_split((int)p_cwh, WSP_BOT) == FAIL)
{
beep_flush();
ga_clear(&winsizes);
return K_IGNORE;
}
cmdwin_type = get_cmdline_type();
+2 -1
View File
@@ -1929,7 +1929,8 @@ f_writefile(typval_T *argvars, typval_T *rettv)
}
else
{
semsg(_(e_invarg2), "writefile()");
semsg(_(e_invarg2),
_("writefile() first argument must be a List or a Blob"));
return;
}
+1 -2
View File
@@ -384,9 +384,7 @@ EXTERN type_T t_void INIT4(VAR_VOID, 0, NULL, NULL);
EXTERN type_T t_bool INIT4(VAR_BOOL, 0, NULL, NULL);
EXTERN type_T t_special INIT4(VAR_SPECIAL, 0, NULL, NULL);
EXTERN type_T t_number INIT4(VAR_NUMBER, 0, NULL, NULL);
# ifdef FEAT_FLOAT
EXTERN type_T t_float INIT4(VAR_FLOAT, 0, NULL, NULL);
# endif
EXTERN type_T t_string INIT4(VAR_STRING, 0, NULL, NULL);
EXTERN type_T t_blob INIT4(VAR_BLOB, 0, NULL, NULL);
EXTERN type_T t_job INIT4(VAR_JOB, 0, NULL, NULL);
@@ -1651,6 +1649,7 @@ EXTERN char e_func_deleted[] INIT(= N_("E933: Function was deleted: %s"));
EXTERN char e_dictkey[] INIT(= N_("E716: Key not present in Dictionary: %s"));
EXTERN char e_listreq[] INIT(= N_("E714: List required"));
EXTERN char e_listblobreq[] INIT(= N_("E897: List or Blob required"));
EXTERN char e_list_end[] INIT(= N_("E697: Missing end of List ']': %s"));
EXTERN char e_listdictarg[] INIT(= N_("E712: Argument of %s must be a List or Dictionary"));
EXTERN char e_listdictblobarg[] INIT(= N_("E896: Argument of %s must be a List, Dictionary or Blob"));
EXTERN char e_modulus[] INIT(= N_("E804: Cannot use '%' with Float"));
+11 -17
View File
@@ -542,7 +542,7 @@ gui_init(void)
if (STRCMP(use_gvimrc, "NONE") != 0
&& STRCMP(use_gvimrc, "NORC") != 0
&& do_source(use_gvimrc, FALSE, DOSO_NONE, NULL) != OK)
semsg(_("E230: Cannot read from \"%s\""), use_gvimrc, NULL);
semsg(_("E230: Cannot read from \"%s\""), use_gvimrc);
}
else
{
@@ -2664,18 +2664,19 @@ gui_outstr_nowrap(
/*
* Un-draw the cursor. Actually this just redraws the character at the given
* position. The character just before it too, for when it was in bold.
* position.
*/
void
gui_undraw_cursor(void)
{
if (gui.cursor_is_valid)
{
if (gui_redraw_block(gui.cursor_row, gui.cursor_col,
gui.cursor_row, gui.cursor_col, GUI_MON_NOCLEAR)
&& gui.cursor_col > 0)
(void)gui_redraw_block(gui.cursor_row, gui.cursor_col - 1,
gui.cursor_row, gui.cursor_col - 1, GUI_MON_NOCLEAR);
// Redraw the character just before too, if there is one, because with
// some fonts and characters there can be a one pixel overlap.
gui_redraw_block(gui.cursor_row,
gui.cursor_col > 0 ? gui.cursor_col - 1 : gui.cursor_col,
gui.cursor_row, gui.cursor_col, GUI_MON_NOCLEAR);
// Cursor_is_valid is reset when the cursor is undrawn, also reset it
// here in case it wasn't needed to undraw it.
gui.cursor_is_valid = FALSE;
@@ -2696,7 +2697,7 @@ gui_redraw(
row2 = Y_2_ROW(y + h - 1);
col2 = X_2_COL(x + w - 1);
(void)gui_redraw_block(row1, col1, row2, col2, GUI_MON_NOCLEAR);
gui_redraw_block(row1, col1, row2, col2, GUI_MON_NOCLEAR);
/*
* We may need to redraw the cursor, but don't take it upon us to change
@@ -2712,10 +2713,8 @@ gui_redraw(
/*
* Draw a rectangular block of characters, from row1 to row2 (inclusive) and
* from col1 to col2 (inclusive).
* Return TRUE when the character before the first drawn character has
* different attributes (may have to be redrawn too).
*/
int
void
gui_redraw_block(
int row1,
int col1,
@@ -2729,12 +2728,11 @@ gui_redraw_block(
sattr_T first_attr;
int idx, len;
int back, nback;
int retval = FALSE;
int orig_col1, orig_col2;
// Don't try to update when ScreenLines is not valid
if (!screen_cleared || ScreenLines == NULL)
return retval;
return;
// Don't try to draw outside the shell!
// Check everything, strange values may be caused by a big border width
@@ -2796,8 +2794,6 @@ gui_redraw_block(
if (ScreenAttrs[off - 1 - back] != ScreenAttrs[off]
|| ScreenLines[off - 1 - back] == ' ')
break;
retval = (col1 > 0 && ScreenAttrs[off - 1] != 0 && back == 0
&& ScreenLines[off - 1] != ' ');
// Break it up in strings of characters with the same attributes.
// Print UTF-8 characters individually.
@@ -2879,8 +2875,6 @@ gui_redraw_block(
gui.row = old_row;
gui.col = old_col;
gui.highlight_mask = (int)old_hl_mask;
return retval;
}
static void
+2
View File
@@ -4743,6 +4743,8 @@ is_cjk_font(PangoFontDescription *font_desc)
PangoCoverage *coverage;
gunichar uc;
// Valgrind reports a leak for pango_language_from_string(), but the
// documentation says "This is owned by Pango and should not be freed".
coverage = pango_font_get_coverage(
font, pango_language_from_string(cjk_langs[i]));
+3
View File
@@ -1485,6 +1485,9 @@ do_highlight(
did_highlight_changed = TRUE;
redraw_all_later(NOT_VALID);
}
#endif
#ifdef FEAT_VTP
control_console_color_rgb();
#endif
}
#ifdef FEAT_TERMINAL
+1 -1
View File
@@ -1083,7 +1083,7 @@ get_list_tv(char_u **arg, typval_T *rettv, int evaluate, int do_error)
if (**arg != ']')
{
if (do_error)
semsg(_("E697: Missing end of List ']': %s"), *arg);
semsg(_(e_list_end), *arg);
failret:
if (evaluate)
list_free(l);
+251 -28
View File
@@ -1690,6 +1690,49 @@ get_menu_cmd_modes(
return modes;
}
/*
* Return the string representation of the menu modes. Does the opposite
* of get_menu_cmd_modes().
*/
static char_u *
get_menu_mode_str(int modes)
{
if ((modes & (MENU_INSERT_MODE | MENU_CMDLINE_MODE | MENU_NORMAL_MODE |
MENU_VISUAL_MODE | MENU_SELECT_MODE | MENU_OP_PENDING_MODE))
== (MENU_INSERT_MODE | MENU_CMDLINE_MODE | MENU_NORMAL_MODE |
MENU_VISUAL_MODE | MENU_SELECT_MODE | MENU_OP_PENDING_MODE))
return (char_u *)"a";
if ((modes & (MENU_NORMAL_MODE | MENU_VISUAL_MODE | MENU_SELECT_MODE |
MENU_OP_PENDING_MODE))
== (MENU_NORMAL_MODE | MENU_VISUAL_MODE | MENU_SELECT_MODE |
MENU_OP_PENDING_MODE))
return (char_u *)" ";
if ((modes & (MENU_INSERT_MODE | MENU_CMDLINE_MODE))
== (MENU_INSERT_MODE | MENU_CMDLINE_MODE))
return (char_u *)"!";
if ((modes & (MENU_VISUAL_MODE | MENU_SELECT_MODE))
== (MENU_VISUAL_MODE | MENU_SELECT_MODE))
return (char_u *)"v";
if (modes & MENU_VISUAL_MODE)
return (char_u *)"x";
if (modes & MENU_SELECT_MODE)
return (char_u *)"s";
if (modes & MENU_OP_PENDING_MODE)
return (char_u *)"o";
if (modes & MENU_INSERT_MODE)
return (char_u *)"i";
if (modes & MENU_TERMINAL_MODE)
return (char_u *)"tl";
if (modes & MENU_CMDLINE_MODE)
return (char_u *)"c";
if (modes & MENU_NORMAL_MODE)
return (char_u *)"n";
if (modes & MENU_TIP_MODE)
return (char_u *)"t";
return (char_u *)"";
}
/*
* Modify a menu name starting with "PopUp" to include the mode character.
* Returns the name in allocated memory (NULL for failure).
@@ -2421,40 +2464,21 @@ execute_menu(exarg_T *eap, vimmenu_T *menu, int mode_idx)
}
/*
* Given a menu descriptor, e.g. "File.New", find it in the menu hierarchy and
* execute it.
* Lookup a menu by the descriptor name e.g. "File.New"
* Returns NULL if the menu is not found
*/
void
ex_emenu(exarg_T *eap)
static vimmenu_T *
menu_getbyname(char_u *name_arg)
{
vimmenu_T *menu;
char_u *name;
char_u *saved_name;
char_u *arg = eap->arg;
vimmenu_T *menu;
char_u *p;
int gave_emsg = FALSE;
int mode_idx = -1;
if (arg[0] && VIM_ISWHITE(arg[1]))
{
switch (arg[0])
{
case 'n': mode_idx = MENU_INDEX_NORMAL; break;
case 'v': mode_idx = MENU_INDEX_VISUAL; break;
case 's': mode_idx = MENU_INDEX_SELECT; break;
case 'o': mode_idx = MENU_INDEX_OP_PENDING; break;
case 't': mode_idx = MENU_INDEX_TERMINAL; break;
case 'i': mode_idx = MENU_INDEX_INSERT; break;
case 'c': mode_idx = MENU_INDEX_CMDLINE; break;
default: semsg(_(e_invarg2), arg);
return;
}
arg = skipwhite(arg + 2);
}
saved_name = vim_strsave(arg);
saved_name = vim_strsave(name_arg);
if (saved_name == NULL)
return;
return NULL;
menu = *get_root_menu(saved_name);
name = saved_name;
@@ -2491,10 +2515,45 @@ ex_emenu(exarg_T *eap)
if (menu == NULL)
{
if (!gave_emsg)
semsg(_("E334: Menu not found: %s"), arg);
return;
semsg(_("E334: Menu not found: %s"), name_arg);
return NULL;
}
return menu;
}
/*
* Given a menu descriptor, e.g. "File.New", find it in the menu hierarchy and
* execute it.
*/
void
ex_emenu(exarg_T *eap)
{
vimmenu_T *menu;
char_u *arg = eap->arg;
int mode_idx = -1;
if (arg[0] && VIM_ISWHITE(arg[1]))
{
switch (arg[0])
{
case 'n': mode_idx = MENU_INDEX_NORMAL; break;
case 'v': mode_idx = MENU_INDEX_VISUAL; break;
case 's': mode_idx = MENU_INDEX_SELECT; break;
case 'o': mode_idx = MENU_INDEX_OP_PENDING; break;
case 't': mode_idx = MENU_INDEX_TERMINAL; break;
case 'i': mode_idx = MENU_INDEX_INSERT; break;
case 'c': mode_idx = MENU_INDEX_CMDLINE; break;
default: semsg(_(e_invarg2), arg);
return;
}
arg = skipwhite(arg + 2);
}
menu = menu_getbyname(arg);
if (menu == NULL)
return;
// Found the menu, so execute.
execute_menu(eap, menu, mode_idx);
}
@@ -3155,4 +3214,168 @@ lookup_toolbar_item(idx)
#endif // FEAT_GUI_MACVIM
/*
* Get the information about a menu item in mode 'which'
*/
static int
menuitem_getinfo(vimmenu_T *menu, int modes, dict_T *dict)
{
int status;
if (menu_is_tearoff(menu->dname)) // skip tearoff menu item
return OK;
status = dict_add_string(dict, "name", menu->name);
if (status == OK)
status = dict_add_string(dict, "display", menu->dname);
if (status == OK && menu->actext != NULL)
status = dict_add_string(dict, "accel", menu->actext);
if (status == OK)
status = dict_add_number(dict, "priority", menu->priority);
if (status == OK)
status = dict_add_string(dict, "modes",
get_menu_mode_str(menu->modes));
#ifdef FEAT_TOOLBAR
if (status == OK && menu->iconfile != NULL)
status = dict_add_string(dict, "icon", menu->iconfile);
if (status == OK && menu->iconidx >= 0)
status = dict_add_number(dict, "iconidx", menu->iconidx);
#endif
if (status == OK)
{
char_u buf[NUMBUFLEN];
if (has_mbyte)
buf[utf_char2bytes(menu->mnemonic, buf)] = NUL;
else
{
buf[0] = (char_u)menu->mnemonic;
buf[1] = NUL;
}
status = dict_add_string(dict, "shortcut", buf);
}
if (status == OK && menu->children == NULL)
{
int bit;
// Get the first mode in which the menu is available
for (bit = 0; bit < MENU_MODES && !((1 << bit) & modes); bit++)
;
if (bit < MENU_MODES) // just in case, avoid Coverity warning
{
if (menu->strings[bit] != NULL)
{
char_u *tofree = NULL;
status = dict_add_string(dict, "rhs",
*menu->strings[bit] == NUL
? (char_u *)"<Nop>"
: (tofree = str2special_save(
menu->strings[bit], FALSE)));
vim_free(tofree);
}
if (status == OK)
status = dict_add_bool(dict, "noremenu",
menu->noremap[bit] == REMAP_NONE);
if (status == OK)
status = dict_add_bool(dict, "script",
menu->noremap[bit] == REMAP_SCRIPT);
if (status == OK)
status = dict_add_bool(dict, "silent", menu->silent[bit]);
if (status == OK)
status = dict_add_bool(dict, "enabled",
((menu->enabled & (1 << bit)) != 0));
}
}
// If there are submenus, add all the submenu display names
if (status == OK && menu->children != NULL)
{
list_T *l = list_alloc();
vimmenu_T *child;
if (l == NULL)
return FAIL;
dict_add_list(dict, "submenus", l);
child = menu->children;
while (child)
{
if (!menu_is_tearoff(child->dname)) // skip tearoff menu
list_append_string(l, child->dname, -1);
child = child->next;
}
}
return status;
}
/*
* "menu_info()" function
* Return information about a menu (including all the child menus)
*/
void
f_menu_info(typval_T *argvars, typval_T *rettv)
{
char_u *menu_name;
char_u *which;
int modes;
char_u *saved_name;
char_u *name;
vimmenu_T *menu;
dict_T *retdict;
if (rettv_dict_alloc(rettv) != OK)
return;
retdict = rettv->vval.v_dict;
menu_name = tv_get_string_chk(&argvars[0]);
if (menu_name == NULL)
return;
// menu mode
if (argvars[1].v_type != VAR_UNKNOWN)
which = tv_get_string_chk(&argvars[1]);
else
which = (char_u *)""; // Default is modes for "menu"
if (which == NULL)
return;
modes = get_menu_cmd_modes(which, *which == '!', NULL, NULL);
// Locate the specified menu or menu item
menu = *get_root_menu(menu_name);
saved_name = vim_strsave(menu_name);
if (saved_name == NULL)
return;
if (*saved_name != NUL)
{
char_u *p;
name = saved_name;
while (*name)
{
// Find in the menu hierarchy
p = menu_name_skip(name);
while (menu != NULL)
{
if (menu_name_equal(name, menu))
break;
menu = menu->next;
}
if (menu == NULL || *p == NUL)
break;
menu = menu->children;
name = p;
}
}
vim_free(saved_name);
if (menu == NULL) // specified menu not found
return;
if (menu->modes & modes)
menuitem_getinfo(menu, modes, retdict);
}
#endif // FEAT_MENU
+1
View File
@@ -865,6 +865,7 @@ emsg_namelen(char *msg, char_u *name, int len)
char_u *copy = vim_strnsave((char_u *)name, len);
semsg(msg, copy == NULL ? "NULL" : (char *)copy);
vim_free(copy);
}
/*
+13
View File
@@ -2230,6 +2230,19 @@ fast_breakcheck(void)
}
}
/*
* Like line_breakcheck() but check 100 times less often.
*/
void
veryfast_breakcheck(void)
{
if (++breakcheck_count >= BREAKCHECK_SKIP * 100)
{
breakcheck_count = 0;
ui_breakcheck();
}
}
#if defined(VIM_BACKTICK) || defined(FEAT_EVAL) \
|| (defined(HAVE_LOCALE_H) || defined(X_LOCALE)) \
|| defined(PROTO)
+6 -6
View File
@@ -4249,14 +4249,14 @@ mch_parse_cmd(char_u *cmd, int use_shcf, char ***argv, int *argc)
* 1: find number of arguments
* 2: separate them and build argv[]
*/
for (i = 0; i < 2; ++i)
for (i = 1; i <= 2; ++i)
{
p = skipwhite(cmd);
inquote = FALSE;
*argc = 0;
for (;;)
while (*p != NUL)
{
if (i == 1)
if (i == 2)
(*argv)[*argc] = (char *)p;
++*argc;
d = p;
@@ -4273,18 +4273,18 @@ mch_parse_cmd(char_u *cmd, int use_shcf, char ***argv, int *argc)
// Second pass: Remove the backslash.
++p;
}
if (i == 1)
if (i == 2)
*d++ = *p;
}
++p;
}
if (*p == NUL)
{
if (i == 1)
if (i == 2)
*d++ = NUL;
break;
}
if (i == 1)
if (i == 2)
*d++ = NUL;
p = skipwhite(p + 1);
}
+7 -2
View File
@@ -1154,7 +1154,9 @@ getcount:
kmsg = keep_msg;
keep_msg = NULL;
// showmode() will clear keep_msg, but we want to use it anyway
// Showmode() will clear keep_msg, but we want to use it anyway.
// First update w_topline.
setcursor();
update_screen(0);
// now reset it, otherwise it's put in the history again
keep_msg = kmsg;
@@ -1167,6 +1169,9 @@ getcount:
}
}
setcursor();
#ifdef CURSOR_SHAPE
ui_cursor_shape(); // may show different cursor shape
#endif
cursor_on();
out_flush();
if (msg_scroll || emsg_on_display)
@@ -1280,7 +1285,7 @@ set_vcount_ca(cmdarg_T *cap, int *set_prevcount)
#endif
/*
* Check if highlighting for visual mode is possible, give a warning message
* Check if highlighting for Visual mode is possible, give a warning message
* if not.
*/
void
+2 -109
View File
@@ -203,7 +203,7 @@ op_shift(oparg_T *oap, int curs_top, int amount)
vim_snprintf((char *)IObuff, IOSIZE,
NGETTEXT(msg_line_single, msg_line_plural, oap->line_count),
oap->line_count, op, amount);
msg((char *)IObuff);
msg_attr_keep((char *)IObuff, 0, TRUE);
}
if (!cmdmod.lockmarks)
@@ -2999,7 +2999,7 @@ op_addsub(
curbuf->b_op_start = startpos;
if (change_cnt > p_report)
smsg(NGETTEXT("%ld line changed", "%ld lines changed",
smsg(NGETTEXT("%d line changed", "%d lines changed",
change_cnt), change_cnt);
}
}
@@ -3409,113 +3409,6 @@ theend:
return did_change;
}
#if defined(FEAT_CLIPBOARD) || defined(PROTO)
/*
* SELECTION / PRIMARY ('*')
*
* Text selection stuff that uses the GUI selection register '*'. When using a
* GUI this may be text from another window, otherwise it is the last text we
* had highlighted with VIsual mode. With mouse support, clicking the middle
* button performs the paste, otherwise you will need to do <"*p>. "
* If not under X, it is synonymous with the clipboard register '+'.
*
* X CLIPBOARD ('+')
*
* Text selection stuff that uses the GUI clipboard register '+'.
* Under X, this matches the standard cut/paste buffer CLIPBOARD selection.
* It will be used for unnamed cut/pasting is 'clipboard' contains "unnamed",
* otherwise you will need to do <"+p>. "
* If not under X, it is synonymous with the selection register '*'.
*/
/*
* Routine to export any final X selection we had to the environment
* so that the text is still available after Vim has exited. X selections
* only exist while the owning application exists, so we write to the
* permanent (while X runs) store CUT_BUFFER0.
* Dump the CLIPBOARD selection if we own it (it's logically the more
* 'permanent' of the two), otherwise the PRIMARY one.
* For now, use a hard-coded sanity limit of 1Mb of data.
*/
#if (defined(FEAT_X11) && defined(FEAT_CLIPBOARD)) || defined(PROTO)
void
x11_export_final_selection(void)
{
Display *dpy;
char_u *str = NULL;
long_u len = 0;
int motion_type = -1;
# ifdef FEAT_GUI
if (gui.in_use)
dpy = X_DISPLAY;
else
# endif
# ifdef FEAT_XCLIPBOARD
dpy = xterm_dpy;
# else
return;
# endif
// Get selection to export
if (clip_plus.owned)
motion_type = clip_convert_selection(&str, &len, &clip_plus);
else if (clip_star.owned)
motion_type = clip_convert_selection(&str, &len, &clip_star);
// Check it's OK
if (dpy != NULL && str != NULL && motion_type >= 0
&& len < 1024*1024 && len > 0)
{
int ok = TRUE;
// The CUT_BUFFER0 is supposed to always contain latin1. Convert from
// 'enc' when it is a multi-byte encoding. When 'enc' is an 8-bit
// encoding conversion usually doesn't work, so keep the text as-is.
if (has_mbyte)
{
vimconv_T vc;
vc.vc_type = CONV_NONE;
if (convert_setup(&vc, p_enc, (char_u *)"latin1") == OK)
{
int intlen = len;
char_u *conv_str;
vc.vc_fail = TRUE;
conv_str = string_convert(&vc, str, &intlen);
len = intlen;
if (conv_str != NULL)
{
vim_free(str);
str = conv_str;
}
else
{
ok = FALSE;
}
convert_setup(&vc, NULL, NULL);
}
else
{
ok = FALSE;
}
}
// Do not store the string if conversion failed. Better to use any
// other selection than garbled text.
if (ok)
{
XStoreBuffer(dpy, (char *)str, (int)len, 0);
XFlush(dpy);
}
}
vim_free(str);
}
#endif
#endif // FEAT_CLIPBOARD || PROTO
void
clear_oparg(oparg_T *oap)
{
+1 -1
View File
@@ -500,7 +500,7 @@ set_string_option(
if (is_hidden_option(opt_idx)) // don't set hidden option
return NULL;
s = vim_strsave(value);
s = vim_strsave(value == NULL ? (char_u *)"" : value);
if (s != NULL)
{
varp = (char_u **)get_option_varp_scope(opt_idx,
+1 -4
View File
@@ -77,7 +77,7 @@
/*
* Generic Vim #define
* Generic Vim #define for Mac
*/
#define FEAT_SOURCE_FFS
@@ -86,9 +86,6 @@
#define USE_EXE_NAME // to find $VIM
#define CASE_INSENSITIVE_FILENAME // ignore case when comparing file names
#define SPACE_IN_FILENAME
#define BREAKCHECK_SKIP 32 // call mch_breakcheck() each time, it's
// quite fast. Did I forgot to update the
// comment
#define USE_FNAME_CASE // make ":e os_Mac.c" open the file in its
// original case, as "os_mac.c"
+6 -6
View File
@@ -47,13 +47,13 @@
#endif // !USE_SYSTEM
#ifdef HAVE_STROPTS_H
#ifdef sinix
#define buf_T __system_buf_t__
#endif
# ifdef sinix
# define buf_T __system_buf_t__
# endif
# include <stropts.h>
#ifdef sinix
#undef buf_T
#endif
# ifdef sinix
# undef buf_T
# endif
#endif
#ifdef HAVE_STRING_H
+6
View File
@@ -5821,6 +5821,12 @@ gotoxy(
if (!USE_VTP)
{
// There are reports of double-width characters not displayed
// correctly. This workaround should fix it, similar to how it's done
// for VTP.
g_coord.X = 0;
SetConsoleCursorPosition(g_hConOut, g_coord);
// external cursor coords are 1-based; internal are 0-based
g_coord.X = x - 1;
g_coord.Y = y - 1;
+547 -250
View File
File diff suppressed because it is too large Load Diff
+7 -6
View File
@@ -1071,12 +1071,13 @@ pum_set_event_info(dict_T *dict)
{
if (!pum_visible())
return;
dict_add_number(dict, "height", pum_height);
dict_add_number(dict, "width", pum_width);
dict_add_number(dict, "row", pum_row);
dict_add_number(dict, "col", pum_col);
dict_add_number(dict, "size", pum_size);
dict_add_bool(dict, "scrollbar", pum_scrollbar ? VVAL_TRUE : VVAL_FALSE);
(void)dict_add_number(dict, "height", pum_height);
(void)dict_add_number(dict, "width", pum_width);
(void)dict_add_number(dict, "row", pum_row);
(void)dict_add_number(dict, "col", pum_col);
(void)dict_add_number(dict, "size", pum_size);
(void)dict_add_bool(dict, "scrollbar",
pum_scrollbar ? VVAL_TRUE : VVAL_FALSE);
}
#endif
+4 -3
View File
@@ -68,6 +68,7 @@ extern int _stricoll(char *a, char *b);
# include "change.pro"
# include "charset.pro"
# include "cindent.pro"
# include "clipboard.pro"
# include "cmdexpand.pro"
# include "cmdhist.pro"
# include "if_cscope.pro"
@@ -119,7 +120,7 @@ extern int _stricoll(char *a, char *b);
// These prototypes cannot be produced automatically.
int smsg(const char *, ...)
# ifdef USE_PRINTF_FORMAT_ATTRIBUTE
__attribute__((format(printf, 1, 0)))
__attribute__((format(printf, 1, 2)))
# endif
;
@@ -138,14 +139,14 @@ int smsg_attr_keep(int, const char *, ...)
// These prototypes cannot be produced automatically.
int semsg(const char *, ...)
# ifdef USE_PRINTF_FORMAT_ATTRIBUTE
__attribute__((format(printf, 1, 0)))
__attribute__((format(printf, 1, 2)))
# endif
;
// These prototypes cannot be produced automatically.
void siemsg(const char *, ...)
# ifdef USE_PRINTF_FORMAT_ATTRIBUTE
__attribute__((format(printf, 1, 0)))
__attribute__((format(printf, 1, 2)))
# endif
;
+38
View File
@@ -0,0 +1,38 @@
/* clipboard.c */
void clip_init(int can_use);
void clip_update_selection(Clipboard_T *clip);
void clip_own_selection(Clipboard_T *cbd);
void clip_lose_selection(Clipboard_T *cbd);
void start_global_changes(void);
void end_global_changes(void);
void clip_auto_select(void);
int clip_isautosel_star(void);
int clip_isautosel_plus(void);
void clip_modeless(int button, int is_click, int is_drag);
void clip_start_selection(int col, int row, int repeated_click);
void clip_process_selection(int button, int col, int row, int_u repeated_click);
void clip_may_redraw_selection(int row, int col, int len);
void clip_clear_selection(Clipboard_T *cbd);
void clip_may_clear_selection(int row1, int row2);
void clip_scroll_selection(int rows);
void clip_copy_modeless_selection(int both);
void clip_gen_set_selection(Clipboard_T *cbd);
int clip_gen_owner_exists(Clipboard_T *cbd);
char *check_clipboard_option(void);
void open_app_context(void);
void x11_setup_atoms(Display *dpy);
void x11_setup_selection(Widget w);
void clip_x11_request_selection(Widget myShell, Display *dpy, Clipboard_T *cbd);
void clip_x11_lose_selection(Widget myShell, Clipboard_T *cbd);
int clip_x11_own_selection(Widget myShell, Clipboard_T *cbd);
void clip_x11_set_selection(Clipboard_T *cbd);
void yank_cut_buffer0(Display *dpy, Clipboard_T *cbd);
void x11_export_final_selection(void);
void clip_free_selection(Clipboard_T *cbd);
void clip_get_selection(Clipboard_T *cbd);
void clip_yank_selection(int type, char_u *str, long len, Clipboard_T *cbd);
int clip_convert_selection(char_u **str, long_u *len, Clipboard_T *cbd);
int may_get_selection(int regname);
void may_set_selection(void);
void adjust_clip_reg(int *rp);
/* vim: set ft=c : */
+1 -1
View File
@@ -27,7 +27,7 @@ void gui_enable_flush(void);
void gui_may_flush(void);
void gui_undraw_cursor(void);
void gui_redraw(int x, int y, int w, int h);
int gui_redraw_block(int row1, int col1, int row2, int col2, int flags);
void gui_redraw_block(int row1, int col1, int row2, int col2, int flags);
int gui_wait_for_chars(long wtime, int tb_change_cnt);
int gui_inchar(char_u *buf, int maxlen, long wtime, int tb_change_cnt);
void gui_send_mouse_event(int button, int x, int y, int repeated_click, int_u modifiers);
+1
View File
@@ -28,4 +28,5 @@ void ex_macmenu(exarg_T *eap);
void ex_macmenukey(exarg_T *eap);
char_u *lookup_toolbar_item(int idx);
#endif
void f_menu_info(typval_T *argvars, typval_T *rettv);
/* vim: set ft=c : */
+1
View File
@@ -40,6 +40,7 @@ char_u *concat_str(char_u *str1, char_u *str2);
void preserve_exit(void);
void line_breakcheck(void);
void fast_breakcheck(void);
void veryfast_breakcheck(void);
char_u *get_cmd_output(char_u *cmd, char_u *infile, int flags, int *ret_len);
void f_system(typval_T *argvars, typval_T *rettv);
void f_systemlist(typval_T *argvars, typval_T *rettv);
-1
View File
@@ -19,7 +19,6 @@ void format_lines(linenr_T line_count, int avoid_fex);
int paragraph_start(linenr_T lnum);
void block_prep(oparg_T *oap, struct block_def *bdp, linenr_T lnum, int is_del);
void op_addsub(oparg_T *oap, linenr_T Prenum1, int g_cmd);
void x11_export_final_selection(void);
void clear_oparg(oparg_T *oap);
void cursor_pos_info(dict_T *dict);
void do_pending_operator(cmdarg_T *cap, int old_col, int gui_yank);
+1 -1
View File
@@ -33,6 +33,7 @@ void f_popup_hide(typval_T *argvars, typval_T *rettv);
void popup_show(win_T *wp);
void f_popup_show(typval_T *argvars, typval_T *rettv);
void f_popup_settext(typval_T *argvars, typval_T *rettv);
int error_if_popup_window(int also_with_term);
void popup_close(int id);
void popup_close_tabpage(tabpage_T *tp, int id);
void close_all_popups(void);
@@ -41,7 +42,6 @@ void f_popup_setoptions(typval_T *argvars, typval_T *rettv);
void f_popup_getpos(typval_T *argvars, typval_T *rettv);
void f_popup_locate(typval_T *argvars, typval_T *rettv);
void f_popup_getoptions(typval_T *argvars, typval_T *rettv);
int error_if_popup_window(int also_with_term);
int error_if_term_popup_window(void);
void popup_reset_handled(int handled_flag);
win_T *find_next_popup(int lowest, int handled_flag);
+4 -6
View File
@@ -1,14 +1,15 @@
/* register.c */
yankreg_T *get_y_regs(void);
yankreg_T *get_y_register(int reg);
yankreg_T *get_y_current(void);
yankreg_T *get_y_previous(void);
void set_y_current(yankreg_T *yreg);
void set_y_previous(yankreg_T *yreg);
int get_expr_register(void);
void set_expr_line(char_u *new_line);
char_u *get_expr_line(void);
int valid_yank_reg(int regname, int writing);
int get_yank_register(int regname, int writing);
int may_get_selection(int regname);
void *get_register(int name, int copy);
void put_register(int name, void *reg);
void free_register(void *reg);
@@ -20,23 +21,20 @@ int do_execreg(int regname, int colon, int addcr, int silent);
int insert_reg(int regname, int literally_arg);
int get_spec_reg(int regname, char_u **argp, int *allocated, int errmsg);
int cmdline_paste_reg(int regname, int literally_arg, int remcr);
void adjust_clip_reg(int *rp);
void shift_delete_registers(void);
void yank_do_autocmd(oparg_T *oap, yankreg_T *reg);
void init_yank(void);
void clear_registers(void);
void free_yank_all(void);
int op_yank(oparg_T *oap, int deleting, int mess);
void do_put(int regname, int dir, long count, int flags);
int get_register_name(int num);
void ex_display(exarg_T *eap);
void clip_free_selection(Clipboard_T *cbd);
void clip_get_selection(Clipboard_T *cbd);
void clip_yank_selection(int type, char_u *str, long len, Clipboard_T *cbd);
int clip_convert_selection(char_u **str, long_u *len, Clipboard_T *cbd);
void dnd_yank_drag_data(char_u *str, long len);
char_u get_reg_type(int regname, long *reglen);
char_u *get_reg_contents(int regname, int flags);
void write_reg_contents(int name, char_u *str, int maxlen, int must_append);
void write_reg_contents_lst(int name, char_u **strings, int maxlen, int must_append, int yank_type, long block_len);
void write_reg_contents_ex(int name, char_u *str, int maxlen, int must_append, int yank_type, long block_len);
void str_to_reg(yankreg_T *y_ptr, int yank_type, char_u *str, long len, long blocklen, int str_list);
/* vim: set ft=c : */
-30
View File
@@ -14,28 +14,6 @@ void ui_new_shellsize(void);
int ui_get_winpos(int *x, int *y, varnumber_T timeout);
void ui_breakcheck(void);
void ui_breakcheck_force(int force);
void clip_init(int can_use);
void clip_update_selection(Clipboard_T *clip);
void clip_own_selection(Clipboard_T *cbd);
void clip_lose_selection(Clipboard_T *cbd);
void start_global_changes(void);
int is_clipboard_needs_update(void);
void end_global_changes(void);
void clip_auto_select(void);
int clip_isautosel_star(void);
int clip_isautosel_plus(void);
void clip_modeless(int button, int is_click, int is_drag);
void clip_start_selection(int col, int row, int repeated_click);
void clip_process_selection(int button, int col, int row, int_u repeated_click);
void clip_may_redraw_selection(int row, int col, int len);
void clip_clear_selection(Clipboard_T *cbd);
void clip_may_clear_selection(int row1, int row2);
void clip_scroll_selection(int rows);
void clip_copy_modeless_selection(int both);
void clip_gen_set_selection(Clipboard_T *cbd);
void clip_gen_request_selection(Clipboard_T *cbd);
int clip_gen_owner_exists(Clipboard_T *cbd);
char *check_clipboard_option(void);
int vim_is_input_buf_full(void);
int vim_is_input_buf_empty(void);
int vim_free_in_input_buf(void);
@@ -52,14 +30,6 @@ void ui_cursor_shape_forced(int forced);
void ui_cursor_shape(void);
int check_col(int col);
int check_row(int row);
void open_app_context(void);
void x11_setup_atoms(Display *dpy);
void x11_setup_selection(Widget w);
void clip_x11_request_selection(Widget myShell, Display *dpy, Clipboard_T *cbd);
void clip_x11_lose_selection(Widget myShell, Clipboard_T *cbd);
int clip_x11_own_selection(Widget myShell, Clipboard_T *cbd);
void clip_x11_set_selection(Clipboard_T *cbd);
void yank_cut_buffer0(Display *dpy, Clipboard_T *cbd);
void ui_focus_change(int in_focus);
void im_save_status(long *psave);
/* vim: set ft=c : */
+1
View File
@@ -9,6 +9,7 @@ imported_T *find_imported(char_u *name, size_t len, cctx_T *cctx);
char_u *to_name_const_end(char_u *arg);
int assignment_len(char_u *p, int *heredoc);
void compile_def_function(ufunc_T *ufunc, int set_return_type);
void delete_instr(isn_T *isn);
void delete_def_function(ufunc_T *ufunc);
void free_def_functions(void);
/* vim: set ft=c : */
+14 -239
View File
@@ -32,16 +32,11 @@ static int stuff_yank(int, char_u *);
static void put_reedit_in_typebuf(int silent);
static int put_in_typebuf(char_u *s, int esc, int colon,
int silent);
static void free_yank_all(void);
static int yank_copy_line(struct block_def *bd, long y_idx);
#ifdef FEAT_CLIPBOARD
static void copy_yank_reg(yankreg_T *reg);
static void may_set_selection(void);
#endif
static void dis_msg(char_u *p, int skip_esc);
#if defined(FEAT_CLIPBOARD) || defined(FEAT_EVAL)
static void str_to_reg(yankreg_T *y_ptr, int yank_type, char_u *str, long len, long blocklen, int str_list);
#endif
yankreg_T *
get_y_regs(void)
@@ -49,6 +44,12 @@ get_y_regs(void)
return y_regs;
}
yankreg_T *
get_y_register(int reg)
{
return &y_regs[reg];
}
yankreg_T *
get_y_current(void)
{
@@ -61,6 +62,12 @@ get_y_previous(void)
return y_previous;
}
void
set_y_current(yankreg_T *yreg)
{
y_current = yreg;
}
void
set_y_previous(yankreg_T *yreg)
{
@@ -241,32 +248,6 @@ get_yank_register(int regname, int writing)
return ret;
}
#if defined(FEAT_CLIPBOARD) || defined(PROTO)
/*
* When "regname" is a clipboard register, obtain the selection. If it's not
* available return zero, otherwise return "regname".
*/
int
may_get_selection(int regname)
{
if (regname == '*')
{
if (!clip_star.available)
regname = 0;
else
clip_get_selection(&clip_star);
}
else if (regname == '+')
{
if (!clip_plus.available)
regname = 0;
else
clip_get_selection(&clip_plus);
}
return regname;
}
#endif
/*
* Obtain the contents of a "normal" register. The register is made empty.
* The returned pointer has allocated memory, use put_register() later.
@@ -883,32 +864,6 @@ cmdline_paste_reg(
return OK;
}
#if defined(FEAT_CLIPBOARD) || defined(PROTO)
/*
* Adjust the register name pointed to with "rp" for the clipboard being
* used always and the clipboard being available.
*/
void
adjust_clip_reg(int *rp)
{
// If no reg. specified, and "unnamed" or "unnamedplus" is in 'clipboard',
// use '*' or '+' reg, respectively. "unnamedplus" prevails.
if (*rp == 0 && (clip_unnamed != 0 || clip_unnamed_saved != 0))
{
if (clip_unnamed != 0)
*rp = ((clip_unnamed & CLIP_UNNAMED_PLUS) && clip_plus.available)
? '+' : '*';
else
*rp = ((clip_unnamed_saved & CLIP_UNNAMED_PLUS)
&& clip_plus.available) ? '+' : '*';
}
if (!clip_star.available && *rp == '*')
*rp = 0;
if (!clip_plus.available && *rp == '+')
*rp = 0;
}
#endif
/*
* Shift the delete registers: "9 is cleared, "8 becomes "9, etc.
*/
@@ -1050,7 +1005,7 @@ free_yank(long n)
}
}
static void
void
free_yank_all(void)
{
free_yank(y_current->y_size);
@@ -2348,186 +2303,6 @@ dis_msg(
ui_breakcheck();
}
#if defined(FEAT_CLIPBOARD) || defined(PROTO)
void
clip_free_selection(Clipboard_T *cbd)
{
yankreg_T *y_ptr = y_current;
if (cbd == &clip_plus)
y_current = &y_regs[PLUS_REGISTER];
else
y_current = &y_regs[STAR_REGISTER];
free_yank_all();
y_current->y_size = 0;
y_current = y_ptr;
}
/*
* Get the selected text and put it in register '*' or '+'.
*/
void
clip_get_selection(Clipboard_T *cbd)
{
yankreg_T *old_y_previous, *old_y_current;
pos_T old_cursor;
pos_T old_visual;
int old_visual_mode;
colnr_T old_curswant;
int old_set_curswant;
pos_T old_op_start, old_op_end;
oparg_T oa;
cmdarg_T ca;
if (cbd->owned)
{
if ((cbd == &clip_plus && y_regs[PLUS_REGISTER].y_array != NULL)
|| (cbd == &clip_star && y_regs[STAR_REGISTER].y_array != NULL))
return;
// Get the text between clip_star.start & clip_star.end
old_y_previous = y_previous;
old_y_current = y_current;
old_cursor = curwin->w_cursor;
old_curswant = curwin->w_curswant;
old_set_curswant = curwin->w_set_curswant;
old_op_start = curbuf->b_op_start;
old_op_end = curbuf->b_op_end;
old_visual = VIsual;
old_visual_mode = VIsual_mode;
clear_oparg(&oa);
oa.regname = (cbd == &clip_plus ? '+' : '*');
oa.op_type = OP_YANK;
vim_memset(&ca, 0, sizeof(ca));
ca.oap = &oa;
ca.cmdchar = 'y';
ca.count1 = 1;
ca.retval = CA_NO_ADJ_OP_END;
do_pending_operator(&ca, 0, TRUE);
y_previous = old_y_previous;
y_current = old_y_current;
curwin->w_cursor = old_cursor;
changed_cline_bef_curs(); // need to update w_virtcol et al
curwin->w_curswant = old_curswant;
curwin->w_set_curswant = old_set_curswant;
curbuf->b_op_start = old_op_start;
curbuf->b_op_end = old_op_end;
VIsual = old_visual;
VIsual_mode = old_visual_mode;
}
else if (!is_clipboard_needs_update())
{
clip_free_selection(cbd);
// Try to get selected text from another window
clip_gen_request_selection(cbd);
}
}
/*
* Convert from the GUI selection string into the '*'/'+' register.
*/
void
clip_yank_selection(
int type,
char_u *str,
long len,
Clipboard_T *cbd)
{
yankreg_T *y_ptr;
if (cbd == &clip_plus)
y_ptr = &y_regs[PLUS_REGISTER];
else
y_ptr = &y_regs[STAR_REGISTER];
clip_free_selection(cbd);
str_to_reg(y_ptr, type, str, len, 0L, FALSE);
}
/*
* Convert the '*'/'+' register into a GUI selection string returned in *str
* with length *len.
* Returns the motion type, or -1 for failure.
*/
int
clip_convert_selection(char_u **str, long_u *len, Clipboard_T *cbd)
{
char_u *p;
int lnum;
int i, j;
int_u eolsize;
yankreg_T *y_ptr;
if (cbd == &clip_plus)
y_ptr = &y_regs[PLUS_REGISTER];
else
y_ptr = &y_regs[STAR_REGISTER];
# ifdef USE_CRNL
eolsize = 2;
# else
eolsize = 1;
# endif
*str = NULL;
*len = 0;
if (y_ptr->y_array == NULL)
return -1;
for (i = 0; i < y_ptr->y_size; i++)
*len += (long_u)STRLEN(y_ptr->y_array[i]) + eolsize;
// Don't want newline character at end of last line if we're in MCHAR mode.
if (y_ptr->y_type == MCHAR && *len >= eolsize)
*len -= eolsize;
p = *str = alloc(*len + 1); // add one to avoid zero
if (p == NULL)
return -1;
lnum = 0;
for (i = 0, j = 0; i < (int)*len; i++, j++)
{
if (y_ptr->y_array[lnum][j] == '\n')
p[i] = NUL;
else if (y_ptr->y_array[lnum][j] == NUL)
{
# ifdef USE_CRNL
p[i++] = '\r';
# endif
p[i] = '\n';
lnum++;
j = -1;
}
else
p[i] = y_ptr->y_array[lnum][j];
}
return y_ptr->y_type;
}
/*
* If we have written to a clipboard register, send the text to the clipboard.
*/
static void
may_set_selection(void)
{
if (y_current == &(y_regs[STAR_REGISTER]) && clip_star.available)
{
clip_own_selection(&clip_star);
clip_gen_set_selection(&clip_star);
}
else if (y_current == &(y_regs[PLUS_REGISTER]) && clip_plus.available)
{
clip_own_selection(&clip_plus);
clip_gen_set_selection(&clip_plus);
}
}
#endif // FEAT_CLIPBOARD || PROTO
#if defined(FEAT_DND) || defined(PROTO)
/*
* Replace the contents of the '~' register with str.
@@ -2900,7 +2675,7 @@ write_reg_contents_ex(
* Put a string into a register. When the register is not empty, the string
* is appended.
*/
static void
void
str_to_reg(
yankreg_T *y_ptr, // pointer to yank register
int yank_type, // MCHAR, MLINE, MBLOCK, MAUTO
+4 -5
View File
@@ -2829,11 +2829,10 @@ give_up:
&& ScreenLines != NULL
&& old_Rows != Rows)
{
(void)gui_redraw_block(0, 0, (int)Rows - 1, (int)Columns - 1, 0);
/*
* Adjust the position of the cursor, for when executing an external
* command.
*/
gui_redraw_block(0, 0, (int)Rows - 1, (int)Columns - 1, 0);
// Adjust the position of the cursor, for when executing an external
// command.
if (msg_row >= Rows) // Rows got smaller
msg_row = Rows - 1; // put cursor at last row
else if (Rows > old_Rows) // Rows got bigger
+4 -1
View File
@@ -1133,7 +1133,8 @@ do_source(
{
// Already loaded and no need to load again, return here.
*ret_sid = sid;
return OK;
retval = OK;
goto theend;
}
#endif
@@ -1273,6 +1274,7 @@ do_source(
// loading the same script again
si->sn_had_command = FALSE;
si->sn_version = 1;
current_sctx.sc_sid = sid;
ht = &SCRIPT_VARS(sid);
@@ -1525,6 +1527,7 @@ free_scriptnames(void)
vim_free(si->sn_vars);
vim_free(si->sn_name);
free_imports(i);
free_string_option(si->sn_save_cpo);
# ifdef FEAT_PROFILE
ga_clear(&si->sn_prl_ga);
+8 -8
View File
@@ -4115,7 +4115,7 @@ spell_read_wordfile(spellinfo_T *spin, char_u *fname)
pc = string_convert(&spin->si_conv, rline, NULL);
if (pc == NULL)
{
smsg(_("Conversion failure for word in %s line %d: %s"),
smsg(_("Conversion failure for word in %s line %ld: %s"),
fname, lnum, rline);
continue;
}
@@ -4133,10 +4133,10 @@ spell_read_wordfile(spellinfo_T *spin, char_u *fname)
if (STRNCMP(line, "encoding=", 9) == 0)
{
if (spin->si_conv.vc_type != CONV_NONE)
smsg(_("Duplicate /encoding= line ignored in %s line %d: %s"),
smsg(_("Duplicate /encoding= line ignored in %s line %ld: %s"),
fname, lnum, line - 1);
else if (did_word)
smsg(_("/encoding= line after word ignored in %s line %d: %s"),
smsg(_("/encoding= line after word ignored in %s line %ld: %s"),
fname, lnum, line - 1);
else
{
@@ -4159,13 +4159,13 @@ spell_read_wordfile(spellinfo_T *spin, char_u *fname)
if (STRNCMP(line, "regions=", 8) == 0)
{
if (spin->si_region_count > 1)
smsg(_("Duplicate /regions= line ignored in %s line %d: %s"),
smsg(_("Duplicate /regions= line ignored in %s line %ld: %s"),
fname, lnum, line);
else
{
line += 8;
if (STRLEN(line) > MAXREGIONS * 2)
smsg(_("Too many regions in %s line %d: %s"),
smsg(_("Too many regions in %s line %ld: %s"),
fname, lnum, line);
else
{
@@ -4179,7 +4179,7 @@ spell_read_wordfile(spellinfo_T *spin, char_u *fname)
continue;
}
smsg(_("/ line ignored in %s line %d: %s"),
smsg(_("/ line ignored in %s line %ld: %s"),
fname, lnum, line - 1);
continue;
}
@@ -4209,7 +4209,7 @@ spell_read_wordfile(spellinfo_T *spin, char_u *fname)
l = *p - '0';
if (l == 0 || l > spin->si_region_count)
{
smsg(_("Invalid region nr in %s line %d: %s"),
smsg(_("Invalid region nr in %s line %ld: %s"),
fname, lnum, p);
break;
}
@@ -4217,7 +4217,7 @@ spell_read_wordfile(spellinfo_T *spin, char_u *fname)
}
else
{
smsg(_("Unrecognized flags in %s line %d: %s"),
smsg(_("Unrecognized flags in %s line %ld: %s"),
fname, lnum, p);
break;
}
+15 -10
View File
@@ -3719,17 +3719,22 @@ cleanup_suggestions(
suggest_T *stp = &SUG(*gap, 0);
int i;
// Sort the list.
qsort(gap->ga_data, (size_t)gap->ga_len, sizeof(suggest_T), sug_compare);
// Truncate the list to the number of suggestions that will be displayed.
if (gap->ga_len > keep)
if (gap->ga_len > 0)
{
for (i = keep; i < gap->ga_len; ++i)
vim_free(stp[i].st_word);
gap->ga_len = keep;
if (keep >= 1)
return stp[keep - 1].st_score;
// Sort the list.
qsort(gap->ga_data, (size_t)gap->ga_len, sizeof(suggest_T),
sug_compare);
// Truncate the list to the number of suggestions that will be
// displayed.
if (gap->ga_len > keep)
{
for (i = keep; i < gap->ga_len; ++i)
vim_free(stp[i].st_word);
gap->ga_len = keep;
if (keep >= 1)
return stp[keep - 1].st_score;
}
}
return maxscore;
}
+4
View File
@@ -1308,6 +1308,7 @@ typedef struct {
int cb_free_name; // cb_name was allocated
} callback_T;
typedef struct isn_S isn_T; // instruction
typedef struct dfunc_S dfunc_T; // :def function
typedef struct jobvar_S job_T;
@@ -2073,6 +2074,7 @@ struct channel_S {
#define JO2_TTY_TYPE 0x10000 // "tty_type"
#define JO2_BUFNR 0x20000 // "bufnr"
#define JO2_TERM_API 0x40000 // "term_api"
#define JO2_TERM_HIGHLIGHT 0x80000 // "highlight"
#define JO_MODE_ALL (JO_MODE + JO_IN_MODE + JO_OUT_MODE + JO_ERR_MODE)
#define JO_CB_ALL \
@@ -2145,6 +2147,8 @@ typedef struct
# if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
long_u jo_ansi_colors[16];
# endif
char_u jo_term_highlight_buf[NUMBUFLEN];
char_u *jo_term_highlight;
int jo_tty_type; // first character of "tty_type"
char_u jo_term_api_buf[NUMBUFLEN];
char_u *jo_term_api;
+103 -31
View File
@@ -148,6 +148,8 @@ struct terminal_S {
int tl_scrollback_scrolled;
garray_T tl_scrollback_postponed;
char_u *tl_highlight_name; // replaces "Terminal"; allocated
cellattr_T tl_default_color;
linenr_T tl_top_diff_rows; // rows of top diff file or zero
@@ -465,7 +467,7 @@ term_start(
buf_T *buf;
// Create a new buffer without a window. Make it the current buffer for
// a moment to be able to do the initialisations.
// a moment to be able to do the initializations.
buf = buflist_new((char_u *)"", NULL, (linenr_T)0,
BLN_NEW | BLN_LISTED);
if (buf == NULL || ml_open(buf) == FAIL)
@@ -526,9 +528,15 @@ term_start(
apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, FALSE, curbuf);
if (opt->jo_term_name != NULL)
{
vim_free(curbuf->b_ffname);
curbuf->b_ffname = vim_strsave(opt->jo_term_name);
}
else if (argv != NULL)
{
vim_free(curbuf->b_ffname);
curbuf->b_ffname = vim_strsave((char_u *)"!system");
}
else
{
int i;
@@ -659,6 +667,9 @@ term_start(
else
term->tl_api = vim_strsave((char_u *)"Tapi_");
if (opt->jo_set2 & JO2_TERM_HIGHLIGHT)
term->tl_highlight_name = vim_strsave(opt->jo_term_highlight);
// System dependent: setup the vterm and maybe start the job in it.
if (argv == NULL
&& argvar->v_type == VAR_STRING
@@ -1018,6 +1029,7 @@ free_unused_terminals()
if (term->tl_out_fd != NULL)
fclose(term->tl_out_fd);
#endif
vim_free(term->tl_highlight_name);
vim_free(term->tl_cursor_color);
vim_free(term);
}
@@ -1988,7 +2000,7 @@ term_enter_job_mode()
redraw_buf_and_status_later(curbuf, NOT_VALID);
#ifdef FEAT_PROP_POPUP
if (WIN_IS_POPUP(curwin))
redraw_win_later(curwin, NOT_VALID);
redraw_later(NOT_VALID);
#endif
}
@@ -2214,6 +2226,17 @@ terminal_is_active()
return in_terminal_loop != NULL;
}
/*
* Return the highight group name for the terminal; "Terminal" if not set.
*/
static char_u *
term_get_highlight_name(term_T *term)
{
if (term->tl_highlight_name == NULL)
return (char_u *)"Terminal";
return term->tl_highlight_name;
}
#if defined(FEAT_GUI) || defined(PROTO)
cursorentry_T *
term_get_cursor_shape(guicolor_T *fg, guicolor_T *bg)
@@ -2236,8 +2259,8 @@ term_get_cursor_shape(guicolor_T *fg, guicolor_T *bg)
entry.blinkoff = 250;
}
// The "Terminal" highlight group overrules the defaults.
id = syn_name2id((char_u *)"Terminal");
// The highlight group overrules the defaults.
id = syn_name2id(term_get_highlight_name(term));
if (id != 0)
{
syn_id2colors(id, &term_fg, &term_bg);
@@ -2616,6 +2639,48 @@ may_toggle_cursor(term_T *term)
}
}
/*
* Cache "Terminal" highlight group colors.
*/
void
set_terminal_default_colors(int cterm_fg, int cterm_bg)
{
term_default_cterm_fg = cterm_fg - 1;
term_default_cterm_bg = cterm_bg - 1;
}
static int
get_default_cterm_fg(term_T *term)
{
if (term->tl_highlight_name != NULL)
{
int id = syn_name2id(term->tl_highlight_name);
int fg = -1;
int bg = -1;
if (id > 0)
syn_id2cterm_bg(id, &fg, &bg);
return fg;
}
return term_default_cterm_fg;
}
static int
get_default_cterm_bg(term_T *term)
{
if (term->tl_highlight_name != NULL)
{
int id = syn_name2id(term->tl_highlight_name);
int fg = -1;
int bg = -1;
if (id > 0)
syn_id2cterm_bg(id, &fg, &bg);
return bg;
}
return term_default_cterm_bg;
}
/*
* Reverse engineer the RGB value into a cterm color index.
* First color is 1. Return 0 if no match found (default color).
@@ -2737,6 +2802,7 @@ hl2vtermAttr(int attr, cellattr_T *cell)
*/
static int
cell2attr(
term_T *term,
win_T *wp,
VTermScreenCellAttrs cellattrs,
VTermColor cellfg,
@@ -2791,15 +2857,25 @@ cell2attr(
{
if (wincolor_fg >= 0)
fg = wincolor_fg + 1;
else if (term_default_cterm_fg >= 0)
fg = term_default_cterm_fg + 1;
else
{
int cterm_fg = get_default_cterm_fg(term);
if (cterm_fg >= 0)
fg = cterm_fg + 1;
}
}
if (bg == 0)
{
if (wincolor_bg >= 0)
bg = wincolor_bg + 1;
else if (term_default_cterm_bg >= 0)
bg = term_default_cterm_bg + 1;
else
{
int cterm_bg = get_default_cterm_bg(term);
if (cterm_bg >= 0)
bg = cterm_bg + 1;
}
}
}
@@ -2855,7 +2931,7 @@ term_scroll_up(term_T *term, int start_row, int count)
// Set the color to clear lines with.
vterm_state_get_default_colors(vterm_obtain_state(term->tl_vterm),
&fg, &bg);
clear_attr = cell2attr(wp, attr, fg, bg);
clear_attr = cell2attr(term, wp, attr, fg, bg);
win_del_lines(wp, start_row, count, FALSE, FALSE, clear_attr);
}
}
@@ -3415,6 +3491,7 @@ term_check_channel_closed_recently()
*/
static void
term_line2screenline(
term_T *term,
win_T *wp,
VTermScreen *screen,
VTermPos *pos,
@@ -3483,7 +3560,7 @@ term_line2screenline(
else
ScreenLines[off] = c;
}
ScreenAttrs[off] = cell2attr(wp, cell.attrs, cell.fg, cell.bg);
ScreenAttrs[off] = cell2attr(term, wp, cell.attrs, cell.fg, cell.bg);
++pos->col;
++off;
@@ -3534,7 +3611,7 @@ update_system_term(term_T *term)
{
int max_col = MIN(Columns, term->tl_cols);
term_line2screenline(NULL, screen, &pos, max_col);
term_line2screenline(term, NULL, screen, &pos, max_col);
}
else
pos.col = 0;
@@ -3648,7 +3725,7 @@ term_update_window(win_T *wp)
{
int max_col = MIN(wp->w_width, term->tl_cols);
term_line2screenline(wp, screen, &pos, max_col);
term_line2screenline(term, wp, screen, &pos, max_col);
}
else
pos.col = 0;
@@ -3731,7 +3808,7 @@ term_get_attr(win_T *wp, linenr_T lnum, int col)
else
cellattr = line->sb_cells + col;
}
return cell2attr(wp, cellattr->attrs, cellattr->fg, cellattr->bg);
return cell2attr(term, wp, cellattr->attrs, cellattr->fg, cellattr->bg);
}
/*
@@ -3775,11 +3852,11 @@ init_default_colors(term_T *term, win_T *wp)
bg->red = bg->green = bg->blue = bgval;
fg->ansi_index = bg->ansi_index = VTERM_ANSI_INDEX_DEFAULT;
// The 'wincolor' or "Terminal" highlight group overrules the defaults.
// The 'wincolor' or the highlight group overrules the defaults.
if (wp != NULL && *wp->w_p_wcr != NUL)
id = syn_name2id(wp->w_p_wcr);
else
id = syn_name2id((char_u *)"Terminal");
id = syn_name2id(term_get_highlight_name(term));
// Use the actual color for the GUI and when 'termguicolors' is set.
#if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
@@ -3843,10 +3920,13 @@ init_default_colors(term_T *term, win_T *wp)
#endif
if (id != 0 && t_colors >= 16)
{
if (term_default_cterm_fg >= 0)
cterm_color2vterm(term_default_cterm_fg, fg);
if (term_default_cterm_bg >= 0)
cterm_color2vterm(term_default_cterm_bg, bg);
int cterm_fg = get_default_cterm_fg(term);
int cterm_bg = get_default_cterm_bg(term);
if (cterm_fg >= 0)
cterm_color2vterm(cterm_fg, fg);
if (cterm_bg >= 0)
cterm_color2vterm(cterm_bg, bg);
}
else
{
@@ -4326,6 +4406,8 @@ term_update_colors(void)
vterm_obtain_state(term->tl_vterm),
&term->tl_default_color.fg,
&term->tl_default_color.bg);
redraw_later(NOT_VALID);
}
/*
@@ -4383,16 +4465,6 @@ set_ref_in_term(int copyID)
return abort;
}
/*
* Cache "Terminal" highlight group colors.
*/
void
set_terminal_default_colors(int cterm_fg, int cterm_bg)
{
term_default_cterm_fg = cterm_fg - 1;
term_default_cterm_bg = cterm_bg - 1;
}
/*
* Get the buffer from the first argument in "argvars".
* Returns NULL when the buffer is not for a terminal window and logs a message
@@ -5742,7 +5814,7 @@ f_term_scrape(typval_T *argvars, typval_T *rettv)
bg.red, bg.green, bg.blue);
dict_add_string(dcell, "bg", rgb);
dict_add_number(dcell, "attr", cell2attr(NULL, attrs, fg, bg));
dict_add_number(dcell, "attr", cell2attr(term, NULL, attrs, fg, bg));
dict_add_number(dcell, "width", width);
++pos.col;
@@ -5934,7 +6006,7 @@ f_term_start(typval_T *argvars, typval_T *rettv)
JO2_TERM_NAME + JO2_TERM_FINISH + JO2_HIDDEN + JO2_TERM_OPENCMD
+ JO2_TERM_COLS + JO2_TERM_ROWS + JO2_VERTICAL + JO2_CURWIN
+ JO2_CWD + JO2_ENV + JO2_EOF_CHARS
+ JO2_NORESTORE + JO2_TERM_KILL
+ JO2_NORESTORE + JO2_TERM_KILL + JO2_TERM_HIGHLIGHT
+ JO2_ANSI_COLORS + JO2_TTY_TYPE + JO2_TERM_API) == FAIL)
return;
+6 -1
View File
@@ -176,11 +176,12 @@ NEW_TESTS = \
test_matchadd_conceal \
test_matchadd_conceal_utf8 \
test_memory_usage \
test_method \
test_menu \
test_messages \
test_method \
test_mksession \
test_mksession_utf8 \
test_modeless \
test_modeline \
test_move \
test_nested_function \
@@ -223,6 +224,7 @@ NEW_TESTS = \
test_search \
test_search_stat \
test_searchpos \
test_selectmode \
test_set \
test_sha256 \
test_shift \
@@ -404,9 +406,11 @@ NEW_TESTS_RES = \
test_matchadd_conceal.res \
test_matchadd_conceal_utf8.res \
test_memory_usage.res \
test_menu.res \
test_messages.res \
test_method.res \
test_mksession.res \
test_modeless.res \
test_modeline.res \
test_nested_function.res \
test_netbeans.res \
@@ -441,6 +445,7 @@ NEW_TESTS_RES = \
test_scrollbind.res \
test_search.res \
test_search_stat.res \
test_selectmode.res \
test_shortpathname.res \
test_signals.res \
test_signs.res \
+10 -1
View File
@@ -6,6 +6,9 @@ command -nargs=1 MissingFeature throw 'Skipped: ' .. <args> .. ' feature missing
" Command to check for the presence of a feature.
command -nargs=1 CheckFeature call CheckFeature(<f-args>)
func CheckFeature(name)
if !has(a:name, 1)
throw 'Checking for non-existent feature ' .. a:name
endif
if !has(a:name)
MissingFeature a:name
endif
@@ -14,14 +17,20 @@ endfunc
" Command to check for the presence of a working option.
command -nargs=1 CheckOption call CheckOption(<f-args>)
func CheckOption(name)
if !exists('&' .. a:name)
throw 'Checking for non-existent option ' .. a:name
endif
if !exists('+' .. a:name)
throw 'Skipped: ' .. a:name .. ' option not supported'
endif
endfunc
" Command to check for the presence of a function.
" Command to check for the presence of a built-in function.
command -nargs=1 CheckFunction call CheckFunction(<f-args>)
func CheckFunction(name)
if !exists('?' .. a:name)
throw 'Checking for non-existent function ' .. a:name
endif
if !exists('*' .. a:name)
throw 'Skipped: ' .. a:name .. ' function missing'
endif
@@ -16,5 +16,5 @@
|a+0#0000001#ffd7ff255|b|6| @11| +0#0000000#a8a8a8255| +0&#ffffff0@58
|a|b|0> @71
|~+0#4040ff13&| @73
|[+3#0000000&|N|o| |N|a|m|e|]| |[|+|]| @43|1|0|,|1| @10|B|o|t
|[+3#0000000&|N|o| |N|a|m|e|]| |[|+|]| @43|1@1|,|1| @10|B|o|t
|-+2&&@1| |K|e|y|w|o|r|d| |L|o|c|a|l| |c|o|m|p|l|e|t|i|o|n| |(|^|N|^|P|)| |m+0#00e0003&|a|t|c|h| |1| |o|f| |1|0| +0#0000000&@26
+1 -1
View File
@@ -12,4 +12,4 @@
|1@1| @11|╚+0#0000001#ffd7ff255|═@44|⇲| +0#0000000#ffffff0@13
|1|2| @72
|1|3| @72
|t|e|r|m|i|n|a|l| |p|o|p|u|p| @42|1|,|1| @10|T|o|p|
|t|e|r|m|i|n|a|l| |p|o|p|u|p| @60
+1 -1
View File
@@ -12,4 +12,4 @@
|1@1| @72
|1|2| @72
|1|3| @72
|"|[|N|o| |N|a|m|e|]|"| |[|M|o|d|i|f|i|e|d|]| |2|0| |l|i|n|e|s| |-@1|5|%|-@1| @18|1|,|1| @10|T|o|p|
|"|[|N|o| |N|a|m|e|]|"| |[|M|o|d|i|f|i|e|d|]| |l|i|n|e| |1| |o|f| |2|0| |-@1|5|%|-@1| |c|o|l| |1| @26
+1 -1
View File
@@ -12,4 +12,4 @@
|1@1| @11|╚+0&#a8a8a8255|═@44|⇲| +0&#ffffff0@13
|1|2| @72
|1|3| @72
@57|0|,|0|-|1| @8|A|l@1|
@75
+1 -1
View File
@@ -12,4 +12,4 @@
|1@1| @72
|1|2| @72
|1|3| @72
|:|c|a|l@1| |C|l|o|s|e|P|o|p|u|p|(|)| @38|1|,|1| @10|T|o|p|
|:|c|a|l@1| |C|l|o|s|e|P|o|p|u|p|(|)| @56
+1 -1
View File
@@ -12,4 +12,4 @@
|1@1| @11|╚+0#0000001#ffd7ff255|═@44|╝| +0#0000000#ffffff0@13
|1|2| @72
|1|3| @72
@57|1|,|1| @10|A|l@1|
@75
+1 -1
View File
@@ -12,4 +12,4 @@
|1@1| @11|╚+0#0000001#ffd7ff255|═@44|╝| +0#0000000#ffffff0@13
|1|2| @72
|1|3| @72
|-+2&&@1| |V|I|S|U|A|L| |-@1| +0&&@34|6| @8|3|,|6| @10|A|l@1|
|-+2&&@1| |V|I|S|U|A|L| |-@1| +0&&@51|6| @9
+1 -1
View File
@@ -12,4 +12,4 @@
|1@1| @11|╚+0#0000001#ffd7ff255|═@44|╝| +0#0000000#ffffff0@13
|1|2| @72
|1|3| @72
@57|1|,|1| @10|T|o|p|
@75
@@ -0,0 +1,15 @@
|0+0&#ffffff0| @73
|1| @73
|2| @73
|3| @73
|4| @24|╔+0#0000001#ffd7ff255|═@19|╗| +0#0000000#ffffff0@26
|5| @24|║+0#0000001#ffd7ff255|h+0#00e0003#5fd7ff255|e|l@1|o| @14|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@26
|6| @24|║+0#0000001#ffd7ff255|h+0#00e0003#5fd7ff255|e|l@1|o| @14|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@26
|7| @24|║+0#0000001#ffd7ff255> +0#00e0003#5fd7ff255@19|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@26
|8| @24|║+0#0000001#ffd7ff255| +0#00e0003#5fd7ff255@19|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@26
|9| @24|║+0#0000001#ffd7ff255| +0#00e0003#5fd7ff255@19|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@26
|1|0| @23|╚+0#0000001#ffd7ff255|═@19|╝| +0#0000000#ffffff0@26
|1@1| @72
|1|2| @72
|1|3| @72
@75
@@ -0,0 +1,15 @@
|0+0&#ffffff0| @73
|1| @73
|2| @73
|3| @73
|4| @24|╔+0#0000001#ffd7ff255|═@19|╗| +0#0000000#ffffff0@26
|5| @24|║+0#0000001#ffd7ff255|h+0#4040ff13#ffff4012|e|l@1|o| @14|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@26
|6| @24|║+0#0000001#ffd7ff255|h+0#4040ff13#ffff4012|e|l@1|o| @14|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@26
|7| @24|║+0#0000001#ffd7ff255> +0#4040ff13#ffff4012@19|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@26
|8| @24|║+0#0000001#ffd7ff255| +0#4040ff13#ffff4012@19|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@26
|9| @24|║+0#0000001#ffd7ff255| +0#4040ff13#ffff4012@19|║+0#0000001#ffd7ff255| +0#0000000#ffffff0@26
|1|0| @23|╚+0#0000001#ffd7ff255|═@19|╝| +0#0000000#ffffff0@26
|1@1| @72
|1|2| @72
|1|3| @72
@75
@@ -12,4 +12,4 @@
|1@1| @72
|1|2| @72
|1|3| @72
|:| @55|1|,|1| @10|T|o|p|
|:| @73
+1 -1
View File
@@ -73,7 +73,7 @@ let test_values = {
\ 'buftype': [['', 'help', 'nofile'], ['xxx', 'help,nofile']],
\ 'casemap': [['', 'internal'], ['xxx']],
\ 'cedit': [['', '\<Esc>'], ['xxx', 'f']],
\ 'clipboard': [['', 'unnamed', 'autoselect,unnamed'], ['xxx']],
\ 'clipboard': [['', 'unnamed', 'autoselect,unnamed', 'html', 'exclude:vimdisplay'], ['xxx', '\ze*']],
\ 'colorcolumn': [['', '8', '+2'], ['xxx']],
\ 'comments': [['', 'b:#'], ['xxx']],
\ 'commentstring': [['', '/*%s*/'], ['xxx']],
+172
View File
@@ -0,0 +1,172 @@
" Helper functions for generating mouse events
" xterm2 and sgr always work, urxvt is optional.
let g:Ttymouse_values = ['xterm2', 'sgr']
if has('mouse_urxvt')
call add(g:Ttymouse_values, 'urxvt')
endif
" dec doesn't support all the functionality
if has('mouse_dec')
let g:Ttymouse_dec = ['dec']
else
let g:Ttymouse_dec = []
endif
" netterm only supports left click
if has('mouse_netterm')
let g:Ttymouse_netterm = ['netterm']
else
let g:Ttymouse_netterm = []
endif
" Helper function to emit a terminal escape code.
func TerminalEscapeCode(code, row, col, m)
if &ttymouse ==# 'xterm2'
" need to use byte encoding here.
let str = list2str([a:code + 0x20, a:col + 0x20, a:row + 0x20])
if has('iconv')
let bytes = str->iconv('utf-8', 'latin1')
else
" Hopefully the numbers are not too big.
let bytes = str
endif
return "\<Esc>[M" .. bytes
elseif &ttymouse ==# 'sgr'
return printf("\<Esc>[<%d;%d;%d%s", a:code, a:col, a:row, a:m)
elseif &ttymouse ==# 'urxvt'
return printf("\<Esc>[%d;%d;%dM", a:code + 0x20, a:col, a:row)
endif
endfunc
func DecEscapeCode(code, down, row, col)
return printf("\<Esc>[%d;%d;%d;%d&w", a:code, a:down, a:row, a:col)
endfunc
func NettermEscapeCode(row, col)
return printf("\<Esc>}%d,%d\r", a:row, a:col)
endfunc
func MouseLeftClickCode(row, col)
if &ttymouse ==# 'dec'
return DecEscapeCode(2, 4, a:row, a:col)
elseif &ttymouse ==# 'netterm'
return NettermEscapeCode(a:row, a:col)
else
return TerminalEscapeCode(0, a:row, a:col, 'M')
endif
endfunc
func MouseLeftClick(row, col)
call feedkeys(MouseLeftClickCode(a:row, a:col), 'Lx!')
endfunc
func MouseMiddleClickCode(row, col)
if &ttymouse ==# 'dec'
return DecEscapeCode(4, 2, a:row, a:col)
else
return TerminalEscapeCode(1, a:row, a:col, 'M')
endif
endfunc
func MouseMiddleClick(row, col)
call feedkeys(MouseMiddleClickCode(a:row, a:col), 'Lx!')
endfunc
func MouseRightClickCode(row, col)
if &ttymouse ==# 'dec'
return DecEscapeCode(6, 1, a:row, a:col)
else
return TerminalEscapeCode(2, a:row, a:col, 'M')
endif
endfunc
func MouseRightClick(row, col)
call feedkeys(MouseRightClickCode(a:row, a:col), 'Lx!')
endfunc
func MouseCtrlLeftClickCode(row, col)
let ctrl = 0x10
return TerminalEscapeCode(0 + ctrl, a:row, a:col, 'M')
endfunc
func MouseCtrlLeftClick(row, col)
call feedkeys(MouseCtrlLeftClickCode(a:row, a:col), 'Lx!')
endfunc
func MouseCtrlRightClickCode(row, col)
let ctrl = 0x10
return TerminalEscapeCode(2 + ctrl, a:row, a:col, 'M')
endfunc
func MouseCtrlRightClick(row, col)
call feedkeys(MouseCtrlRightClickCode(a:row, a:col), 'Lx!')
endfunc
func MouseLeftReleaseCode(row, col)
if &ttymouse ==# 'dec'
return DecEscapeCode(3, 0, a:row, a:col)
elseif &ttymouse ==# 'netterm'
return ''
else
return TerminalEscapeCode(3, a:row, a:col, 'm')
endif
endfunc
func MouseLeftRelease(row, col)
call feedkeys(MouseLeftReleaseCode(a:row, a:col), 'Lx!')
endfunc
func MouseMiddleReleaseCode(row, col)
if &ttymouse ==# 'dec'
return DecEscapeCode(5, 0, a:row, a:col)
else
return TerminalEscapeCode(3, a:row, a:col, 'm')
endif
endfunc
func MouseMiddleRelease(row, col)
call feedkeys(MouseMiddleReleaseCode(a:row, a:col), 'Lx!')
endfunc
func MouseRightReleaseCode(row, col)
if &ttymouse ==# 'dec'
return DecEscapeCode(7, 0, a:row, a:col)
else
return TerminalEscapeCode(3, a:row, a:col, 'm')
endif
endfunc
func MouseRightRelease(row, col)
call feedkeys(MouseRightReleaseCode(a:row, a:col), 'Lx!')
endfunc
func MouseLeftDragCode(row, col)
if &ttymouse ==# 'dec'
return DecEscapeCode(1, 4, a:row, a:col)
else
return TerminalEscapeCode(0x20, a:row, a:col, 'M')
endif
endfunc
func MouseLeftDrag(row, col)
call feedkeys(MouseLeftDragCode(a:row, a:col), 'Lx!')
endfunc
func MouseWheelUpCode(row, col)
return TerminalEscapeCode(0x40, a:row, a:col, 'M')
endfunc
func MouseWheelUp(row, col)
call feedkeys(MouseWheelUpCode(a:row, a:col), 'Lx!')
endfunc
func MouseWheelDownCode(row, col)
return TerminalEscapeCode(0x41, a:row, a:col, 'M')
endfunc
func MouseWheelDown(row, col)
call feedkeys(MouseWheelDownCode(a:row, a:col), 'Lx!')
endfunc
" vim: shiftwidth=2 sts=2 expandtab
+49 -48
View File
@@ -7,6 +7,19 @@
" ../vim -u NONE -S runtest.vim test_channel.vim open_delay
" The output can be found in the "messages" file.
"
" If the environment variable $TEST_FILTER is set then only test functions
" matching this pattern are executed. E.g. for sh/bash:
" export TEST_FILTER=Test_channel
" For csh:
" setenv TEST_FILTER Test_channel
"
" To ignore failure for tests that are known to fail in a certain environment,
" set $TEST_MAY_FAIL to a comma separated list of function names. E.g. for
" sh/bash:
" export TEST_MAY_FAIL=Test_channel_one,Test_channel_other
" The failure report will then not be included in the test.log file and
" "make test" will not fail.
"
" The test script may contain anything, only functions that start with
" "Test_" are special. These will be invoked and should contain assert
" functions. See test_assert.vim for an example.
@@ -209,11 +222,17 @@ func RunTheTest(test)
let s:done += 1
endfunc
func AfterTheTest()
func AfterTheTest(func_name)
if len(v:errors) > 0
let s:fail += 1
call add(s:errors, 'Found errors in ' . s:test . ':')
call extend(s:errors, v:errors)
if match(s:may_fail_list, '^' .. a:func_name) >= 0
let s:fail_expected += 1
call add(s:errors_expected, 'Found errors in ' . s:test . ':')
call extend(s:errors_expected, v:errors)
else
let s:fail += 1
call add(s:errors, 'Found errors in ' . s:test . ':')
call extend(s:errors, v:errors)
endif
let v:errors = []
endif
endfunc
@@ -229,7 +248,7 @@ endfunc
" This function can be called by a test if it wants to abort testing.
func FinishTesting()
call AfterTheTest()
call AfterTheTest('')
" Don't write viminfo on exit.
set viminfo=
@@ -237,7 +256,7 @@ func FinishTesting()
" Clean up files created by setup.vim
call delete('XfakeHOME', 'rf')
if s:fail == 0
if s:fail == 0 && s:fail_expected == 0
" Success, create the .res file so that make knows it's done.
exe 'split ' . fnamemodify(g:testname, ':r') . '.res'
write
@@ -275,6 +294,12 @@ func FinishTesting()
call add(s:messages, message)
call extend(s:messages, s:errors)
endif
if s:fail_expected > 0
let message = s:fail_expected . ' FAILED (matching $TEST_MAY_FAIL):'
echo message
call add(s:messages, message)
call extend(s:messages, s:errors_expected)
endif
" Add SKIPPED messages
call extend(s:messages, s:skipped)
@@ -294,11 +319,13 @@ endfunc
let g:testname = expand('%')
let s:done = 0
let s:fail = 0
let s:fail_expected = 0
let s:errors = []
let s:errors_expected = []
let s:messages = []
let s:skipped = []
if expand('%') =~ 'test_vimscript.vim'
" this test has intentional s:errors, don't use try/catch.
" this test has intentional errors, don't use try/catch.
source %
else
try
@@ -315,56 +342,28 @@ endif
" Names of flaky tests.
let s:flaky_tests = [
\ 'Test_autocmd_SafeState()',
\ 'Test_call()',
\ 'Test_channel_handler()',
\ 'Test_client_server()',
\ 'Test_close_and_exit_cb()',
\ 'Test_close_callback()',
\ 'Test_close_handle()',
\ 'Test_close_lambda()',
\ 'Test_close_output_buffer()',
\ 'Test_close_partial()',
\ 'Test_collapse_buffers()',
\ 'Test_communicate()',
\ 'Test_cwd()',
\ 'Test_diff_screen()',
\ 'Test_exit_callback()',
\ 'Test_exit_callback_interval()',
\ 'Test_map_timeout_with_timer_interrupt()',
\ 'Test_nb_basic()',
\ 'Test_open_delay()',
\ 'Test_out_cb()',
\ 'Test_pipe_through_sort_all()',
\ 'Test_pipe_through_sort_some()',
\ 'Test_popup_and_window_resize()',
\ 'Test_quoteplus()',
\ 'Test_quotestar()',
\ 'Test_raw_one_time_callback()',
\ 'Test_reltime()',
\ 'Test_server_crash()',
\ 'Test_state()',
\ 'Test_terminal_ansicolors_default()',
\ 'Test_terminal_ansicolors_func()',
\ 'Test_terminal_ansicolors_global()',
\ 'Test_terminal_composing_unicode()',
\ 'Test_terminal_does_not_truncate_last_newlines()',
\ 'Test_terminal_env()',
\ 'Test_terminal_hide_buffer()',
\ 'Test_terminal_make_change()',
\ 'Test_terminal_no_cmd()',
\ 'Test_terminal_noblock()',
\ 'Test_terminal_redir_file()',
\ 'Test_terminal_response_to_control_sequence()',
\ 'Test_terminal_scrollback()',
\ 'Test_terminal_split_quit()',
\ 'Test_terminal_termwinkey()',
\ 'Test_terminal_termwinsize_minimum()',
\ 'Test_terminal_termwinsize_option_fixed()',
\ 'Test_terminal_termwinsize_option_zero()',
\ 'Test_terminal_tmap()',
\ 'Test_terminal_wall()',
\ 'Test_terminal_wipe_buffer()',
\ 'Test_terminal_wqall()',
\ 'Test_termwinscroll()',
\ 'Test_timer_oneshot()',
\ 'Test_timer_paused()',
@@ -372,16 +371,9 @@ let s:flaky_tests = [
\ 'Test_timer_repeat_three()',
\ 'Test_timer_stop_all_in_callback()',
\ 'Test_timer_stop_in_callback()',
\ 'Test_two_channels()',
\ 'Test_unlet_handle()',
\ 'Test_timer_with_partial_callback()',
\ 'Test_zero_reply()',
\ 'Test_zz1_terminal_in_gui()',
\ ]
" Pattern indicating a common flaky test failure.
let s:flaky_errors_re = 'StopVimInTerminal\|VerifyScreenDump'
" Locate Test_ functions and execute them.
redir @q
silent function /^Test_
@@ -402,13 +394,22 @@ if $TEST_FILTER != ''
let s:filtered -= len(s:tests)
endif
let s:may_fail_list = []
if $TEST_MAY_FAIL != ''
" Split the list at commas and add () to make it match s:test.
let s:may_fail_list = split($TEST_MAY_FAIL, ',')->map({i, v -> v .. '()'})
endif
" Execute the tests in alphabetical order.
for s:test in sort(s:tests)
" Silence, please!
set belloff=all
let prev_error = ''
let total_errors = []
let run_nr = 1
let g:run_nr = 1
" A test can set test_is_flaky to retry running the test.
let test_is_flaky = 0
call RunTheTest(s:test)
@@ -417,15 +418,15 @@ for s:test in sort(s:tests)
" - it fails five times (with a different message)
if len(v:errors) > 0
\ && (index(s:flaky_tests, s:test) >= 0
\ || v:errors[0] =~ s:flaky_errors_re)
\ || test_is_flaky)
while 1
call add(s:messages, 'Found errors in ' . s:test . ':')
call extend(s:messages, v:errors)
call add(total_errors, 'Run ' . run_nr . ':')
call add(total_errors, 'Run ' . g:run_nr . ':')
call extend(total_errors, v:errors)
if run_nr == 5 || prev_error == v:errors[0]
if g:run_nr == 5 || prev_error == v:errors[0]
call add(total_errors, 'Flaky test failed too often, giving up')
let v:errors = total_errors
if has('gui_macvim')
@@ -449,7 +450,7 @@ for s:test in sort(s:tests)
let prev_error = v:errors[0]
let v:errors = []
let run_nr += 1
let g:run_nr += 1
call RunTheTest(s:test)
@@ -460,7 +461,7 @@ for s:test in sort(s:tests)
endwhile
endif
call AfterTheTest()
call AfterTheTest(s:test)
endfor
call FinishTesting()

Some files were not shown because too many files have changed in this diff Show More