Compare commits

...

41 Commits

Author SHA1 Message Date
Kazuki Sakamoto 4dd200f7ac Draw markedText in MMCoreTextView if imstyle=1 2017-09-20 19:13:23 -07:00
Kazuki Sakamoto ff28b66f41 Remove InlineIM from Preferences 2017-09-20 19:13:23 -07:00
Kazuki Sakamoto d23c46d07e Control InlineIM by imstyle 2017-09-20 19:13:23 -07:00
Kazuki Sakamoto 5cba1fc864 Merge remote-tracking branch 'vim/master' 2017-09-20 17:11:37 -07:00
Bram Moolenaar 9cb03716c9 patch 8.0.1130: the qf_jump() function is still too long
Problem:    The qf_jump() function is still too long.
Solution:   Split of parts to separate functions. (Yegappan Lakshmanan)
2017-09-20 22:43:02 +02:00
Kazuki Sakamoto 98a9de100b Merge remote-tracking branch 'vim/master' 2017-09-20 09:16:35 -07:00
Bram Moolenaar 2e6ab18729 Add back terminal.c 2017-09-20 10:03:07 +02:00
Bram Moolenaar a5a2be26fe patch 8.0.1129: window toolbar missing a part of the patch
Problem:    Window toolbar missing a part of the patch.
Solution:   Add change in vim.h.
2017-09-19 22:08:04 +02:00
Bram Moolenaar 37c64c78fd Update runtime files. 2017-09-19 22:06:03 +02:00
Bram Moolenaar e22bbf6508 patch 8.0.1128: old xterm sends CTRL-X in response to t_RS
Problem:    Old xterm sends CTRL-X in response to t_RS.
Solution:   Only send t_RS for xterm 279 and later.  Remove the workaround to
            ignore CTRL-X.
2017-09-19 20:47:16 +02:00
Kazuki Sakamoto d78a756945 Merge remote-tracking branch 'vim/master' 2017-09-18 19:20:53 -07:00
Bram Moolenaar a8e93d63e3 patch 8.0.1127: Test_peek_and_get_char fails on 32 bit system
Problem:    Test_peek_and_get_char fails on 32 bit system. (Eliminate
            Riesebieter)
Solution:   Avoid an integer overflow. (James McCoy, closes #2116)
2017-09-18 21:50:47 +02:00
Bram Moolenaar 71b2964066 patch 8.0.1126: endless resize when terminal showing in two buffers
Problem:    Endless resize when terminal showing in two buffers. (Hirohito
            Higashi)
Solution:   Set a flag to prevent resizing the window.
2017-09-18 21:24:56 +02:00
Bram Moolenaar d326ad6e93 patch 8.0.1125: wrong window height when splitting window with window toolbar
Problem:    Wrong window height when splitting window with window toolbar.
Solution:   Add or subtract the window toolbar height.
2017-09-18 20:31:41 +02:00
Bram Moolenaar f16c71b669 patch 8.0.1124: use of MZSCHEME_VER is unclear
Problem:    Use of MZSCHEME_VER is unclear.
Solution:   Add a comment. (Ken Takata)
2017-09-18 20:01:02 +02:00
Bram Moolenaar 1b9645de3c patch 8.0.1123: cannot define a toolbar for a window
Problem:    Cannot define a toolbar for a window.
Solution:   Add a window-local toolbar.
2017-09-17 23:03:31 +02:00
Bram Moolenaar dde403c2d8 patch 8.0.1122: vimtutor.bat doesn't work well with vim.bat
Problem:    vimtutor.bat doesn't work well with vim.bat.
Solution:   Use "call vim". (Ken Takata, closes #2105)
2017-09-17 21:43:00 +02:00
Bram Moolenaar 49150a41f8 patch 8.0.1121: can uncheck executables in MS-Windows installer
Problem:    Can uncheck executables in MS-Windows installer.
Solution:   Make the choice read-only. (Ken Takata, closes #2106)
2017-09-17 21:00:03 +02:00
Bram Moolenaar 63c4e8a198 patch 8.0.1120: :tm means :tmap instead of :tmenu
Problem:    :tm means :tmap instead of :tmenu. (Taro Muraoka)
Solution:   Move the new entry below the old entry. (closes #2102)
2017-09-17 20:32:20 +02:00
Bram Moolenaar 8adb0d03ca patch 8.0.1119: quitting a split terminal window kills the job
Problem:    Quitting a split terminal window kills the job. (Yasuhiro
            Matsumoto)
Solution:   Only stop terminal job if it is the last window.
2017-09-17 19:08:02 +02:00
Bram Moolenaar 4033c55eca patch 8.0.1118: FEAT_WINDOWS adds a lot of #ifdefs
Problem:    FEAT_WINDOWS adds a lot of #ifdefs while it is nearly always
            enabled and only adds 7% to the binary size of the tiny build.
Solution:   Graduate FEAT_WINDOWS.
2017-09-16 20:54:51 +02:00
Bram Moolenaar e738a1a033 patch 8.0.1117: Test_terminal_no_cmd hangs on MS-Windows with GUI
Problem:    Test_terminal_no_cmd hangs on MS-Windows with GUI. (Christian
            Brabandt)
Solution:   Run the command with "start" and wait for the text to appear.
            (micbou, closes #2096)
2017-09-16 17:42:41 +02:00
Bram Moolenaar 1514e8f427 patch 8.0.1116: terminal test fails on MS-Windows
Problem:    Terminal test fails on MS-Windows.
Solution:   Wait for the text to appear. (micbou, closes #2097)
2017-09-16 17:35:13 +02:00
Bram Moolenaar 495b7dd213 patch 8.0.1115: crash when using foldtextresult() recursively
Problem:    Crash when using foldtextresult() recursively.
Solution:   Avoid recursive calls. (Yasuhiro Matsumoto, closes #2098)
2017-09-16 17:19:22 +02:00
Bram Moolenaar 4cf56bbc85 patch 8.0.1114: default for 'iminsert' is annoying
Problem:    Default for 'iminsert' is annoying.
Solution:   Make the default always zero. (Yasuhiro Matsumoto, closes #2071)
2017-09-16 15:50:32 +02:00
Bram Moolenaar eef9adddab patch 8.0.1113: can go to Insert mode from Terminal-Normal mode
Problem:    Can go to Insert mode from Terminal-Normal mode.
Solution:   Prevent :startinsert and "VA" to enter Insert mode. (Yasuhiro
            Matsumoto, closes #2092)
2017-09-16 15:38:04 +02:00
Bram Moolenaar fc2b270cfd patch 8.0.1112: can't get size or current index from quickfix list
Problem:    Can't get size or current index from quickfix list.
Solution:   Add "idx" and "size" options. (Yegappan Lakshmanan)
2017-09-15 22:43:07 +02:00
Bram Moolenaar b5e79ef5a9 patch 8.0.1111: syntax error in configure when using Perl
Problem:    Syntax error in configure when using Perl.
Solution:   Add missing quote
2017-09-15 12:40:53 +02:00
Bram Moolenaar e8ff56b28e patch 8.0.1110: FORTIFY_SOURCE from Perl causes problems
Problem:    FORTIFY_SOURCE from Perl causes problems. (Scott Baker)
Solution:   Filter out the flag. (Christian Brabandt, closes #2068)
2017-09-14 23:06:23 +02:00
Bram Moolenaar f5291f301e patch 8.0.1109: timer causes error on exit from Ex mode
Problem:    Timer causes error on exit from Ex mode. (xtal8)
Solution:   save and restore the ex_pressedreturn flag. (Christian Brabandt,
            closes #2079)
2017-09-14 22:55:37 +02:00
Bram Moolenaar 69fbc9e1da patch 8.0.1108: cannot specify mappings for the terminal window
Problem:    Cannot specify mappings for the terminal window.
Solution:   Add the :tmap command and associated code.  (Jacob Askeland,
            closes #2073)
2017-09-14 20:37:57 +02:00
Bram Moolenaar 38baa3e634 patch 8.0.1107: terminal debugger jumps to non-existing file
Problem:    Terminal debugger jumps to non-existing file.
Solution:   Check that the file exists.  Add an option to make the Vim wide
            wide. Fix removing highlight groups.
2017-09-14 16:10:38 +02:00
Bram Moolenaar 69e8aa7511 patch 8.0.1106: terminal colors wrong on an MS-Windows console
Problem:    Terminal colors on an MS-Windows console are not matching the
            normal colors.
Solution:   Use the normal colors for the terminal. (Yasuhiro Matsumoto,
            closes #2087)
2017-09-14 15:55:13 +02:00
Bram Moolenaar 1190cf68e2 patch 8.0.1105: match() and matchend() are not tested
Problem:    match() and matchend() are not tested.
Solution:   Add tests. (Ozaki Kiichi, closes #2088)
2017-09-14 14:31:18 +02:00
Bram Moolenaar ef6b8de42f patch 8.0.1104: the qf_jump() function is too long
Problem:    The qf_jump() function is too long.
Solution:   Split of parts to separate functions. (Yegappan Lakshmanan)
2017-09-14 13:57:37 +02:00
Bram Moolenaar 478e3a78c3 patch 8.0.1103: converting cterm color fails for grey ramp
Problem:    Converting cterm color fails for grey ramp.
Solution:   Use index instead of number.
2017-09-14 13:37:00 +02:00
Kazuki Sakamoto 7e94ef5d2f Merge remote-tracking branch 'vim/master' 2017-09-13 20:35:12 -07:00
Bram Moolenaar c71053c611 patch 8.0.1102: terminal window does not use Normal colors
Problem:    Terminal window does not use Normal colors.
Solution:   For the GUI and when 'termguicolors' is enabled, use the actual
            foreground and background colors for the terminal.  (Yasuhiro
            Matsumoto, closes #2067)
            Use the "Terminal" highlight group if defined.
2017-09-14 00:00:44 +02:00
Bram Moolenaar 71eeb74a60 patch 8.0.1101: channel write fails if writing to log fails
Problem:    Channel write fails if writing to log fails.
Solution:   Ignore return value of fwrite(). (Ozaki Kiichi, closes #2081)
2017-09-13 22:18:01 +02:00
Bram Moolenaar 072412ed45 patch 8.0.1100: stuck in redraw loop when 'lazyredraw' is set
Problem:    Stuck in redraw loop when 'lazyredraw' is set.
Solution:   Don't loop on update_screen() when not redrawing. (Yasuhiro
            Matsumoto, closes #2082)
2017-09-13 22:11:35 +02:00
Bram Moolenaar 518d699699 patch 8.0.1099: warnings for GDK calls
Problem:    Warnings for GDK calls.
Solution:   Use other calls for GTK 3 and fix a few problems. (Kazunobu
            Kuriyama)
2017-09-13 22:09:58 +02:00
139 changed files with 5812 additions and 4777 deletions
+1 -1
View File
@@ -179,7 +179,7 @@ FunctionEnd
##########################################################
Section "Vim executables and runtime files"
SectionIn 1 2 3
SectionIn 1 2 3 RO
# we need also this here if the user changes the instdir
StrCpy $0 "$INSTDIR\vim${VER_MAJOR}${VER_MINOR}"
+2 -2
View File
@@ -1,6 +1,6 @@
" Vim support file to help with paste mappings and menus
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2006 Jun 23
" Last Change: 2017 Aug 30
" Define the string to use for items that are present both in Edit, Popup and
" Toolbar menu. Also used in mswin.vim and macmap.vim.
@@ -12,7 +12,7 @@
if has("virtualedit")
let paste#paste_cmd = {'n': ":call paste#Paste()<CR>"}
let paste#paste_cmd['v'] = '"-c<Esc>' . paste#paste_cmd['n']
let paste#paste_cmd['i'] = 'x<BS><Esc>' . paste#paste_cmd['n'] . 'gi'
let paste#paste_cmd['i'] = "\<c-\>\<c-o>\"+gP"
func! paste#Paste()
let ove = &ve
+2 -1
View File
@@ -1,4 +1,4 @@
*cmdline.txt* For Vim version 8.0. Last change: 2017 Jul 11
*cmdline.txt* For Vim version 8.0. Last change: 2017 Sep 17
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -826,6 +826,7 @@ Also see |`=|.
*:<cword>* *:<cWORD>* *:<cfile>* *<cfile>*
*:<sfile>* *<sfile>* *:<afile>* *<afile>*
*:<abuf>* *<abuf>* *:<amatch>* *<amatch>*
*:<cexpr>* *<cexpr>*
*<slnum>* *E495* *E496* *E497* *E499* *E500*
Note: these are typed literally, they are not special keys!
<cword> is replaced with the word under the cursor (like |star|)
+3 -3
View File
@@ -1,4 +1,4 @@
*diff.txt* For Vim version 8.0. Last change: 2017 Feb 03
*diff.txt* For Vim version 8.0. Last change: 2017 Sep 02
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -226,8 +226,8 @@ The diffs are highlighted with these groups:
(searching from the end of the line). The
text in between is highlighted. This means
that parts in the middle that are still the
same are highlighted anyway. Only "iwhite" of
'diffopt' is used here.
same are highlighted anyway. The 'diffopt'
flags "iwhite" and "icase" are used here.
|hl-DiffDelete| DiffDelete Deleted lines. Also called filler lines,
because they don't really exist in this
buffer.
+17 -5
View File
@@ -1,4 +1,4 @@
*eval.txt* For Vim version 8.0. Last change: 2017 Sep 11
*eval.txt* For Vim version 8.0. Last change: 2017 Sep 17
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -4642,6 +4642,7 @@ getqflist([{what}]) *getqflist()*
id get information for the quickfix list with
|quickfix-ID|; zero means the id for the
current list or the list specifed by "nr"
idx index of the current entry in the list
items quickfix list entries
lines use 'errorformat' to extract items from a list
of lines and return the resulting entries.
@@ -4650,6 +4651,7 @@ getqflist([{what}]) *getqflist()*
nr get information for this quickfix list; zero
means the current quickfix list and "$" means
the last quickfix list
size number of entries in the quickfix list
title get the list title
winid get the |window-ID| (if opened)
all all of the above quickfix properties
@@ -4669,8 +4671,10 @@ getqflist([{what}]) *getqflist()*
The returned dictionary contains the following entries:
context context information stored with |setqflist()|
id quickfix list ID |quickfix-ID|
idx index of the current entry in the list
items quickfix list entries
nr quickfix list number
size number of entries in the quickfix list
title quickfix list title text
winid quickfix |window-ID| (if opened)
@@ -4783,7 +4787,9 @@ getwininfo([{winid}]) *getwininfo()*
Each List item is a Dictionary with the following entries:
bufnr number of buffer in the window
height window height
height window height (excluding winbar)
winbar 1 if the window has a toolbar, 0
otherwise
loclist 1 if showing a location list
{only with the +quickfix feature}
quickfix 1 if quickfix or location list window
@@ -5672,6 +5678,7 @@ maparg({name}[, {mode} [, {abbr} [, {dict}]]]) *maparg()*
"s" Select
"x" Visual
"l" langmap |language-mapping|
"t" Terminal-Job
"" Normal, Visual and Operator-pending
When {mode} is omitted, the modes for "" are used.
@@ -8017,9 +8024,9 @@ term_getattr({attr}, {what}) *term_getattr()*
term_getcursor({buf}) *term_getcursor()*
Get the cursor position of terminal {buf}. Returns a list with
two numbers and a dictionary: [rows, cols, dict].
two numbers and a dictionary: [row, col, dict].
"rows" and "cols" are one based, the first screen cell is row
"row" and "col" are one based, the first screen cell is row
1, column 1. This is the cursor position of the terminal
itself, not of the Vim window.
@@ -8134,6 +8141,10 @@ term_sendkeys({buf}, {keys}) *term_sendkeys()*
means the character CTRL-X.
{only available when compiled with the |+terminal| feature}
term_setsize({buf}, {expr}) *term_setsize()*
Not implemented yet.
{only available when compiled with the |+terminal| feature}
term_start({cmd}, {options}) *term_start()*
Open a terminal window and run {cmd} in it.
@@ -8605,6 +8616,7 @@ winheight({nr}) *winheight()*
When {nr} is zero, the height of the current window is
returned. When window {nr} doesn't exist, -1 is returned.
An existing window always has a height of zero or more.
This excludes any window toolbar line.
Examples: >
:echo "The current window has " . winheight(0) . " lines."
<
@@ -8936,7 +8948,7 @@ toolbar Compiled with support for |gui-toolbar|.
transparency Compiled with 'transparency' support.
ttyin input is a terminal (tty)
ttyout output is a terminal (tty)
unix Unix version of Vim.
unix Unix version of Vim. *+unix*
unnamedplus Compiled with support for "unnamedplus" in 'clipboard'
user_commands User-defined commands.
vertsplit Compiled with vertically split windows |:vsplit|.
+25 -1
View File
@@ -1,4 +1,4 @@
*gui.txt* For Vim version 8.0. Last change: 2017 Aug 27
*gui.txt* For Vim version 8.0. Last change: 2017 Sep 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -785,10 +785,34 @@ In the Win32 and GTK+ GUI, starting a menu name with ']' excludes that menu
from the main menu bar. You must then use the |:popup| or |:tearoff| command
to display it.
*window-toolbar* *WinBar*
Each window can have a local toolbar. This uses the first line of the window,
thus reduces the space for the text by one line. The items in the toolbar
must start with "WinBar".
Only text can be used. When using Unicode, special characters can be used to
make the items look like icons.
If the items do not fit then the last ones cannot be used. The toolbar does
not wrap.
Example for debugger tools: >
amenu 1.10 WinBar.Step :Step<CR>
amenu 1.20 WinBar.Next :Next<CR>
amenu 1.30 WinBar.Finish :Finish<CR>
amenu 1.40 WinBar.Cont :Continue<CR>
<
The window toolbar uses the ToolbarLine and ToolbarButton highlight groups.
When splitting the window the window toolbar is not copied to the new window.
*popup-menu*
In the Win32, GTK+, Motif, Athena and Photon GUI, you can define the
special menu "PopUp". This is the menu that is displayed when the right mouse
button is pressed, if 'mousemodel' is set to popup or popup_setpos.
Example: >
nnoremenu 1.40 PopUp.&Paste "+gP
menu PopUp
5.3 Showing What Menus Are Mapped To *showing-menus*
+4
View File
@@ -1585,13 +1585,17 @@ tag command action ~
|:tjump| :tj[ump] like ":tselect", but jump directly when there
is only one match
|:tlast| :tl[ast] jump to last matching tag
|:tmapclear| :tmapc[lear] remove all mappings for Terminal-Job mode
|:tmap| :tma[p] like ":map" but for Terminal-Job mode
|:tmenu| :tm[enu] define menu tooltip
|:tnext| :tn[ext] jump to next matching tag
|:tnoremap| :tno[remap] like ":noremap" but for Terminal-Job mode
|:topleft| :to[pleft] make split window appear at top or far left
|:tprevious| :tp[revious] jump to previous matching tag
|:trewind| :tr[ewind] jump to first matching tag
|:try| :try execute commands, abort on error or exception
|:tselect| :ts[elect] list matching tags and select one
|:tunmap| :tunma[p] like ":unmap" but for Terminal-Job mode
|:tunmenu| :tu[nmenu] remove menu tooltip
|:undo| :u[ndo] undo last change(s)
|:undojoin| :undoj[oin] join next change with previous undo block
+5 -1
View File
@@ -1,4 +1,4 @@
*intro.txt* For Vim version 8.0. Last change: 2017 Aug 24
*intro.txt* For Vim version 8.0. Last change: 2017 Sep 04
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -264,6 +264,10 @@ Vim would never have become what it is now, without the help of these people!
Juergen Weigert Lattice version, AUX improvements, UNIX and
MS-DOS ports, autoconf
Stefan 'Sec' Zehl Maintainer of vim.org
Yasuhiro Matsumoto many MS-Windows improvements
Ken Takata fixes and features
Kazunobu Kuriyama GTK 3
Christian Brabandt many fixes, features, user support, etc.
I wish to thank all the people that sent me bug reports and suggestions. The
list is too long to mention them all here. Vim would not be the same without
+14 -2
View File
@@ -1,4 +1,4 @@
*map.txt* For Vim version 8.0. Last change: 2017 May 30
*map.txt* For Vim version 8.0. Last change: 2017 Sep 17
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -55,6 +55,7 @@ modes.
:im[ap] {lhs} {rhs} |mapmode-i| *:im* *:imap*
:lm[ap] {lhs} {rhs} |mapmode-l| *:lm* *:lmap*
:cm[ap] {lhs} {rhs} |mapmode-c| *:cm* *:cmap*
:tma[p] {lhs} {rhs} |mapmode-t| *:tma* *:tmap*
Map the key sequence {lhs} to {rhs} for the modes
where the map command applies. The result, including
{rhs}, is then further scanned for mappings. This
@@ -71,6 +72,7 @@ modes.
:ino[remap] {lhs} {rhs} |mapmode-i| *:ino* *:inoremap*
:ln[oremap] {lhs} {rhs} |mapmode-l| *:ln* *:lnoremap*
:cno[remap] {lhs} {rhs} |mapmode-c| *:cno* *:cnoremap*
:tno[remap] {lhs} {rhs} |mapmode-t| *:tno* *:tnoremap*
Map the key sequence {lhs} to {rhs} for the modes
where the map command applies. Disallow mapping of
{rhs}, to avoid nested and recursive mappings. Often
@@ -87,6 +89,7 @@ modes.
:iu[nmap] {lhs} |mapmode-i| *:iu* *:iunmap*
:lu[nmap] {lhs} |mapmode-l| *:lu* *:lunmap*
:cu[nmap] {lhs} |mapmode-c| *:cu* *:cunmap*
:tunma[p] {lhs} |mapmode-t| *:tunma* *:tunmap*
Remove the mapping of {lhs} for the modes where the
map command applies. The mapping may remain defined
for other modes where it applies.
@@ -105,6 +108,7 @@ modes.
:imapc[lear] |mapmode-i| *:imapc* *:imapclear*
:lmapc[lear] |mapmode-l| *:lmapc* *:lmapclear*
:cmapc[lear] |mapmode-c| *:cmapc* *:cmapclear*
:tmapc[lear] |mapmode-t| *:tmapc* *:tmapclear*
Remove ALL mappings for the modes where the map
command applies. {not in Vi}
Use the <buffer> argument to remove buffer-local
@@ -121,6 +125,7 @@ modes.
:im[ap] |mapmode-i|
:lm[ap] |mapmode-l|
:cm[ap] |mapmode-c|
:tma[p] |mapmode-t|
List all key mappings for the modes where the map
command applies. Note that ":map" and ":map!" are
used most often, because they include the other modes.
@@ -135,6 +140,7 @@ modes.
:im[ap] {lhs} |mapmode-i| *:imap_l*
:lm[ap] {lhs} |mapmode-l| *:lmap_l*
:cm[ap] {lhs} |mapmode-c| *:cmap_l*
:tma[p] {lhs} |mapmode-t| *:tmap_l*
List the key mappings for the key sequences starting
with {lhs} in the modes where the map command applies.
{not in Vi}
@@ -318,6 +324,7 @@ Overview of which map command works in which mode. More details below.
:imap :inoremap :iunmap Insert
:lmap :lnoremap :lunmap Insert, Command-line, Lang-Arg
:cmap :cnoremap :cunmap Command-line
:tmap :tnoremap :tunmap Terminal-Job
COMMANDS MODES ~
@@ -358,6 +365,10 @@ Therefore the ":map" and ":map!" commands enter and display mappings for
several modes. In Vim you can use the ":nmap", ":vmap", ":omap", ":cmap" and
":imap" commands to enter mappings for each mode separately.
*mapmode-t*
The terminal mappings are used in a terminal window, when typing keys for the
job running in the terminal. See |terminal-typing|.
*omap-info*
Operator-pending mappings can be used to define a movement command that can be
used with any operator. Simple example: ":omap { w" makes "y{" work like "yw"
@@ -418,6 +429,7 @@ When listing mappings the characters in the first two columns are:
i Insert
l ":lmap" mappings for Insert, Command-line and Lang-Arg
c Command-line
t Terminal-Job
Just before the {rhs} a special character can appear:
* indicates that it is not remappable
@@ -682,7 +694,7 @@ option). After that it assumes that the 'q' is to be interpreted as such. If
you type slowly, or your system is slow, reset the 'timeout' option. Then you
might want to set the 'ttimeout' option.
*map-precedence*
*map-precedence*
Buffer-local mappings (defined using |:map-<buffer>|) take precedence over
global mappings. When a buffer-local mapping is the same as a global mapping,
Vim will use the buffer-local mapping. In addition, Vim will use a complete
+33 -9
View File
@@ -1,4 +1,4 @@
*options.txt* For Vim version 8.0. Last change: 2017 Aug 27
*options.txt* For Vim version 8.0. Last change: 2017 Sep 16
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -423,6 +423,16 @@ command, not when assigning a value to an option with ":let".
*$HOME-windows*
On MS-Windows, if $HOME is not defined as an environment variable, then
at runtime Vim will set it to the expansion of $HOMEDRIVE$HOMEPATH.
If $HOMEDRIVE is not set then $USERPROFILE is used.
This expanded value is not exported to the environment, this matters when
running an external command: >
:echo system('set | findstr ^HOME=')
and >
:echo luaeval('os.getenv("HOME")')
should echo nothing (an empty string) despite exists('$HOME') being true.
When setting $HOME to a non-empty string it will be exported to the
subprocesses.
Note the maximum length of an expanded option is limited. How much depends on
@@ -722,7 +732,8 @@ A jump table for the options with a short description can be found at |Q_op|.
Vim may set this option automatically at startup time when Vim is
compiled with the |+termresponse| feature and if |t_u7| is set to the
escape sequence to request cursor position report.
escape sequence to request cursor position report. The response can
be found in |v:termu7resp|.
*'antialias'* *'anti'* *'noantialias'* *'noanti'*
'antialias' 'anti' boolean (default off, on for MacVim)
@@ -875,11 +886,12 @@ A jump table for the options with a short description can be found at |Q_op|.
< Vim will guess the value. In the GUI this should work correctly,
in other cases Vim might not be able to guess the right value.
When the t_BG option is set, Vim will use it to request the background
When the |t_RB| option is set, Vim will use it to request the background
color from the terminal. If the returned RGB value is dark/light and
'background' is not dark/light, 'background' will be set and the
screen is redrawn. This may have side effects, make t_BG empty in
your .vimrc if you suspect this problem.
your .vimrc if you suspect this problem. The response to |t_RB| can
be found in |v:termrgbresp|.
When starting the GUI, the default value for 'background' will be
"light". When the value is not set in the .gvimrc, and Vim detects
@@ -4423,7 +4435,7 @@ A jump table for the options with a short description can be found at |Q_op|.
in later releases.
*'iminsert'* *'imi'*
'iminsert' 'imi' number (default 0, 2 when an input method is supported)
'iminsert' 'imi' number (default 0)
local to buffer
{not in Vi}
Specifies whether :lmap or an Input Method (IM) is to be used in
@@ -4446,7 +4458,7 @@ A jump table for the options with a short description can be found at |Q_op|.
methods. Use 'imdisable' to disable XIM then.
*'imsearch'* *'ims'*
'imsearch' 'ims' number (default 0, 2 when an input method is supported)
'imsearch' 'ims' number (default -1)
local to buffer
{not in Vi}
Specifies whether :lmap or an Input Method (IM) is to be used when
@@ -4487,9 +4499,9 @@ A jump table for the options with a short description can be found at |Q_op|.
{not in Vi}
{only available when compiled with |+xim| and
|+GUI_GTK|}
This option specifies the input style of Input Method.
Set to zero if you want to use on-the-spot style.
Set to one if you want to use over-the-spot style.
This option specifies the input style of Input Method:
0 use on-the-spot style
1 over-the-spot style
See: |xim-input-style|
For a long time on-the-spot sytle had been used in GTK version of vim,
@@ -5908,6 +5920,18 @@ A jump table for the options with a short description can be found at |Q_op|.
< Replace the ';' with a ':' or whatever separator is used. Note that
this doesn't work when $INCL contains a comma or white space.
*'perldll'*
'perldll' string (default depends on the build)
global
{not in Vi}
{only available when compiled with the |+perl/dyn|
feature}
Specifies the name of the Perl shared library. The default is
DYNAMIC_PERL_DLL, which was specified at compile time.
Environment variables are expanded |:set_env|.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
*'preserveindent'* *'pi'* *'nopreserveindent'* *'nopi'*
'preserveindent' 'pi' boolean (default off)
local to buffer
+1 -6
View File
@@ -1,4 +1,4 @@
*quickfix.txt* For Vim version 8.0. Last change: 2017 Jun 13
*quickfix.txt* For Vim version 8.0. Last change: 2017 Sep 13
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -47,11 +47,6 @@ compiler (see |errorformat| below).
*quickfix-ID*
Each quickfix list has a unique identifier called the quickfix ID and this
number will not change within a Vim session. The getqflist() function can be
used to get the identifier assigned to a list.
*quickfix-ID*
Each quickfix list has a unique identifier called the quickfix ID and this
number will not change within a Vim session. The getqflist() function can be
used to get the identifier assigned to a list. There is also a quickfix list
number which may change whenever more than ten lists are added to a quickfix
stack.
+2 -1
View File
@@ -1,4 +1,4 @@
*quickref.txt* For Vim version 8.0. Last change: 2017 Aug 19
*quickref.txt* For Vim version 8.0. Last change: 2017 Sep 10
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -753,6 +753,7 @@ Short explanation of each option: *option-list*
'iminsert' 'imi' use :lmap or IM in Insert mode
'imsearch' 'ims' use :lmap or IM when typing a search pattern
'imstatusfunc' 'imsf' function to obtain X input method status
'imstyle' 'imst' specifies the input style of the input method
'include' 'inc' pattern to be used to find an include file
'includeexpr' 'inex' expression used to process an include line
'incsearch' 'is' highlight match while typing search pattern
+37
View File
@@ -4,6 +4,7 @@
$ motion.txt /*$*
$HOME options.txt /*$HOME*
$HOME-use version5.txt /*$HOME-use*
$HOME-windows options.txt /*$HOME-windows*
$MYGVIMRC gui.txt /*$MYGVIMRC*
$MYVIMRC starting.txt /*$MYVIMRC*
$VIM starting.txt /*$VIM*
@@ -374,7 +375,9 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
'ims' options.txt /*'ims'*
'imsearch' options.txt /*'imsearch'*
'imsf' options.txt /*'imsf'*
'imst' options.txt /*'imst'*
'imstatusfunc' options.txt /*'imstatusfunc'*
'imstyle' options.txt /*'imstyle'*
'inc' options.txt /*'inc'*
'include' options.txt /*'include'*
'includeexpr' options.txt /*'includeexpr'*
@@ -764,6 +767,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
'path' options.txt /*'path'*
'pdev' options.txt /*'pdev'*
'penc' options.txt /*'penc'*
'perldll' options.txt /*'perldll'*
'pex' options.txt /*'pex'*
'pexpr' options.txt /*'pexpr'*
'pfn' options.txt /*'pfn'*
@@ -991,6 +995,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
't_PE' term.txt /*'t_PE'*
't_PS' term.txt /*'t_PS'*
't_RB' term.txt /*'t_RB'*
't_RC' term.txt /*'t_RC'*
't_RI' term.txt /*'t_RI'*
't_RS' term.txt /*'t_RS'*
't_RV' term.txt /*'t_RV'*
@@ -1000,6 +1005,8 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
't_SR' term.txt /*'t_SR'*
't_Sb' term.txt /*'t_Sb'*
't_Sf' term.txt /*'t_Sf'*
't_Te' term.txt /*'t_Te'*
't_Ts' term.txt /*'t_Ts'*
't_VS' term.txt /*'t_VS'*
't_WP' term.txt /*'t_WP'*
't_WS' term.txt /*'t_WS'*
@@ -1353,6 +1360,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
+title various.txt /*+title*
+toolbar various.txt /*+toolbar*
+transparency various.txt /*+transparency*
+unix eval.txt /*+unix*
+user_commands various.txt /*+user_commands*
+vertsplit various.txt /*+vertsplit*
+viminfo various.txt /*+viminfo*
@@ -1917,6 +1925,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
:<afile> cmdline.txt /*:<afile>*
:<amatch> cmdline.txt /*:<amatch>*
:<cWORD> cmdline.txt /*:<cWORD>*
:<cexpr> cmdline.txt /*:<cexpr>*
:<cfile> cmdline.txt /*:<cfile>*
:<cword> cmdline.txt /*:<cword>*
:<sfile> cmdline.txt /*:<sfile>*
@@ -1976,6 +1985,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
:Sexplore pi_netrw.txt /*:Sexplore*
:TOhtml syntax.txt /*:TOhtml*
:TarDiff pi_tar.txt /*:TarDiff*
:Termdebug terminal.txt /*:Termdebug*
:Texplore pi_netrw.txt /*:Texplore*
:UseVimball pi_vimball.txt /*:UseVimball*
:Vexplore pi_netrw.txt /*:Vexplore*
@@ -3151,9 +3161,16 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
:tl tagsrch.txt /*:tl*
:tlast tagsrch.txt /*:tlast*
:tm gui.txt /*:tm*
:tma map.txt /*:tma*
:tmap map.txt /*:tmap*
:tmap_l map.txt /*:tmap_l*
:tmapc map.txt /*:tmapc*
:tmapclear map.txt /*:tmapclear*
:tmenu gui.txt /*:tmenu*
:tn tagsrch.txt /*:tn*
:tnext tagsrch.txt /*:tnext*
:tno map.txt /*:tno*
:tnoremap map.txt /*:tnoremap*
:topleft windows.txt /*:topleft*
:tp tagsrch.txt /*:tp*
:tprevious tagsrch.txt /*:tprevious*
@@ -3163,6 +3180,8 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
:ts tagsrch.txt /*:ts*
:tselect tagsrch.txt /*:tselect*
:tu gui.txt /*:tu*
:tunma map.txt /*:tunma*
:tunmap map.txt /*:tunmap*
:tunmenu gui.txt /*:tunmenu*
:u undo.txt /*:u*
:un undo.txt /*:un*
@@ -3441,6 +3460,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
<bang> map.txt /*<bang>*
<buffer=N> autocmd.txt /*<buffer=N>*
<buffer=abuf> autocmd.txt /*<buffer=abuf>*
<cexpr> cmdline.txt /*<cexpr>*
<cfile> cmdline.txt /*<cfile>*
<character> intro.txt /*<character>*
<count> map.txt /*<count>*
@@ -3471,6 +3491,7 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
<mods> map.txt /*<mods>*
<nomodeline> autocmd.txt /*<nomodeline>*
<q-args> map.txt /*<q-args>*
<range> map.txt /*<range>*
<reg> map.txt /*<reg>*
<register> map.txt /*<register>*
<sfile> cmdline.txt /*<sfile>*
@@ -4886,6 +4907,7 @@ W22 eval.txt /*W22*
WORD motion.txt /*WORD*
WWW intro.txt /*WWW*
Win32 os_win32.txt /*Win32*
WinBar gui.txt /*WinBar*
WinEnter autocmd.txt /*WinEnter*
WinLeave autocmd.txt /*WinLeave*
WinNew autocmd.txt /*WinNew*
@@ -7367,6 +7389,7 @@ mapmode-n map.txt /*mapmode-n*
mapmode-nvo map.txt /*mapmode-nvo*
mapmode-o map.txt /*mapmode-o*
mapmode-s map.txt /*mapmode-s*
mapmode-t map.txt /*mapmode-t*
mapmode-v map.txt /*mapmode-v*
mapmode-x map.txt /*mapmode-x*
mapping map.txt /*mapping*
@@ -8105,6 +8128,7 @@ qnx-terminal os_qnx.txt /*qnx-terminal*
quake.vim syntax.txt /*quake.vim*
quickfix quickfix.txt /*quickfix*
quickfix-6 version6.txt /*quickfix-6*
quickfix-ID quickfix.txt /*quickfix-ID*
quickfix-directory-stack quickfix.txt /*quickfix-directory-stack*
quickfix-error-lists quickfix.txt /*quickfix-error-lists*
quickfix-functions usr_41.txt /*quickfix-functions*
@@ -8334,6 +8358,7 @@ servername-variable eval.txt /*servername-variable*
session-file starting.txt /*session-file*
set-option options.txt /*set-option*
set-spc-auto spell.txt /*set-spc-auto*
setbufline() eval.txt /*setbufline()*
setbufvar() eval.txt /*setbufvar()*
setcharsearch() eval.txt /*setcharsearch()*
setcmdpos() eval.txt /*setcmdpos()*
@@ -8560,6 +8585,7 @@ strdisplaywidth() eval.txt /*strdisplaywidth()*
strftime() eval.txt /*strftime()*
strgetchar() eval.txt /*strgetchar()*
stridx() eval.txt /*stridx()*
strikethrough syntax.txt /*strikethrough*
string eval.txt /*string*
string() eval.txt /*string()*
string-functions usr_41.txt /*string-functions*
@@ -8690,6 +8716,7 @@ t_KL term.txt /*t_KL*
t_PE term.txt /*t_PE*
t_PS term.txt /*t_PS*
t_RB term.txt /*t_RB*
t_RC term.txt /*t_RC*
t_RI term.txt /*t_RI*
t_RS term.txt /*t_RS*
t_RV term.txt /*t_RV*
@@ -8699,6 +8726,8 @@ t_SI term.txt /*t_SI*
t_SR term.txt /*t_SR*
t_Sb term.txt /*t_Sb*
t_Sf term.txt /*t_Sf*
t_Te term.txt /*t_Te*
t_Ts term.txt /*t_Ts*
t_VS term.txt /*t_VS*
t_WP term.txt /*t_WP*
t_WS term.txt /*t_WS*
@@ -8930,6 +8959,7 @@ term_gettty() eval.txt /*term_gettty()*
term_list() eval.txt /*term_list()*
term_scrape() eval.txt /*term_scrape()*
term_sendkeys() eval.txt /*term_sendkeys()*
term_setsize() eval.txt /*term_setsize()*
term_start() eval.txt /*term_start()*
term_wait() eval.txt /*term_wait()*
termcap term.txt /*termcap*
@@ -8948,6 +8978,7 @@ terminal-key-codes term.txt /*terminal-key-codes*
terminal-options term.txt /*terminal-options*
terminal-output-codes term.txt /*terminal-output-codes*
terminal-testing terminal.txt /*terminal-testing*
terminal-typing terminal.txt /*terminal-typing*
terminal-use terminal.txt /*terminal-use*
terminal.txt terminal.txt /*terminal.txt*
terminfo term.txt /*terminfo*
@@ -8955,6 +8986,7 @@ termresponse-variable eval.txt /*termresponse-variable*
test-functions usr_41.txt /*test-functions*
test_alloc_fail() eval.txt /*test_alloc_fail()*
test_autochdir() eval.txt /*test_autochdir()*
test_feedinput() eval.txt /*test_feedinput()*
test_garbagecollect_now() eval.txt /*test_garbagecollect_now()*
test_ignore_error() eval.txt /*test_ignore_error()*
test_null_channel() eval.txt /*test_null_channel()*
@@ -9181,7 +9213,11 @@ v:t_list eval.txt /*v:t_list*
v:t_none eval.txt /*v:t_none*
v:t_number eval.txt /*v:t_number*
v:t_string eval.txt /*v:t_string*
v:termblinkresp eval.txt /*v:termblinkresp*
v:termresponse eval.txt /*v:termresponse*
v:termrgbresp eval.txt /*v:termrgbresp*
v:termstyleresp eval.txt /*v:termstyleresp*
v:termu7resp eval.txt /*v:termu7resp*
v:testing eval.txt /*v:testing*
v:this_session eval.txt /*v:this_session*
v:throwpoint eval.txt /*v:throwpoint*
@@ -9502,6 +9538,7 @@ window-resize windows.txt /*window-resize*
window-size term.txt /*window-size*
window-size-functions usr_41.txt /*window-size-functions*
window-tag windows.txt /*window-tag*
window-toolbar gui.txt /*window-toolbar*
window-variable eval.txt /*window-variable*
windowid windows.txt /*windowid*
windowid-variable eval.txt /*windowid-variable*
+6 -3
View File
@@ -1,4 +1,4 @@
*term.txt* For Vim version 8.0. Last change: 2017 Aug 26
*term.txt* For Vim version 8.0. Last change: 2017 Aug 28
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -295,8 +295,6 @@ OUTPUT CODES *terminal-output-codes*
t_ts set window title start (to status line) *t_ts* *'t_ts'*
t_ue underline end *t_ue* *'t_ue'*
t_us underline mode *t_us* *'t_us'*
t_Ce undercurl end *t_Ce* *'t_Ce'*
t_Cs undercurl mode *t_Cs* *'t_Cs'*
t_ut clearing uses the current background color *t_ut* *'t_ut'*
t_vb visual bell *t_vb* *'t_vb'*
t_ve cursor visible *t_ve* *'t_ve'*
@@ -311,6 +309,10 @@ OUTPUT CODES *terminal-output-codes*
t_ZR italics end *t_ZR* *'t_ZR'*
Added by Vim (there are no standard codes for these):
t_Ce undercurl end *t_Ce* *'t_Ce'*
t_Cs undercurl mode *t_Cs* *'t_Cs'*
t_Te strikethrough end *t_Te* *'t_Te'*
t_Ts strikethrough mode *t_Ts* *'t_Ts'*
t_IS set icon text start *t_IS* *'t_IS'*
t_IE set icon text end *t_IE* *'t_IE'*
t_WP set window position (Y, X) in pixels *t_WP* *'t_WP'*
@@ -337,6 +339,7 @@ Added by Vim (there are no standard codes for these):
t_SC set cursor color start *t_SC* *'t_SC'*
t_EC set cursor color end *t_EC* *'t_EC'*
t_SH set cursor shape *t_SH* *'t_SH'*
t_RC request terminal cursor blinking *t_RC* *'t_RC'*
t_RS request terminal cursor style *t_RS* *'t_RS'*
Some codes have a start, middle and end part. The start and end are defined
+34 -7
View File
@@ -1,4 +1,4 @@
*terminal.txt* For Vim version 8.0. Last change: 2017 Sep 10
*terminal.txt* For Vim version 8.0. Last change: 2017 Sep 17
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -38,7 +38,7 @@ output from the job, also while editing in another window.
Typing ~
*terminal-typing*
When the keyboard focus is in the terminal window, typed keys will be sent to
the job. This uses a pty when possible. You can click outside of the
terminal window to move keyboard focus elsewhere.
@@ -79,15 +79,24 @@ do. For simple commands this causes a SIGINT to be sent to the job, which
would end it. Other commands may ignore the SIGINT or handle the CTRL-C
themselves (like Vim does).
To change the keys you type use terminal mode mappings, see |:tmap|.
These are defined like any mapping, but apply only when typing keys that are
sent to the job running in the terminal.
Size and color ~
See option 'termsize' for controlling the size of the terminal window.
(TODO: scrolling when the terminal is larger than the window)
The terminal uses the 'background' option to decide whether the terminal
window will start with a white or black background. The job running in the
terminal can change the colors.
The job running in the terminal can change the colors. The default foreground
and background colors are taken from Vim, the Normal highlight group.
For a color terminal the 'background' option is used to decide whether the
terminal window will start with a white or black background.
To use a different color the Terminal highlight group can be used: >
hi Terminal ctermbg=lightgrey ctermfg=blue guibg=lightgrey guifg=blue
Syntax ~
@@ -216,12 +225,16 @@ mode.
Use CTRL-W N (or 'termkey' N) to switch to Terminal-Normal mode. Now the
contents of the terminal window is under control of Vim, the job output is
suspended. CTRL-\ CTRL-N does the same.
Terminal-Job mode is where |:tmap| mappings are applied. Keys sent by
|term_sendkeys()| are not subject to tmap, but keys from |feedkeys()| are.
*E946*
In Terminal-Normal mode you can move the cursor around with the usual Vim
commands, Visually mark text, yank text, etc. But you cannot change the
contents of the buffer. The commands that would start insert mode, such as
'i' and 'a', return to Terminal-Job mode. The window will be updated to show
the contents of the terminal.
the contents of the terminal. |:startinsert| is ineffective.
In Terminal-Normal mode the statusline and window title show "(Terminal)". If
the job ends while in Terminal-Normal mode this changes to
@@ -296,7 +309,7 @@ inspects the resulting screen state.
Functions ~
term_sendkeys() send keystrokes to a terminal
term_sendkeys() send keystrokes to a terminal (not subject to tmap)
term_wait() wait for screen to be updated
term_scrape() inspect terminal screen
@@ -359,6 +372,14 @@ In the window showing the source code some commands can used to control gdb:
:Finish execute the gdb "finish" command
:Continue execute the gdb "continue" command
The plugin adds a window toolbar with these entries:
Step :Step
Next :Over
Finish :Finish
Cont :Continue
Eval :Evaluate
This way you can use the mouse to perform the most common commands.
Inspecting variables ~
@@ -403,6 +424,12 @@ When 'background' is "dark":
hi debugPC term=reverse ctermbg=darkblue guibg=darkblue
hi debugBreakpoint term=reverse ctermbg=red guibg=red
To change the width of the Vim window when debugging starts, and use a
vertical split: >
let g:termdebug_wide = 163
This will set &columns to 163 when :Termdebug is used. The value is restored
when quitting the debugger.
vim:tw=78:ts=8:ft=help:norl:
+76 -42
View File
@@ -1,4 +1,4 @@
*todo.txt* For Vim version 8.0. Last change: 2017 Aug 27
*todo.txt* For Vim version 8.0. Last change: 2017 Sep 19
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -35,25 +35,39 @@ entered there will not be repeated below, unless there is extra information.
*known-bugs*
-------------------- Known bugs and current work -----------------------
:term hangs in Athena and Motif. (Kazunobu Kuriyama, 2017 Sep 17)
Always use FEAT_WINDOWS:
May get rid of:
#define W_WINCOL(wp) (wp->w_wincol)
#define W_WIDTH(wp) (wp->w_width)
#define W_ENDCOL(wp) (wp->w_wincol + wp->w_width)
#define W_VSEP_WIDTH(wp) (wp->w_vsep_width)
#define W_STATUS_HEIGHT(wp) (wp->w_status_height)
#define W_WINROW(wp) (wp->w_winrow)
# define ALIST(win) (win)->w_alist
No maintainer for Vietnamese translations.
No maintainer for Simplified Chinese translations.
Terminal emulator window:
- Lots of stuff to implement, see src/terminal.c
- Add debugger interface. Implementation for gdb by Xavier de Gaye. Should
work like an IDE. Try to keep it generic. Now found here:
http://clewn.sf.net.
Can this replace Agide? http://www.a-a-p.org/images/debugfull.png
- Improve debugger interface:
Include all debug features of Agide.
- Implement the right-click popup menu for the terminal. Can use the
completion popup menu code and mouse dragging.
Use it for "set breakpoint", "remove breakpoint", etc.
- make showballoon() work in a terminal. Requires getting mouse-move
events.
- send 'balloonText' events for the cursor position (using CursorHold ?)
in terminal mode.
- Implement the right-click popup menu for the terminal. Can use the
completion popup menu code and mouse dragging.
- Look into the idevim plugin/script.
- Related wishes for NetBeans commands:
- make it possible to have 'defineAnnoType' also handle terminal colors.
- get ideas from http://clewn.sf.net
- Look into the idevim plugin/script.
- Improve testing:
Make a screenshot of a terminal, store in a file.
Display a stored screenshot, display diff with another one.
Make a test that puts Vim in a specific state, make a screenshot and compare
with the expected screenshot. Set t_Co to 256.
+channel:
- Try out background make plugin:
@@ -123,8 +137,6 @@ Regexp problems:
Another one: echom matchstr(" sdfsfsf\n sfdsdfsdf",'[^\n]*')
(2017 May 15, #1252)
Patch to turn test80 into a new style test. (Yegappan Lakshmanan, 2017 Aug 20)
Include a few color schemes, based on popularity:
http://www.vim.org/scripts/script_search_results.php?keywords=&script_type=color+scheme&order_by=rating&direction=descending&search=search
http://vimawesome.com/?q=tag:color-scheme
@@ -138,26 +150,45 @@ Suggested by Hiroki Kokubun:
- [Iceberg](https://github.com/cocopon/iceberg.vim) (my one)
- [hybrid](https://github.com/w0ng/vim-hybrid)
Patch to update Brazilian translations. (Eduardo Dobay, 2017 Sep 10, #2077)
When starting with --clean packages under "start" are not loaded. Make this
work: :packadd START {name} similar to :runtime START name
Patch to refactor qf_jump(). (Yegappan, 2017 Sep 17)
When using :packadd files under "later" are not used, which is inconsistent
with packages under "start". (xtal8, #1994)
After 8.0.0962 pasting leaves the cursor in another position. (Ken Takata,
2017 Aug 23, #2015) Also (zdm, 2017 Aug 23)
Patch to add quickfix list identifier. (Yegappan, 2017 Aug 15)
Patch to fix popup menu drawing when changing the window size. (Ozaki Kiichi,
2017 Sep 17, #2110)
Patch to fix cursor highlighting with match. (Ozaki Kiichi, 2017 Sep 17,
#2111)
Patch for not profiling the first line of a script. (Lemonboy, 2017 Sep 17,
#2103)
Mac Terminal.app: ctermbg=15 gives light grey instead of white.
ctermbg=256 breaks clearing till end of the line. Both work fine in xterm.
Patch to avoid editing a file in the session file twice. (Christian Brabandt,
2017 Aug 21) #1958
Using ":hi" causes a redraw, but a redraw may update the status line, which
may trigger a ":hi" command.
Last line not in profile if it is a continuation line. (LemonBoy, 2017 Sep 17,
#2112)
"vim -c startinsert!" doesn't append. (#2117)
With foldmethod=syntax and nofoldenable comment highlighting isn't removed.
(Marcin Szewczyk, 2017 Apr 26)
Patch to make Mac features more clear and add "macdarwin". (Kazunobu Kuriyama,
2017 Sep 5)
Using 'wildignore' also applies to literally entered file name. Also with
:drop (remote commands).
@@ -168,35 +199,27 @@ ml_get errors with buggy script. (Dominique, 2017 Apr 30)
Error in emsg with buggy script. (Dominique, 2017 Apr 30)
Patch to make ":set scroll&" work properly. (Ozaki Kiichi, 2017 Sep 17, #2104)
mswin.vim should not map CTRL-F in the console (#2093)
Patch from Christian, 2017 Sep 15.
Default install on MS-Windows should source defaults.vim.
Ask whether to use Windows or Vim key behavior?
matchit hasn't been maintained for a long time. #955.
Test runtime files.
Start with filetype detection: testdir/test_filetype.vim
Patch to support on-the-spot and over-the-spot input method. (Ken Takata, 2017
Feb 14). Also see #1215.
Patch to ignore case when 'diffopt' has "icase" for finding the difference
inside a line. (Rick Howe, 2017 Aug 21, 22 with test)
Patch to support strikethrough next to bold and italic. (Christian Brabandt,
2013 Jul 30) Update from Ken Takata, 2013 Oct 12.
Update mentioned by Christian, 2016 Apr 25.
Update from Ken Takata, 2017 Aug 23.
Patch to add setbufline(). (email from Yasuhiro Matsumoto, patch by Ozaki
Kiichi, 2016 Feb 28)
Update Mar 8: https://gist.github.com/mattn/23c1f50999084992ca98
Update Mar 13: https://gist.github.com/mattn/23c1f50999084992ca98
Update Aug 2017: #1953
Patch to fix indenting for raw C++ string. (Christian Brabandt, 2017 Aug 24,
#2019)
Window not closed when deleting buffer. (Harm te Hennepe, 2017 Aug 27, #2029)
Add options_default() / options_restore() to set several options to Vim
defaults for a plugin. Comments from Zyx, 2017 May 10.
Perhaps use a vimcontext / endvimcontext command block.
Patch to fix bogus characters inserted in visual-block append. (Christian
Brabandt, 2017 Aug 23)
After using :noautocmd CursorMoved may still trigger. (Andy Stewart, 2017 Sep
13, #2084). Set old position after the command.
Illegal memory access, requires ASAN to see. (Dominique Pelle, 2015 Jul 28)
Still happens (2017 Jul 9)
@@ -207,17 +230,19 @@ line breaks. (Ken Takata, 2017 Aug 22)
This example in the help does not work (Andy Wokula, 2017 Aug 20):
augroup mine | au! BufRead | augroup END
Memory leaks in test_channel? (or is it because of fork())
Memory leak in test_arabic.
Using uninitialized value in test_crypt.
Include Haiku port? (Adrien Destugues, Siarzhuk Zharski, 2013 Oct 24)
Patch to make gM move to middle of line. (Yasuhiro Matsumoto, Sep 8, #2070)
Include Haiku port. (Adrien Destugues, Siarzhuk Zharski, 2013 Oct 24)
It can replace the BeOS code, which is likely not used anymore.
Now on github: #1856. Is now up-to-date?
Now on github: #1856.
Got permission to include this under the Vim license.
Refactored HTML indent file. (Michael Lee, #1821)
Using uninitialized value in test_crypt.
Test_writefile_fails_conversion failure on Solaris because if different iconv
behavior. Skip when "uname" returns "SunOS"? (Pavel Heimlich, #1872)
@@ -235,6 +260,9 @@ Alternatives for ~:
The ++ options for the :edit command are also useful on the Vim command line.
Overlong utf-8 sequence is displayed wrong. (Harm te Hennepe, 2017 Sep 14,
#2089) Patch with possible solution by Björn Linse.
X11: Putting more than about 262040 characters of text on the clipboard and
pasting it in another Vim doesn't work. (Dominique Pelle, 2008 Aug 21-23)
clip_x11_request_selection_cb() is called with zero value and length.
@@ -249,6 +277,9 @@ Creating a partial with an autoload function is confused about the "self"
attribute of the function. For an unknown function assume "self" and make
that optiona? (Bjorn Linse, 2017 Aug 5)
Cindent: returning a structure has more indent for the second item.
(Sam Pagenkopf, 2017 Sep 14, #2090)
Completion mixes results from the current buffer with tags and other files.
Happens when typing CTRL-N while still search for results. E.g., type "b_" in
terminal.c and then CTRL-N twice.
@@ -1519,6 +1550,9 @@ GTK: tear-off menu does not work. (Kurt Sonnenmoser, 2010 Oct 25)
Win32: tear-off menu does not work when menu language is German. (Markus
Bossler, 2011 Mar 2) Fixed by 7.3.095?
Wish for NetBeans commands:
- make it possible to have 'defineAnnoType' also handle terminal colors.
Version of netbeans.c for use with MacVim. (Kazuki Sakamoto, 2010 Nov 18)
7.3.014 changed how backslash at end of line works, but still get a NUL when
@@ -3709,7 +3743,7 @@ Multi-byte characters:
at a multi-byte character >= 0x100.
- Add the possibility to enter mappings which are used whenever normal text
could be entered. E.g., for "f" command. But not in Normal mode. Sort
of opposite of 'langmap'. Use ":tmap" command?
of opposite of 'langmap'. Use ":amap" command?
- When breaking a line, take properties of multi-byte characters into
account. The "linebreak" program from Bruno Haible can do it:
ftp://ftp.ilog.fr/pub/Users/haible/gnu/linebreak-0.1.tar.gz
+11 -11
View File
@@ -1,4 +1,4 @@
*usr_07.txt* For Vim version 8.0. Last change: 2017 Aug 11
*usr_07.txt* For Vim version 8.0. Last change: 2017 Sep 18
VIM USER MANUAL - by Bram Moolenaar
@@ -215,14 +215,14 @@ change: >
`.
Suppose you are editing the file "one.txt". Somewhere halfway the file you
use "x" to delete a character. Then you go to the last line with "G" and
write the file with ":w". You edit several other files, and then use ":edit
one.txt" to come back to "one.txt". If you now use `" Vim jumps to the last
line of the file. Using `. takes you to the position where you deleted the
character. Even when you move around in the file `" and `. will take you to
the remembered position. At least until you make another change or leave the
file.
Suppose you are editing the file "one.txt". Somewhere halfway through the
file you use "x" to delete a character. Then you go to the last line with "G"
and write the file with ":w". You edit several other files, and then use
":edit one.txt" to come back to "one.txt". If you now use `" Vim jumps to the
last line of the file. Using `. takes you to the position where you deleted
the character. Even when you move around in the file `" and `. will take you
to the remembered position. At least until you make another change or leave
the file.
FILE MARKS
@@ -233,8 +233,8 @@ 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
with an uppercase letter. These are global, they can be used from any file.
For example suppose that we are editing the file "foo.txt". Go to halfway the
file ("50%") and place the F mark there (F for foo): >
For example suppose that we are editing the file "foo.txt". Go to halfway
down the file ("50%") and place the F mark there (F for foo): >
50%mF
+7 -5
View File
@@ -1,4 +1,4 @@
*various.txt* For Vim version 8.0. Last change: 2017 Feb 24
*various.txt* For Vim version 8.0. Last change: 2017 Sep 16
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -322,7 +322,7 @@ N *+cindent* |'cindent'|, C indenting
N *+clientserver* Unix and Win32: Remote invocation |clientserver|
*+clipboard* |clipboard| support
N *+cmdline_compl* command line completion |cmdline-completion|
N *+cmdline_hist* command line history |cmdline-history|
S *+cmdline_hist* command line history |cmdline-history|
N *+cmdline_info* |'showcmd'| and |'ruler'|
N *+comments* |'comments'| support
B *+conceal* "conceal" support, see |conceal| |:syn-conceal| etc.
@@ -362,7 +362,7 @@ m *+hangul_input* Hangul input support |hangul|
*+iconv/dyn* Likewise |iconv-dynamic| |/dyn|
N *+insert_expand* |insert_expand| Insert mode completion
m *+job* starting and stopping jobs |job|
N *+jumplist* |jumplist|
S *+jumplist* |jumplist|
B *+keymap* |'keymap'|
N *+lambda* |lambda| and |closure|
B *+langmap* |'langmap'|
@@ -441,14 +441,16 @@ N *+toolbar* |gui-toolbar|
m *+transparency* MacVim only: window background transparency
N *+user_commands* User-defined commands. |user-commands|
N *+viminfo* |'viminfo'|
N *+vertsplit* Vertically split windows |:vsplit|
*+vertsplit* Vertically split windows |:vsplit|; Always enabled
since 8.0.1118.
in sync with the |+windows| feature
N *+virtualedit* |'virtualedit'|
S *+visual* Visual mode |Visual-mode| Always enabled since 7.4.200.
N *+visualextra* extra Visual mode commands |blockwise-operators|
N *+vreplace* |gR| and |gr|
N *+wildignore* |'wildignore'|
N *+wildmenu* |'wildmenu'|
S *+windows* more than one window
*+windows* more than one window; Always enabled sinde 8.0.1118.
m *+writebackup* |'writebackup'| is default on
m *+xim* X input method |xim|
*+xfontset* X fontset support |xfontset|
+1 -1
View File
@@ -1,4 +1,4 @@
*visual.txt* For Vim version 8.0. Last change: 2014 Mar 23
*visual.txt* For Vim version 8.0. Last change: 2017 Sep 02
VIM REFERENCE MANUAL by Bram Moolenaar
+2 -1
View File
@@ -1,4 +1,4 @@
*windows.txt* For Vim version 8.0. Last change: 2017 Aug 21
*windows.txt* For Vim version 8.0. Last change: 2017 Sep 08
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1034,6 +1034,7 @@ list of buffers. |unlisted-buffer|
= a readonly buffer
R a terminal buffer with a running job
F a terminal buffer with a finished job
? a terminal buffer without a job: `:terminal NONE`
+ a modified buffer
x a buffer with read errors
+7 -6
View File
@@ -3,7 +3,7 @@
" Maintainer: vim-perl <vim-perl@googlegroups.com>
" Homepage: http://github.com/vim-perl/vim-perl
" Bugs/requests: http://github.com/vim-perl/vim-perl/issues
" Last Change: 2013-07-21
" Last Change: 2015-02-09
if exists("b:did_ftplugin") | finish | endif
let b:did_ftplugin = 1
@@ -33,14 +33,14 @@ endif
setlocal include=\\<\\(use\\\|require\\)\\>
setlocal includeexpr=substitute(substitute(substitute(v:fname,'::','/','g'),'->\*','',''),'$','.pm','')
setlocal define=[^A-Za-z_]
setlocal iskeyword+=:
" The following line changes a global variable but is necessary to make
" gf and similar commands work. The change to iskeyword was incorrect.
" Thanks to Andrew Pimlott for pointing out the problem. If this causes a
" problem for you, add an after/ftplugin/perl.vim file that contains
" gf and similar commands work. Thanks to Andrew Pimlott for pointing
" out the problem. If this causes a problem for you, add an
" after/ftplugin/perl.vim file that contains
" set isfname-=:
set isfname+=:
set iskeyword+=:
" Set this once, globally.
if !exists("perlpath")
@@ -77,11 +77,12 @@ endif
"---------------------------------------------
" Undo the stuff we changed.
let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isf< kp< path<" .
let b:undo_ftplugin = "setlocal fo< com< cms< inc< inex< def< isk< isf< kp< path<" .
\ " | unlet! b:browsefilter"
" proper matching for matchit plugin
let b:match_skip = 's:comment\|string\|perlQQ\|perlShellCommand\|perlHereDoc\|perlSubstitution\|perlTranslation\|perlMatch\|perlFormatField'
let b:match_words = '\<if\>:\<elsif\>:\<else\>'
" Restore the saved compatibility options.
let &cpo = s:save_cpo
+9 -10
View File
@@ -1,14 +1,12 @@
" Vim indent file
" Program: CMake - Cross-Platform Makefile Generator
" Module: $RCSfile: cmake-indent.vim,v $
" Language: CMake (ft=cmake)
" Author: Andy Cedilnik <andy.cedilnik@kitware.com>
" Maintainer: Karthik Krishnan <karthik.krishnan@kitware.com>
" Last Change: $Date: 2008-01-16 16:53:53 $
" Version: $Revision: 1.9 $
" Maintainer: Dimitri Merejkowsky <d.merej@gmail.com>
" Former Maintainer: Karthik Krishnan <karthik.krishnan@kitware.com>
" Last Change: 2017 Aug 30
"
" Licence: The CMake license applies to this file. See
" http://www.cmake.org/HTML/Copyright.html
" https://cmake.org/licensing
" This implies that distribution with Vim is allowed
if exists("b:did_indent")
@@ -16,6 +14,7 @@ if exists("b:did_indent")
endif
let b:did_indent = 1
setlocal et
setlocal indentexpr=CMakeGetIndent(v:lnum)
setlocal indentkeys+==ENDIF(,ENDFOREACH(,ENDMACRO(,ELSE(,ELSEIF(,ENDWHILE(
@@ -68,19 +67,19 @@ fun! CMakeGetIndent(lnum)
let ind = ind
else
if previous_line =~? cmake_indent_begin_regex
let ind = ind + shiftwidth()
let ind = ind + &sw
endif
if previous_line =~? cmake_indent_open_regex
let ind = ind + shiftwidth()
let ind = ind + &sw
endif
endif
" Subtract
if this_line =~? cmake_indent_end_regex
let ind = ind - shiftwidth()
let ind = ind - &sw
endif
if previous_line =~? cmake_indent_close_regex
let ind = ind - shiftwidth()
let ind = ind - &sw
endif
return ind
+291 -220
View File
@@ -2,7 +2,7 @@
" Language: Javascript
" Maintainer: Chris Paul ( https://github.com/bounceme )
" URL: https://github.com/pangloss/vim-javascript
" Last Change: March 21, 2017
" Last Change: September 18, 2017
" Only load this indent file when no other was loaded.
if exists('b:did_indent')
@@ -10,6 +10,10 @@ if exists('b:did_indent')
endif
let b:did_indent = 1
" indent correctly if inside <script>
" vim/vim@690afe1 for the switch from cindent
let b:html_indent_script1 = 'inc'
" Now, set up our indentation expression and keys that trigger it.
setlocal indentexpr=GetJavascriptIndent()
setlocal autoindent nolisp nosmartindent
@@ -21,6 +25,13 @@ setlocal indentkeys+=0],0)
let b:undo_indent = 'setlocal indentexpr< smartindent< autoindent< indentkeys<'
" Regex of syntax group names that are or delimit string or are comments.
let b:syng_strcom = get(b:,'syng_strcom','string\|comment\|regex\|special\|doc\|template\%(braces\)\@!')
let b:syng_str = get(b:,'syng_str','string\|template\|special')
" template strings may want to be excluded when editing graphql:
" au! Filetype javascript let b:syng_str = '^\%(.*template\)\@!.*string\|special'
" au! Filetype javascript let b:syng_strcom = '^\%(.*template\)\@!.*string\|comment\|regex\|special\|doc'
" Only define the function once.
if exists('*GetJavascriptIndent')
finish
@@ -36,7 +47,7 @@ if exists('*shiftwidth')
endfunction
else
function s:sw()
return &l:shiftwidth == 0 ? &l:tabstop : &l:shiftwidth
return &l:shiftwidth ? &l:shiftwidth : &l:tabstop
endfunction
endif
@@ -44,272 +55,301 @@ endif
" matches before pos.
let s:z = has('patch-7.4.984') ? 'z' : ''
" Expression used to check whether we should skip a match with searchpair().
let s:skip_expr = "s:SynAt(line('.'),col('.')) =~? b:syng_strcom"
let s:in_comm = s:skip_expr[:-14] . "'comment\\|doc'"
let s:rel = has('reltime')
" searchpair() wrapper
if has('reltime')
function s:GetPair(start,end,flags,skip,time,...)
return searchpair('\m'.a:start,'','\m'.a:end,a:flags,a:skip,max([prevnonblank(v:lnum) - 2000,0] + a:000),a:time)
if s:rel
function s:GetPair(start,end,flags,skip)
return searchpair('\m'.a:start,'','\m'.a:end,a:flags,a:skip,s:l1,a:skip ==# 's:SkipFunc()' ? 2000 : 200)
endfunction
else
function s:GetPair(start,end,flags,skip,...)
return searchpair('\m'.a:start,'','\m'.a:end,a:flags,a:skip,max([prevnonblank(v:lnum) - 1000,get(a:000,1)]))
function s:GetPair(start,end,flags,skip)
return searchpair('\m'.a:start,'','\m'.a:end,a:flags,a:skip,s:l1)
endfunction
endif
" Regex of syntax group names that are or delimit string or are comments.
let s:syng_strcom = 'string\|comment\|regex\|special\|doc\|template\%(braces\)\@!'
let s:syng_str = 'string\|template\|special'
let s:syng_com = 'comment\|doc'
" Expression used to check whether we should skip a match with searchpair().
let s:skip_expr = "synIDattr(synID(line('.'),col('.'),0),'name') =~? '".s:syng_strcom."'"
function s:parse_cino(f) abort
return float2nr(eval(substitute(substitute(join(split(
\ matchstr(&cino,'.*'.a:f.'\zs[^,]*'), 's',1), '*'.s:W)
\ , '^-\=\zs\*','',''), '^-\=\zs\.','0.','')))
endfunction
function s:skip_func()
if getline('.') =~ '\%<'.col('.').'c\/.\{-}\/\|\%>'.col('.').'c[''"]\|\\$'
return eval(s:skip_expr)
elseif s:checkIn || search('\m`\|\${\|\*\/','nW'.s:z,s:looksyn)
let s:checkIn = eval(s:skip_expr)
function s:SynAt(l,c)
let byte = line2byte(a:l) + a:c - 1
let pos = index(s:synid_cache[0], byte)
if pos == -1
let s:synid_cache[:] += [[byte], [synIDattr(synID(a:l, a:c, 0), 'name')]]
endif
let s:looksyn = line('.')
return s:checkIn
return s:synid_cache[1][pos]
endfunction
function s:alternatePair(stop)
let pos = getpos('.')[1:2]
let pat = '[][(){};]'
while search('\m'.pat,'bW',a:stop)
if s:skip_func() | continue | endif
let idx = stridx('])};',s:looking_at())
if idx is 3 | let pat = '[{}()]' | continue | endif
if idx + 1
if s:GetPair(['\[','(','{'][idx], '])}'[idx],'bW','s:skip_func()',2000,a:stop) <= 0
function s:ParseCino(f)
let [divider, n, cstr] = [0] + matchlist(&cino,
\ '\%(.*,\)\=\%(\%d'.char2nr(a:f).'\(-\)\=\([.s0-9]*\)\)\=')[1:2]
for c in split(cstr,'\zs')
if c == '.' && !divider
let divider = 1
elseif c ==# 's'
if n !~ '\d'
return n . s:sw() + 0
endif
let n = str2nr(n) * s:sw()
break
else
let [n, divider] .= [c, 0]
endif
endfor
return str2nr(n) / max([str2nr(divider),1])
endfunction
" Optimized {skip} expr, only callable from the search loop which
" GetJavascriptIndent does to find the containing [[{(] (side-effects)
function s:SkipFunc()
if s:top_col == 1
throw 'out of bounds'
endif
let s:top_col = 0
if s:check_in
if eval(s:skip_expr)
return 1
endif
let s:check_in = 0
elseif getline('.') =~ '\%<'.col('.').'c\/.\{-}\/\|\%>'.col('.').'c[''"]\|\\$'
if eval(s:skip_expr)
let s:looksyn = a:firstline
return 1
endif
elseif search('\m`\|\${\|\*\/','nW'.s:z,s:looksyn) && eval(s:skip_expr)
let s:check_in = 1
return 1
endif
let [s:looksyn, s:top_col] = getpos('.')[1:2]
endfunction
function s:AlternatePair()
let [pat, l:for] = ['[][(){};]', 2]
while s:SearchLoop(pat,'bW','s:SkipFunc()')
if s:LookingAt() == ';'
if !l:for
if s:GetPair('{','}','bW','s:SkipFunc()')
return
endif
break
else
let [pat, l:for] = ['[{}();]', l:for - 1]
endif
else
return
let idx = stridx('])}',s:LookingAt())
if idx == -1
return
elseif !s:GetPair(['\[','(','{'][idx],'])}'[idx],'bW','s:SkipFunc()')
break
endif
endif
endwhile
call call('cursor',pos)
throw 'out of bounds'
endfunction
function s:save_pos(f,...)
let l:pos = getpos('.')[1:2]
let ret = call(a:f,a:000)
call call('cursor',l:pos)
return ret
function s:Nat(int)
return a:int * (a:int > 0)
endfunction
function s:syn_at(l,c)
return synIDattr(synID(a:l,a:c,0),'name')
endfunction
function s:looking_at()
function s:LookingAt()
return getline('.')[col('.')-1]
endfunction
function s:token()
return s:looking_at() =~ '\k' ? expand('<cword>') : s:looking_at()
function s:Token()
return s:LookingAt() =~ '\k' ? expand('<cword>') : s:LookingAt()
endfunction
function s:previous_token()
let l:pos = getpos('.')[1:2]
if search('\m\k\{1,}\zs\k\|\S','bW')
if (getline('.')[col('.')-2:col('.')-1] == '*/' || line('.') != l:pos[0] &&
\ getline('.') =~ '\%<'.col('.').'c\/\/') && s:syn_at(line('.'),col('.')) =~? s:syng_com
while search('\m\S\ze\_s*\/[/*]','bW')
if s:syn_at(line('.'),col('.')) !~? s:syng_com
return s:token()
endif
endwhile
function s:PreviousToken()
let l:col = col('.')
if search('\m\k\{1,}\|\S','ebW')
if search('\m\*\%#\/\|\/\/\%<'.a:firstline.'l','nbW',line('.')) && eval(s:in_comm)
if s:SearchLoop('\S\ze\_s*\/[/*]','bW',s:in_comm)
return s:Token()
endif
call cursor(a:firstline, l:col)
else
return s:token()
return s:Token()
endif
endif
call call('cursor',l:pos)
return ''
endfunction
function s:expr_col()
if getline('.')[col('.')-2] == ':'
return 1
endif
function s:Pure(f,...)
return eval("[call(a:f,a:000),cursor(a:firstline,".col('.').")][0]")
endfunction
function s:SearchLoop(pat,flags,expr)
return s:GetPair(a:pat,'\_$.',a:flags,a:expr)
endfunction
function s:ExprCol()
let bal = 0
while search('\m[{}?:;]','bW')
if eval(s:skip_expr) | continue | endif
" switch (looking_at())
exe { '}': "if s:GetPair('{','}','bW',s:skip_expr,200) <= 0 | return | endif",
\ ';': "return",
\ '{': "return getpos('.')[1:2] != b:js_cache[1:] && !s:IsBlock()",
\ ':': "let bal -= getline('.')[max([col('.')-2,0]):col('.')] !~ '::'",
\ '?': "let bal += 1 | if bal > 0 | return 1 | endif" }[s:looking_at()]
while s:SearchLoop('[{}?]\|\_[^:]\zs::\@!','bW',s:skip_expr)
if s:LookingAt() == ':'
let bal -= 1
elseif s:LookingAt() == '?'
let bal += 1
if bal == 1
break
endif
elseif s:LookingAt() == '{'
let bal = !s:IsBlock()
break
elseif !s:GetPair('{','}','bW',s:skip_expr)
break
endif
endwhile
return s:Nat(bal)
endfunction
" configurable regexes that define continuation lines, not including (, {, or [.
let s:opfirst = '^' . get(g:,'javascript_opfirst',
\ '\C\%([<>=,?^%|*/&]\|\([-.:+]\)\1\@!\|!=\|in\%(stanceof\)\=\>\)')
\ '\C\%([<>=,.?^%|/&]\|\([-:+]\)\1\@!\|\*\+\|!=\|in\%(stanceof\)\=\>\)')
let s:continuation = get(g:,'javascript_continuation',
\ '\C\%([-+<>=,.~!?/*^%|&:]\|\<\%(typeof\|new\|delete\|void\|in\|instanceof\|await\)\)') . '$'
\ '\C\%([<=,.~!?/*^%|&:]\|+\@<!+\|-\@<!-\|=\@<!>\|\<\%(typeof\|new\|delete\|void\|in\|instanceof\|await\)\)') . '$'
function s:continues(ln,con)
if !cursor(a:ln, match(' '.a:con,s:continuation))
let teol = s:looking_at()
if teol == '/'
return s:syn_at(line('.'),col('.')) !~? 'regex'
elseif teol =~ '[-+>]'
return getline('.')[col('.')-2] != tr(teol,'>','=')
elseif teol =~ '\l'
return s:previous_token() != '.'
elseif teol == ':'
return s:expr_col()
endif
return 1
function s:Continues(ln,con)
let tok = matchstr(a:con[-15:],s:continuation)
if tok =~ '[a-z:]'
call cursor(a:ln, len(a:con))
return tok == ':' ? s:ExprCol() : s:PreviousToken() != '.'
elseif tok !~ '[/>]'
return tok isnot ''
endif
endfunction
" get the line of code stripped of comments and move cursor to the last
" non-comment char.
function s:Trim(ln)
let pline = substitute(getline(a:ln),'\s*$','','')
let l:max = max([strridx(pline,'//'), strridx(pline,'/*')])
while l:max != -1 && s:syn_at(a:ln, strlen(pline)) =~? s:syng_com
let pline = pline[: l:max]
let l:max = max([strridx(pline,'//'), strridx(pline,'/*')])
let pline = substitute(pline[:-2],'\s*$','','')
endwhile
return pline is '' || cursor(a:ln,strlen(pline)) ? pline : pline
endfunction
" Find line above 'lnum' that isn't empty or in a comment
function s:PrevCodeLine(lnum)
let [l:pos, l:n] = [getpos('.')[1:2], prevnonblank(a:lnum)]
while l:n
if getline(l:n) =~ '^\s*\/[/*]'
let l:n = prevnonblank(l:n-1)
elseif stridx(getline(l:n), '*/') + 1 && s:syn_at(l:n,1) =~? s:syng_com
call cursor(l:n,1)
keepjumps norm! [*
let l:n = search('\m\S','nbW')
else
break
endif
endwhile
call call('cursor',l:pos)
return l:n
return s:SynAt(a:ln, len(a:con)) !~? (tok == '>' ? 'jsflow\|^html' : 'regex')
endfunction
" Check if line 'lnum' has a balanced amount of parentheses.
function s:Balanced(lnum)
let l:open = 0
let l:line = getline(a:lnum)
let pos = match(l:line, '[][(){}]', 0)
let [l:open, l:line] = [0, getline(a:lnum)]
let pos = match(l:line, '[][(){}]')
while pos != -1
if s:syn_at(a:lnum,pos + 1) !~? s:syng_strcom
if s:SynAt(a:lnum,pos + 1) !~? b:syng_strcom
let l:open += match(' ' . l:line[pos],'[[({]')
if l:open < 0
return
endif
endif
let pos = match(l:line, (l:open ?
\ '['.escape(tr(l:line[pos],'({[]})',')}][{(').l:line[pos],']').']' :
\ '[][(){}]'), pos + 1)
let pos = match(l:line, !l:open ? '[][(){}]' : '()' =~ l:line[pos] ?
\ '[()]' : '{}' =~ l:line[pos] ? '[{}]' : '[][]', pos + 1)
endwhile
return !l:open
endfunction
function s:OneScope(lnum)
let pline = s:Trim(a:lnum)
let kw = 'else do'
if pline[-1:] == ')' && s:GetPair('(', ')', 'bW', s:skip_expr, 100) > 0
if s:previous_token() =~# '^\%(await\|each\)$'
call s:previous_token()
let kw = 'for'
else
let kw = 'for if let while with'
endif
function s:OneScope()
if s:LookingAt() == ')' && s:GetPair('(', ')', 'bW', s:skip_expr)
let tok = s:PreviousToken()
return (count(split('for if let while with'),tok) ||
\ tok =~# '^await$\|^each$' && s:PreviousToken() ==# 'for') &&
\ s:Pure('s:PreviousToken') != '.' && !(tok == 'while' && s:DoWhile())
elseif s:Token() =~# '^else$\|^do$'
return s:Pure('s:PreviousToken') != '.'
endif
return pline[-2:] == '=>' || index(split(kw),s:token()) + 1 &&
\ s:save_pos('s:previous_token') != '.'
return strpart(getline('.'),col('.')-2,2) == '=>'
endfunction
" returns braceless levels started by 'i' and above lines * shiftwidth().
" 'num' is the lineNr which encloses the entire context, 'cont' if whether
" line 'i' + 1 is a continued expression, which could have started in a
" braceless context
function s:iscontOne(i,num,cont)
let [l:i, l:num, bL] = [a:i, a:num + !a:num, 0]
let pind = a:num ? indent(l:num) + s:W : 0
let ind = indent(l:i) + (a:cont ? 0 : s:W)
while l:i >= l:num && (ind > pind || l:i == l:num)
if indent(l:i) < ind && s:OneScope(l:i)
let bL += s:W
let l:i = line('.')
elseif !a:cont || bL || ind < indent(a:i)
function s:DoWhile()
let cpos = searchpos('\m\<','cbW')
if s:SearchLoop('\C[{}]\|\<\%(do\|while\)\>','bW',s:skip_expr)
if s:{s:LookingAt() == '}' && s:GetPair('{','}','bW',s:skip_expr) ?
\ 'Previous' : ''}Token() ==# 'do' && s:IsBlock()
return 1
endif
call call('cursor',cpos)
endif
endfunction
" returns total offset from braceless contexts. 'num' is the lineNr which
" encloses the entire context, 'cont' if whether a:firstline is a continued
" expression, which could have started in a braceless context
function s:IsContOne(num,cont)
let [l:num, b_l] = [a:num + !a:num, 0]
let pind = a:num ? indent(a:num) + s:sw() : 0
let ind = indent('.') + !a:cont
while line('.') > l:num && ind > pind || line('.') == l:num
if indent('.') < ind && s:OneScope()
let b_l += 1
elseif !a:cont || b_l || ind < indent(a:firstline)
break
else
call cursor(0,1)
endif
let ind = min([ind, indent('.')])
if s:PreviousToken() is ''
break
endif
let ind = min([ind, indent(l:i)])
let l:i = s:PrevCodeLine(l:i - 1)
endwhile
return bL
return b_l
endfunction
function s:Class()
return (s:Token() ==# 'class' || s:PreviousToken() =~# '^class$\|^extends$') &&
\ s:PreviousToken() != '.'
endfunction
function s:IsSwitch()
return s:PreviousToken() !~ '[.*]' &&
\ (!s:GetPair('{','}','cbW',s:skip_expr) || s:IsBlock() && !s:Class())
endfunction
" https://github.com/sweet-js/sweet.js/wiki/design#give-lookbehind-to-the-reader
function s:IsBlock()
if s:looking_at() == '{'
let l:n = line('.')
let char = s:previous_token()
if match(s:stack,'\cxml\|jsx') + 1 && s:syn_at(line('.'),col('.')-1) =~? 'xml\|jsx'
return char != '{'
elseif char =~ '\k'
if char ==# 'type'
return s:previous_token() !~# '^\%(im\|ex\)port$'
endif
return index(split('return const let import export extends yield default delete var await void typeof throw case new of in instanceof')
\ ,char) < (line('.') != l:n) || s:save_pos('s:previous_token') == '.'
elseif char == '>'
return getline('.')[col('.')-2] == '=' || s:syn_at(line('.'),col('.')) =~? '^jsflow'
elseif char == ':'
return !s:save_pos('s:expr_col')
elseif char == '/'
return s:syn_at(line('.'),col('.')) =~? 'regex'
let tok = s:PreviousToken()
if join(s:stack) =~? 'xml\|jsx' && s:SynAt(line('.'),col('.')-1) =~? 'xml\|jsx'
return tok != '{'
elseif tok =~ '\k'
if tok ==# 'type'
return s:Pure('eval',"s:PreviousToken() !~# '^\\%(im\\|ex\\)port$' || s:PreviousToken() == '.'")
elseif tok ==# 'of'
return s:Pure('eval',"!s:GetPair('[[({]','[])}]','bW',s:skip_expr) || s:LookingAt() != '(' ||"
\ ."s:{s:PreviousToken() ==# 'await' ? 'Previous' : ''}Token() !=# 'for' || s:PreviousToken() == '.'")
endif
return char !~ '[=~!<*,?^%|&([]' &&
\ (char !~ '[-+]' || l:n != line('.') && getline('.')[col('.')-2] == char)
return index(split('return const let import export extends yield default delete var await void typeof throw case new in instanceof')
\ ,tok) < (line('.') != a:firstline) || s:Pure('s:PreviousToken') == '.'
elseif tok == '>'
return getline('.')[col('.')-2] == '=' || s:SynAt(line('.'),col('.')) =~? 'jsflow\|^html'
elseif tok == '*'
return s:Pure('s:PreviousToken') == ':'
elseif tok == ':'
return s:Pure('eval',"s:PreviousToken() =~ '^\\K\\k*$' && !s:ExprCol()")
elseif tok == '/'
return s:SynAt(line('.'),col('.')) =~? 'regex'
elseif tok !~ '[=~!<,.?^%|&([]'
return tok !~ '[-+]' || line('.') != a:firstline && getline('.')[col('.')-2] == tok
endif
endfunction
function GetJavascriptIndent()
let b:js_cache = get(b:,'js_cache',[0,0,0])
" Get the current line.
call cursor(v:lnum,1)
let l:line = getline('.')
let s:synid_cache = [[],[]]
let l:line = getline(v:lnum)
" use synstack as it validates syn state and works in an empty line
let s:stack = map(synstack(v:lnum,1),"synIDattr(v:val,'name')")
let syns = get(s:stack,-1,'')
let s:stack = [''] + map(synstack(v:lnum,1),"synIDattr(v:val,'name')")
" start with strings,comments,etc.
if syns =~? s:syng_com
if s:stack[-1] =~? 'comment\|doc'
if l:line =~ '^\s*\*'
return cindent(v:lnum)
elseif l:line !~ '^\s*\/[/*]'
return -1
endif
elseif syns =~? s:syng_str
elseif s:stack[-1] =~? b:syng_str
if b:js_cache[0] == v:lnum - 1 && s:Balanced(v:lnum-1)
let b:js_cache[0] = v:lnum
endif
return -1
endif
let l:lnum = s:PrevCodeLine(v:lnum - 1)
if !l:lnum
let s:l1 = max([0,prevnonblank(v:lnum) - (s:rel ? 2000 : 1000),
\ get(get(b:,'hi_indent',{}),'blocklnr')])
call cursor(v:lnum,1)
if s:PreviousToken() is ''
return
endif
let [l:lnum, pline] = [line('.'), getline('.')[:col('.')-1]]
let l:line = substitute(l:line,'^\s*','','')
let l:line_raw = l:line
if l:line[:1] == '/*'
let l:line = substitute(l:line,'^\%(\/\*.\{-}\*\/\s*\)*','','')
endif
@@ -318,60 +358,91 @@ function GetJavascriptIndent()
endif
" the containing paren, bracket, or curly. Many hacks for performance
call cursor(v:lnum,1)
let idx = index([']',')','}'],l:line[0])
if b:js_cache[0] >= l:lnum && b:js_cache[0] < v:lnum &&
\ (b:js_cache[0] > l:lnum || s:Balanced(l:lnum))
if b:js_cache[0] > l:lnum && b:js_cache[0] < v:lnum ||
\ b:js_cache[0] == l:lnum && s:Balanced(l:lnum)
call call('cursor',b:js_cache[1:])
else
let [s:looksyn, s:checkIn, top] = [v:lnum - 1, 0, (!indent(l:lnum) &&
\ s:syn_at(l:lnum,1) !~? s:syng_str) * l:lnum]
if idx + 1
call s:GetPair(['\[','(','{'][idx],'])}'[idx],'bW','s:skip_func()',2000,top)
elseif getline(v:lnum) !~ '^\S' && syns =~? 'block'
call s:GetPair('{','}','bW','s:skip_func()',2000,top)
else
call s:alternatePair(top)
endif
let [s:looksyn, s:top_col, s:check_in, s:l1] = [v:lnum - 1,0,0,
\ max([s:l1, &smc ? search('\m^.\{'.&smc.',}','nbW',s:l1 + 1) + 1 : 0])]
try
if idx != -1
call s:GetPair(['\[','(','{'][idx],'])}'[idx],'bW','s:SkipFunc()')
elseif getline(v:lnum) !~ '^\S' && s:stack[-1] =~? 'block\|^jsobject$'
call s:GetPair('{','}','bW','s:SkipFunc()')
else
call s:AlternatePair()
endif
catch /^\Cout of bounds$/
call cursor(v:lnum,1)
endtry
let b:js_cache[1:] = line('.') == v:lnum ? [0,0] : getpos('.')[1:2]
endif
let b:js_cache = [v:lnum] + (line('.') == v:lnum ? [0,0] : getpos('.')[1:2])
let num = b:js_cache[1]
let [b:js_cache[0], num] = [v:lnum, b:js_cache[1]]
let [s:W, isOp, bL, switch_offset] = [s:sw(),0,0,0]
if !num || s:IsBlock()
let [num_ind, is_op, b_l, l:switch_offset] = [s:Nat(indent(num)),0,0,0]
if !num || s:LookingAt() == '{' && s:IsBlock()
let ilnum = line('.')
let pline = s:save_pos('s:Trim',l:lnum)
if num && s:looking_at() == ')' && s:GetPair('(', ')', 'bW', s:skip_expr, 100) > 0
let num = ilnum == num ? line('.') : num
if idx < 0 && s:previous_token() ==# 'switch' && s:previous_token() != '.'
if &cino !~ ':'
let switch_offset = s:W
else
let switch_offset = max([-indent(num),s:parse_cino(':')])
endif
if num && s:LookingAt() == ')' && s:GetPair('(',')','bW',s:skip_expr)
if ilnum == num
let [num, num_ind] = [line('.'), indent('.')]
endif
if idx == -1 && s:PreviousToken() ==# 'switch' && s:IsSwitch()
let l:switch_offset = &cino !~ ':' ? s:sw() : s:ParseCino(':')
if pline[-1:] != '.' && l:line =~# '^\%(default\|case\)\>'
return indent(num) + switch_offset
return s:Nat(num_ind + l:switch_offset)
elseif &cino =~ '='
let l:case_offset = s:ParseCino('=')
endif
endif
endif
if idx < 0 && pline[-1:] !~ '[{;]'
let isOp = (l:line =~# s:opfirst || s:continues(l:lnum,pline)) * s:W
let bL = s:iscontOne(l:lnum,b:js_cache[1],isOp)
let bL -= (bL && l:line[0] == '{') * s:W
if idx == -1 && pline[-1:] !~ '[{;]'
let sol = matchstr(l:line,s:opfirst)
if sol is '' || sol == '/' && s:SynAt(v:lnum,
\ 1 + len(getline(v:lnum)) - len(l:line)) =~? 'regex'
if s:Continues(l:lnum,pline)
let is_op = s:sw()
endif
elseif num && sol =~# '^\%(in\%(stanceof\)\=\|\*\)$'
call call('cursor',b:js_cache[1:])
if s:PreviousToken() =~ '\k' && s:Class()
return num_ind + s:sw()
endif
let is_op = s:sw()
else
let is_op = s:sw()
endif
call cursor(l:lnum, len(pline))
let b_l = s:Nat(s:IsContOne(b:js_cache[1],is_op) - (!is_op && l:line =~ '^{')) * s:sw()
endif
elseif idx < 0 && getline(b:js_cache[1])[b:js_cache[2]-1] == '(' && &cino =~ '('
let pval = s:parse_cino('(')
return !pval ? (s:parse_cino('w') ? 0 : -(!!search('\m\S','W'.s:z,num))) + virtcol('.') :
\ max([indent('.') + pval + (s:GetPair('(',')','nbrmW',s:skip_expr,100,num) * s:W),0])
elseif idx.s:LookingAt().&cino =~ '^-1(.*(' && (search('\m\S','nbW',num) || s:ParseCino('U'))
let pval = s:ParseCino('(')
if !pval
let [Wval, vcol] = [s:ParseCino('W'), virtcol('.')]
if search('\m\S','W',num)
return s:ParseCino('w') ? vcol : virtcol('.')-1
endif
return Wval ? s:Nat(num_ind + Wval) : vcol
endif
return s:Nat(num_ind + pval + searchpair('\m(','','\m)','nbrmW',s:skip_expr,num) * s:sw())
endif
" main return
if l:line =~ '^\%([])}]\||}\)'
return max([indent(num),0])
if l:line =~ '^[])}]\|^|}'
if l:line_raw[0] == ')' && getline(num)[b:js_cache[2]-1] == '('
if s:ParseCino('M')
return indent(l:lnum)
elseif &cino =~# 'm' && !s:ParseCino('m')
return virtcol('.') - 1
endif
endif
return num_ind
elseif num
return indent(num) + s:W + switch_offset + bL + isOp
return s:Nat(num_ind + get(l:,'case_offset',s:sw()) + l:switch_offset + b_l + is_op)
endif
return bL + isOp
return b_l + is_op
endfunction
let &cpo = s:cpo_save
+3 -6
View File
@@ -3,7 +3,7 @@
" Maintainer: vim-perl <vim-perl@googlegroups.com>
" Homepage: http://github.com/vim-perl/vim-perl
" Bugs/requests: http://github.com/vim-perl/vim-perl/issues
" Last Change: 2017 Jun 13
" Last Change: 2017-01-04
" Suggestions and improvements by :
" Aaron J. Sherman (use syntax for hints)
@@ -48,11 +48,6 @@ function! GetPerlIndent()
return 0
endif
" Don't reindent comments on first column
if cline =~ '^#.'
return 0
endif
" Get current syntax item at the line's first char
let csynid = ''
if b:indent_use_syntax
@@ -134,6 +129,7 @@ function! GetPerlIndent()
\ || synid == "perlMatchStartEnd"
\ || synid == "perlHereDoc"
\ || synid == "perlBraces"
\ || synid == "perlStatementIndirObj"
\ || synid =~ "^perlFiledescStatement"
\ || synid =~ '^perl\(Sub\|Block\|Package\)Fold'
let brace = strpart(line, bracepos, 1)
@@ -151,6 +147,7 @@ function! GetPerlIndent()
if synid == ""
\ || synid == "perlMatchStartEnd"
\ || synid == "perlBraces"
\ || synid == "perlStatementIndirObj"
\ || synid =~ '^perl\(Sub\|Block\|Package\)Fold'
let ind = ind - shiftwidth()
endif
+3 -1
View File
@@ -1,7 +1,7 @@
" These commands create the option window.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2017 Aug 19
" Last Change: 2017 Sep 10
" If there already is an option window, jump to that one.
let buf = bufnr('option-window')
@@ -1244,6 +1244,8 @@ endif
call append("$", "iminsert\tin Insert mode: 1: use :lmap; 2: use IM; 0: neither")
call append("$", "\t(local to window)")
call <SID>OptionL("imi")
call append("$", "imstyle\tinput method style, 0: on-the-spot, 1: over-the-spot")
call <SID>OptionG("imst", &imst)
call append("$", "imsearch\tentering a search pattern: 1: use :lmap; 2: use IM; 0: neither")
call append("$", "\t(local to window)")
call <SID>OptionL("ims")
+3 -5
View File
@@ -1,5 +1,5 @@
" matchit.vim: (global plugin) Extended "%" matching
" Last Change: 2017 March 26
" Last Change: 2017 Sep 15
" Maintainer: Benji Fisher PhD <benji@member.AMS.org>
" Version: 1.13.3, for Vim 6.3+
" Fix from Fernando Torres included.
@@ -704,9 +704,8 @@ fun! s:MultiMatch(spflag, mode)
let skip = 's:comment\|string'
endif
let skip = s:ParseSkip(skip)
" let restore_cursor = line(".") . "G" . virtcol(".") . "|"
" normal! H
" let restore_cursor = "normal!" . line(".") . "Gzt" . restore_cursor
" save v:count1 variable, might be reset from the restore_cursor command
let level = v:count1
let restore_cursor = virtcol(".") . "|"
normal! g0
let restore_cursor = line(".") . "G" . virtcol(".") . "|zs" . restore_cursor
@@ -726,7 +725,6 @@ fun! s:MultiMatch(spflag, mode)
execute "if " . skip . "| let skip = '0' | endif"
endif
mark '
let level = v:count1
while level
if searchpair(openpat, '', closepat, a:spflag, skip) < 1
call s:CleanUp(restore_options, a:mode, startline, startcol)
+104 -20
View File
@@ -15,6 +15,11 @@
" Author: Bram Moolenaar
" Copyright: Vim license applies, see ":help license"
" In case this gets loaded twice.
if exists(':Termdebug')
finish
endif
" The command that starts debugging, e.g. ":Termdebug vim".
" To end type "quit" in the gdb window.
command -nargs=* -complete=file Termdebug call s:StartDebug(<q-args>)
@@ -24,16 +29,9 @@ if !exists('termdebugger')
let termdebugger = 'gdb'
endif
" Sign used to highlight the line where the program has stopped.
" There can be only one.
sign define debugPC linehl=debugPC
let s:pc_id = 12
let s:break_id = 13
" Sign used to indicate a breakpoint.
" Can be used multiple times.
sign define debugBreakpoint text=>> texthl=debugBreakpoint
if &background == 'light'
hi default debugPC term=reverse ctermbg=lightblue guibg=lightblue
else
@@ -45,9 +43,19 @@ func s:StartDebug(cmd)
let s:startwin = win_getid(winnr())
let s:startsigncolumn = &signcolumn
if exists('g:termdebug_wide') && &columns < g:termdebug_wide
let s:save_columns = &columns
let &columns = g:termdebug_wide
let vertical = 1
else
let s:save_columns = 0
let vertical = 0
endif
" Open a terminal window without a job, to run the debugged program
let s:ptybuf = term_start('NONE', {
\ 'term_name': 'gdb program',
\ 'vertical': vertical,
\ })
if s:ptybuf == 0
echoerr 'Failed to open the program terminal window'
@@ -87,12 +95,25 @@ func s:StartDebug(cmd)
" Connect gdb to the communication pty, using the GDB/MI interface
call term_sendkeys(gdbbuf, 'new-ui mi ' . commpty . "\r")
" Sign used to highlight the line where the program has stopped.
" There can be only one.
sign define debugPC linehl=debugPC
" Sign used to indicate a breakpoint.
" Can be used multiple times.
sign define debugBreakpoint text=>> texthl=debugBreakpoint
" Install debugger commands in the text window.
call win_gotoid(s:startwin)
call s:InstallCommands()
call win_gotoid(s:gdbwin)
let s:breakpoints = {}
augroup TermDebug
au BufRead * call s:BufRead()
au BufUnload * call s:BufUnloaded()
augroup END
endfunc
func s:EndDebug(job, status)
@@ -106,6 +127,11 @@ func s:EndDebug(job, status)
call s:DeleteCommands()
call win_gotoid(curwinid)
if s:save_columns > 0
let &columns = s:save_columns
endif
au! TermDebug
endfunc
" Handle a message received from gdb on the GDB/MI interface.
@@ -118,7 +144,7 @@ func s:CommOutput(chan, msg)
let msg = msg[1:]
endif
if msg != ''
if msg =~ '^\*\(stopped\|running\)'
if msg =~ '^\(\*stopped\|\*running\|=thread-selected\)'
call s:HandleCursor(msg)
elseif msg =~ '^\^done,bkpt=' || msg =~ '^=breakpoint-created,'
call s:HandleNewBreakpoint(msg)
@@ -147,6 +173,14 @@ func s:InstallCommands()
" TODO: can the K mapping be restored?
nnoremap K :Evaluate<CR>
if has('menu')
amenu WinBar.Step :Step<CR>
amenu WinBar.Next :Over<CR>
amenu WinBar.Finish :Finish<CR>
amenu WinBar.Cont :Continue<CR>
amenu WinBar.Eval :Evaluate<CR>
endif
endfunc
" Delete installed debugger commands in the current window.
@@ -162,12 +196,21 @@ func s:DeleteCommands()
delcommand Program
nunmap K
sign undefine debugPC
sign undefine debugBreakpoint
if has('menu')
aunmenu WinBar.Step
aunmenu WinBar.Next
aunmenu WinBar.Finish
aunmenu WinBar.Cont
aunmenu WinBar.Eval
endif
exe 'sign unplace ' . s:pc_id
for key in keys(s:breakpoints)
exe 'sign unplace ' . (s:break_id + key)
endfor
sign undefine debugPC
sign undefine debugBreakpoint
unlet s:breakpoints
endfunc
@@ -218,7 +261,15 @@ endfunc
" Handle the result of data-evaluate-expression
func s:HandleEvaluate(msg)
echomsg '"' . s:evalexpr . '": ' . substitute(a:msg, '.*value="\(.*\)"', '\1', '')
let value = substitute(a:msg, '.*value="\(.*\)"', '\1', '')
let value = substitute(value, '\\"', '"', 'g')
echomsg '"' . s:evalexpr . '": ' . value
if s:evalexpr[0] != '*' && value =~ '^0x' && value !~ '"$'
" Looks like a pointer, also display what it points to.
let s:evalexpr = '*' . s:evalexpr
call term_sendkeys(s:commbuf, '-data-evaluate-expression "' . s:evalexpr . "\"\r")
endif
endfunc
" Handle an error.
@@ -232,11 +283,11 @@ func s:HandleCursor(msg)
let wid = win_getid(winnr())
if win_gotoid(s:startwin)
if a:msg =~ '^\*stopped'
let fname = substitute(a:msg, '.*fullname="\([^"]*\)".*', '\1', '')
let fname = substitute(a:msg, '.*fullname="\([^"]*\)".*', '\1', '')
if a:msg =~ '^\(\*stopped\|=thread-selected\)' && filereadable(fname)
let lnum = substitute(a:msg, '.*line="\([^"]*\)".*', '\1', '')
if lnum =~ '^[0-9]*$'
if expand('%:h') != fname
if expand('%:p') != fnamemodify(fname, ':p')
if &modified
" TODO: find existing window
exe 'split ' . fnameescape(fname)
@@ -246,7 +297,7 @@ func s:HandleCursor(msg)
endif
endif
exe lnum
exe 'sign place ' . s:pc_id . ' line=' . lnum . ' name=debugPC file=' . fnameescape(fname)
exe 'sign place ' . s:pc_id . ' line=' . lnum . ' name=debugPC file=' . fname
setlocal signcolumn=yes
endif
else
@@ -274,11 +325,17 @@ func s:HandleNewBreakpoint(msg)
let fname = substitute(a:msg, '.*fullname="\([^"]*\)".*', '\1', '')
let lnum = substitute(a:msg, '.*line="\([^"]*\)".*', '\1', '')
exe 'sign place ' . (s:break_id + nr) . ' line=' . lnum . ' name=debugBreakpoint file=' . fnameescape(fname)
let entry['fname'] = fname
let entry['lnum'] = lnum
if bufloaded(fname)
call s:PlaceSign(nr, entry)
endif
endfunc
func s:PlaceSign(nr, entry)
exe 'sign place ' . (s:break_id + a:nr) . ' line=' . a:entry['lnum'] . ' name=debugBreakpoint file=' . a:entry['fname']
let a:entry['placed'] = 1
endfunc
" Handle deleting a breakpoint
@@ -288,6 +345,33 @@ func s:HandleBreakpointDelete(msg)
if nr == 0
return
endif
exe 'sign unplace ' . (s:break_id + nr)
unlet s:breakpoints[nr]
if has_key(s:breakpoints, nr)
let entry = s:breakpoints[nr]
if has_key(entry, 'placed')
exe 'sign unplace ' . (s:break_id + nr)
unlet entry['placed']
endif
unlet s:breakpoints[nr]
endif
endfunc
" Handle a BufRead autocommand event: place any signs.
func s:BufRead()
let fname = expand('<afile>:p')
for [nr, entry] in items(s:breakpoints)
if entry['fname'] == fname
call s:PlaceSign(nr, entry)
endif
endfor
endfunc
" Handle a BufUnloaded autocommand event: unplace any signs.
func s:BufUnloaded()
let fname = expand('<afile>:p')
for [nr, entry] in items(s:breakpoints)
if entry['fname'] == fname
let entry['placed'] = 0
endif
endfor
endfunc
+1 -1
View File
@@ -136,7 +136,7 @@ syntax match clojureRegexpBoundary "[$^]" contained display
syntax match clojureRegexpQuantifier "[?*+][?+]\=" contained display
syntax match clojureRegexpQuantifier "\v\{\d+%(,|,\d+)?}\??" contained display
syntax match clojureRegexpOr "|" contained display
syntax match clojureRegexpBackRef "\v\\%([1-9]\d*|k\<[a-zA-z]+\>)" contained display
syntax match clojureRegexpBackRef "\v\\%([1-9]\d*|k\<[a-zA-Z]+\>)" contained display
" Mode modifiers, mode-modified spans, lookaround, regular and atomic
" grouping, and named-capturing.
+448 -45
View File
File diff suppressed because one or more lines are too long
+5 -5
View File
@@ -85,7 +85,7 @@ syn match formComment "\;\ *\*.*$" contains=formTodo
syn region formString start=+"+ end=+"+ contains=formSpecial
syn region formString start=+'+ end=+'+
syn region formNestedString start=+`+ end=+'+ contains=formNestedString
syn match formPreProc "^\=\#[a-zA-z][a-zA-Z0-9]*\>"
syn match formPreProc "^\=\#[a-zA-Z][a-zA-Z0-9]*\>"
syn match formNumber "\<\d\+\>"
syn match formNumber "\<\d\+\.\d*\>"
syn match formNumber "\.\d\+\>"
@@ -94,13 +94,13 @@ syn match formNumber "-\.\d" contains=Number
syn match formNumber "i_\+\>"
syn match formNumber "fac_\+\>"
" pattern matching wildcards
syn match formNumber "?[A-z0-9]*"
syn match formNumber "?[a-zA-Z0-9]*"
" dollar-variables (new in 3.x)
syn match formNumber "\\$[A-z0-9]*"
syn match formNumber "\\$[a-zA-Z0-9]*"
" scalar products
syn match formNumber "^\=[a-zA-z][a-zA-Z0-9]*\.[a-zA-z][a-zA-Z0-9]*\>"
syn match formNumber "^\=[a-zA-Z][a-zA-Z0-9]*\.[a-zA-Z][a-zA-Z0-9]*\>"
syn match formDirective "^\=\.[a-zA-z][a-zA-Z0-9]*\>"
syn match formDirective "^\=\.[a-zA-Z][a-zA-Z0-9]*\>"
" hi User Labels
syn sync ccomment formComment minlines=10
+32 -24
View File
@@ -1,15 +1,13 @@
" Vim syntax file
" Language: Mason (Perl embedded in HTML)
" Maintainer: Andrew Smith <andrewdsmith@yahoo.com>
" Last change: 2003 May 11
" URL: http://www.masonhq.com/editors/mason.vim
" Language: Mason (Perl embedded in HTML)
" Maintainer: vim-perl <vim-perl@googlegroups.com>
" Homepage: http://github.com/vim-perl/vim-perl/tree/master
" Bugs/requests: http://github.com/vim-perl/vim-perl/issues
" Last Change: 2017-09-12
" Contributors: Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>
" Andrew Smith <andrewdsmith@yahoo.com>
"
" This seems to work satisfactorily with html.vim and perl.vim for version 5.5.
" Please mail any fixes or improvements to the above address. Things that need
" doing include:
"
" - Add match for component names in <& &> blocks.
" - Add match for component names in <%def> and <%method> block delimiters.
" TODO:
" - Fix <%text> blocks to show HTML tags but ignore Mason tags.
"
@@ -34,30 +32,38 @@ syn cluster htmlPreproc add=@masonTop
" Now pull in the Perl syntax.
"
syn include @perlTop syntax/perl.vim
unlet b:current_syntax
syn include @podTop syntax/pod.vim
" It's hard to reduce down to the correct sub-set of Perl to highlight in some
" of these cases so I've taken the safe option of just using perlTop in all of
" them. If you have any suggestions, please let me know.
"
syn region masonLine matchgroup=Delimiter start="^%" end="$" contains=@perlTop
syn region masonExpr matchgroup=Delimiter start="<%" end="%>" contains=@perlTop
syn region masonPerl matchgroup=Delimiter start="<%perl>" end="</%perl>" contains=@perlTop
syn region masonComp keepend matchgroup=Delimiter start="<&" end="&>" contains=@perlTop
syn region masonPod start="^=[a-z]" end="^=cut" keepend contained contains=@podTop
syn cluster perlTop remove=perlBraces
syn region masonLine matchgroup=Delimiter start="^%" end="$" keepend contains=@perlTop
syn region masonPerlComment start="#" end="\%(%>\)\@=\|$" contained contains=perlTodo,@Spell
syn region masonExpr matchgroup=Delimiter start="<%" end="%>" contains=@perlTop,masonPerlComment
syn region masonPerl matchgroup=Delimiter start="<%perl>" end="</%perl>" contains=masonPod,@perlTop
syn region masonComp keepend matchgroup=Delimiter start="<&\s*\%([-._/[:alnum:]]\+:\)\?[-._/[:alnum:]]*" end="&>" contains=@perlTop
syn region masonComp keepend matchgroup=Delimiter skipnl start="<&|\s*\%([-._/[:alnum:]]\+:\)\?[-._/[:alnum:]]*" end="&>" contains=@perlTop nextgroup=masonCompContent
syn region masonCompContent matchgroup=Delimiter start="" end="</&>" contained contains=@masonTop
syn region masonArgs matchgroup=Delimiter start="<%args>" end="</%args>" contains=@perlTop
syn region masonArgs matchgroup=Delimiter start="<%args>" end="</%args>" contains=masonPod,@perlTop
syn region masonInit matchgroup=Delimiter start="<%init>" end="</%init>" contains=@perlTop
syn region masonCleanup matchgroup=Delimiter start="<%cleanup>" end="</%cleanup>" contains=@perlTop
syn region masonOnce matchgroup=Delimiter start="<%once>" end="</%once>" contains=@perlTop
syn region masonShared matchgroup=Delimiter start="<%shared>" end="</%shared>" contains=@perlTop
syn region masonInit matchgroup=Delimiter start="<%init>" end="</%init>" contains=masonPod,@perlTop
syn region masonCleanup matchgroup=Delimiter start="<%cleanup>" end="</%cleanup>" contains=masonPod,@perlTop
syn region masonOnce matchgroup=Delimiter start="<%once>" end="</%once>" contains=masonPod,@perlTop
syn region masonClass matchgroup=Delimiter start="<%class>" end="</%class>" contains=masonPod,@perlTop
syn region masonShared matchgroup=Delimiter start="<%shared>" end="</%shared>" contains=masonPod,@perlTop
syn region masonDef matchgroup=Delimiter start="<%def[^>]*>" end="</%def>" contains=@htmlTop
syn region masonMethod matchgroup=Delimiter start="<%method[^>]*>" end="</%method>" contains=@htmlTop
syn region masonDef matchgroup=Delimiter start="<%def\s*[-._/[:alnum:]]\+\s*>" end="</%def>" contains=@htmlTop
syn region masonMethod matchgroup=Delimiter start="<%method\s*[-._/[:alnum:]]\+\s*>" end="</%method>" contains=@htmlTop
syn region masonFlags matchgroup=Delimiter start="<%flags>" end="</%flags>" contains=@perlTop
syn region masonAttr matchgroup=Delimiter start="<%attr>" end="</%attr>" contains=@perlTop
syn region masonFlags matchgroup=Delimiter start="<%flags>" end="</%flags>" contains=masonPod,@perlTop
syn region masonAttr matchgroup=Delimiter start="<%attr>" end="</%attr>" contains=masonPod,@perlTop
syn region masonFilter matchgroup=Delimiter start="<%filter>" end="</%filter>" contains=@perlTop
syn region masonFilter matchgroup=Delimiter start="<%filter>" end="</%filter>" contains=masonPod,@perlTop
syn region masonDoc matchgroup=Delimiter start="<%doc>" end="</%doc>"
syn region masonText matchgroup=Delimiter start="<%text>" end="</%text>"
@@ -67,6 +73,8 @@ syn cluster masonTop contains=masonLine,masonExpr,masonPerl,masonComp,masonArgs,
" Set up default highlighting. Almost all of this is done in the included
" syntax files.
hi def link masonDoc Comment
hi def link masonPod Comment
hi def link masonPerlComment perlComment
let b:current_syntax = "mason"
+97 -102
View File
@@ -3,7 +3,7 @@
" Maintainer: vim-perl <vim-perl@googlegroups.com>
" Homepage: http://github.com/vim-perl/vim-perl/tree/master
" Bugs/requests: http://github.com/vim-perl/vim-perl/issues
" Last Change: 2013-07-23
" Last Change: 2017-09-12
" Contributors: Andy Lester <andy@petdance.com>
" Hinrik Örn Sigurðsson <hinrik.sig@gmail.com>
" Lukas Mai <l.mai.web.de>
@@ -28,8 +28,9 @@
" unlet perl_fold
" unlet perl_fold_blocks
" unlet perl_nofold_packages
" let perl_nofold_subs = 1
" unlet perl_nofold_subs
" unlet perl_fold_anonymous_subs
" unlet perl_no_subprototype_error
if exists("b:current_syntax")
finish
@@ -38,11 +39,6 @@ endif
let s:cpo_save = &cpo
set cpo&vim
if exists('&regexpengine')
let s:regexpengine=&regexpengine
set regexpengine=1
endif
" POD starts with ^=<word> and ends with ^=cut
if !exists("perl_include_pod") || perl_include_pod == 1
@@ -83,7 +79,7 @@ syn match perlControl "\<\%(BEGIN\|CHECK\|INIT\|END\|UNITCHECK\)\>\_s*" nextgr
syn match perlStatementStorage "\<\%(my\|our\|local\|state\)\>"
syn match perlStatementControl "\<\%(return\|last\|next\|redo\|goto\|break\)\>"
syn match perlStatementScalar "\<\%(chom\=p\|chr\|crypt\|r\=index\|lc\%(first\)\=\|length\|ord\|pack\|sprintf\|substr\|uc\%(first\)\=\)\>"
syn match perlStatementScalar "\<\%(chom\=p\|chr\|crypt\|r\=index\|lc\%(first\)\=\|length\|ord\|pack\|sprintf\|substr\|fc\|uc\%(first\)\=\)\>"
syn match perlStatementRegexp "\<\%(pos\|quotemeta\|split\|study\)\>"
syn match perlStatementNumeric "\<\%(abs\|atan2\|cos\|exp\|hex\|int\|log\|oct\|rand\|sin\|sqrt\|srand\)\>"
syn match perlStatementList "\<\%(splice\|unshift\|shift\|push\|pop\|join\|reverse\|grep\|map\|sort\|unpack\)\>"
@@ -94,9 +90,9 @@ syn match perlStatementFiledesc "\<\%(fcntl\|flock\|ioctl\|open\%(dir\)\=\|read
syn match perlStatementVector "\<vec\>"
syn match perlStatementFiles "\<\%(ch\%(dir\|mod\|own\|root\)\|glob\|link\|mkdir\|readlink\|rename\|rmdir\|symlink\|umask\|unlink\|utime\)\>"
syn match perlStatementFiles "-[rwxoRWXOezsfdlpSbctugkTBMAC]\>"
syn match perlStatementFlow "\<\%(caller\|die\|dump\|eval\|exit\|wantarray\)\>"
syn match perlStatementInclude "\<\%(require\|import\)\>"
syn match perlStatementInclude "\<\%(use\|no\)\s\+\%(\%(attributes\|attrs\|autouse\|parent\|base\|big\%(int\|num\|rat\)\|blib\|bytes\|charnames\|constant\|diagnostics\|encoding\%(::warnings\)\=\|feature\|fields\|filetest\|if\|integer\|less\|lib\|locale\|mro\|open\|ops\|overload\|re\|sigtrap\|sort\|strict\|subs\|threads\%(::shared\)\=\|utf8\|vars\|version\|vmsish\|warnings\%(::register\)\=\)\>\)\="
syn match perlStatementFlow "\<\%(caller\|die\|dump\|eval\|exit\|wantarray\|evalbytes\)\>"
syn match perlStatementInclude "\<\%(require\|import\|unimport\)\>"
syn match perlStatementInclude "\<\%(use\|no\)\s\+\%(\%(attributes\|attrs\|autodie\|autouse\|parent\|base\|big\%(int\|num\|rat\)\|blib\|bytes\|charnames\|constant\|diagnostics\|encoding\%(::warnings\)\=\|feature\|fields\|filetest\|if\|integer\|less\|lib\|locale\|mro\|open\|ops\|overload\|overloading\|re\|sigtrap\|sort\|strict\|subs\|threads\%(::shared\)\=\|utf8\|vars\|version\|vmsish\|warnings\%(::register\)\=\)\>\)\="
syn match perlStatementProc "\<\%(alarm\|exec\|fork\|get\%(pgrp\|ppid\|priority\)\|kill\|pipe\|set\%(pgrp\|priority\)\|sleep\|system\|times\|wait\%(pid\)\=\)\>"
syn match perlStatementSocket "\<\%(accept\|bind\|connect\|get\%(peername\|sock\%(name\|opt\)\)\|listen\|recv\|send\|setsockopt\|shutdown\|socket\%(pair\)\=\)\>"
syn match perlStatementIPC "\<\%(msg\%(ctl\|get\|rcv\|snd\)\|sem\%(ctl\|get\|op\)\|shm\%(ctl\|get\|read\|write\)\)\>"
@@ -108,7 +104,7 @@ syn match perlStatementMisc "\<\%(warn\|format\|formline\|reset\|scalar\|protot
syn keyword perlTodo TODO TODO: TBD TBD: FIXME FIXME: XXX XXX: NOTE NOTE: contained
syn region perlStatementIndirObjWrap matchgroup=perlStatementIndirObj start="\<\%(map\|grep\|sort\|printf\=\|say\|system\|exec\)\>\s*{" end="}" contains=@perlTop,perlBraces extend
syn region perlStatementIndirObjWrap matchgroup=perlStatementIndirObj start="\%(\<\%(map\|grep\|sort\|printf\=\|say\|system\|exec\)\>\s*\)\@<={" end="}" transparent extend
syn match perlLabel "^\s*\h\w*\s*::\@!\%(\<v\d\+\s*:\)\@<!"
@@ -125,7 +121,7 @@ syn match perlLabel "^\s*\h\w*\s*::\@!\%(\<v\d\+\s*:\)\@<!"
" Special variables first ($^A, ...) and ($|, $', ...)
syn match perlVarPlain "$^[ACDEFHILMNOPRSTVWX]\="
syn match perlVarPlain "$[\\\"\[\]'&`+*.,;=%~!?@#$<>(-]"
syn match perlVarPlain "%+"
syn match perlVarPlain "@[-+]"
syn match perlVarPlain "$\%(0\|[1-9]\d*\)"
" Same as above, but avoids confusion in $::foo (equivalent to $main::foo)
syn match perlVarPlain "$::\@!"
@@ -143,41 +139,46 @@ syn match perlPackageRef "[$@#%*&]\%(\%(::\|'\)\=\I\i*\%(\%(::\|'\)\I\i*\)*\)\
" just set the variable "perl_no_extended_vars"...
if !exists("perl_no_scope_in_variables")
syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef
syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref
syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref
syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" contains=perlPackageRef nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref
else
syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)"
syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod
syn match perlVarPlain "\%([@$]\|\$#\)\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref
syn match perlVarPlain2 "%\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref
syn match perlFunctionName "&\$*\%(\I\i*\)\=\%(\%(::\|'\)\I\i*\)*\%(::\|\i\@<=\)" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref
endif
syn match perlVarPlain2 "%[-+]"
if !exists("perl_no_extended_vars")
syn cluster perlExpr contains=perlStatementIndirObjWrap,perlStatementScalar,perlStatementRegexp,perlStatementNumeric,perlStatementList,perlStatementHash,perlStatementFiles,perlStatementTime,perlStatementMisc,perlVarPlain,perlVarPlain2,perlVarNotInMatches,perlVarSlash,perlVarBlock,perlVarBlock2,perlShellCommand,perlFloat,perlNumber,perlStringUnexpanded,perlString,perlQQ,perlArrow,perlBraces
syn region perlArrow matchgroup=perlArrow start="->\s*(" end=")" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained
syn region perlArrow matchgroup=perlArrow start="->\s*\[" end="\]" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained
syn region perlArrow matchgroup=perlArrow start="->\s*{" end="}" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained
syn match perlArrow "->\s*{\s*\I\i*\s*}" contains=perlVarSimpleMemberName nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained
syn region perlArrow matchgroup=perlArrow start="->\s*\$*\I\i*\s*(" end=")" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contained
syn region perlVarBlock matchgroup=perlVarPlain start="\%($#\|[$@]\)\$*{" skip="\\}" end=+}\|\%(\%(<<\%('\|"\)\?\)\@=\)+ contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod extend
syn region perlVarBlock2 matchgroup=perlVarPlain start="[%&*]\$*{" skip="\\}" end=+}\|\%(\%(<<\%('\|"\)\?\)\@=\)+ contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod extend
syn match perlVarPlain2 "[%&*]\$*{\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod extend
syn match perlVarPlain "\%(\$#\|[@$]\)\$*{\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod extend
syn region perlVarMember matchgroup=perlVarPlain start="\%(->\)\={" skip="\\}" end="}" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod extend
syn match perlVarSimpleMember "\%(->\)\={\s*\I\i*\s*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod contains=perlVarSimpleMemberName contained extend
syn region perlArrow matchgroup=perlArrow start="->\s*(" end=")" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contained
syn region perlArrow matchgroup=perlArrow start="->\s*\[" end="\]" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contained
syn region perlArrow matchgroup=perlArrow start="->\s*{" end="}" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contained
syn match perlArrow "->\s*{\s*\I\i*\s*}" contains=perlVarSimpleMemberName nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contained
syn region perlArrow matchgroup=perlArrow start="->\s*\$*\I\i*\s*(" end=")" contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contained
syn region perlVarBlock matchgroup=perlVarPlain start="\%($#\|[$@]\)\$*{" skip="\\}" end=+}\|\%(\%(<<\%('\|"\)\?\)\@=\)+ contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend
syn region perlVarBlock2 matchgroup=perlVarPlain start="[%&*]\$*{" skip="\\}" end=+}\|\%(\%(<<\%('\|"\)\?\)\@=\)+ contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend
syn match perlVarPlain2 "[%&*]\$*{\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend
syn match perlVarPlain "\%(\$#\|[@$]\)\$*{\I\i*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend
syn region perlVarMember matchgroup=perlVarPlain start="\%(->\)\={" skip="\\}" end="}" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend
syn match perlVarSimpleMember "\%(->\)\={\s*\I\i*\s*}" nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref contains=perlVarSimpleMemberName contained extend
syn match perlVarSimpleMemberName "\I\i*" contained
syn region perlVarMember matchgroup=perlVarPlain start="\%(->\)\=\[" skip="\\]" end="]" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod extend
syn match perlPackageConst "__PACKAGE__" nextgroup=perlMethod
syn match perlMethod "->\$*\I\i*" contained nextgroup=perlVarSimpleMember,perlVarMember,perlMethod
syn region perlVarMember matchgroup=perlVarPlain start="\%(->\)\=\[" skip="\\]" end="]" contained contains=@perlExpr nextgroup=perlVarMember,perlVarSimpleMember,perlMethod,perlPostDeref extend
syn match perlPackageConst "__PACKAGE__" nextgroup=perlMethod,perlPostDeref
syn match perlMethod "->\$*\I\i*" contained nextgroup=perlVarSimpleMember,perlVarMember,perlMethod,perlPostDeref
syn match perlPostDeref "->\%($#\|[$@%&*]\)\*" contained nextgroup=perlVarSimpleMember,perlVarMember,perlMethod,perlPostDeref
syn region perlPostDeref start="->\%($#\|[$@%&*]\)\[" skip="\\]" end="]" contained contains=@perlExpr nextgroup=perlVarSimpleMember,perlVarMember,perlMethod,perlPostDeref
syn region perlPostDeref matchgroup=perlPostDeref start="->\%($#\|[$@%&*]\){" skip="\\}" end="}" contained contains=@perlExpr nextgroup=perlVarSimpleMember,perlVarMember,perlMethod,perlPostDeref
endif
" File Descriptors
syn match perlFiledescRead "<\h\w*>"
syn match perlFiledescStatementComma "(\=\s*\u\w*\s*,"me=e-1 transparent contained contains=perlFiledescStatement
syn match perlFiledescStatementNocomma "(\=\s*\u\w*\s*[^, \t]"me=e-1 transparent contained contains=perlFiledescStatement
syn match perlFiledescStatementComma "(\=\s*\<\u\w*\>\s*,"me=e-1 transparent contained contains=perlFiledescStatement
syn match perlFiledescStatementNocomma "(\=\s*\<\u\w*\>\s*[^, \t]"me=e-1 transparent contained contains=perlFiledescStatement
syn match perlFiledescStatement "\u\w*" contained
syn match perlFiledescStatement "\<\u\w*\>" contained
" Special characters in strings and matches
syn match perlSpecialString "\\\%(\o\{1,3}\|x\%({\x\+}\|\x\{1,2}\)\|c.\|[^cx]\)" contained extend
@@ -241,20 +242,18 @@ syn region perlAnglesDQ start=+<+ end=+>+ extend contained contains=perlAnglesD
" Simple version of searches and matches
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\>\s*\z([^[:space:]'([{<#]\)+ end=+\z1[msixpodualgc]*+ contains=@perlInterpMatch keepend extend
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m#+ end=+#[msixpodualgc]*+ contains=@perlInterpMatch keepend extend
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*'+ end=+'[msixpodualgc]*+ contains=@perlInterpSQ keepend extend
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*/+ end=+/[msixpodualgc]*+ contains=@perlInterpSlash keepend extend
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*(+ end=+)[msixpodualgc]*+ contains=@perlInterpMatch,perlParensDQ keepend extend
" A special case for m{}, m<> and m[] which allows for comments and extra whitespace in the pattern
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*{+ end=+}[msixpodualgc]*+ contains=@perlInterpMatch,perlComment,perlBracesDQ extend
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*<+ end=+>[msixpodualgc]*+ contains=@perlInterpMatch,perlAnglesDQ keepend extend
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*\[+ end=+\][msixpodualgc]*+ contains=@perlInterpMatch,perlComment,perlBracketsDQ keepend extend
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\>\s*\z([^[:space:]'([{<#]\)+ end=+\z1[msixpodualgcn]*+ contains=@perlInterpMatch keepend extend
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m#+ end=+#[msixpodualgcn]*+ contains=@perlInterpMatch keepend extend
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*'+ end=+'[msixpodualgcn]*+ contains=@perlInterpSQ keepend extend
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*/+ end=+/[msixpodualgcn]*+ contains=@perlInterpSlash keepend extend
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*(+ end=+)[msixpodualgcn]*+ contains=@perlInterpMatch,perlParensDQ keepend extend
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*{+ end=+}[msixpodualgcn]*+ contains=@perlInterpMatch,perlBracesDQ extend
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*<+ end=+>[msixpodualgcn]*+ contains=@perlInterpMatch,perlAnglesDQ keepend extend
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!m\s*\[+ end=+\][msixpodualgcn]*+ contains=@perlInterpMatch,perlBracketsDQ keepend extend
" Below some hacks to recognise the // variant. This is virtually impossible to catch in all
" cases as the / is used in so many other ways, but these should be the most obvious ones.
syn region perlMatch matchgroup=perlMatchStartEnd start="\%([$@%&*]\@<!\%(\<split\|\<while\|\<if\|\<unless\|\.\.\|[-+*!~(\[{=]\)\s*\)\@<=/\%(/=\)\@!" start=+^/\%(/=\)\@!+ start=+\s\@<=/\%(/=\)\@![^[:space:][:digit:]$@%=]\@=\%(/\_s*\%([([{$@%&*[:digit:]"'`]\|\_s\w\|[[:upper:]_abd-fhjklnqrt-wyz]\)\)\@!+ skip=+\\/+ end=+/[msixpodualgc]*+ contains=@perlInterpSlash extend
syn region perlMatch matchgroup=perlMatchStartEnd start="\%([$@%&*]\@<!\%(\<split\|\<while\|\<if\|\<unless\|\.\.\|[-+*!~(\[{=]\)\s*\)\@<=/\%(/=\)\@!" start=+^/\%(/=\)\@!+ start=+\s\@<=/\%(/=\)\@![^[:space:][:digit:]$@%=]\@=\%(/\_s*\%([([{$@%&*[:digit:]"'`]\|\_s\w\|[[:upper:]_abd-fhjklnqrt-wyz]\)\)\@!+ skip=+\\/+ end=+/[msixpodualgcn]*+ contains=@perlInterpSlash extend
" Substitutions
@@ -267,12 +266,12 @@ syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*<+ end=+>+ contains=@perlInterpMatch,perlAnglesDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend extend
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*\[+ end=+\]+ contains=@perlInterpMatch,perlBracketsDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend extend
syn region perlMatch matchgroup=perlMatchStartEnd start=+\<\%(::\|'\|->\)\@<!s\s*{+ end=+}+ contains=@perlInterpMatch,perlBracesDQ nextgroup=perlSubstitutionGQQ skipwhite skipempty skipnl keepend extend
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+\z([^[:space:]'([{<]\)+ end=+\z1[msixpodualgcer]*+ keepend contained contains=@perlInterpDQ extend
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+(+ end=+)[msixpodualgcer]*+ contained contains=@perlInterpDQ,perlParensDQ keepend extend
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+\[+ end=+\][msixpodualgcer]*+ contained contains=@perlInterpDQ,perlBracketsDQ keepend extend
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+{+ end=+}[msixpodualgcer]*+ contained contains=@perlInterpDQ,perlBracesDQ keepend extend extend
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+<+ end=+>[msixpodualgcer]*+ contained contains=@perlInterpDQ,perlAnglesDQ keepend extend
syn region perlSubstitutionSQ matchgroup=perlMatchStartEnd start=+'+ end=+'[msixpodualgcer]*+ contained contains=@perlInterpSQ keepend extend
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+\z([^[:space:]'([{<]\)+ end=+\z1[msixpodualgcern]*+ keepend contained contains=@perlInterpDQ extend
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+(+ end=+)[msixpodualgcern]*+ contained contains=@perlInterpDQ,perlParensDQ keepend extend
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+\[+ end=+\][msixpodualgcern]*+ contained contains=@perlInterpDQ,perlBracketsDQ keepend extend
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+{+ end=+}[msixpodualgcern]*+ contained contains=@perlInterpDQ,perlBracesDQ keepend extend extend
syn region perlSubstitutionGQQ matchgroup=perlMatchStartEnd start=+<+ end=+>[msixpodualgcern]*+ contained contains=@perlInterpDQ,perlAnglesDQ keepend extend
syn region perlSubstitutionSQ matchgroup=perlMatchStartEnd start=+'+ end=+'[msixpodualgcern]*+ contained contains=@perlInterpSQ keepend extend
" Translations
" perlMatch is the first part, perlTranslation* is the second, translator part.
@@ -314,35 +313,40 @@ syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s*{+ end=+}+ contains=@perlInterpSQ,perlBracesSQ keepend extend
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qw\s*<+ end=+>+ contains=@perlInterpSQ,perlAnglesSQ keepend extend
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\>\s*\z([^[:space:]#([{<'/]\)+ end=+\z1[imosx]*+ contains=@perlInterpMatch keepend extend
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*/+ end=+/[imosx]*+ contains=@perlInterpSlash keepend extend
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr#+ end=+#[imosx]*+ contains=@perlInterpMatch keepend extend
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*'+ end=+'[imosx]*+ contains=@perlInterpSQ keepend extend
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*(+ end=+)[imosx]*+ contains=@perlInterpMatch,perlParensDQ keepend extend
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\>\s*\z([^[:space:]#([{<'/]\)+ end=+\z1[imosxdual]*+ contains=@perlInterpMatch keepend extend
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*/+ end=+/[imosxdual]*+ contains=@perlInterpSlash keepend extend
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr#+ end=+#[imosxdual]*+ contains=@perlInterpMatch keepend extend
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*'+ end=+'[imosxdual]*+ contains=@perlInterpSQ keepend extend
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*(+ end=+)[imosxdual]*+ contains=@perlInterpMatch,perlParensDQ keepend extend
" A special case for qr{}, qr<> and qr[] which allows for comments and extra whitespace in the pattern
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*{+ end=+}[imosx]*+ contains=@perlInterpMatch,perlBracesDQ,perlComment keepend extend
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*<+ end=+>[imosx]*+ contains=@perlInterpMatch,perlAnglesDQ,perlComment keepend extend
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*\[+ end=+\][imosx]*+ contains=@perlInterpMatch,perlBracketsDQ,perlComment keepend extend
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*{+ end=+}[imosxdual]*+ contains=@perlInterpMatch,perlBracesDQ,perlComment keepend extend
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*<+ end=+>[imosxdual]*+ contains=@perlInterpMatch,perlAnglesDQ,perlComment keepend extend
syn region perlQQ matchgroup=perlStringStartEnd start=+\<\%(::\|'\|->\)\@<!qr\s*\[+ end=+\][imosxdual]*+ contains=@perlInterpMatch,perlBracketsDQ,perlComment keepend extend
" Constructs such as print <<EOF [...] EOF, 'here' documents
"
" XXX Any statements after the identifier are in perlString colour (i.e.
" 'if $a' in 'print <<EOF if $a'). This is almost impossible to get right it
" seems due to the 'auto-extending nature' of regions.
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\z(\I\i*\)+ end=+$+ contains=@perlTop oneline
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ end=+$+ contains=@perlTop oneline
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ end=+$+ contains=@perlTop oneline
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\s*""+ end=+$+ contains=@perlTop oneline
syn region perlHereDocStart matchgroup=perlStringStartEnd start=+<<\s*''+ end=+$+ contains=@perlTop oneline
if exists("perl_fold")
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\z(\I\i*\).*+ end=+^\z1$+ contains=@perlInterpDQ fold extend
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ end=+^\z1$+ contains=@perlInterpDQ fold extend
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ end=+^\z1$+ contains=@perlInterpSQ fold extend
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*""+ end=+^$+ contains=@perlInterpDQ,perlNotEmptyLine fold extend
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*''+ end=+^$+ contains=@perlInterpSQ,perlNotEmptyLine fold extend
syn region perlHereDoc start=+<<\z(\I\i*\)+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ fold extend
syn region perlHereDoc start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ fold extend
syn region perlHereDoc start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpSQ fold extend
syn region perlHereDoc start=+<<\s*""+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpDQ,perlNotEmptyLine fold extend
syn region perlHereDoc start=+<<\s*''+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpSQ,perlNotEmptyLine fold extend
syn region perlAutoload matchgroup=perlStringStartEnd start=+<<\s*\(['"]\=\)\z(END_\%(SUB\|OF_FUNC\|OF_AUTOLOAD\)\)\1+ end=+^\z1$+ contains=ALL fold extend
else
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\z(\I\i*\).*+ end=+^\z1$+ contains=@perlInterpDQ
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ end=+^\z1$+ contains=@perlInterpDQ
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ end=+^\z1$+ contains=@perlInterpSQ
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*""+ end=+^$+ contains=@perlInterpDQ,perlNotEmptyLine
syn region perlHereDoc matchgroup=perlStringStartEnd start=+<<\s*''+ end=+^$+ contains=@perlInterpSQ,perlNotEmptyLine
syn region perlHereDoc start=+<<\z(\I\i*\)+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ
syn region perlHereDoc start=+<<\s*"\z([^\\"]*\%(\\.[^\\"]*\)*\)"+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpDQ
syn region perlHereDoc start=+<<\s*'\z([^\\']*\%(\\.[^\\']*\)*\)'+ matchgroup=perlStringStartEnd end=+^\z1$+ contains=perlHereDocStart,@perlInterpSQ
syn region perlHereDoc start=+<<\s*""+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpDQ,perlNotEmptyLine
syn region perlHereDoc start=+<<\s*''+ matchgroup=perlStringStartEnd end=+^$+ contains=perlHereDocStart,@perlInterpSQ,perlNotEmptyLine
syn region perlAutoload matchgroup=perlStringStartEnd start=+<<\s*\(['"]\=\)\z(END_\%(SUB\|OF_FUNC\|OF_AUTOLOAD\)\)\1+ end=+^\z1$+ contains=ALL
endif
@@ -356,28 +360,22 @@ syn keyword perlStatementPackage package contained
" sub [name] [(prototype)] {
"
syn match perlSubError "[^[:space:];{#]" contained
if v:version == 701 && !has('patch221') " XXX I hope that's the right one
syn match perlSubAttributes ":" contained
syn match perlSubAttributesCont "\h\w*\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained
syn region perlSubAttributesCont matchgroup=perlSubAttributesCont start="\h\w*(" end=")\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained contains=@perlInterpSQ,perlParensSQ
syn cluster perlSubAttrMaybe contains=perlSubAttributesCont,perlSubError,perlFakeGroup
syn match perlSubAttributes "" contained nextgroup=perlSubError
syn match perlSubAttributes ":\_s*" contained nextgroup=@perlSubAttrMaybe
if get(g:, "perl_sub_signatures", 0)
syn match perlSignature +(\_[^)]*)\_s*+ nextgroup=perlSubAttributes,perlComment contained
else
syn match perlSubAttributesCont "\h\w*\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained
syn region perlSubAttributesCont matchgroup=perlSubAttributesCont start="\h\w*(" end=")\_s*\%(:\_s*\)\=" nextgroup=@perlSubAttrMaybe contained contains=@perlInterpSQ,perlParensSQ
syn cluster perlSubAttrMaybe contains=perlSubAttributesCont,perlSubError,perlFakeGroup
syn match perlSubAttributes "" contained nextgroup=perlSubError
syn match perlSubAttributes ":\_s*" contained nextgroup=@perlSubAttrMaybe
syn match perlSubPrototypeError "(\%(\_s*\%(\%(\\\%([$@%&*]\|\[[$@%&*]\+\]\)\|[$&*]\|[@%]\%(\_s*)\)\@=\|;\%(\_s*[)$@%&*\\]\)\@=\|_\%(\_s*[);]\)\@=\)\_s*\)*\)\@>\zs\_[^)]\+" contained
syn match perlSubPrototype +(\_[^)]*)\_s*+ nextgroup=perlSubAttributes,perlComment contained contains=perlSubPrototypeError
endif
syn match perlSubPrototypeError "(\%(\_s*\%(\%(\\\%([$@%&*]\|\[[$@%&*]\+\]\)\|[$&*]\|[@%]\%(\_s*)\)\@=\|;\%(\_s*[)$@%&*\\]\)\@=\|_\%(\_s*[);]\)\@=\)\_s*\)*\)\@>\zs\_[^)]\+" contained
syn match perlSubPrototype +(\_[^)]*)\_s*\|+ nextgroup=perlSubAttributes,perlComment contained contains=perlSubPrototypeError
syn match perlSubName +\%(\h\|::\|'\w\)\%(\w\|::\|'\w\)*\_s*\|+ contained nextgroup=perlSubPrototype,perlComment
syn match perlSubName +\%(\h\|::\|'\w\)\%(\w\|::\|'\w\)*\_s*\|+ contained nextgroup=perlSubPrototype,perlSignature,perlSubAttributes,perlComment
syn match perlFunction +\<sub\>\_s*+ nextgroup=perlSubName
if !exists("perl_no_scope_in_variables")
syn match perlFunctionPRef "\h\w*::" contained
syn match perlFunctionName "\h\w*[^:]" contained
else
syn match perlFunctionName "\h[[:alnum:]_:]*" contained
endif
" The => operator forces a bareword to the left of it to be interpreted as
" a string
syn match perlString "\I\@<!-\?\I\i*\%(\s*=>\)\@="
@@ -397,10 +395,10 @@ syn match perlFormatField "@$" contained
" __END__ and __DATA__ clauses
if exists("perl_fold")
syntax region perlDATA start="^__DATA__$" skip="." end="." fold
syntax region perlDATA start="^__DATA__$" skip="." end="." contains=@perlDATA fold
syntax region perlDATA start="^__END__$" skip="." end="." contains=perlPOD,@perlDATA fold
else
syntax region perlDATA start="^__DATA__$" skip="." end="."
syntax region perlDATA start="^__DATA__$" skip="." end="." contains=@perlDATA
syntax region perlDATA start="^__END__$" skip="." end="." contains=perlPOD,@perlDATA
endif
@@ -414,9 +412,9 @@ if exists("perl_fold")
syn region perlPackageFold start="^package \S\+;\s*\%(#.*\)\=$" end="^1;\=\s*\%(#.*\)\=$" end="\n\+package"me=s-1 transparent fold keepend
endif
if !exists("perl_nofold_subs")
if exists("perl_fold_anonymous_subs") && perl_fold_anonymous_subs
syn region perlSubFold start="\<sub\>[^\n;]*{" end="}" transparent fold keepend extend
syn region perlSubFold start="\<\%(BEGIN\|END\|CHECK\|INIT\)\>\s*{" end="}" transparent fold keepend
if get(g:, "perl_fold_anonymous_subs", 0)
syn region perlSubFold start="\<sub\>[^{]*{" end="}" transparent fold keepend extend
syn region perlSubFold start="\<\%(BEGIN\|END\|CHECK\|INIT\)\>\s*{" end="}" transparent fold keepend
else
syn region perlSubFold start="^\z(\s*\)\<sub\>.*[^};]$" end="^\z1}\s*\%(#.*\)\=$" transparent fold keepend
syn region perlSubFold start="^\z(\s*\)\<\%(BEGIN\|END\|CHECK\|INIT\|UNITCHECK\)\>.*[^};]$" end="^\z1}\s*$" transparent fold keepend
@@ -424,7 +422,7 @@ if exists("perl_fold")
endif
if exists("perl_fold_blocks")
syn region perlBlockFold start="^\z(\s*\)\%(if\|elsif\|unless\|for\|while\|until\|given\)\s*(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" start="^\z(\s*\)foreach\s*\%(\%(my\|our\)\=\s*\S\+\s*\)\=(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend
syn region perlBlockFold start="^\z(\s*\)\%(if\|elsif\|unless\|for\|while\|until\|given\)\s*(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" start="^\z(\s*\)for\%(each\)\=\s*\%(\%(my\|our\)\=\s*\S\+\s*\)\=(.*)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend
syn region perlBlockFold start="^\z(\s*\)\%(do\|else\)\%(\s*{\)\=\s*\%(#.*\)\=$" end="^\z1}\s*while" end="^\z1}\s*;\=\%(#.*\)\=$" transparent fold keepend
endif
@@ -435,7 +433,6 @@ else
syn sync minlines=0
endif
" NOTE: If you're linking new highlight groups to perlString, please also put
" them into b:match_skip in ftplugin/perl.vim.
@@ -458,6 +455,7 @@ hi def link perlOperator Operator
hi def link perlFunction Keyword
hi def link perlSubName Function
hi def link perlSubPrototype Type
hi def link perlSignature Type
hi def link perlSubAttributes PreProc
hi def link perlSubAttributesCont perlSubAttributes
hi def link perlComment Comment
@@ -516,8 +514,11 @@ hi def link perlStatementMisc perlStatement
hi def link perlStatementIndirObj perlStatement
hi def link perlFunctionName perlIdentifier
hi def link perlMethod perlIdentifier
hi def link perlPostDeref perlIdentifier
hi def link perlFunctionPRef perlType
hi def link perlPOD perlComment
if !get(g:, 'perl_include_pod', 1)
hi def link perlPOD perlComment
endif
hi def link perlShellCommand perlString
hi def link perlSpecialAscii perlSpecial
hi def link perlSpecialDollar perlSpecial
@@ -548,7 +549,6 @@ hi def link perlElseIfError Error
hi def link perlSubPrototypeError Error
hi def link perlSubError Error
" Syncing to speed up processing
"
if !exists("perl_no_sync_on_sub")
@@ -575,11 +575,6 @@ syn sync match perlSyncPOD grouphere NONE "^=cut"
let b:current_syntax = "perl"
if exists('&regexpengine')
let &regexpengine=s:regexpengine
unlet s:regexpengine
endif
let &cpo = s:cpo_save
unlet s:cpo_save
+2 -3
View File
@@ -4,7 +4,7 @@
" Previously: Scott Bigham <dsb@killerbunnies.org>
" Homepage: http://github.com/vim-perl/vim-perl
" Bugs/requests: http://github.com/vim-perl/vim-perl/issues
" Last Change: 2013-07-21
" Last Change: 2017-09-12
" To add embedded POD documentation highlighting to your syntax file, add
" the commands:
@@ -68,7 +68,7 @@ syn match podEscape2 "\d\+>"me=e-1 contained contains=@NoSpell
hi def link podCommand Statement
hi def link podCmdText String
hi def link podOverIndent Number
hi def link podOverIndent Number
hi def link podForKeywd Identifier
hi def link podFormat Identifier
hi def link podVerbatimLine PreProc
@@ -76,7 +76,6 @@ hi def link podSpecial Identifier
hi def link podEscape String
hi def link podEscape2 Number
if exists("perl_pod_spellcheck_headings")
" Spell-check headings
syn clear podCmdText
+4 -1
View File
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: readline(3) configuration file
" Previous Maintainer: Nikolai Weibull <now@bitwi.se>
" Latest Revision: 2012-04-25
" Latest Revision: 2017-06-25
" readline_has_bash - if defined add support for bash specific
" settings/functions
@@ -119,6 +119,7 @@ syn keyword readlineVariable contained
\ nextgroup=readlineBoolean
\ skipwhite
\ bind-tty-special-chars
\ colored-stats
\ completion-ignore-case
\ completion-map-case
\ convert-meta
@@ -142,6 +143,7 @@ syn keyword readlineVariable contained
\ revert-all-at-newline
\ show-all-if-ambiguous
\ show-all-if-unmodified
\ show-mode-in-prompt
\ skip-completed-text
\ visible-stats
@@ -158,6 +160,7 @@ syn keyword readlineVariable contained
\ completion-prefix-display-length
\ completion-query-items
\ history-size
\ keyseq-timeout
syn keyword readlineVariable contained
\ nextgroup=readlineEditingMode
+97
View File
@@ -0,0 +1,97 @@
" Vim syntax file
" Language: Verbose TAP Output
" Maintainer: Rufus Cable <rufus@threebytesfull.com>
" Remark: Simple syntax highlighting for TAP output
" License:
" Copyright: (c) 2008-2013 Rufus Cable
" Last Change: 2014-12-13
if exists("b:current_syntax")
finish
endif
syn match tapTestDiag /^ *#.*/ contains=tapTestTodo
syn match tapTestTime /^ *\[\d\d:\d\d:\d\d\].*/ contains=tapTestFile
syn match tapTestFile /\w\+\/[^. ]*/ contained
syn match tapTestFileWithDot /\w\+\/[^ ]*/ contained
syn match tapTestPlan /^ *\d\+\.\.\d\+$/
" tapTest is a line like 'ok 1', 'not ok 2', 'ok 3 - xxxx'
syn match tapTest /^ *\(not \)\?ok \d\+.*/ contains=tapTestStatusOK,tapTestStatusNotOK,tapTestLine
" tapTestLine is the line without the ok/not ok status - i.e. number and
" optional message
syn match tapTestLine /\d\+\( .*\|$\)/ contains=tapTestNumber,tapTestLoadMessage,tapTestTodo,tapTestSkip contained
" turn ok/not ok messages green/red respectively
syn match tapTestStatusOK /ok/ contained
syn match tapTestStatusNotOK /not ok/ contained
" highlight todo tests
syn match tapTestTodo /\(# TODO\|Failed (TODO)\) .*$/ contained contains=tapTestTodoRev
syn match tapTestTodoRev /\<TODO\>/ contained
" highlight skipped tests
syn match tapTestSkip /# skip .*$/ contained contains=tapTestSkipTag
syn match tapTestSkipTag /\(# \)\@<=skip\>/ contained
" look behind so "ok 123" and "not ok 124" match test number
syn match tapTestNumber /\(ok \)\@<=\d\d*/ contained
syn match tapTestLoadMessage /\*\*\*.*\*\*\*/ contained contains=tapTestThreeStars,tapTestFileWithDot
syn match tapTestThreeStars /\*\*\*/ contained
syn region tapTestRegion start=/^ *\(not \)\?ok.*$/me=e+1 end=/^\(\(not \)\?ok\|# Looks like you planned \|All tests successful\|Bailout called\)/me=s-1 fold transparent excludenl
syn region tapTestResultsOKRegion start=/^\(All tests successful\|Result: PASS\)/ end=/$/
syn region tapTestResultsNotOKRegion start=/^\(# Looks like you planned \|Bailout called\|# Looks like you failed \|Result: FAIL\)/ end=/$/
syn region tapTestResultsSummaryRegion start=/^Test Summary Report/ end=/^Files=.*$/ contains=tapTestResultsSummaryHeading,tapTestResultsSummaryNotOK
syn region tapTestResultsSummaryHeading start=/^Test Summary Report/ end=/^-\+$/ contained
syn region tapTestResultsSummaryNotOK start=/TODO passed:/ end=/$/ contained
syn region tapTestInstructionsRegion start=/\%1l/ end=/^$/
set foldtext=TAPTestLine_foldtext()
function! TAPTestLine_foldtext()
let line = getline(v:foldstart)
let sub = substitute(line, '/\*\|\*/\|{{{\d\=', '', 'g')
return sub
endfunction
set foldminlines=5
set foldcolumn=2
set foldenable
set foldmethod=syntax
syn sync fromstart
if !exists("did_tapverboseoutput_syntax_inits")
let did_tapverboseoutput_syntax_inits = 1
hi tapTestStatusOK term=bold ctermfg=green guifg=Green
hi tapTestStatusNotOK term=reverse ctermfg=black ctermbg=red guifg=Black guibg=Red
hi tapTestTodo term=bold ctermfg=yellow ctermbg=black guifg=Yellow guibg=Black
hi tapTestTodoRev term=reverse ctermfg=black ctermbg=yellow guifg=Black guibg=Yellow
hi tapTestSkip term=bold ctermfg=lightblue guifg=LightBlue
hi tapTestSkipTag term=reverse ctermfg=black ctermbg=lightblue guifg=Black guibg=LightBlue
hi tapTestTime term=bold ctermfg=blue guifg=Blue
hi tapTestFile term=reverse ctermfg=black ctermbg=yellow guibg=Black guifg=Yellow
hi tapTestLoadedFile term=bold ctermfg=black ctermbg=cyan guibg=Cyan guifg=Black
hi tapTestThreeStars term=reverse ctermfg=blue guifg=Blue
hi tapTestPlan term=bold ctermfg=yellow guifg=Yellow
hi link tapTestFileWithDot tapTestLoadedFile
hi link tapTestNumber Number
hi link tapTestDiag Comment
hi tapTestRegion ctermbg=green
hi tapTestResultsOKRegion ctermbg=green ctermfg=black
hi tapTestResultsNotOKRegion ctermbg=red ctermfg=black
hi tapTestResultsSummaryHeading ctermbg=blue ctermfg=white
hi tapTestResultsSummaryNotOK ctermbg=red ctermfg=black
hi tapTestInstructionsRegion ctermbg=lightmagenta ctermfg=black
endif
let b:current_syntax="tapVerboseOutput"
+3 -3
View File
@@ -3,10 +3,10 @@
" Author: Moriki, Atsushi <4woods+vim@gmail.com>
" Homepage: http://github.com/vim-perl/vim-perl
" Bugs/requests: http://github.com/vim-perl/vim-perl/issues
" Last Change: 2013-07-21
" Last Change: 2015-04-25
"
" Instration:
" put tt2.vim and tt2html.vim in to your syntax diretory.
" Installation:
" put tt2.vim and tt2html.vim in to your syntax directory.
"
" add below in your filetype.vim.
" au BufNewFile,BufRead *.tt2 setf tt2
+1 -1
View File
@@ -78,7 +78,7 @@ syn case match
" Function Names {{{2
syn keyword vimFuncName contained abs append argv assert_fails assert_notequal atan2 buflisted bufwinid byteidxcomp ch_close_in ch_getjob ch_open ch_sendraw char2nr complete copy cscope_connection did_filetype escape execute expand filewritable float2nr fnamemodify foldtext function getbufline getcharsearch getcmdwintype getfontname getftype getpid getregtype getwininfo glob has_key histdel hlexists index inputrestore invert items job_start js_decode json_encode libcall line2byte log map match matcharg matchlist max mode nr2char perleval printf pyeval reltime remote_expr remote_read rename reverse screenchar search searchpairpos serverlist setcmdpos setloclist setqflist settabwinvar shellescape sin soundfold split str2nr strdisplaywidth stridx strpart strwidth synID synconcealed systemlist tabpagewinnr tan test_alloc_fail test_garbagecollect_now test_null_job test_null_string timer_pause timer_stopall tr undofile values wildmenumode win_gotoid winbufnr winline winrestview wordcount
syn keyword vimFuncName contained acos argc asin assert_false assert_notmatch browse bufloaded bufwinnr call ch_evalexpr ch_info ch_read ch_setoptions cindent complete_add cos cursor diff_filler eval exepath extend filter floor foldclosed foldtextresult garbagecollect getbufvar getcmdline getcompletion getfperm getline getpos gettabinfo getwinposx glob2regpat haslocaldir histget hostname input inputsave isdirectory job_getchannel job_status js_encode keys libcallnr lispindent log10 maparg matchadd matchdelete matchstr min mzeval or pow pumvisible range reltimefloat remote_foreground remote_send repeat round screencol searchdecl searchpos setbufvar setfperm setmatches setreg setwinvar shiftwidth sinh spellbadword sqrt strcharpart strftime string strridx submatch synIDattr synstack tabpagebuflist tagfiles tanh test_autochdir test_null_channel test_null_list test_settime timer_start tolower trunc undotree virtcol win_findbuf win_id2tabwin wincol winnr winsaveview writefile
syn keyword vimFuncName contained acos argc asin assert_false assert_notmatch browse bufloaded bufwinnr call ch_evalexpr ch_info ch_read ch_setoptions cindent complete_add cos cursor diff_filler eval exepath extend filter floor foldclosed foldtextresult garbagecollect getbufvar getcmdline getcompletion getfperm getline getpos gettabinfo getwinposx glob2regpat haslocaldir histget hostname input inputsave isdirectory job_getchannel job_status js_encode keys libcallnr lispindent log10 maparg matchadd matchdelete matchstr min mzeval or pow pumvisible range reltimefloat remote_foreground remote_send repeat round screencol searchdecl searchpos setbufline setbufvar setfperm setmatches setreg setwinvar shiftwidth sinh spellbadword sqrt strcharpart strftime string strridx submatch synIDattr synstack tabpagebuflist tagfiles tanh test_autochdir test_null_channel test_null_list test_settime timer_start tolower trunc undotree virtcol win_findbuf win_id2tabwin wincol winnr winsaveview writefile
syn keyword vimFuncName contained add argidx assert_equal assert_inrange assert_true browsedir bufname byte2line ceil ch_evalraw ch_log ch_readraw ch_status clearmatches complete_check cosh deepcopy diff_hlID eventhandler exists feedkeys finddir fmod foldclosedend foreground get getchar getcmdpos getcurpos getfsize getloclist getqflist gettabvar getwinposy globpath hasmapto histnr iconv inputdialog inputsecret islocked job_info job_stop json_decode len line localtime luaeval mapcheck matchaddpos matchend matchstrpos mkdir nextnonblank pathshorten prevnonblank py3eval readfile reltimestr remote_peek remove resolve screenattr screenrow searchpair server2client setcharsearch setline setpos settabvar sha256 simplify sort spellsuggest str2float strchars strgetchar strlen strtrans substitute synIDtrans system tabpagenr taglist tempname test_disable_char_avail test_null_dict test_null_partial timer_info timer_stop toupper type uniq visualmode win_getid win_id2win winheight winrestcmd winwidth xor
syn keyword vimFuncName contained and arglistid assert_exception assert_match atan bufexists bufnr byteidx ch_close ch_getbufnr ch_logfile ch_sendexpr changenr col confirm count delete empty executable exp filereadable findfile fnameescape foldlevel funcref getbufinfo getcharmod getcmdtype getcwd getftime getmatches getreg gettabwinvar getwinvar has histadd hlID indent inputlist insert isnan job_setoptions join
+2179 -1763
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -12,7 +12,7 @@
ATTENTION:
The commands in the lessons will modify the text. Make a copy of this
file to practise on (if you started "vimtutor" this is already a copy).
file to practice on (if you started "vimtutor" this is already a copy).
It is important to remember that this tutor is set up to teach by
use. That means that you need to execute the commands to learn them
+1 -1
View File
@@ -12,7 +12,7 @@
ATTENTION:
The commands in the lessons will modify the text. Make a copy of this
file to practise on (if you started "vimtutor" this is already a copy).
file to practice on (if you started "vimtutor" this is already a copy).
It is important to remember that this tutor is set up to teach by
use. That means that you need to execute the commands to learn them
+15 -34
View File
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11762" systemVersion="15G1611" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies>
<deployment version="1050" identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="9531"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="MMPreferenceController">
@@ -13,7 +14,7 @@
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<userDefaultsController representsSharedInstance="YES" id="58" userLabel="Shared Defaults"/>
<customView id="115" userLabel="General">
<rect key="frame" x="0.0" y="0.0" width="483" height="290"/>
@@ -24,7 +25,7 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<popUpButtonCell key="cell" type="push" title="Keep MacVim Running" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" inset="2" selectedItem="960" id="979">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
<font key="font" metaFont="menu"/>
<menu key="menu" title="OtherViews" id="959">
<items>
<menuItem title="Keep MacVim Running" state="on" id="960"/>
@@ -51,7 +52,7 @@
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<popUpButtonCell key="cell" type="push" title="and set the arglist" bezelStyle="rounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="borderAndBezel" inset="2" selectedItem="436" id="978">
<behavior key="behavior" lightByBackground="YES" lightByGray="YES"/>
<font key="font" metaFont="system"/>
<font key="font" metaFont="menu"/>
<menu key="menu" title="OtherViews" id="429">
<items>
<menuItem title="with a tab for each file" tag="3" id="430"/>
@@ -180,12 +181,12 @@
</textField>
</subviews>
</customView>
<customView id="620" userLabel="Advanced">
<rect key="frame" x="0.0" y="0.0" width="483" height="318"/>
<customView misplaced="YES" id="620" userLabel="Advanced">
<rect key="frame" x="0.0" y="0.0" width="483" height="222"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<textField verticalHuggingPriority="750" id="826">
<rect key="frame" x="17" y="170" width="449" height="56"/>
<rect key="frame" x="17" y="74" width="449" height="56"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" id="993">
<font key="font" metaFont="smallSystem"/>
@@ -195,7 +196,7 @@
</textFieldCell>
</textField>
<button id="817">
<rect key="frame" x="18" y="228" width="133" height="18"/>
<rect key="frame" x="18" y="132" width="133" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Enable Quickstart" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="992">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
@@ -207,7 +208,7 @@
</connections>
</button>
<textField verticalHuggingPriority="750" id="815">
<rect key="frame" x="17" y="252" width="449" height="28"/>
<rect key="frame" x="17" y="156" width="449" height="28"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" id="991">
<font key="font" metaFont="smallSystem"/>
@@ -217,7 +218,7 @@
</textFieldCell>
</textField>
<button id="782">
<rect key="frame" x="18" y="282" width="174" height="18"/>
<rect key="frame" x="18" y="186" width="174" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Use Core Text renderer" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="990">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
@@ -228,28 +229,7 @@
<binding destination="58" name="value" keyPath="values.MMRenderer" id="1000"/>
</connections>
</button>
<textField verticalHuggingPriority="750" id="1001">
<rect key="frame" x="17" y="74" width="444" height="70"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" id="1004">
<font key="font" metaFont="smallSystem"/>
<string key="title">This option causes marked text to be rendered like normal text which is very convenient when using a complex input method (e.g. Kotoeri). However, it has some known limitations which may be circumvented by disabling this option (e.g. mapping to "dead keys" may not work). Note that without this option the Core Text renderer will not draw marked text at all.</string>
<color key="textColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button id="1013">
<rect key="frame" x="18" y="146" width="174" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Draw marked text inline" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="1014">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system"/>
</buttonCell>
<connections>
<binding destination="58" name="value" keyPath="values.MMUseInlineIm" id="1016"/>
</connections>
</button>
<textField verticalHuggingPriority="750" id="1017">
<textField verticalHuggingPriority="750" misplaced="YES" id="1017">
<rect key="frame" x="17" y="20" width="415" height="28"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" controlSize="small" sendsActionOnEndEditing="YES" id="1020">
@@ -259,7 +239,7 @@
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<button id="1028">
<button misplaced="YES" id="1028">
<rect key="frame" x="18" y="50" width="388" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Prefer native full-screen support (requires Mac OS X 10.7)" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="1029">
@@ -271,6 +251,7 @@
</connections>
</button>
</subviews>
<point key="canvasLocation" x="54.5" y="-249"/>
</customView>
</objects>
</document>
Binary file not shown.
-3
View File
@@ -227,9 +227,6 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
[NSNumber numberWithBool:NO], MMVerticalSplitKey,
[NSNumber numberWithInt:0], MMPreloadCacheSizeKey,
[NSNumber numberWithInt:0], MMLastWindowClosedBehaviorKey,
#ifdef INCLUDE_OLD_IM_CODE
[NSNumber numberWithBool:YES], MMUseInlineImKey,
#endif // INCLUDE_OLD_IM_CODE
[NSNumber numberWithBool:NO], MMSuppressTerminationAlertKey,
[NSNumber numberWithBool:YES], MMNativeFullScreenKey,
[NSNumber numberWithDouble:0.25], MMFullScreenFadeTimeKey,
+13
View File
@@ -2092,6 +2092,8 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
[self setImState:NO];
} else if (BackingPropertiesChangedMsgID == msgid) {
[self redrawScreen];
} else if (RedrawBlockMsgID == msgid) {
[self handleRedrawBlock:data];
} else {
ASLogWarn(@"Unknown message received (msgid=%d)", msgid);
}
@@ -3008,6 +3010,17 @@ extern GuiFont gui_mch_retain_font(GuiFont font);
}
}
- (void)handleRedrawBlock:(NSData *)data
{
const void *bytes = [data bytes];
int row1 = *((int*)bytes); bytes += sizeof(int);
int col1 = *((int*)bytes); bytes += sizeof(int);
int row2 = *((int*)bytes); bytes += sizeof(int);
int col2 = *((int*)bytes);
gui_redraw_block(row1, col1, row2, col2, GUI_MON_NOCLEAR);
}
#ifdef FEAT_BEVAL
- (void)bevalCallback:(id)sender
{
+10
View File
@@ -18,6 +18,8 @@
int maxRows, maxColumns;
NSColor *defaultBackgroundColor;
NSColor *defaultForegroundColor;
int defaultBackgroundHexColor;
int defaultForegroundHexColor;
NSSize cellSize;
NSFont *font;
NSFont *fontWide;
@@ -51,6 +53,12 @@
void *trackingRectUserData_;
NSTrackingRectTag lastToolTipTag_;
NSString* toolTip_;
NSUInteger markedRangeLength;
int markedTextStartRow;
int markedTextStartColumn;
int markedTextEndRow;
int markedTextEndColumn;
}
- (id)initWithFrame:(NSRect)frame;
@@ -87,8 +95,10 @@
- (void)setLigatures:(BOOL)state;
- (void)setThinStrokes:(BOOL)state;
- (void)setImControl:(BOOL)enable;
- (void)setInlineIm:(BOOL)enable;
- (void)activateIm:(BOOL)enable;
- (void)checkImState;
- (void)clearMarkedText;
- (BOOL)convertPoint:(NSPoint)point toRow:(int *)row column:(int *)column;
- (NSRect)rectForRow:(int)row column:(int)column numRows:(int)nr
numColumns:(int)nc;
+70
View File
@@ -205,6 +205,13 @@ defaultAdvanceForFont(NSFont *font)
if (defaultBackgroundColor != bgColor) {
[defaultBackgroundColor release];
defaultBackgroundColor = bgColor ? [bgColor retain] : nil;
if (bgColor) {
defaultBackgroundHexColor =
(int)(bgColor.blueComponent * 0xff) |
((int)(bgColor.greenComponent * 0xff) << 8) |
((int)(bgColor.redComponent * 0xff) << 16) |
(0xff << 24);
}
}
// NOTE: The default foreground color isn't actually used for anything, but
@@ -213,6 +220,13 @@ defaultAdvanceForFont(NSFont *font)
if (defaultForegroundColor != fgColor) {
[defaultForegroundColor release];
defaultForegroundColor = fgColor ? [fgColor retain] : nil;
if (fgColor) {
defaultForegroundHexColor =
(int)(fgColor.blueComponent * 0xff) |
((int)(fgColor.greenComponent * 0xff) << 8) |
((int)(fgColor.redComponent * 0xff) << 16) |
(0xff << 24);
}
}
}
@@ -425,6 +439,11 @@ defaultAdvanceForFont(NSFont *font)
[helper setImControl:enable];
}
- (void)setInlineIm:(BOOL)enable
{
[helper setInlineIm:enable];
}
- (void)activateIm:(BOOL)enable
{
[helper activateIm:enable];
@@ -494,6 +513,23 @@ defaultAdvanceForFont(NSFont *font)
[helper setMarkedText:text selectedRange:range];
}
- (void)clearMarkedText
{
if (![helper inlineIm]) {
[self redrawMarkedTextBlock];
}
}
- (void)redrawMarkedTextBlock
{
NSMutableData *data = [NSMutableData data];
[data appendBytes:&markedTextStartRow length:sizeof(int)];
[data appendBytes:&markedTextStartColumn length:sizeof(int)];
[data appendBytes:&markedTextEndRow length:sizeof(int)];
[data appendBytes:&markedTextEndColumn length:sizeof(int)];
[[self vimController] sendMessage:RedrawBlockMsgID data:data];
}
- (void)unmarkText
{
[helper unmarkText];
@@ -647,6 +683,40 @@ defaultAdvanceForFont(NSFont *font)
[drawData removeAllObjects];
}
if ([helper hasMarkedText] && ![helper inlineIm]) {
NSString *text = [[helper markedText] string];
// Draw marked text
CFStringRef sref = (__bridge CFStringRef)text;
CFIndex unilength = CFStringGetLength(sref);
const UniChar *unichars = CFStringGetCharactersPtr(sref);
UniChar *buffer = NULL;
if (unichars == NULL) {
buffer = malloc(unilength * sizeof(UniChar));
CFStringGetCharacters(sref, CFRangeMake(0, unilength), buffer);
unichars = buffer;
}
int row = [helper preEditRow];
int col = [helper preEditColumn];
markedTextStartRow = row;
markedTextEndRow = row;
markedTextStartColumn = col;
markedTextEndColumn = col + unilength * 2;
[self drawString:unichars length:unilength
atRow:row column:col cells:(unilength * 2)
withFlags:(DRAW_WIDE|DRAW_UNDERL)
foregroundColor:defaultForegroundHexColor
backgroundColor:defaultBackgroundHexColor
specialColor:defaultForegroundHexColor];
if (buffer) {
free(buffer);
buffer = NULL;
}
}
}
- (void)performBatchDrawWithData:(NSData *)data
+2
View File
@@ -37,6 +37,7 @@
- (void)setLigatures:(BOOL)ligatures;
- (void)setThinStrokes:(BOOL)thinStrokes;
- (void)setImControl:(BOOL)enable;
- (void)setInlineIm:(BOOL)enable;
- (void)activateIm:(BOOL)enable;
- (void)checkImState;
@@ -74,4 +75,5 @@
- (void)deleteSign:(NSString *)signName;
- (void)setToolTipAtMousePoint:(NSString *)string;
- (void)setCGLayerEnabled:(BOOL)enabled;
- (void)clearMarkedText;
@end
+11 -6
View File
@@ -322,6 +322,11 @@
[helper setImControl:enable];
}
- (void)setInlineIm:(BOOL)enable
{
[helper setInlineIm:enable];
}
- (void)activateIm:(BOOL)enable
{
[helper activateIm:enable];
@@ -557,8 +562,7 @@
numInvertRects = 0;
}
#ifdef INCLUDE_OLD_IM_CODE
if ([self hasMarkedText] && ![helper useInlineIm]) {
if ([self hasMarkedText] && ![helper inlineIm]) {
shouldDrawInsertionPoint = YES;
MMTextStorage *ts = (MMTextStorage*)[self textStorage];
NSSize inset = [self textContainerInset];
@@ -616,7 +620,6 @@
}
}
}
#endif // INCLUDE_OLD_IM_CODE
if (shouldDrawInsertionPoint) {
MMTextStorage *ts = (MMTextStorage*)[self textStorage];
@@ -626,9 +629,8 @@
ipRect.origin.x += [self textContainerOrigin].x;
ipRect.origin.y += [self textContainerOrigin].y;
#ifdef INCLUDE_OLD_IM_CODE
// Draw insertion point inside marked text.
if ([self hasMarkedText] && ![helper useInlineIm]) {
if ([self hasMarkedText] && ![helper inlineIm]) {
NSFont *theFont = [[self markedTextAttributes]
valueForKey:NSFontAttributeName];
if (theFont == [ts font])
@@ -640,7 +642,6 @@
([helper imRange].location +
[helper imRange].length);
}
#endif // INCLUDE_OLD_IM_CODE
if (MMInsertionPointHorizontal == insertionPointShape) {
int frac = ([ts cellSize].height * insertionPointFraction + 99)/100;
@@ -730,6 +731,10 @@
[helper unmarkText];
}
- (void)clearMarkedText
{
}
- (NSRect)firstRectForCharacterRange:(NSRange)range
{
return [helper firstRectForCharacterRange:range];
+3 -1
View File
@@ -45,6 +45,7 @@
NSMutableAttributedString *markedText;
int preEditRow;
int preEditColumn;
BOOL inlineIm;
BOOL imControl;
BOOL imState;
TISInputSourceRef lastImSource;
@@ -90,7 +91,8 @@
- (NSRect)firstRectForCharacterRange:(NSRange)range;
- (void)setImControl:(BOOL)enable;
- (void)activateIm:(BOOL)enable;
- (BOOL)useInlineIm;
- (void)setInlineIm:(BOOL)enable;
- (BOOL)inlineIm;
- (void)checkImState;
@end
+11 -11
View File
@@ -213,6 +213,7 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
// called the input manager expects the marked text to be unmarked
// automatically, hence the explicit unmarkText: call here.
[self unmarkText];
[textView clearMarkedText];
}
// NOTE: 'string' is either an NSString or an NSAttributedString. Since we
@@ -317,6 +318,7 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
// marked text moves outside the view as a result of scrolling.
[self sendMarkedText:nil position:0];
[self unmarkText];
[textView clearMarkedText];
[[NSTextInputContext currentInputContext] discardMarkedText];
}
@@ -616,7 +618,7 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
ASLogDebug(@"text='%@' range=%@", text, NSStringFromRange(range));
[self unmarkText];
if ([self useInlineIm]) {
if (inlineIm) {
if ([text isKindOfClass:[NSAttributedString class]])
text = [text string];
@@ -629,7 +631,6 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
return;
}
#ifdef INCLUDE_OLD_IM_CODE
if (!(text && [text length] > 0))
return;
@@ -669,7 +670,6 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
}
[textView setNeedsDisplay:YES];
#endif // INCLUDE_OLD_IM_CODE
}
- (void)unmarkText
@@ -813,14 +813,14 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
}
}
- (BOOL)useInlineIm
- (void)setInlineIm:(BOOL)enable
{
#ifdef INCLUDE_OLD_IM_CODE
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
return [ud boolForKey:MMUseInlineImKey];
#else
return YES;
#endif // INCLUDE_OLD_IM_CODE
inlineIm = enable;
}
- (BOOL)inlineIm
{
return inlineIm;
}
- (void)checkImState
@@ -1064,7 +1064,7 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
- (void)sendMarkedText:(NSString *)text position:(int32_t)pos
{
if (![self useInlineIm])
if (!inlineIm)
return;
NSMutableData *data = [NSMutableData data];
+4
View File
@@ -833,6 +833,10 @@ static BOOL isUnsafeMessage(int msgid);
[[[windowController vimView] textView] activateIm:YES];
} else if (DeactivateKeyScriptMsgID == msgid) {
[[[windowController vimView] textView] activateIm:NO];
} else if (EnableInlineImMsgID == msgid) {
[[[windowController vimView] textView] setInlineIm:YES];
} else if (DisableInlineImMsgID == msgid) {
[[[windowController vimView] textView] setInlineIm:NO];
} else if (EnableImControlMsgID == msgid) {
[[[windowController vimView] textView] setImControl:YES];
} else if (DisableImControlMsgID == msgid) {
+3
View File
@@ -251,6 +251,9 @@ enum {
DisableLigaturesMsgID,
EnableThinStrokesMsgID,
DisableThinStrokesMsgID,
EnableInlineImMsgID,
DisableInlineImMsgID,
RedrawBlockMsgID,
LastMsgID // NOTE: MUST BE LAST MESSAGE IN ENUM!
};
+3
View File
@@ -105,6 +105,9 @@ char *MessageStrings[] =
"DisableLigaturesMsgID",
"EnableThinStrokesMsgID",
"DisableThinStrokesMsgID",
"EnableInlineImMsgID",
"DisableInlineImMsgID",
"RedrawBlockMsgID",
"END OF MESSAGE IDs" // NOTE: Must be last!
};
-7
View File
@@ -13,10 +13,6 @@
#import "MacVim.h"
// TODO: Remove this when the inline IM code has been tested
#define INCLUDE_OLD_IM_CODE
// NSUserDefaults keys
extern NSString *MMTabMinWidthKey;
extern NSString *MMTabMaxWidthKey;
@@ -45,9 +41,6 @@ extern NSString *MMOpenLayoutKey;
extern NSString *MMVerticalSplitKey;
extern NSString *MMPreloadCacheSizeKey;
extern NSString *MMLastWindowClosedBehaviorKey;
#ifdef INCLUDE_OLD_IM_CODE
extern NSString *MMUseInlineImKey;
#endif // INCLUDE_OLD_IM_CODE
extern NSString *MMSuppressTerminationAlertKey;
extern NSString *MMNativeFullScreenKey;
extern NSString *MMUseMouseTimeKey;
-3
View File
@@ -41,9 +41,6 @@ NSString *MMOpenLayoutKey = @"MMOpenLayout";
NSString *MMVerticalSplitKey = @"MMVerticalSplit";
NSString *MMPreloadCacheSizeKey = @"MMPreloadCacheSize";
NSString *MMLastWindowClosedBehaviorKey = @"MMLastWindowClosedBehavior";
#ifdef INCLUDE_OLD_IM_CODE
NSString *MMUseInlineImKey = @"MMUseInlineIm";
#endif // INCLUDE_OLD_IM_CODE
NSString *MMSuppressTerminationAlertKey = @"MMSuppressTerminationAlert";
NSString *MMNativeFullScreenKey = @"MMNativeFullScreen";
NSString *MMUseMouseTimeKey = @"MMUseMouseTime";
+11
View File
@@ -264,6 +264,8 @@ gui_mch_init(void)
gui_mch_adjust_charheight();
gui_mch_adjust_charwidth();
gui_macvim_set_imstyle(p_imst);
if (!MMNoMRU && GARGCOUNT > 0) {
// Add files passed on command line to MRU.
NSMutableArray *filenames = [NSMutableArray array];
@@ -1331,6 +1333,15 @@ im_get_status(void)
void
gui_macvim_set_imstyle(long imstyle)
{
int msgid = imstyle == IM_ON_THE_SPOT ?
EnableInlineImMsgID : DisableInlineImMsgID;
[[MMBackend sharedInstance] queueMessage:msgid properties:nil];
}
// -- Find & Replace dialog -------------------------------------------------
+2
View File
@@ -221,6 +221,8 @@ endif
# MZSCHEME=[Path to MzScheme directory] (Set inside Make_cyg.mak or Make_ming.mak)
# DYNAMIC_MZSCHEME=yes (to load the MzScheme DLL dynamically)
# MZSCHEME_VER=[MzScheme version] (default is 3m_a0solc (6.6))
# Used for the DLL file name. E.g.:
# C:\Program Files (x86)\Racket\lib\libracket3m_XXXXXX.dll
# MZSCHEME_DEBUG=no
ifdef MZSCHEME
ifndef DYNAMIC_MZSCHEME
+3 -1
View File
@@ -47,7 +47,9 @@
# MzScheme interface:
# MZSCHEME=[Path to MzScheme directory]
# DYNAMIC_MZSCHEME=yes (to load the MzScheme DLLs dynamically)
# MZSCHEME_VER=[version, 205_000, ...] (default is 3m_a0solc (6.6))
# MZSCHEME_VER=[MzScheme version] (default is 3m_a0solc (6.6))
# Used for the DLL file name. E.g.:
# C:\Program Files (x86)\Racket\lib\libracket3m_XXXXXX.dll
# MZSCHEME_DEBUG=no
#
# Perl interface:
+1
View File
@@ -2295,6 +2295,7 @@ test_arglist \
test_vimscript \
test_virtualedit \
test_visual \
test_winbar \
test_window_cmd \
test_window_id \
test_windows_home \
+4 -3
View File
@@ -5755,9 +5755,10 @@ $as_echo "OK" >&6; }
done
perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \
-e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[^ ]*//' \
-e 's/-fdebug-prefix-map[^ ]*//g'`
perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \
-e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[^ ]*//' \
-e 's/-fdebug-prefix-map[^ ]*//g' \
-e 's/\(-Wp,\)\?-D_FORTIFY_SOURCE=.//g'`
perllibs=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed -e 'ldopts' | \
sed -e '/Warning/d' -e '/Note (probably harmless)/d' \
-e 's/-bE:perl.exp//' -e 's/-lc //'`
+41 -120
View File
@@ -59,7 +59,7 @@ static void clear_wininfo(buf_T *buf);
static void insert_sign(buf_T *buf, signlist_T *prev, signlist_T *next, int id, linenr_T lnum, int typenr);
#endif
#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
#if defined(FEAT_QUICKFIX)
static char *msg_loclist = N_("[Location List]");
static char *msg_qflist = N_("[Quickfix List]");
#endif
@@ -458,18 +458,35 @@ close_buffer(
int is_curbuf;
int nwindows;
bufref_T bufref;
# ifdef FEAT_WINDOWS
int is_curwin = (curwin != NULL && curwin->w_buffer == buf);
win_T *the_curwin = curwin;
tabpage_T *the_curtab = curtab;
# endif
#endif
int unload_buf = (action != 0);
int del_buf = (action == DOBUF_DEL || action == DOBUF_WIPE);
int wipe_buf = (action == DOBUF_WIPE);
/*
* Force unloading or deleting when 'bufhidden' says so.
* The caller must take care of NOT deleting/freeing when 'bufhidden' is
* "hide" (otherwise we could never free or delete a buffer).
*/
if (buf->b_p_bh[0] == 'd') /* 'bufhidden' == "delete" */
{
del_buf = TRUE;
unload_buf = TRUE;
}
else if (buf->b_p_bh[0] == 'w') /* 'bufhidden' == "wipe" */
{
del_buf = TRUE;
unload_buf = TRUE;
wipe_buf = TRUE;
}
else if (buf->b_p_bh[0] == 'u') /* 'bufhidden' == "unload" */
unload_buf = TRUE;
#ifdef FEAT_TERMINAL
if (bt_terminal(buf))
if (bt_terminal(buf) && (buf->b_nwindows == 1 || del_buf))
{
if (term_job_running(buf->b_term))
{
@@ -491,26 +508,7 @@ close_buffer(
wipe_buf = TRUE;
}
}
else
#endif
/*
* Force unloading or deleting when 'bufhidden' says so.
* The caller must take care of NOT deleting/freeing when 'bufhidden' is
* "hide" (otherwise we could never free or delete a buffer).
*/
if (buf->b_p_bh[0] == 'd') /* 'bufhidden' == "delete" */
{
del_buf = TRUE;
unload_buf = TRUE;
}
else if (buf->b_p_bh[0] == 'w') /* 'bufhidden' == "wipe" */
{
del_buf = TRUE;
unload_buf = TRUE;
wipe_buf = TRUE;
}
else if (buf->b_p_bh[0] == 'u') /* 'bufhidden' == "unload" */
unload_buf = TRUE;
#ifdef FEAT_AUTOCMD
/* Disallow deleting the buffer when it is locked (already being closed or
@@ -522,11 +520,8 @@ close_buffer(
}
#endif
if (win != NULL
#ifdef FEAT_WINDOWS
&& win_valid_any_tab(win) /* in case autocommands closed the window */
#endif
)
/* check no autocommands closed the window */
if (win != NULL && win_valid_any_tab(win))
{
/* Set b_last_cursor when closing the last window for the buffer.
* Remember the last cursor position and window options of the buffer.
@@ -581,7 +576,6 @@ aucmd_abort:
# endif
}
# ifdef FEAT_WINDOWS
/* If the buffer was in curwin and the window has changed, go back to that
* window, if it still exists. This avoids that ":edit x" triggering a
* "tabnext" BufUnload autocmd leaves a window behind without a buffer. */
@@ -591,7 +585,6 @@ aucmd_abort:
goto_tabpage_win(the_curtab, the_curwin);
unblock_autocmds();
}
# endif
nwindows = buf->b_nwindows;
#endif
@@ -650,13 +643,7 @@ aucmd_abort:
if (buf == curbuf && !is_curbuf)
return;
if (
#ifdef FEAT_WINDOWS
win_valid_any_tab(win) &&
#else
win != NULL &&
#endif
win->w_buffer == buf)
if (win_valid_any_tab(win) && win->w_buffer == buf)
win->w_buffer = NULL; /* make sure we don't use the buffer now */
/* Autocommands may have opened or closed windows for this buffer.
@@ -750,11 +737,9 @@ buf_freeall(buf_T *buf, int flags)
#ifdef FEAT_AUTOCMD
int is_curbuf = (buf == curbuf);
bufref_T bufref;
# ifdef FEAT_WINDOWS
int is_curwin = (curwin != NULL && curwin->w_buffer == buf);
win_T *the_curwin = curwin;
tabpage_T *the_curtab = curtab;
# endif
/* Make sure the buffer isn't closed by autocommands. */
++buf->b_locked;
@@ -785,7 +770,6 @@ buf_freeall(buf_T *buf, int flags)
}
--buf->b_locked;
# ifdef FEAT_WINDOWS
/* If the buffer was in curwin and the window has changed, go back to that
* window, if it still exists. This avoids that ":edit x" triggering a
* "tabnext" BufUnload autocmd leaves a window behind without a buffer. */
@@ -795,7 +779,6 @@ buf_freeall(buf_T *buf, int flags)
goto_tabpage_win(the_curtab, the_curwin);
unblock_autocmds();
}
# endif
# ifdef FEAT_EVAL
if (aborting()) /* autocmds may abort script processing */
@@ -822,7 +805,6 @@ buf_freeall(buf_T *buf, int flags)
#ifdef FEAT_FOLDING
/* No folds in an empty buffer. */
# ifdef FEAT_WINDOWS
{
win_T *win;
tabpage_T *tp;
@@ -831,10 +813,6 @@ buf_freeall(buf_T *buf, int flags)
if (win->w_buffer == buf)
clearFolding(win);
}
# else
if (curwin != NULL && curwin->w_buffer == buf)
clearFolding(curwin);
# endif
#endif
#ifdef FEAT_TCL
@@ -1005,7 +983,7 @@ goto_buffer(
int dir,
int count)
{
# if defined(FEAT_WINDOWS) && defined(HAS_SWAP_EXISTS_ACTION)
# if defined(HAS_SWAP_EXISTS_ACTION)
bufref_T old_curbuf;
set_bufref(&old_curbuf, curbuf);
@@ -1014,7 +992,7 @@ goto_buffer(
# endif
(void)do_buffer(*eap->cmd == 's' ? DOBUF_SPLIT : DOBUF_GOTO,
start, dir, count, eap->forceit);
# if defined(FEAT_WINDOWS) && defined(HAS_SWAP_EXISTS_ACTION)
# if defined(HAS_SWAP_EXISTS_ACTION)
if (swap_exists_action == SEA_QUIT && *eap->cmd == 's')
{
# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
@@ -1273,11 +1251,9 @@ empty_curbuf(
}
set_bufref(&bufref, buf);
#ifdef FEAT_WINDOWS
if (close_others)
/* Close any other windows on this buffer, then make it empty. */
close_windows(buf, TRUE);
#endif
setpcmark();
retval = do_ecmd(0, NULL, NULL, NULL, ECMD_ONE,
@@ -1414,11 +1390,9 @@ do_buffer(
if (unload)
{
int forward;
# if defined(FEAT_AUTOCMD) || defined(FEAT_WINDOWS)
bufref_T bufref;
set_bufref(&bufref, buf);
# endif
/* When unloading or deleting a buffer that's already unloaded and
* unlisted: fail silently. */
@@ -1465,33 +1439,28 @@ do_buffer(
if (bp == NULL && buf == curbuf)
return empty_curbuf(TRUE, forceit, action);
#ifdef FEAT_WINDOWS
/*
* If the deleted buffer is the current one, close the current window
* (unless it's the only window). Repeat this so long as we end up in
* a window with this buffer.
*/
while (buf == curbuf
# ifdef FEAT_AUTOCMD
#ifdef FEAT_AUTOCMD
&& !(curwin->w_closing || curwin->w_buffer->b_locked > 0)
# endif
#endif
&& (!ONE_WINDOW || first_tabpage->tp_next != NULL))
{
if (win_close(curwin, FALSE) == FAIL)
break;
}
#endif
/*
* If the buffer to be deleted is not the current one, delete it here.
*/
if (buf != curbuf)
{
#ifdef FEAT_WINDOWS
close_windows(buf, FALSE);
if (buf != curbuf && bufref_valid(&bufref))
#endif
if (buf->b_nwindows <= 0)
if (buf != curbuf && bufref_valid(&bufref) && buf->b_nwindows <= 0)
close_buffer(NULL, buf, action, FALSE);
return OK;
}
@@ -1610,7 +1579,6 @@ do_buffer(
*/
if (action == DOBUF_SPLIT) /* split window first */
{
# ifdef FEAT_WINDOWS
/* If 'switchbuf' contains "useopen": jump to first window containing
* "buf" if one exists */
if ((swb_flags & SWB_USEOPEN) && buf_jump_open_win(buf))
@@ -1620,7 +1588,6 @@ do_buffer(
if ((swb_flags & SWB_USETAB) && buf_jump_open_tab(buf))
return OK;
if (win_split(0, 0) == FAIL)
# endif
return FAIL;
}
#endif
@@ -1723,30 +1690,24 @@ set_curbuf(buf_T *buf, int action)
if (prevbuf == curwin->w_buffer)
reset_synblock(curwin);
#endif
#ifdef FEAT_WINDOWS
if (unload)
close_windows(prevbuf, FALSE);
#endif
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
if (bufref_valid(&bufref) && !aborting())
#else
if (bufref_valid(&bufref))
#endif
{
#ifdef FEAT_WINDOWS
win_T *previouswin = curwin;
#endif
if (prevbuf == curbuf)
u_sync(FALSE);
close_buffer(prevbuf == curwin->w_buffer ? curwin : NULL, prevbuf,
unload ? action : (action == DOBUF_GOTO
&& !buf_hide(prevbuf)
&& !bufIsChanged(prevbuf)) ? DOBUF_UNLOAD : 0, FALSE);
#ifdef FEAT_WINDOWS
if (curwin != previouswin && win_valid(previouswin))
/* autocommands changed curwin, Grr! */
curwin = previouswin;
#endif
}
}
#ifdef FEAT_AUTOCMD
@@ -1755,12 +1716,9 @@ set_curbuf(buf_T *buf, int action)
* If curwin->w_buffer is null, enter_buffer() will make it valid again */
if ((buf_valid(buf) && buf != curbuf
# ifdef FEAT_EVAL
&& !aborting()
&& !aborting()
# endif
# ifdef FEAT_WINDOWS
) || curwin->w_buffer == NULL
# endif
)
) || curwin->w_buffer == NULL)
#endif
{
enter_buffer(buf);
@@ -2331,9 +2289,7 @@ buflist_getfile(
int forceit)
{
buf_T *buf;
#ifdef FEAT_WINDOWS
win_T *wp = NULL;
#endif
pos_T *fpos;
colnr_T col;
@@ -2371,7 +2327,6 @@ buflist_getfile(
else
col = 0;
#ifdef FEAT_WINDOWS
if (options & GETF_SWITCH)
{
/* If 'switchbuf' contains "useopen": jump to first window containing
@@ -2397,7 +2352,6 @@ buflist_getfile(
RESET_BINDING(curwin);
}
}
#endif
++RedrawingDisabled;
if (GETFILE_SUCCESS(getfile(buf->b_fnum, NULL, NULL,
@@ -2602,7 +2556,6 @@ buflist_findpat(
{
/* Ignore the match if the buffer is not open in
* the current tab. */
#ifdef FEAT_WINDOWS
win_T *wp;
FOR_ALL_WINDOWS(wp)
@@ -2610,10 +2563,6 @@ buflist_findpat(
break;
if (wp == NULL)
continue;
#else
if (curwin->w_buffer != buf)
continue;
#endif
}
if (match >= 0) /* already found a match */
{
@@ -3093,7 +3042,10 @@ buflist_list(exarg_T *eap)
#ifdef FEAT_TERMINAL
if (term_job_running(buf->b_term))
{
ro_char = 'R';
if (term_none_open(buf->b_term))
ro_char = '?';
else
ro_char = 'R';
changed_char = ' '; /* bufIsChanged() returns TRUE to avoid
* closing, but it's not actually changed. */
}
@@ -3296,9 +3248,7 @@ buf_name_changed(buf_T *buf)
#ifdef FEAT_TITLE
maketitle(); /* set window title */
#endif
#ifdef FEAT_WINDOWS
status_redraw_all(); /* status lines need to be redrawn */
#endif
fmarks_check_names(buf); /* check named file marks */
ml_timestamp(buf); /* reset timestamp */
}
@@ -4432,7 +4382,7 @@ build_stl_str_hl(
break;
#endif
#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
#if defined(FEAT_QUICKFIX)
case STL_PREVIEWFLAG:
case STL_PREVIEWFLAG_ALT:
itemisflag = TRUE;
@@ -4918,7 +4868,6 @@ alist_name(aentry_T *aep)
return bp->b_fname;
}
#if defined(FEAT_WINDOWS) || defined(PROTO)
/*
* do_arg_all(): Open up to 'count' windows, one for each argument.
*/
@@ -5067,23 +5016,19 @@ do_arg_all(
}
#endif
}
#ifdef FEAT_WINDOWS
/* don't close last window */
if (ONE_WINDOW
&& (first_tabpage->tp_next == NULL || !had_tab))
#endif
use_firstwin = TRUE;
#ifdef FEAT_WINDOWS
else
{
win_close(wp, !buf_hide(buf) && !bufIsChanged(buf));
# ifdef FEAT_AUTOCMD
#ifdef FEAT_AUTOCMD
/* check if autocommands removed the next window */
if (!win_valid(wpnext))
wpnext = firstwin; /* start all over... */
# endif
}
#endif
}
}
}
}
@@ -5115,13 +5060,11 @@ do_arg_all(
last_curwin = curwin;
last_curtab = curtab;
win_enter(lastwin, FALSE);
#ifdef FEAT_WINDOWS
/* ":drop all" should re-use an empty window to avoid "--remote-tab"
* leaving an empty tab page when executed locally. */
if (keep_tabs && BUFEMPTY() && curbuf->b_nwindows == 1
&& curbuf->b_ffname == NULL && !curbuf->b_changed)
use_firstwin = TRUE;
#endif
for (i = 0; i < count && i < opened_len && !got_int; ++i)
{
@@ -5232,10 +5175,8 @@ ex_buffer_all(exarg_T *eap)
int r;
int count; /* Maximum number of windows to open. */
int all; /* When TRUE also load inactive buffers. */
#ifdef FEAT_WINDOWS
int had_tab = cmdmod.tab;
tabpage_T *tpnext;
#endif
if (eap->addr_count == 0) /* make as many windows as possible */
count = 9999;
@@ -5256,25 +5197,20 @@ ex_buffer_all(exarg_T *eap)
* Close superfluous windows (two windows for the same buffer).
* Also close windows that are not full-width.
*/
#ifdef FEAT_WINDOWS
if (had_tab > 0)
goto_tabpage_tp(first_tabpage, TRUE, TRUE);
for (;;)
{
#endif
tpnext = curtab->tp_next;
for (wp = firstwin; wp != NULL; wp = wpnext)
{
wpnext = wp->w_next;
if ((wp->w_buffer->b_nwindows > 1
#ifdef FEAT_WINDOWS
|| ((cmdmod.split & WSP_VERT)
? wp->w_height + wp->w_status_height < Rows - p_ch
- tabline_height()
: wp->w_width != Columns)
|| (had_tab > 0 && wp != firstwin)
#endif
) && !ONE_WINDOW
|| (had_tab > 0 && wp != firstwin)) && !ONE_WINDOW
#ifdef FEAT_AUTOCMD
&& !(wp->w_closing || wp->w_buffer->b_locked > 0)
#endif
@@ -5292,13 +5228,11 @@ ex_buffer_all(exarg_T *eap)
++open_wins;
}
#ifdef FEAT_WINDOWS
/* Without the ":tab" modifier only do the current tab page. */
if (had_tab == 0 || tpnext == NULL)
break;
goto_tabpage_tp(tpnext, TRUE, TRUE);
}
#endif
/*
* Go through the buffer list. When a buffer doesn't have a window yet,
@@ -5319,7 +5253,6 @@ ex_buffer_all(exarg_T *eap)
if ((!all && buf->b_ml.ml_mfp == NULL) || !buf->b_p_bl)
continue;
#ifdef FEAT_WINDOWS
if (had_tab != 0)
{
/* With the ":tab" modifier don't move the window. */
@@ -5329,7 +5262,6 @@ ex_buffer_all(exarg_T *eap)
wp = NULL;
}
else
#endif
{
/* Check if this buffer already has a window */
FOR_ALL_WINDOWS(wp)
@@ -5411,11 +5343,9 @@ ex_buffer_all(exarg_T *eap)
if (aborting())
break;
#endif
#ifdef FEAT_WINDOWS
/* When ":tab" was used open a new tab for a new window repeatedly. */
if (had_tab > 0 && tabpage_index(NULL) <= p_tpm)
cmdmod.tab = 9999;
#endif
}
#ifdef FEAT_AUTOCMD
--autocmd_no_enter;
@@ -5456,7 +5386,6 @@ ex_buffer_all(exarg_T *eap)
}
# endif /* FEAT_LISTCMDS */
#endif /* FEAT_WINDOWS */
static int chk_modeline(linenr_T, int);
@@ -5683,10 +5612,8 @@ read_viminfo_bufferlist(
write_viminfo_bufferlist(FILE *fp)
{
buf_T *buf;
#ifdef FEAT_WINDOWS
win_T *win;
tabpage_T *tp;
#endif
char_u *line;
int max_buffers;
@@ -5702,12 +5629,8 @@ write_viminfo_bufferlist(FILE *fp)
if (line == NULL)
return;
#ifdef FEAT_WINDOWS
FOR_ALL_TAB_WINDOWS(tp, win)
set_last_cursor(win);
#else
set_last_cursor(curwin);
#endif
fputs(_("\n# Buffer list:\n"), fp);
FOR_ALL_BUFFERS(buf)
@@ -5820,7 +5743,7 @@ buf_hide(buf_T *buf)
char_u *
buf_spname(buf_T *buf)
{
#if defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)
#if defined(FEAT_QUICKFIX)
if (bt_quickfix(buf))
{
win_T *win;
@@ -5898,9 +5821,7 @@ restore_win_for_buf(
}
#endif
#if (defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)) \
|| defined(SWITCH_TO_WIN) \
|| defined(PROTO)
#if defined(FEAT_QUICKFIX) || defined(SWITCH_TO_WIN) || defined(PROTO)
/*
* Find a window for buffer "buf".
* If found OK is returned and "wp" and "tp" are set to the window and tabpage.
+5 -6
View File
@@ -140,7 +140,7 @@ ch_log_active(void)
}
static void
ch_log_lead(char *what, channel_T *ch)
ch_log_lead(const char *what, channel_T *ch)
{
if (log_fd != NULL)
{
@@ -1834,12 +1834,11 @@ channel_save(channel_T *channel, ch_part_T part, char_u *buf, int len,
head->rq_prev = node;
}
if (log_fd != NULL && lead != NULL)
if (ch_log_active() && lead != NULL)
{
ch_log_lead(lead, channel);
fprintf(log_fd, "'");
if (fwrite(buf, len, 1, log_fd) != 1)
return FAIL;
ignored = (int)fwrite(buf, len, 1, log_fd);
fprintf(log_fd, "'\n");
}
return OK;
@@ -3410,7 +3409,7 @@ channel_read_block(channel_T *channel, ch_part_T part, int timeout)
channel_consume(channel, part, (int)(nl - buf) + 1);
}
}
if (log_fd != NULL)
if (ch_log_active())
ch_log(channel, "Returning %d bytes", (int)STRLEN(msg));
return msg;
}
@@ -3695,7 +3694,7 @@ channel_send(
return FAIL;
}
if (log_fd != NULL)
if (ch_log_active())
{
ch_log_lead("SEND ", channel);
fprintf(log_fd, "'");
+2 -8
View File
@@ -1092,10 +1092,7 @@ win_lbr_chartabsize(
&& VIM_ISBREAK(c)
&& !VIM_ISBREAK((int)s[1])
&& wp->w_p_wrap
# ifdef FEAT_WINDOWS
&& wp->w_width != 0
# endif
)
&& wp->w_width != 0)
{
/*
* Count all characters from first non-blank after a blank up to next
@@ -1249,10 +1246,8 @@ in_win_border(win_T *wp, colnr_T vcol)
int width1; /* width of first line (after line number) */
int width2; /* width of further lines */
# ifdef FEAT_WINDOWS
if (wp->w_width == 0) /* there is no border */
return FALSE;
# endif
width1 = W_WIDTH(wp) - win_col_off(wp);
if ((int)vcol < width1 - 1)
return FALSE;
@@ -2029,8 +2024,7 @@ hex2nr(int c)
return c - '0';
}
#if defined(FEAT_TERMRESPONSE) \
|| (defined(FEAT_GUI_GTK) && defined(FEAT_WINDOWS)) || defined(PROTO)
#if defined(FEAT_TERMRESPONSE) || defined(FEAT_GUI_GTK) || defined(PROTO)
/*
* Convert two hex characters to a byte.
* Return -1 if one of the characters is not hex.
+4 -2
View File
@@ -1026,9 +1026,11 @@ if test "$enable_perlinterp" = "yes" -o "$enable_perlinterp" = "dynamic"; then
AC_SUBST(vi_cv_perlsitelib)
dnl Remove "-fno-something", it breaks using cproto.
dnl Remove "-fdebug-prefix-map", it isn't supported by clang.
dnl Remove "FORTIFY_SOURCE", it will be defined twice.
perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \
-e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[[^ ]]*//' \
-e 's/-fdebug-prefix-map[[^ ]]*//g'`
-e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[[^ ]]*//' \
-e 's/-fdebug-prefix-map[[^ ]]*//g' \
-e 's/\(-Wp,\)\?-D_FORTIFY_SOURCE=.//g'`
dnl Remove "-lc", it breaks on FreeBSD when using "-pthread".
perllibs=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed -e 'ldopts' | \
sed -e '/Warning/d' -e '/Note (probably harmless)/d' \
-4
View File
@@ -2426,9 +2426,7 @@ ex_loadkeymap(exarg_T *eap)
p_cpo = save_cpo;
curbuf->b_kmap_state |= KEYMAP_LOADED;
#ifdef FEAT_WINDOWS
status_redraw_curbuf();
#endif
}
/*
@@ -2462,9 +2460,7 @@ keymap_unload(void)
ga_clear(&curbuf->b_kmap_ga);
curbuf->b_kmap_state &= ~KEYMAP_LOADED;
#ifdef FEAT_WINDOWS
status_redraw_curbuf();
#endif
}
#endif /* FEAT_KEYMAP */
+3 -29
View File
@@ -1369,7 +1369,7 @@ doESCkey:
/* FALLTHROUGH */
case CAR:
case NL:
#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
#if defined(FEAT_QUICKFIX)
/* In a quickfix window a <CR> jumps to the error under the
* cursor. */
if (bt_quickfix(curbuf) && c == CAR)
@@ -4059,22 +4059,16 @@ ins_compl_fixRedoBufForLeader(char_u *ptr_arg)
static buf_T *
ins_compl_next_buf(buf_T *buf, int flag)
{
#ifdef FEAT_WINDOWS
static win_T *wp;
#endif
if (flag == 'w') /* just windows */
{
#ifdef FEAT_WINDOWS
if (buf == curbuf) /* first call for this flag/expansion */
wp = curwin;
while ((wp = (wp->w_next != NULL ? wp->w_next : firstwin)) != curwin
&& wp->w_buffer->b_scanned)
;
buf = wp->w_buffer;
#else
buf = curbuf;
#endif
}
else
/* 'b' (just loaded buffers), 'u' (just non-loaded buffers) or 'U'
@@ -8554,7 +8548,7 @@ ins_ctrl_hat(void)
if (gui.in_use)
gui_update_cursor(TRUE, FALSE);
#endif
#if defined(FEAT_WINDOWS) && defined(FEAT_KEYMAP)
#if defined(FEAT_KEYMAP)
/* Show/unshow value of 'keymap' in status lines. */
status_redraw_curbuf();
#endif
@@ -9396,7 +9390,6 @@ ins_mouse(int c)
tpos = curwin->w_cursor;
if (do_mouse(NULL, c, BACKWARD, 1L, 0))
{
#ifdef FEAT_WINDOWS
win_T *new_curwin = curwin;
if (curwin != old_curwin && win_valid(old_curwin))
@@ -9406,33 +9399,26 @@ ins_mouse(int c)
curwin = old_curwin;
curbuf = curwin->w_buffer;
}
#endif
start_arrow(curwin == old_curwin ? &tpos : NULL);
#ifdef FEAT_WINDOWS
if (curwin != new_curwin && win_valid(new_curwin))
{
curwin = new_curwin;
curbuf = curwin->w_buffer;
}
#endif
# ifdef FEAT_CINDENT
can_cindent = TRUE;
# endif
}
#ifdef FEAT_WINDOWS
/* redraw status lines (in case another window became active) */
redraw_statuslines();
#endif
}
static void
ins_mousescroll(int dir)
{
pos_T tpos;
# if defined(FEAT_WINDOWS)
win_T *old_curwin = curwin, *wp;
# endif
# ifdef FEAT_INS_EXPAND
int did_scroll = FALSE;
# endif
@@ -9442,7 +9428,6 @@ ins_mousescroll(int dir)
tpos = curwin->w_cursor;
# ifdef FEAT_WINDOWS
if (mouse_row >= 0 && mouse_col >= 0)
{
int row, col;
@@ -9458,16 +9443,11 @@ ins_mousescroll(int dir)
curbuf = curwin->w_buffer;
}
if (curwin == old_curwin)
# endif
undisplay_dollar();
# ifdef FEAT_INS_EXPAND
/* Don't scroll the window in which completion is being done. */
if (!pum_visible()
# if defined(FEAT_WINDOWS)
|| curwin != old_curwin
# endif
)
if (!pum_visible() || curwin != old_curwin)
# endif
{
# ifdef FEAT_GUI_SCROLL_WHEEL_FORCE
@@ -9512,12 +9492,10 @@ ins_mousescroll(int dir)
# endif
}
# ifdef FEAT_WINDOWS
curwin->w_redr_status = TRUE;
curwin = old_curwin;
curbuf = curwin->w_buffer;
# endif
# ifdef FEAT_INS_EXPAND
/* The popup menu may overlay the window, need to redraw it.
@@ -9916,7 +9894,6 @@ ins_pageup(void)
undisplay_dollar();
#ifdef FEAT_WINDOWS
if (mod_mask & MOD_MASK_CTRL)
{
/* <C-PageUp>: tab page back */
@@ -9927,7 +9904,6 @@ ins_pageup(void)
}
return;
}
#endif
tpos = curwin->w_cursor;
if (onepage(BACKWARD, 1L) == OK)
@@ -9979,7 +9955,6 @@ ins_pagedown(void)
undisplay_dollar();
#ifdef FEAT_WINDOWS
if (mod_mask & MOD_MASK_CTRL)
{
/* <C-PageDown>: tab page forward */
@@ -9990,7 +9965,6 @@ ins_pagedown(void)
}
return;
}
#endif
tpos = curwin->w_cursor;
if (onepage(FORWARD, 1L) == OK)
+1 -54
View File
@@ -211,9 +211,7 @@ static char_u *skip_var_one(char_u *arg);
static void list_glob_vars(int *first);
static void list_buf_vars(int *first);
static void list_win_vars(int *first);
#ifdef FEAT_WINDOWS
static void list_tab_vars(int *first);
#endif
static void list_vim_vars(int *first);
static void list_script_vars(int *first);
static char_u *list_arg_vars(exarg_T *eap, char_u *arg, int *first);
@@ -1205,9 +1203,7 @@ ex_let(exarg_T *eap)
list_glob_vars(&first);
list_buf_vars(&first);
list_win_vars(&first);
#ifdef FEAT_WINDOWS
list_tab_vars(&first);
#endif
list_script_vars(&first);
list_func_vars(&first);
list_vim_vars(&first);
@@ -1469,7 +1465,6 @@ list_win_vars(int *first)
(char_u *)"w:", TRUE, first);
}
#ifdef FEAT_WINDOWS
/*
* List tab page variables.
*/
@@ -1479,7 +1474,6 @@ list_tab_vars(int *first)
list_hashtable_vars(&curtab->tp_vars->dv_hashtab,
(char_u *)"t:", TRUE, first);
}
#endif
/*
* List Vim variables.
@@ -1565,9 +1559,7 @@ list_arg_vars(exarg_T *eap, char_u *arg, int *first)
case 'g': list_glob_vars(first); break;
case 'b': list_buf_vars(first); break;
case 'w': list_win_vars(first); break;
#ifdef FEAT_WINDOWS
case 't': list_tab_vars(first); break;
#endif
case 'v': list_vim_vars(first); break;
case 's': list_script_vars(first); break;
case 'l': list_func_vars(first); break;
@@ -3075,9 +3067,7 @@ get_user_var_name(expand_T *xp, int idx)
static long_u gdone;
static long_u bdone;
static long_u wdone;
#ifdef FEAT_WINDOWS
static long_u tdone;
#endif
static int vidx;
static hashitem_T *hi;
hashtab_T *ht;
@@ -3085,9 +3075,7 @@ get_user_var_name(expand_T *xp, int idx)
if (idx == 0)
{
gdone = bdone = wdone = vidx = 0;
#ifdef FEAT_WINDOWS
tdone = 0;
#endif
}
/* Global variables */
@@ -3130,7 +3118,6 @@ get_user_var_name(expand_T *xp, int idx)
return cat_prefix_varname('w', hi->hi_key);
}
#ifdef FEAT_WINDOWS
/* t: variables */
ht = &curtab->tp_vars->dv_hashtab;
if (tdone < ht->ht_used)
@@ -3143,7 +3130,6 @@ get_user_var_name(expand_T *xp, int idx)
++hi;
return cat_prefix_varname('t', hi->hi_key);
}
#endif
/* v: variables */
if (vidx < VV_LEN)
@@ -5238,9 +5224,7 @@ garbage_collect(int testing)
win_T *wp;
int i;
int did_free = FALSE;
#ifdef FEAT_WINDOWS
tabpage_T *tp;
#endif
if (!testing)
{
@@ -5283,13 +5267,10 @@ garbage_collect(int testing)
NULL, NULL);
#endif
#ifdef FEAT_WINDOWS
/* tabpage-local variables */
FOR_ALL_TABPAGES(tp)
abort = abort || set_ref_in_item(&tp->tp_winvar.di_tv, copyID,
NULL, NULL);
#endif
/* global variables */
abort = abort || set_ref_in_ht(&globvarht, copyID, NULL);
@@ -7389,9 +7370,7 @@ find_var_in_ht(
case 'v': return &vimvars_var;
case 'b': return &curbuf->b_bufvar;
case 'w': return &curwin->w_winvar;
#ifdef FEAT_WINDOWS
case 't': return &curtab->tp_winvar;
#endif
case 'l': return get_funccal_local_var();
case 'a': return get_funccal_args_var();
}
@@ -7461,10 +7440,8 @@ find_var_ht(char_u *name, char_u **varname)
return &curbuf->b_vars->dv_hashtab;
if (*name == 'w') /* window variable */
return &curwin->w_vars->dv_hashtab;
#ifdef FEAT_WINDOWS
if (*name == 't') /* tab page variable */
return &curtab->tp_vars->dv_hashtab;
#endif
if (*name == 'v') /* v: variable */
return &vimvarht;
if (*name == 'a') /* a: function argument */
@@ -8275,13 +8252,7 @@ ex_echo(exarg_T *eap)
void
ex_echohl(exarg_T *eap)
{
int id;
id = syn_name2id(eap->arg);
if (id == 0)
echo_attr = 0;
else
echo_attr = syn_id2attr(id);
echo_attr = syn_name2attr(eap->arg);
}
/*
@@ -8386,14 +8357,11 @@ find_win_by_nr(
typval_T *vp,
tabpage_T *tp UNUSED) /* NULL for current tab page */
{
#ifdef FEAT_WINDOWS
win_T *wp;
#endif
int nr;
nr = (int)get_tv_number_chk(vp, NULL);
#ifdef FEAT_WINDOWS
if (nr < 0)
return NULL;
if (nr == 0)
@@ -8412,11 +8380,6 @@ find_win_by_nr(
if (nr >= LOWEST_WIN_ID)
return NULL;
return wp;
#else
if (nr == 0 || nr == 1 || nr == curwin->w_id)
return curwin;
return NULL;
#endif
}
/*
@@ -8465,18 +8428,14 @@ getwinvar(
dictitem_T *v;
tabpage_T *tp = NULL;
int done = FALSE;
#ifdef FEAT_WINDOWS
win_T *oldcurwin;
tabpage_T *oldtabpage;
int need_switch_win;
#endif
#ifdef FEAT_WINDOWS
if (off == 1)
tp = find_tabpage((int)get_tv_number_chk(&argvars[0], NULL));
else
tp = curtab;
#endif
win = find_win_by_nr(&argvars[off], tp);
varname = get_tv_string_chk(&argvars[off + 1]);
++emsg_off;
@@ -8486,14 +8445,12 @@ getwinvar(
if (win != NULL && varname != NULL)
{
#ifdef FEAT_WINDOWS
/* Set curwin to be our win, temporarily. Also set the tabpage,
* otherwise the window is not valid. Only do this when needed,
* autocommands get blocked. */
need_switch_win = !(tp == curtab && win == curwin);
if (!need_switch_win
|| switch_win(&oldcurwin, &oldtabpage, win, tp, TRUE) == OK)
#endif
{
if (*varname == '&')
{
@@ -8526,11 +8483,9 @@ getwinvar(
}
}
#ifdef FEAT_WINDOWS
if (need_switch_win)
/* restore previous notion of curwin */
restore_win(oldcurwin, oldtabpage, TRUE);
#endif
}
if (!done && argvars[off + 2].v_type != VAR_UNKNOWN)
@@ -8547,11 +8502,9 @@ getwinvar(
setwinvar(typval_T *argvars, typval_T *rettv UNUSED, int off)
{
win_T *win;
#ifdef FEAT_WINDOWS
win_T *save_curwin;
tabpage_T *save_curtab;
int need_switch_win;
#endif
char_u *varname, *winvarname;
typval_T *varp;
char_u nbuf[NUMBUFLEN];
@@ -8560,23 +8513,19 @@ setwinvar(typval_T *argvars, typval_T *rettv UNUSED, int off)
if (check_restricted() || check_secure())
return;
#ifdef FEAT_WINDOWS
if (off == 1)
tp = find_tabpage((int)get_tv_number_chk(&argvars[0], NULL));
else
tp = curtab;
#endif
win = find_win_by_nr(&argvars[off], tp);
varname = get_tv_string_chk(&argvars[off + 1]);
varp = &argvars[off + 2];
if (win != NULL && varname != NULL && varp != NULL)
{
#ifdef FEAT_WINDOWS
need_switch_win = !(tp == curtab && win == curwin);
if (!need_switch_win
|| switch_win(&save_curwin, &save_curtab, win, tp, TRUE) == OK)
#endif
{
if (*varname == '&')
{
@@ -8602,10 +8551,8 @@ setwinvar(typval_T *argvars, typval_T *rettv UNUSED, int off)
}
}
}
#ifdef FEAT_WINDOWS
if (need_switch_win)
restore_win(save_curwin, save_curtab, TRUE);
#endif
}
}
+23 -63
View File
@@ -1638,16 +1638,13 @@ f_bufnr(typval_T *argvars, typval_T *rettv)
static void
buf_win_common(typval_T *argvars, typval_T *rettv, int get_nr)
{
#ifdef FEAT_WINDOWS
win_T *wp;
int winnr = 0;
#endif
buf_T *buf;
(void)get_tv_number(&argvars[0]); /* issue errmsg if type error */
++emsg_off;
buf = get_buf_tv(&argvars[0], TRUE);
#ifdef FEAT_WINDOWS
FOR_ALL_WINDOWS(wp)
{
++winnr;
@@ -1655,10 +1652,6 @@ buf_win_common(typval_T *argvars, typval_T *rettv, int get_nr)
break;
}
rettv->vval.v_number = (wp != NULL ? (get_nr ? winnr : wp->w_id) : -1);
#else
rettv->vval.v_number = (curwin->w_buffer == buf
? (get_nr ? 1 : curwin->w_id) : -1);
#endif
--emsg_off;
}
@@ -3259,11 +3252,18 @@ f_feedkeys(typval_T *argvars, typval_T *rettv UNUSED)
/* Avoid a 1 second delay when the keys start Insert mode. */
msg_scroll = FALSE;
if (!dangerous)
++ex_normal_busy;
exec_normal(TRUE);
if (!dangerous)
--ex_normal_busy;
#ifdef FEAT_TERMINAL
if (term_use_loop())
terminal_loop(FALSE);
else
#endif
{
if (!dangerous)
++ex_normal_busy;
exec_normal(TRUE);
if (!dangerous)
--ex_normal_busy;
}
msg_scroll |= save_msg_scroll;
}
}
@@ -3635,11 +3635,16 @@ f_foldtextresult(typval_T *argvars UNUSED, typval_T *rettv)
char_u buf[FOLD_TEXT_LEN];
foldinfo_T foldinfo;
int fold_count;
static int entered = FALSE;
#endif
rettv->v_type = VAR_STRING;
rettv->vval.v_string = NULL;
#ifdef FEAT_FOLDING
if (entered)
return; /* reject recursive use */
entered = TRUE;
lnum = get_tv_lnum(argvars);
/* treat illegal types and illegal string values for {lnum} the same */
if (lnum < 0)
@@ -3653,6 +3658,8 @@ f_foldtextresult(typval_T *argvars UNUSED, typval_T *rettv)
text = vim_strsave(text);
rettv->vval.v_string = text;
}
entered = FALSE;
#endif
}
@@ -4383,9 +4390,7 @@ f_getchar(typval_T *argvars, typval_T *rettv)
int col = mouse_col;
win_T *win;
linenr_T lnum;
# ifdef FEAT_WINDOWS
win_T *wp;
# endif
int winnr = 1;
if (row >= 0 && col >= 0)
@@ -4396,10 +4401,8 @@ f_getchar(typval_T *argvars, typval_T *rettv)
if (win == NULL)
return;
(void)mouse_comp_pos(win, &row, &col, &lnum);
# ifdef FEAT_WINDOWS
for (wp = firstwin; wp != win; wp = wp->w_next)
++winnr;
# endif
set_vim_var_nr(VV_MOUSE_WIN, winnr);
set_vim_var_nr(VV_MOUSE_WINID, win->w_id);
set_vim_var_nr(VV_MOUSE_LNUM, lnum);
@@ -5098,7 +5101,6 @@ f_getregtype(typval_T *argvars, typval_T *rettv)
rettv->vval.v_string = vim_strsave(buf);
}
#ifdef FEAT_WINDOWS
/*
* Returns information (variables, options, etc.) about a tab page
* as a dictionary.
@@ -5130,7 +5132,6 @@ get_tabpage_info(tabpage_T *tp, int tp_idx)
return dict;
}
#endif
/*
* "gettabinfo()" function
@@ -5138,7 +5139,6 @@ get_tabpage_info(tabpage_T *tp, int tp_idx)
static void
f_gettabinfo(typval_T *argvars, typval_T *rettv)
{
#ifdef FEAT_WINDOWS
tabpage_T *tp, *tparg = NULL;
dict_T *d;
int tpnr = 0;
@@ -5166,7 +5166,6 @@ f_gettabinfo(typval_T *argvars, typval_T *rettv)
if (tparg != NULL)
return;
}
#endif
}
/*
@@ -5221,7 +5220,6 @@ f_gettabwinvar(typval_T *argvars, typval_T *rettv)
getwinvar(argvars, rettv, 1);
}
#ifdef FEAT_WINDOWS
/*
* Returns information about a window as a dictionary.
*/
@@ -5238,6 +5236,9 @@ get_win_info(win_T *wp, short tpnr, short winnr)
dict_add_nr_str(dict, "winnr", winnr, NULL);
dict_add_nr_str(dict, "winid", wp->w_id, NULL);
dict_add_nr_str(dict, "height", wp->w_height, NULL);
#ifdef FEAT_MENU
dict_add_nr_str(dict, "winbar", wp->w_winbar_height, NULL);
#endif
dict_add_nr_str(dict, "width", wp->w_width, NULL);
dict_add_nr_str(dict, "bufnr", wp->w_buffer->b_fnum, NULL);
@@ -5255,7 +5256,6 @@ get_win_info(win_T *wp, short tpnr, short winnr)
return dict;
}
#endif
/*
* "getwininfo()" function
@@ -5263,17 +5263,14 @@ get_win_info(win_T *wp, short tpnr, short winnr)
static void
f_getwininfo(typval_T *argvars, typval_T *rettv)
{
#ifdef FEAT_WINDOWS
tabpage_T *tp;
win_T *wp = NULL, *wparg = NULL;
dict_T *d;
short tabnr = 0, winnr;
#endif
if (rettv_list_alloc(rettv) != OK)
return;
#ifdef FEAT_WINDOWS
if (argvars[0].v_type != VAR_UNKNOWN)
{
wparg = win_id2wp(argvars);
@@ -5301,7 +5298,6 @@ f_getwininfo(typval_T *argvars, typval_T *rettv)
return;
}
}
#endif
}
/*
@@ -5983,9 +5979,7 @@ f_has(typval_T *argvars, typval_T *rettv)
#ifdef FEAT_VIMINFO
"viminfo",
#endif
#ifdef FEAT_WINDOWS
"vertsplit",
#endif
#ifdef FEAT_VIRTUALEDIT
"virtualedit",
#endif
@@ -6002,9 +5996,7 @@ f_has(typval_T *argvars, typval_T *rettv)
#ifdef FEAT_WILDMENU
"wildmenu",
#endif
#ifdef FEAT_WINDOWS
"windows",
#endif
#ifdef FEAT_WAK
"winaltkeys",
#endif
@@ -10539,10 +10531,8 @@ free_lstval:
static void
f_settabvar(typval_T *argvars, typval_T *rettv)
{
#ifdef FEAT_WINDOWS
tabpage_T *save_curtab;
tabpage_T *tp;
#endif
char_u *varname, *tabvarname;
typval_T *varp;
@@ -10551,22 +10541,14 @@ f_settabvar(typval_T *argvars, typval_T *rettv)
if (check_restricted() || check_secure())
return;
#ifdef FEAT_WINDOWS
tp = find_tabpage((int)get_tv_number_chk(&argvars[0], NULL));
#endif
varname = get_tv_string_chk(&argvars[1]);
varp = &argvars[2];
if (varname != NULL && varp != NULL
#ifdef FEAT_WINDOWS
&& tp != NULL
#endif
)
if (varname != NULL && varp != NULL && tp != NULL)
{
#ifdef FEAT_WINDOWS
save_curtab = curtab;
goto_tabpage_tp(tp, FALSE, FALSE);
#endif
tabvarname = alloc((unsigned)STRLEN(varname) + 3);
if (tabvarname != NULL)
@@ -10577,11 +10559,9 @@ f_settabvar(typval_T *argvars, typval_T *rettv)
vim_free(tabvarname);
}
#ifdef FEAT_WINDOWS
/* Restore current tabpage */
if (valid_tabpage(save_curtab))
goto_tabpage_tp(save_curtab, FALSE, FALSE);
#endif
}
}
@@ -12287,7 +12267,6 @@ f_systemlist(typval_T *argvars, typval_T *rettv)
static void
f_tabpagebuflist(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
{
#ifdef FEAT_WINDOWS
tabpage_T *tp;
win_T *wp = NULL;
@@ -12306,7 +12285,6 @@ f_tabpagebuflist(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
wp->w_buffer->b_fnum) == FAIL)
break;
}
#endif
}
@@ -12317,7 +12295,6 @@ f_tabpagebuflist(typval_T *argvars UNUSED, typval_T *rettv UNUSED)
f_tabpagenr(typval_T *argvars UNUSED, typval_T *rettv)
{
int nr = 1;
#ifdef FEAT_WINDOWS
char_u *arg;
if (argvars[0].v_type != VAR_UNKNOWN)
@@ -12334,12 +12311,10 @@ f_tabpagenr(typval_T *argvars UNUSED, typval_T *rettv)
}
else
nr = tabpage_index(curtab);
#endif
rettv->vval.v_number = nr;
}
#ifdef FEAT_WINDOWS
static int get_winnr(tabpage_T *tp, typval_T *argvar);
/*
@@ -12388,7 +12363,6 @@ get_winnr(tabpage_T *tp, typval_T *argvar)
}
return nr;
}
#endif
/*
* "tabpagewinnr()" function
@@ -12397,7 +12371,6 @@ get_winnr(tabpage_T *tp, typval_T *argvar)
f_tabpagewinnr(typval_T *argvars UNUSED, typval_T *rettv)
{
int nr = 1;
#ifdef FEAT_WINDOWS
tabpage_T *tp;
tp = find_tabpage((int)get_tv_number(&argvars[0]));
@@ -12405,7 +12378,6 @@ f_tabpagewinnr(typval_T *argvars UNUSED, typval_T *rettv)
nr = 0;
else
nr = get_winnr(tp, &argvars[1]);
#endif
rettv->vval.v_number = nr;
}
@@ -13224,9 +13196,7 @@ f_winnr(typval_T *argvars UNUSED, typval_T *rettv)
{
int nr = 1;
#ifdef FEAT_WINDOWS
nr = get_winnr(curtab, &argvars[0]);
#endif
rettv->vval.v_number = nr;
}
@@ -13236,7 +13206,6 @@ f_winnr(typval_T *argvars UNUSED, typval_T *rettv)
static void
f_winrestcmd(typval_T *argvars UNUSED, typval_T *rettv)
{
#ifdef FEAT_WINDOWS
win_T *wp;
int winnr = 1;
garray_T ga;
@@ -13254,9 +13223,6 @@ f_winrestcmd(typval_T *argvars UNUSED, typval_T *rettv)
ga_append(&ga, NUL);
rettv->vval.v_string = ga.ga_data;
#else
rettv->vval.v_string = NULL;
#endif
rettv->v_type = VAR_STRING;
}
@@ -13300,9 +13266,7 @@ f_winrestview(typval_T *argvars, typval_T *rettv UNUSED)
check_cursor();
win_new_height(curwin, curwin->w_height);
# ifdef FEAT_WINDOWS
win_new_width(curwin, W_WIDTH(curwin));
# endif
changed_window_setting();
if (curwin->w_topline <= 0)
@@ -13355,11 +13319,7 @@ f_winwidth(typval_T *argvars, typval_T *rettv)
if (wp == NULL)
rettv->vval.v_number = -1;
else
#ifdef FEAT_WINDOWS
rettv->vval.v_number = wp->w_width;
#else
rettv->vval.v_number = Columns;
#endif
}
/*
+8 -8
View File
@@ -25,12 +25,12 @@ static const unsigned short cmdidxs1[26] =
/* r */ 353,
/* s */ 372,
/* t */ 439,
/* u */ 475,
/* v */ 486,
/* w */ 504,
/* x */ 519,
/* y */ 528,
/* z */ 529
/* u */ 479,
/* v */ 490,
/* w */ 508,
/* x */ 523,
/* y */ 532,
/* z */ 533
};
/*
@@ -60,7 +60,7 @@ static const unsigned char cmdidxs2[26][26] =
/* q */ { 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
/* r */ { 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, 18, 0, 0, 0, 0 },
/* s */ { 2, 6, 15, 0, 18, 22, 0, 24, 25, 0, 0, 28, 30, 34, 38, 40, 0, 48, 0, 49, 0, 61, 62, 0, 63, 0 },
/* t */ { 2, 0, 19, 0, 22, 24, 0, 25, 0, 26, 0, 27, 28, 29, 30, 31, 0, 32, 34, 0, 35, 0, 0, 0, 0, 0 },
/* t */ { 2, 0, 19, 0, 22, 24, 0, 25, 0, 26, 0, 27, 28, 31, 33, 34, 0, 35, 37, 0, 38, 0, 0, 0, 0, 0 },
/* u */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
/* v */ { 0, 0, 0, 0, 1, 0, 0, 0, 4, 0, 0, 0, 9, 12, 0, 0, 0, 0, 15, 0, 16, 0, 0, 0, 0, 0 },
/* w */ { 2, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 8, 0, 9, 10, 0, 12, 0, 13, 14, 0, 0, 0, 0 },
@@ -69,4 +69,4 @@ static const unsigned char cmdidxs2[26][26] =
/* z */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
};
static const int command_count = 542;
static const int command_count = 546;
+3 -49
View File
@@ -3225,9 +3225,7 @@ do_write(exarg_T *eap)
if (retval == OK)
{
curbuf->b_p_ro = FALSE;
#ifdef FEAT_WINDOWS
redraw_tabline = TRUE;
#endif
}
}
@@ -4153,7 +4151,6 @@ do_ecmd(
#ifdef FEAT_FOLDING
/* It's possible that all lines in the buffer changed. Need to update
* automatic folding for all windows where it's used. */
# ifdef FEAT_WINDOWS
{
win_T *win;
tabpage_T *tp;
@@ -4162,9 +4159,6 @@ do_ecmd(
if (win->w_buffer == curbuf)
foldUpdateAll(win);
}
# else
foldUpdateAll(curwin);
# endif
#endif
/* Change directories when the 'acd' option is set. */
@@ -4284,10 +4278,8 @@ do_ecmd(
}
}
#ifdef FEAT_WINDOWS
/* Check if cursors in other windows on the same buffer are still valid */
check_lnums(FALSE);
#endif
/*
* Did not read the file, need to show some info about the file.
@@ -4583,10 +4575,8 @@ ex_z(exarg_T *eap)
* 'scroll' */
if (eap->forceit)
bigness = curwin->w_height;
#ifdef FEAT_WINDOWS
else if (!ONE_WINDOW)
bigness = curwin->w_height - 3;
#endif
else
bigness = curwin->w_p_scr * 2;
if (bigness < 1)
@@ -6152,7 +6142,7 @@ free_old_sub(void)
}
#endif
#if (defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)) || defined(PROTO)
#if defined(FEAT_QUICKFIX) || defined(PROTO)
/*
* Set up for a tagpreview.
* Return TRUE when it was created.
@@ -6215,9 +6205,7 @@ ex_help(exarg_T *eap)
FILE *helpfd; /* file descriptor of help file */
int n;
int i;
#ifdef FEAT_WINDOWS
win_T *wp;
#endif
int num_matches;
char_u **matches;
char_u *p;
@@ -6319,13 +6307,8 @@ ex_help(exarg_T *eap)
* Re-use an existing help window or open a new one.
* Always open a new one for ":tab help".
*/
if (!bt_help(curwin->w_buffer)
#ifdef FEAT_WINDOWS
|| cmdmod.tab != 0
#endif
)
if (!bt_help(curwin->w_buffer) || cmdmod.tab != 0)
{
#ifdef FEAT_WINDOWS
if (cmdmod.tab != 0)
wp = NULL;
else
@@ -6335,7 +6318,6 @@ ex_help(exarg_T *eap)
if (wp != NULL && wp->w_buffer->b_nwindows > 0)
win_enter(wp, TRUE);
else
#endif
{
/*
* There is no help window yet.
@@ -6348,7 +6330,6 @@ ex_help(exarg_T *eap)
}
fclose(helpfd);
#ifdef FEAT_WINDOWS
/* Split off help window; put it at far top if no position
* specified, the current window is vertically split and
* narrow. */
@@ -6358,16 +6339,9 @@ ex_help(exarg_T *eap)
n |= WSP_TOP;
if (win_split(0, n) == FAIL)
goto erret;
#else
/* use current window */
if (!can_abandon(curbuf, FALSE))
goto erret;
#endif
#ifdef FEAT_WINDOWS
if (curwin->w_height < p_hh)
win_setheight((int)p_hh);
#endif
/*
* Open help file (do_ecmd() will set b_help flag, readfile() will
@@ -6377,12 +6351,7 @@ ex_help(exarg_T *eap)
alt_fnum = curbuf->b_fnum;
(void)do_ecmd(0, NULL, NULL, NULL, ECMD_LASTL,
ECMD_HIDE + ECMD_SET_HELP,
#ifdef FEAT_WINDOWS
NULL /* buffer is still open, don't store info */
#else
curwin
#endif
);
NULL); /* buffer is still open, don't store info */
if (!cmdmod.keepalt)
curwin->w_alt_fnum = alt_fnum;
empty_fnum = curbuf->b_fnum;
@@ -6425,7 +6394,6 @@ erret:
void
ex_helpclose(exarg_T *eap UNUSED)
{
#if defined(FEAT_WINDOWS)
win_T *win;
FOR_ALL_WINDOWS(win)
@@ -6436,7 +6404,6 @@ ex_helpclose(exarg_T *eap UNUSED)
return;
}
}
#endif
}
#if defined(FEAT_MULTI_LANG) || defined(PROTO)
@@ -8350,9 +8317,7 @@ ex_drop(exarg_T *eap)
int split = FALSE;
win_T *wp;
buf_T *buf;
# ifdef FEAT_WINDOWS
tabpage_T *tp;
# endif
/*
* Check if the first argument is already being edited in a window. If
@@ -8372,7 +8337,6 @@ ex_drop(exarg_T *eap)
if (ARGCOUNT == 0)
return;
# ifdef FEAT_WINDOWS
if (cmdmod.tab)
{
/* ":tab drop file ...": open a tab for each argument that isn't
@@ -8381,7 +8345,6 @@ ex_drop(exarg_T *eap)
ex_all(eap);
}
else
# endif
{
/* ":drop file ...": Edit the first argument. Jump to an existing
* window if possible, edit in current window if the current buffer
@@ -8392,9 +8355,7 @@ ex_drop(exarg_T *eap)
{
if (wp->w_buffer == buf)
{
# ifdef FEAT_WINDOWS
goto_tabpage_win(tp, wp);
# endif
curwin->w_arg_idx = 0;
return;
}
@@ -8408,16 +8369,9 @@ ex_drop(exarg_T *eap)
*/
if (!buf_hide(curbuf))
{
# ifdef FEAT_WINDOWS
++emsg_off;
# endif
split = check_changed(curbuf, CCGD_AW | CCGD_EXCMD);
# ifdef FEAT_WINDOWS
--emsg_off;
# else
if (split)
return;
# endif
}
/* Fake a ":sfirst" or ":first" command edit the first argument. */
+13 -1
View File
@@ -1490,7 +1490,7 @@ EX(CMD_tearoff, "tearoff", ex_tearoff,
NEEDARG|EXTRA|TRLBAR|NOTRLCOM|CMDWIN,
ADDR_LINES),
EX(CMD_terminal, "terminal", ex_terminal,
RANGE|BANG|FILES|TRLBAR|CMDWIN,
RANGE|BANG|FILES|CMDWIN,
ADDR_LINES),
EX(CMD_tfirst, "tfirst", ex_tag,
RANGE|NOTADR|BANG|TRLBAR|ZEROR,
@@ -1507,9 +1507,18 @@ EX(CMD_tlast, "tlast", ex_tag,
EX(CMD_tmenu, "tmenu", ex_menu,
RANGE|NOTADR|ZEROR|EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
ADDR_LINES),
EX(CMD_tmap, "tmap", ex_map,
EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
ADDR_LINES),
EX(CMD_tmapclear, "tmapclear", ex_mapclear,
EXTRA|TRLBAR|CMDWIN,
ADDR_LINES),
EX(CMD_tnext, "tnext", ex_tag,
RANGE|NOTADR|BANG|TRLBAR|ZEROR,
ADDR_LINES),
EX(CMD_tnoremap, "tnoremap", ex_map,
EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
ADDR_LINES),
EX(CMD_topleft, "topleft", ex_wrongmodifier,
NEEDARG|EXTRA|NOTRLCOM,
ADDR_LINES),
@@ -1528,6 +1537,9 @@ EX(CMD_tselect, "tselect", ex_tag,
EX(CMD_tunmenu, "tunmenu", ex_menu,
EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
ADDR_LINES),
EX(CMD_tunmap, "tunmap", ex_unmap,
EXTRA|TRLBAR|NOTRLCOM|USECTRLV|CMDWIN,
ADDR_LINES),
EX(CMD_undo, "undo", ex_undo,
RANGE|NOTADR|COUNT|ZEROR|TRLBAR|CMDWIN,
ADDR_LINES),
+32 -72
View File
@@ -1090,15 +1090,24 @@ profile_zero(proftime_T *tm)
static timer_T *first_timer = NULL;
static long last_timer_id = 0;
# ifdef WIN3264
# define GET_TIMEDIFF(timer, now) \
(long)(((double)(timer->tr_due.QuadPart - now.QuadPart) \
/ (double)fr.QuadPart) * 1000)
# else
# define GET_TIMEDIFF(timer, now) \
(timer->tr_due.tv_sec - now.tv_sec) * 1000 \
+ (timer->tr_due.tv_usec - now.tv_usec) / 1000
# endif
static long
timer_time_left(timer_T *timer, proftime_T *now)
{
# ifdef WIN3264
LARGE_INTEGER fr;
if (now->QuadPart > timer->tr_due.QuadPart)
return 0;
QueryPerformanceFrequency(&fr);
return (long)(((double)(timer->tr_due.QuadPart - now->QuadPart)
/ (double)fr.QuadPart) * 1000);
# else
if (now->tv_sec > timer->tr_due.tv_sec)
return 0;
return (timer->tr_due.tv_sec - now->tv_sec) * 1000
+ (timer->tr_due.tv_usec - now->tv_usec) / 1000;
# endif
}
/*
* Insert a timer in the list of timers.
@@ -1196,17 +1205,11 @@ check_due_timer(void)
int did_one = FALSE;
int need_update_screen = FALSE;
long current_id = last_timer_id;
# ifdef WIN3264
LARGE_INTEGER fr;
# endif
/* Don't run any timers while exiting or dealing with an error. */
if (exiting || aborting())
return next_due;
# ifdef WIN3264
QueryPerformanceFrequency(&fr);
# endif
profile_start(&now);
for (timer = first_timer; timer != NULL && !got_int; timer = timer_next)
{
@@ -1214,7 +1217,7 @@ check_due_timer(void)
if (timer->tr_id == -1 || timer->tr_firing || timer->tr_paused)
continue;
this_due = GET_TIMEDIFF(timer, now);
this_due = timer_time_left(timer, &now);
if (this_due <= 1)
{
int save_timer_busy = timer_busy;
@@ -1224,6 +1227,7 @@ check_due_timer(void)
int save_must_redraw = must_redraw;
int save_trylevel = trylevel;
int save_did_throw = did_throw;
int save_ex_pressedreturn = get_pressedreturn();
except_T *save_current_exception = current_exception;
/* Create a scope for running the timer callback, ignoring most of
@@ -1257,6 +1261,7 @@ check_due_timer(void)
need_update_screen = TRUE;
must_redraw = must_redraw > save_must_redraw
? must_redraw : save_must_redraw;
set_pressedreturn(save_ex_pressedreturn);
/* Only fire the timer again if it repeats and stop_timer() wasn't
* called while inside the callback (tr_id == -1). */
@@ -1264,7 +1269,7 @@ check_due_timer(void)
&& timer->tr_emsg_count < 3)
{
profile_setlimit(timer->tr_interval, &timer->tr_due);
this_due = GET_TIMEDIFF(timer, now);
this_due = timer_time_left(timer, &now);
if (this_due < 1)
this_due = 1;
if (timer->tr_repeat > 0)
@@ -1342,9 +1347,6 @@ add_timer_info(typval_T *rettv, timer_T *timer)
dictitem_T *di;
long remaining;
proftime_T now;
# ifdef WIN3264
LARGE_INTEGER fr;
#endif
if (dict == NULL)
return;
@@ -1354,10 +1356,7 @@ add_timer_info(typval_T *rettv, timer_T *timer)
dict_add_nr_str(dict, "time", (long)timer->tr_interval, NULL);
profile_start(&now);
# ifdef WIN3264
QueryPerformanceFrequency(&fr);
# endif
remaining = GET_TIMEDIFF(timer, now);
remaining = timer_time_left(timer, &now);
dict_add_nr_str(dict, "remaining", (long)remaining, NULL);
dict_add_nr_str(dict, "repeat",
@@ -2194,10 +2193,8 @@ check_changed_any(
int bufnum = 0;
int bufcount = 0;
int *bufnrs;
#ifdef FEAT_WINDOWS
tabpage_T *tp;
win_T *wp;
#endif
FOR_ALL_BUFFERS(buf)
++bufcount;
@@ -2211,7 +2208,6 @@ check_changed_any(
/* curbuf */
bufnrs[bufnum++] = curbuf->b_fnum;
#ifdef FEAT_WINDOWS
/* buf in curtab */
FOR_ALL_WINDOWS(wp)
if (wp->w_buffer != curbuf)
@@ -2222,7 +2218,6 @@ check_changed_any(
if (tp != curtab)
for (wp = tp->tp_firstwin; wp != NULL; wp = wp->w_next)
add_bufnum(bufnrs, &bufnum, wp->w_buffer->b_fnum);
#endif
/* any other buf */
FOR_ALL_BUFFERS(buf)
add_bufnum(bufnrs, &bufnum, buf->b_fnum);
@@ -2285,29 +2280,27 @@ check_changed_any(
}
}
#ifdef FEAT_WINDOWS
/* Try to find a window that contains the buffer. */
if (buf != curbuf)
FOR_ALL_TAB_WINDOWS(tp, wp)
if (wp->w_buffer == buf)
{
# ifdef FEAT_AUTOCMD
#ifdef FEAT_AUTOCMD
bufref_T bufref;
set_bufref(&bufref, buf);
# endif
#endif
goto_tabpage_win(tp, wp);
# ifdef FEAT_AUTOCMD
#ifdef FEAT_AUTOCMD
/* Paranoia: did autocms wipe out the buffer with changes? */
if (!bufref_valid(&bufref))
{
goto theend;
}
# endif
#endif
goto buf_found;
}
buf_found:
#endif
/* Open the changed buffer in the current window. */
if (buf != curbuf)
@@ -2599,16 +2592,12 @@ do_arglist(
static void
alist_check_arg_idx(void)
{
#ifdef FEAT_WINDOWS
win_T *win;
tabpage_T *tp;
FOR_ALL_TAB_WINDOWS(tp, win)
if (win->w_alist == curwin->w_alist)
check_arg_idx(win);
#else
check_arg_idx(curwin);
#endif
}
/*
@@ -2640,9 +2629,7 @@ check_arg_idx(win_T *win)
win->w_arg_idx_invalid = TRUE;
if (win->w_arg_idx != WARGCOUNT(win) - 1
&& arg_had_last == FALSE
#ifdef FEAT_WINDOWS
&& ALIST(win) == &global_alist
#endif
&& GARGCOUNT > 0
&& win->w_arg_idx < GARGCOUNT
&& (win->w_buffer->b_fnum == GARGLIST[GARGCOUNT - 1].ae_fnum
@@ -2657,10 +2644,7 @@ check_arg_idx(win_T *win)
* Set "arg_had_last" if it's also the last one */
win->w_arg_idx_invalid = FALSE;
if (win->w_arg_idx == WARGCOUNT(win) - 1
#ifdef FEAT_WINDOWS
&& win->w_alist == &global_alist
#endif
)
&& win->w_alist == &global_alist)
arg_had_last = TRUE;
}
}
@@ -2675,7 +2659,7 @@ ex_args(exarg_T *eap)
if (eap->cmdidx != CMD_args)
{
#if defined(FEAT_WINDOWS) && defined(FEAT_LISTCMDS)
#if defined(FEAT_LISTCMDS)
alist_unlink(ALIST(curwin));
if (eap->cmdidx == CMD_argglobal)
ALIST(curwin) = &global_alist;
@@ -2696,7 +2680,7 @@ ex_args(exarg_T *eap)
ex_next(eap);
}
else
#if defined(FEAT_WINDOWS) && defined(FEAT_LISTCMDS)
#if defined(FEAT_LISTCMDS)
if (eap->cmdidx == CMD_args)
#endif
{
@@ -2719,7 +2703,7 @@ ex_args(exarg_T *eap)
}
}
}
#if defined(FEAT_WINDOWS) && defined(FEAT_LISTCMDS)
#if defined(FEAT_LISTCMDS)
else if (eap->cmdidx == CMD_arglocal)
{
garray_T *gap = &curwin->w_alist->al_ga;
@@ -2813,7 +2797,6 @@ do_argfile(exarg_T *eap, int argn)
need_mouse_correct = TRUE;
#endif
#ifdef FEAT_WINDOWS
/* split window or create new tab page first */
if (*eap->cmd == 's' || cmdmod.tab != 0)
{
@@ -2822,7 +2805,6 @@ do_argfile(exarg_T *eap, int argn)
RESET_BINDING(curwin);
}
else
#endif
{
/*
* if 'hidden' set, only check for changed file when re-editing
@@ -2844,11 +2826,7 @@ do_argfile(exarg_T *eap, int argn)
}
curwin->w_arg_idx = argn;
if (argn == ARGCOUNT - 1
#ifdef FEAT_WINDOWS
&& curwin->w_alist == &global_alist
#endif
)
if (argn == ARGCOUNT - 1 && curwin->w_alist == &global_alist)
arg_had_last = TRUE;
/* Edit the file; always use the last known line number.
@@ -2988,10 +2966,8 @@ ex_argdelete(exarg_T *eap)
ex_listdo(exarg_T *eap)
{
int i;
#ifdef FEAT_WINDOWS
win_T *wp;
tabpage_T *tp;
#endif
buf_T *buf = curbuf;
int next_fnum = 0;
#if defined(FEAT_AUTOCMD) && defined(FEAT_SYN_HL)
@@ -3003,14 +2979,6 @@ ex_listdo(exarg_T *eap)
int qf_idx;
#endif
#ifndef FEAT_WINDOWS
if (eap->cmdidx == CMD_windo)
{
ex_ni(eap);
return;
}
#endif
#ifndef FEAT_QUICKFIX
if (eap->cmdidx == CMD_cdo || eap->cmdidx == CMD_ldo ||
eap->cmdidx == CMD_cfdo || eap->cmdidx == CMD_lfdo)
@@ -3039,13 +3007,10 @@ ex_listdo(exarg_T *eap)
{
i = 0;
/* start at the eap->line1 argument/window/buffer */
#ifdef FEAT_WINDOWS
wp = firstwin;
tp = first_tabpage;
#endif
switch (eap->cmdidx)
{
#ifdef FEAT_WINDOWS
case CMD_windo:
for ( ; wp != NULL && i + 1 < eap->line1; wp = wp->w_next)
i++;
@@ -3054,7 +3019,6 @@ ex_listdo(exarg_T *eap)
for( ; tp != NULL && i + 1 < eap->line1; tp = tp->tp_next)
i++;
break;
#endif
case CMD_argdo:
i = eap->line1 - 1;
break;
@@ -3120,7 +3084,6 @@ ex_listdo(exarg_T *eap)
if (curwin->w_arg_idx != i)
break;
}
#ifdef FEAT_WINDOWS
else if (eap->cmdidx == CMD_windo)
{
/* go to window "wp" */
@@ -3139,7 +3102,6 @@ ex_listdo(exarg_T *eap)
goto_tabpage_tp(tp, TRUE, TRUE);
tp = tp->tp_next;
}
#endif
else if (eap->cmdidx == CMD_bufdo)
{
/* Remember the number of the next listed buffer, in case
@@ -3211,11 +3173,9 @@ ex_listdo(exarg_T *eap)
#endif
}
#ifdef FEAT_WINDOWS
if (eap->cmdidx == CMD_windo || eap->cmdidx == CMD_tabdo)
if (i+1 > eap->line2)
break;
#endif
if (eap->cmdidx == CMD_argdo && i >= eap->line2)
break;
}
+62 -155
View File
@@ -108,7 +108,7 @@ static void ex_blast(exarg_T *eap);
# define buflist_list ex_ni
# define ex_checktime ex_ni
#endif
#if !defined(FEAT_LISTCMDS) || !defined(FEAT_WINDOWS)
#if !defined(FEAT_LISTCMDS)
# define ex_buffer_all ex_ni
#endif
static char_u *getargcmd(char_u **);
@@ -126,7 +126,7 @@ static int getargopt(exarg_T *eap);
# define ex_helpgrep ex_ni
# define ex_vimgrep ex_ni
#endif
#if !defined(FEAT_QUICKFIX) || !defined(FEAT_WINDOWS)
#if !defined(FEAT_QUICKFIX)
# define ex_cclose ex_ni
# define ex_copen ex_ni
# define ex_cwindow ex_ni
@@ -159,7 +159,6 @@ static void ex_colorscheme(exarg_T *eap);
static void ex_quit(exarg_T *eap);
static void ex_cquit(exarg_T *eap);
static void ex_quit_all(exarg_T *eap);
#ifdef FEAT_WINDOWS
static void ex_close(exarg_T *eap);
static void ex_win_close(int forceit, win_T *win, tabpage_T *tp);
static void ex_only(exarg_T *eap);
@@ -170,20 +169,7 @@ static void ex_tabonly(exarg_T *eap);
static void ex_tabnext(exarg_T *eap);
static void ex_tabmove(exarg_T *eap);
static void ex_tabs(exarg_T *eap);
#else
# define ex_close ex_ni
# define ex_only ex_ni
# define ex_all ex_ni
# define ex_resize ex_ni
# define ex_splitview ex_ni
# define ex_stag ex_ni
# define ex_tabnext ex_ni
# define ex_tabmove ex_ni
# define ex_tabs ex_ni
# define ex_tabclose ex_ni
# define ex_tabonly ex_ni
#endif
#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
#if defined(FEAT_QUICKFIX)
static void ex_pclose(exarg_T *eap);
static void ex_ptag(exarg_T *eap);
static void ex_pedit(exarg_T *eap);
@@ -316,11 +302,7 @@ static void ex_equal(exarg_T *eap);
static void ex_sleep(exarg_T *eap);
static void do_exmap(exarg_T *eap, int isabbrev);
static void ex_winsize(exarg_T *eap);
#ifdef FEAT_WINDOWS
static void ex_wincmd(exarg_T *eap);
#else
# define ex_wincmd ex_ni
#endif
#if defined(FEAT_GUI) || defined(UNIX) || defined(VMS) || defined(MSWIN)
static void ex_winpos(exarg_T *eap);
#else
@@ -358,7 +340,7 @@ static void ex_findpat(exarg_T *eap);
# define ex_findpat ex_ni
# define ex_checkpath ex_ni
#endif
#if defined(FEAT_FIND_ID) && defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
#if defined(FEAT_FIND_ID) && defined(FEAT_QUICKFIX)
static void ex_psearch(exarg_T *eap);
#else
# define ex_psearch ex_ni
@@ -1682,7 +1664,6 @@ compute_buffer_local_count(int addr_type, int lnum, int offset)
return buf->b_fnum;
}
#ifdef FEAT_WINDOWS
static int current_win_nr(win_T *win);
static int current_tab_nr(tabpage_T *tab);
@@ -1720,13 +1701,6 @@ current_tab_nr(tabpage_T *tab)
# define LAST_WIN_NR current_win_nr(NULL)
# define CURRENT_TAB_NR current_tab_nr(curtab)
# define LAST_TAB_NR current_tab_nr(NULL)
#else
# define CURRENT_WIN_NR 1
# define LAST_WIN_NR 1
# define CURRENT_TAB_NR 1
# define LAST_TAB_NR 1
#endif
/*
* Execute one Ex command.
@@ -1850,16 +1824,12 @@ do_one_cmd(
/* When adding an entry, also modify cmd_exists(). */
case 'a': if (!checkforcmd(&ea.cmd, "aboveleft", 3))
break;
#ifdef FEAT_WINDOWS
cmdmod.split |= WSP_ABOVE;
#endif
continue;
case 'b': if (checkforcmd(&ea.cmd, "belowright", 3))
{
#ifdef FEAT_WINDOWS
cmdmod.split |= WSP_BELOW;
#endif
continue;
}
if (checkforcmd(&ea.cmd, "browse", 3))
@@ -1871,9 +1841,7 @@ do_one_cmd(
}
if (!checkforcmd(&ea.cmd, "botright", 2))
break;
#ifdef FEAT_WINDOWS
cmdmod.split |= WSP_BOT;
#endif
continue;
case 'c': if (!checkforcmd(&ea.cmd, "confirm", 4))
@@ -1944,9 +1912,7 @@ do_one_cmd(
if (!checkforcmd(&ea.cmd, "leftabove", 5))
break;
#ifdef FEAT_WINDOWS
cmdmod.split |= WSP_ABOVE;
#endif
continue;
case 'n': if (checkforcmd(&ea.cmd, "noautocmd", 3))
@@ -1970,9 +1936,7 @@ do_one_cmd(
case 'r': if (!checkforcmd(&ea.cmd, "rightbelow", 6))
break;
#ifdef FEAT_WINDOWS
cmdmod.split |= WSP_BELOW;
#endif
continue;
case 's': if (checkforcmd(&ea.cmd, "sandbox", 3))
@@ -2000,7 +1964,6 @@ do_one_cmd(
case 't': if (checkforcmd(&p, "tab", 3))
{
#ifdef FEAT_WINDOWS
long tabnr = get_address(&ea, &ea.cmd, ADDR_TABS,
ea.skip, FALSE, 1);
if (tabnr == MAXLNUM)
@@ -2015,14 +1978,11 @@ do_one_cmd(
cmdmod.tab = tabnr + 1;
}
ea.cmd = p;
#endif
continue;
}
if (!checkforcmd(&ea.cmd, "topleft", 2))
break;
#ifdef FEAT_WINDOWS
cmdmod.split |= WSP_TOP;
#endif
continue;
case 'u': if (!checkforcmd(&ea.cmd, "unsilent", 3))
@@ -2034,9 +1994,7 @@ do_one_cmd(
case 'v': if (checkforcmd(&ea.cmd, "vertical", 4))
{
#ifdef FEAT_WINDOWS
cmdmod.split |= WSP_VERT;
#endif
continue;
}
if (!checkforcmd(&p, "verbose", 4))
@@ -2119,11 +2077,9 @@ do_one_cmd(
else
ea.addr_type = ADDR_LINES;
#ifdef FEAT_WINDOWS
/* :wincmd range depends on the argument. */
if (ea.cmdidx == CMD_wincmd && p != NULL)
get_wincmd_addr_type(skipwhite(p), &ea);
#endif
}
/* repeat for all ',' or ';' separated addresses */
@@ -4216,6 +4172,7 @@ set_one_cmd_context(
case CMD_cmap: case CMD_cnoremap:
case CMD_lmap: case CMD_lnoremap:
case CMD_smap: case CMD_snoremap:
case CMD_tmap: case CMD_tnoremap:
case CMD_xmap: case CMD_xnoremap:
return set_context_in_map_cmd(xp, cmd, arg, forceit,
FALSE, FALSE, ea.cmdidx);
@@ -4227,6 +4184,7 @@ set_one_cmd_context(
case CMD_cunmap:
case CMD_lunmap:
case CMD_sunmap:
case CMD_tunmap:
case CMD_xunmap:
return set_context_in_map_cmd(xp, cmd, arg, forceit,
FALSE, TRUE, ea.cmdidx);
@@ -4238,6 +4196,7 @@ set_one_cmd_context(
case CMD_cmapclear:
case CMD_lmapclear:
case CMD_smapclear:
case CMD_tmapclear:
case CMD_xmapclear:
xp->xp_context = EXPAND_MAPCLEAR;
xp->xp_pattern = arg;
@@ -6809,7 +6768,6 @@ uc_check_code(
*buf = '\0';
}
#ifdef FEAT_WINDOWS
/* :aboveleft and :leftabove */
if (cmdmod.split & WSP_ABOVE)
result += add_cmd_modifier(buf, "aboveleft", &multi_mods);
@@ -6819,7 +6777,6 @@ uc_check_code(
/* :botright */
if (cmdmod.split & WSP_BOT)
result += add_cmd_modifier(buf, "botright", &multi_mods);
#endif
/* the modifiers that are simple flags */
for (i = 0; mod_entries[i].varp != NULL; ++i)
@@ -6835,23 +6792,19 @@ uc_check_code(
if (msg_silent > 0)
result += add_cmd_modifier(buf,
emsg_silent > 0 ? "silent!" : "silent", &multi_mods);
#ifdef FEAT_WINDOWS
/* :tab */
if (cmdmod.tab > 0)
result += add_cmd_modifier(buf, "tab", &multi_mods);
/* :topleft */
if (cmdmod.split & WSP_TOP)
result += add_cmd_modifier(buf, "topleft", &multi_mods);
#endif
/* TODO: How to support :unsilent?*/
/* :verbose */
if (p_verbose > 0)
result += add_cmd_modifier(buf, "verbose", &multi_mods);
#ifdef FEAT_WINDOWS
/* :vertical */
if (cmdmod.split & WSP_VERT)
result += add_cmd_modifier(buf, "vertical", &multi_mods);
#endif
if (quote && buf != NULL)
{
buf += result - 2;
@@ -7284,9 +7237,7 @@ not_exiting(void)
static void
ex_quit(exarg_T *eap)
{
#if defined(FEAT_WINDOWS) || defined(FEAT_AUTOCMD)
win_T *wp;
#endif
#ifdef FEAT_CMDWIN
if (cmdwin_type != 0)
@@ -7301,7 +7252,6 @@ ex_quit(exarg_T *eap)
text_locked_msg();
return;
}
#ifdef FEAT_WINDOWS
if (eap->addr_count > 0)
{
int wnr = eap->line2;
@@ -7311,19 +7261,13 @@ ex_quit(exarg_T *eap)
break;
}
else
#endif
#if defined(FEAT_WINDOWS) || defined(FEAT_AUTOCMD)
wp = curwin;
#endif
#ifdef FEAT_AUTOCMD
apply_autocmds(EVENT_QUITPRE, NULL, NULL, FALSE, curbuf);
/* Refuse to quit when locked or when the buffer in the last window is
* being closed (can only happen in autocommands). */
if (curbuf_locked()
# ifdef FEAT_WINDOWS
|| !win_valid(wp)
# endif
if (curbuf_locked() || !win_valid(wp)
|| (wp->w_buffer->b_nwindows == 1 && wp->w_buffer->b_locked > 0))
return;
#endif
@@ -7348,7 +7292,6 @@ ex_quit(exarg_T *eap)
}
else
{
#ifdef FEAT_WINDOWS
/* quit last window
* Note: only_one_window() returns true, even so a help window is
* still open. In that case only quit, if no address has been
@@ -7357,15 +7300,12 @@ ex_quit(exarg_T *eap)
* :h|wincmd w|q - quit
*/
if (only_one_window() && (ONE_WINDOW || eap->addr_count == 0))
#endif
getout(0);
#ifdef FEAT_WINDOWS
# ifdef FEAT_GUI
#ifdef FEAT_GUI
need_mouse_correct = TRUE;
# endif
#endif
/* close window; may free buffer */
win_close(wp, !buf_hide(wp->w_buffer) || eap->forceit);
#endif
}
}
@@ -7416,7 +7356,6 @@ ex_quit_all(exarg_T *eap)
not_exiting();
}
#if defined(FEAT_WINDOWS) || defined(PROTO)
/*
* ":close": close current window, unless it is the last one
*/
@@ -7425,11 +7364,11 @@ ex_close(exarg_T *eap)
{
win_T *win;
int winnr = 0;
# ifdef FEAT_CMDWIN
#ifdef FEAT_CMDWIN
if (cmdwin_type != 0)
cmdwin_result = Ctrl_C;
else
# endif
#endif
if (!text_locked()
#ifdef FEAT_AUTOCMD
&& !curbuf_locked()
@@ -7452,7 +7391,7 @@ ex_close(exarg_T *eap)
}
}
# ifdef FEAT_QUICKFIX
#ifdef FEAT_QUICKFIX
/*
* ":pclose": Close any preview window.
*/
@@ -7468,7 +7407,7 @@ ex_pclose(exarg_T *eap)
break;
}
}
# endif
#endif
/*
* Close window "win" and take care of handling closing the last window for a
@@ -7486,7 +7425,7 @@ ex_win_close(
need_hide = (bufIsChanged(buf) && buf->b_nwindows <= 1);
if (need_hide && !buf_hide(buf) && !forceit)
{
# if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
#if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
if ((p_confirm || cmdmod.confirm) && p_write)
{
bufref_T bufref;
@@ -7498,16 +7437,16 @@ ex_win_close(
need_hide = FALSE;
}
else
# endif
#endif
{
no_write_message();
return;
}
}
# ifdef FEAT_GUI
#ifdef FEAT_GUI
need_mouse_correct = TRUE;
# endif
#endif
/* free buffer when not hiding it or when it's a scratch buffer */
if (tp == NULL)
@@ -7793,18 +7732,16 @@ ex_all(exarg_T *eap)
eap->line2 = 9999;
do_arg_all((int)eap->line2, eap->forceit, eap->cmdidx == CMD_drop);
}
#endif /* FEAT_WINDOWS */
static void
ex_hide(exarg_T *eap UNUSED)
{
/* ":hide" or ":hide | cmd": hide current window */
#ifdef FEAT_WINDOWS
if (!eap->skip)
{
# ifdef FEAT_GUI
#ifdef FEAT_GUI
need_mouse_correct = TRUE;
# endif
#endif
if (eap->addr_count == 0)
win_close(curwin, FALSE); /* don't free buffer */
else
@@ -7823,7 +7760,6 @@ ex_hide(exarg_T *eap UNUSED)
win_close(win, FALSE);
}
}
#endif
}
/*
@@ -7901,17 +7837,13 @@ ex_exit(exarg_T *eap)
}
else
{
#ifdef FEAT_WINDOWS
if (only_one_window()) /* quit last window, exit Vim */
#endif
getout(0);
#ifdef FEAT_WINDOWS
# ifdef FEAT_GUI
need_mouse_correct = TRUE;
# endif
/* Quit current window, may free the buffer. */
win_close(curwin, !buf_hide(curwin->w_buffer));
#endif
}
}
@@ -7961,7 +7893,7 @@ ex_shell(exarg_T *eap UNUSED)
do_shell(NULL, 0);
}
#if (defined(FEAT_WINDOWS) && defined(HAVE_DROP_FILE)) \
#if defined(HAVE_DROP_FILE) \
|| (defined(FEAT_GUI_GTK) && defined(FEAT_DND)) \
|| defined(FEAT_GUI_MSWIN) \
|| defined(FEAT_GUI_MAC) \
@@ -8015,7 +7947,6 @@ handle_drop(
}
if (split)
{
# ifdef FEAT_WINDOWS
if (win_split(0, 0) == FAIL)
return;
RESET_BINDING(curwin);
@@ -8024,9 +7955,6 @@ handle_drop(
* existing one is overwritten. */
alist_unlink(curwin->w_alist);
alist_new();
# else
return; /* can't split, always fail */
# endif
}
/*
@@ -8073,8 +8001,6 @@ alist_init(alist_T *al)
ga_init2(&al->al_ga, (int)sizeof(aentry_T), 5);
}
#if defined(FEAT_WINDOWS) || defined(PROTO)
/*
* Remove a reference from an argument list.
* Ignored when the argument list is the global one.
@@ -8090,7 +8016,7 @@ alist_unlink(alist_T *al)
}
}
# if defined(FEAT_LISTCMDS) || defined(HAVE_DROP_FILE) || defined(PROTO)
#if defined(FEAT_LISTCMDS) || defined(HAVE_DROP_FILE) || defined(PROTO)
/*
* Create a new argument list and use it for the current window.
*/
@@ -8110,7 +8036,6 @@ alist_new(void)
alist_init(curwin->w_alist);
}
}
# endif
#endif
#if !defined(UNIX) || defined(PROTO)
@@ -8194,9 +8119,7 @@ alist_set(
}
else
FreeWild(count, files);
#ifdef FEAT_WINDOWS
if (al == &global_alist)
#endif
arg_had_last = FALSE;
}
@@ -8230,21 +8153,17 @@ alist_add(
alist_slash_adjust(void)
{
int i;
# ifdef FEAT_WINDOWS
win_T *wp;
tabpage_T *tp;
# endif
for (i = 0; i < GARGCOUNT; ++i)
if (GARGLIST[i].ae_fname != NULL)
slash_adjust(GARGLIST[i].ae_fname);
# ifdef FEAT_WINDOWS
FOR_ALL_TAB_WINDOWS(tp, wp)
if (wp->w_alist != &global_alist)
for (i = 0; i < WARGCOUNT(wp); ++i)
if (WARGLIST(wp)[i].ae_fname != NULL)
slash_adjust(WARGLIST(wp)[i].ae_fname);
# endif
}
#endif
@@ -8286,7 +8205,6 @@ ex_wrongmodifier(exarg_T *eap)
eap->errmsg = e_invcmd;
}
#ifdef FEAT_WINDOWS
/*
* :sview [+command] file split window with new file, read-only
* :split [[+command] file] split window with current or new file
@@ -8304,18 +8222,18 @@ ex_wrongmodifier(exarg_T *eap)
ex_splitview(exarg_T *eap)
{
win_T *old_curwin = curwin;
# if defined(FEAT_SEARCHPATH) || defined(FEAT_BROWSE)
#if defined(FEAT_SEARCHPATH) || defined(FEAT_BROWSE)
char_u *fname = NULL;
# endif
# ifdef FEAT_BROWSE
#endif
#ifdef FEAT_BROWSE
int browse_flag = cmdmod.browse;
# endif
#endif
# ifdef FEAT_GUI
#ifdef FEAT_GUI
need_mouse_correct = TRUE;
# endif
#endif
# ifdef FEAT_QUICKFIX
#ifdef FEAT_QUICKFIX
/* A ":split" in the quickfix window works like ":new". Don't want two
* quickfix windows. But it's OK when doing ":tab split". */
if (bt_quickfix(curbuf) && cmdmod.tab == 0)
@@ -8325,9 +8243,9 @@ ex_splitview(exarg_T *eap)
if (eap->cmdidx == CMD_vsplit)
eap->cmdidx = CMD_vnew;
}
# endif
#endif
# ifdef FEAT_SEARCHPATH
#ifdef FEAT_SEARCHPATH
if (eap->cmdidx == CMD_sfind || eap->cmdidx == CMD_tabfind)
{
fname = find_file_in_path(eap->arg, (int)STRLEN(eap->arg),
@@ -8336,11 +8254,11 @@ ex_splitview(exarg_T *eap)
goto theend;
eap->arg = fname;
}
# ifdef FEAT_BROWSE
else
# endif
# endif
# ifdef FEAT_BROWSE
else
# endif
#endif
#ifdef FEAT_BROWSE
if (cmdmod.browse
&& eap->cmdidx != CMD_vnew
&& eap->cmdidx != CMD_new)
@@ -8368,7 +8286,7 @@ ex_splitview(exarg_T *eap)
}
}
cmdmod.browse = FALSE; /* Don't browse again in do_ecmd(). */
# endif
#endif
/*
* Either open new tab page or split the window.
@@ -8549,8 +8467,6 @@ ex_tabs(exarg_T *eap UNUSED)
}
}
#endif /* FEAT_WINDOWS */
/*
* ":mode": Set screen mode.
* If no argument given, just get the screen size and redraw.
@@ -8564,7 +8480,6 @@ ex_mode(exarg_T *eap)
mch_screenmode(eap->arg);
}
#ifdef FEAT_WINDOWS
/*
* ":resize".
* set, increment or decrement current window height
@@ -8603,7 +8518,6 @@ ex_resize(exarg_T *eap)
win_setheight_win((int)n, wp);
}
}
#endif
/*
* ":find [+command] <file>" command.
@@ -8696,9 +8610,7 @@ do_exedit(
win_T *old_curwin) /* curwin before doing a split or NULL */
{
int n;
#ifdef FEAT_WINDOWS
int need_hide;
#endif
int exmode_was = exmode_active;
/*
@@ -8753,10 +8665,7 @@ do_exedit(
if ((eap->cmdidx == CMD_new
|| eap->cmdidx == CMD_tabnew
|| eap->cmdidx == CMD_tabedit
#ifdef FEAT_WINDOWS
|| eap->cmdidx == CMD_vnew
#endif
) && *eap->arg == NUL)
|| eap->cmdidx == CMD_vnew) && *eap->arg == NUL)
{
/* ":new" or ":tabnew" without argument: edit an new empty buffer */
setpcmark();
@@ -8764,11 +8673,7 @@ do_exedit(
ECMD_HIDE + (eap->forceit ? ECMD_FORCEIT : 0),
old_curwin == NULL ? curwin : NULL);
}
else if ((eap->cmdidx != CMD_split
#ifdef FEAT_WINDOWS
&& eap->cmdidx != CMD_vsplit
#endif
)
else if ((eap->cmdidx != CMD_split && eap->cmdidx != CMD_vsplit)
|| *eap->arg != NUL
#ifdef FEAT_BROWSE
|| cmdmod.browse
@@ -8804,33 +8709,31 @@ do_exedit(
, old_curwin == NULL ? curwin : NULL) == FAIL)
{
/* Editing the file failed. If the window was split, close it. */
#ifdef FEAT_WINDOWS
if (old_curwin != NULL)
{
need_hide = (curbufIsChanged() && curbuf->b_nwindows <= 1);
if (!need_hide || buf_hide(curbuf))
{
# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
cleanup_T cs;
/* Reset the error/interrupt/exception state here so that
* aborting() returns FALSE when closing a window. */
enter_cleanup(&cs);
# endif
# ifdef FEAT_GUI
#endif
#ifdef FEAT_GUI
need_mouse_correct = TRUE;
# endif
#endif
win_close(curwin, !need_hide && !buf_hide(curbuf));
# if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
#if defined(FEAT_AUTOCMD) && defined(FEAT_EVAL)
/* Restore the error/interrupt/exception state if not
* discarded by a new aborting error, interrupt, or
* uncaught exception. */
leave_cleanup(&cs);
# endif
#endif
}
}
#endif
}
else if (readonlymode && curbuf->b_nwindows == 1)
{
@@ -8856,7 +8759,6 @@ do_exedit(
#endif
}
#ifdef FEAT_WINDOWS
/*
* if ":split file" worked, set alternate file name in old window to new
* file
@@ -8868,7 +8770,6 @@ do_exedit(
&& old_curwin->w_buffer != curbuf
&& !cmdmod.keepalt)
old_curwin->w_alt_fnum = curbuf->b_fnum;
#endif
ex_no_reprint = TRUE;
}
@@ -8968,9 +8869,7 @@ ex_syncbind(exarg_T *eap UNUSED)
curwin->w_scbind_pos = topline;
redraw_later(VALID);
cursor_correct();
#ifdef FEAT_WINDOWS
curwin->w_redr_status = TRUE;
#endif
}
}
curwin = save_curwin;
@@ -9325,7 +9224,6 @@ ex_winsize(exarg_T *eap)
EMSG(_("E465: :winsize requires two number arguments"));
}
#ifdef FEAT_WINDOWS
static void
ex_wincmd(exarg_T *eap)
{
@@ -9360,7 +9258,6 @@ ex_wincmd(exarg_T *eap)
postponed_split_tab = 0;
}
}
#endif
#if defined(FEAT_GUI) || defined(UNIX) || defined(VMS) || defined(MSWIN)
/*
@@ -9885,7 +9782,6 @@ ex_redraw(exarg_T *eap)
static void
ex_redrawstatus(exarg_T *eap UNUSED)
{
#if defined(FEAT_WINDOWS)
int r = RedrawingDisabled;
int p = p_lz;
@@ -9899,10 +9795,9 @@ ex_redrawstatus(exarg_T *eap UNUSED)
RedrawingDisabled = r;
p_lz = p;
out_flush();
# ifdef FEAT_GUI_MACVIM
#ifdef FEAT_GUI_MACVIM
if (gui.in_use)
gui_macvim_force_flush();
# endif
#endif
}
@@ -10481,7 +10376,7 @@ ex_checkpath(exarg_T *eap)
(linenr_T)1, (linenr_T)MAXLNUM);
}
#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
#if defined(FEAT_QUICKFIX)
/*
* ":psearch"
*/
@@ -10552,9 +10447,8 @@ ex_findpat(exarg_T *eap)
}
#endif
#ifdef FEAT_WINDOWS
# ifdef FEAT_QUICKFIX
#ifdef FEAT_QUICKFIX
/*
* ":ptag", ":ptselect", ":ptjump", ":ptnext", etc.
*/
@@ -10587,7 +10481,7 @@ ex_pedit(exarg_T *eap)
}
g_do_tagpreview = 0;
}
# endif
#endif
/*
* ":stag", ":stselect" and ":stjump".
@@ -10602,7 +10496,6 @@ ex_stag(exarg_T *eap)
postponed_split_flags = 0;
postponed_split_tab = 0;
}
#endif
/*
* ":tag", ":tselect", ":tjump", ":tnext", etc.
@@ -12450,3 +12343,17 @@ ex_folddo(exarg_T *eap)
#endif
}
#endif
# if defined(FEAT_TIMERS) || defined(PROTO)
int
get_pressedreturn(void)
{
return ex_pressedreturn;
}
void
set_pressedreturn(int val)
{
ex_pressedreturn = val;
}
#endif
+1 -3
View File
@@ -1125,7 +1125,7 @@ getcmdline(
#ifdef CURSOR_SHAPE
ui_cursor_shape(); /* may show different cursor shape */
#endif
#if defined(FEAT_WINDOWS) && defined(FEAT_KEYMAP)
#if defined(FEAT_KEYMAP)
/* Show/unshow value of 'keymap' in status lines later. */
status_redraw_curbuf();
#endif
@@ -1974,11 +1974,9 @@ cmdline_changed:
end_pos = curwin->w_cursor; /* shutup gcc 4 */
validate_cursor();
# ifdef FEAT_WINDOWS
/* May redraw the status line to show the cursor position. */
if (p_ru && curwin->w_status_height > 0)
curwin->w_redr_status = TRUE;
# endif
save_cmdline(&save_ccline);
update_screen(SOME_VALID);
+9 -11
View File
@@ -94,13 +94,11 @@
*/
/*
* These features used to be optional but are now always enabled.
* +windows Multiple windows. Without this there is no help
* window and no status lines.
* +vertsplit Vertically split windows.
*/
#ifdef FEAT_SMALL
# define FEAT_WINDOWS
#endif
/*
* +listcmds Vim commands for the buffer list and the argument
@@ -134,8 +132,8 @@
# define FEAT_JUMPLIST
#endif
/* the cmdline-window requires FEAT_WINDOWS and FEAT_CMDHIST */
#if defined(FEAT_WINDOWS) && defined(FEAT_CMDHIST)
/* the cmdline-window requires FEAT_CMDHIST */
#if defined(FEAT_CMDHIST)
# define FEAT_CMDWIN
#endif
@@ -452,7 +450,7 @@
* +diff Displaying diffs in a nice way.
* Requires +windows and +autocmd.
*/
#if defined(FEAT_NORMAL) && defined(FEAT_WINDOWS) && defined(FEAT_AUTOCMD)
#if defined(FEAT_NORMAL) && defined(FEAT_AUTOCMD)
# define FEAT_DIFF
#endif
@@ -490,7 +488,7 @@
/*
* +wildmenu 'wildmenu' option
*/
#if defined(FEAT_NORMAL) && defined(FEAT_WINDOWS)
#if defined(FEAT_NORMAL)
# define FEAT_WILDMENU
#endif
@@ -595,7 +593,7 @@
* +mksession ":mksession" command.
* Requires +windows and +vertsplit.
*/
#if defined(FEAT_NORMAL) && defined(FEAT_WINDOWS)
#if defined(FEAT_NORMAL)
# define FEAT_SESSION
#endif
@@ -710,14 +708,14 @@
/*
* +scrollbind synchronization of split windows
*/
#if defined(FEAT_NORMAL) && defined(FEAT_WINDOWS)
#if defined(FEAT_NORMAL)
# define FEAT_SCROLLBIND
#endif
/*
* +cursorbind synchronization of split windows
*/
#if defined(FEAT_NORMAL) && defined(FEAT_WINDOWS)
#if defined(FEAT_NORMAL)
# define FEAT_CURSORBIND
#endif
@@ -759,7 +757,7 @@
/*
* GUI tabline
*/
#if defined(FEAT_WINDOWS) && defined(FEAT_NORMAL) \
#if defined(FEAT_NORMAL) \
&& (defined(FEAT_GUI_GTK) \
|| defined(FEAT_GUI_MACVIM) \
|| (defined(FEAT_GUI_MOTIF) && defined(HAVE_XM_NOTEBOOK_H)) \
+5 -25
View File
@@ -4174,9 +4174,7 @@ buf_write(
#ifdef FEAT_TITLE
need_maketitle = TRUE; /* set window title later */
#endif
#ifdef FEAT_WINDOWS
status_redraw_all(); /* redraw status lines later */
#endif
}
if (end > buf->b_ml.ml_line_count)
@@ -6201,10 +6199,8 @@ shorten_fnames(int force)
* also have a swap file. */
mf_fullname(buf->b_ml.ml_mfp);
}
#ifdef FEAT_WINDOWS
status_redraw_all();
redraw_tabline = TRUE;
#endif
}
#if (defined(FEAT_DND) && defined(FEAT_GUI_GTK)) \
@@ -9001,9 +8997,7 @@ aucmd_prepbuf(
buf_T *buf) /* new curbuf */
{
win_T *win;
#ifdef FEAT_WINDOWS
int save_ea;
#endif
#ifdef FEAT_AUTOCHDIR
int save_acd;
#endif
@@ -9012,13 +9006,9 @@ aucmd_prepbuf(
if (buf == curbuf) /* be quick when buf is curbuf */
win = curwin;
else
#ifdef FEAT_WINDOWS
FOR_ALL_WINDOWS(win)
if (win->w_buffer == buf)
break;
#else
win = NULL;
#endif
/* Allocate "aucmd_win" when needed. If this fails (out of memory) fall
* back to using the current window. */
@@ -9064,7 +9054,6 @@ aucmd_prepbuf(
globaldir = NULL;
#ifdef FEAT_WINDOWS
/* Split the current window, put the aucmd_win in the upper half.
* We don't want the BufEnter or WinEnter autocommands. */
block_autocmds();
@@ -9072,20 +9061,19 @@ aucmd_prepbuf(
save_ea = p_ea;
p_ea = FALSE;
# ifdef FEAT_AUTOCHDIR
#ifdef FEAT_AUTOCHDIR
/* Prevent chdir() call in win_enter_ext(), through do_autochdir(). */
save_acd = p_acd;
p_acd = FALSE;
# endif
#endif
(void)win_split_ins(0, WSP_TOP, aucmd_win, 0);
(void)win_comp_pos(); /* recompute window positions */
p_ea = save_ea;
# ifdef FEAT_AUTOCHDIR
#ifdef FEAT_AUTOCHDIR
p_acd = save_acd;
# endif
unblock_autocmds();
#endif
unblock_autocmds();
curwin = aucmd_win;
}
curbuf = buf;
@@ -9102,14 +9090,11 @@ aucmd_prepbuf(
aucmd_restbuf(
aco_save_T *aco) /* structure holding saved values */
{
#ifdef FEAT_WINDOWS
int dummy;
#endif
if (aco->use_aucmd_win)
{
--curbuf->b_nwindows;
#ifdef FEAT_WINDOWS
/* Find "aucmd_win", it can't be closed, but it may be in another tab
* page. Do not trigger autocommands here. */
block_autocmds();
@@ -9150,12 +9135,9 @@ win_found:
else
/* Hmm, original window disappeared. Just use the first one. */
curwin = firstwin;
# ifdef FEAT_EVAL
#ifdef FEAT_EVAL
vars_clear(&aucmd_win->w_vars->dv_hashtab); /* free all w: variables */
hash_init(&aucmd_win->w_vars->dv_hashtab); /* re-use the hashtab */
# endif
#else
curwin = aco->save_curwin;
#endif
curbuf = curwin->w_buffer;
@@ -9181,9 +9163,7 @@ win_found:
else
{
/* restore curwin */
#ifdef FEAT_WINDOWS
if (win_valid(aco->save_curwin))
#endif
{
/* Restore the buffer which was previously edited by curwin, if
* it was changed, we are still the same window and the buffer is
+1 -2
View File
@@ -95,7 +95,7 @@ static int foldendmarkerlen;
/* Exported folding functions. {{{1 */
/* copyFoldingState() {{{2 */
#if defined(FEAT_WINDOWS) || defined(PROTO)
/*
* Copy that folding state from window "wp_from" to window "wp_to".
*/
@@ -106,7 +106,6 @@ copyFoldingState(win_T *wp_from, win_T *wp_to)
wp_to->w_foldinvalid = wp_from->w_foldinvalid;
cloneFoldGrowArray(&wp_from->w_folds, &wp_to->w_folds);
}
#endif
/* hasAnyFolding() {{{2 */
/*
+7 -3
View File
@@ -59,7 +59,7 @@ static int block_redo = FALSE;
* Returns a value between 0 and 255, index in maphash.
* Put Normal/Visual mode mappings mostly separately from Insert/Cmdline mode.
*/
#define MAP_HASH(mode, c1) (((mode) & (NORMAL + VISUAL + SELECTMODE + OP_PENDING)) ? (c1) : ((c1) ^ 0x80))
#define MAP_HASH(mode, c1) (((mode) & (NORMAL + VISUAL + SELECTMODE + OP_PENDING + TERMINAL)) ? (c1) : ((c1) ^ 0x80))
/*
* Each mapping is put in one of the 256 hash lists, to speed up finding it.
@@ -2290,10 +2290,8 @@ vgetorpeek(int advance)
msg_row = Rows - 1;
msg_clr_eos(); /* clear ruler */
}
#ifdef FEAT_WINDOWS
status_redraw_all();
redraw_statuslines();
#endif
showmode();
setcursor();
continue;
@@ -3188,6 +3186,7 @@ input_available(void)
* for :xmap mode is VISUAL
* for :smap mode is SELECTMODE
* for :omap mode is OP_PENDING
* for :tmap mode is TERMINAL
*
* for :abbr mode is INSERT + CMDLINE
* for :iabbr mode is INSERT
@@ -3832,6 +3831,8 @@ get_map_mode(char_u **cmdp, int forceit)
mode = SELECTMODE; /* :smap */
else if (modec == 'o')
mode = OP_PENDING; /* :omap */
else if (modec == 't')
mode = TERMINAL; /* :tmap */
else
{
--p;
@@ -4892,6 +4893,9 @@ makemap(
case LANGMAP:
c1 = 'l';
break;
case TERMINAL:
c1 = 't';
break;
default:
IEMSG(_("E228: makemap: Illegal mode"));
return FAIL;
+1 -30
View File
@@ -63,7 +63,6 @@ EXTERN int Screen_mco INIT(= 0); /* value of p_mco used when
EXTERN schar_T *ScreenLines2 INIT(= NULL);
#endif
#ifdef FEAT_WINDOWS
/*
* Indexes for tab page line:
* N > 0 for label of tab page N
@@ -72,7 +71,6 @@ EXTERN schar_T *ScreenLines2 INIT(= NULL);
* N == -999 for closing current tab page
*/
EXTERN short *TabPageIdxs INIT(= NULL);
#endif
EXTERN int screen_Rows INIT(= 0); /* actual size of ScreenLines[] */
EXTERN int screen_Columns INIT(= 0); /* actual size of ScreenLines[] */
@@ -440,9 +438,7 @@ EXTERN int gui_prev_topfill INIT(= 0);
EXTERN int drag_status_line INIT(= FALSE); /* dragging the status line */
EXTERN int postponed_mouseshape INIT(= FALSE); /* postponed updating the
mouse pointer shape */
# ifdef FEAT_WINDOWS
EXTERN int drag_sep_line INIT(= FALSE); /* dragging vert separator */
# endif
# endif
#endif
@@ -550,9 +546,7 @@ EXTERN int clip_unnamed_saved INIT(= 0);
* All windows are linked in a list. firstwin points to the first entry,
* lastwin to the last entry (can be the same as firstwin) and curwin to the
* currently active window.
* Without the FEAT_WINDOWS they are all equal.
*/
#ifdef FEAT_WINDOWS
EXTERN win_T *firstwin; /* first window */
EXTERN win_T *lastwin; /* last window */
EXTERN win_T *prevwin INIT(= NULL); /* previous window */
@@ -571,16 +565,6 @@ EXTERN win_T *prevwin INIT(= NULL); /* previous window */
for ((tp) = first_tabpage; (tp) != NULL; (tp) = (tp)->tp_next) \
for ((wp) = ((tp) == curtab) \
? firstwin : (tp)->tp_firstwin; (wp); (wp) = (wp)->w_next)
#else
# define firstwin curwin
# define lastwin curwin
# define ONE_WINDOW 1
# define W_NEXT(wp) NULL
# define FOR_ALL_WINDOWS(wp) wp = curwin;
# define FOR_ALL_TABPAGES(tp) for (;FALSE;)
# define FOR_ALL_WINDOWS_IN_TAB(tp, wp) wp = curwin;
# define FOR_ALL_TAB_WINDOWS(tp, wp) wp = curwin;
#endif
EXTERN win_T *curwin; /* currently active window */
@@ -595,7 +579,6 @@ EXTERN int aucmd_win_used INIT(= FALSE); /* aucmd_win is being used */
*/
EXTERN frame_T *topframe; /* top of the window frame tree */
#ifdef FEAT_WINDOWS
/*
* Tab pages are alternative topframes. "first_tabpage" points to the first
* one in the list, "curtab" is the current one.
@@ -603,7 +586,6 @@ EXTERN frame_T *topframe; /* top of the window frame tree */
EXTERN tabpage_T *first_tabpage;
EXTERN tabpage_T *curtab;
EXTERN int redraw_tabline INIT(= FALSE); /* need to redraw tabline */
#endif
/*
* All buffers are linked in a list. 'firstbuf' points to the first entry,
@@ -1103,14 +1085,12 @@ EXTERN varnumber_T last_changedtick INIT(= 0); /* for TextChanged event */
EXTERN buf_T *last_changedtick_buf INIT(= NULL);
#endif
#ifdef FEAT_WINDOWS
EXTERN int postponed_split INIT(= 0); /* for CTRL-W CTRL-] command */
EXTERN int postponed_split_flags INIT(= 0); /* args for win_split() */
EXTERN int postponed_split_tab INIT(= 0); /* cmdmod.tab */
# ifdef FEAT_QUICKFIX
#ifdef FEAT_QUICKFIX
EXTERN int g_do_tagpreview INIT(= 0); /* for tag preview commands:
height of preview window */
# endif
#endif
EXTERN int replace_offset INIT(= 0); /* offset for replace_push() */
@@ -1198,17 +1178,12 @@ EXTERN int lcs_trail INIT(= NUL);
EXTERN int lcs_conceal INIT(= ' ');
#endif
#if defined(FEAT_WINDOWS) || defined(FEAT_WILDMENU) || defined(FEAT_STL_OPT) \
|| defined(FEAT_FOLDING)
/* Characters from 'fillchars' option */
EXTERN int fill_stl INIT(= ' ');
EXTERN int fill_stlnc INIT(= ' ');
#endif
#if defined(FEAT_WINDOWS) || defined(FEAT_FOLDING)
EXTERN int fill_vert INIT(= ' ');
EXTERN int fill_fold INIT(= '-');
EXTERN int fill_diff INIT(= '-');
#endif
#ifdef FEAT_FOLDING
EXTERN int disable_fold_update INIT(= 0);
@@ -1514,9 +1489,7 @@ EXTERN char_u e_nopresub[] INIT(= N_("E33: No previous substitute regular expres
EXTERN char_u e_noprev[] INIT(= N_("E34: No previous command"));
EXTERN char_u e_noprevre[] INIT(= N_("E35: No previous regular expression"));
EXTERN char_u e_norange[] INIT(= N_("E481: No range allowed"));
#ifdef FEAT_WINDOWS
EXTERN char_u e_noroom[] INIT(= N_("E36: Not enough room"));
#endif
#ifdef FEAT_CLIENTSERVER
EXTERN char_u e_noserver[] INIT(= N_("E247: no registered server named \"%s\""));
#endif
@@ -1587,10 +1560,8 @@ EXTERN char_u e_toomany[] INIT(= N_("E77: Too many file names"));
EXTERN char_u e_trailing[] INIT(= N_("E488: Trailing characters"));
EXTERN char_u e_umark[] INIT(= N_("E78: Unknown mark"));
EXTERN char_u e_wildexpand[] INIT(= N_("E79: Cannot expand wildcards"));
#ifdef FEAT_WINDOWS
EXTERN char_u e_winheight[] INIT(= N_("E591: 'winheight' cannot be smaller than 'winminheight'"));
EXTERN char_u e_winwidth[] INIT(= N_("E592: 'winwidth' cannot be smaller than 'winminwidth'"));
#endif
EXTERN char_u e_write[] INIT(= N_("E80: Error while writing"));
EXTERN char_u e_zerocount[] INIT(= N_("E939: Positive count required"));
#ifdef FEAT_EVAL
+7 -69
View File
@@ -1116,7 +1116,7 @@ gui_update_cursor(
* When in a terminal window use the shape/color specified there.
*/
#ifdef FEAT_TERMINAL
if (use_terminal_cursor())
if (terminal_is_active())
shape = term_get_cursor_shape(&shape_fg, &shape_bg);
else
#endif
@@ -1659,9 +1659,7 @@ gui_set_shellsize(
min_width = base_width + MIN_COLUMNS * gui.char_width;
min_height = base_height + MIN_LINES * gui.char_height;
#ifdef FEAT_WINDOWS
min_height += tabline_height() * gui.char_height;
#endif
#ifdef FEAT_GUI_GTK
if (un_maximize)
@@ -1845,7 +1843,6 @@ gui_write(
gui.scroll_region_bot = arg1;
}
break;
#ifdef FEAT_WINDOWS
case 'V': /* Set vertical scroll region */
if (arg1 < arg2)
{
@@ -1858,7 +1855,6 @@ gui_write(
gui.scroll_region_right = arg1;
}
break;
#endif
case 'd': /* Delete line */
gui_delete_lines(gui.row, 1);
break;
@@ -3197,16 +3193,11 @@ button_set:
* Visual selection.
*/
if ((State == NORMAL || State == NORMAL_BUSY || (State & INSERT))
&& Y_2_ROW(y) >= topframe->fr_height
# ifdef FEAT_WINDOWS
+ firstwin->w_winrow
# endif
&& Y_2_ROW(y) >= topframe->fr_height + firstwin->w_winrow
&& button != MOUSE_DRAG
# ifdef FEAT_MOUSESHAPE
&& !drag_status_line
# ifdef FEAT_WINDOWS
&& !drag_sep_line
# endif
# endif
)
checkfor = MOUSE_NONE;
@@ -3482,7 +3473,6 @@ gui_init_which_components(char_u *oldval UNUSED)
case GO_RIGHT:
gui.which_scrollbars[SBAR_RIGHT] = TRUE;
break;
#ifdef FEAT_WINDOWS
case GO_VLEFT:
if (win_hasvertsplit())
gui.which_scrollbars[SBAR_LEFT] = TRUE;
@@ -3491,7 +3481,6 @@ gui_init_which_components(char_u *oldval UNUSED)
if (win_hasvertsplit())
gui.which_scrollbars[SBAR_RIGHT] = TRUE;
break;
#endif
case GO_BOT:
gui.which_scrollbars[SBAR_BOTTOM] = TRUE;
break;
@@ -3554,11 +3543,8 @@ gui_init_which_components(char_u *oldval UNUSED)
* shown/unshown. Thus we need two places to remember whether a
* scrollbar is there or not. */
if (gui.which_scrollbars[i] != prev_which_scrollbars[i]
#ifdef FEAT_WINDOWS
|| gui.which_scrollbars[i]
!= curtab->tp_prev_which_scrollbars[i]
#endif
)
!= curtab->tp_prev_which_scrollbars[i])
{
if (i == SBAR_BOTTOM)
gui_mch_enable_scrollbar(&gui.bottom_sbar,
@@ -3580,9 +3566,7 @@ gui_init_which_components(char_u *oldval UNUSED)
fix_size = TRUE;
}
}
#ifdef FEAT_WINDOWS
curtab->tp_prev_which_scrollbars[i] = gui.which_scrollbars[i];
#endif
prev_which_scrollbars[i] = gui.which_scrollbars[i];
}
@@ -3658,12 +3642,10 @@ gui_init_which_components(char_u *oldval UNUSED)
Columns = prev_Columns;
#endif
}
#ifdef FEAT_WINDOWS
/* When the console tabline appears or disappears the window positions
* change. */
if (firstwin->w_winrow != tabline_height())
shell_new_rows(); /* recompute window positions and heights */
#endif
}
}
@@ -3873,7 +3855,6 @@ send_tabline_menu_event(int tabidx, int event)
* Scrollbar stuff:
*/
#if defined(FEAT_WINDOWS) || defined(PROTO)
/*
* Remove all scrollbars. Used before switching to another tab page.
*/
@@ -3897,7 +3878,6 @@ gui_remove_scrollbars(void)
curtab->tp_prev_which_scrollbars[i] = -1;
}
}
#endif
void
gui_create_scrollbar(scrollbar_T *sb, int type, win_T *wp)
@@ -3920,9 +3900,7 @@ gui_create_scrollbar(scrollbar_T *sb, int type, win_T *wp)
sb->max = 1;
sb->top = 0;
sb->height = 0;
#ifdef FEAT_WINDOWS
sb->width = 0;
#endif
sb->status_height = 0;
gui_mch_create_scrollbar(sb, (wp == NULL) ? SBAR_HORIZ : SBAR_VERT);
}
@@ -3965,9 +3943,7 @@ gui_find_scrollbar(long ident)
void
gui_drag_scrollbar(scrollbar_T *sb, long value, int still_dragging)
{
#ifdef FEAT_WINDOWS
win_T *wp;
#endif
int sb_num;
#ifdef USE_ON_FLY_SCROLL
colnr_T old_leftcol = curwin->w_leftcol;
@@ -4059,15 +4035,10 @@ gui_drag_scrollbar(scrollbar_T *sb, long value, int still_dragging)
if (sb->wp != NULL) /* vertical scrollbar */
{
sb_num = 0;
#ifdef FEAT_WINDOWS
for (wp = firstwin; wp != sb->wp && wp != NULL; wp = wp->w_next)
sb_num++;
if (wp == NULL)
return;
#else
if (sb->wp != curwin)
return;
#endif
#ifdef USE_ON_FLY_SCROLL
current_scrollbar = sb_num;
@@ -4176,7 +4147,6 @@ gui_drag_scrollbar(scrollbar_T *sb, long value, int still_dragging)
* Scrollbar stuff:
*/
#if defined(FEAT_AUTOCMD) || defined(FEAT_WINDOWS) || defined(PROTO)
/*
* Called when something in the window layout has changed.
*/
@@ -4191,7 +4161,6 @@ gui_may_update_scrollbars(void)
}
need_mouse_correct = TRUE;
}
#endif
void
gui_update_scrollbars(
@@ -4202,9 +4171,7 @@ gui_update_scrollbars(
long val, size, max; /* need 32 bits here */
int which_sb;
int h, y;
#ifdef FEAT_WINDOWS
static win_T *prev_curwin = NULL;
#endif
/* Update the horizontal scrollbar */
gui_update_horiz_scrollbar(force);
@@ -4297,22 +4264,17 @@ gui_update_scrollbars(
continue;
}
if (force || sb->height != wp->w_height
#ifdef FEAT_WINDOWS
|| sb->top != wp->w_winrow
|| sb->status_height != wp->w_status_height
|| sb->width != wp->w_width
|| prev_curwin != curwin
#endif
)
|| prev_curwin != curwin)
{
/* Height, width or position of scrollbar has changed. For
* vertical split: curwin changed. */
sb->height = wp->w_height;
#ifdef FEAT_WINDOWS
sb->top = wp->w_winrow;
sb->status_height = wp->w_status_height;
sb->width = wp->w_width;
#endif
/* Calculate height and position in pixels */
h = (sb->height + sb->status_height) * gui.char_height;
@@ -4339,9 +4301,7 @@ gui_update_scrollbars(
y += gui.tabline_height;
#endif
#ifdef FEAT_WINDOWS
if (wp->w_winrow == 0)
#endif
{
/* Height of top scrollbar includes width of top border */
h += gui.border_offset;
@@ -4394,9 +4354,7 @@ gui_update_scrollbars(
val, size, max);
}
}
#ifdef FEAT_WINDOWS
prev_curwin = curwin;
#endif
--hold_gui_events;
}
@@ -4411,7 +4369,6 @@ gui_do_scrollbar(
int which, /* SBAR_LEFT or SBAR_RIGHT */
int enable) /* TRUE to enable scrollbar */
{
#ifdef FEAT_WINDOWS
int midcol = curwin->w_wincol + curwin->w_width / 2;
int has_midcol = (wp->w_wincol <= midcol
&& wp->w_wincol + wp->w_width >= midcol);
@@ -4442,7 +4399,6 @@ gui_do_scrollbar(
enable = FALSE;
}
}
#endif
gui_mch_enable_scrollbar(&wp->w_scrollbars[which], enable);
}
@@ -4912,11 +4868,9 @@ gui_mouse_moved(int x, int y)
if (wp == curwin || wp == NULL)
return; /* still in the same old window, or none at all */
#ifdef FEAT_WINDOWS
/* Ignore position in the tab pages line. */
if (Y_2_ROW(y) < tabline_height())
return;
#endif
/*
* format a mouse click on status line input
@@ -4935,11 +4889,7 @@ gui_mouse_moved(int x, int y)
st[2] = KE_FILLER;
st[3] = (char_u)MOUSE_LEFT;
fill_mouse_coord(st + 4,
#ifdef FEAT_WINDOWS
wp->w_wincol == 0 ? -1 : wp->w_wincol + MOUSE_COLOFF,
#else
-1,
#endif
wp->w_height + W_WINROW(wp));
add_to_input_buf(st, 8);
@@ -4971,11 +4921,7 @@ gui_mouse_correct(void)
/* Don't move the mouse when it's left or right of the Vim window */
if (x < 0 || x > Columns * gui.char_width)
return;
if (y >= 0
# ifdef FEAT_WINDOWS
&& Y_2_ROW(y) >= tabline_height()
# endif
)
if (y >= 0 && Y_2_ROW(y) >= tabline_height())
wp = xy2win(x, y);
if (wp != curwin && wp != NULL) /* If in other than current window */
{
@@ -4992,7 +4938,6 @@ gui_mouse_correct(void)
static win_T *
xy2win(int x UNUSED, int y UNUSED)
{
#ifdef FEAT_WINDOWS
int row;
int col;
win_T *wp;
@@ -5013,7 +4958,7 @@ xy2win(int x UNUSED, int y UNUSED)
wp = mouse_find_win(&row, &col);
if (wp == NULL)
return NULL;
# ifdef FEAT_MOUSESHAPE
#ifdef FEAT_MOUSESHAPE
if (State == HITRETURN || State == ASKMORE)
{
if (Y_2_ROW(y) >= msg_row)
@@ -5031,11 +4976,8 @@ xy2win(int x UNUSED, int y UNUSED)
update_mouseshape(SHAPE_IDX_STATUS);
else
update_mouseshape(-2);
# endif
return wp;
#else
return firstwin;
#endif
return wp;
}
/*
@@ -5474,7 +5416,6 @@ gui_do_findrepl(
|| defined(PROTO) \
|| defined(FEAT_GUI_MACVIM)
#ifdef FEAT_WINDOWS
static void gui_wingoto_xy(int x, int y);
/*
@@ -5494,7 +5435,6 @@ gui_wingoto_xy(int x, int y)
win_goto(wp);
}
}
#endif
/*
* Process file drop. Mouse cursor position, key modifiers, name of files
@@ -5557,9 +5497,7 @@ gui_handle_drop(
{
/* Go to the window under mouse cursor, then shorten given "fnames" by
* current window, because a window can have local current dir. */
# ifdef FEAT_WINDOWS
gui_wingoto_xy(x, y);
# endif
shorten_filenames(fnames, count);
/* If Shift held down, remember the first item. */
-2
View File
@@ -183,9 +183,7 @@ typedef struct GuiScrollbar
/* Values measured in characters: */
int top; /* Top of scroll bar (chars from row 0) */
int height; /* Current height of scroll bar in rows */
#ifdef FEAT_WINDOWS
int width; /* Current width of scroll bar in cols */
#endif
int status_height; /* Height of status line */
#ifdef FEAT_GUI_X11
Widget id; /* Id of real scroll bar */
-2
View File
@@ -1961,14 +1961,12 @@ gui_mch_create_scrollbar(
#endif
}
#if defined(FEAT_WINDOWS) || defined(PROTO)
void
gui_mch_destroy_scrollbar(scrollbar_T *sb)
{
if (sb->id != (Widget)0)
XtDestroyWidget(sb->id);
}
#endif
void
gui_mch_set_scrollbar_colors(scrollbar_T *sb)
-8
View File
@@ -29,9 +29,7 @@ general_beval_cb(BalloonEval *beval, int state UNUSED)
char_u *bexpr;
buf_T *save_curbuf;
size_t len;
# ifdef FEAT_WINDOWS
win_T *cw;
# endif
#endif
static int recursive = FALSE;
@@ -53,11 +51,9 @@ general_beval_cb(BalloonEval *beval, int state UNUSED)
: wp->w_buffer->b_p_bexpr;
if (*bexpr != NUL)
{
# ifdef FEAT_WINDOWS
/* Convert window pointer to number. */
for (cw = firstwin; cw != wp; cw = cw->w_next)
++winnr;
# endif
set_vim_var_nr(VV_BEVAL_BUFNR, (long)wp->w_buffer->b_fnum);
set_vim_var_nr(VV_BEVAL_WINNR, winnr);
@@ -341,11 +337,7 @@ get_beval_info(
*textp = NULL;
row = Y_2_ROW(beval->y);
col = X_2_COL(beval->x);
#ifdef FEAT_WINDOWS
wp = mouse_find_win(&row, &col);
#else
wp = firstwin;
#endif
if (wp != NULL && row < wp->w_height && col < W_WIDTH(wp))
{
/* Found a window and the cursor is in the text. Now find the line
-2
View File
@@ -1160,7 +1160,6 @@ gui_mch_create_scrollbar(scrollbar_T *sb, int orient)
}
}
#if defined(FEAT_WINDOWS) || defined(PROTO)
void
gui_mch_destroy_scrollbar(scrollbar_T *sb)
{
@@ -1171,7 +1170,6 @@ gui_mch_destroy_scrollbar(scrollbar_T *sb)
}
gui_mch_update();
}
#endif
#if defined(FEAT_BROWSE) || defined(PROTO)
/*
-2
View File
@@ -1879,14 +1879,12 @@ gui_mch_create_scrollbar(
}
}
#if defined(FEAT_WINDOWS) || defined(PROTO)
void
gui_mch_destroy_scrollbar(scrollbar_T *sb)
{
if (sb->id != (Widget)0)
XtDestroyWidget(sb->id);
}
#endif
void
gui_mch_set_scrollbar_colors(scrollbar_T *sb)
+7 -13
View File
@@ -2947,13 +2947,11 @@ _OnActivateApp(
return MyWindowProc(hwnd, WM_ACTIVATEAPP, fActivate, (DWORD)dwThreadId);
}
#if defined(FEAT_WINDOWS) || defined(PROTO)
void
gui_mch_destroy_scrollbar(scrollbar_T *sb)
{
DestroyWindow(sb->id);
}
#endif
/*
* Get current mouse coordinates in text window.
@@ -3785,12 +3783,11 @@ _OnDropFiles(
HWND hwnd UNUSED,
HDROP hDrop)
{
#ifdef FEAT_WINDOWS
# define BUFPATHLEN _MAX_PATH
# define DRAGQVAL 0xFFFFFFFF
# ifdef FEAT_MBYTE
#define BUFPATHLEN _MAX_PATH
#define DRAGQVAL 0xFFFFFFFF
#ifdef FEAT_MBYTE
WCHAR wszFile[BUFPATHLEN];
# endif
#endif
char szFile[BUFPATHLEN];
UINT cFiles = DragQueryFile(hDrop, DRAGQVAL, NULL, 0);
UINT i;
@@ -3811,11 +3808,11 @@ _OnDropFiles(
if (fnames != NULL)
for (i = 0; i < cFiles; ++i)
{
# ifdef FEAT_MBYTE
#ifdef FEAT_MBYTE
if (DragQueryFileW(hDrop, i, wszFile, BUFPATHLEN) > 0)
fnames[i] = utf16_to_enc(wszFile, NULL);
else
# endif
#endif
{
DragQueryFile(hDrop, i, szFile, BUFPATHLEN);
fnames[i] = vim_strsave((char_u *)szFile);
@@ -3837,7 +3834,6 @@ _OnDropFiles(
s_need_activate = TRUE;
}
#endif
}
static int
@@ -5463,9 +5459,7 @@ gui_mch_init(void)
#endif
s_hdc = GetDC(s_textArea);
#ifdef FEAT_WINDOWS
DragAcceptFiles(s_hwnd, TRUE);
#endif
/* Do we need to bother with this? */
/* m_fMouseAvail = GetSystemMetrics(SM_MOUSEPRESENT); */
@@ -5781,7 +5775,7 @@ _OnImeNotify(HWND hWnd, DWORD dwCommand, DWORD dwData UNUSED)
State &= ~LANGMAP;
if (State & INSERT)
{
#if defined(FEAT_WINDOWS) && defined(FEAT_KEYMAP)
#if defined(FEAT_KEYMAP)
/* Unshown 'keymap' in status lines */
if (curbuf->b_p_iminsert == B_IMODE_LMAP)
{
+2 -8
View File
@@ -217,7 +217,6 @@ do_cscope_general(
return;
}
#ifdef FEAT_WINDOWS
if (make_split)
{
if (!cmdp->cansplit)
@@ -229,14 +228,11 @@ do_cscope_general(
postponed_split_flags = cmdmod.split;
postponed_split_tab = cmdmod.tab;
}
#endif
cmdp->func(eap);
#ifdef FEAT_WINDOWS
postponed_split_flags = 0;
postponed_split_tab = 0;
#endif
}
/*
@@ -326,7 +322,7 @@ ex_cstag(exarg_T *eap)
if (!ret)
{
(void)EMSG(_("E257: cstag: tag not found"));
#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
#if defined(FEAT_QUICKFIX)
g_do_tagpreview = 0;
#endif
}
@@ -1244,7 +1240,6 @@ cs_find_common(
if (qf_init(wp, tmp, (char_u *)"%f%*\\t%l%*\\t%m",
*qfpos == '-', cmdline, NULL) > 0)
{
# ifdef FEAT_WINDOWS
if (postponed_split != 0)
{
(void)win_split(postponed_split > 0 ? postponed_split : 0,
@@ -1252,7 +1247,6 @@ cs_find_common(
RESET_BINDING(curwin);
postponed_split = 0;
}
# endif
# ifdef FEAT_AUTOCMD
apply_autocmds(EVENT_QUICKFIXCMDPOST, (char_u *)"cscope",
@@ -2001,7 +1995,7 @@ cs_print_tags_priv(char **matches, char **cntxts, int num_matches)
char *cstag_msg = _("Cscope tag: %s");
char *csfmt_str = "%4d %6s ";
assert (num_matches > 0);
assert(num_matches > 0);
if ((tbuf = (char *)alloc((unsigned)strlen(matches[0]) + 1)) == NULL)
return;
-4
View File
@@ -1178,10 +1178,8 @@ luaV_window_index(lua_State *L)
lua_pushinteger(L, w->w_cursor.lnum);
else if (strncmp(s, "col", 3) == 0)
lua_pushinteger(L, w->w_cursor.col + 1);
#ifdef FEAT_WINDOWS
else if (strncmp(s, "width", 5) == 0)
lua_pushinteger(L, W_WIDTH(w));
#endif
else if (strncmp(s, "height", 6) == 0)
lua_pushinteger(L, w->w_height);
/* methods */
@@ -1221,7 +1219,6 @@ luaV_window_newindex (lua_State *L)
w->w_cursor.col = v - 1;
update_screen(VALID);
}
#ifdef FEAT_WINDOWS
else if (strncmp(s, "width", 5) == 0)
{
win_T *win = curwin;
@@ -1232,7 +1229,6 @@ luaV_window_newindex (lua_State *L)
win_setwidth(v);
curwin = win;
}
#endif
else if (strncmp(s, "height", 6) == 0)
{
win_T *win = curwin;
-14
View File
@@ -145,10 +145,8 @@ static Scheme_Object *get_window_num(void *, int, Scheme_Object **);
static Scheme_Object *get_window_buffer(void *, int, Scheme_Object **);
static Scheme_Object *get_window_height(void *, int, Scheme_Object **);
static Scheme_Object *set_window_height(void *, int, Scheme_Object **);
#ifdef FEAT_WINDOWS
static Scheme_Object *get_window_width(void *, int, Scheme_Object **);
static Scheme_Object *set_window_width(void *, int, Scheme_Object **);
#endif
static Scheme_Object *get_cursor(void *, int, Scheme_Object **);
static Scheme_Object *set_cursor(void *, int, Scheme_Object **);
static Scheme_Object *get_window_list(void *, int, Scheme_Object **);
@@ -1913,11 +1911,9 @@ get_curr_win(void *data UNUSED, int argc UNUSED, Scheme_Object **argv UNUSED)
get_window_count(void *data UNUSED, int argc UNUSED, Scheme_Object **argv UNUSED)
{
int n = 0;
#ifdef FEAT_WINDOWS
win_T *w;
FOR_ALL_WINDOWS(w)
#endif
++n;
return scheme_make_integer(n);
}
@@ -1934,9 +1930,7 @@ get_window_list(void *data, int argc, Scheme_Object **argv)
buf = get_buffer_arg(prim->name, 0, argc, argv);
list = scheme_null;
#ifdef FEAT_WINDOWS
for ( ; w != NULL; w = w->w_next)
#endif
if (w->w_buffer == buf->buf)
{
list = scheme_make_pair(window_new(w), list);
@@ -1988,13 +1982,11 @@ window_new(win_T *win)
get_window_num(void *data UNUSED, int argc UNUSED, Scheme_Object **argv UNUSED)
{
int nr = 1;
#ifdef FEAT_WINDOWS
Vim_Prim *prim = (Vim_Prim *)data;
win_T *win = get_window_arg(prim->name, 0, argc, argv)->win;
win_T *wp;
for (wp = firstwin; wp != win; wp = wp->w_next)
#endif
++nr;
return scheme_make_integer(nr);
@@ -2012,9 +2004,7 @@ get_window_by_num(void *data, int argc, Scheme_Object **argv)
if (fnum < 1)
scheme_signal_error(_("window index is out of range"));
#ifdef FEAT_WINDOWS
for ( ; win != NULL; win = win->w_next, --fnum)
#endif
if (fnum == 1) /* to be 1-based */
return window_new(win);
@@ -2066,7 +2056,6 @@ set_window_height(void *data, int argc, Scheme_Object **argv)
return scheme_void;
}
#ifdef FEAT_WINDOWS
/* (get-win-width [window]) */
static Scheme_Object *
get_window_width(void *data, int argc, Scheme_Object **argv)
@@ -2101,7 +2090,6 @@ set_window_width(void *data, int argc, Scheme_Object **argv)
raise_if_error();
return scheme_void;
}
#endif
/* (get-cursor [window]) -> (line . col) */
static Scheme_Object *
@@ -3744,10 +3732,8 @@ static Vim_Prim prims[]=
{get_window_buffer, "get-win-buffer", 0, 1},
{get_window_height, "get-win-height", 0, 1},
{set_window_height, "set-win-height", 1, 2},
#ifdef FEAT_WINDOWS
{get_window_width, "get-win-width", 0, 1},
{set_window_width, "set-win-width", 1, 2},
#endif
{get_cursor, "get-cursor", 0, 1},
{set_cursor, "set-cursor", 1, 2},
{get_window_list, "get-win-list", 0, 1},
+3 -28
View File
@@ -1387,11 +1387,8 @@ PerlIOVim_pushed(pTHX_ PerlIO *f, const char *mode,
{
PerlIOVim *s = PerlIOSelf(f, PerlIOVim);
s->attr = 0;
if (arg && SvPOK(arg)) {
int id = syn_name2id((char_u *)SvPV_nolen(arg));
if (id != 0)
s->attr = syn_id2attr(id);
}
if (arg && SvPOK(arg))
s->attr = syn_name2attr((char_u *)SvPV_nolen(arg));
return PerlIOBase_pushed(aTHX_ f, mode, (SV *)NULL, tab);
}
@@ -1451,24 +1448,6 @@ vim_IOLayer_init(void)
}
#endif /* PERLIO_LAYERS && !USE_SFIO */
#ifndef FEAT_WINDOWS
int
win_valid(win_T *w)
{
return TRUE;
}
int
win_count(void)
{
return 1;
}
win_T *
win_find_nr(int n)
{
return curwin;
}
#endif
XS(boot_VIM);
static void
@@ -1500,11 +1479,7 @@ Msg(text, hl=NULL)
{
attr = 0;
if (hl != NULL)
{
id = syn_name2id((char_u *)hl);
if (id != 0)
attr = syn_id2attr(id);
}
attr = syn_name2attr((char_u *)hl);
msg_split((char_u *)text, attr);
}
-4
View File
@@ -3872,14 +3872,12 @@ WindowAttr(WindowObject *self, char *name)
}
else if (strcmp(name, "height") == 0)
return PyLong_FromLong((long)(self->win->w_height));
#ifdef FEAT_WINDOWS
else if (strcmp(name, "row") == 0)
return PyLong_FromLong((long)(self->win->w_winrow));
else if (strcmp(name, "width") == 0)
return PyLong_FromLong((long)(W_WIDTH(self->win)));
else if (strcmp(name, "col") == 0)
return PyLong_FromLong((long)(W_WINCOL(self->win)));
#endif
else if (strcmp(name, "vars") == 0)
return NEW_DICTIONARY(self->win->w_vars);
else if (strcmp(name, "options") == 0)
@@ -3965,7 +3963,6 @@ WindowSetattr(WindowObject *self, char *name, PyObject *valObject)
return 0;
}
#ifdef FEAT_WINDOWS
else if (strcmp(name, "width") == 0)
{
long width;
@@ -3988,7 +3985,6 @@ WindowSetattr(WindowObject *self, char *name, PyObject *valObject)
return 0;
}
#endif
else
{
PyErr_SetString(PyExc_AttributeError, name);
-2
View File
@@ -1446,7 +1446,6 @@ python_buffer_free(buf_T *buf)
}
}
#if defined(FEAT_WINDOWS) || defined(PROTO)
void
python_window_free(win_T *win)
{
@@ -1468,7 +1467,6 @@ python_tabpage_free(tabpage_T *tab)
TAB_PYTHON_REF(tab) = NULL;
}
}
#endif
static int
PythonMod_Init(void)
-2
View File
@@ -1585,7 +1585,6 @@ python3_buffer_free(buf_T *buf)
}
}
#if defined(FEAT_WINDOWS) || defined(PROTO)
void
python3_window_free(win_T *win)
{
@@ -1607,7 +1606,6 @@ python3_tabpage_free(tabpage_T *tab)
TAB_PYTHON_REF(tab) = NULL;
}
}
#endif
static PyObject *
Py3Init_vim(void)
-10
View File
@@ -1433,16 +1433,12 @@ static VALUE current_line_number(void)
static VALUE window_s_count(void)
{
#ifdef FEAT_WINDOWS
win_T *w;
int n = 0;
FOR_ALL_WINDOWS(w)
n++;
return INT2NUM(n);
#else
return INT2NUM(1);
#endif
}
static VALUE window_s_aref(VALUE self UNUSED, VALUE num)
@@ -1450,11 +1446,7 @@ static VALUE window_s_aref(VALUE self UNUSED, VALUE num)
win_T *w;
int n = NUM2INT(num);
#ifndef FEAT_WINDOWS
w = curwin;
#else
for (w = firstwin; w != NULL; w = w->w_next, --n)
#endif
if (n == 0)
return window_new(w);
return Qnil;
@@ -1492,14 +1484,12 @@ static VALUE window_width(VALUE self UNUSED)
static VALUE window_set_width(VALUE self UNUSED, VALUE width)
{
#ifdef FEAT_WINDOWS
win_T *win = get_win(self);
win_T *savewin = curwin;
curwin = win;
win_setwidth(NUM2INT(width));
curwin = savewin;
#endif
return width;
}
-2
View File
@@ -2083,7 +2083,6 @@ tcl_buffer_free(buf_T *buf)
}
}
#if defined(FEAT_WINDOWS) || defined(PROTO)
void
tcl_window_free(win_T *win)
{
@@ -2102,6 +2101,5 @@ tcl_window_free(win_T *win)
win->w_tcl_ref = NULL;
}
}
#endif
/* The End */
+5 -38
View File
@@ -47,9 +47,7 @@ static void command_line_scan(mparm_T *parmp);
static void check_tty(mparm_T *parmp);
static void read_stdin(void);
static void create_windows(mparm_T *parmp);
# ifdef FEAT_WINDOWS
static void edit_buffers(mparm_T *parmp, char_u *cwd);
# endif
static void exe_pre_commands(mparm_T *parmp);
static void exe_commands(mparm_T *parmp);
static void source_startup_scripts(mparm_T *parmp);
@@ -148,9 +146,7 @@ main
#ifdef FEAT_EVAL
params.use_debug_break_level = -1;
#endif
#ifdef FEAT_WINDOWS
params.window_count = -1;
#endif
#ifdef FEAT_RUBY
{
@@ -804,13 +800,11 @@ vim_main2(void)
}
#endif
#ifdef FEAT_WINDOWS
/*
* If opened more than one window, start editing files in the other
* windows.
*/
edit_buffers(&params, start_dir);
#endif
vim_free(start_dir);
#ifdef FEAT_DIFF
@@ -917,7 +911,7 @@ vim_main2(void)
mch_set_winsize_now(); /* Allow winsize changes from now on */
#endif
#if defined(FEAT_GUI) && defined(FEAT_WINDOWS)
#if defined(FEAT_GUI)
/* When tab pages were created, may need to update the tab pages line and
* scrollbars. This is skipped while creating them. */
if (first_tabpage->tp_next != NULL)
@@ -1326,9 +1320,7 @@ main_loop(
update_screen(0);
else if (redraw_cmdline || clear_cmdline)
showmode();
#ifdef FEAT_WINDOWS
redraw_statuslines();
#endif
#ifdef FEAT_TITLE
if (need_maketitle)
maketitle();
@@ -1432,7 +1424,7 @@ main_loop(
/* If terminal_loop() returns OK we got a key that is handled
* in Normal model. With FAIL we first need to position the
* cursor and the screen needs to be redrawn. */
if (terminal_loop() == OK)
if (terminal_loop(TRUE) == OK)
normal_cmd(&oa, TRUE);
}
else
@@ -1510,7 +1502,6 @@ getout(int exitval)
if (get_vim_var_nr(VV_DYING) <= 1)
{
/* Trigger BufWinLeave for all windows, but only once per buffer. */
# if defined FEAT_WINDOWS
for (tp = first_tabpage; tp != NULL; tp = next_tp)
{
next_tp = tp->tp_next;
@@ -1531,10 +1522,6 @@ getout(int exitval)
}
}
}
# else
apply_autocmds(EVENT_BUFWINLEAVE, curbuf, curbuf->b_fname,
FALSE, curbuf);
# endif
/* Trigger BufUnload for buffers that are loaded */
FOR_ALL_BUFFERS(buf)
@@ -2186,30 +2173,24 @@ command_line_scan(mparm_T *parmp)
break;
}
#endif
#ifdef FEAT_WINDOWS
/* default is 0: open window for each file */
parmp->window_count = get_number_arg((char_u *)argv[0],
&argv_idx, 0);
parmp->window_layout = WIN_TABS;
#endif
break;
case 'o': /* "-o[N]" open N horizontal split windows */
#ifdef FEAT_WINDOWS
/* default is 0: open window for each file */
parmp->window_count = get_number_arg((char_u *)argv[0],
&argv_idx, 0);
parmp->window_layout = WIN_HOR;
#endif
break;
case 'O': /* "-O[N]" open N vertical split windows */
#ifdef FEAT_WINDOWS
/* default is 0: open window for each file */
parmp->window_count = get_number_arg((char_u *)argv[0],
&argv_idx, 0);
parmp->window_layout = WIN_VER;
#endif
break;
#ifdef FEAT_QUICKFIX
@@ -2724,7 +2705,6 @@ read_stdin(void)
static void
create_windows(mparm_T *parmp UNUSED)
{
#ifdef FEAT_WINDOWS
int dorewind;
int done = 0;
@@ -2757,7 +2737,6 @@ create_windows(mparm_T *parmp UNUSED)
}
else
parmp->window_count = 1;
#endif
if (recoverymode) /* do recover */
{
@@ -2781,7 +2760,6 @@ create_windows(mparm_T *parmp UNUSED)
++autocmd_no_enter;
++autocmd_no_leave;
#endif
#ifdef FEAT_WINDOWS
dorewind = TRUE;
while (done++ < 1000)
{
@@ -2805,7 +2783,6 @@ create_windows(mparm_T *parmp UNUSED)
curwin = curwin->w_next;
}
dorewind = FALSE;
#endif
curbuf = curwin->w_buffer;
if (curbuf->b_ml.ml_mfp == NULL)
{
@@ -2846,7 +2823,6 @@ create_windows(mparm_T *parmp UNUSED)
dorewind = TRUE; /* start again */
#endif
}
#ifdef FEAT_WINDOWS
ui_breakcheck();
if (got_int)
{
@@ -2854,14 +2830,11 @@ create_windows(mparm_T *parmp UNUSED)
break;
}
}
#endif
#ifdef FEAT_WINDOWS
if (parmp->window_layout == WIN_TABS)
goto_tabpage(1);
else
curwin = firstwin;
curbuf = curwin->w_buffer;
#endif
#ifdef FEAT_AUTOCMD
--autocmd_no_enter;
--autocmd_no_leave;
@@ -2869,7 +2842,6 @@ create_windows(mparm_T *parmp UNUSED)
}
}
#ifdef FEAT_WINDOWS
/*
* If opened more than one window, start editing files in the other
* windows. make_windows() has already opened the windows.
@@ -2977,7 +2949,7 @@ edit_buffers(
/* make the first window the current window */
win = firstwin;
#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
#if defined(FEAT_QUICKFIX)
/* Avoid making a preview window the current window. */
while (win->w_p_pvw)
{
@@ -2991,14 +2963,13 @@ edit_buffers(
#endif
win_enter(win, FALSE);
# ifdef FEAT_AUTOCMD
#ifdef FEAT_AUTOCMD
--autocmd_no_leave;
# endif
#endif
TIME_MSG("editing files in windows");
if (parmp->window_count > 1 && parmp->window_layout != WIN_TABS)
win_equal(curwin, FALSE, 'b'); /* adjust heights */
}
#endif /* FEAT_WINDOWS */
/*
* Execute the commands from --cmd arguments "cmds[cnt]".
@@ -3451,11 +3422,9 @@ usage(void)
main_msg(_("-U <gvimrc>\t\tUse <gvimrc> instead of any .gvimrc"));
#endif
main_msg(_("--noplugin\t\tDon't load plugin scripts"));
#ifdef FEAT_WINDOWS
main_msg(_("-p[N]\t\tOpen N tab pages (default: one for each file)"));
main_msg(_("-o[N]\t\tOpen N windows (default: one for each file)"));
main_msg(_("-O[N]\t\tLike -o but split vertically"));
#endif
main_msg(_("+\t\t\tStart at end of file"));
main_msg(_("+<lnum>\t\tStart at line <lnum>"));
main_msg(_("--cmd <command>\tExecute <command> before loading any vimrc file"));
@@ -3478,9 +3447,7 @@ usage(void)
main_msg(_("--remote-silent <files> Same, don't complain if there is no server"));
main_msg(_("--remote-wait <files> As --remote but wait for files to have been edited"));
main_msg(_("--remote-wait-silent <files> Same, don't complain if there is no server"));
# ifdef FEAT_WINDOWS
main_msg(_("--remote-tab[-wait][-silent] <files> As --remote but use tab page per file"));
# endif
main_msg(_("--remote-send <keys>\tSend <keys> to a Vim server and exit"));
main_msg(_("--remote-expr <expr>\tEvaluate <expr> in a Vim server and print result"));
main_msg(_("--serverlist\t\tList available Vim server names and exit"));
-8
View File
@@ -1056,9 +1056,7 @@ mark_adjust_internal(
int fnum = curbuf->b_fnum;
linenr_T *lp;
win_T *win;
#ifdef FEAT_WINDOWS
tabpage_T *tab;
#endif
static pos_T initpos = INIT_POS_T(1, 0, 0);
if (line2 < line1 && amount_after == 0L) /* nothing to do */
@@ -1340,7 +1338,6 @@ cleanup_jumplist(void)
curwin->w_jumplistlen = to;
}
# if defined(FEAT_WINDOWS) || defined(PROTO)
/*
* Copy the jumplist from window "from" to window "to".
*/
@@ -1370,7 +1367,6 @@ free_jumplist(win_T *wp)
for (i = 0; i < wp->w_jumplistlen; ++i)
vim_free(wp->w_jumplist[i].fname);
}
# endif
#endif /* FEAT_JUMPLIST */
void
@@ -1895,7 +1891,6 @@ write_viminfo_marks(FILE *fp_out, garray_T *buflist)
buf_T *buf;
int is_mark_set;
int i;
#ifdef FEAT_WINDOWS
win_T *win;
tabpage_T *tp;
@@ -1904,9 +1899,6 @@ write_viminfo_marks(FILE *fp_out, garray_T *buflist)
*/
FOR_ALL_TAB_WINDOWS(tp, win)
set_last_cursor(win);
#else
set_last_cursor(curwin);
#endif
fputs(_("\n# History of marks within files (newest to oldest):\n"), fp_out);
FOR_ALL_BUFFERS(buf)
+74
View File
@@ -4907,19 +4907,92 @@ im_preedit_window_set_position(void)
im_preedit_window_open()
{
char *preedit_string;
#if !GTK_CHECK_VERSION(3,16,0)
char buf[8];
#endif
PangoAttrList *attr_list;
PangoLayout *layout;
#if GTK_CHECK_VERSION(3,0,0)
# if !GTK_CHECK_VERSION(3,16,0)
GdkRGBA color;
# endif
#else
GdkColor color;
#endif
gint w, h;
if (preedit_window == NULL)
{
preedit_window = gtk_window_new(GTK_WINDOW_POPUP);
gtk_window_set_transient_for(GTK_WINDOW(preedit_window),
GTK_WINDOW(gui.mainwin));
preedit_label = gtk_label_new("");
gtk_widget_set_name(preedit_label, "vim-gui-preedit-area");
gtk_container_add(GTK_CONTAINER(preedit_window), preedit_label);
}
#if GTK_CHECK_VERSION(3,16,0)
{
GtkStyleContext * const context
= gtk_widget_get_style_context(gui.drawarea);
GtkCssProvider * const provider = gtk_css_provider_new();
gchar *css = NULL;
const char * const fontname
= pango_font_description_get_family(gui.norm_font);
gint fontsize
= pango_font_description_get_size(gui.norm_font) / PANGO_SCALE;
gchar *fontsize_propval = NULL;
if (!pango_font_description_get_size_is_absolute(gui.norm_font))
{
/* fontsize was given in points. Convert it into that in pixels
* to use with CSS. */
GdkScreen * const screen
= gdk_window_get_screen(gtk_widget_get_window(gui.mainwin));
const gdouble dpi = gdk_screen_get_resolution(screen);
fontsize = dpi * fontsize / 72;
}
if (fontsize > 0)
fontsize_propval = g_strdup_printf("%dpx", fontsize);
else
fontsize_propval = g_strdup_printf("inherit");
css = g_strdup_printf(
"widget#vim-gui-preedit-area {\n"
" font-family: %s,monospace;\n"
" font-size: %s;\n"
" color: #%.2lx%.2lx%.2lx;\n"
" background-color: #%.2lx%.2lx%.2lx;\n"
"}\n",
fontname != NULL ? fontname : "inherit",
fontsize_propval,
(gui.norm_pixel >> 16) & 0xff,
(gui.norm_pixel >> 8) & 0xff,
gui.norm_pixel & 0xff,
(gui.back_pixel >> 16) & 0xff,
(gui.back_pixel >> 8) & 0xff,
gui.back_pixel & 0xff);
gtk_css_provider_load_from_data(provider, css, -1, NULL);
gtk_style_context_add_provider(context,
GTK_STYLE_PROVIDER(provider), G_MAXUINT);
g_free(css);
g_free(fontsize_propval);
g_object_unref(provider);
}
#elif GTK_CHECK_VERSION(3,0,0)
gtk_widget_override_font(preedit_label, gui.norm_font);
vim_snprintf(buf, sizeof(buf), "#%06X", gui.norm_pixel);
gdk_rgba_parse(&color, buf);
gtk_widget_override_color(preedit_label, GTK_STATE_FLAG_NORMAL, &color);
vim_snprintf(buf, sizeof(buf), "#%06X", gui.back_pixel);
gdk_rgba_parse(&color, buf);
gtk_widget_override_background_color(preedit_label, GTK_STATE_FLAG_NORMAL,
&color);
#else
gtk_widget_modify_font(preedit_label, gui.norm_font);
vim_snprintf(buf, sizeof(buf), "#%06X", gui.norm_pixel);
@@ -4929,6 +5002,7 @@ im_preedit_window_open()
vim_snprintf(buf, sizeof(buf), "#%06X", gui.back_pixel);
gdk_color_parse(buf, &color);
gtk_widget_modify_bg(preedit_window, GTK_STATE_NORMAL, &color);
#endif
gtk_im_context_get_preedit_string(xic, &preedit_string, &attr_list, NULL);
+3 -3
View File
@@ -2544,8 +2544,7 @@ ml_append(
return ml_append_int(curbuf, lnum, line, len, newfile, FALSE);
}
#if defined(FEAT_SPELL) || (defined(FEAT_QUICKFIX) && defined(FEAT_WINDOWS)) \
|| defined(PROTO)
#if defined(FEAT_SPELL) || defined(FEAT_QUICKFIX) || defined(PROTO)
/*
* Like ml_append() but for an arbitrary buffer. The buffer must already have
* a memline.
@@ -3112,7 +3111,8 @@ ml_replace(linenr_T lnum, char_u *line, int copy)
}
/*
* Delete line 'lnum' in the current buffer.
* Delete line "lnum" in the current buffer.
* When "message" is TRUE may give a "No lines in buffer" message.
*
* Check: The caller of this function should probably also call
* deleted_lines() after this.
+240 -78
View File
@@ -82,6 +82,31 @@ static const char *toolbar_names[] =
# define TOOLBAR_NAME_COUNT (sizeof(toolbar_names) / sizeof(char *))
#endif
/*
* Return TRUE if "name" is a window toolbar menu name.
*/
static int
menu_is_winbar(char_u *name)
{
return (STRNCMP(name, "WinBar", 5) == 0);
}
int
winbar_height(win_T *wp)
{
if (wp->w_winbar != NULL && wp->w_winbar->children != NULL)
return 1;
return 0;
}
static vimmenu_T **
get_root_menu(char_u *name)
{
if (menu_is_winbar(name))
return &curwin->w_winbar;
return &root_menu;
}
/*
* Do the :menu command and relatives.
*/
@@ -113,6 +138,7 @@ ex_menu(
char_u *icon = NULL;
#endif
vimmenu_T menuarg;
vimmenu_T **root_menu_ptr;
modes = get_menu_cmd_modes(eap->cmd, eap->forceit, &noremap, &unmenu);
arg = eap->arg;
@@ -280,6 +306,11 @@ ex_menu(
# endif
#endif
root_menu_ptr = get_root_menu(menu_path);
if (root_menu_ptr == &curwin->w_winbar)
/* Assume the window toolbar menu will change. */
redraw_later(NOT_VALID);
if (enable != MAYBE)
{
/*
@@ -298,13 +329,13 @@ ex_menu(
p = popup_mode_name(menu_path, i);
if (p != NULL)
{
menu_nable_recurse(root_menu, p, MENU_ALL_MODES,
menu_nable_recurse(*root_menu_ptr, p, MENU_ALL_MODES,
enable);
vim_free(p);
}
}
}
menu_nable_recurse(root_menu, menu_path, modes, enable);
menu_nable_recurse(*root_menu_ptr, menu_path, modes, enable);
}
else if (unmenu)
{
@@ -325,14 +356,14 @@ ex_menu(
p = popup_mode_name(menu_path, i);
if (p != NULL)
{
remove_menu(&root_menu, p, MENU_ALL_MODES, TRUE);
remove_menu(root_menu_ptr, p, MENU_ALL_MODES, TRUE);
vim_free(p);
}
}
}
/* Careful: remove_menu() changes menu_path */
remove_menu(&root_menu, menu_path, modes, FALSE);
remove_menu(root_menu_ptr, menu_path, modes, FALSE);
}
else
{
@@ -402,6 +433,19 @@ ex_menu(
))
gui_set_shellsize(FALSE, FALSE, RESIZE_VERT);
#endif
if (root_menu_ptr == &curwin->w_winbar)
{
int h = winbar_height(curwin);
if (h != curwin->w_winbar_height)
{
if (h == 0)
++curwin->w_height;
else if (curwin->w_height > 0)
--curwin->w_height;
curwin->w_winbar_height = h;
}
}
theend:
;
@@ -446,12 +490,14 @@ add_menu_path(
char_u *en_name;
char_u *map_to = NULL;
#endif
vimmenu_T **root_menu_ptr;
/* Make a copy so we can stuff around with it, since it could be const */
path_name = vim_strsave(menu_path);
if (path_name == NULL)
return FAIL;
menup = &root_menu;
root_menu_ptr = get_root_menu(menu_path);
menup = root_menu_ptr;
parent = NULL;
name = path_name;
while (*name)
@@ -788,7 +834,7 @@ erret:
while (parent != NULL && parent->children == NULL)
{
if (parent->parent == NULL)
menup = &root_menu;
menup = root_menu_ptr;
else
menup = &parent->parent->children;
for ( ; *menup != NULL && *menup != parent; menup = &((*menup)->next))
@@ -988,6 +1034,16 @@ remove_menu(
return OK;
}
/*
* Remove the WinBar menu from window "wp".
*/
void
remove_winbar(win_T *wp)
{
remove_menu(&wp->w_winbar, (char_u *)"", MENU_ALL_MODES, TRUE);
vim_free(wp->w_winbar_items);
}
/*
* Free the given menu structure and remove it from the linked list.
*/
@@ -1063,10 +1119,10 @@ show_menus(char_u *path_name, int modes)
vimmenu_T *menu;
vimmenu_T *parent = NULL;
menu = root_menu;
name = path_name = vim_strsave(path_name);
if (path_name == NULL)
return FAIL;
menu = *get_root_menu(path_name);
/* First, find the (sub)menu with the given name */
while (*name)
@@ -1196,6 +1252,7 @@ show_menus_recursive(vimmenu_T *menu, int modes, int depth)
* Used when expanding menu names.
*/
static vimmenu_T *expand_menu = NULL;
static vimmenu_T *expand_menu_alt = NULL;
static int expand_modes = 0x0;
static int expand_emenu; /* TRUE for ":emenu" command */
@@ -1257,6 +1314,8 @@ set_context_in_menu_cmd(
return NULL; /* TODO: check for next command? */
if (*p == NUL) /* Complete the menu name */
{
int try_alt_menu = TRUE;
/*
* With :unmenu, you only want to match menus for the appropriate mode.
* With :menu though you might want to add a menu with the same name as
@@ -1296,6 +1355,11 @@ set_context_in_menu_cmd(
break;
}
menu = menu->next;
if (menu == NULL && try_alt_menu)
{
menu = curwin->w_winbar;
try_alt_menu = FALSE;
}
}
if (menu == NULL)
{
@@ -1305,12 +1369,17 @@ set_context_in_menu_cmd(
}
name = p;
menu = menu->children;
try_alt_menu = FALSE;
}
vim_free(path_name);
xp->xp_context = expand_menus ? EXPAND_MENUNAMES : EXPAND_MENUS;
xp->xp_pattern = after_dot;
expand_menu = menu;
if (expand_menu == root_menu)
expand_menu_alt = curwin->w_winbar;
else
expand_menu_alt = NULL;
}
else /* We're in the mapping part */
xp->xp_context = EXPAND_NOTHING;
@@ -1325,6 +1394,7 @@ set_context_in_menu_cmd(
get_menu_name(expand_T *xp UNUSED, int idx)
{
static vimmenu_T *menu = NULL;
static int did_alt_menu = FALSE;
char_u *str;
#ifdef FEAT_MULTI_LANG
static int should_advance = FALSE;
@@ -1333,6 +1403,7 @@ get_menu_name(expand_T *xp UNUSED, int idx)
if (idx == 0) /* first call: start at first item */
{
menu = expand_menu;
did_alt_menu = FALSE;
#ifdef FEAT_MULTI_LANG
should_advance = FALSE;
#endif
@@ -1343,7 +1414,14 @@ get_menu_name(expand_T *xp UNUSED, int idx)
|| menu_is_separator(menu->dname)
|| menu_is_tearoff(menu->dname)
|| menu->children == NULL))
{
menu = menu->next;
if (menu == NULL && !did_alt_menu)
{
menu = expand_menu_alt;
did_alt_menu = TRUE;
}
}
if (menu == NULL) /* at end of linked list */
return NULL;
@@ -1367,8 +1445,15 @@ get_menu_name(expand_T *xp UNUSED, int idx)
#ifdef FEAT_MULTI_LANG
if (should_advance)
#endif
{
/* Advance to next menu entry. */
menu = menu->next;
if (menu == NULL && !did_alt_menu)
{
menu = expand_menu_alt;
did_alt_menu = TRUE;
}
}
#ifdef FEAT_MULTI_LANG
should_advance = !should_advance;
@@ -1385,6 +1470,7 @@ get_menu_name(expand_T *xp UNUSED, int idx)
get_menu_names(expand_T *xp UNUSED, int idx)
{
static vimmenu_T *menu = NULL;
static int did_alt_menu = FALSE;
#define TBUFFER_LEN 256
static char_u tbuffer[TBUFFER_LEN]; /*hack*/
char_u *str;
@@ -1395,6 +1481,7 @@ get_menu_names(expand_T *xp UNUSED, int idx)
if (idx == 0) /* first call: start at first item */
{
menu = expand_menu;
did_alt_menu = FALSE;
#ifdef FEAT_MULTI_LANG
should_advance = FALSE;
#endif
@@ -1409,7 +1496,14 @@ get_menu_names(expand_T *xp UNUSED, int idx)
|| menu->dname[STRLEN(menu->dname) - 1] == '.'
#endif
))
{
menu = menu->next;
if (menu == NULL && !did_alt_menu)
{
menu = expand_menu_alt;
did_alt_menu = TRUE;
}
}
if (menu == NULL) /* at end of linked list */
return NULL;
@@ -1457,8 +1551,15 @@ get_menu_names(expand_T *xp UNUSED, int idx)
#ifdef FEAT_MULTI_LANG
if (should_advance)
#endif
{
/* Advance to next menu entry. */
menu = menu->next;
if (menu == NULL && !did_alt_menu)
{
menu = expand_menu_alt;
did_alt_menu = TRUE;
}
}
#ifdef FEAT_MULTI_LANG
should_advance = !should_advance;
@@ -2140,65 +2241,19 @@ gui_destroy_tearoffs_recurse(vimmenu_T *menu)
#endif /* FEAT_GUI_W32 && FEAT_TEAROFF */
/*
* Given a menu descriptor, e.g. "File.New", find it in the menu hierarchy and
* execute it.
* Execute "menu". Use by ":emenu" and the window toolbar.
* "eap" is NULL for the window toolbar.
*/
void
ex_emenu(exarg_T *eap)
static void
execute_menu(exarg_T *eap, vimmenu_T *menu)
{
vimmenu_T *menu;
char_u *name;
char_u *saved_name;
char_u *p;
int idx;
char_u *mode;
int idx;
#ifdef FEAT_GUI_MACVIM
char_u *old_arg;
#endif
saved_name = vim_strsave(eap->arg);
if (saved_name == NULL)
return;
menu = root_menu;
name = saved_name;
while (*name)
{
/* Find in the menu hierarchy */
p = menu_name_skip(name);
while (menu != NULL)
{
if (menu_name_equal(name, menu))
{
if (*p == NUL && menu->children != NULL)
{
EMSG(_("E333: Menu path must lead to a menu item"));
menu = NULL;
}
else if (*p != NUL && menu->children == NULL)
{
EMSG(_(e_notsubmenu));
menu = NULL;
}
break;
}
menu = menu->next;
}
if (menu == NULL || *p == NUL)
break;
menu = menu->children;
name = p;
}
vim_free(saved_name);
if (menu == NULL)
{
EMSG2(_("E334: Menu not found: %s"), eap->arg);
return;
}
/* Found the menu, so execute.
* Use the Insert mode entry when returning to Insert mode. */
/* Use the Insert mode entry when returning to Insert mode. */
if (restart_edit
#ifdef FEAT_EVAL
&& !current_SID
@@ -2208,7 +2263,12 @@ ex_emenu(exarg_T *eap)
mode = (char_u *)"Insert";
idx = MENU_INDEX_INSERT;
}
else if (eap->addr_count)
else if (VIsual_active)
{
mode = (char_u *)"Visual";
idx = MENU_INDEX_VISUAL;
}
else if (eap != NULL && eap->addr_count)
{
pos_T tpos;
@@ -2266,35 +2326,137 @@ ex_emenu(exarg_T *eap)
{
/* When executing a script or function execute the commands right now.
* Also for the window toolbar.
* Otherwise put them in the typeahead buffer. */
if (eap == NULL
#ifdef FEAT_EVAL
if (current_SID != 0)
|| current_SID != 0
#endif
)
exec_normal_cmd(menu->strings[idx], menu->noremap[idx],
menu->silent[idx]);
else
#endif
ins_typebuf(menu->strings[idx], menu->noremap[idx], 0,
TRUE, menu->silent[idx]);
}
#ifdef FEAT_GUI_MACVIM
else if (menu->mac_action != NULL && menu->strings[idx][0] == NUL)
else if (eap != NULL)
{
/* This allows us to bind a menu to an action without mapping to
* anything so that pressing the menu's key equivalent and typing
* ":emenu ..." does the same thing. (HACK: We count on the fact that
* ex_macaction() only looks at eap->arg.) */
old_arg = eap->arg;
eap->arg = menu->mac_action;
ex_macaction(eap);
eap->arg = old_arg;
}
#ifdef FEAT_GUI_MACVIM
if (menu->mac_action != NULL && menu->strings[idx][0] == NUL)
{
/* This allows us to bind a menu to an action without mapping to
* anything so that pressing the menu's key equivalent and typing
* ":emenu ..." does the same thing. (HACK: We count on the fact
* that ex_macaction() only looks at eap->arg.) */
old_arg = eap->arg;
eap->arg = menu->mac_action;
ex_macaction(eap);
eap->arg = old_arg;
}
else
#endif /* FEAT_GUI_MACVIM */
else
EMSG2(_("E335: Menu not defined for %s mode"), mode);
EMSG2(_("E335: Menu not defined for %s mode"), mode);
}
}
#if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_MACVIM)\
|| (defined(FEAT_GUI_GTK) && defined(FEAT_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 *name;
char_u *saved_name;
char_u *p;
saved_name = vim_strsave(eap->arg);
if (saved_name == NULL)
return;
menu = *get_root_menu(saved_name);
name = saved_name;
while (*name)
{
/* Find in the menu hierarchy */
p = menu_name_skip(name);
while (menu != NULL)
{
if (menu_name_equal(name, menu))
{
if (*p == NUL && menu->children != NULL)
{
EMSG(_("E333: Menu path must lead to a menu item"));
menu = NULL;
}
else if (*p != NUL && menu->children == NULL)
{
EMSG(_(e_notsubmenu));
menu = NULL;
}
break;
}
menu = menu->next;
}
if (menu == NULL || *p == NUL)
break;
menu = menu->children;
name = p;
}
vim_free(saved_name);
if (menu == NULL)
{
EMSG2(_("E334: Menu not found: %s"), eap->arg);
return;
}
/* Found the menu, so execute. */
execute_menu(eap, menu);
}
/*
* Handle a click in the window toolbar of "wp" at column "col".
*/
void
winbar_click(win_T *wp, int col)
{
int idx;
if (wp->w_winbar_items == NULL)
return;
for (idx = 0; wp->w_winbar_items[idx].wb_menu != NULL; ++idx)
{
winbar_item_T *item = &wp->w_winbar_items[idx];
if (col >= item->wb_startcol && col <= item->wb_endcol)
{
win_T *save_curwin = NULL;
if (wp != curwin)
{
/* Clicking in the window toolbar of a not-current window.
* Make that window the current one and go to Normal mode. */
save_curwin = curwin;
curwin = wp;
curbuf = curwin->w_buffer;
check_cursor();
}
execute_menu(NULL, item->wb_menu);
if (save_curwin != NULL)
{
curwin = save_curwin;
curbuf = curwin->w_buffer;
}
}
}
}
#if defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK) \
|| defined(FEAT_GUI_MACVIM) \
|| defined(FEAT_BEVAL_TIP) || defined(PROTO)
/*
* Given a menu descriptor, e.g. "File.New", find it in the menu hierarchy.
@@ -2307,7 +2469,7 @@ gui_find_menu(char_u *path_name)
char_u *saved_name;
char_u *p;
menu = root_menu;
menu = *get_root_menu(path_name);
saved_name = vim_strsave(path_name);
if (saved_name == NULL)

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