Compare commits

...

24 Commits

Author SHA1 Message Date
6315a9ae92 patch 8.0.1336: cannot use imactivatefunc() unless compiled with +xim
Problem:    Cannot use imactivatefunc() unless compiled with +xim.
Solution:   Allow using imactivatefunc() when not compiled with +xim.
            (Yasuhiro Matsumoto, closes #2349)
2017-11-25 15:20:02 +01:00
291a9d15ed patch 8.0.1335: writefile() using fsync() may give an error.
Problem:    Writefile() using fsync() may give an error for a device.
            (Yasuhiro Matsumoto)
Solution:   Ignore fsync() failing. (closes #2373)
2017-11-25 14:37:11 +01:00
3167c3e701 patch 8.0.1334: splitting a window with a WinBar damages window layout
Problem:    Splitting a window with a WinBar damages window layout.
            (Lifepillar)
Solution:   Take the winbar into account when computing the new window
            position.  Add WINBAR_HEIGHT().
2017-11-25 14:19:43 +01:00
2c997d7603 patch 8.0.1333: some tests are run twice
Problem:    Some tests are run twice.
Solution:   Invoked most utf8 tests only from test_alot_utf8. (Yegappan
            Lakshmanan, closes #2369)
2017-11-23 22:52:09 +01:00
93a32e2ec4 patch 8.0.1332: highlighting in quickfix window could be better
Problem:    Highlighting in quickfix window could be better. (Axel Bender)
Solution:   Use the qfSeparator highlight item. (Yegappan Lakshmanan)
2017-11-23 22:05:45 +01:00
3679c17917 patch 8.0.1331: possible crash when window can be zero lines high
Problem:    Possible crash when window can be zero lines high. (Joseph
            Dornisch)
Solution:   Only set w_fraction if the window is at least two lines high.
2017-11-22 22:22:11 +01:00
a2a80162de Update runtime files. 2017-11-21 23:09:50 +01:00
52dbb5ea7f patch 8.0.1330: MS-Windows: job in terminal can't get back to Vim
Problem:    MS-Windows: job in terminal can't get back to Vim.
Solution:   set VIM_SERVERNAME in the environment. (Yasuhiro Matsumoto, closes
            #2360)
2017-11-21 18:11:27 +01:00
5505860152 patch 8.0.1329: when a flaky test fails it also often fails the second time
Problem:    When a flaky test fails it also often fails the second time.
Solution:   Sleep a couple of seconds before the second try.
2017-11-21 15:14:51 +01:00
ff5467965e patch 8.0.1328: trouble when using ":term ++close" with autocmd
Problem:    Trouble when using ":term ++close" with autocmd. (Gabriel Barta)
Solution:   Use aucmd_prepbuf() and aucmd_restbuf() instead of setting curbuf.
            (closes #2339)
2017-11-21 14:47:57 +01:00
91ffda9852 patch 8.0.1327: new proto file missing from distribution
Problem:    New proto file missing from distribution.
Solution:   Add it. (closes #2355)
2017-11-21 13:52:14 +01:00
6e77df2d85 patch 8.0.1326: largefile test fails on CI, glob test on MS-Windows
Problem:    Largefile test fails on CI, glob test on MS-Windows.
Solution:   Remove largefile test from list of all tests. Don't run
            Test_glob() on non-unix systems.  More cleanup. (Yegappan
            Lakshmanan, closes #2354)
2017-11-21 11:43:08 +01:00
5df95ea9ef patch 8.0.1325: more tests are not run
Problem:    More tests are not run.
Solution:   Add targets to the list of tests. (Yegappan Lakshmanan)
2017-11-20 22:08:10 +01:00
bb160a188a patch 8.0.1324: some xterm sends different mouse move codes
Problem:    Some xterm sends different mouse move codes.
Solution:   Also accept 0x80 as a move event.
2017-11-20 21:52:24 +01:00
73675fbc48 patch 8.0.1323: mouse events in a terminal window may cause endless loop
Problem:    Mouse events in a terminal window may cause endless loop.
Solution:   Adjust position computation.  Don't stuff a mouse event when
            coming from normal_cmd().
2017-11-20 21:49:19 +01:00
5bbef31949 patch 8.0.1322: textformat test isn't run
Problem:    Textformat test isn't run. (Yegappan Lakshmanan)
Solution:   Add target to the list of tests.
2017-11-19 20:38:05 +01:00
40e280d949 patch 8.0.1321: can't build huge version with Athena
Problem:    Can't build huge version with Athena. (Mark Kelly)
Solution:   Move including beval.h to before structs.h. Include beval.pro like
            other proto files.
2017-11-19 20:34:59 +01:00
7221fce8b3 patch 8.0.1320: popup test fails on GUI-only build
Problem:    Popup test fails on GUI-only build.
Solution:   Don't test balloon_split() when it's not available.
2017-11-19 20:32:49 +01:00
669a828cdc patch 8.0.1319: can't build GUI on MS-Windows
Problem:    Can't build GUI on MS-Windows.
Solution:   Don't define the balloon_split() function in a GUI-only build.
2017-11-19 20:13:05 +01:00
246fe03d15 patch 8.0.1318: terminal balloon only shows one line
Problem:    Terminal balloon only shows one line.
Solution:   Split into several lines in a clever way.  Add balloon_split().
            Make balloon_show() accept a list in the terminal.
2017-11-19 19:56:27 +01:00
e518226713 patch 8.0.1317: accessing freed memory in term_wait()
Problem:    Accessing freed memory in term_wait(). (Dominique Pelle)
Solution:   Check that the buffer still exists.
2017-11-19 15:05:44 +01:00
44c2bffde7 patch 8.0.1316: build still still fails on Mac
Problem:    Build still still fails on Mac. (chdiza)
Solution:   Remove another bogus typedef.
2017-11-18 23:23:01 +01:00
e86ee877c1 patch 8.0.1315: build still fails on Mac
Problem:    Build still fails on Mac. (chdiza)
Solution:   Remove bogus typedef.
2017-11-18 23:09:37 +01:00
4ab9d9e9a4 patch 8.0.1314: build fails on Mac
Problem:    Build fails on Mac. (chdiza)
Solution:   Add #ifdef around GUI fields.
2017-11-18 22:49:58 +01:00
50 changed files with 894 additions and 259 deletions

View File

@ -141,6 +141,7 @@ SRC_ALL = \
src/testdir/xterm_ramp.vim \ src/testdir/xterm_ramp.vim \
src/proto.h \ src/proto.h \
src/proto/arabic.pro \ src/proto/arabic.pro \
src/proto/beval.pro \
src/proto/blowfish.pro \ src/proto/blowfish.pro \
src/proto/buffer.pro \ src/proto/buffer.pro \
src/proto/channel.pro \ src/proto/channel.pro \

View File

@ -1,4 +1,4 @@
*debugger.txt* For Vim version 8.0. Last change: 2005 Mar 29 *debugger.txt* For Vim version 8.0. Last change: 2017 Nov 21
VIM REFERENCE MANUAL by Gordon Prieur VIM REFERENCE MANUAL by Gordon Prieur
@ -95,10 +95,12 @@ list and colors can be set via X resources (XmNballoonEvalFontList,
XmNballoonEvalBackground, and XmNballoonEvalForeground). XmNballoonEvalBackground, and XmNballoonEvalForeground).
The 'balloondelay' option sets the delay before an attempt is made to show a The 'balloondelay' option sets the delay before an attempt is made to show a
balloon. balloon.
The 'ballooneval' option needs to be set to switch it on. The 'ballooneval' and/or the 'balloonevalterm' option needs to be set to
switch it on.
Balloon evaluation is only available when compiled with the |+balloon_eval| Balloon evaluation is only available in the GUI when compiled with the
feature. |+balloon_eval| feature. For the terminal the |+balloon_eval_term| feature
matters.
The Balloon evaluation functions are also used to show a tooltip for the The Balloon evaluation functions are also used to show a tooltip for the
toolbar. The 'ballooneval' option does not need to be set for this. But the toolbar. The 'ballooneval' option does not need to be set for this. But the

View File

@ -1,4 +1,4 @@
*editing.txt* For Vim version 8.0. Last change: 2017 Aug 21 *editing.txt* For Vim version 8.0. Last change: 2017 Nov 16
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -900,7 +900,7 @@ Note: When the 'write' option is off, you are not able to write any file.
*:w* *:write* *:w* *:write*
*E502* *E503* *E504* *E505* *E502* *E503* *E504* *E505*
*E512* *E514* *E667* *E796* *E512* *E514* *E667* *E796* *E949*
:w[rite] [++opt] Write the whole buffer to the current file. This is :w[rite] [++opt] Write the whole buffer to the current file. This is
the normal way to save changes to a file. It fails the normal way to save changes to a file. It fails
when the 'readonly' option is set or when there is when the 'readonly' option is set or when there is
@ -956,6 +956,9 @@ used, for example, when the write fails and you want to try again later with
":w #". This can be switched off by removing the 'A' flag from the ":w #". This can be switched off by removing the 'A' flag from the
'cpoptions' option. 'cpoptions' option.
Note that the 'fsync' option matters here. If it's set it may make writes
slower (but safer).
*:sav* *:saveas* *:sav* *:saveas*
:sav[eas][!] [++opt] {file} :sav[eas][!] [++opt] {file}
Save the current buffer under the name {file} and set Save the current buffer under the name {file} and set

View File

@ -1,4 +1,4 @@
*eval.txt* For Vim version 8.0. Last change: 2017 Nov 16 *eval.txt* For Vim version 8.0. Last change: 2017 Nov 19
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -2032,6 +2032,7 @@ asin({expr}) Float arc sine of {expr}
atan({expr}) Float arc tangent of {expr} atan({expr}) Float arc tangent of {expr}
atan2({expr1}, {expr2}) Float arc tangent of {expr1} / {expr2} atan2({expr1}, {expr2}) Float arc tangent of {expr1} / {expr2}
balloon_show({msg}) none show {msg} inside the balloon balloon_show({msg}) none show {msg} inside the balloon
balloon_split({msg}) List split {msg} as used for a balloon
browse({save}, {title}, {initdir}, {default}) browse({save}, {title}, {initdir}, {default})
String put up a file requester String put up a file requester
browsedir({title}, {initdir}) String put up a directory requester browsedir({title}, {initdir}) String put up a directory requester
@ -2682,8 +2683,12 @@ atan2({expr1}, {expr2}) *atan2()*
< 2.356194 < 2.356194
{only available when compiled with the |+float| feature} {only available when compiled with the |+float| feature}
balloon_show({msg}) *balloon_show()* balloon_show({expr}) *balloon_show()*
Show {msg} inside the balloon. Show {expr} inside the balloon. For the GUI {expr} is used as
a string. For a terminal {expr} can be a list, which contains
the lines of the balloon. If {expr} is not a list it will be
split with |balloon_split()|.
Example: > Example: >
func GetBalloonContent() func GetBalloonContent()
" initiate getting the content " initiate getting the content
@ -2703,7 +2708,16 @@ balloon_show({msg}) *balloon_show()*
When showing a balloon is not possible nothing happens, no When showing a balloon is not possible nothing happens, no
error message. error message.
{only available when compiled with the +balloon_eval feature} {only available when compiled with the +balloon_eval or
+balloon_eval_term feature}
balloon_split({msg}) *balloon_split()*
Split {msg} into lines to be displayed in a balloon. The
splits are made for the current window size and optimize to
show debugger output.
Returns a |List| with the split lines.
{only available when compiled with the +balloon_eval_term
feature}
*browse()* *browse()*
browse({save}, {title}, {initdir}, {default}) browse({save}, {title}, {initdir}, {default})
@ -2734,6 +2748,8 @@ bufexists({expr}) *bufexists()*
The result is a Number, which is |TRUE| if a buffer called The result is a Number, which is |TRUE| if a buffer called
{expr} exists. {expr} exists.
If the {expr} argument is a number, buffer numbers are used. If the {expr} argument is a number, buffer numbers are used.
Number zero is the alternate buffer for the current window.
If the {expr} argument is a string it must match a buffer name If the {expr} argument is a string it must match a buffer name
exactly. The name can be: exactly. The name can be:
- Relative to the current directory. - Relative to the current directory.

View File

@ -26,8 +26,9 @@ For changing the language of messages and menus see |mlang.txt|.
7. Input on X11 |mbyte-XIM| 7. Input on X11 |mbyte-XIM|
8. Input on MS-Windows |mbyte-IME| 8. Input on MS-Windows |mbyte-IME|
9. Input with a keymap |mbyte-keymap| 9. Input with a keymap |mbyte-keymap|
10. Using UTF-8 |mbyte-utf8| 10. Input with imactivatefunc() |mbyte-func|
11. Overview of options |mbyte-options| 11. Using UTF-8 |mbyte-utf8|
12. Overview of options |mbyte-options|
NOTE: This file contains UTF-8 characters. These may show up as strange NOTE: This file contains UTF-8 characters. These may show up as strange
characters or boxes when using another encoding. characters or boxes when using another encoding.
@ -1254,7 +1255,35 @@ Combining forms:
ﭏ 0xfb4f Xal alef-lamed ﭏ 0xfb4f Xal alef-lamed
============================================================================== ==============================================================================
10. Using UTF-8 *mbyte-utf8* *UTF-8* *utf-8* *utf8* 10. Input with imactivatefunc() *mbyte-func*
Vim has |imactivatefunc()| and |imstatusfunc()|. This is useful to
activate/deativate input method from Vim in any way, also with an external
command. For example, fcitx provide fcitx-remote command: >
set iminsert=2
set imsearch=2
set imcmdline
set imactivatefunc=ImActivate
function! ImActivate(active)
if a:active
call system('fcitx-remote -o')
else
call system('fcitx-remote -c')
endif
endfunction
set imstatusfunc=ImStatus
function! ImStatus()
return system('fcitx-remote')[0] is# '2'
endfunction
Using this script, you can activate/deactivate XIM via Vim even when it is not
compiled with |+xim|.
==============================================================================
11. Using UTF-8 *mbyte-utf8* *UTF-8* *utf-8* *utf8*
*Unicode* *unicode* *Unicode* *unicode*
The Unicode character set was designed to include all characters from other The Unicode character set was designed to include all characters from other
character sets. Therefore it is possible to write text in any language using character sets. Therefore it is possible to write text in any language using
@ -1402,7 +1431,7 @@ not everybody is able to type a composing character.
============================================================================== ==============================================================================
11. Overview of options *mbyte-options* 12. Overview of options *mbyte-options*
These options are relevant for editing multi-byte files. Check the help in These options are relevant for editing multi-byte files. Check the help in
options.txt for detailed information. options.txt for detailed information.

View File

@ -4256,8 +4256,7 @@ A jump table for the options with a short description can be found at |Q_op|.
'imactivatefunc' 'imaf' string (default "") 'imactivatefunc' 'imaf' string (default "")
global global
{not in Vi} {not in Vi}
{only available when compiled with |+xim| and {only available when compiled with |+mbyte|}
|+GUI_GTK|}
This option specifies a function that will be called to This option specifies a function that will be called to
activate/inactivate Input Method. activate/inactivate Input Method.
@ -4308,8 +4307,7 @@ A jump table for the options with a short description can be found at |Q_op|.
'imcmdline' 'imc' boolean (default off) 'imcmdline' 'imc' boolean (default off)
global global
{not in Vi} {not in Vi}
{only available when compiled with the |+xim|, {only available when compiled with |+mbyte|}
|+multi_byte_ime| or |global-ime| features}
When set the Input Method is always on when starting to edit a command When set the Input Method is always on when starting to edit a command
line, unless entering a search pattern (see 'imsearch' for that). line, unless entering a search pattern (see 'imsearch' for that).
Setting this option is useful when your input method allows entering Setting this option is useful when your input method allows entering
@ -4320,8 +4318,7 @@ A jump table for the options with a short description can be found at |Q_op|.
'imdisable' 'imd' boolean (default off, on for some systems (SGI)) 'imdisable' 'imd' boolean (default off, on for some systems (SGI))
global global
{not in Vi} {not in Vi}
{only available when compiled with the |+xim|, {only available when compiled with |+mbyte|}
|+multi_byte_ime| or |global-ime| features}
When set the Input Method is never used. This is useful to disable When set the Input Method is never used. This is useful to disable
the IM when it doesn't work properly. the IM when it doesn't work properly.
Currently this option is on by default for SGI/IRIX machines. This Currently this option is on by default for SGI/IRIX machines. This
@ -4336,8 +4333,6 @@ A jump table for the options with a short description can be found at |Q_op|.
0 :lmap is off and IM is off 0 :lmap is off and IM is off
1 :lmap is ON and IM is off 1 :lmap is ON and IM is off
2 :lmap is off and IM is ON 2 :lmap is off and IM is ON
2 is available only when compiled with the |+multi_byte_ime|, |+xim|
or |global-ime|.
To always reset the option to zero when leaving Insert mode with <Esc> To always reset the option to zero when leaving Insert mode with <Esc>
this can be used: > this can be used: >
:inoremap <ESC> <ESC>:set iminsert=0<CR> :inoremap <ESC> <ESC>:set iminsert=0<CR>
@ -4350,6 +4345,10 @@ A jump table for the options with a short description can be found at |Q_op|.
The value 0 may not work correctly with Athena and Motif with some XIM The value 0 may not work correctly with Athena and Motif with some XIM
methods. Use 'imdisable' to disable XIM then. methods. Use 'imdisable' to disable XIM then.
You can set 'imactivatefunc' and 'imstatusfunc' to handle IME/XIM
via external command if vim is not compiled with the |+xim|,
|+multi_byte_ime| or |global-ime|.
*'imsearch'* *'ims'* *'imsearch'* *'ims'*
'imsearch' 'ims' number (default -1) 'imsearch' 'ims' number (default -1)
local to buffer local to buffer
@ -4372,8 +4371,7 @@ A jump table for the options with a short description can be found at |Q_op|.
'imstatusfunc' 'imsf' string (default "") 'imstatusfunc' 'imsf' string (default "")
global global
{not in Vi} {not in Vi}
{only available when compiled with |+xim| and {only available when compiled with |+mbyte|}
|+GUI_GTK|}
This option specifies a function that is called to obtain the status This option specifies a function that is called to obtain the status
of Input Method. It must return a positive number when IME is active. of Input Method. It must return a positive number when IME is active.

View File

@ -1,4 +1,4 @@
*quickref.txt* For Vim version 8.0. Last change: 2017 Oct 19 *quickref.txt* For Vim version 8.0. Last change: 2017 Nov 21
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -618,7 +618,8 @@ Short explanation of each option: *option-list*
'backupext' 'bex' extension used for the backup file 'backupext' 'bex' extension used for the backup file
'backupskip' 'bsk' no backup for files that match these patterns 'backupskip' 'bsk' no backup for files that match these patterns
'balloondelay' 'bdlay' delay in mS before a balloon may pop up 'balloondelay' 'bdlay' delay in mS before a balloon may pop up
'ballooneval' 'beval' switch on balloon evaluation 'ballooneval' 'beval' switch on balloon evaluation in the GUI
'balloonevalterm' 'bevalterm' switch on balloon evaluation in the terminal
'balloonexpr' 'bexpr' expression to show in balloon 'balloonexpr' 'bexpr' expression to show in balloon
'belloff' 'bo' do not ring the bell for these reasons 'belloff' 'bo' do not ring the bell for these reasons
'binary' 'bin' read/write/edit file in binary mode 'binary' 'bin' read/write/edit file in binary mode

View File

@ -1,4 +1,4 @@
*remote.txt* For Vim version 8.0. Last change: 2017 Aug 01 *remote.txt* For Vim version 8.0. Last change: 2017 Nov 12
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -181,7 +181,8 @@ name on the 'VimRegistry' property on the root window.
A non GUI Vim with access to the X11 display (|xterm-clipboard| enabled), can A non GUI Vim with access to the X11 display (|xterm-clipboard| enabled), can
also act as a command server if a server name is explicitly given with the also act as a command server if a server name is explicitly given with the
--servername argument. --servername argument, or when Vim was build with the |+autoservername|
feature.
An empty --servername argument will cause the command server to be disabled. An empty --servername argument will cause the command server to be disabled.

View File

@ -1,4 +1,4 @@
*starting.txt* For Vim version 8.0. Last change: 2017 Nov 11 *starting.txt* For Vim version 8.0. Last change: 2017 Nov 18
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -58,9 +58,9 @@ filename One or more file names. The first one will be the current
that is read from stdin. The commands that would normally be that is read from stdin. The commands that would normally be
read from stdin will now be read from stderr. Example: > read from stdin will now be read from stderr. Example: >
find . -name "*.c" -print | vim - find . -name "*.c" -print | vim -
< The buffer will be marked modified, because it contains text < The buffer will not be marked as modified, so that it's easy
that needs to be saved. Except when in readonly mode, then to exit. Be careful to mark it as modified if you don't want
the buffer is not marked modified. Example: > to accidentally lose it. Example: >
ls | view - ls | view -
< <
Starting in Ex mode: > Starting in Ex mode: >
@ -421,7 +421,9 @@ a slash. Thus "-R" means recovery and "-/R" readonly.
*--not-a-term* *--not-a-term*
--not-a-term Tells Vim that the user knows that the input and/or output is --not-a-term Tells Vim that the user knows that the input and/or output is
not connected to a terminal. This will avoid the warning and not connected to a terminal. This will avoid the warning and
the two second delay that would happen. {not in Vi} the two second delay that would happen.
Also avoids the "Reading from stdin..." message.
{not in Vi}
*--ttyfail* *--ttyfail*
--ttyfail When the stdin or stdout is not a terminal (tty) then exit --ttyfail When the stdin or stdout is not a terminal (tty) then exit

View File

@ -74,12 +74,14 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
'backupskip' options.txt /*'backupskip'* 'backupskip' options.txt /*'backupskip'*
'balloondelay' options.txt /*'balloondelay'* 'balloondelay' options.txt /*'balloondelay'*
'ballooneval' options.txt /*'ballooneval'* 'ballooneval' options.txt /*'ballooneval'*
'balloonevalterm' options.txt /*'balloonevalterm'*
'balloonexpr' options.txt /*'balloonexpr'* 'balloonexpr' options.txt /*'balloonexpr'*
'bdir' options.txt /*'bdir'* 'bdir' options.txt /*'bdir'*
'bdlay' options.txt /*'bdlay'* 'bdlay' options.txt /*'bdlay'*
'beautify' vi_diff.txt /*'beautify'* 'beautify' vi_diff.txt /*'beautify'*
'belloff' options.txt /*'belloff'* 'belloff' options.txt /*'belloff'*
'beval' options.txt /*'beval'* 'beval' options.txt /*'beval'*
'bevalterm' options.txt /*'bevalterm'*
'bex' options.txt /*'bex'* 'bex' options.txt /*'bex'*
'bexpr' options.txt /*'bexpr'* 'bexpr' options.txt /*'bexpr'*
'bf' vi_diff.txt /*'bf'* 'bf' vi_diff.txt /*'bf'*
@ -505,7 +507,9 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
'noawa' options.txt /*'noawa'* 'noawa' options.txt /*'noawa'*
'nobackup' options.txt /*'nobackup'* 'nobackup' options.txt /*'nobackup'*
'noballooneval' options.txt /*'noballooneval'* 'noballooneval' options.txt /*'noballooneval'*
'noballoonevalterm' options.txt /*'noballoonevalterm'*
'nobeval' options.txt /*'nobeval'* 'nobeval' options.txt /*'nobeval'*
'nobevalterm' options.txt /*'nobevalterm'*
'nobin' options.txt /*'nobin'* 'nobin' options.txt /*'nobin'*
'nobinary' options.txt /*'nobinary'* 'nobinary' options.txt /*'nobinary'*
'nobiosk' options.txt /*'nobiosk'* 'nobiosk' options.txt /*'nobiosk'*
@ -1223,7 +1227,9 @@ $VIM_POSIX vi_diff.txt /*$VIM_POSIX*
+acl various.txt /*+acl* +acl various.txt /*+acl*
+arabic various.txt /*+arabic* +arabic various.txt /*+arabic*
+autocmd various.txt /*+autocmd* +autocmd various.txt /*+autocmd*
+autoservername various.txt /*+autoservername*
+balloon_eval various.txt /*+balloon_eval* +balloon_eval various.txt /*+balloon_eval*
+balloon_eval_term various.txt /*+balloon_eval_term*
+browse various.txt /*+browse* +browse various.txt /*+browse*
+builtin_terms various.txt /*+builtin_terms* +builtin_terms various.txt /*+builtin_terms*
+byte_offset various.txt /*+byte_offset* +byte_offset various.txt /*+byte_offset*
@ -4569,6 +4575,7 @@ E945 pattern.txt /*E945*
E946 terminal.txt /*E946* E946 terminal.txt /*E946*
E947 terminal.txt /*E947* E947 terminal.txt /*E947*
E948 terminal.txt /*E948* E948 terminal.txt /*E948*
E949 editing.txt /*E949*
E95 message.txt /*E95* E95 message.txt /*E95*
E96 diff.txt /*E96* E96 diff.txt /*E96*
E97 diff.txt /*E97* E97 diff.txt /*E97*
@ -5145,6 +5152,7 @@ backup-extension version4.txt /*backup-extension*
backup-table editing.txt /*backup-table* backup-table editing.txt /*backup-table*
balloon-eval debugger.txt /*balloon-eval* balloon-eval debugger.txt /*balloon-eval*
balloon_show() eval.txt /*balloon_show()* balloon_show() eval.txt /*balloon_show()*
balloon_split() eval.txt /*balloon_split()*
bar motion.txt /*bar* bar motion.txt /*bar*
bars help.txt /*bars* bars help.txt /*bars*
base_font_name_list mbyte.txt /*base_font_name_list* base_font_name_list mbyte.txt /*base_font_name_list*

View File

@ -1,4 +1,4 @@
*terminal.txt* For Vim version 8.0. Last change: 2017 Nov 12 *terminal.txt* For Vim version 8.0. Last change: 2017 Nov 17
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -106,6 +106,10 @@ BufWinEnter autocommand event is triggered. This makes it possible to set
options specifically for the window and buffer. Example: > options specifically for the window and buffer. Example: >
au BufWinEnter * if &buftype == 'terminal' | setlocal bufhidden=hide | endif au BufWinEnter * if &buftype == 'terminal' | setlocal bufhidden=hide | endif
Mouse events (click and drag) are passed to the terminal. Mouse move events
are only passed when Vim itself is receiving them. For a terminal that is
when 'balloonevalterm' is enabled.
Size and color ~ Size and color ~
*terminal-size-color* *terminal-size-color*
@ -335,6 +339,9 @@ to point to the right file, if needed. If you have both the 32-bit and 64-bit
version, rename to winpty32.dll and winpty64.dll to match the way Vim was version, rename to winpty32.dll and winpty64.dll to match the way Vim was
build. build.
Environment variables are used to pass information to the running job:
VIM_SERVERNAME v:servername
============================================================================== ==============================================================================
2. Remote testing *terminal-testing* 2. Remote testing *terminal-testing*

View File

@ -1,4 +1,4 @@
*todo.txt* For Vim version 8.0. Last change: 2017 Nov 11 *todo.txt* For Vim version 8.0. Last change: 2017 Nov 21
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -35,10 +35,6 @@ entered there will not be repeated below, unless there is extra information.
*known-bugs* *known-bugs*
-------------------- Known bugs and current work ----------------------- -------------------- Known bugs and current work -----------------------
Permission of viminfo tempfile can be wrong. (Simon Ruderich)
Always use 600 ? Also avoids groups problem.
patch from Simon Ruderich, Nov 8
No maintainer for Vietnamese translations. No maintainer for Vietnamese translations.
No maintainer for Simplified Chinese translations. No maintainer for Simplified Chinese translations.
@ -49,10 +45,6 @@ Terminal emulator window:
- Implement the right-click popup menu for the terminal. Can use the - Implement the right-click popup menu for the terminal. Can use the
completion popup menu code and mouse dragging. completion popup menu code and mouse dragging.
Use it for "set breakpoint", "remove breakpoint", etc. 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.
- get ideas from http://clewn.sf.net - get ideas from http://clewn.sf.net
- Look into the idevim plugin/script. - Look into the idevim plugin/script.
- Improve testing: - Improve testing:
@ -88,6 +80,8 @@ Terminal emulator window:
Although user could use "xterm -e 'cmd arg'". Although user could use "xterm -e 'cmd arg'".
Regexp problems: Regexp problems:
- When search pattern has the base character both with and without combining
character, search fails. E.g. "รรีบ" in "การรีบรักใคร". (agguser, #2312)
- [:space:] only matches ASCII spaces. Add [:white:] for all space-like - [:space:] only matches ASCII spaces. Add [:white:] for all space-like
characters, esp. including 0xa0. Use character class zero. characters, esp. including 0xa0. Use character class zero.
- Since 7.4.704 the old regex engine fails to match [[:print:]] in 0xf6. - Since 7.4.704 the old regex engine fails to match [[:print:]] in 0xf6.
@ -136,7 +130,7 @@ Regexp problems:
Include a few color schemes, based on popularity: 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://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 http://vimawesome.com/?q=tag:color-scheme
Use names that indicate their apperance (Christian Brabandt, 2017 Aug 3) Use names that indicate their appearance (Christian Brabandt, 2017 Aug 3)
- monokai - Xia Crusoe (2017 Aug 4) - monokai - Xia Crusoe (2017 Aug 4)
- seoul256 - Christian Brabandt (2017 Aug 3) - seoul256 - Christian Brabandt (2017 Aug 3)
- gruvbox - Christian Brabandt (2017 Aug 3) - gruvbox - Christian Brabandt (2017 Aug 3)
@ -147,6 +141,7 @@ Suggested by Hiroki Kokubun:
- [hybrid](https://github.com/w0ng/vim-hybrid) - [hybrid](https://github.com/w0ng/vim-hybrid)
Include solarized color scheme?, it does not support termguicolors. Include solarized color scheme?, it does not support termguicolors.
-> Make check for colorscheme that it's sane. -> Make check for colorscheme that it's sane.
- Sanitized version of pablo (Lifepillar, 2017 Nov 21)
Compiler warnings (geeknik, 2017 Oct 26): Compiler warnings (geeknik, 2017 Oct 26):
- signed integer overflow in do_sub() (#2249) - signed integer overflow in do_sub() (#2249)
@ -155,6 +150,13 @@ Compiler warnings (geeknik, 2017 Oct 26):
- signed integer overflow in nfa_regatom() (#2251) - signed integer overflow in nfa_regatom() (#2251)
- undefined left shift in get_string_tv() (#2250) - undefined left shift in get_string_tv() (#2250)
Patch to use imactivatefunc() also without +xim feature. (Yasuhiro Matsumoto,
2017 Nov 19, #2349)
'hlsearch' shows empty matches, which means highlighting everything.
Don't do that. For "foo\|" or "\v"
Patch from Christian, 2017 Nov 14. Should still display "$" matches.
When starting with --clean packages under "start" are not loaded. Make this When starting with --clean packages under "start" are not loaded. Make this
work: :packadd START {name} similar to :runtime START name work: :packadd START {name} similar to :runtime START name
@ -169,6 +171,12 @@ With foldmethod=syntax and nofoldenable comment highlighting isn't removed.
Using 'wildignore' also applies to literally entered file name. Also with Using 'wildignore' also applies to literally entered file name. Also with
:drop (remote commands). :drop (remote commands).
Race condition between stat() and open() in write_viminfo(). Use open() in the
loop and try another name instead of using a temp file. (Simon Ruderich)
The first one, when viminfo is new, should just fail if it creating with
O_EXCL fails.
Also use umask instead of mch_fopen() after vim_tempname().
"gvim --remote" from a directory with non-word characters changes the current "gvim --remote" from a directory with non-word characters changes the current
directory (Paulo Marcel Coelho Arabic, 2017 Oct 30, #2266) directory (Paulo Marcel Coelho Arabic, 2017 Oct 30, #2266)
Also see #1689. Also see #1689.
@ -176,19 +184,38 @@ Also see #1689.
ml_get error when using a Python. (Yggdroot, 2017 Jun 1, #1737) ml_get error when using a Python. (Yggdroot, 2017 Jun 1, #1737)
Lemonboy can reproduce (2017 Jun 5) Lemonboy can reproduce (2017 Jun 5)
Invalid range error when using BufWinLeave for closing terminal.
(Gabriel Barta, 2017 Nov 15, #2339)
ml_get errors with buggy script. (Dominique, 2017 Apr 30) ml_get errors with buggy script. (Dominique, 2017 Apr 30)
Error in emsg with buggy script. (Dominique, 2017 Apr 30) Error in emsg with buggy script. (Dominique, 2017 Apr 30)
Patch to avoid clearing the intro message on Win32 console.
(Ken Takata, 2017 Nov 14)
Patch to copy buffer-local options before buffer leaves the window. (Bjorn
Linse, 2017 Nov 14, #2336)
When a timer is running and typing CTRL-R on the command line, it is not When a timer is running and typing CTRL-R on the command line, it is not
redrawn properly. (xtal8, 2017 Oct 23, #2241) redrawn properly. (xtal8, 2017 Oct 23, #2241)
Universal solution to detect if t_RS is working, using cursor position. Universal solution to detect if t_RS is working, using cursor position.
Koichi Iwamoto, #2126 Koichi Iwamoto, #2126
Patch to fix cmdline abbreviation after '<,'>. (Christian Brabandt, 2017 Nov
13, on issue #2320)
Patch to add TextDeletePost and TextYankPost events. (Philippe Vaucher, 2011
May 24) Update May 26.
Now in patch by Lemonboy, #2333 (who is Lemonboy?)
Default install on MS-Windows should source defaults.vim. Default install on MS-Windows should source defaults.vim.
Ask whether to use Windows or Vim key behavior? Ask whether to use Windows or Vim key behavior?
Patch for improving detecting Ruby on Mac in configure. (Ilya Mikhaltsou, 2017
Nov 21)
When using command line window, CmdlineLeave is triggered without When using command line window, CmdlineLeave is triggered without
CmdlineEnter. (xtal8, 2017 Oct 30, #2263) CmdlineEnter. (xtal8, 2017 Oct 30, #2263)
Add some way to get the nested state. Although CmdwinEnter is obviously Add some way to get the nested state. Although CmdwinEnter is obviously
@ -196,9 +223,14 @@ always nested.
matchit hasn't been maintained for a long time. #955. matchit hasn't been maintained for a long time. #955.
Problem with 'delcombine'. (agguser, 2017 Nov 10, #2313)
MS-Windows: buffer completetion doesn't work when using backslash (or slash) MS-Windows: buffer completetion doesn't work when using backslash (or slash)
for a path separator. (xtal8, #2201) for a path separator. (xtal8, #2201)
Patch to adjust to DPI setting for GTK. (Roel van de Kraats, 2017 Nov 20,
#2357)
Test runtime files. Test runtime files.
Start with filetype detection: testdir/test_filetype.vim Start with filetype detection: testdir/test_filetype.vim
@ -217,15 +249,22 @@ Still happens (2017 Jul 9)
When bracketed paste is used, pasting at the ":append" prompt does not get the When bracketed paste is used, pasting at the ":append" prompt does not get the
line breaks. (Ken Takata, 2017 Aug 22) line breaks. (Ken Takata, 2017 Aug 22)
The ":move" command does not honor closed folds. (Ryan Lue, #2351)
Patch for 24 bit color support in MS-Windows console, using vcon. (Nobuhiro Patch for 24 bit color support in MS-Windows console, using vcon. (Nobuhiro
Takasaki, 2017 Oct 1, #2060). Ready to include now? Takasaki, Ken Takata, 2017 Oct 1, #2060).
Memory leaks in test_channel? (or is it because of fork()) Memory leaks in test_channel? (or is it because of fork())
Memory leak in test_arabic. Memory leak in test_arabic.
Using uninitialized value in test_crypt. Using uninitialized value in test_crypt.
Patch to clear background when "guibg=NONE" is used and 'termguicolors' is
set.
Patch to make gM move to middle of line. (Yasuhiro Matsumoto, Sep 8, #2070) Patch to make gM move to middle of line. (Yasuhiro Matsumoto, Sep 8, #2070)
Cannot copy modeless selection when cursor is inside it. (lkintact, #2300)
Include Haiku port. (Adrien Destugues, Siarzhuk Zharski, 2013 Oct 24) Include Haiku port. (Adrien Destugues, Siarzhuk Zharski, 2013 Oct 24)
It can replace the BeOS code, which is likely not used anymore. It can replace the BeOS code, which is likely not used anymore.
Now on github: #1856. Updated Oct 2017 Now on github: #1856. Updated Oct 2017
@ -290,8 +329,15 @@ Patch to add argument to :cquit. (Thinca, 2014 Oct 12)
Python: After "import vim" error messages only show the first line of the Python: After "import vim" error messages only show the first line of the
stack trace. (Yggdroot, 2017 Jul 28, #1887) stack trace. (Yggdroot, 2017 Jul 28, #1887)
Profile of a dict function is lost when the dict is deleted. Would it be
possible to collect this? (Daniel Hahler, #2350)
Patch to add "module" to quickfix entries. (Marcin Szamotulski, Coot, 2017 Jun Patch to add "module" to quickfix entries. (Marcin Szamotulski, Coot, 2017 Jun
8, #1757) 8, #1757) Now part of #2322. Or #2327? #1757 was re-opened, include that
first.
Add `:filter` support for various commands (Marcin Szamotulski, 2017 Nov 12
#2322) Now in #2327?
When checking if a bufref is valid, also check the buffer number, to catch the When checking if a bufref is valid, also check the buffer number, to catch the
case of :bwipe followed by :new. case of :bwipe followed by :new.
@ -1484,9 +1530,6 @@ Build problem with small features on Mac OS X 10.6. (Rainer, 2011 Jan 24)
"0g@$" puts '] on last byte of multi-byte. (ZyX, 2011 Jan 22) "0g@$" puts '] on last byte of multi-byte. (ZyX, 2011 Jan 22)
Patch to add TextDeletePost and TextYankPost events. (Philippe Vaucher, 2011
May 24) Update May 26.
Patch for :tabrecently. (Hirokazu Yoshida, 2012 Jan 30) Patch for :tabrecently. (Hirokazu Yoshida, 2012 Jan 30)
Problem with "syn sync grouphere". (Gustavo Niemeyer, 2011 Jan 27) Problem with "syn sync grouphere". (Gustavo Niemeyer, 2011 Jan 27)
@ -4653,7 +4696,7 @@ Command line history:
- Add "KeyWasTyped" flag: It's reset before each command and set when a - Add "KeyWasTyped" flag: It's reset before each command and set when a
character from the keyboard is consumed. Value is used to decide to put a character from the keyboard is consumed. Value is used to decide to put a
command line in history or not. Put line in history if it didn't command line in history or not. Put line in history if it didn't
completely resulted from one mapping. completely result from one mapping.
- When using ":browse", also put the resulting edit command in the history, - When using ":browse", also put the resulting edit command in the history,
so that it can be repeated. (Demirel) so that it can be repeated. (Demirel)

View File

@ -1,4 +1,4 @@
*usr_41.txt* For Vim version 8.0. Last change: 2017 Oct 15 *usr_41.txt* For Vim version 8.0. Last change: 2017 Nov 19
VIM USER MANUAL - by Bram Moolenaar VIM USER MANUAL - by Bram Moolenaar
@ -886,6 +886,7 @@ GUI: *gui-functions*
getwinposx() X position of the GUI Vim window getwinposx() X position of the GUI Vim window
getwinposy() Y position of the GUI Vim window getwinposy() Y position of the GUI Vim window
balloon_show() set the balloon content balloon_show() set the balloon content
balloon_split() split a message for a balloon
Vim server: *server-functions* Vim server: *server-functions*
serverlist() return the list of server names serverlist() return the list of server names

View File

@ -1,4 +1,4 @@
*various.txt* For Vim version 8.0. Last change: 2017 Sep 16 *various.txt* For Vim version 8.0. Last change: 2017 Nov 18
VIM REFERENCE MANUAL by Bram Moolenaar VIM REFERENCE MANUAL by Bram Moolenaar
@ -310,9 +310,12 @@ g8 Print the hex values of the bytes used in the
B *+arabic* |Arabic| language support B *+arabic* |Arabic| language support
N *+autocmd* |:autocmd|, automatic commands N *+autocmd* |:autocmd|, automatic commands
H *+autoservername* Automatically enable |clientserver| H *+autoservername* Automatically enable |clientserver|
m *+balloon_eval* |balloon-eval| support. Included when compiling with m *+balloon_eval* |balloon-eval| support in the GUI. Included when
supported GUI (Motif, GTK, GUI) and either compiling with supported GUI (Motif, GTK, GUI) and
Netbeans/Sun Workshop integration or |+eval| feature. either Netbeans/Sun Workshop integration or |+eval|
feature.
H *+balloon_eval_term* |balloon-eval| support in the terminal,
'balloonevalterm'
N *+browse* |:browse| command N *+browse* |:browse| command
N *+builtin_terms* some terminals builtin |builtin-terms| N *+builtin_terms* some terminals builtin |builtin-terms|
B *++builtin_terms* maximal terminals builtin |builtin-terms| B *++builtin_terms* maximal terminals builtin |builtin-terms|

View File

@ -1,7 +1,7 @@
" Vim support file to detect file types " Vim support file to detect file types
" "
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2017 Nov 11 " Last Change: 2017 Nov 21
" Listen very carefully, I will say this only once " Listen very carefully, I will say this only once
if exists("did_load_filetypes") if exists("did_load_filetypes")
@ -231,10 +231,10 @@ au BufNewFile,BufRead *.bl setf blank
au BufNewFile,BufRead */etc/blkid.tab,*/etc/blkid.tab.old setf xml au BufNewFile,BufRead */etc/blkid.tab,*/etc/blkid.tab.old setf xml
" Bazel (http://bazel.io) " Bazel (http://bazel.io)
autocmd BufRead,BufNewFile *.bzl,WORKSPACE setf bzl autocmd BufRead,BufNewFile *.bzl,WORKSPACE,BUILD.bazel setf bzl
if has("fname_case") if has("fname_case")
" There is another check for BUILD further below. " There is another check for BUILD further below.
autocmd BufRead,BufNewFile BUILD setf bzl autocmd BufRead,BufNewFile BUILD setf bzl
endif endif
" C or lpc " C or lpc

View File

@ -1,7 +1,7 @@
" These commands create the option window. " These commands create the option window.
" "
" Maintainer: Bram Moolenaar <Bram@vim.org> " Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2017 Oct 19 " Last Change: 2017 Nov 21
" If there already is an option window, jump to that one. " If there already is an option window, jump to that one.
let buf = bufnr('option-window') let buf = bufnr('option-window')
@ -647,11 +647,17 @@ if has("gui")
endif endif
call append("$", "linespace\tnumber of pixel lines to use between characters") call append("$", "linespace\tnumber of pixel lines to use between characters")
call append("$", " \tset lsp=" . &lsp) call append("$", " \tset lsp=" . &lsp)
if has("balloon_eval") if has("balloon_eval") || has("balloon_eval_term")
call append("$", "balloondelay\tdelay in milliseconds before a balloon may pop up") call append("$", "balloondelay\tdelay in milliseconds before a balloon may pop up")
call append("$", " \tset bdlay=" . &bdlay) call append("$", " \tset bdlay=" . &bdlay)
call append("$", "ballooneval\twhether the balloon evaluation is to be used") if has("balloon_eval")
call <SID>BinOptionG("beval", &beval) call append("$", "ballooneval\tuse balloon evaluation in the GUI")
call <SID>BinOptionG("beval", &beval)
endif
if has("balloon_eval_term")
call append("$", "balloonevalterm\tuse balloon evaluation in the terminal")
call <SID>BinOptionG("bevalterm", &beval)
endif
if has("eval") if has("eval")
call append("$", "balloonexpr\texpression to show in balloon eval") call append("$", "balloonexpr\texpression to show in balloon eval")
call append("$", " \tset bexpr=" . &bexpr) call append("$", " \tset bexpr=" . &bexpr)

View File

@ -127,9 +127,11 @@ func s:StartDebug(cmd)
call win_gotoid(s:gdbwin) call win_gotoid(s:gdbwin)
" Enable showing a balloon with eval info " Enable showing a balloon with eval info
if has("balloon_eval") if has("balloon_eval") || has("balloon_eval_term")
set ballooneval
set balloonexpr=TermDebugBalloonExpr() set balloonexpr=TermDebugBalloonExpr()
if has("balloon_eval")
set ballooneval
endif
if has("balloon_eval_term") if has("balloon_eval_term")
set balloonevalterm set balloonevalterm
endif endif
@ -158,9 +160,11 @@ func s:EndDebug(job, status)
let &columns = s:save_columns let &columns = s:save_columns
endif endif
if has("balloon_eval") if has("balloon_eval") || has("balloon_eval_term")
set noballooneval
set balloonexpr= set balloonexpr=
if has("balloon_eval")
set noballooneval
endif
if has("balloon_eval_term") if has("balloon_eval_term")
set noballoonevalterm set noballoonevalterm
endif endif
@ -366,6 +370,7 @@ func s:HandleError(msg)
if a:msg =~ 'No symbol .* in current context' if a:msg =~ 'No symbol .* in current context'
\ || a:msg =~ 'Cannot access memory at address ' \ || a:msg =~ 'Cannot access memory at address '
\ || a:msg =~ 'Attempt to use a type name as an expression' \ || a:msg =~ 'Attempt to use a type name as an expression'
\ || a:msg =~ 'A syntax error in expression,'
" Result of s:SendEval() failed, ignore. " Result of s:SendEval() failed, ignore.
return return
endif endif

View File

@ -2,11 +2,10 @@
" Language: doxygen on top of c, cpp, idl, java, php " Language: doxygen on top of c, cpp, idl, java, php
" Maintainer: Michael Geddes <vimmer@frog.wheelycreek.net> " Maintainer: Michael Geddes <vimmer@frog.wheelycreek.net>
" Author: Michael Geddes " Author: Michael Geddes
" Last Changes: Jan 2009 (\tparam by Domnique Pelle, Aug 2013) " Last Change: November 2017 (\throws by Candy Gumdrop)
" Nov 2017 (@throws by Domnique Pelle) " Version: 1.27
" Version: 1.23
" "
" Copyright 2004-2008 Michael Geddes " Copyright 2004-2017 Michael Geddes
" Please feel free to use, modify & distribute all or part of this script, " Please feel free to use, modify & distribute all or part of this script,
" providing this copyright message remains. " providing this copyright message remains.
" I would appreciate being acknowledged in any derived scripts, and would " I would appreciate being acknowledged in any derived scripts, and would
@ -59,52 +58,76 @@ try
" "
" C/C++ Style line comments " C/C++ Style line comments
syn region doxygenComment start=+/\*\(\*/\)\@![*!]+ end=+\*/+ contains=doxygenSyncStart,doxygenStart,doxygenTODO keepend fold containedin=phpRegion syn match doxygenCommentWhite +\s*\ze/\*\(\*/\)\@![*!]+ containedin=phpRegion
syn region doxygenCommentL start=+//[/!]<\@!+me=e-1 end=+$+ contains=doxygenStartL,@Spell keepend skipwhite skipnl nextgroup=doxygenComment2 fold containedin=phpRegion syn match doxygenCommentWhite +\s*\ze//[/!]+ containedin=phpRegion
syn match doxygenCommentWhite +\s*\ze/\*\(\*/\)\@![*!]+
syn match doxygenCommentWhite +\s*\ze//[/!]+ containedin=phpRegion
syn region doxygenComment start=+/\*\(\*/\)\@![*!]+ end=+\*/+ contains=doxygenSyncStart,doxygenStart,doxygenTODO,doxygenLeadingWhite keepend fold containedin=phpRegion
syn region doxygenCommentL start=+//[/!]<\@!+me=e-1 end=+$+ contains=doxygenLeadingLWhite,doxygenStartL,@Spell keepend skipwhite skipnl nextgroup=doxygenCommentWhite2 fold containedin=phpRegion
syn region doxygenCommentL start=+//[/!]<+me=e-2 end=+$+ contains=doxygenStartL,@Spell keepend skipwhite skipnl fold containedin=phpRegion syn region doxygenCommentL start=+//[/!]<+me=e-2 end=+$+ contains=doxygenStartL,@Spell keepend skipwhite skipnl fold containedin=phpRegion
syn region doxygenCommentL start=+//@\ze[{}]+ end=+$+ contains=doxygenGroupDefine,doxygenGroupDefineSpecial,@Spell fold containedin=phpRegion syn region doxygenCommentL start=+//@\ze[{}]+ end=+$+ contains=doxygenGroupDefine,doxygenGroupDefineSpecial,@Spell fold containedin=phpRegion
syn region doxygenComment start=+/\*@\ze[{}]+ end=+\*/+ contains=doxygenGroupDefine,doxygenGroupDefineSpecial,@Spell fold containedin=phpRegion
" Single line brief followed by multiline comment. " Single line brief followed by multiline comment.
syn match doxygenCommentWhite2 +\_s*\ze/\*\(\*/\)\@![*!]+ contained nextgroup=doxygenComment2
syn region doxygenComment2 start=+/\*\(\*/\)\@![*!]+ end=+\*/+ contained contains=doxygenSyncStart2,doxygenStart2,doxygenTODO keepend fold syn region doxygenComment2 start=+/\*\(\*/\)\@![*!]+ end=+\*/+ contained contains=doxygenSyncStart2,doxygenStart2,doxygenTODO keepend fold
" This helps with sync-ing as for some reason, syncing behaves differently to a normal region, and the start pattern does not get matched. " This helps with sync-ing as for some reason, syncing behaves differently to a normal region, and the start pattern does not get matched.
syn match doxygenSyncStart2 +[^*/]+ contained nextgroup=doxygenBody,doxygenPrev,doxygenStartSpecial,doxygenSkipComment,doxygenStartSkip2 skipwhite skipnl syn match doxygenSyncStart2 +[^*/]+ contained nextgroup=doxygenBody,doxygenPrev,doxygenStartSpecial,doxygenSkipComment,doxygenStartSkip2 skipwhite skipnl
" Skip empty lines at the start for when comments start on the 2nd/3rd line. " Skip empty lines at the start for when comments start on the 2nd/3rd line.
syn match doxygenStartSkip2 +^\s*\*[^/]+me=e-1 contained nextgroup=doxygenBody,doxygenStartSpecial,doxygenStartSkip skipwhite skipnl syn match doxygenStartSkip2 +^\s*\*[^/]+me=e-1 contained nextgroup=doxygenBody,doxygenStartSpecial,doxygenStartSkipWhite skipwhite skipnl
syn match doxygenStartSkip2 +^\s*\*$+ contained nextgroup=doxygenBody,doxygenStartSpecial,,doxygenStartSkip skipwhite skipnl syn match doxygenStartSkip2 +^\s*\*$+ contained nextgroup=doxygenBody,doxygenStartSpecial,doxygenStartSkipWhite skipwhite skipnl
syn match doxygenStart2 +/\*[*!]+ contained nextgroup=doxygenBody,doxygenPrev,doxygenStartSpecial,doxygenStartSkip2 skipwhite skipnl syn match doxygenStart2 +/\*[*!]+ contained nextgroup=doxygenBody,doxygenPrev,doxygenStartSpecial,doxygenStartSkip2 skipwhite skipnl
" Match the Starting pattern (effectively creating the start of a BNF) " Match the Starting pattern (effectively creating the start of a BNF)
if !exists('g:doxygen_javadoc_autobrief') || g:doxygen_javadoc_autobrief if !exists('g:doxygen_javadoc_autobrief') || g:doxygen_javadoc_autobrief
syn match doxygenStart +/\*[*!]+ contained nextgroup=doxygenBrief,doxygenPrev,doxygenFindBriefSpecial,doxygenStartSpecial,doxygenStartSkip,doxygenPage skipwhite skipnl syn match doxygenStart +/\*[*!]+ contained nextgroup=doxygenBrief,doxygenPrev,doxygenFindBriefSpecial,doxygenStartSpecial,doxygenStartSkipWhite,doxygenPage skipwhite skipnl
syn match doxygenStartL +//[/!]+ contained nextgroup=doxygenPrevL,doxygenBriefL,doxygenSpecial skipwhite syn match doxygenLeadingLWhite +\s\++ contained nextgroup=doxygenPrevL,doxygenBriefL,doxygenSpecial
syn match doxygenStartL +//[/!]+ contained nextgroup=doxygenLeaingLWhite,doxygenPrevL,doxygenBriefL,doxygenSpecial
" Match the first sentence as a brief comment " Match the first sentence as a brief comment
if ! exists('g:doxygen_end_punctuation') if ! exists('g:doxygen_end_punctuation')
let g:doxygen_end_punctuation='[.]' let g:doxygen_end_punctuation='[.]'
endif endif
exe 'syn region doxygenBrief contained start=+[\\@]\([npcbea]\>\|em\>\|ref\>\|link\>\|f\$\|[$\\&<>#]\)\|[^ \t\\@*]+ start=+\(^\s*\)\@<!\*/\@!+ start=+\<\k+ skip=+'.doxygen_end_punctuation.'\S\@=+ end=+'.doxygen_end_punctuation.'+ end=+\(\s*\(\n\s*\*\=\s*\)[@\\]\([npcbea]\>\|em\>\|ref\>\|link\>\|f\$\|[$\\&<>#]\)\@!\)\@=+ contains=doxygenSmallSpecial,doxygenContinueComment,doxygenBriefEndComment,doxygenFindBriefSpecial,doxygenSmallSpecial,@doxygenHtmlGroup,doxygenTODO,doxygenHyperLink,doxygenHashLink,@Spell skipnl nextgroup=doxygenBody' exe 'syn region doxygenBrief contained start=+[\\@]\([npcbea]\>\|em\>\|ref\>\|link\>\|f\$\|[$\\&<>#]\)\|[^ \t\\@*]+ start=+\(^\s*\)\@<!\*/\@!+ start=+\<\k+ skip=+'.doxygen_end_punctuation.'\S\@=+ end=+'.doxygen_end_punctuation.'+ end=+\(\s*\(\n\s*\*\=\s*\)[@\\]\([npcbea]\>\|em\>\|ref\>\|link\>\|f\$\|[$\\&<>#]\)\@!\)\@=+ contains=doxygenSmallSpecial,doxygenContinueCommentWhite,doxygenLeadingWhite,doxygenBriefEndComment,doxygenFindBriefSpecial,doxygenSmallSpecial,@doxygenHtmlGroup,doxygenTODO,doxygenHyperLink,doxygenHashLink,@Spell skipnl nextgroup=doxygenBody'
syn match doxygenBriefEndComment +\*/+ contained syn match doxygenBriefEndComment +\*/+ contained
exe 'syn region doxygenBriefL start=+@\k\@!\|[\\@]\([npcbea]\>\|em\>\|ref\>\|link\>\|f\$\|[$\\&<>#]\)\|[^ \t\\@]+ start=+\<+ skip=+'.doxygen_end_punctuation.'\S+ end=+'.doxygen_end_punctuation.'\|$+ contained contains=doxygenSmallSpecial,doxygenHyperLink,doxygenHashLink,@doxygenHtmlGroup,@Spell keepend' exe 'syn region doxygenBriefL start=+@\k\@!\|[\\@]\([npcbea]\>\|em\>\|ref\>\|link\>\|f\$\|[$\\&<>#]\)\|[^ \t\\@]+ start=+\<+ skip=+'.doxygen_end_punctuation.'\S+ end=+'.doxygen_end_punctuation.'\|$+ contained contains=doxygenSmallSpecial,doxygenHyperLink,doxygenHashLink,@doxygenHtmlGroup,@Spell keepend'
syn match doxygenPrevL +<+ contained nextgroup=doxygenBriefL,doxygenSpecial skipwhite syn match doxygenPrevL +<+ contained nextgroup=doxygenBriefL,doxygenSpecial skipwhite
else else
syn match doxygenStart +/\*[*!]+ contained nextgroup=doxygenBody,doxygenPrev,doxygenFindBriefSpecial,doxygenStartSpecial,doxygenStartSkip,doxygenPage skipwhite skipnl syn match doxygenStart +/\*[*!]+ contained nextgroup=doxygenBody,doxygenPrev,doxygenFindBriefSpecial,doxygenStartSpecial,doxygenStartSkipWhite,doxygenPage skipwhite skipnl
syn match doxygenStartL +//[/!]+ contained nextgroup=doxygenPrevL,doxygenLine,doxygenSpecial skipwhite syn match doxygenStartL +//[/!]+ contained nextgroup=doxygenLeadingLWhite,doxygenPrevL,doxygenLine,doxygenSpecial
syn match doxygenLeadingLWhite +\s\++ contained nextgroup=doxygenPrevL,doxygenLine,doxygenSpecial
syn region doxygenLine start=+@\k\@!\|[\\@]\([npcbea]\>\|em\>\|ref\>\|link\>\|f\$\|[$\\&<>#]\)\|[^ \t\\@<]+ start=+\<+ end='$' contained contains=doxygenSmallSpecial,doxygenHyperLink,doxygenHashLink,@doxygenHtmlGroup,@Spell keepend syn region doxygenLine start=+@\k\@!\|[\\@]\([npcbea]\>\|em\>\|ref\>\|link\>\|f\$\|[$\\&<>#]\)\|[^ \t\\@<]+ start=+\<+ end='$' contained contains=doxygenSmallSpecial,doxygenHyperLink,doxygenHashLink,@doxygenHtmlGroup,@Spell keepend
syn match doxygenPrevL +<+ contained nextgroup=doxygenLine,doxygenSpecial skipwhite syn match doxygenPrevL +<+ contained nextgroup=doxygenLine,doxygenSpecial skipwhite
endif endif
" This helps with sync-ing as for some reason, syncing behaves differently to a normal region, and the start pattern does not get matched. " This helps with sync-ing as for some reason, syncing behaves differently to a normal region, and the start pattern does not get matched.
syn match doxygenSyncStart +\ze[^*/]+ contained nextgroup=doxygenBrief,doxygenPrev,doxygenStartSpecial,doxygenFindBriefSpecial,doxygenStartSkip,doxygenPage skipwhite skipnl syn match doxygenSyncStart +\ze[^*/]+ contained nextgroup=doxygenBrief,doxygenPrev,doxygenStartSpecial,doxygenFindBriefSpecial,doxygenStartSkipWhite,doxygenPage skipwhite skipnl
" Match an [@\]brief so that it moves to body-mode.
"
"
" syn match doxygenBriefLine contained
syn match doxygenBriefSpecial contained +[@\\]+ nextgroup=doxygenBriefWord skipwhite
" syn region doxygenFindBriefSpecial start=+[@\\]brief\>+ end=+\(\n\s*\*\=\s*\([@\\]\([npcbea]\>\|em\>\|ref\>\|link\>\|f\$\|[$\\&<>#]\)\@!\)\|\s*$\)\@=+ keepend contains=doxygenBriefSpecial nextgroup=doxygenBody keepend skipwhite skipnl contained
syn region doxygenFindBriefSpecial start=+[@\\]brief\>+ skip=+^\s*\(\*/\@!\s*\)\=\(\<\|[@\\]\<\([npcbea]\>\|em\>\|ref\|link\>\>\|f\$\|[$\\&<>#]\)\|[^ \t\\@*]\)+ end=+^+ keepend contains=doxygenBriefSpecial nextgroup=doxygenBody keepend skipwhite skipnl contained
" end=+\(\n\s*\*\=\s*\([@\\]\([npcbea]\>\|em\>\|ref\>\|link\>\|f\$\|[$\\&<>#]\)\@!\)\|\s*$\)\@=+
"syn region doxygenBriefLine contained start=+\<\k+ skip=+^\s*\(\*/\@!\s*\)\=\(\<\|[@\\]\<\([npcbea]\>\|em\>\|ref\|link\>\>\|f\$\|[$\\&<>#]\)\|[^ \t\\@*]\)+ end=+^+ contains=doxygenContinueCommentWhite,doxygenSmallSpecial,@doxygenHtmlGroup,doxygenTODO,doxygenHyperLink,doxygenHashLink,@Spell skipwhite keepend matchgroup=xxx
syn region doxygenBriefLine contained start=+\<\k+ skip=+^\s*\(\*/\@!\s*\)\=\(\<\|[@\\]\<\([npcbea]\>\|em\>\|ref\|link\>\>\|f\$\|[$\\&<>#]\)\|[^ \t\\@*]\)+ end=+^+ skipwhite keepend matchgroup=xxx
" syn region doxygenBriefLine matchgroup=xxxy contained start=+\<\k.\++ skip=+^\s*\k+ end=+end+ skipwhite keepend
"doxygenFindBriefSpecial,
"" syn region doxygenSpecialMultilineDesc start=+.\++ contained contains=doxygenSpecialContinueCommentWhite,doxygenSmallSpecial,doxygenHyperLink,doxygenHashLink,@doxygenHtmlGroup,@Spell skipwhite keepend
syn region doxygenBriefLine contained start=+\<\k+ end=+\(\n\s*\*\=\s*\([@\\]\([npcbea]\>\|em\>\|ref\>\|link\>\|f\$\|[$\\&<>#]\)\@!\)\|\s*$\)\@=+ contains=doxygenContinueComment,doxygenFindBriefSpecial,doxygenSmallSpecial,@doxygenHtmlGroup,doxygenTODO,doxygenHyperLink,doxygenHashLink,@Spell skipwhite keepend
" Match a '<' for applying a comment to the previous element. " Match a '<' for applying a comment to the previous element.
syn match doxygenPrev +<+ contained nextgroup=doxygenBrief,doxygenBody,doxygenSpecial,doxygenStartSkip skipwhite syn match doxygenPrev +<+ contained nextgroup=doxygenBrief,doxygenBody,doxygenSpecial,doxygenStartSkipWhite skipwhite
if exists("c_comment_strings") if exists("c_comment_strings")
" These are anti-Doxygen comments. If there are more than two asterisks or 3 '/'s " These are anti-Doxygen comments. If there are more than two asterisks or 3 '/'s
@ -123,10 +146,11 @@ endif
"syn region doxygenBodyBit contained start=+$+ "syn region doxygenBodyBit contained start=+$+
" The main body of a doxygen comment. " The main body of a doxygen comment.
syn region doxygenBody contained start=+\(/\*[*!]\)\@<!<\|[^<]\|$+ matchgroup=doxygenEndComment end=+\*/+re=e-2,me=e-2 contains=doxygenContinueComment,doxygenTODO,doxygenSpecial,doxygenSmallSpecial,doxygenHyperLink,doxygenHashLink,@doxygenHtmlGroup,@Spell syn region doxygenBody contained start=+\(/\*[*!]\)\@<!<\|[^<]\|$+ matchgroup=doxygenEndComment end=+\*/+re=e-2,me=e-2 contains=doxygenContinueCommentWhite,doxygenTODO,doxygenSpecial,doxygenSmallSpecial,doxygenHyperLink,doxygenHashLink,@doxygenHtmlGroup,@Spell
" These allow the skipping of comment continuation '*' characters. " These allow the skipping of comment continuation '*' characters.
syn match doxygenContinueComment contained +^\s*\*/\@!\s*+ syn match doxygenContinueCommentWhite contained +^\s*\ze\*+ nextgroup=doxygenContinueComment
syn match doxygenContinueComment contained +\*/\@!+
" Catch a Brief comment without punctuation - flag it as an error but " Catch a Brief comment without punctuation - flag it as an error but
" make sure the end comment is picked up also. " make sure the end comment is picked up also.
@ -135,27 +159,19 @@ endif
" Skip empty lines at the start for when comments start on the 2nd/3rd line. " Skip empty lines at the start for when comments start on the 2nd/3rd line.
if !exists('g:doxygen_javadoc_autobrief') || g:doxygen_javadoc_autobrief if !exists('g:doxygen_javadoc_autobrief') || g:doxygen_javadoc_autobrief
syn match doxygenStartSkip +^\s*\*[^/]+me=e-1 contained nextgroup=doxygenBrief,doxygenStartSpecial,doxygenFindBriefSpecial,doxygenStartSkip,doxygenPage skipwhite skipnl syn match doxygenStartSkipWhite +^\s*\ze\*/\@!+ contained nextgroup=doxygenBrief,doxygenStartSpecial,doxygenFindBriefSpecial,doxygenStartSkipWhite,doxygenPage skipwhite skipnl
syn match doxygenStartSkip +^\s*\*$+ contained nextgroup=doxygenBrief,doxygenStartSpecial,doxygenFindBriefSpecial,doxygenStartSkip,doxygenPage skipwhite skipnl "syn match doxygenStartSkipWhite +^\s*\ze\*$+ contained nextgroup=doxygenBrief,doxygenStartSpecial,doxygenFindBriefSpecial,doxygenStartSkipWhite,doxygenPage skipwhite skipnl
else else
syn match doxygenStartSkip +^\s*\*[^/]+me=e-1 contained nextgroup=doxygenStartSpecial,doxygenFindBriefSpecial,doxygenStartSkip,doxygenPage,doxygenBody skipwhite skipnl syn match doxygenStartSkipWhite +^\s*\*[^/]+me=e-1 contained nextgroup=doxygenStartSpecial,doxygenFindBriefSpecial,doxygenStartSkipWhite,doxygenPage,doxygenBody skipwhite skipnl
syn match doxygenStartSkip +^\s*\*$+ contained nextgroup=doxygenStartSpecial,doxygenFindBriefSpecial,doxygenStartSkip,doxygenPage,doxygenBody skipwhite skipnl syn match doxygenStartSkipWhite +^\s*\*$+ contained nextgroup=doxygenStartSpecial,doxygenFindBriefSpecial,doxygenStartSkipWhite,doxygenPage,doxygenBody skipwhite skipnl
endif endif
" Match an [@\]brief so that it moves to body-mode.
"
"
" syn match doxygenBriefLine contained
syn match doxygenBriefSpecial contained +[@\\]+ nextgroup=doxygenBriefWord skipwhite
syn region doxygenFindBriefSpecial start=+[@\\]brief\>+ end=+\(\n\s*\*\=\s*\([@\\]\([npcbea]\>\|em\>\|ref\>\|link\>\|f\$\|[$\\&<>#]\)\@!\)\|\s*$\)\@=+ keepend contains=doxygenBriefSpecial nextgroup=doxygenBody keepend skipwhite skipnl contained
" Create the single word matching special identifiers. " Create the single word matching special identifiers.
fun! s:DxyCreateSmallSpecial( kword, name ) fun! s:DxyCreateSmallSpecial( kword, name )
let mx='[-:0-9A-Za-z_%=&+*/!~>|]\@<!\([-0-9A-Za-z_%=+*/!~>|#]\+[-0-9A-Za-z_%=+*/!~>|]\@!\|\\[\\<>&.]@\|[.,][0-9a-zA-Z_]\@=\|::\|([^)]*)\|&[0-9a-zA-Z]\{2,7};\)\+' let mx='[-:0-9A-Za-z_%=&+*/!~>|]\@<!\([-0-9A-Za-z_%=+*/!~>|#]\+[-0-9A-Za-z_%=+*/!~>|]\@!\|\\[\\<>&.]@\|[.,][0-9a-zA-Z_]\@=\|::\|([^)]*)\|&[0-9a-zA-Z]\{2,7};\)\+'
exe 'syn region doxygenSpecial'.a:name.'Word contained start=+'.a:kword.'+ end=+\(\_s\+'.mx.'\)\@<=[-a-zA-Z_0-9+*/^%|~!=&\\]\@!+ skipwhite contains=doxygenContinueComment,doxygen'.a:name.'Word' exe 'syn region doxygenSpecial'.a:name.'Word contained start=+'.a:kword.'+ end=+\(\_s\+'.mx.'\)\@<=[-a-zA-Z_0-9+*/^%|~!=&\\]\@!+ skipwhite contains=doxygenContinueCommentWhite,doxygen'.a:name.'Word'
exe 'syn match doxygen'.a:name.'Word contained "\_s\@<='.mx.'" contains=doxygenHtmlSpecial,@Spell keepend' exe 'syn match doxygen'.a:name.'Word contained "\_s\@<='.mx.'" contains=doxygenHtmlSpecial,@Spell keepend'
endfun endfun
call s:DxyCreateSmallSpecial('p', 'Code') call s:DxyCreateSmallSpecial('p', 'Code')
@ -180,40 +196,42 @@ endif
" Match parameters and retvals (highlighting the first word as special). " Match parameters and retvals (highlighting the first word as special).
syn match doxygenParamDirection contained "\v\[(\s*in>((]\s*\[|\s*,\s*)out>)=|out>((]\s*\[|\s*,\s*)in>)=)\]" nextgroup=doxygenParamName skipwhite syn match doxygenParamDirection contained "\v\[(\s*in>((]\s*\[|\s*,\s*)out>)=|out>((]\s*\[|\s*,\s*)in>)=)\]" nextgroup=doxygenParamName skipwhite
syn keyword doxygenParam contained param tparam nextgroup=doxygenParamName,doxygenParamDirection skipwhite syn keyword doxygenParam contained param nextgroup=doxygenParamName,doxygenParamDirection skipwhite
syn keyword doxygenTParam contained tparam nextgroup=doxygenParamName skipwhite
syn match doxygenParamName contained +[A-Za-z0-9_:]\++ nextgroup=doxygenSpecialMultilineDesc skipwhite syn match doxygenParamName contained +[A-Za-z0-9_:]\++ nextgroup=doxygenSpecialMultilineDesc skipwhite
syn keyword doxygenRetval contained retval throw throws exception nextgroup=doxygenParamName skipwhite syn keyword doxygenRetval contained retval throw throws exception nextgroup=doxygenParamName skipwhite
" Match one line identifiers. " Match one line identifiers.
syn keyword doxygenOther contained addindex anchor syn keyword doxygenOther contained addindex anchor
\ dontinclude endhtmlonly endlatexonly showinitializer hideinitializer \ dontinclude endhtmlonly endlatexonly showinitializer hideinitializer
\ example htmlonly image include ingroup internal latexonly line \ example htmlonly image include includelineno ingroup internal latexonly line
\ overload related relates relatedalso relatesalso sa skip skipline \ overload relates relatesalso sa skip skipline
\ until verbinclude version addtogroup htmlinclude copydoc dotfile \ until verbinclude version addtogroup htmlinclude copydoc dotfile
\ xmlonly endxmlonly \ xmlonly endxmlonly
\ nextgroup=doxygenSpecialOnelineDesc \ nextgroup=doxygenSpecialOnelineDesc copybrief copydetails copyright dir extends
\ implements
syn region doxygenCodeRegion contained matchgroup=doxygenOther start=+\<code\>+ matchgroup=doxygenOther end=+[\\@]\@<=\<endcode\>+ contains=doxygenCodeRegionSpecial,doxygenContinueComment,doxygenErrorComment,@NoSpell syn region doxygenCodeRegion contained matchgroup=doxygenOther start=+\<code\>+ matchgroup=doxygenOther end=+[\\@]\@<=\<endcode\>+ contains=doxygenCodeRegionSpecial,doxygenContinueCommentWhite,doxygenErrorComment,@NoSpell
syn match doxygenCodeRegionSpecial contained +[\\@]\(endcode\>\)\@=+ syn match doxygenCodeRegionSpecial contained +[\\@]\(endcode\>\)\@=+
syn region doxygenVerbatimRegion contained matchgroup=doxygenOther start=+\<verbatim\>+ matchgroup=doxygenOther end=+[\\@]\@<=\<endverbatim\>+ contains=doxygenVerbatimRegionSpecial,doxygenContinueComment,doxygenErrorComment,@NoSpell syn region doxygenVerbatimRegion contained matchgroup=doxygenOther start=+\<verbatim\>+ matchgroup=doxygenOther end=+[\\@]\@<=\<endverbatim\>+ contains=doxygenVerbatimRegionSpecial,doxygenContinueCommentWhite,doxygenErrorComment,@NoSpell
syn match doxygenVerbatimRegionSpecial contained +[\\@]\(endverbatim\>\)\@=+ syn match doxygenVerbatimRegionSpecial contained +[\\@]\(endverbatim\>\)\@=+
if exists('b:current_syntax') if exists('b:current_syntax')
let b:doxygen_syntax_save=b:current_syntax let b:doxygen_syntax_save=b:current_syntax
unlet b:current_syntax unlet b:current_syntax
endif endif
syn include @Dotx syntax/dot.vim syn include @Dotx syntax/dot.vim
if exists('b:doxygen_syntax_save') if exists('b:doxygen_syntax_save')
let b:current_syntax=b:doxygen_syntax_save let b:current_syntax=b:doxygen_syntax_save
unlet b:doxygen_syntax_save unlet b:doxygen_syntax_save
else else
unlet b:current_syntax unlet b:current_syntax
endif endif
syn region doxygenDotRegion contained matchgroup=doxygenOther start=+\<dot\>+ matchgroup=doxygenOther end=+[\\@]\@<=\<enddot\>+ contains=doxygenDotRegionSpecial,doxygenErrorComment,doxygenContinueComment,@NoSpell,@Dotx syn region doxygenDotRegion contained matchgroup=doxygenOther start=+\<dot\>+ matchgroup=doxygenOther end=+[\\@]\@<=\<enddot\>+ contains=doxygenDotRegionSpecial,doxygenErrorComment,doxygenContinueCommentWhite,@NoSpell,@Dotx
syn match doxygenDotRegionSpecial contained +[\\@]\(enddot\>\)\@=+ syn match doxygenDotRegionSpecial contained +[\\@]\(enddot\>\)\@=+
" Match single line identifiers. " Match single line identifiers.
@ -224,13 +242,13 @@ endif
syn keyword doxygenOther contained par nextgroup=doxygenHeaderLine syn keyword doxygenOther contained par nextgroup=doxygenHeaderLine
syn region doxygenHeaderLine start=+.+ end=+^+ contained skipwhite nextgroup=doxygenSpecialMultilineDesc syn region doxygenHeaderLine start=+.+ end=+^+ contained skipwhite nextgroup=doxygenSpecialMultilineDesc
syn keyword doxygenOther contained arg author authors date deprecated li result return returns see invariant note post pre remark remarks since test nextgroup=doxygenSpecialMultilineDesc syn keyword doxygenOther contained arg author authors date deprecated li return returns see invariant note post pre remarks since test nextgroup=doxygenSpecialMultilineDesc
syn keyword doxygenOtherTODO contained todo attention nextgroup=doxygenSpecialMultilineDesc syn keyword doxygenOtherTODO contained todo attention nextgroup=doxygenSpecialMultilineDesc
syn keyword doxygenOtherWARN contained warning nextgroup=doxygenSpecialMultilineDesc syn keyword doxygenOtherWARN contained warning nextgroup=doxygenSpecialMultilineDesc
syn keyword doxygenOtherBUG contained bug nextgroup=doxygenSpecialMultilineDesc syn keyword doxygenOtherBUG contained bug nextgroup=doxygenSpecialMultilineDesc
" Handle \link, \endlink, highlighting the link-to and the link text bits separately. " Handle \link, \endlink, highlighting the link-to and the link text bits separately.
syn region doxygenOtherLink matchgroup=doxygenOther start=+\<link\>+ end=+[\@]\@<=endlink\>+ contained contains=doxygenLinkWord,doxygenContinueComment,doxygenLinkError,doxygenEndlinkSpecial syn region doxygenOtherLink matchgroup=doxygenOther start=+\<link\>+ end=+[\@]\@<=endlink\>+ contained contains=doxygenLinkWord,doxygenContinueCommentWhite,doxygenLinkError,doxygenEndlinkSpecial
syn match doxygenEndlinkSpecial contained +[\\@]\zeendlink\>+ syn match doxygenEndlinkSpecial contained +[\\@]\zeendlink\>+
syn match doxygenLinkWord "[_a-zA-Z:#()][_a-z0-9A-Z:#()]*\>" contained skipnl nextgroup=doxygenLinkRest,doxygenContinueLinkComment syn match doxygenLinkWord "[_a-zA-Z:#()][_a-z0-9A-Z:#()]*\>" contained skipnl nextgroup=doxygenLinkRest,doxygenContinueLinkComment
@ -250,7 +268,7 @@ endif
" Handle section " Handle section
syn keyword doxygenOther defgroup section subsection subsubsection weakgroup contained skipwhite nextgroup=doxygenSpecialIdent syn keyword doxygenOther defgroup section subsection subsubsection weakgroup contained skipwhite nextgroup=doxygenSpecialIdent
syn region doxygenSpecialSectionDesc start=+.\++ end=+$+ contained skipwhite contains=doxygenSmallSpecial,@doxygenHtmlGroup keepend skipwhite skipnl nextgroup=doxygenContinueComment syn region doxygenSpecialSectionDesc start=+.\++ end=+$+ contained skipwhite contains=doxygenSmallSpecial,@doxygenHtmlGroup keepend skipwhite skipnl nextgroup=doxygenContinueCommentWhite
syn match doxygenSpecialIdent "\<[a-zA-Z_0-9]\+\>" contained nextgroup=doxygenSpecialSectionDesc syn match doxygenSpecialIdent "\<[a-zA-Z_0-9]\+\>" contained nextgroup=doxygenSpecialSectionDesc
" Does the one-line description for the one-line type identifiers. " Does the one-line description for the one-line type identifiers.
@ -260,8 +278,12 @@ endif
" Handle the multiline description for the multiline type identifiers. " Handle the multiline description for the multiline type identifiers.
" Continue until an 'empty' line (can contain a '*' continuation) or until the " Continue until an 'empty' line (can contain a '*' continuation) or until the
" next whole-line @ command \ command. " next whole-line @ command \ command.
syn region doxygenSpecialMultilineDesc start=+.\++ skip=+^\s*\(\*/\@!\s*\)\=\(\<\|[@\\]\<\([npcbea]\>\|em\>\|ref\|link\>\>\|f\$\|[$\\&<>#]\)\|[^ \t\\@*]\)+ end=+^+ contained contains=doxygenSpecialContinueComment,doxygenSmallSpecial,doxygenHyperLink,doxygenHashLink,@doxygenHtmlGroup,@Spell skipwhite keepend syn region doxygenSpecialMultilineDesc start=+.\++ skip=+^\s*\(\*/\@!\s*\)\=\(\<\|[@\\]\<\([npcbea]\>\|em\>\|ref\|link\>\>\|f\$\|[$\\&<>#]\)\|[^ \t\\@*]\)+ end=+^+ contained contains=doxygenSpecialContinueCommentWhite,doxygenSmallSpecial,doxygenHyperLink,doxygenHashLink,@doxygenHtmlGroup,@Spell skipwhite keepend
syn match doxygenSpecialContinueComment contained +^\s*\*/\@!\s*+ nextgroup=doxygenSpecial skipwhite
" syn match doxygenSpecialContinueComment contained +^\s*\*/\@!\s*+ nextgroup=doxygenSpecial skipwhite
syn match doxygenSpecialContinueCommentWhite contained +^\s*\ze\*+ nextgroup=doxygenSpecialContinueComment
syn match doxygenSpecialContinueComment contained +\*/\@!+
" Handle special cases 'bold' and 'group' " Handle special cases 'bold' and 'group'
syn keyword doxygenBold contained bold nextgroup=doxygenSpecialHeading syn keyword doxygenBold contained bold nextgroup=doxygenSpecialHeading
@ -288,7 +310,7 @@ endif
" Supported HTML subset. Not perfect, but okay. " Supported HTML subset. Not perfect, but okay.
syn case ignore syn case ignore
syn region doxygenHtmlTag contained matchgroup=doxygenHtmlCh start=+\v\</=\ze([biuap]|em|strong|img|br|center|code|dfn|d[ldt]|hr|h[0-3]|li|[ou]l|pre|small|sub|sup|table|tt|var|caption|src|alt|longdesc|name|height|width|usemap|ismap|href|type)>+ skip=+\\<\|\<\k\+=\("[^"]*"\|'[^']*\)+ end=+>+ contains=doxygenHtmlCmd,doxygenContinueComment,doxygenHtmlVar syn region doxygenHtmlTag contained matchgroup=doxygenHtmlCh start=+\v\</=\ze([biuap]|em|strong|img|br|center|code|dfn|d[ldt]|hr|h[0-3]|li|[ou]l|pre|small|sub|sup|table|tt|var|caption|src|alt|longdesc|name|height|width|usemap|ismap|href|type)>+ skip=+\\<\|\<\k\+=\("[^"]*"\|'[^']*\)+ end=+>+ contains=doxygenHtmlCmd,doxygenContinueCommentWhite,doxygenHtmlVar
syn keyword doxygenHtmlCmd contained b i em strong u img a br p center code dfn dl dd dt hr h1 h2 h3 li ol ul pre small sub sup table tt var caption nextgroup=doxygenHtmlVar skipwhite syn keyword doxygenHtmlCmd contained b i em strong u img a br p center code dfn dl dd dt hr h1 h2 h3 li ol ul pre small sub sup table tt var caption nextgroup=doxygenHtmlVar skipwhite
syn keyword doxygenHtmlVar contained src alt longdesc name height width usemap ismap href type nextgroup=doxygenHtmlEqu skipwhite syn keyword doxygenHtmlVar contained src alt longdesc name height width usemap ismap href type nextgroup=doxygenHtmlEqu skipwhite
syn match doxygenHtmlEqu contained +=+ nextgroup=doxygenHtmlExpr skipwhite syn match doxygenHtmlEqu contained +=+ nextgroup=doxygenHtmlExpr skipwhite
@ -298,7 +320,7 @@ endif
syn cluster doxygenHtmlGroup contains=doxygenHtmlCode,doxygenHtmlBold,doxygenHtmlUnderline,doxygenHtmlItalic,doxygenHtmlSpecial,doxygenHtmlTag,doxygenHtmlLink syn cluster doxygenHtmlGroup contains=doxygenHtmlCode,doxygenHtmlBold,doxygenHtmlUnderline,doxygenHtmlItalic,doxygenHtmlSpecial,doxygenHtmlTag,doxygenHtmlLink
syn cluster doxygenHtmlTop contains=@Spell,doxygenHtmlSpecial,doxygenHtmlTag,doxygenContinueComment syn cluster doxygenHtmlTop contains=@Spell,doxygenHtmlSpecial,doxygenHtmlTag,doxygenContinueCommentWhite
" Html Support " Html Support
syn region doxygenHtmlLink contained start=+<[aA]\>\s*\(\n\s*\*\s*\)\=\(\(name\|href\)=\("[^"]*"\|'[^']*'\)\)\=\s*>+ end=+</[aA]>+me=e-4 contains=@doxygenHtmlTop syn region doxygenHtmlLink contained start=+<[aA]\>\s*\(\n\s*\*\s*\)\=\(\(name\|href\)=\("[^"]*"\|'[^']*'\)\)\=\s*>+ end=+</[aA]>+me=e-4 contains=@doxygenHtmlTop
hi link doxygenHtmlLink Underlined hi link doxygenHtmlLink Underlined
@ -343,7 +365,7 @@ endif
syn cluster rcGroup add=doxygen.* syn cluster rcGroup add=doxygen.*
let s:my_syncolor=0 let s:my_syncolor=0
if !exists(':SynColor') if !exists(':SynColor')
command -nargs=+ SynColor hi def <args> command -nargs=+ SynColor hi def <args>
let s:my_syncolor=1 let s:my_syncolor=1
endif endif
@ -469,6 +491,8 @@ endif
call s:Doxygen_Hilights() call s:Doxygen_Hilights()
syn match doxygenLeadingWhite +\(^\s*\*\)\@<=\s*+ contained
" This is still a proposal, but won't do any harm. " This is still a proposal, but won't do any harm.
aug doxygengroup aug doxygengroup
au! au!
@ -483,6 +507,7 @@ endif
SynLink doxygenOtherTODO Todo SynLink doxygenOtherTODO Todo
SynLink doxygenOtherWARN Todo SynLink doxygenOtherWARN Todo
SynLink doxygenOtherBUG Todo SynLink doxygenOtherBUG Todo
SynLink doxygenLeadingLWhite doxygenBody
SynLink doxygenErrorSpecial Error SynLink doxygenErrorSpecial Error
SynLink doxygenErrorEnd Error SynLink doxygenErrorEnd Error
@ -517,7 +542,10 @@ endif
SynLink doxygenBriefL doxygenBrief SynLink doxygenBriefL doxygenBrief
SynLink doxygenBriefLine doxygenBrief SynLink doxygenBriefLine doxygenBrief
SynLink doxygenHeaderLine doxygenSpecialHeading SynLink doxygenHeaderLine doxygenSpecialHeading
SynLink doxygenStartSkip doxygenContinueComment SynLink doxygenCommentWhite Normal
SynLink doxygenCommentWhite2 doxygenCommentWhite
SynLink doxygenContinueCommentWhite doxygenCommentWhite
SynLink doxygenStartSkipWhite doxygenContinueCommentWhite
SynLink doxygenLinkWord doxygenParamName SynLink doxygenLinkWord doxygenParamName
SynLink doxygenLinkRest doxygenSpecialMultilineDesc SynLink doxygenLinkRest doxygenSpecialMultilineDesc
SynLink doxygenHyperLink doxygenLinkWord SynLink doxygenHyperLink doxygenLinkWord
@ -591,5 +619,5 @@ finally
let &cpo = s:cpo_save let &cpo = s:cpo_save
unlet s:cpo_save unlet s:cpo_save
endtry endtry
let suppress_doxygen=1
" vim:et sw=2 sts=2 " vim:et sw=2 sts=2

View File

@ -2190,6 +2190,7 @@ test_arglist \
test_highlight \ test_highlight \
test_history \ test_history \
test_hlsearch \ test_hlsearch \
test_iminsert \
test_increment \ test_increment \
test_increment_dbcs \ test_increment_dbcs \
test_ins_complete \ test_ins_complete \

View File

@ -134,19 +134,20 @@ get_beval_info(
} }
/* /*
* Show a balloon with "mesg". * Show a balloon with "mesg" or "list".
*/ */
void void
post_balloon(BalloonEval *beval UNUSED, char_u *mesg) post_balloon(BalloonEval *beval UNUSED, char_u *mesg, list_T *list)
{ {
# ifdef FEAT_BEVAL_TERM # ifdef FEAT_BEVAL_TERM
# ifdef FEAT_GUI # ifdef FEAT_GUI
if (!gui.in_use) if (!gui.in_use)
# endif # endif
ui_post_balloon(mesg); ui_post_balloon(mesg, list);
# endif # endif
# ifdef FEAT_BEVAL_GUI # ifdef FEAT_BEVAL_GUI
if (gui.in_use) if (gui.in_use)
/* GUI can't handle a list */
gui_mch_post_balloon(beval, mesg); gui_mch_post_balloon(beval, mesg);
# endif # endif
} }
@ -257,7 +258,7 @@ general_beval_cb(BalloonEval *beval, int state UNUSED)
set_vim_var_string(VV_BEVAL_TEXT, NULL, -1); set_vim_var_string(VV_BEVAL_TEXT, NULL, -1);
if (result != NULL && result[0] != NUL) if (result != NULL && result[0] != NUL)
{ {
post_balloon(beval, result); post_balloon(beval, result, NULL);
recursive = FALSE; recursive = FALSE;
return; return;
} }

View File

@ -32,7 +32,8 @@ typedef enum
typedef struct BalloonEvalStruct typedef struct BalloonEvalStruct
{ {
#ifdef FEAT_GUI_GTK #ifdef FEAT_BEVAL_GUI
# ifdef FEAT_GUI_GTK
GtkWidget *target; /* widget we are monitoring */ GtkWidget *target; /* widget we are monitoring */
GtkWidget *balloonShell; GtkWidget *balloonShell;
GtkWidget *balloonLabel; GtkWidget *balloonLabel;
@ -41,8 +42,8 @@ typedef struct BalloonEvalStruct
int x; int x;
int y; int y;
unsigned int state; /* Button/Modifier key state */ unsigned int state; /* Button/Modifier key state */
#else # else
# if !defined(FEAT_GUI_W32) # if !defined(FEAT_GUI_W32)
Widget target; /* widget we are monitoring */ Widget target; /* widget we are monitoring */
Widget balloonShell; Widget balloonShell;
Widget balloonLabel; Widget balloonLabel;
@ -54,28 +55,29 @@ typedef struct BalloonEvalStruct
Position x_root; Position x_root;
Position y_root; Position y_root;
int state; /* Button/Modifier key state */ int state; /* Button/Modifier key state */
# else # else
HWND target; HWND target;
HWND balloon; HWND balloon;
int x; int x;
int y; int y;
BeState showState; /* tells us whats currently going on */ BeState showState; /* tells us whats currently going on */
# endif
# endif # endif
#endif # if !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_W32)
int ts; /* tabstop setting for this buffer */
char_u *msg;
void (*msgCB)(struct BalloonEvalStruct *, int);
void *clientData; /* For callback */
#if !defined(FEAT_GUI_GTK) && !defined(FEAT_GUI_W32)
Dimension screen_width; /* screen width in pixels */ Dimension screen_width; /* screen width in pixels */
Dimension screen_height; /* screen height in pixels */ Dimension screen_height; /* screen height in pixels */
# endif
void (*msgCB)(struct BalloonEvalStruct *, int);
void *clientData; /* For callback */
#endif #endif
int ts; /* tabstop setting for this buffer */
char_u *msg;
} BalloonEval; } BalloonEval;
#define EVAL_OFFSET_X 15 /* displacement of beval topleft corner from pointer */ #define EVAL_OFFSET_X 15 /* displacement of beval topleft corner from pointer */
#define EVAL_OFFSET_Y 10 #define EVAL_OFFSET_Y 10
#include "beval.pro"
#ifdef FEAT_BEVAL_GUI #ifdef FEAT_BEVAL_GUI
# include "gui_beval.pro" # include "gui_beval.pro"
#endif #endif

View File

@ -61,6 +61,9 @@ static void f_atan2(typval_T *argvars, typval_T *rettv);
#endif #endif
#ifdef FEAT_BEVAL #ifdef FEAT_BEVAL
static void f_balloon_show(typval_T *argvars, typval_T *rettv); static void f_balloon_show(typval_T *argvars, typval_T *rettv);
# if defined(FEAT_BEVAL_TERM)
static void f_balloon_split(typval_T *argvars, typval_T *rettv);
# endif
#endif #endif
static void f_browse(typval_T *argvars, typval_T *rettv); static void f_browse(typval_T *argvars, typval_T *rettv);
static void f_browsedir(typval_T *argvars, typval_T *rettv); static void f_browsedir(typval_T *argvars, typval_T *rettv);
@ -494,6 +497,9 @@ static struct fst
#endif #endif
#ifdef FEAT_BEVAL #ifdef FEAT_BEVAL
{"balloon_show", 1, 1, f_balloon_show}, {"balloon_show", 1, 1, f_balloon_show},
# if defined(FEAT_BEVAL_TERM)
{"balloon_split", 1, 1, f_balloon_split},
# endif
#endif #endif
{"browse", 4, 4, f_browse}, {"browse", 4, 4, f_browse},
{"browsedir", 2, 2, f_browsedir}, {"browsedir", 2, 2, f_browsedir},
@ -1410,8 +1416,40 @@ f_atan2(typval_T *argvars, typval_T *rettv)
f_balloon_show(typval_T *argvars, typval_T *rettv UNUSED) f_balloon_show(typval_T *argvars, typval_T *rettv UNUSED)
{ {
if (balloonEval != NULL) if (balloonEval != NULL)
post_balloon(balloonEval, get_tv_string_chk(&argvars[0])); {
if (argvars[0].v_type == VAR_LIST
# ifdef FEAT_GUI
&& !gui.in_use
# endif
)
post_balloon(balloonEval, NULL, argvars[0].vval.v_list);
else
post_balloon(balloonEval, get_tv_string_chk(&argvars[0]), NULL);
}
} }
# if defined(FEAT_BEVAL_TERM)
static void
f_balloon_split(typval_T *argvars, typval_T *rettv UNUSED)
{
if (rettv_list_alloc(rettv) == OK)
{
char_u *msg = get_tv_string_chk(&argvars[0]);
if (msg != NULL)
{
pumitem_T *array;
int size = split_message(msg, &array);
int i;
/* Skip the first and last item, they are always empty. */
for (i = 1; i < size - 1; ++i)
list_append_string(rettv->vval.v_list, array[i].pum_text, -1);
vim_free(array);
}
}
}
# endif
#endif #endif
/* /*
@ -13411,8 +13449,10 @@ f_writefile(typval_T *argvars, typval_T *rettv)
if (write_list(fd, list, binary) == FAIL) if (write_list(fd, list, binary) == FAIL)
ret = -1; ret = -1;
#ifdef HAVE_FSYNC #ifdef HAVE_FSYNC
else if (do_fsync && fsync(fileno(fd)) != 0) else if (do_fsync)
EMSG(_(e_fsync)); /* Ignore the error, the user wouldn't know what to do about it.
* May happen for a device. */
ignored = fsync(fileno(fd));
#endif #endif
fclose(fd); fclose(fd);
} }

View File

@ -4782,6 +4782,20 @@ iconv_end(void)
#endif /* FEAT_MBYTE */ #endif /* FEAT_MBYTE */
#ifdef FEAT_EVAL
static void
call_imactivatefunc(int active)
{
char_u *argv[1];
if (active)
argv[0] = (char_u *)"1";
else
argv[0] = (char_u *)"0";
(void)call_func_retnr(p_imaf, 1, argv, FALSE);
}
#endif
#if defined(FEAT_XIM) || defined(PROTO) #if defined(FEAT_XIM) || defined(PROTO)
# if defined(FEAT_GUI_GTK) || defined(PROTO) # if defined(FEAT_GUI_GTK) || defined(PROTO)
@ -4824,7 +4838,14 @@ im_set_active(int active)
im_is_active = (active && !p_imdisable); im_is_active = (active && !p_imdisable);
if (im_is_active != was_active) if (im_is_active != was_active)
xim_reset(); {
#ifdef FEAT_EVAL
if (p_imaf[0] != NUL)
call_imactivatefunc(im_is_active);
else
#endif
xim_reset();
}
} }
void void
@ -5666,15 +5687,7 @@ xim_reset(void)
# ifdef FEAT_EVAL # ifdef FEAT_EVAL
if (p_imaf[0] != NUL) if (p_imaf[0] != NUL)
{ call_imactivatefunc(im_is_active);
char_u *argv[1];
if (im_is_active)
argv[0] = (char_u *)"1";
else
argv[0] = (char_u *)"0";
(void)call_func_retnr(p_imaf, 1, argv, FALSE);
}
else else
# endif # endif
if (im_activatekey_keyval != GDK_VoidSymbol) if (im_activatekey_keyval != GDK_VoidSymbol)
@ -6442,6 +6455,45 @@ xim_get_status_area_height(void)
} }
# endif # endif
#else /* !defined(FEAT_XIM) */
# ifndef FEAT_GUI_W32
int
im_get_status()
{
# ifdef FEAT_EVAL
if (p_imsf[0] != NUL)
{
int is_active;
/* FIXME: Don't execute user function in unsafe situation. */
if (exiting
# ifdef FEAT_AUTOCMD
|| is_autocmd_blocked()
# endif
)
return FALSE;
/* FIXME: :py print 'xxx' is shown duplicate result.
* Use silent to avoid it. */
++msg_silent;
is_active = call_func_retnr(p_imsf, 0, NULL, FALSE);
--msg_silent;
return (is_active > 0);
}
# endif
return FALSE;
}
void
im_set_active(int active)
{
# ifdef(USE_IM_CONTROL) && defined(FEAT_EVAL)
if (p_imaf[0] != NUL)
call_imactivatefunc(p_imdisable ? FALSE : active);
# endif
}
# endif
#endif /* FEAT_XIM */ #endif /* FEAT_XIM */
#if defined(FEAT_MBYTE) || defined(PROTO) #if defined(FEAT_MBYTE) || defined(PROTO)

View File

@ -4633,7 +4633,9 @@ nv_mousescroll(cmdarg_T *cap)
{ {
# ifdef FEAT_TERMINAL # ifdef FEAT_TERMINAL
if (term_use_loop()) if (term_use_loop())
send_keys_to_term(curbuf->b_term, cap->cmdchar, TRUE); /* This window is a terminal window, send the mouse event there.
* Set "typed" to FALSE to avoid an endless loop. */
send_keys_to_term(curbuf->b_term, cap->cmdchar, FALSE);
else else
# endif # endif
if (mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL)) if (mod_mask & (MOD_MASK_SHIFT | MOD_MASK_CTRL))

View File

@ -1539,7 +1539,7 @@ static struct vimoption options[] =
(char_u *)&p_ic, PV_NONE, (char_u *)&p_ic, PV_NONE,
{(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT}, {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
{"imactivatefunc","imaf",P_STRING|P_VI_DEF|P_SECURE, {"imactivatefunc","imaf",P_STRING|P_VI_DEF|P_SECURE,
# if defined(FEAT_EVAL) && defined(FEAT_XIM) && defined(FEAT_GUI_GTK) #if defined(FEAT_EVAL) && defined(USE_IM_CONTROL)
(char_u *)&p_imaf, PV_NONE, (char_u *)&p_imaf, PV_NONE,
{(char_u *)"", (char_u *)NULL} {(char_u *)"", (char_u *)NULL}
# else # else
@ -1582,7 +1582,7 @@ static struct vimoption options[] =
{(char_u *)B_IMODE_USE_INSERT, (char_u *)0L} {(char_u *)B_IMODE_USE_INSERT, (char_u *)0L}
SCRIPTID_INIT}, SCRIPTID_INIT},
{"imstatusfunc","imsf",P_STRING|P_VI_DEF|P_SECURE, {"imstatusfunc","imsf",P_STRING|P_VI_DEF|P_SECURE,
#if defined(FEAT_EVAL) && defined(FEAT_XIM) && defined(FEAT_GUI_GTK) #if defined(FEAT_EVAL) && defined(USE_IM_CONTROL)
(char_u *)&p_imsf, PV_NONE, (char_u *)&p_imsf, PV_NONE,
{(char_u *)"", (char_u *)NULL} {(char_u *)"", (char_u *)NULL}
#else #else

View File

@ -581,11 +581,13 @@ EXTERN char_u *p_iconstring; /* 'iconstring' */
EXTERN int p_ic; /* 'ignorecase' */ EXTERN int p_ic; /* 'ignorecase' */
#if defined(FEAT_XIM) && defined(FEAT_GUI_GTK) #if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
EXTERN char_u *p_imak; /* 'imactivatekey' */ EXTERN char_u *p_imak; /* 'imactivatekey' */
#define IM_ON_THE_SPOT 0L
#define IM_OVER_THE_SPOT 1L
EXTERN long p_imst; /* 'imstyle' */
#endif
#if defined(FEAT_EVAL) && defined(USE_IM_CONTROL)
EXTERN char_u *p_imaf; /* 'imactivatefunc' */ EXTERN char_u *p_imaf; /* 'imactivatefunc' */
EXTERN char_u *p_imsf; /* 'imstatusfunc' */ EXTERN char_u *p_imsf; /* 'imstatusfunc' */
EXTERN long p_imst; /* 'imstyle' */
# define IM_ON_THE_SPOT 0L
# define IM_OVER_THE_SPOT 1L
#endif #endif
#ifdef USE_IM_CONTROL #ifdef USE_IM_CONTROL
EXTERN int p_imcmdline; /* 'imcmdline' */ EXTERN int p_imcmdline; /* 'imcmdline' */

View File

@ -14,7 +14,6 @@
*/ */
#define NO_X11_INCLUDES #define NO_X11_INCLUDES
typedef int BalloonEval; /* used in header files */
#include "vim.h" #include "vim.h"

View File

@ -14,7 +14,6 @@
/* Avoid a conflict for the definition of Boolean between Mac header files and /* Avoid a conflict for the definition of Boolean between Mac header files and
* X11 header files. */ * X11 header files. */
#define NO_X11_INCLUDES #define NO_X11_INCLUDES
#define BalloonEval int /* used in header files */
#include "vim.h" #include "vim.h"
#import <AppKit/AppKit.h> #import <AppKit/AppKit.h>

View File

@ -5034,10 +5034,10 @@ job_io_file_open(
* environment argument of vim_create_process(). * environment argument of vim_create_process().
*/ */
void void
win32_build_env(dict_T *env, garray_T *gap) win32_build_env(dict_T *env, garray_T *gap, int is_terminal)
{ {
hashitem_T *hi; hashitem_T *hi;
int todo = (int)env->dv_hashtab.ht_used; long_u todo = env != NULL ? env->dv_hashtab.ht_used : 0;
LPVOID base = GetEnvironmentStringsW(); LPVOID base = GetEnvironmentStringsW();
/* for last \0 */ /* for last \0 */
@ -5062,35 +5062,56 @@ win32_build_env(dict_T *env, garray_T *gap)
*((WCHAR*)gap->ga_data + gap->ga_len++) = L'\0'; *((WCHAR*)gap->ga_data + gap->ga_len++) = L'\0';
} }
for (hi = env->dv_hashtab.ht_array; todo > 0; ++hi) if (env != NULL)
{ {
if (!HASHITEM_EMPTY(hi)) for (hi = env->dv_hashtab.ht_array; todo > 0; ++hi)
{ {
typval_T *item = &dict_lookup(hi)->di_tv; if (!HASHITEM_EMPTY(hi))
WCHAR *wkey = enc_to_utf16((char_u *)hi->hi_key, NULL);
WCHAR *wval = enc_to_utf16(get_tv_string(item), NULL);
--todo;
if (wkey != NULL && wval != NULL)
{ {
size_t n; typval_T *item = &dict_lookup(hi)->di_tv;
size_t lkey = wcslen(wkey); WCHAR *wkey = enc_to_utf16((char_u *)hi->hi_key, NULL);
size_t lval = wcslen(wval); WCHAR *wval = enc_to_utf16(get_tv_string(item), NULL);
--todo;
if (wkey != NULL && wval != NULL)
{
size_t n;
size_t lkey = wcslen(wkey);
size_t lval = wcslen(wval);
if (ga_grow(gap, (int)(lkey + lval + 2)) != OK) if (ga_grow(gap, (int)(lkey + lval + 2)) != OK)
continue; continue;
for (n = 0; n < lkey; n++) for (n = 0; n < lkey; n++)
*((WCHAR*)gap->ga_data + gap->ga_len++) = wkey[n]; *((WCHAR*)gap->ga_data + gap->ga_len++) = wkey[n];
*((WCHAR*)gap->ga_data + gap->ga_len++) = L'='; *((WCHAR*)gap->ga_data + gap->ga_len++) = L'=';
for (n = 0; n < lval; n++) for (n = 0; n < lval; n++)
*((WCHAR*)gap->ga_data + gap->ga_len++) = wval[n]; *((WCHAR*)gap->ga_data + gap->ga_len++) = wval[n];
*((WCHAR*)gap->ga_data + gap->ga_len++) = L'\0'; *((WCHAR*)gap->ga_data + gap->ga_len++) = L'\0';
}
if (wkey != NULL) vim_free(wkey);
if (wval != NULL) vim_free(wval);
} }
if (wkey != NULL) vim_free(wkey);
if (wval != NULL) vim_free(wval);
} }
} }
*((WCHAR*)gap->ga_data + gap->ga_len++) = L'\0'; # ifdef FEAT_CLIENTSERVER
if (is_terminal)
{
char_u *servername = get_vim_var_str(VV_SEND_SERVER);
size_t lval = STRLEN(servername);
size_t n;
if (ga_grow(gap, (int)(14 + lval + 2)) == OK)
{
for (n = 0; n < 15; n++)
*((WCHAR*)gap->ga_data + gap->ga_len++) =
(WCHAR)"VIM_SERVERNAME="[n];
for (n = 0; n < lval; n++)
*((WCHAR*)gap->ga_data + gap->ga_len++) =
(WCHAR)servername[n];
*((WCHAR*)gap->ga_data + gap->ga_len++) = L'\0';
}
}
# endif
} }
void void
@ -5133,7 +5154,7 @@ mch_job_start(char *cmd, job_T *job, jobopt_T *options)
} }
if (options->jo_env != NULL) if (options->jo_env != NULL)
win32_build_env(options->jo_env, &ga); win32_build_env(options->jo_env, &ga, FALSE);
ZeroMemory(&pi, sizeof(pi)); ZeroMemory(&pi, sizeof(pi));
ZeroMemory(&si, sizeof(si)); ZeroMemory(&si, sizeof(si));

View File

@ -766,9 +766,147 @@ static int balloon_arraysize;
static int balloon_mouse_row = 0; static int balloon_mouse_row = 0;
static int balloon_mouse_col = 0; static int balloon_mouse_col = 0;
#define BALLOON_MIN_WIDTH 40 #define BALLOON_MIN_WIDTH 50
#define BALLOON_MIN_HEIGHT 10 #define BALLOON_MIN_HEIGHT 10
typedef struct {
char_u *start;
int bytelen;
int cells;
int indent;
} balpart_T;
/*
* Split a string into parts to display in the balloon.
* Aimed at output from gdb. Attempts to split at white space, preserve quoted
* strings and make a struct look good.
* Resulting array is stored in "array" and returns the size of the array.
*/
int
split_message(char_u *mesg, pumitem_T **array)
{
garray_T ga;
char_u *p;
balpart_T *item;
int quoted = FALSE;
int height;
int line;
int item_idx;
int indent = 0;
int max_cells = 0;
int max_height = Rows / 2 - 2;
int long_item_count = 0;
int split_long_items = FALSE;
ga_init2(&ga, sizeof(balpart_T), 20);
p = mesg;
while (*p != NUL)
{
if (ga_grow(&ga, 1) == FAIL)
goto failed;
item = ((balpart_T *)ga.ga_data) + ga.ga_len;
item->start = p;
item->indent = indent;
item->cells = indent * 2;
++ga.ga_len;
while (*p != NUL)
{
if (*p == '"')
quoted = !quoted;
else if (*p == '\\' && p[1] != NUL)
++p;
else if (!quoted)
{
if ((*p == ',' && p[1] == ' ') || *p == '{' || *p == '}')
{
/* Looks like a good point to break. */
if (*p == '{')
++indent;
else if (*p == '}' && indent > 0)
--indent;
++item->cells;
p = skipwhite(p + 1);
break;
}
}
item->cells += ptr2cells(p);
p += MB_PTR2LEN(p);
}
item->bytelen = p - item->start;
if (item->cells > max_cells)
max_cells = item->cells;
long_item_count += item->cells / BALLOON_MIN_WIDTH;
}
height = 2 + ga.ga_len;
/* If there are long items and the height is below the limit: split lines */
if (long_item_count > 0 && height + long_item_count <= max_height)
{
split_long_items = TRUE;
height += long_item_count;
}
/* Limit to half the window height, it has to fit above or below the mouse
* position. */
if (height > max_height)
height = max_height;
*array = (pumitem_T *)alloc_clear((unsigned)sizeof(pumitem_T) * height);
if (*array == NULL)
goto failed;
/* Add an empty line above and below, looks better. */
(*array)->pum_text = vim_strsave((char_u *)"");
(*array + height - 1)->pum_text = vim_strsave((char_u *)"");
for (line = 1, item_idx = 0; line < height - 1; ++item_idx)
{
int skip;
int thislen;
int copylen;
int ind;
int cells;
item = ((balpart_T *)ga.ga_data) + item_idx;
for (skip = 0; skip < item->bytelen; skip += thislen)
{
if (split_long_items && item->cells >= BALLOON_MIN_WIDTH)
{
cells = item->indent * 2;
for (p = item->start + skip; p < item->start + item->bytelen;
p += MB_PTR2LEN(p))
if ((cells += ptr2cells(p)) > BALLOON_MIN_WIDTH)
break;
thislen = p - (item->start + skip);
}
else
thislen = item->bytelen;
/* put indent at the start */
p = alloc(thislen + item->indent * 2 + 1);
for (ind = 0; ind < item->indent * 2; ++ind)
p[ind] = ' ';
/* exclude spaces at the end of the string */
for (copylen = thislen; copylen > 0; --copylen)
if (item->start[skip + copylen - 1] != ' ')
break;
vim_strncpy(p + ind, item->start + skip, copylen);
(*array)[line].pum_text = p;
item->indent = 0; /* wrapped line has no indent */
++line;
}
}
ga_clear(&ga);
return height;
failed:
ga_clear(&ga);
return 0;
}
void void
ui_remove_balloon(void) ui_remove_balloon(void)
{ {
@ -786,28 +924,42 @@ ui_remove_balloon(void)
* Terminal version of a balloon, uses the popup menu code. * Terminal version of a balloon, uses the popup menu code.
*/ */
void void
ui_post_balloon(char_u *mesg) ui_post_balloon(char_u *mesg, list_T *list)
{ {
ui_remove_balloon(); ui_remove_balloon();
/* TODO: split the text in multiple lines. */ if (mesg == NULL && list == NULL)
balloon_arraysize = 3; return;
balloon_array = (pumitem_T *)alloc_clear( if (list != NULL)
(unsigned)sizeof(pumitem_T) * balloon_arraysize);
if (balloon_array != NULL)
{ {
/* Add an empty line above and below, looks better. */ listitem_T *li;
balloon_array[0].pum_text = vim_strsave((char_u *)""); int idx;
balloon_array[1].pum_text = vim_strsave(mesg);
balloon_array[2].pum_text = vim_strsave((char_u *)"");
balloon_arraysize = list->lv_len;
balloon_array = (pumitem_T *)alloc_clear(
(unsigned)sizeof(pumitem_T) * list->lv_len);
if (balloon_array == NULL)
return;
for (idx = 0, li = list->lv_first; li != NULL; li = li->li_next, ++idx)
{
char_u *text = get_tv_string_chk(&li->li_tv);
balloon_array[idx].pum_text = vim_strsave(
text == NULL ? (char_u *)"" : text);
}
}
else
balloon_arraysize = split_message(mesg, &balloon_array);
if (balloon_arraysize > 0)
{
pum_array = balloon_array; pum_array = balloon_array;
pum_size = balloon_arraysize; pum_size = balloon_arraysize;
pum_compute_size(); pum_compute_size();
pum_scrollbar = 0; pum_scrollbar = 0;
pum_height = balloon_arraysize; pum_height = balloon_arraysize;
if (Rows - mouse_row > BALLOON_MIN_HEIGHT) if (Rows - mouse_row > pum_size)
{ {
/* Enough space below the mouse row. */ /* Enough space below the mouse row. */
pum_row = mouse_row + 1; pum_row = mouse_row + 1;
@ -817,7 +969,7 @@ ui_post_balloon(char_u *mesg)
else else
{ {
/* Show above the mouse row, reduce height if it does not fit. */ /* Show above the mouse row, reduce height if it does not fit. */
pum_row = mouse_row - 1 - pum_size; pum_row = mouse_row - pum_size;
if (pum_row < 0) if (pum_row < 0)
{ {
pum_height += pum_row; pum_height += pum_row;

View File

@ -201,7 +201,9 @@ void qsort(void *base, size_t elm_count, size_t elm_size, int (*cmp)(const void
/* Ugly solution for "BalloonEval" not being defined while it's used in some /* Ugly solution for "BalloonEval" not being defined while it's used in some
* .pro files. */ * .pro files. */
# ifndef FEAT_BEVAL # ifdef FEAT_BEVAL
# include "beval.pro"
# else
# define BalloonEval int # define BalloonEval int
# endif # endif

View File

@ -1,6 +1,6 @@
/* beval.c */ /* beval.c */
int get_beval_info(BalloonEval *beval, int getword, win_T **winp, linenr_T *lnump, char_u **textp, int *colp); int get_beval_info(BalloonEval *beval, int getword, win_T **winp, linenr_T *lnump, char_u **textp, int *colp);
void post_balloon(BalloonEval *beval, char_u *mesg); void post_balloon(BalloonEval *beval, char_u *mesg, list_T *list);
int can_use_beval(void); int can_use_beval(void);
void general_beval_cb(BalloonEval *beval, int state); void general_beval_cb(BalloonEval *beval, int state);
/* vim: set ft=c : */ /* vim: set ft=c : */

View File

@ -67,5 +67,5 @@ void used_file_arg(char *name, int literal, int full_path, int diff_mode);
void set_alist_count(void); void set_alist_count(void);
void fix_arg_enc(void); void fix_arg_enc(void);
int mch_setenv(char *var, char *value, int x); int mch_setenv(char *var, char *value, int x);
void win32_build_env(dict_T *l, garray_T *gap); void win32_build_env(dict_T *l, garray_T *gap, int is_terminal);
/* vim: set ft=c : */ /* vim: set ft=c : */

View File

@ -5,7 +5,8 @@ void pum_undisplay(void);
void pum_clear(void); void pum_clear(void);
int pum_visible(void); int pum_visible(void);
int pum_get_height(void); int pum_get_height(void);
int split_message(char_u *mesg, pumitem_T **array);
void ui_remove_balloon(void); void ui_remove_balloon(void);
void ui_post_balloon(char_u *mesg); void ui_post_balloon(char_u *mesg, list_T *list);
void ui_may_remove_balloon(void); void ui_may_remove_balloon(void);
/* vim: set ft=c : */ /* vim: set ft=c : */

View File

@ -2654,6 +2654,9 @@ qf_list(exarg_T *eap)
int idx2 = -1; int idx2 = -1;
char_u *arg = eap->arg; char_u *arg = eap->arg;
int plus = FALSE; int plus = FALSE;
int qfFileAttr;
int qfSepAttr;
int qfLineAttr;
int all = eap->forceit; /* if not :cl!, only show int all = eap->forceit; /* if not :cl!, only show
recognised errors */ recognised errors */
qf_info_T *qi = &ql_info; qf_info_T *qi = &ql_info;
@ -2699,6 +2702,20 @@ qf_list(exarg_T *eap)
idx2 = (-idx2 > i) ? 0 : idx2 + i + 1; idx2 = (-idx2 > i) ? 0 : idx2 + i + 1;
} }
/*
* Get the attributes for the different quickfix highlight items. Note
* that this depends on syntax items defined in the qf.vim syntax file
*/
qfFileAttr = syn_name2attr((char_u *)"qfFileName");
if (qfFileAttr == 0)
qfFileAttr = HL_ATTR(HLF_D);
qfSepAttr = syn_name2attr((char_u *)"qfSeparator");
if (qfSepAttr == 0)
qfSepAttr = HL_ATTR(HLF_D);
qfLineAttr = syn_name2attr((char_u *)"qfLineNr");
if (qfLineAttr == 0)
qfLineAttr = HL_ATTR(HLF_N);
if (qi->qf_lists[qi->qf_curlist].qf_nonevalid) if (qi->qf_lists[qi->qf_curlist].qf_nonevalid)
all = TRUE; all = TRUE;
qfp = qi->qf_lists[qi->qf_curlist].qf_start; qfp = qi->qf_lists[qi->qf_curlist].qf_start;
@ -2724,22 +2741,26 @@ qf_list(exarg_T *eap)
vim_snprintf((char *)IObuff, IOSIZE, "%2d %s", vim_snprintf((char *)IObuff, IOSIZE, "%2d %s",
i, (char *)fname); i, (char *)fname);
msg_outtrans_attr(IObuff, i == qi->qf_lists[qi->qf_curlist].qf_index msg_outtrans_attr(IObuff, i == qi->qf_lists[qi->qf_curlist].qf_index
? HL_ATTR(HLF_QFL) : HL_ATTR(HLF_D)); ? HL_ATTR(HLF_QFL) : qfFileAttr);
if (qfp->qf_lnum != 0)
msg_puts_attr((char_u *)":", qfSepAttr);
if (qfp->qf_lnum == 0) if (qfp->qf_lnum == 0)
IObuff[0] = NUL; IObuff[0] = NUL;
else if (qfp->qf_col == 0) else if (qfp->qf_col == 0)
sprintf((char *)IObuff, ":%ld", qfp->qf_lnum); sprintf((char *)IObuff, "%ld", qfp->qf_lnum);
else else
sprintf((char *)IObuff, ":%ld col %d", sprintf((char *)IObuff, "%ld col %d",
qfp->qf_lnum, qfp->qf_col); qfp->qf_lnum, qfp->qf_col);
sprintf((char *)IObuff + STRLEN(IObuff), "%s:", sprintf((char *)IObuff + STRLEN(IObuff), "%s",
(char *)qf_types(qfp->qf_type, qfp->qf_nr)); (char *)qf_types(qfp->qf_type, qfp->qf_nr));
msg_puts_attr(IObuff, HL_ATTR(HLF_N)); msg_puts_attr(IObuff, qfLineAttr);
msg_puts_attr((char_u *)":", qfSepAttr);
if (qfp->qf_pattern != NULL) if (qfp->qf_pattern != NULL)
{ {
qf_fmt_text(qfp->qf_pattern, IObuff, IOSIZE); qf_fmt_text(qfp->qf_pattern, IObuff, IOSIZE);
STRCAT(IObuff, ":");
msg_puts(IObuff); msg_puts(IObuff);
msg_puts_attr((char_u *)":", qfSepAttr);
} }
msg_puts((char_u *)" "); msg_puts((char_u *)" ");

View File

@ -2091,12 +2091,8 @@ struct file_buffer
#define B_IMODE_USE_INSERT -1 /* Use b_p_iminsert value for search */ #define B_IMODE_USE_INSERT -1 /* Use b_p_iminsert value for search */
#define B_IMODE_NONE 0 /* Input via none */ #define B_IMODE_NONE 0 /* Input via none */
#define B_IMODE_LMAP 1 /* Input via langmap */ #define B_IMODE_LMAP 1 /* Input via langmap */
#ifndef USE_IM_CONTROL #define B_IMODE_IM 2 /* Input via input method */
# define B_IMODE_LAST 1 #define B_IMODE_LAST 2
#else
# define B_IMODE_IM 2 /* Input via input method */
# define B_IMODE_LAST 2
#endif
#ifdef FEAT_KEYMAP #ifdef FEAT_KEYMAP
short b_kmap_state; /* using "lmap" mappings */ short b_kmap_state; /* using "lmap" mappings */

View File

@ -4980,6 +4980,8 @@ check_termcode(
* add 0x08 for ALT * add 0x08 for ALT
* add 0x10 for CTRL * add 0x10 for CTRL
* add 0x20 for mouse drag (0x40 is drag with left button) * add 0x20 for mouse drag (0x40 is drag with left button)
* add 0x40 for mouse move (0x80 is move, 0x81 too)
* 0x43 (drag + release) is also move
* c == column + ' ' + 1 == column + 33 * c == column + ' ' + 1 == column + 33
* r == row + ' ' + 1 == row + 33 * r == row + ' ' + 1 == row + 33
* *
@ -5121,9 +5123,15 @@ check_termcode(
# endif # endif
) )
{ {
/* Keep the mouse_code before it's changed, so that we # if defined(UNIX) && defined(FEAT_MOUSE_TTY)
* remember that it was a mouse wheel click. */ if (use_xterm_mouse() > 1 && mouse_code >= 0x80)
wheel_code = mouse_code; /* mouse-move event, using MOUSE_DRAG works */
mouse_code = MOUSE_DRAG;
else
# endif
/* Keep the mouse_code before it's changed, so that we
* remember that it was a mouse wheel click. */
wheel_code = mouse_code;
} }
# ifdef FEAT_MOUSE_XTERM # ifdef FEAT_MOUSE_XTERM
else if (held_button == MOUSE_RELEASE else if (held_button == MOUSE_RELEASE

View File

@ -51,6 +51,7 @@
* - implement term_setsize() * - implement term_setsize()
* - Termdebug does not work when Vim build with mzscheme. gdb hangs. * - Termdebug does not work when Vim build with mzscheme. gdb hangs.
* - MS-Windows GUI: WinBar has tearoff item * - MS-Windows GUI: WinBar has tearoff item
* - Adding WinBar to terminal window doesn't display, text isn't shifted down.
* - MS-Windows GUI: still need to type a key after shell exits? #1924 * - MS-Windows GUI: still need to type a key after shell exits? #1924
* - After executing a shell command the status line isn't redraw. * - After executing a shell command the status line isn't redraw.
* - What to store in a session file? Shell at the prompt would be OK to * - What to store in a session file? Shell at the prompt would be OK to
@ -1302,9 +1303,9 @@ send_keys_to_term(term_T *term, int c, int typed)
case K_MOUSELEFT: case K_MOUSELEFT:
case K_MOUSERIGHT: case K_MOUSERIGHT:
if (mouse_row < W_WINROW(curwin) if (mouse_row < W_WINROW(curwin)
|| mouse_row >= (W_WINROW(curwin) + curwin->w_height) || mouse_row > (W_WINROW(curwin) + curwin->w_height)
|| mouse_col < curwin->w_wincol || mouse_col < curwin->w_wincol
|| mouse_col >= W_ENDCOL(curwin) || mouse_col > W_ENDCOL(curwin)
|| dragging_outside) || dragging_outside)
{ {
/* click or scroll outside the current window */ /* click or scroll outside the current window */
@ -2172,10 +2173,13 @@ term_channel_closed(channel_T *ch)
if (term->tl_finish == 'c') if (term->tl_finish == 'c')
{ {
aco_save_T aco;
/* ++close or term_finish == "close" */ /* ++close or term_finish == "close" */
ch_log(NULL, "terminal job finished, closing window"); ch_log(NULL, "terminal job finished, closing window");
curbuf = term->tl_buffer; aucmd_prepbuf(&aco, term->tl_buffer);
do_bufdel(DOBUF_WIPE, (char_u *)"", 1, fnum, fnum, FALSE); do_bufdel(DOBUF_WIPE, (char_u *)"", 1, fnum, fnum, FALSE);
aucmd_restbuf(&aco);
break; break;
} }
if (term->tl_finish == 'o' && term->tl_buffer->b_nwindows == 0) if (term->tl_finish == 'o' && term->tl_buffer->b_nwindows == 0)
@ -3227,6 +3231,10 @@ f_term_wait(typval_T *argvars, typval_T *rettv UNUSED)
{ {
mch_check_messages(); mch_check_messages();
parse_queued_messages(); parse_queued_messages();
if (!buf_valid(buf))
/* If the terminal is closed when the channel is closed the
* buffer disappears. */
break;
ui_delay(10L, FALSE); ui_delay(10L, FALSE);
} }
mch_check_messages(); mch_check_messages();
@ -3416,12 +3424,10 @@ term_and_job_init(
return FAIL; return FAIL;
if (opt->jo_cwd != NULL) if (opt->jo_cwd != NULL)
cwd_wchar = enc_to_utf16(opt->jo_cwd, NULL); cwd_wchar = enc_to_utf16(opt->jo_cwd, NULL);
if (opt->jo_env != NULL)
{ ga_init2(&ga_env, (int)sizeof(char*), 20);
ga_init2(&ga_env, (int)sizeof(char*), 20); win32_build_env(opt->jo_env, &ga_env, TRUE);
win32_build_env(opt->jo_env, &ga_env); env_wchar = ga_env.ga_data;
env_wchar = ga_env.ga_data;
}
job = job_alloc(); job = job_alloc();
if (job == NULL) if (job == NULL)
@ -3523,8 +3529,7 @@ term_and_job_init(
failed: failed:
if (argvar->v_type == VAR_LIST) if (argvar->v_type == VAR_LIST)
vim_free(ga_cmd.ga_data); vim_free(ga_cmd.ga_data);
if (opt->jo_env != NULL) vim_free(ga_env.ga_data);
vim_free(ga_env.ga_data);
vim_free(cmd_wchar); vim_free(cmd_wchar);
vim_free(cwd_wchar); vim_free(cwd_wchar);
if (spawn_config != NULL) if (spawn_config != NULL)

View File

@ -67,6 +67,7 @@ SCRIPTS_GUI =
# Tests using runtest.vim # Tests using runtest.vim
# Keep test_alot*.res as the last one, sort the others. # Keep test_alot*.res as the last one, sort the others.
# test_largefile.res is omitted, it uses too much resources to run on CI.
NEW_TESTS = test_arabic.res \ NEW_TESTS = test_arabic.res \
test_arglist.res \ test_arglist.res \
test_assert.res \ test_assert.res \
@ -83,6 +84,7 @@ NEW_TESTS = test_arabic.res \
test_close_count.res \ test_close_count.res \
test_cmdline.res \ test_cmdline.res \
test_command_count.res \ test_command_count.res \
test_comparators.res \
test_crypt.res \ test_crypt.res \
test_cscope.res \ test_cscope.res \
test_curswant.res \ test_curswant.res \
@ -91,13 +93,17 @@ NEW_TESTS = test_arabic.res \
test_display.res \ test_display.res \
test_edit.res \ test_edit.res \
test_erasebackword.res \ test_erasebackword.res \
test_escaped_glob.res \
test_exec_while_if.res \
test_exists.res \ test_exists.res \
test_exists_autocmd.res \
test_farsi.res \ test_farsi.res \
test_file_size.res \ test_file_size.res \
test_find_complete.res \ test_find_complete.res \
test_fixeol.res \ test_fixeol.res \
test_fnameescape.res \ test_fnameescape.res \
test_fold.res \ test_fold.res \
test_getcwd.res \
test_getvar.res \ test_getvar.res \
test_gf.res \ test_gf.res \
test_gn.res \ test_gn.res \
@ -109,6 +115,7 @@ NEW_TESTS = test_arabic.res \
test_highlight.res \ test_highlight.res \
test_history.res \ test_history.res \
test_hlsearch.res \ test_hlsearch.res \
test_iminsert.res \
test_increment.res \ test_increment.res \
test_increment_dbcs.res \ test_increment_dbcs.res \
test_ins_complete.res \ test_ins_complete.res \
@ -120,14 +127,13 @@ NEW_TESTS = test_arabic.res \
test_listchars.res \ test_listchars.res \
test_listdict.res \ test_listdict.res \
test_listlbr.res \ test_listlbr.res \
test_listlbr_utf8.res \
test_lua.res \ test_lua.res \
test_makeencoding.res \ test_makeencoding.res \
test_man.res \ test_man.res \
test_maparg.res \
test_marks.res \ test_marks.res \
test_matchadd_conceal.res \ test_matchadd_conceal.res \
test_mksession.res \ test_mksession.res \
test_mksession_utf8.res \
test_nested_function.res \ test_nested_function.res \
test_netbeans.res \ test_netbeans.res \
test_normal.res \ test_normal.res \
@ -136,6 +142,7 @@ NEW_TESTS = test_arabic.res \
test_packadd.res \ test_packadd.res \
test_paste.res \ test_paste.res \
test_perl.res \ test_perl.res \
test_plus_arg_edit.res \
test_preview.res \ test_preview.res \
test_profile.res \ test_profile.res \
test_python2.res \ test_python2.res \
@ -144,8 +151,9 @@ NEW_TESTS = test_arabic.res \
test_pyx3.res \ test_pyx3.res \
test_quickfix.res \ test_quickfix.res \
test_quotestar.res \ test_quotestar.res \
test_retab.res \ test_regex_char_classes.res \
test_registers.res \ test_registers.res \
test_retab.res \
test_ruby.res \ test_ruby.res \
test_scrollbind.res \ test_scrollbind.res \
test_search.res \ test_search.res \
@ -153,7 +161,6 @@ NEW_TESTS = test_arabic.res \
test_smartindent.res \ test_smartindent.res \
test_spell.res \ test_spell.res \
test_startup.res \ test_startup.res \
test_startup_utf8.res \
test_stat.res \ test_stat.res \
test_substitute.res \ test_substitute.res \
test_swap.res \ test_swap.res \
@ -163,10 +170,11 @@ NEW_TESTS = test_arabic.res \
test_tcl.res \ test_tcl.res \
test_terminal.res \ test_terminal.res \
test_terminal_fail.res \ test_terminal_fail.res \
test_textformat.res \
test_textobjects.res \ test_textobjects.res \
test_undo.res \ test_undo.res \
test_usercommands.res \
test_user_func.res \ test_user_func.res \
test_usercommands.res \
test_viminfo.res \ test_viminfo.res \
test_vimscript.res \ test_vimscript.res \
test_visual.res \ test_visual.res \

View File

@ -286,6 +286,10 @@ for s:test in sort(s:tests)
call add(s:messages, 'Flaky test failed, running it again') call add(s:messages, 'Flaky test failed, running it again')
let first_run = v:errors let first_run = v:errors
" Flakiness is often caused by the system being very busy. Sleep a couple
" of seconds to have a higher chance of succeeding the second time.
sleep 2
let v:errors = [] let v:errors = []
call RunTheTest(s:test) call RunTheTest(s:test)
if len(v:errors) > 0 if len(v:errors) > 0

View File

@ -7,8 +7,11 @@
source test_charsearch_utf8.vim source test_charsearch_utf8.vim
source test_expr_utf8.vim source test_expr_utf8.vim
source test_listlbr_utf8.vim
source test_matchadd_conceal_utf8.vim source test_matchadd_conceal_utf8.vim
source test_mksession_utf8.vim
source test_regexp_utf8.vim source test_regexp_utf8.vim
source test_source_utf8.vim source test_source_utf8.vim
source test_startup_utf8.vim
source test_utf8.vim source test_utf8.vim
source test_utf8_comparisons.vim source test_utf8_comparisons.vim

View File

@ -9,12 +9,19 @@ function SetUp()
endfunction endfunction
function Test_glob() function Test_glob()
if !has('unix')
" This test fails on Windows because of the special characters in the
" filenames. Disable the test on non-Unix systems for now.
return
endif
call assert_equal("", glob('Xxx\{')) call assert_equal("", glob('Xxx\{'))
call assert_equal("", glob('Xxx\$')) call assert_equal("", glob('Xxx\$'))
w! Xxx{ w! Xxx{
w! Xxx\$ w! Xxx\$
call assert_equal("Xxx{", glob('Xxx\{')) call assert_equal("Xxx{", glob('Xxx\{'))
call assert_equal("Xxx$", glob('Xxx\$')) call assert_equal("Xxx$", glob('Xxx\$'))
call delete('Xxx{')
call delete('Xxx$')
endfunction endfunction
function Test_globpath() function Test_globpath()

View File

@ -0,0 +1,29 @@
if !has('multi_byte')
finish
endif
source view_util.vim
let s:imactivatefunc_called = 0
let s:imstatusfunc_called = 0
func IM_activatefunc(active)
let s:imactivatefunc_called = 1
endfunc
func IM_statusfunc()
let s:imstatusfunc_called = 1
return 0
endfunc
func Test_iminsert2()
set imactivatefunc=IM_activatefunc
set imstatusfunc=IM_statusfunc
set iminsert=2
normal! i
set iminsert=0
set imactivatefunc=
set imstatusfunc=
call assert_equal(1, s:imactivatefunc_called)
call assert_equal(1, s:imstatusfunc_called)
endfunc

View File

@ -99,6 +99,7 @@ func Test_mksession_utf8()
call delete('test_mks.out') call delete('test_mks.out')
call delete(tmpfile) call delete(tmpfile)
let &wrap = wrap_save let &wrap = wrap_save
set sessionoptions& splitbelow& fileencoding&
endfunc endfunc
" vim: shiftwidth=2 sts=2 expandtab " vim: shiftwidth=2 sts=2 expandtab

View File

@ -5,4 +5,6 @@ function Test_edit()
edit +1|s/|/PIPE/|w Xfile1| e Xfile2|1 | s/\//SLASH/|w edit +1|s/|/PIPE/|w Xfile1| e Xfile2|1 | s/\//SLASH/|w
call assert_equal(["fooPIPEbar"], readfile("Xfile1")) call assert_equal(["fooPIPEbar"], readfile("Xfile1"))
call assert_equal(["fooSLASHbar"], readfile("Xfile2")) call assert_equal(["fooSLASHbar"], readfile("Xfile2"))
call delete('Xfile1')
call delete('Xfile2')
endfunction endfunction

View File

@ -703,4 +703,40 @@ func Test_popup_and_preview_autocommand()
bw! bw!
endfunc endfunc
func Test_balloon_split()
if !exists('*balloon_split')
return
endif
call assert_equal([
\ 'one two three four one two three four one two thre',
\ 'e four',
\ ], balloon_split(
\ 'one two three four one two three four one two three four'))
call assert_equal([
\ 'struct = {',
\ ' one = 1,',
\ ' two = 2,',
\ ' three = 3}',
\ ], balloon_split(
\ 'struct = {one = 1, two = 2, three = 3}'))
call assert_equal([
\ 'struct = {',
\ ' one = 1,',
\ ' nested = {',
\ ' n1 = "yes",',
\ ' n2 = "no"}',
\ ' two = 2}',
\ ], balloon_split(
\ 'struct = {one = 1, nested = {n1 = "yes", n2 = "no"} two = 2}'))
call assert_equal([
\ 'struct = 0x234 {',
\ ' long = 2343 "\\"some long string that will be wr',
\ 'apped in two\\"",',
\ ' next = 123}',
\ ], balloon_split(
\ 'struct = 0x234 {long = 2343 "\\"some long string that will be wrapped in two\\"", next = 123}'))
endfunc
" vim: shiftwidth=2 sts=2 expandtab " vim: shiftwidth=2 sts=2 expandtab

View File

@ -352,9 +352,7 @@ func Test_terminal_curwin()
call delete('Xtext') call delete('Xtext')
endfunc endfunc
func Test_finish_open_close() func s:get_sleep_cmd()
call assert_equal(1, winnr('$'))
if s:python != '' if s:python != ''
let cmd = s:python . " test_short_sleep.py" let cmd = s:python . " test_short_sleep.py"
let waittime = 500 let waittime = 500
@ -367,12 +365,18 @@ func Test_finish_open_close()
let cmd = 'sleep 1' let cmd = 'sleep 1'
endif endif
endif endif
return [cmd, waittime]
endfunc
func Test_terminal_finish_open_close()
call assert_equal(1, winnr('$'))
let [cmd, waittime] = s:get_sleep_cmd()
exe 'terminal ++close ' . cmd exe 'terminal ++close ' . cmd
call assert_equal(2, winnr('$')) call assert_equal(2, winnr('$'))
wincmd p wincmd p
call WaitFor("winnr('$') == 1", waittime) call WaitFor("winnr('$') == 1", waittime)
call assert_equal(1, winnr('$'))
call term_start(cmd, {'term_finish': 'close'}) call term_start(cmd, {'term_finish': 'close'})
call assert_equal(2, winnr('$')) call assert_equal(2, winnr('$'))
@ -430,6 +434,27 @@ func Test_terminal_cwd()
call delete('Xdir', 'rf') call delete('Xdir', 'rf')
endfunc endfunc
func Test_terminal_servername()
if !has('clientserver')
return
endif
let g:buf = Run_shell_in_terminal({})
" Wait for the shell to display a prompt
call WaitFor('term_getline(g:buf, 1) != ""')
if has('win32')
call term_sendkeys(g:buf, "echo %VIM_SERVERNAME%\r")
else
call term_sendkeys(g:buf, "echo $VIM_SERVERNAME\r")
endif
call term_wait(g:buf)
call Stop_shell_in_terminal(g:buf)
call WaitFor('getline(2) == v:servername')
call assert_equal(v:servername, getline(2))
exe g:buf . 'bwipe'
unlet g:buf
endfunc
func Test_terminal_env() func Test_terminal_env()
let g:buf = Run_shell_in_terminal({'env': {'TESTENV': 'correct'}}) let g:buf = Run_shell_in_terminal({'env': {'TESTENV': 'correct'}})
" Wait for the shell to display a prompt " Wait for the shell to display a prompt
@ -743,3 +768,29 @@ func Test_terminal_composing_unicode()
unlet g:job unlet g:job
let &encoding = save_enc let &encoding = save_enc
endfunc endfunc
func Test_terminal_aucmd_on_close()
fun Nop()
let s:called = 1
endfun
aug repro
au!
au BufWinLeave * call Nop()
aug END
let [cmd, waittime] = s:get_sleep_cmd()
call assert_equal(1, winnr('$'))
new
call setline(1, ['one', 'two'])
exe 'term ++close ' . cmd
wincmd p
call WaitFor("winnr('$') == 2", waittime)
call assert_equal(1, s:called)
bwipe!
unlet s:called
au! repro
delfunc Nop
endfunc

View File

@ -771,6 +771,52 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1336,
/**/
1335,
/**/
1334,
/**/
1333,
/**/
1332,
/**/
1331,
/**/
1330,
/**/
1329,
/**/
1328,
/**/
1327,
/**/
1326,
/**/
1325,
/**/
1324,
/**/
1323,
/**/
1322,
/**/
1321,
/**/
1320,
/**/
1319,
/**/
1318,
/**/
1317,
/**/
1316,
/**/
1315,
/**/
1314,
/**/ /**/
1313, 1313,
/**/ /**/

View File

@ -536,9 +536,7 @@ typedef unsigned long u8char_T; /* long should be 32 bits or more */
/* /*
* Check input method control. * Check input method control.
*/ */
#if defined(FEAT_XIM) \ #if defined(FEAT_MBYTE)
|| (defined(FEAT_GUI) && (defined(FEAT_MBYTE_IME) || defined(GLOBAL_IME))) \
|| (defined(FEAT_GUI_MAC) && defined(FEAT_MBYTE))
# define USE_IM_CONTROL # define USE_IM_CONTROL
#endif #endif
@ -1485,6 +1483,11 @@ typedef UINT32_TYPEDEF UINT32_T;
#define MIN_COLUMNS 12 /* minimal columns for screen */ #define MIN_COLUMNS 12 /* minimal columns for screen */
#define MIN_LINES 2 /* minimal lines for screen */ #define MIN_LINES 2 /* minimal lines for screen */
#define STATUS_HEIGHT 1 /* height of a status line under a window */ #define STATUS_HEIGHT 1 /* height of a status line under a window */
#ifdef FEAT_MENU /* height of a status line under a window */
# define WINBAR_HEIGHT(wp) (wp)->w_winbar_height
#else
# define WINBAR_HEIGHT(wp) 0
#endif
#define QF_WINHEIGHT 10 /* default height for quickfix window */ #define QF_WINHEIGHT 10 /* default height for quickfix window */
/* /*
@ -1809,14 +1812,15 @@ typedef int sock_T;
/* Include option.h before structs.h, because the number of window-local and /* Include option.h before structs.h, because the number of window-local and
* buffer-local options is used there. */ * buffer-local options is used there. */
#include "option.h" /* options and default values */ #include "option.h" /* options and default values */
#include "beval.h" /* BalloonEval */
/* Note that gui.h is included by structs.h */ /* Note that gui.h is included by structs.h */
#include "structs.h" /* file that defines many structures */ #include "structs.h" /* defines many structures */
#include "alloc.h" #include "alloc.h"
#include "beval.h"
/* Values for "do_profiling". */ /* Values for "do_profiling". */
#define PROF_NONE 0 /* profiling not started */ #define PROF_NONE 0 /* profiling not started */

View File

@ -1081,8 +1081,7 @@ win_split_ins(
/* Set w_fraction now so that the cursor keeps the same relative /* Set w_fraction now so that the cursor keeps the same relative
* vertical position. */ * vertical position. */
if (oldwin->w_height > 0) set_fraction(oldwin);
set_fraction(oldwin);
wp->w_fraction = oldwin->w_fraction; wp->w_fraction = oldwin->w_fraction;
if (flags & WSP_VERT) if (flags & WSP_VERT)
@ -1099,21 +1098,14 @@ win_split_ins(
/* set height and row of new window to full height */ /* set height and row of new window to full height */
wp->w_winrow = tabline_height(); wp->w_winrow = tabline_height();
win_new_height(wp, curfrp->fr_height - (p_ls > 0) win_new_height(wp, curfrp->fr_height - (p_ls > 0)
#ifdef FEAT_MENU - WINBAR_HEIGHT(wp));
- wp->w_winbar_height
#endif
);
wp->w_status_height = (p_ls > 0); wp->w_status_height = (p_ls > 0);
} }
else else
{ {
/* height and row of new window is same as current window */ /* height and row of new window is same as current window */
wp->w_winrow = oldwin->w_winrow; wp->w_winrow = oldwin->w_winrow;
win_new_height(wp, oldwin->w_height win_new_height(wp, oldwin->w_height + WINBAR_HEIGHT(oldwin));
#ifdef FEAT_MENU
+ oldwin->w_winbar_height
#endif
);
wp->w_status_height = oldwin->w_status_height; wp->w_status_height = oldwin->w_status_height;
} }
frp->fr_height = curfrp->fr_height; frp->fr_height = curfrp->fr_height;
@ -1172,10 +1164,7 @@ win_split_ins(
if (flags & (WSP_TOP | WSP_BOT)) if (flags & (WSP_TOP | WSP_BOT))
{ {
int new_fr_height = curfrp->fr_height - new_size int new_fr_height = curfrp->fr_height - new_size
#ifdef FEAT_MENU + WINBAR_HEIGHT(wp) ;
+ wp->w_winbar_height
#endif
;
if (!((flags & WSP_BOT) && p_ls == 0)) if (!((flags & WSP_BOT) && p_ls == 0))
new_fr_height -= STATUS_HEIGHT; new_fr_height -= STATUS_HEIGHT;
@ -1191,7 +1180,8 @@ win_split_ins(
} }
else /* new window below current one */ else /* new window below current one */
{ {
wp->w_winrow = oldwin->w_winrow + oldwin->w_height + STATUS_HEIGHT; wp->w_winrow = oldwin->w_winrow + oldwin->w_height
+ STATUS_HEIGHT + WINBAR_HEIGHT(oldwin);
wp->w_status_height = oldwin->w_status_height; wp->w_status_height = oldwin->w_status_height;
if (!(flags & WSP_BOT)) if (!(flags & WSP_BOT))
oldwin->w_status_height = STATUS_HEIGHT; oldwin->w_status_height = STATUS_HEIGHT;
@ -2868,10 +2858,7 @@ frame_new_height(
/* Simple case: just one window. */ /* Simple case: just one window. */
win_new_height(topfrp->fr_win, win_new_height(topfrp->fr_win,
height - topfrp->fr_win->w_status_height height - topfrp->fr_win->w_status_height
#ifdef FEAT_MENU - WINBAR_HEIGHT(topfrp->fr_win));
- topfrp->fr_win->w_winbar_height
#endif
);
} }
else if (topfrp->fr_layout == FR_ROW) else if (topfrp->fr_layout == FR_ROW)
{ {
@ -3218,10 +3205,7 @@ frame_fix_width(win_T *wp)
frame_fix_height(win_T *wp) frame_fix_height(win_T *wp)
{ {
wp->w_frame->fr_height = wp->w_height + wp->w_status_height wp->w_frame->fr_height = wp->w_height + wp->w_status_height
#ifdef FEAT_MENU + WINBAR_HEIGHT(wp) ;
+ wp->w_winbar_height
#endif
;
} }
/* /*
@ -5682,11 +5666,13 @@ win_drag_vsep_line(win_T *dragwin, int offset)
/* /*
* Set wp->w_fraction for the current w_wrow and w_height. * Set wp->w_fraction for the current w_wrow and w_height.
* Has no effect when the window is less than two lines.
*/ */
void void
set_fraction(win_T *wp) set_fraction(win_T *wp)
{ {
wp->w_fraction = ((long)wp->w_wrow * FRACTION_MULT if (wp->w_height > 1)
wp->w_fraction = ((long)wp->w_wrow * FRACTION_MULT
+ wp->w_height / 2) / (long)wp->w_height; + wp->w_height / 2) / (long)wp->w_height;
} }