Re: [vim/vim] Feature Request: mode() returns Insert sub-mode (#1397)
Hi Yegappan, 2017-1-23(Mon) 2:40:48 UTC+9 yega...@gmail.com: > Hi, > > On Fri, Jan 20, 2017 at 12:35 PM, Zhen-Huan (Kenny) Hu > <vim-dev-git...@256bit.org> wrote: > > diff --git a/src/evalfunc.c b/src/evalfunc.c > > index 4b6bfaa..1f3164f 100644 > > --- a/src/evalfunc.c > > +++ b/src/evalfunc.c > > @@ -7765,10 +7765,16 @@ f_mode(typval_T *argvars, typval_T *rettv) > > } > > else > > #endif > > - if (State & REPLACE_FLAG) > > -buf[0] = 'R'; > > - else > > -buf[0] = 'i'; > > + { > > +if (State & REPLACE_FLAG) > > + buf[0] = 'R'; > > +else > > + buf[0] = 'i'; > > +#ifdef FEAT_INS_EXPAND > > +if (ctrl_x_mode != 0) > > + buf[1] = 'x'; > > +#endif > > + } > > } > > else if (State & CMDLINE) > > { > > > > I tested CTRL-X under both replace mode and insert mode. Under replace mode, > > mode(1) returns Rx and under insert mode, it returns ix. > > > > As a side note, why CTRL-N/P and CTRL-X + CTRL-N/P behave differently than > > CTRL-X + others. It seems if CTRL-N/P cannot find a match, it will > > automatically return to the insert mode. If CTRL-X + others cannot find a > > match, it will stay under CTRL-X mode? > > > > Based on the patch from Hirohito, I have adjusted the patch to handle > this case. Try using the attached patch. `ins_compl_active()` should be referenced before referring to `ctrl_x_mode`. My patch's 'x' means "wait for CTRL-X mode selection". That is, when the following text is displayed on the last line. -- ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y) Thanks. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Patch 8.0.0211
Hi Bram, 2017-1-22(Sun) 6:50:40 UTC+9 Bram Moolenaar: > Patch 8.0.0211 (after 8.0.0210) > Problem:Build fails if the multi-byte feature is disabled. > Solution: Change #ifdef around ins_char_bytes. > Files: src/misc1.c > > > *** ../vim-8.0.0210/src/misc1.c 2017-01-12 21:44:45.142171836 +0100 > --- src/misc1.c 2017-01-21 21:47:16.948216111 +0100 > *** > *** 2177,2192 > void > ins_char(int c) > { > - #if defined(FEAT_MBYTE) || defined(PROTO) > char_u buf[MB_MAXBYTES + 1]; > ! int n; > > n = (*mb_char2bytes)(c, buf); > > /* When "c" is 0x100, 0x200, etc. we don't want to insert a NUL byte. >* Happens for CTRL-Vu9900. */ > if (buf[0] == 0) > buf[0] = '\n'; > > ins_char_bytes(buf, n); > } > --- 2177,2195 > void > ins_char(int c) > { > char_u buf[MB_MAXBYTES + 1]; > ! int n = 1; > > + #if defined(FEAT_MBYTE) || defined(PROTO) > n = (*mb_char2bytes)(c, buf); > > /* When "c" is 0x100, 0x200, etc. we don't want to insert a NUL byte. >* Happens for CTRL-Vu9900. */ > if (buf[0] == 0) > buf[0] = '\n'; > + #else > + buf[0] = c; > + #endif [...] I think `defined(PROTO)` is unnecessary for `#if ~ #endif` which is completed within the function. An attached small patch fixes this. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/misc1.c b/src/misc1.c index 046e2f0..cc5d5e6 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -2180,7 +2180,7 @@ ins_char(int c) char_u buf[MB_MAXBYTES + 1]; int n = 1; -#if defined(FEAT_MBYTE) || defined(PROTO) +#ifdef FEAT_MBYTE n = (*mb_char2bytes)(c, buf); /* When "c" is 0x100, 0x200, etc. we don't want to insert a NUL byte.
Re: [vim/vim] Feature Request: mode() returns Insert sub-mode (#1397)
Hi All, 2017-1-24(Tue) 2:03:05 UTC+9 Zhen-Huan (Kenny) Hu: > else if (ins_compl_active()) > > > > buf[1] = pum_visible() ? 'C' : 'c'; > > > > > > Does this 'C' vs. 'c' mean whether a completion was successful? I don't think > pum_visible() alone is able to determine this accurately since it depends on > whether the user have completeopt=menuone to have a menu if there is only one > match. I'd rather not distinguish it in mode() and let it return 'ic' if > ins_compl_active() no matther whether pum_visible(). I was also thinking somewhat similar. It's a idea level proposal. Adding completion info built-in function ... completion_info() Returns a Dictionary with information about insert mode completion: "active"When completion is active, set to 1. "matches" Numner of matches. "Searching_match_done" Searching match done. "popupmenued" Popup menu displayed. "inserted" Insert a match from the menu. "selected" Select a match in the menu. "ctrl_x_selecting" Waiting for the ctrl-x mode selection. ... -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [vim/vim] Feature Request: mode() returns Insert sub-mode (#1397)
Hi Yegappan, 2017-1-21(Sat) 4:20:02 UTC+9 yega...@gmail.com: > Hi Hirohito, > > On Fri, Jan 20, 2017 at 7:44 AM, h_east <h.east@gmail.com> wrote: > > Hi Bram, Yegappan, Zhen and Vim developers, > > > > 2017-1-20(Fri) 12:44:50 UTC+9 vim-dev ML: > >> Hi, > >> > >> > >> > >> On Thu, Jan 19, 2017 at 3:56 PM, Zhen-Huan (Kenny) Hu > >> > >> <vim-dev...@256bit.org> wrote: > >> > >> > #ifdef FEAT_INS_EXPAND > >> > >> > if (ctrl_x_mode != 0) > >> > >> >buf[0] = 'x'; > >> > >> > else > >> > >> > #endif > >> > >> > > >> > >> > I tested the code. mode() all returns x as expected when pressing > >> > >> > alone, or combined with , , , , , , , > >> > as > >> > >> > well as , > >> > >> > > >> > >> > Pressing or , mode() returns i. > >> > >> > > >> > >> > I agree it should be ix since it's a sub-mode. > >> > >> > > >> > >> > >> > >> An updated patch to return either "ix" or "Rx" is attached. > > [...] > > > > How about attached patch? > > > > Note that Ctrl-X can be pressed in replace mode also. For example, you > can press 'R' to enter replace mode and then invoke completion using > CTRL-X. This diff handles only the insert mode case. That's right. Also, Virtual Replace is the same. Unfortunately, Two letters are not enough for CTRL-X mode on Virtual Replace mode. For example, how do we represent it in the following cases? Type: gR Represent: Rvx ?? Thanks for many advice. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[patch] :.tabnext count depends on the current line of the buffer
Hi Bram and list, How to reproduce: - Run vanilla Vim with five tab-pages. $ vim -Nu NONE -p 1 2 3 4 5 - Edit the first tab-page's buffer and move to current line three. o3 - Type the following command. :.tabnext Expected behavior: - Stay first tab-page. Actual behavior: - Go to the third tab-page. I wrote a patch fixed this issue and other minor issues. And some improvements. Fixed minor issues: - `:tabmove 99` doesn't result in an error. (Even though `:99tabmove` gets an error) - Also `:tabmove -+`, `:tabmove +3-`. Improvements: - Support post count for `:tabnext`, `:tabclose`, `:tabonly`. - Also `:tabprevious`, `:tabNext`. But accept only numbers. (See `:h :tabprevious`) - Add more tests for tab-page command. Patch is attached. Check out and include this please. PS This issue was reported by Ken Hamada (a.k.a. itchyny). -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/runtime/doc/tabpage.txt b/runtime/doc/tabpage.txt index bc40981..e72388c 100644 --- a/runtime/doc/tabpage.txt +++ b/runtime/doc/tabpage.txt @@ -139,6 +139,10 @@ something else. :+tabclose " close the next tab page :1tabclose " close the first tab page :$tabclose " close the last tab page + :tabclose -2" close the two previous tab page + :tabclose + " close the next tab page + :tabclose 3 " close the third tab page + :tabclose $ " close the last tab page < *:tabo* *:tabonly* :tabo[nly][!] Close all other tab pages. @@ -153,13 +157,20 @@ something else. " one :{count}tabo[nly][!] - Close all tab pages except the {count}th one. > +:tabo[nly][!] {count} + Close all tab pages except {count} one. > :.tabonly " as above :-tabonly " close all tab pages except the previous " one :+tabonly " close all tab pages except the next one :1tabonly " close all tab pages except the first one :$tabonly " close all tab pages except the last one + :tabonly - " close all tab pages except the previous +" one + :tabonly +2 " close all tab pages except the two next +" one + :tabonly 1 " close all tab pages except the first one + :tabonly $ " close all tab pages except the last one SWITCHING TO ANOTHER TAB PAGE: @@ -174,7 +185,20 @@ gt *i_CTRL-* *i_* Go to the next tab page. Wraps around from the last to the first one. +:{count}tabn[ext] :tabn[ext] {count} + Go to tab page {count}. The first tab page has number one. > + :-tabnext " go to the previous tab page + :+tabnext " go to the next tab page + :+2tabnext " go to the two next tab page + :1tabnext " go to the first tab page + :$tabnext " go to the last tab page + :tabnext $ " as above + :tabnext - " go to the previous tab page + :tabnext -1 " as above + :tabnext + " go to the next tab page + :tabnext +1 " as above + {count} {count}gt Go to tab page {count}. The first tab page has number one. diff --git a/src/ex_cmds.h b/src/ex_cmds.h index d70ff6a..88dfbb9 100644 --- a/src/ex_cmds.h +++ b/src/ex_cmds.h @@ -65,7 +65,8 @@ #define ADDR_LOADED_BUFFERS 3 #define ADDR_BUFFERS 4 #define ADDR_TABS 5 -#define ADDR_QUICKFIX 6 +#define ADDR_TABS_RELATIVE 6 /* Tab page that only relative */ +#define ADDR_QUICKFIX 7 #define ADDR_OTHER 99 #ifndef DO_DECLARE_EXCMD @@ -1425,9 +1426,9 @@ EX(CMD_tags, "tags", do_tags, ADDR_LINES), EX(CMD_tab, "tab", ex_wrongmodifier, NEEDARG|EXTRA|NOTRLCOM, - ADDR_LINES), + ADDR_TABS), EX(CMD_tabclose, "tabclose", ex_tabclose, - RANGE|NOTADR|COUNT|BANG|TRLBAR|CMDWIN, + BANG|RANGE|NOTADR|ZEROR|EXTRA|NOSPC|TRLBAR|CMDWIN, ADDR_TABS), EX(CMD_tabdo, "tabdo", ex_listdo, NEEDARG|EXTRA|NOTRLCOM|RANGE|NOTADR|DFLALL, @@ -1440,34 +1441,34 @@ EX(CMD_tabfind, "tabfind", ex_splitview, ADDR_TABS), EX(CMD_tabfirst, "tabfirst", ex_tabnext, TRLBAR, - ADDR_LINES), + ADDR_TABS), EX(CMD_tabmove, "tabmove", ex_tabmove, RANGE|NOTADR|ZEROR|EXTRA|NOSPC|TRLBAR, ADDR_TABS), EX(CMD_tablast, "tablast", ex_tabnext, TRLBAR, - ADDR_LINES), + ADDR_TABS), EX(CMD_tabnext, "tabnext", ex_tabnext, - RANGE|N
[patch] Remove "VimL" and like word from Vim source tree
Hi Bram, Dr.Chip and list, I removed "VimL" and like word from Vim source tree. Related comment: https://groups.google.com/d/msg/vim_dev/3Z5yM8KER2w/wAqws0QSEAAJ Please check an attached patch. > Dr.Chip (as a netrw author) There is also a "VimL" word in the help of netrw. I hope you accept the following changes. diff --git a/runtime/doc/pi_netrw.txt b/runtime/doc/pi_netrw.txt index 914c576..633dc87 100644 --- a/runtime/doc/pi_netrw.txt +++ b/runtime/doc/pi_netrw.txt @@ -479,7 +479,7 @@ file using root-relative paths, use the full path: == 4. Network-Oriented File Transfer *netrw-xfer* {{{1 -Network-oriented file transfer under Vim is implemented by a VimL-based script +Network-oriented file transfer under Vim is implemented by a Vim script () using plugin techniques. It currently supports both reading and writing across networks using rcp, scp, ftp or ftp+<.netrc>, scp, fetch, dav/cadaver, rsync, or sftp. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/runtime/doc/if_mzsch.txt b/runtime/doc/if_mzsch.txt index 9ef6c3d..7e206f5 100644 --- a/runtime/doc/if_mzsch.txt +++ b/runtime/doc/if_mzsch.txt @@ -249,7 +249,7 @@ Windows *mzscheme-window* 5. mzeval() Vim function*mzscheme-mzeval* To facilitate bi-directional interface, you can use |mzeval()| function to -evaluate MzScheme expressions and pass their values to VimL. +evaluate MzScheme expressions and pass their values to Vim script. == 6. Using Function references*mzscheme-funcref* diff --git a/runtime/doc/if_pyth.txt b/runtime/doc/if_pyth.txt index 2016e33..72ed7b0 100644 --- a/runtime/doc/if_pyth.txt +++ b/runtime/doc/if_pyth.txt @@ -676,11 +676,11 @@ vim.Function object*python-Function* dictionary. Note that explicit `self` keyword used when calling resulting object overrides this attribute. auto_rebind Boolean. True if partial created from this Python object - and stored in the VimL dictionary should be automatically - rebound to the dictionary it is stored in when this - dictionary is indexed. Exposes Vim internal difference - between `dict.func` (auto_rebind=True) and - `function(dict.func,dict)` (auto_rebind=False). This + and stored in the Vim script dictionary should be + automatically rebound to the dictionary it is stored in + when this dictionary is indexed. Exposes Vim internal + difference between `dict.func` (auto_rebind=True) and + `function(dict.func,dict)` (auto_rebind=False). This attribute makes no sense if `self` attribute is `None`. Constructor additionally accepts `args`, `self` and `auto_rebind` @@ -711,7 +711,7 @@ vim.Function object*python-Function* 8. pyeval() and py3eval() Vim functions *python-pyeval* To facilitate bi-directional interface, you can use |pyeval()| and |py3eval()| -functions to evaluate Python expressions and pass their values to VimL. +functions to evaluate Python expressions and pass their values to Vim script. |pyxeval()| is also available. == diff --git a/runtime/doc/syntax.txt b/runtime/doc/syntax.txt index e300983..7feedd0 100644 --- a/runtime/doc/syntax.txt +++ b/runtime/doc/syntax.txt @@ -3320,8 +3320,8 @@ Some folding is now supported with syntax/vim.vim: > g:vimsyn_folding =~ 't' : fold tcl script < *g:vimsyn_noerror* -Not all error highlighting that syntax/vim.vim does may be correct; VimL is a -difficult language to highlight correctly. A way to suppress error +Not all error highlighting that syntax/vim.vim does may be correct; Vim script +is a difficult language to highlight correctly. A way to suppress error highlighting is to put the following line in your |vimrc|: > let g:vimsyn_noerror = 1 diff --git a/runtime/doc/usr_02.txt b/runtime/doc/usr_02.txt index 48dede8..3c68943 100644 --- a/runtime/doc/usr_02.txt +++ b/runtime/doc/usr_02.txt @@ -589,7 +589,7 @@ Summary: *help-summary* > register: > :help quote: -13)
Re: Patch 8.0.0308
Hi Bram and all, 2017-2-6(Mon) 0:08:19 UTC+9 Bram Moolenaar: > Patch 8.0.0308 > Problem:When using a symbolic link, the package path will not be inserted > at the right position in 'runtimepath'. (Dugan Chen, Norio Takagi) > Solution: Resolve symbolic links when finding the right position in > 'runtimepath'. (Hirohito Higashi) > Files: src/ex_cmds2.c, src/testdir/test_packadd.vim ... Sorry, I forget to delete symbolic link at test_packadd.vim When you do `ctags -R` after running `make test_packadd`, the following error will be output. $ ctags -R ctags: Warning: cannot open source file "testdir/top2_dir" : No such file or directory Attached patch fix this. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/testdir/test_packadd.vim b/src/testdir/test_packadd.vim index 5433c98..bf00fa2 100644 --- a/src/testdir/test_packadd.vim +++ b/src/testdir/test_packadd.vim @@ -98,6 +98,7 @@ func Test_packadd_symlink_dir() set rtp& let rtp = + silent !rm top2_dir endfunc " Check command-line completion for 'packadd'
Re: [vim/vim] printf("%p") is useless (#1466)
Hi Nikolai, Excuse, This has nothing to do with the subject, will not you stop using `VimL`? GitHub ceased using VimL. See the attached image. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [vim/vim] Missing bracket in tex.vim (#1482)
Hi zdohnal, 2017-2-16(Thu) 22:16:59 UTC+9 zdohnal: > Fix for missing bracket in tex.vim (patch is from vim-dev mailing list, > created by Hirohito Higashi ). I did not see any pull request or issue here > for this problem, so I created this pull request for this reason. > > > > You can view, comment on, or merge this pull request online at: > > https://github.com/vim/vim/pull/1482 > > Commit Summary > > Missing bracket in tex.vim > > > File Changes > > > M > runtime/syntax/tex.vim > (2) > > > > Patch Links: > > https://github.com/vim/vim/pull/1482.patch > https://github.com/vim/vim/pull/1482.diff This issue has been already reported by me. and maintainer understood. I think that it will be fixed after a while. https://groups.google.com/d/topic/vim_dev/v8FfVAZcew0/discussion Thanks. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [vim/vim] Missing bracket in tex.vim (#1482)
Hi zdohnal, 2017-2-16(Thu) 22:43:44 UTC+9 zdohnal: > Yes, I understand. I saw your comment on vim-dev mailing list (as I wrote in > brackets), but no issue, no commit or pull request here on github. I thought > email on mailing list can be easily overlooked, so for to be sure I created > this pull request. Vim is not locked in by GitHub. Bram manages the issue properly. Perhaps Bram is busy lately. Please wait for a while until the issue is fixed. (for a few days or weeks or months...) -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Patch 8.0.0325
Hi Bram and list, 2017-2-11(Sat) 19:37:13 UTC+9 Bram Moolenaar: > Patch 8.0.0325 > Problem:Packadd test does not clean up symlink. > Solution: Delete the link. (Hirohito Higashi) > Files: src/testdir/test_packadd.vim > > > *** ../vim-8.0.0324/src/testdir/test_packadd.vim 2017-02-05 > 16:07:50.291087646 +0100 > --- src/testdir/test_packadd.vim 2017-02-11 11:32:27.880899001 +0100 > *** > *** 98,103 > --- 98,104 > > set rtp& > let rtp = > + silent !rm top2_dir > endfunc > > " Check command-line completion for 'packadd' > *** ../vim-8.0.0324/src/version.c 2017-02-09 22:28:11.354931464 +0100 > --- src/version.c 2017-02-11 11:34:13.340127348 +0100 > *** > *** 766,767 > --- 766,769 > { /* Add new patch number below this line */ > + /**/ > + 325, > /**/ Soy, again. My code is very bad. I modified it with the attached patch, so please include it. Please. Related thread. https://groups.google.com/d/topic/vim_dev/0z5sIxPz3CY/discussion I'm so sorry. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/testdir/test_packadd.vim b/src/testdir/test_packadd.vim index bf00fa2..8ffebf9 100644 --- a/src/testdir/test_packadd.vim +++ b/src/testdir/test_packadd.vim @@ -73,7 +73,7 @@ func Test_packadd_symlink_dir() endif let top2_dir = s:topdir . '/Xdir2' let real_dir = s:topdir . '/Xsym' - silent !ln -s real_dir top2_dir + exec "silent !ln -s" real_dir top2_dir let = top2_dir . ',' . top2_dir . '/after' let = @@ -98,7 +98,7 @@ func Test_packadd_symlink_dir() set rtp& let rtp = - silent !rm top2_dir + exec "silent !rm" top2_dir endfunc " Check command-line completion for 'packadd'
[patch] E11 message via Ex command is not translated
Hi Bram and list, E11 output by the following procedure are not translated. q::tabn E11: Invalid in command-line window; executes, CTRL-C quits In this procedure, the translated one is output. q:w E11: コマンドラインでは無効です; で実行, CTRL-Cでやめる NOTE for Beginner. Actually, in order to output the translated message, it is necessary to prepare a file not attached as standard and set `:lang`. I wrote a patch. (attached) Check it out. NOTE: This issue was reported by Norio Takagi. https://github.com/vim-jp/issues/issues/1027 (in Japanese) -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 3ee7056..bc6619e 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -2490,7 +2490,7 @@ do_one_cmd( && !IS_USER_CMDIDX(ea.cmdidx)) { /* Command not allowed when editing the command line. */ - errormsg = get_text_locked_msg(); + errormsg = (char_u *)_(get_text_locked_msg()); goto doend; } #ifdef FEAT_AUTOCMD
Re: [patch] E11 message via Ex command is not translated
Hi Bram and all, It has nothing to do with this patch, but why `e_zerocount` does not have an error number(E999)? Is this intentional? -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [vim/vim] Feature Request: mode() returns Insert sub-mode (#1397)
Hi Bram, Yegappan, Zhen and Vim developers, 2017-1-20(Fri) 12:44:50 UTC+9 vim-dev ML: > Hi, > > > > On Thu, Jan 19, 2017 at 3:56 PM, Zhen-Huan (Kenny) Hu > > <vim-dev...@256bit.org> wrote: > > > #ifdef FEAT_INS_EXPAND > > > if (ctrl_x_mode != 0) > > >buf[0] = 'x'; > > > else > > > #endif > > > > > > I tested the code. mode() all returns x as expected when pressing > > > alone, or combined with , , , , , , , as > > > well as , > > > > > > Pressing or , mode() returns i. > > > > > > I agree it should be ix since it's a sub-mode. > > > > > > > An updated patch to return either "ix" or "Rx" is attached. [...] How about attached patch? -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index ec4030e..ce1dbb5 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -5839,6 +5839,9 @@ mode([expr]) Return a string that indicates the current mode. S Select by line CTRL-S Select blockwise i Insert + ic Insert completion + iC Insert completion with displaying popup menu + ix Insert CTRL-X mode selecting R Replace |R| Rv Virtual Replace |gR| c Command-line diff --git a/src/evalfunc.c b/src/evalfunc.c index 4b6bfaa..c618c41 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -7768,7 +7768,15 @@ f_mode(typval_T *argvars, typval_T *rettv) if (State & REPLACE_FLAG) buf[0] = 'R'; else + { buf[0] = 'i'; +#ifdef FEAT_INS_EXPAND + if (ins_compl_active()) + buf[1] = pum_visible() ? 'C' : 'c'; + else if (ctrl_x_mode == 1) + buf[1] = 'x'; +#endif + } } else if (State & CMDLINE) {
Re: Patch 7.4.2228
Hi Bram and list, 2016-8-19(Fri) 6:05:06 UTC+9 Bram Moolenaar: > Patch 7.4.2228 > Problem:Test files have inconsistant modelines. > Solution: Don't set 'tabstop' to 2, use 'sts' and 'sw'. > Files: src/testdir/README.txt, src/testdir/test_backspace_opt.vim, > src/testdir/test_digraph.vim, src/testdir/test_gn.vim, > src/testdir/test_help_tagjump.vim, > src/testdir/test_increment_dbcs.vim, > src/testdir/test_increment.vim, src/testdir/test_match.vim, > src/testdir/test_tagjump.vim, src/testdir/test_window_cmd.vim, > src/testdir/test_regexp_latin.vim, src/testdir/test_timers.vim [...] Oh, most of them I've created. I'm sorry. After the next will care :-) Speaking of which, what is the official indent setting of Vim script(extension: .vim)? Is the following setting official? set shiftwidth=2 sts=2 expandtab I think that should be described in the runtime/indent/vim.vim decide them. That way you will not have to write a modeline to the test file. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[new feature] :tab modifier's counter supports dollar and relative number
Hi Bram and list, I made a patch about :tab modifier counter. Existing features: :tab split " opens current buffer in new tab page :tab help gt" opens tab page with help for "gt" :0tab help " opens tab page with help before the first one New features: :.tab help gt " same as `:tab help gt` :+tab help " opens tab page with help after the next tab page :-tab help " opens tab page with help before the current one :$tab help " opens tab page with help after the last one Note: If [counter] specified by absolute or relative values, It will perform the range check. When it does out of range(0 ~ number of tabpages), error(E16) occurs. Check it and include please. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/runtime/doc/tabpage.txt b/runtime/doc/tabpage.txt index b98c18b..f2444c0 100644 --- a/runtime/doc/tabpage.txt +++ b/runtime/doc/tabpage.txt @@ -87,14 +87,21 @@ In the GUI tab pages line you can use the right mouse button to open menu. Execute {cmd} and when it opens a new window open a new tab page instead. Doesn't work for |:diffsplit|, |:diffpatch|, |:execute| and |:normal|. - When [count] is omitted the tab page appears after the current - one. - When [count] is specified the new tab page comes after tab - page [count]. Use ":0tab cmd" to get the new tab page as the - first one. + If [count] is given the new tab page appears after the tab + page [count] otherwise the new tab page will appear after the + current one. Examples: > - :tab split " opens current buffer in new tab page - :tab help gt " opens tab page with help for "gt" + :tab split " opens current buffer in new tab page + :tab help gt" opens tab page with help for "gt" + :.tab help gt " as above + :+tab help " opens tab page with help after the next +" tab page + :-tab help " opens tab page with help before the +" current one + :0tab help " opens tab page with help before the +" first one + :$tab help " opens tab page with help after the last +" one CTRL-W gf Open a new tab page and edit the file name under the cursor. See |CTRL-W_gf|. @@ -141,10 +148,11 @@ something else. given, then they become hidden. But modified buffers are never abandoned, so changes cannot get lost. > :tabonly " close all tab pages except the current +" one :{count}tabo[nly][!] Close all tab pages except the {count}th one. > - :.tabonly " one + :.tabonly " as above :-tabonly " close all tab pages except the previous " one :+tabonly " close all tab pages except the next one diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 1a7fbfa..9f1d227 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -1858,9 +1858,7 @@ do_one_cmd( /* * 2. Handle command modifiers. */ - p = ea.cmd; - if (VIM_ISDIGIT(*ea.cmd)) - p = skipwhite(skipdigits(ea.cmd)); + p = skip_range(ea.cmd, NULL); switch (*p) { /* When adding an entry, also modify cmd_exists(). */ @@ -1992,10 +1990,19 @@ do_one_cmd( case 't': if (checkforcmd(, "tab", 3)) { #ifdef FEAT_WINDOWS - if (vim_isdigit(*ea.cmd)) -cmdmod.tab = atoi((char *)ea.cmd) + 1; - else + long tabnr = get_address(, , ADDR_TABS, +ea.skip, FALSE); + if (tabnr == MAXLNUM) cmdmod.tab = tabpage_index(curtab) + 1; + else + { +if (tabnr < 0 || tabnr > LAST_TAB_NR) +{ +errormsg = (char_u *)_(e_invrange); +goto doend; +} +cmdmod.tab = tabnr + 1; + } ea.cmd = p; #endif continue; diff --git a/src/testdir/test_tabpage.vim b/src/testdir/test_tabpage.vim index e6b85d6..f1c41e9 100644 --- a/src/testdir/test_tabpage.vim +++ b/src/testdir/test_tabpage.vim @@ -186,4 +186,36 @@ function Test_tabpage_with_autocmd() bw! endfunction +function Test_tabpage_with_tab_modifier() + for n in range(4) +tabedit + endfor + + function s:check_tab(pre_nr, cmd, post_nr) +exec 'tabnext ' . a:pre_nr +exec a:cmd +call assert_equal(a:post_nr, tabpagenr()) +call assert_equal('help', ) +helpclose + endfunc + + call s:check_tab(1, 'tab help', 2) + call s:check
Re: [patch] SEGV occurs in balloon_show() under certain circumstances.
Hi Ken, 2017-3-2(Thu) 12:26:38 UTC+9 Ken Takata: > Hi, > > 2017/3/2 Thu 11:52:29 UTC+9 h_east wrote: > > Hi Bram, > > > > How to reproduce (on Linux): > > - Go to Vim source directory > > $ cd /path/to/your/vim > > - Configure with enabling gui gnome2 > > $ ./configure --with-features=huge --enable-gui=gnome2 > > --enable-fail-if-missing > > - Make > > $ make > > - Run vanilla CLI Vim > > $ src/vim -Nu NONE > > - Execute the following command. > > :call balloon_show("Hi") > > > > Expected behavior: > > - Nothing happens. (Or an error message is output?) > > > > Actual behavior: > > - SEGV > > > > Attached patch fixes this. > > Isn't it better to add NULL check to the caller of gui_mch_post_balloon()? > Because other part do so. > > Additionally, I found some problems in the document. > > 1. Tabs and spaces are mixed. > 2. '+beval' should be '|+balloon_eval|'. Yeah, your patch is better! Thank you for following me. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[patch] SEGV occurs in balloon_show() under certain circumstances.
Hi Bram, How to reproduce (on Linux): - Go to Vim source directory $ cd /path/to/your/vim - Configure with enabling gui gnome2 $ ./configure --with-features=huge --enable-gui=gnome2 --enable-fail-if-missing - Make $ make - Run vanilla CLI Vim $ src/vim -Nu NONE - Execute the following command. :call balloon_show("Hi") Expected behavior: - Nothing happens. (Or an error message is output?) Actual behavior: - SEGV Attached patch fixes this. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/gui_beval.c b/src/gui_beval.c index dd61945..a63ede4 100644 --- a/src/gui_beval.c +++ b/src/gui_beval.c @@ -437,6 +437,9 @@ get_beval_info( void gui_mch_post_balloon(BalloonEval *beval, char_u *mesg) { +if (beval == NULL) + return; + beval->msg = mesg; if (mesg != NULL) drawBalloon(beval); diff --git a/src/gui_w32.c b/src/gui_w32.c index cd9f31e..13ea26f 100644 --- a/src/gui_w32.c +++ b/src/gui_w32.c @@ -8582,7 +8582,7 @@ gui_mch_post_balloon(BalloonEval *beval, char_u *mesg) { POINT pt; // TRACE0("gui_mch_post_balloon {{{"); -if (beval->showState == ShS_SHOWING) +if (beval == NULL || beval->showState == ShS_SHOWING) return; GetCursorPos(); ScreenToClient(s_textArea, );
Re: Patch 8.0.0375
Hi Bram, 2017-2-26(Sun) 23:09:12 UTC+9 Bram Moolenaar: > Patch 8.0.0375 > Problem:The "+ register is not tested. > Solution: Add a test using another Vim instance to change the "+ register. > (Kazuki Kuriyama) > Files: src/testdir/test_gui.vim [...] You are mistaking the contributor name. `Kazunobu Kuriyama` is correct. I think that it is better to modify it on runtime/doc/version8.txt -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[bug?][patch] Vim command completion is not performed, when expression register inserted
Hi Bram and list, How to reproduce: - Prepare the following vim script file. $ cat sample1.vim function! Sample() return 'autocmd ' endfunction call feedkeys("i\=Sample()\\\") - Run vanilla vim with execute above file. $ vim -Nu NONE -S sample1.vim Expected behavior (I think): Current line displayed `autocomd BufAdd` and popup menu is appeared. Actual behavior: completion is not performed. Below message diplayed in last line. "-- Command-line completion (^V^N^P) Pattern not found" Is this bug? I don't know. But I wrote a patch with a test. Please check an attached patch. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/ex_getln.c b/src/ex_getln.c index 110a95a..7d58ed1 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -4512,6 +4512,8 @@ set_cmd_context( /* pass CMD_SIZE because there is no real command */ set_context_for_expression(xp, str, CMD_SIZE); # endif + while (nextcomm != NULL) + nextcomm = set_one_cmd_context(xp, nextcomm); } else if (ccline.input_fn) { diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim index 6db3bf7..767753f 100644 --- a/src/testdir/test_autocmd.vim +++ b/src/testdir/test_autocmd.vim @@ -172,6 +172,7 @@ func Test_augroup_warning() augroup Another augroup END call assert_true(match(execute('au VimEnter'), "-Deleted-.*VimEnter") >= 0) + augroup! Another " no warning for postpone aucmd delete augroup StartOK diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim index 34a2251..cd87e00 100644 --- a/src/testdir/test_popup.vim +++ b/src/testdir/test_popup.vim @@ -236,22 +236,27 @@ func! Test_popup_completion_insertmode() iunmap endfunc -function! ComplTest() abort - call complete(1, ['source', 'soundfold']) - return '' -endfunction - func Test_noinsert_complete() + function! s:complTest1() abort +call complete(1, ['source', 'soundfold']) +return '' + endfunction + + function! s:complTest2() abort +call complete(1, ['source', 'soundfold']) +return '' + endfunction + new set completeopt+=noinsert - inoremap =ComplTest() + inoremap =s:complTest1() call feedkeys("i\soun\\\.", 'tx') call assert_equal('soundfold', getline(1)) call assert_equal('soundfold', getline(2)) bwipe! new - inoremap =Test() + inoremap =s:complTest2() call feedkeys("i\\\", 'tx') call assert_equal('source', getline(1)) bwipe! @@ -260,10 +265,17 @@ func Test_noinsert_complete() iunmap endfunc +func Test_compl_vim_cmds_after_register_expr() + function! s:test_func() +return 'autocmd ' + endfunction -function! Test() abort - call complete(1, ['source', 'soundfold']) - return '' -endfunction + new + call feedkeys("i\=s:test_func()", 'tx') + " When a new autocmd event is added before the 'BufAdd' in ascending order, + " we will be a need to change here. + call assert_equal('autocmd BufAdd', getline(1)) + bwipe! +endfunc " vim: shiftwidth=2 sts=2 expandtab
Re: [bug?][patch] Vim command completion is not performed, when expression register inserted
Hi Bram and developers! 2016-9-4(Sun) 22:40:41 UTC+9 h_east: > Hi Bram and developers, > > 2016-9-3(Sat) 21:52:42 UTC+9 Bram Moolenaar: > > Hirohito Higashi wrote: > > > > > How to reproduce: > > > - Prepare the following vim script file. > > > $ cat sample1.vim > > > function! Sample() > > > return 'autocmd ' > > > endfunction > > > call feedkeys("i\=Sample()\\\") > > > > > > - Run vanilla vim with execute above file. > > > $ vim -Nu NONE -S sample1.vim > > > > > > > > > Expected behavior (I think): > > > Current line displayed `autocomd BufAdd` and popup menu is appeared. > > > > > > > > > Actual behavior: > > > completion is not performed. > > > Below message diplayed in last line. > > > "-- Command-line completion (^V^N^P) Pattern not found" > > > > > > > > > Is this bug? > > > I don't know. But I wrote a patch with a test. > > > Please check an attached patch. > > > > Isn't the problem that the completion is using ccline, but when getting > > there from insert mode it's never set? So ccline.cmdfirstc is "=" > > because of the previous command. > > Okay. I would try to more investigate. > Thanks. I had more investigate and update a patch. Perhaps, you will accept an attached patch :-) -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/ex_getln.c b/src/ex_getln.c index ed82f0f..5f1e386 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -218,6 +218,7 @@ getcmdline( * custom status line may invoke ":normal". */ struct cmdline_info save_ccline; #endif +int cmdfirstc_save; #ifdef FEAT_EVAL if (firstc == -1) @@ -249,13 +250,19 @@ getcmdline( /* * set some variables for redrawcmd() */ +if (firstc == '=') + cmdfirstc_save = ccline.cmdfirstc; ccline.cmdfirstc = (firstc == '@' ? 0 : firstc); ccline.cmdindent = (firstc > 0 ? indent : 0); /* alloc initial ccline.cmdbuff */ alloc_cmdbuff(exmode_active ? 250 : indent + 1); if (ccline.cmdbuff == NULL) +{ + if (firstc == '=') + ccline.cmdfirstc = cmdfirstc_save; return NULL; /* out of memory */ +} ccline.cmdlen = ccline.cmdpos = 0; ccline.cmdbuff[0] = NUL; @@ -2085,6 +2092,8 @@ returncmd: /* Make ccline empty, getcmdline() may try to use it. */ ccline.cmdbuff = NULL; + if (firstc == '=') + ccline.cmdfirstc = cmdfirstc_save; return p; } } diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim index c029ca1..264cad8 100644 --- a/src/testdir/test_autocmd.vim +++ b/src/testdir/test_autocmd.vim @@ -220,6 +220,7 @@ func Test_augroup_warning() augroup Another augroup END call assert_true(match(execute('au VimEnter'), "-Deleted-.*VimEnter") >= 0) + augroup! Another " no warning for postpone aucmd delete augroup StartOK diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim index dd94933..6e07393 100644 --- a/src/testdir/test_popup.vim +++ b/src/testdir/test_popup.vim @@ -242,22 +242,27 @@ func! Test_popup_completion_insertmode() iunmap endfunc -function! ComplTest() abort - call complete(1, ['source', 'soundfold']) - return '' -endfunction - func Test_noinsert_complete() + function! s:complTest1() abort +call complete(1, ['source', 'soundfold']) +return '' + endfunction + + function! s:complTest2() abort +call complete(1, ['source', 'soundfold']) +return '' + endfunction + new set completeopt+=noinsert - inoremap =ComplTest() + inoremap =s:complTest1() call feedkeys("i\soun\\\.", 'tx') call assert_equal('soundfold', getline(1)) call assert_equal('soundfold', getline(2)) bwipe! new - inoremap =Test() + inoremap =s:complTest2() call feedkeys("i\\\", 'tx') call assert_equal('source', getline(1)) bwipe! @@ -266,10 +271,20 @@ func Test_noinsert_complete() iunmap endfunc +func Test_compl_vim_cmds_after_register_expr() + function! s:test_func() +return 'autocmd ' + endfunction + augroup A_Group +au! + augroup END -function! Test() abort - call complete(1, ['source', 'soundfold']) - return '' -endfunction + new + call feedkeys("i\=s:test_func()", 'tx') + call assert_equal('autocmd A_Group', getline(1)) + autocmd! A_Group + augroup! A_Group + bwipe! +endfunc " vim: shiftwidth=2 sts=2 expandtab
Re: [vim/vim] test_tabpage: Check in Test_tabpage_with_tab_modifier (#1042)
Hi James, 2016-9-6(Tue) 12:11:28 UTC+9 James McCoy: > If the tests are run in a (fake)root environment, > > Test_tabpage_with_tab_modifier fails when run through test_alot.vim. > > This is due to being set by the modeline of the help files, > > and modelines are disabled when running as (fake)root. > > > Using instead avoids the fickleness of the way is > > being set. > > > This was found while attempting to update the Debian packaging of Vim, > > but can be boiled down to: > > > $ fakeroot make -C src/testdir test_alot.res > > > > You can view, comment on, or merge this pull request online at: > > https://github.com/vim/vim/pull/1042 > > Commit Summary > > test_tabpage: Check in Test_tabpage_with_tab_modifier > > > File Changes > > > M > src/testdir/test_tabpage.vim > (2) > > > > Patch Links: > > https://github.com/vim/vim/pull/1042.patch > https://github.com/vim/vim/pull/1042.diff I am writer of Test_tabpage_with_tab_modifier(). Ah, You are right. Thanks for the follow up. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[patch] SEGV when autocmd BufUnload with bwipe
Hi Bram and developers, I checked in 7.4.2321 Case 1 How to reproduce: - Create the following file: $ cat sample1.vim edit a.txt augroup sample autocmd! autocmd BufUnload tabfirst | 2bwipeout! augroup END edit b.txt - Run vanilla Vim with above script file $ vim -Nu NONE -S sample1.vim Expected behavior: SEGV does not occur. Actual behavior: SEGVed. Case 2 How to reproduce: - Create the following file: $ cat sample2.vim setlocal buftype=nowrite augroup sample autocmd! autocmd BufUnload tabfirst | 2bwipeout augroup END normal! i1 edit a.txt call feedkeys("\") - Run vanilla Vim with above script file $ vim -Nu NONE -S sample2.vim Expected behavior: SEGV does not occur. Actual behavior: SEGVed. I know there are rare case and salicious scripts. But, It is not good to SEGV. I wrote a patch. --> `fix_autocmd_bufunload_with_bwipe.patch` check it out. I've also written test. --> `autocmd_bufunload_with_bwipe_test.patch` Unfortunately, it did not SEGV in the pre-patch binary :-/ NOTE: This issue was reported by Norio Takagi. (Thanks!) -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/buffer.c b/src/buffer.c index 9270c39..bef3d32 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -499,6 +499,10 @@ close_buffer( /* When the buffer is no longer in a window, trigger BufWinLeave */ if (buf->b_nwindows == 1) { +# ifdef FEAT_WINDOWS + tabpage_T *save_curtab = curtab; +# endif + buf->b_closing = TRUE; if (apply_autocmds(EVENT_BUFWINLEAVE, buf->b_fname, buf->b_fname, FALSE, buf) @@ -533,6 +537,10 @@ aucmd_abort: if (aborting()) /* autocmds may abort script processing */ return; # endif +# ifdef FEAT_WINDOWS + if (save_curtab != curtab) + return; +# endif } nwindows = buf->b_nwindows; #endif @@ -561,7 +569,9 @@ aucmd_abort: buf->b_nwindows = nwindows; #endif -buf_freeall(buf, (del_buf ? BFA_DEL : 0) + (wipe_buf ? BFA_WIPE : 0)); +if (buf_freeall(buf, (del_buf ? BFA_DEL : 0) + (wipe_buf ? BFA_WIPE : 0)) + == FAIL) + return; #ifdef FEAT_AUTOCMD /* Autocommands may have deleted the buffer. */ @@ -671,8 +681,9 @@ buf_clear_file(buf_T *buf) * BFA_DEL buffer is going to be deleted * BFA_WIPE buffer is going to be wiped out * BFA_KEEP_UNDO do not free undo information + * Return FAIL for failure, OK otherwise. */ -void +int buf_freeall(buf_T *buf, int flags) { #ifdef FEAT_AUTOCMD @@ -693,7 +704,7 @@ buf_freeall(buf_T *buf, int flags) FALSE, buf) && !bufref_valid()) /* autocommands deleted the buffer */ - return; + return FAIL; } if ((flags & BFA_DEL) && buf->b_p_bl) { @@ -701,7 +712,7 @@ buf_freeall(buf_T *buf, int flags) FALSE, buf) && !bufref_valid()) /* autocommands deleted the buffer */ - return; + return FAIL; } if (flags & BFA_WIPE) { @@ -709,7 +720,7 @@ buf_freeall(buf_T *buf, int flags) FALSE, buf) && !bufref_valid()) /* autocommands deleted the buffer */ - return; + return FAIL; } buf->b_closing = FALSE; @@ -717,7 +728,7 @@ buf_freeall(buf_T *buf, int flags) /* If the buffer was in curwin and the window has changed, go back to that * window, if it still exists. This avoids that ":edit x" triggering a * "tabnext" BufUnload autocmd leaves a window behind without a buffer. */ -if (is_curwin && curwin != the_curwin && win_valid_any_tab(the_curwin)) +if (is_curwin && curwin != the_curwin && win_valid_any_tab(the_curwin)) { block_autocmds(); goto_tabpage_win(the_curtab, the_curwin); @@ -727,7 +738,7 @@ buf_freeall(buf_T *buf, int flags) # ifdef FEAT_EVAL if (aborting()) /* autocmds may abort script processing */ - return; + return FAIL; # endif /* @@ -737,7 +748,7 @@ buf_freeall(buf_T *buf, int flags) * Therefore only return if curbuf changed to the deleted buffer. */ if (buf == curbuf && !is_curbuf) - return; + return FAIL; #endif #ifdef FEAT_DIFF diff_buf_delete(buf); /* Can't use 'diff' for unloaded buffer. */ @@ -779,6 +790,7 @@ buf_freeall(buf_T *buf, int flags) syntax_clear(>b_s); /* reset syntax info */ #endif buf->b_flags &= ~BF_READERR;/* a read error is no longer rel
Re: [patch] SEGV when autocmd BufUnload with bwipe
Hi Bram, 2016-9-4(Sun) 21:33:17 UTC+9 h_east: > Hi Bram and developers, > > I checked in 7.4.2321 > > Case 1 > How to reproduce: > - Create the following file: > $ cat sample1.vim > edit a.txt > augroup sample > autocmd! > autocmd BufUnload tabfirst | 2bwipeout! > augroup END > edit b.txt > > - Run vanilla Vim with above script file > $ vim -Nu NONE -S sample1.vim > > Expected behavior: > SEGV does not occur. > > Actual behavior: > SEGVed. > > > > Case 2 > How to reproduce: > - Create the following file: > $ cat sample2.vim > setlocal buftype=nowrite > augroup sample > autocmd! > autocmd BufUnload tabfirst | 2bwipeout > augroup END > normal! i1 > edit a.txt > call feedkeys("\") > > - Run vanilla Vim with above script file > $ vim -Nu NONE -S sample2.vim > > Expected behavior: > SEGV does not occur. > > Actual behavior: > SEGVed. > > > I know there are rare case and salicious scripts. > But, It is not good to SEGV. > > I wrote a patch. --> `fix_autocmd_bufunload_with_bwipe.patch` > check it out. > I've also written test. --> `autocmd_bufunload_with_bwipe_test.patch` > Unfortunately, it did not SEGV in the pre-patch binary :-/ > > NOTE: This issue was reported by Norio Takagi. (Thanks!) My patch also fixed the following case. Case 3 How to reproduce: - Create the following file: $ cat sample3.vim tabedit augroup sample autocmd! autocmd BufWinLeave tabfirst augroup END :%!ls edit! a.txt normal! gt :%!ls call feedkeys("\q::q\") - Run vanilla Vim with above script file $ vim -Nu NONE -S sample3.vim Expected behavior: SEGV does not occur. Actual behavior: SEGVed. Thanks. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [bug?][patch] Vim command completion is not performed, when expression register inserted
Hi Bram and developers, 2016-9-3(Sat) 21:52:42 UTC+9 Bram Moolenaar: > Hirohito Higashi wrote: > > > How to reproduce: > > - Prepare the following vim script file. > > $ cat sample1.vim > > function! Sample() > > return 'autocmd ' > > endfunction > > call feedkeys("i\=Sample()\\\") > > > > - Run vanilla vim with execute above file. > > $ vim -Nu NONE -S sample1.vim > > > > > > Expected behavior (I think): > > Current line displayed `autocomd BufAdd` and popup menu is appeared. > > > > > > Actual behavior: > > completion is not performed. > > Below message diplayed in last line. > > "-- Command-line completion (^V^N^P) Pattern not found" > > > > > > Is this bug? > > I don't know. But I wrote a patch with a test. > > Please check an attached patch. > > Isn't the problem that the completion is using ccline, but when getting > there from insert mode it's never set? So ccline.cmdfirstc is "=" > because of the previous command. Okay. I would try to more investigate. Thanks. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [vim/vim] Syntax folding optimization (#1045)
Hi, 2016-9-8(Thu) 0:14:11 UTC+9 Shougo: > E.g. take an example of a file, where completion takes long, and show how > much this improves? > > > > I have tested it in 2000 lines Vim script file. > > > Before: almost 0.1s wait after each input. It is not usable. > > After: No wait after each input. Why you do not disclose the files, settings and operation using the test? And... I have to say every time, why not a written test? -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: test popupmenu question
uot;the popup menu is not visible" is not equivalent to "the completion mode is not active". After the type , Vim still stay in the first state of the completion mode. It is not related to the visible of popup menu. Check on the gdb. (gdb) p compl_started $4 = 1 (gdb) p pum_visible() $5 = 0 So that, the first behavior `complete_CTRL-E` is correct. Of course, the second and more is `i_CTRL_E`. > > For whatever reason, doing it interactively, this results in: > > , > | Dece > | > | December2015 > ` > (because after inserting the match is still in popupmenu mode and > "ends completion and goes back to what was there before selecting a > match") > > However, a total mystery is to me, when the test is run, it will > complete to > > , > | December2015 > | December2015 > | December2015 > ` Hmm?, I got the following result. (make test_popup in 7.4.2358) 1 FAILED: Found errors in Test_popup_complete2(): function RunTheTest[9]..Test_popup_complete2 line 10: Expected ['December2015', '', 'December2015'] but got ['Dece', '', 'December2015'] I think `['Dece', '', 'December2015']` is right. > > I have left this documented in the test. I am pretty sure, this is a > bug, and therefore, the test fails currently. > > On a related note, since the "noinsert/noselect" property only seem to > change, what is inserted when the completion menu is entered initially, > > It is hard to correctly test for that, therefore, I basically tested, > whether enter will insert a line break or not (difference in the states > as you explained above) and by that we know, if there was something > selected. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Vim 8.0 released!
Hi Bram and Vim developers and users! Congrats!! I'll continue to write a patch in the future :-) -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [vim/vim] Fix systemlist() (#1135)
Hi thinca, 2016-9-30(Fri) 12:01:55 UTC+9 thinca: > @h-east Thank you for your advice! > > I updated the patch. You need select one of the two patches. I think the first one is good. > diff -ru vim.orig/src/testdir/Make_all.mak vim/src/testdir/Make_all.mak > --- vim.orig/src/testdir/Make_all.mak 2016-09-29 11:54:58.0 +0900 > +++ vim/src/testdir/Make_all.mak 2016-09-30 09:26:47.771610300 +0900 > @@ -182,6 +182,7 @@ > test_stat.res \ > test_substitute.res \ > test_syntax.res \ > + test_system_func.res \ > test_textobjects.res \ > test_undo.res \ > test_usercommands.res \ > > > If you want to run from test_alot.vim as follows: > diff -ru vim.orig/src/testdir/test_alot.vim vim/src/testdir/test_alot.vim > --- vim.orig/src/testdir/test_alot.vim2016-09-29 11:54:58.0 > +0900 > +++ vim/src/testdir/test_alot.vim 2016-09-30 10:00:40.479191900 +0900 > @@ -41,6 +41,7 @@ > source test_tagjump.vim > source test_timers.vim > source test_true_false.vim > +source test_system_func.vim > source test_unlet.vim > source test_window_cmd.vim > source test_options.vim -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [patch] Behavior of autocmd BufNew with tabedit is strange
Hi Bram, 2016-10-8(Sat) 23:44:20 UTC+9 Bram Moolenaar: > Hirohito Higashi wrote: > > > How to reproduce: > > - Prepare the following script file > > $ cat sample.vim > > > > e aa.txt > > augroup sample > > autocmd! > > autocmd BufNew * tabedit cc.txt > > Hmm, starting to edit another file in a BufNew autocmd event is just > asking for trouble. In general this should not be allowed. The only > reason it's not an error is to allow for using a temp buffer to do some > work. Okay. > > > augroup END > > > > normal! i1 > > tabedit bb.txt > > > > - Run vanilla Vim with above script file > > $ vim -Nu NONE -S sample.vim > > > > Expected behavior (I think): > > - Three tabpages is opened. > > 1st: aa.txt (modified) > > 2nd: bb.txt (not modified) <-- current tabpage > > 3rd: cc.txt (not modified) > > > > Actual behavior: > > - Three tabpages is opened. > > 1st: aa.txt (modified) > > 2nd: aa.txt (modified) > > 3rd: cc.txt (not modified) <-- current tabpage > > > > > > I wrote a patch and test. > > Check it please. > > > > NOTE 1: This issue was reported by Norio Takagi. > > NOTE 2: The following part of the patch is a change not related to the main > > topic :-) > > --- a/src/buffer.c > > +++ b/src/buffer.c > > @@ -451,7 +451,7 @@ close_buffer( > > intnwindows; > > bufref_T bufref; > > # ifdef FEAT_WINDOWS > > -intis_curwin = (curwin!= NULL && curwin->w_buffer == buf); > > +intis_curwin = (curwin != NULL && curwin->w_buffer == buf); > > win_T *the_curwin = curwin; > > tabpage_T *the_curtab = curtab; > > # endif > > @@ -1649,10 +1649,11 @@ set_curbuf(buf_T *buf, int action) > > #ifdef FEAT_AUTOCMD > > if (!apply_autocmds(EVENT_BUFLEAVE, NULL, NULL, FALSE, curbuf) > > # ifdef FEAT_EVAL > > - || (bufref_valid() && !aborting())) > > + || (bufref_valid() && !aborting()) > > # else > > - || bufref_valid()) > > + || bufref_valid() > > # endif > > + ) > > #endif > > { > > #ifdef FEAT_SYN_HL > > I don't think we should even try fixing this. I suspect there will be > other problems. Since this was modified in passing, I do not compulsion. But, I will ensure that the problem does not occur. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[patch] Behavior of autocmd BufNew with tabedit is strange
Hi Bram and list, How to reproduce: - Prepare the following script file $ cat sample.vim e aa.txt augroup sample autocmd! autocmd BufNew * tabedit cc.txt augroup END normal! i1 tabedit bb.txt - Run vanilla Vim with above script file $ vim -Nu NONE -S sample.vim Expected behavior (I think): - Three tabpages is opened. 1st: aa.txt (modified) 2nd: bb.txt (not modified) <-- current tabpage 3rd: cc.txt (not modified) Actual behavior: - Three tabpages is opened. 1st: aa.txt (modified) 2nd: aa.txt (modified) 3rd: cc.txt (not modified) <-- current tabpage I wrote a patch and test. Check it please. NOTE 1: This issue was reported by Norio Takagi. NOTE 2: The following part of the patch is a change not related to the main topic :-) --- a/src/buffer.c +++ b/src/buffer.c @@ -451,7 +451,7 @@ close_buffer( intnwindows; bufref_T bufref; # ifdef FEAT_WINDOWS -intis_curwin = (curwin!= NULL && curwin->w_buffer == buf); +intis_curwin = (curwin != NULL && curwin->w_buffer == buf); win_T *the_curwin = curwin; tabpage_T *the_curtab = curtab; # endif @@ -1649,10 +1649,11 @@ set_curbuf(buf_T *buf, int action) #ifdef FEAT_AUTOCMD if (!apply_autocmds(EVENT_BUFLEAVE, NULL, NULL, FALSE, curbuf) # ifdef FEAT_EVAL - || (bufref_valid() && !aborting())) + || (bufref_valid() && !aborting()) # else - || bufref_valid()) + || bufref_valid() # endif + ) #endif { #ifdef FEAT_SYN_HL -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/buffer.c b/src/buffer.c index b013295..dcd2b71 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -451,7 +451,7 @@ close_buffer( int nwindows; bufref_T bufref; # ifdef FEAT_WINDOWS -int is_curwin = (curwin!= NULL && curwin->w_buffer == buf); +int is_curwin = (curwin != NULL && curwin->w_buffer == buf); win_T *the_curwin = curwin; tabpage_T *the_curtab = curtab; # endif @@ -1649,10 +1649,11 @@ set_curbuf(buf_T *buf, int action) #ifdef FEAT_AUTOCMD if (!apply_autocmds(EVENT_BUFLEAVE, NULL, NULL, FALSE, curbuf) # ifdef FEAT_EVAL - || (bufref_valid() && !aborting())) + || (bufref_valid() && !aborting()) # else - || bufref_valid()) + || bufref_valid() # endif + ) #endif { #ifdef FEAT_SYN_HL @@ -1866,6 +1867,10 @@ buflist_new( #ifdef UNIX stat_T st; #endif +# ifdef FEAT_WINDOWS +win_T *the_curwin = curwin; +tabpage_T *the_curtab = curtab; +# endif if (top_file_num == 1) hash_init(_hashtab); @@ -2108,6 +2113,19 @@ buflist_new( } #endif +# ifdef FEAT_WINDOWS +/* If the window or tab page has changed, go back to that window, if it + * still exists. This avoids that ":tabedit" triggering a "tabedit" BufNew + * autocmd leaves a window or tab page. */ +if ((curwin != the_curwin || curtab != the_curtab) + && valid_tabpage(the_curtab) && win_valid_any_tab(the_curwin)) +{ + block_autocmds(); + goto_tabpage_win(the_curtab, the_curwin); + unblock_autocmds(); +} +# endif + return buf; } diff --git a/src/testdir/test_autocmd.vim b/src/testdir/test_autocmd.vim index 6ebfee4..cceae25 100644 --- a/src/testdir/test_autocmd.vim +++ b/src/testdir/test_autocmd.vim @@ -322,3 +322,40 @@ func Test_three_windows() call delete('Xtestje2') call delete('Xtestje3') endfunc + +function! Test_autocmd_bufnew_with_tabedit() + e aa.txt + augroup test_group + autocmd! + autocmd BufNew * tabedit cc.txt + augroup END + + normal! i1 + tabedit bb.txt + + autocmd! test_group + augroup! test_group + + let tnum = tabpagenr('$') + call assert_equal(3, tnum) + call assert_equal(2, tabpagenr()) + call assert_equal('bb.txt', bufname('%')) + let li = [] + tabrewind + for t in range(1, tnum) +let di = {} +let di.winnum = winnr('$') +let di.bufname = bufname('%') +let di.mod = +call add(li, di) +tabnext + endfor + bwipe! aa.txt + bwipe! bb.txt + bwipe! cc.txt + + call assert_equal({'winnum': 1, 'bufname': 'aa.txt', 'mod': 1}, li[0]) + call assert_equal({'winnum': 1, 'bufname': 'bb.txt', 'mod': 0}, li[1]) + call assert_equal({'winnum': 1, 'bufname': 'cc.txt', 'mod': 0}, li[2]) +endfunction +" vim: shiftwidth=2 sts=2 expandtab
Re: [vim/vim] fix the order of lbuffer and lbottom to be compatible with help (#1093)
Hi haya14busa, Bram and list! 2016-9-18(Sun) 2:10:03 UTC+9 haya14busa: > However, I +1 to fix the document. > > > > Really? :lbuffer exists since Vim 7.0. > d12f5c1#diff-ce3914d764138d99accdab481d1a3204R183 > > > I respects that Vim cares backward compatibility. lbottom was introduced > recently (Jul 10), so I prefer to changing behavior not to surprise many > users who use Vim under 7.4.2010 > > > On top of that, :cb executes :cbuffer, not :cbottom. > > I prefer consistency between quickfix commands and location list commands. Yeah, It wanted to know. Your patch is looks good for me. BTW, I have implemented a mechanism in my product `syntax-vim-ex` to check the Ex-command abbreviation between the code and the document. https://github.com/vim-jp/syntax-vim-ex https://github.com/vim-jp/syntax-vim-ex/blob/generator/gen_syntax_vim.vim#L172-L210 The following is the check result. 8< Sanity errors: Ex-cmd `:argg` (short name of `:argglobal`) is not found in the help tag. Ex-cmd `:argl` (short name of `:arglocal`) is not found in the help tag. Ex-cmd `:bufd` (short name of `:bufdo`) is not found in the help tag. Ex-cmd `:cfd` (short name of `:cfdo`) is not found in the help tag. Ex-cmd `:cst` (short name of `:cstag`) is not found in the help tag. Ex-cmd `:deb` (short name of `:debug`) is not found in the help tag. Ex-cmd `:hid` (short name of `:hide`) is not found in the help tag. Ex-cmd `:int` (short name of `:intro`) is not found in the help tag. Ex-cmd `:lbu` (short name of `:lbuffer`) is not found in the help tag. Ex-cmd `:ld` (short name of `:ldo`) is not found in the help tag. Ex-cmd `:lfd` (short name of `:lfdo`) is not found in the help tag. Ex-cmd `:luad` (short name of `:luado`) is not found in the help tag. Ex-cmd `:luaf` (short name of `:luafile`) is not found in the help tag. Ex-cmd `:nb` (short name of `:nbkey`) is not found in the help tag. Ex-cmd `:nbc` (short name of `:nbclose`) is not found in the help tag. Ex-cmd `:nbs` (short name of `:nbstart`) is not found in the help tag. Ex-cmd `:ow` (short name of `:ownsyntax`) is not found in the help tag. Ex-cmd `:pt` (short name of `:ptag`) is not found in the help tag. Ex-cmd `:pyd` (short name of `:pydo`) is not found in the help tag. Ex-cmd `:py3d` (short name of `:py3do`) is not found in the help tag. Ex-cmd `:py3f` (short name of `:py3file`) is not found in the help tag. Ex-cmd `:rund` (short name of `:rundo`) is not found in the help tag. Ex-cmd `:startg` (short name of `:startgreplace`) is not found in the help tag. Ex-cmd `:startr` (short name of `:startreplace`) is not found in the help tag. Ex-cmd `:synti` (short name of `:syntime`) is not found in the help tag. Ex-cmd `:smi` (short name of `:smile`) is not found in the help tag. Ex-cmd `:to` (short name of `:topleft`) is not found in the help tag. Ex-cmd `:wi` (short name of `:winsize`) is not found in the help tag. Ex-cmd `:wind` (short name of `:windo`) is not found in the help tag. Ex-cmd `:wu` (short name of `:wundo`) is not found in the help tag. Makefile:44: recipe for target 'vim.vim.rc' failed make: *** [vim.vim.rc] Error 1 8< I fixed them except `:lbu`. it is fixed in haya14busa's patch. I attached a patch. contained he's patch. I confirmed it becomes all systems green Please check this. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/runtime/doc/editing.txt b/runtime/doc/editing.txt index 58a1f2e..b40e4bc 100644 --- a/runtime/doc/editing.txt +++ b/runtime/doc/editing.txt @@ -824,7 +824,7 @@ LOCAL ARGUMENT LIST {not in Vi} {not available when compiled without the |+windows| or |+listcmds| features} - *:arglocal* + *:arglocal* *:argl* :argl[ocal] Make a local copy of the global argument list. Doesn't start editing another file. @@ -832,7 +832,7 @@ LOCAL ARGUMENT LIST Define a new argument list, which is local to the current window. Works like |:args_f| otherwise. - *:argglobal* + *:argglobal* *:argg* :argg[lobal] Use the global argument list for the current window. Doesn't start editing another file. diff --git a/runtime/doc/gui.txt b/runtime/doc/gui.txt index efe6319..49e3684 100644 --- a/runtime/doc/gui.txt +++ b/runtime/doc/gui.txt @@ -144,8 +144,8 @@ task bar with the 'guiheadroom' option. remembered until the window is opened. The position is adjusted to make the window fit on the screen (if possible). - *:win* *:wins
Re: test popupmenu question
Hi ChrisBra, Bram and list! 2016-9-12(Mon) 2:56:04 UTC+9 Christian Brabandt: > On So, 11 Sep 2016, h_east wrote: > > > Hi ChrisBra, Bram and list, > > 2016-7-24(Sun) 0:36:14 UTC+9 Christian Brabandt: > > > On Sa, 23 Jul 2016, Bram Moolenaar wrote: > > > > Christian Brabandt wrote: > > > I think I also found a bug, and this makes the test currently fail. > > > Take this example from the test: > > > > > > (The popupmenu is the one from the help for all months) > > > The initial state of the buffer is this: > > > , > > > | D > > > | December2015 > > > ` > > > > I have investigated this behavior. > > > > Related vim_dev threads: > > - Patch 7.4.2146 > > https://groups.google.com/d/msg/vim_dev/75ZXlRlBzl4/DDnqvSn9BgAJ > > - [vim/vim] VIM 7.4: Possible regression via patch 2146? (#972) > > https://groups.google.com/d/msg/vim_dev/mQ2YacpOKvo/vOsgkU-2AQAJ > > - Patch 7.4.2188 > > https://groups.google.com/d/msg/vim_dev/e2Rr8Px3qkQ/1XWiAQ0LAgAJ > > > > I think the series of behavior is correct. > > okay. > > > > , > > > | Dece > > > | > > > | December2015 > > > ` > > > (because after inserting the match is still in popupmenu mode and > > > "ends completion and goes back to what was there before selecting a > > > match") > > > > > > However, a total mystery is to me, when the test is run, it will > > > complete to > > > > > > , > > > | December2015 > > > | December2015 > > > | December2015 > > > ` > > > > Hmm?, I got the following result. (make test_popup in 7.4.2358) > > > > 1 FAILED: > > Found errors in Test_popup_complete2(): > > function RunTheTest[9]..Test_popup_complete2 line 10: Expected > > ['December2015', '', 'December2015'] but got ['Dece', '', 'December2015'] > > > > I think `['Dece', '', 'December2015']` is right. > > Okay then we can enable the test again and need to change the test > assert. I changed test_popup.vim I was wondering if you can check an attached patch? I would like you to check the mainly English sentence Thank you -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim index 6e07393..eae8bc3 100644 --- a/src/testdir/test_popup.vim +++ b/src/testdir/test_popup.vim @@ -17,16 +17,18 @@ func! ListMonths() endfunc func! Test_popup_complete2() - " Insert match immediately, if there is only one match - " Should select a character from the line below - " TODO: test disabled because the code change has been reverted. - throw "Skipped: Bug with and popupmenu not fixed yet" + " 'the popup menu is not visible' is not equivalent to 'the completion mode + " is not active'. + " After the type , Vim still stay in the first state of the completion + " mode. It is not related to the visible of popup. + " So that, the first behavior is `complete_CTRL-E`, and the second and + " more is `i_CTRL_E` new inoremap =ListMonths() call append(1, ["December2015"]) :1 call feedkeys("aD\\\", 'tx') - call assert_equal(["December2015", "", "December2015"], getline(1,3)) + call assert_equal(["Dece", "", "December2015"], getline(1,3)) %d bw! endfu
Re: test popupmenu question
Hi ChrisBra, Bram and list, 2016-9-23(Fri) 0:34:35 UTC+9 Christian Brabandt: > Hi, > > On Mi, 21 Sep 2016, h_east wrote: > > func! Test_popup_complete2() > > - " Insert match immediately, if there is only one match > > - " Should select a character from the line below > > - " TODO: test disabled because the code change has been reverted. > > - throw "Skipped: Bug with and popupmenu not fixed yet" > > + " 'the popup menu is not visible' is not equivalent to 'the completion > > mode > > + " is not active'. > > + " After the type , Vim still stay in the first state of the > > completion > > + " mode. It is not related to the visible of popup. > > + " So that, the first behavior is `complete_CTRL-E`, and the second > > and > > + " more is `i_CTRL_E` > > > How about this: > Although the popupmenu is not visible, this does not mean completion > mode has ended. After pressing to complete the currently typed > char, Vim still stays in the first state of the completion > (:h ins-completion-menu), although the popupmenu wasn't shown will > remove the inserted completed text (:h complete_CTRL-E), while the > following will behave like expected (:h i_CTRL-E) Nicely. I like this. Thanks. > > > - call assert_equal(["December2015", "", "December2015"], getline(1,3)) > > + call assert_equal(["Dece", "", "December2015"], getline(1,3)) > > Looks good to me. Thanks for the check. I update a patch. Bram> Please include this patch. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim index 6e07393..10eaf3a 100644 --- a/src/testdir/test_popup.vim +++ b/src/testdir/test_popup.vim @@ -17,16 +17,18 @@ func! ListMonths() endfunc func! Test_popup_complete2() - " Insert match immediately, if there is only one match - " Should select a character from the line below - " TODO: test disabled because the code change has been reverted. - throw "Skipped: Bug with and popupmenu not fixed yet" + " Although the popupmenu is not visible, this does not mean completion mode + " has ended. After pressing to complete the currently typed char, Vim + " still stays in the first state of the completion (:h ins-completion-menu), + " although the popupmenu wasn't shown will remove the inserted + " completed text (:h complete_CTRL-E), while the following will behave + " like expected (:h i_CTRL-E) new inoremap =ListMonths() call append(1, ["December2015"]) :1 call feedkeys("aD\\\", 'tx') - call assert_equal(["December2015", "", "December2015"], getline(1,3)) + call assert_equal(["Dece", "", "December2015"], getline(1,3)) %d bw! endfu
[Proposal][patch] Add `const` for reference only pointer C function argument
Hi Bram and list, Title is as it is. Merit: - Compiler optimizations will be a bit smarter. - Execution speed will be a bit faster. - Compiler us warn the code assignment wrong. Demerit: - None. (maybe) I made a patch for proposal. How about this? When it's Okay, I'll continue with the remaining of the work. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/buffer.c b/src/buffer.c index b013295..b2fe5fa 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -377,7 +377,7 @@ set_bufref(bufref_T *bufref, buf_T *buf) * Only goes through the buffer list if buf_free_count changed. */ int -bufref_valid(bufref_T *bufref) +bufref_valid(const bufref_T *bufref) { return bufref->br_buf_free_count == buf_free_count ? TRUE : buf_valid(bufref->br_buf); @@ -388,7 +388,7 @@ bufref_valid(bufref_T *bufref) * This can be slow if there are many buffers, prefer using bufref_valid(). */ int -buf_valid(buf_T *buf) +buf_valid(const buf_T *buf) { buf_T *bp; diff --git a/src/eval.c b/src/eval.c index 6873b97..5ec9733 100644 --- a/src/eval.c +++ b/src/eval.c @@ -6696,7 +6696,7 @@ v_throwpoint(char_u *oldval) * Must always be called in pairs! */ char_u * -set_cmdarg(exarg_T *eap, char_u *oldarg) +set_cmdarg(const exarg_T *eap, char_u *oldarg) { char_u *oldval; char_u *newval; diff --git a/src/fileio.c b/src/fileio.c index ea1f338..44f381d 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -7780,7 +7780,7 @@ static char_u *find_end_event(char_u *arg, int have_group); static int event_ignored(event_T event); static int au_get_grouparg(char_u **argp); static int do_autocmd_event(event_T event, char_u *pat, int nested, char_u *cmd, int forceit, int group); -static int apply_autocmds_group(event_T event, char_u *fname, char_u *fname_io, int force, int group, buf_T *buf, exarg_T *eap); +static int apply_autocmds_group(event_T event, char_u *fname, char_u *fname_io, int force, int group, const buf_T *buf, const exarg_T *eap); static void auto_next_pat(AutoPatCmd *apc, int stop_at_last); #if defined(FEAT_AUTOCMD) || defined(FEAT_WILDIGN) static int match_file_pat(char_u *pattern, regprog_T **prog, char_u *fname, char_u *sfname, char_u *tail, int allow_dirs); @@ -7949,7 +7949,7 @@ au_cleanup(void) * autocmds. */ void -aubuflocal_remove(buf_T *buf) +aubuflocal_remove(const buf_T *buf) { AutoPat *ap; event_T event; @@ -9098,7 +9098,7 @@ apply_autocmds( char_u *fname, /* NULL or empty means use actual file name */ char_u *fname_io, /* fname to use for on cmdline */ int force, /* when TRUE, ignore autocmd_busy */ -buf_T *buf) /* buffer for */ +const buf_T *buf) /* buffer for */ { return apply_autocmds_group(event, fname, fname_io, force, AUGROUP_ALL, buf, NULL); @@ -9263,8 +9263,8 @@ apply_autocmds_group( use fname */ int force, /* when TRUE, ignore autocmd_busy */ int group, /* group ID, or AUGROUP_ALL */ -buf_T *buf, /* buffer for */ -exarg_T *eap) /* command arguments */ +const buf_T *buf, /* buffer for */ +const exarg_T *eap) /* command arguments */ { char_u *sfname = NULL; /* short file name */ char_u *tail; diff --git a/src/fold.c b/src/fold.c index d3635a6..42d92ab 100644 --- a/src/fold.c +++ b/src/fold.c @@ -100,7 +100,7 @@ static int foldendmarkerlen; * Copy that folding state from window "wp_from" to window "wp_to". */ void -copyFoldingState(win_T *wp_from, win_T *wp_to) +copyFoldingState(const win_T *wp_from, win_T *wp_to) { wp_to->w_fold_manual = wp_from->w_fold_manual; wp_to->w_foldinvalid = wp_from->w_foldinvalid; @@ -1083,17 +1083,17 @@ foldAdjustCursor(void) * Return FAIL if the operation cannot be completed, otherwise OK. */ void -cloneFoldGrowArray(garray_T *from, garray_T *to) +cloneFoldGrowArray(const garray_T *from, garray_T *to) { int i; -fold_T *from_p; +const fold_T *from_p; fold_T *to_p; ga_init2(to, from->ga_itemsize, from->ga_growsize); if (from->ga_len == 0 || ga_grow(to, from->ga_len) == FAIL) return; -from_p = (fold_T *)from->ga_data; +from_p = (const fold_T *)from->ga_data; to_p = (fold_T *)to->ga_data; for (i = 0; i < from->ga_len; i++) diff --git a/src/mark.c b/src/mark.c index 0627a7c..04e7abf 100644 --- a/src/mark.c +++ b/src/mark.c @@ -1315,7
[patch] fix document related to defaults.vim
Hi Bram and list, There is described in the document about the options that you changed in defaults.vim. But, some options are not described. I added some describe. Please check it out. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/runtime/defaults.vim b/runtime/defaults.vim index 43ff1e0..38ddaee 100644 --- a/runtime/defaults.vim +++ b/runtime/defaults.vim @@ -1,13 +1,19 @@ " The default vimrc file. " " Maintainer: Bram Moolenaar <b...@vim.org> -" Last change: 2016 Sep 02 +" Last change: 2016 Sep 16 " " This is loaded if no vimrc file was found. " Except when Vim is run with "-u NONE" or "-C". " Individual settings can be reverted with ":set option&". " Other commands can be reverted as mentioned below. +" NOTE: When you changed the option value in this file, you should also modify +" the document (doc/options.txt). +" You remember looking at this! +" :help options +" /defaults\.vim + " When started as "evim", evim.vim will already have done these settings. if v:progname =~? "evim" finish diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 3ec648b..07da051 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -4313,7 +4313,7 @@ A jump table for the options with a short description can be found at |Q_op|. *'incsearch'* *'is'* *'noincsearch'* *'nois'* 'incsearch' 'is' boolean (default off, set in |defaults.vim| if the - +reltime feature is supported) + |+reltime| feature is supported) global {not in Vi} {not available when compiled without the @@ -6183,7 +6183,7 @@ A jump table for the options with a short description can be found at |Q_op|. NOTE: This option is set to 1 when 'compatible' is set. *'scrolloff'* *'so'* -'scrolloff' 'so' number (default 0) +'scrolloff' 'so' number (default 0, set to 5 in |defaults.vim|) global {not in Vi} Minimal number of screen lines to keep above and below the cursor. @@ -7685,7 +7685,7 @@ A jump table for the options with a short description can be found at |Q_op|. 'timeout' 'to' boolean (default on) global *'ttimeout'* *'nottimeout'* -'ttimeout' boolean (default off) +'ttimeout' boolean (default off, set in |defaults.vim|) global {not in Vi} These two options together determine the behavior when part of a @@ -7720,7 +7720,7 @@ A jump table for the options with a short description can be found at |Q_op|. global {not in all versions of Vi} *'ttimeoutlen'* *'ttm'* -'ttimeoutlen' 'ttm' number (default -1) +'ttimeoutlen' 'ttm' number (default -1, set to 100 in |defaults.vim|) global {not in Vi} The time in milliseconds that is waited for a key code or mapped key
Re: [patch] fix document related to defaults.vim
Hi Bram and list, 2016-9-17(Sat) 3:30:26 UTC+9 Bram Moolenaar: > Hirohito Higashi wrote: > > > There is described in the document about the options that you changed > > in defaults.vim. > > But, some options are not described. > > > > I added some describe. > > Please check it out. > > Thanks. I think the remark in defaults.vim won't help much though. Well, Please change as your favorite :-) Thanks. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [vim/vim] fix the order of lbuffer and lbottom to be compatible with help (#1093)
Hi haya14busa, 2016-9-17(Sat) 22:58:46 UTC+9 haya14busa: > Hi! I found small bug(?) > > :h :lbuffer > > *:lb* *:lbuffer* > :lb[uffer][!] [bufnr] Same as ":cbuffer", except the location list for the > current window is used instead of the quickfix list. > > > :h :lbottom > > *:lbo* *:lbottom* > :lbo[ttom] Same as ":cbottom", except use the window showing the > location list for the current window. > > > > According to the help doc, :lb should execute :lbuffer, but it executes > :lbottom due to the ex-cmd definition order. > > > :lbottom was introduced by patch 7.4.2010 (which is relatively newer than > :lbuffer). > > 537ef08 > > > I fixed the order to make the behavior compatible with help (and old vim) Nice catch! However, I +1 to fix the document. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[patch] test62.{in,ok} convert to the new style test `test_tabpage.vim`
Hi Bram and list, Attach a patch. Please include this. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/Makefile b/src/Makefile index 28b4b20..5d895f1 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2041,7 +2041,7 @@ test1 \ test30 test31 test32 test33 test34 test36 test37 test38 test39 \ test40 test41 test42 test43 test44 test45 test46 test48 test49 \ test50 test51 test52 test53 test54 test55 test56 test57 test58 test59 \ - test60 test62 test64 test65 test66 test67 test68 test69 \ + test60 test64 test65 test66 test67 test68 test69 \ test70 test71 test72 test73 test74 test75 test76 test77 test78 test79 \ test80 test81 test82 test83 test84 test85 test86 test87 test88 test89 \ test90 test91 test92 test93 test94 test95 test97 test98 test99 \ @@ -2122,6 +2122,7 @@ test_arglist \ test_syn_attr \ test_syntax \ test_tabline \ + test_tabpage \ test_tagjump \ test_textobjects \ test_timers \ diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak index 2762a39..19973d5 100644 --- a/src/testdir/Make_all.mak +++ b/src/testdir/Make_all.mak @@ -50,7 +50,6 @@ SCRIPTS_ALL = \ test56.out \ test57.out \ test60.out \ - test62.out \ test64.out \ test65.out \ test66.out \ diff --git a/src/testdir/test62.in b/src/testdir/test62.in deleted file mode 100644 index c437f36..000 --- a/src/testdir/test62.in +++ /dev/null @@ -1,205 +0,0 @@ -Tests for tab pages - -STARTTEST -:so small.vim -:lang C -:" Simple test for opening and closing a tab page -:tabnew -:let nr = tabpagenr() -:q -:call append(line('$'), 'tab page ' . nr) -:unlet nr -:" -:" Open three tab pages and use ":tabdo" -:0tabnew -:1tabnew -:$tabnew -:tabdo call append(line('$'), 'this is tab page ' . tabpagenr()) -:tabclose! 2 -:tabrewind -:let line1 = getline('$') -:undo -:q -:tablast -:let line2 = getline('$') -:q! -:call append(line('$'), line1) -:call append(line('$'), line2) -:unlet line1 line2 -:" -:" Test for settabvar() and gettabvar() functions. Open a new tab page and -:" set 3 variables to a number, string and a list. Verify that the variables -:" are correctly set. -:tabnew -:tabfirst -:call settabvar(2, 'val_num', 100) -:call settabvar(2, 'val_str', 'SetTabVar test') -:call settabvar(2, 'val_list', ['red', 'blue', 'green']) -:" -:let test_status = 'gettabvar: fail' -:if gettabvar(2, 'val_num') == 100 && gettabvar(2, 'val_str') == 'SetTabVar test' && gettabvar(2, 'val_list') == ['red', 'blue', 'green'] -:let test_status = 'gettabvar: pass' -:endif -:call append(line('$'), test_status) -:" -:tabnext 2 -:let test_status = 'settabvar: fail' -:if t:val_num == 100 && t:val_str == 'SetTabVar test' && t:val_list == ['red', 'blue', 'green'] -: let test_status = 'settabvar: pass' -:endif -:tabclose -:call append(line('$'), test_status) -:" -:if has('gui') || has('clientserver') -:" Test for ":tab drop exist-file" to keep current window. -:sp test1 -:tab drop test1 -:let test_status = 'tab drop 1: fail' -:if tabpagenr('$') == 1 && winnr('$') == 2 && winnr() == 1 -:let test_status = 'tab drop 1: pass' -:endif -:close -:call append(line('$'), test_status) -:" -:" -:" Test for ":tab drop new-file" to keep current window of tabpage 1. -:split -:tab drop newfile -:let test_status = 'tab drop 2: fail' -:if tabpagenr('$') == 2 && tabpagewinnr(1, '$') == 2 && tabpagewinnr(1) == 1 -:let test_status = 'tab drop 2: pass' -:endif -:tabclose -:q -:call append(line('$'), test_status) -:" -:" -:" Test for ":tab drop multi-opend-file" to keep current tabpage and window. -:new test1 -:tabnew -:new test1 -:tab drop test1 -:let test_status = 'tab drop 3: fail' -:if tabpagenr() == 2 && tabpagewinnr(2, '$') == 2 && tabpagewinnr(2) == 1 -:let test_status = 'tab drop 3: pass' -:endif -:tabclose -:q -:call append(line('$'), test_status) -:else -:" :drop not supported -:call append(line('$'), 'tab drop 1: pass') -:call append(line('$'), 'tab drop 2: pass') -:call append(line('$'), 'tab drop 3: pass') -:endif -:" -:" -:for i in range(9) | tabnew | endfor -1gt -:$put =tabpagenr() -:tabmove 5 -:$put =tabpagenr() -:.tabmove -:$put =tabpagenr() -:tabmove - -:$put =tabpagenr() -:tabmove + -:$put =tabpagenr() -:tabmove -2 -:$put =tabpagenr() -:tabmove +4 -:$put =tabpagenr() -:tabmove -:$put =tabpagenr() -:ta
Re: Patch 7.4.2259
Hi Bram and list, 2016-8-27(Sat) 2:14:14 UTC+9 Bram Moolenaar: > Patch 7.4.2259 > Problem:With 'incsearch' can only see the next match. > Solution: Make CTRL-N/CTRL-P move to the previous/next match. (Christian > Brabandt) > Files: runtime/doc/cmdline.txt, src/ex_getln.c, src/testdir/Make_all.mak, > src/testdir/test_search.vim, src/Makefile [...] Probably, I think that the attached patch is better to include. It's not an error because the static function. However it is better to mimic the other static functions. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/ex_getln.c b/src/ex_getln.c index f6e5097..881d057 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -7077,7 +7077,7 @@ script_get(exarg_T *eap, char_u *cmd) return (char_u *)ga.ga_data; } -#ifdef FEAT_SEARCH_EXTRA +#if defined(FEAT_SEARCH_EXTRA) || defined(PROTO) static void set_search_match(pos_T *t) {
[bug][patch] Unexpectedly preview window opened, after the `:ptjump` command canceled.
Hi Bram and developers, How to reproduce: - Change directory to your local vim/src directory. $ cd /path-to-your-vim-clone-dir/vim/src - Start vanilla Vim. $ ./vim -Nu NONE - Do tagjump and display in the preview window. (In fact, it becomes selected wait because candidates are two) :ptjump cmdmod - Cancel the selection. - Display the help. :help Expected behavior: - Open the help window and display the help document. Actual behavior: - Two windows opened. Top window is preview window, and displayed the help document. Next one is empty window. An attached patch fix this. Sorry for without a test. Tell me if there is an easy way to test in the Vim script. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/tag.c b/src/tag.c index e388a43..a198a31 100644 --- a/src/tag.c +++ b/src/tag.c @@ -1078,6 +1078,9 @@ end_do_tag: curwin->w_tagstackidx = tagstackidx; #ifdef FEAT_WINDOWS postponed_split = 0; /* don't split next time */ +# ifdef FEAT_QUICKFIX +g_do_tagpreview = 0; /* don't preview next time */ +# endif #endif #ifdef FEAT_CSCOPE
Re: Patch 7.4.2278
Hi Bram and all, 2016-8-28(Sun) 21:40:05 UTC+9 Bram Moolenaar: > Patch 7.4.2278 > Problem:New users have no idea of the 'scrolloff' option. > Solution: Set 'scrolloff' in defaults.vim. > Files: runtime/defaults.vim > > > *** ../vim-7.4.2277/runtime/defaults.vim 2016-08-21 17:44:57.440487201 > +0200 > --- runtime/defaults.vim 2016-08-28 14:37:40.749133353 +0200 > *** > *** 1,7 > " The default vimrc file. > " > " Maintainer: Bram Moolenaar <b...@vim.org> > ! " Last change: 2016 Aug 21 > " > " This is loaded if no vimrc file was found. > " Except when Vim is run with "-u NONE" or "-C". > --- 1,7 > " The default vimrc file. > " > " Maintainer: Bram Moolenaar <b...@vim.org> > ! " Last change: 2016 Aug 28 > " > " This is loaded if no vimrc file was found. > " Except when Vim is run with "-u NONE" or "-C". > *** > *** 31,36 > --- 31,39 > " Show @@@ in the last line if it is truncated. > set display=truncate > > + " Show a few lines of context around the cursor. > + set scrolloff=5 > + > " Do incremental searching when it's possible to timeout. > if has('reltime') > set incsearch > *** ../vim-7.4.2277/src/version.c 2016-08-28 14:11:20.238534825 +0200 > --- src/version.c 2016-08-28 14:38:41.060613477 +0200 > *** > *** 765,766 > --- 765,768 > { /* Add new patch number below this line */ > + /**/ > + 2278, > /**/ Hmm, I am negative, in this patch. I think that new users tend to use the mouse. Cursor movement with the mouse, and 'scrolloff' option of the combination confuse a new user. (on GVim, and on CLI with 'set mouse=a') (default.vim already contained 'set mouse=a') Sample: - Rename your .vimrc (Order to use the default.vim) $ mv ~/.vimrc ~/.vimrc.orig - Start GVim $ gvim - Display help. :help - Go to half percentage in the help file. 50% - Cursor move to line 6 of window. (adjusted for 'scrolloff') H - Click top line of window by mouse. Behavior: - Click the line will be moved to the line 6. I think this behavior confuse a new user. I think it is better not to include the whimsy in the default.vim. How do you think? -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Build 7.4.2243: Makefile:41: recipe for target 'report' failed
Hi Elimar, 2016-8-23(Tue) 18:28:18 UTC+9 Elimar Riesebieter: > Executed 162 tests¬ > 1 FAILED:¬ > From test_alot.vim: > Found errors in Test_tabpage_with_tab_modifier():¬ > function > RunTheTest[9]..Test_tabpage_with_tab_modifier[13]..39_check_tab line 4: > Expected 'help' but got 'text' > > Repeated 9 times. Tell me your Vim configuration. result of `:ver`. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Build 7.4.2243: Makefile:41: recipe for target 'report' failed
Hi Elimar, 2016-8-23(Tue) 19:15:31 UTC+9 Elimar Riesebieter: > * h_east [2016-08-23 02:36 -0700]: > > > Hi Elimar, > > > > 2016-8-23(Tue) 18:28:18 UTC+9 Elimar Riesebieter: > > > Executed 162 tests¬ > > > 1 FAILED:¬ > > > From test_alot.vim: > > > Found errors in Test_tabpage_with_tab_modifier():¬ > > > function > > > RunTheTest[9]..Test_tabpage_with_tab_modifier[13]..39_check_tab line > > > 4: Expected 'help' but got 'text' > > > > > > Repeated 9 times. > > > > Tell me your Vim configuration. > > result of `:ver`. > > I tried to build 7.4.2243 which failed with the above messages. So > why do you want to know which version I am running? This has IMHO > nothing to do with a compile run ;-) No, It has to do. Please paste the result of `:ver` like below. 8< VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Aug 22 2016 21:06:10) Included patches: 1-2239 Compiled by h_east@localhost.localdomain Huge version with GTK2-GNOME GUI. Features included (+) or not (-): +acl +file_in_path+mouse_sgr +tag_old_static +arabic +find_in_path-mouse_sysmouse -tag_any_white +autocmd +float +mouse_urxvt -tcl +balloon_eval+folding +mouse_xterm +termguicolors +browse -footer +multi_byte +terminfo ++builtin_terms +fork() +multi_lang +termresponse +byte_offset +gettext -mzscheme+textobjects +channel -hangul_input+netbeans_intg +timers +cindent +iconv +num64 +title +clientserver+insert_expand +packages+toolbar +clipboard +job +path_extra +user_commands +cmdline_compl +jumplist-perl+vertsplit +cmdline_hist+keymap +persistent_undo +virtualedit +cmdline_info+lambda +postscript +visual +comments+langmap +printer +visualextra +conceal +libcall +profile +viminfo +cryptv +linebreak -python +vreplace +cscope +lispindent -python3 +wildignore +cursorbind +listcmds+quickfix+wildmenu +cursorshape +localmap+reltime +windows +dialog_con_gui -lua +rightleft +writebackup +diff+menu-ruby+X11 +digraphs+mksession +scrollbind -xfontset +dnd +modify_fname+signs +xim -ebcdic +mouse +smartindent -xpm +emacs_tags +mouseshape +startuptime +xsmp_interact +eval+mouse_dec +statusline +xterm_clipboard +ex_extra-mouse_gpm -sun_workshop-xterm_save +extra_search-mouse_jsbterm +syntax +farsi +mouse_netterm +tag_binary system vimrc file: "$VIM/vimrc" user vimrc file: "$HOME/.vimrc" 2nd user vimrc file: "~/.vim/vimrc" user exrc file: "$HOME/.exrc" system gvimrc file: "$VIM/gvimrc" user gvimrc file: "$HOME/.gvimrc" 2nd user gvimrc file: "~/.vim/gvimrc" defaults file: "$VIMRUNTIME/defaults.vim" system menu file: "$VIMRUNTIME/menu.vim" fall-back for $VIM: "/usr/local/share/vim" Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK -pthread -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libdrm -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -D_REENTRANT -DORBIT2=1 -pthread -I/usr/include/libgnomeui-2.0 -I/usr/include/gnome-keyring-1 -I/usr/include/libbonoboui-2.0 -I/usr/include/libxml2 -I/usr/include/libgnome-2.0 -I/usr/include/libbonobo-2.0 -I/usr/include/bonobo-activation-2.0 -I/usr/include/orbit-2.0 -I/usr/include/libgnomecanvas-2.0 -I/usr/include/gail-1.0 -I/usr/include/libart-2.0 -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libdrm -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/gnome-vfs-2.0 -I/usr/lib64/gnome-vfs-2.0/include -I/usr/include/gconf/2 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include-g -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 L
Re: [vim/vim] Fix systemlist() (#1135)
Hi thinca, 2016-9-30(Fri) 1:39:34 UTC+9 thinca: > :help systemlist() says: > > > > Output is the same as readfile() will output with {binary} argument > > set to "b". > > > > And :help readfile() says: > > > > When {binary} contains "b" binary mode is used: > > > When the last line ends in a NL an extra empty list item is > added. > No CR characters are removed. > > > > > systemlist() doesn't satisfy the first matter. > > > :echo systemlist('echo hello') > " => ['hello'] > " `echo` command outputs text with NL, > " so this should be ['hello', ''] > > > This change fixes the above problem. > > > > You can view, comment on, or merge this pull request online at: > > https://github.com/vim/vim/pull/1135 > > Commit Summary > > Fix systemlist() > > > File Changes > > > M > src/Makefile > (1) > > > M > src/evalfunc.c > (2) > > > A > src/testdir/test_system_func.vim > (20) > > > > Patch Links: > > https://github.com/vim/vim/pull/1135.patch > https://github.com/vim/vim/pull/1135.diff Good patch Unfortunately, test that your have to add is not running in the Travis CI and AppVeyor. You should modified as follows: diff -ru vim.orig/src/testdir/Make_all.mak vim/src/testdir/Make_all.mak --- vim.orig/src/testdir/Make_all.mak 2016-09-29 11:54:58.0 +0900 +++ vim/src/testdir/Make_all.mak2016-09-30 09:26:47.771610300 +0900 @@ -182,6 +182,7 @@ test_stat.res \ test_substitute.res \ test_syntax.res \ + test_system_func.res \ test_textobjects.res \ test_undo.res \ test_usercommands.res \ If you want to run from test_alot.vim as follows: diff -ru vim.orig/src/testdir/test_alot.vim vim/src/testdir/test_alot.vim --- vim.orig/src/testdir/test_alot.vim 2016-09-29 11:54:58.0 +0900 +++ vim/src/testdir/test_alot.vim 2016-09-30 10:00:40.479191900 +0900 @@ -41,6 +41,7 @@ source test_tagjump.vim source test_timers.vim source test_true_false.vim +source test_system_func.vim source test_unlet.vim source test_window_cmd.vim source test_options.vim -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [vim/vim] Popup menu does not default to below the cursor (#1241)
Hi Matt and list, 2016-11-9(Wed) 1:29:38 UTC+9 Matt Gardner: > For comparison, here are the same screenshots using the commit just prior to > that patch: Oh, sorry. I wrote a patch that respects the original behavior. Please confirming this. Thanks for the reporting and suggestions! -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/popupmnu.c b/src/popupmnu.c index 19d215b..307dbbe 100644 --- a/src/popupmnu.c +++ b/src/popupmnu.c @@ -105,7 +105,8 @@ redo: /* Put the pum below "row" if possible. If there are few lines decide on * where there is more room. */ -if (row - above_row >= below_row - row) +if (row + 2 >= below_row - pum_height + && row - above_row > (below_row - above_row) / 2) { /* pum above "row" */
Re: Patch 8.0.0069
* win_ins_lines() above, "screen_cleared" is FALSE or MAYBE > *** > *** 5670,5676 > #ifdef FEAT_DIFF >&& filler_todo <= 0 > #endif > ! && W_WIDTH(wp) == Columns) > { > /* Remember that the line wraps, used for modeless copy. */ > LineWraps[screen_row - 1] = TRUE; > --- 5670,5679 > #ifdef FEAT_DIFF >&& filler_todo <= 0 > #endif > ! #ifdef FEAT_WINDOWS > ! && W_WIDTH(wp) == Columns > ! #endif > ! ) > { > /* Remember that the line wraps, used for modeless copy. */ > LineWraps[screen_row - 1] = TRUE; > *** > *** 10524,10530 >* window differs, or the fillchars differ, or this is not the >* current window */ > if (*attr != 0 && ((hl_attr(HLF_S) != hl_attr(HLF_SNC) > ! || !is_curwin || firstwin == lastwin) > || (fill_stl != fill_stlnc))) > return fill; > if (is_curwin) > --- 10527,10533 >* window differs, or the fillchars differ, or this is not the >* current window */ > if (*attr != 0 && ((hl_attr(HLF_S) != hl_attr(HLF_SNC) > ! || !is_curwin || ONE_WINDOW) > || (fill_stl != fill_stlnc))) > return fill; > if (is_curwin) > *** ../vim-8.0.0068/src/quickfix.c2016-11-06 14:46:40.644143343 +0100 > --- src/quickfix.c2016-11-06 15:21:15.663263021 +0100 > *** > *** 2137,2143 >* If there is only one window and it is the quickfix window, create a >* new one above the quickfix window. >*/ > ! if (((firstwin == lastwin) && bt_quickfix(curbuf)) || !usable_win) > { > flags = WSP_ABOVE; > if (ll_ref != NULL) > --- 2137,2143 >* If there is only one window and it is the quickfix window, create a >* new one above the quickfix window. >*/ > ! if ((ONE_WINDOW && bt_quickfix(curbuf)) || !usable_win) > { > flags = WSP_ABOVE; > if (ll_ref != NULL) > *** ../vim-8.0.0068/src/window.c 2016-09-04 17:24:16.0 +0200 > --- src/window.c 2016-11-06 15:22:39.882737085 +0100 > *** > *** 234,240 > /* cursor to previous window with wrap around */ > case 'W': > CHECK_CMDWIN > ! if (firstwin == lastwin && Prenum != 1) /* just one window */ > beep_flush(); > else > { > --- 234,240 > /* cursor to previous window with wrap around */ > case 'W': > CHECK_CMDWIN > ! if (ONE_WINDOW && Prenum != 1) /* just one window */ > beep_flush(); > else > { > *** > *** 1593,1599 > frame_T *frp; > int n; > > ! if (firstwin == lastwin)/* nothing to do */ > { > beep_flush(); > return; > --- 1593,1599 > frame_T *frp; > int n; > > ! if (ONE_WINDOW) /* nothing to do */ > { > beep_flush(); > return; > *** > *** 2206,2212 > } > return TRUE; > #else > ! return firstwin == lastwin; > #endif > } > > --- 2206,2212 > } > return TRUE; > #else > ! return ONE_WINDOW; > #endif > } > > *** > *** 2220,2226 > int free_buf, > tabpage_T *prev_curtab) > { > ! if (firstwin == lastwin) > { > #ifdef FEAT_AUTOCMD > buf_T *old_curbuf = curbuf; > --- 2220,2226 > int free_buf, > tabpage_T *prev_curtab) > { > ! if (ONE_WINDOW) > { > #ifdef FEAT_AUTOCMD > buf_T *old_curbuf = curbuf; > *** > *** 2625,2631 > /* >* If there is only one window there is nothing to remove. >*/ > ! if (tp == NULL ? firstwin == lastwin : tp->tp_firstwin == > tp->tp_lastwin) > return NULL; > > /* > --- 2625,2631 > /* >* If there is only one window there is nothing to remove. >*/ > ! if (tp == NULL ? ONE_WINDOW : tp->tp_firstwin == tp->tp_lastwin) > return NULL; > > /* > *** > *** 2780,2786 > frame_T *frp; > int b; > > ! if (
Re: [vim/vim] and can't be recognized in vimrc (#1239)
Hi Ziming, 2016-11-8(Tue) 13:36:28 UTC+9 Ziming Dong: > I'm using vim8.0, version 8.0.23. > > this is my vimrc file in ~/.vimrc. > > I find these lines not working, > :map :tabp > :map :tabn > inoremap { {} > inoremap ( () > inoremap [ [] > > > and when I type {, I just get {} in insert mode. Perhaps the mapping command is do in vi-compatible mode. Let's confirm! Please add below two lines just before `:map :tabp` in your .vimrc and start Vim. And tell me the result of :messages echom 'compatible:' echom 'cpoptions:' -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [vim/vim] and can't be recognized in vimrc (#1239)
Hi Ziming, 2016-11-8(Tue) 15:46:44 UTC+9 Ziming Dong: > @vim-ml > > Messages maintainer: Bram Moolenaar <br...@vim.org> > compatible: 0 > cpoptions: aAbBcCdDeEfFgHiIjJkKlLmMnoOpPqrRsStuvwWxXyZ$!%*-+<>; If `<` is included in `cpoptions` option, You can see the behavior you reported. Have you changed this option in debian.vim or /etc/vim/vimrc.local? Tentatively, I think that setting the mapping command later than line of `set nocompatible` will fix the problem. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [vim/vim] Directories raise "Error: no write since last change" (#893)
Hi Neil > How do I check the version? :echo g:loaded_netrwPlugin -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [vim/vim] Strange value of v:shell_error when calling system() with silent (#1196)
Hi Kiichi, Perhaps you should enclose all of the added lines in the below directive? #if defined(FEAT_JOB_CHANNEL) && !defined(USE_SYSTEM) ... #endif ? (use `#if defined(FEAT_JOB_CHANNEL) && !defined(USE_SYSTEM)` instead of `# ifdef FEAT_JOB_CHANNEL`) -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [bug][patch] matchaddpos() may not draw overldapped pos.
Hi Bram and Kiichi, 2016-10-15(Sat) 3:41:58 UTC+9 Bram Moolenaar: > Ozaki Kiichi wrote: > > > This is matchaddpos() problem. > > > > [repro steps] > > > > vim -Nu NONE > > > > i1234567890 > > :call matchaddpos('ErrorMsg', [[1, 1, 5], [1, 3, 5]]) > > > > expected: colored 1~7 ("12345" and "34567"; pos [1, 1, 5] and [1, 3, 5], > > overlapped "345") > > > > actual: colored 1~5 ("12345"; only first pos [1, 1, 5]) > > > > This problem occurs when overlapping more than 1 char. > > e.g. [[1, 1, 5], [1, 5, 5]] is no problem. > > > > [cause] > > > > https://github.com/vim/vim/blob/fd89d7e/src/screen.c#L7770-L7771 > > > > On processing second pos [1, 3, 5], mincol is 5 (end of first pos col). > > Thus, col (== 3) is less then mincol, and second pos is skipped. > > > > I think that the case of "col < mincol < col + len -1" should be also > > processed. > > > > [patch] > > > > https://gist.github.com/ichizok/f34c9018f5e9e452d3bc78cc9026a720 > > Can you please add a test that fails without the patch? Here is a test patch. I confirmed pass the test with Kiichi's patch, and fails without it. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/testdir/test_match.vim b/src/testdir/test_match.vim index 9ac1db1..20da0db 100644 --- a/src/testdir/test_match.vim +++ b/src/testdir/test_match.vim @@ -181,6 +181,16 @@ func Test_matchaddpos() redraw! call assert_equal(screenattr(2,2), screenattr(1,6)) + " Check overwrapped pos + call clearmatches() + call setline(1, ['1234567890', 'NH']) + call matchaddpos('Error', [[1,1,5], [1,3,5], [2,2]]) + redraw! + call assert_notequal(screenattr(2,2), 0) + call assert_equal(screenattr(2,2), screenattr(1,5)) + call assert_equal(screenattr(2,2), screenattr(1,7)) + call assert_notequal(screenattr(2,2), screenattr(1,8)) + nohl syntax off set hlsearch&
[patch] Add completion for :messages
Hi Bram and list, Type `:messages ` and push Tab key. None patched behavior: - Output Ctrl-I code :messages ^I Patched behavior: - Complete `clear` :messages clear Attach a patch. (Contains a test) Check it please. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/ex_docmd.c b/src/ex_docmd.c index ac7beb7..6802b8b 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -4281,6 +4281,11 @@ set_one_cmd_context( xp->xp_pattern = arg; break; + case CMD_messages: + xp->xp_context = EXPAND_MESSAGES; + xp->xp_pattern = arg; + break; + #if defined(FEAT_CMDHIST) case CMD_history: xp->xp_context = EXPAND_HISTORY; @@ -5893,6 +5898,7 @@ static struct #endif {EXPAND_MAPPINGS, "mapping"}, {EXPAND_MENUS, "menu"}, +{EXPAND_MESSAGES, "messages"}, {EXPAND_OWNSYNTAX, "syntax"}, #if defined(FEAT_PROFILE) {EXPAND_SYNTIME, "syntime"}, @@ -11901,6 +11907,18 @@ get_behave_arg(expand_T *xp UNUSED, int idx) return (char_u *)"xterm"; return NULL; } + +/* + * Function given to ExpandGeneric() to obtain the possible arguments of the + * ":messages {clear}" command. + */ +char_u * +get_messages_arg(expand_T *xp UNUSED, int idx) +{ +if (idx == 0) + return (char_u *)"clear"; +return NULL; +} #endif #ifdef FEAT_AUTOCMD diff --git a/src/ex_getln.c b/src/ex_getln.c index 25a12be..5d098cc 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -4832,6 +4832,7 @@ ExpandFromContext( { {EXPAND_COMMANDS, get_command_name, FALSE, TRUE}, {EXPAND_BEHAVE, get_behave_arg, TRUE, TRUE}, + {EXPAND_MESSAGES, get_messages_arg, TRUE, TRUE}, #ifdef FEAT_CMDHIST {EXPAND_HISTORY, get_history_arg, TRUE, TRUE}, #endif diff --git a/src/proto/ex_docmd.pro b/src/proto/ex_docmd.pro index b92ce80..11a3f71 100644 --- a/src/proto/ex_docmd.pro +++ b/src/proto/ex_docmd.pro @@ -61,4 +61,5 @@ int put_eol(FILE *fd); int put_line(FILE *fd, char *s); void dialog_msg(char_u *buff, char *format, char_u *fname); char_u *get_behave_arg(expand_T *xp, int idx); +char_u *get_messages_arg(expand_T *xp, int idx); /* vim: set ft=c : */ diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim index 4bacf57..3718087 100644 --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -129,6 +129,11 @@ func Test_getcompletion() let l = getcompletion('dark', 'highlight') call assert_equal([], l) + let l = getcompletion('', 'messages') + call assert_true(index(l, 'clear') >= 0) + let l = getcompletion('not', 'messages') + call assert_equal([], l) + if has('cscope') let l = getcompletion('', 'cscope') let cmds = ['add', 'find', 'help', 'kill', 'reset', 'show'] diff --git a/src/vim.h b/src/vim.h index a787575..0ac296e 100644 --- a/src/vim.h +++ b/src/vim.h @@ -793,6 +793,7 @@ extern char *(*dyn_libintl_textdomain)(const char *domainname); #define EXPAND_SYNTIME 43 #define EXPAND_USER_ADDR_TYPE 44 #define EXPAND_PACKADD 45 +#define EXPAND_MESSAGES 46 /* Values for exmode_active (0 is no exmode) */ #define EXMODE_NORMAL 1
Re: [vim/vim] Fix #1168 completion problem from #875 (#1169)
You should add a test. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [vim/vim] Fix #1168 completion problem from #875 (#1169)
2016-10-15(Sat) 13:58:03 UTC+9 Shougo: > OK. I have added the test. > > But it is very hard to simulate the completion wait. > > Because the test omnifunc is asynchronous. Issue#1168 repro steps doesn't seem to asynchronous for me. Where is the asynchronous? > > The test fix is wellcome. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [patch] Add completion for :messages
Hi All, I update a patch. (Modified documents) -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index d4a005a..88599dd 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -4287,7 +4287,9 @@ getcompletion({pat}, {type} [, {filtered}]) *getcompletion()* locale locale names (as output of locale -a) mapping mapping name menu menus + messages |:messages| suboptions option options + packadd optional package |pack-add| names shellcmd Shell command sign |:sign| suboptions syntax syntax file names |'syntax'| diff --git a/runtime/doc/map.txt b/runtime/doc/map.txt index 7989d64..25ed827 100644 --- a/runtime/doc/map.txt +++ b/runtime/doc/map.txt @@ -1280,6 +1280,7 @@ completion can be enabled: -complete=locale locale names (as output of locale -a) -complete=mapping mapping name -complete=menu menus + -complete=messages |:messages| suboptions -complete=option options -complete=packadd optional package |pack-add| names -complete=shellcmd Shell command diff --git a/src/ex_docmd.c b/src/ex_docmd.c index ac7beb7..6802b8b 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -4281,6 +4281,11 @@ set_one_cmd_context( xp->xp_pattern = arg; break; + case CMD_messages: + xp->xp_context = EXPAND_MESSAGES; + xp->xp_pattern = arg; + break; + #if defined(FEAT_CMDHIST) case CMD_history: xp->xp_context = EXPAND_HISTORY; @@ -5893,6 +5898,7 @@ static struct #endif {EXPAND_MAPPINGS, "mapping"}, {EXPAND_MENUS, "menu"}, +{EXPAND_MESSAGES, "messages"}, {EXPAND_OWNSYNTAX, "syntax"}, #if defined(FEAT_PROFILE) {EXPAND_SYNTIME, "syntime"}, @@ -11901,6 +11907,18 @@ get_behave_arg(expand_T *xp UNUSED, int idx) return (char_u *)"xterm"; return NULL; } + +/* + * Function given to ExpandGeneric() to obtain the possible arguments of the + * ":messages {clear}" command. + */ +char_u * +get_messages_arg(expand_T *xp UNUSED, int idx) +{ +if (idx == 0) + return (char_u *)"clear"; +return NULL; +} #endif #ifdef FEAT_AUTOCMD diff --git a/src/ex_getln.c b/src/ex_getln.c index 25a12be..5d098cc 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -4832,6 +4832,7 @@ ExpandFromContext( { {EXPAND_COMMANDS, get_command_name, FALSE, TRUE}, {EXPAND_BEHAVE, get_behave_arg, TRUE, TRUE}, + {EXPAND_MESSAGES, get_messages_arg, TRUE, TRUE}, #ifdef FEAT_CMDHIST {EXPAND_HISTORY, get_history_arg, TRUE, TRUE}, #endif diff --git a/src/proto/ex_docmd.pro b/src/proto/ex_docmd.pro index b92ce80..11a3f71 100644 --- a/src/proto/ex_docmd.pro +++ b/src/proto/ex_docmd.pro @@ -61,4 +61,5 @@ int put_eol(FILE *fd); int put_line(FILE *fd, char *s); void dialog_msg(char_u *buff, char *format, char_u *fname); char_u *get_behave_arg(expand_T *xp, int idx); +char_u *get_messages_arg(expand_T *xp, int idx); /* vim: set ft=c : */ diff --git a/src/testdir/test_cmdline.vim b/src/testdir/test_cmdline.vim index 4bacf57..3718087 100644 --- a/src/testdir/test_cmdline.vim +++ b/src/testdir/test_cmdline.vim @@ -129,6 +129,11 @@ func Test_getcompletion() let l = getcompletion('dark', 'highlight') call assert_equal([], l) + let l = getcompletion('', 'messages') + call assert_true(index(l, 'clear') >= 0) + let l = getcompletion('not', 'messages') + call assert_equal([], l) + if has('cscope') let l = getcompletion('', 'cscope') let cmds = ['add', 'find', 'help', 'kill', 'reset', 'show'] diff --git a/src/vim.h b/src/vim.h index a787575..0ac296e 100644 --- a/src/vim.h +++ b/src/vim.h @@ -793,6 +793,7 @@ extern char *(*dyn_libintl_textdomain)(const char *domainname); #define EXPAND_SYNTIME 43 #define EXPAND_USER_ADDR_TYPE 44 #define EXPAND_PACKADD 45 +#define EXPAND_MESSAGES 46 /* Values for exmode_active (0 is no exmode) */ #define EXMODE_NORMAL 1
Re: E315 ml_get invalid lnum
Hi John, 2016-10-18(Tue) 12:03:44 UTC+9 JohnBeckett: > Vim 8 deploys $VIMRUNTIME/defaults.vim which includes an autocmd > to "jump to the last known cursor position". > That can generate E315. > > Execute the following to create two files and exit. > At exit, the cursor is on the last line of each file. > > gvim -N -u NONE > :tabe test1.tmp > :put =range(1,90) > :w > :tabe test2.tmp > :put =range(1,100) > :xa > > Execute the following to generate internal error E315: > > gvim -N -u NONE > :source $VIMRUNTIME/defaults.vim > :tabe test2.tmp > :vert diffs test1.tmp > > Result: > > "test1.tmp" 91L, 353C > E315: ml_get: invalid lnum: 92 > Press ENTER or type command to continue I can reproduce it. And also occurs in the following procedure. Probably, so this is option 'scrolloff' related bugs. gvim -N -u NONE :e test2.tmp G :set scrolloff=5 :vert diffs test1.tmp P.S. Right-side scroll bar's relative position is strange. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [vim/vim] Empty first tab lost when using sessions (#1282)
Hi Jim! 2016-11-26(Sat) 0:41:46 UTC+9 Jim Stewart: > I'm creating a session with mksession, and when I restore the session, if the > first tab was empty ([No Name]), it's gone in the restored session. Other > empty tabs are restored fine; it seems to only be the first tab that's lost. > If there are multiple "leading" empty tabs, it's still only the first one > that disappears. > > I'm using this with vim -u NONE so there is zero config and no plugins, but I > get the same behavior with my normal config. Affects versions 7.3 and 8.0.52. > > I'm using the default sessionoptions in all cases: > blank,buffers,curdir,folds,options,tabpages,winsize. > > Steps to reproduce: > > $ vim -u NONE > :tabnew > :e foo.txt > :w > :tabnew > :mksession > :qa > $ vim -u NONE -S Session.vim > > > The tabline now shows foo.txt | [No Name]. Expected [No Name] | foo.txt | [No > Name]. I can reproduce it. And I wrote a patch for this issue. (Attached) Could you please check this patch? When issue has been resolved, I'll add a test later. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 439467c..ca4133a 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -11091,6 +11091,8 @@ makeopens( } if (tabnr > 1) need_tabnew = TRUE; + else if (put_line(fd, "new") == FAIL) + return FAIL; } /*
Re: [vim/vim] Empty first tab lost when using sessions (#1282)
Hi Jim and list, 2016-11-26(Sat) 5:40:52 UTC+9 vim-dev ML: > > I can reproduce it. > > > And I wrote a patch for this issue. (Attached) > > > Could you please check this patch? > > > When issue has been resolved, I'll add a test later. > > > > This patch fixes it for me, with 8.0.52. I'm not familiar with the Vim > source, but if there's anything I can do to help, please let me know. > > > > Thanks you! Ah, this patch is bad solution. I rewrote a patch that respect the following description of the document. :help :mksession doc> 8. Restores all windows with the same layout. If 'sessionoptions' contains doc> "help", help windows are restored. If 'sessionoptions' contains "blank", doc> windows editing a buffer without a name will be restored. That is, when 'sessionoptions' contains 'blank', then also restores the empty window. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 439467c..a22de59 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -10992,12 +10992,16 @@ makeopens( * If there is an empty, unnamed buffer we will wipe it out later. * Remember the buffer number. */ -if (put_line(fd, "if expand('%') == '' && ! && line('$') <= 1 && getline(1) == ''") == FAIL) - return FAIL; -if (put_line(fd, " let s:wipebuf = bufnr('%')") == FAIL) - return FAIL; -if (put_line(fd, "endif") == FAIL) - return FAIL; +if (!(ssop_flags & SSOP_BLANK)) +{ + if (put_line(fd, "if expand('%') == '' && ! && line('$') <= 1 " + "&& getline(1) == ''") == FAIL) + return FAIL; + if (put_line(fd, " let s:wipebuf = bufnr('%')") == FAIL) + return FAIL; + if (put_line(fd, "endif") == FAIL) + return FAIL; +} /* * Now save the current files, current buffer first. @@ -11217,14 +11221,17 @@ makeopens( /* * Wipe out an empty unnamed buffer we started in. */ -if (put_line(fd, "if exists('s:wipebuf')") == FAIL) - return FAIL; -if (put_line(fd, " silent exe 'bwipe ' . s:wipebuf") == FAIL) - return FAIL; -if (put_line(fd, "endif") == FAIL) - return FAIL; -if (put_line(fd, "unlet! s:wipebuf") == FAIL) - return FAIL; +if (!(ssop_flags & SSOP_BLANK)) +{ + if (put_line(fd, "if exists('s:wipebuf')") == FAIL) + return FAIL; + if (put_line(fd, " silent exe 'bwipe ' . s:wipebuf") == FAIL) + return FAIL; + if (put_line(fd, "endif") == FAIL) + return FAIL; + if (put_line(fd, "unlet! s:wipebuf") == FAIL) + return FAIL; +} /* Re-apply 'winheight', 'winwidth' and 'shortmess'. */ if (fprintf(fd, "set winheight=%ld winwidth=%ld shortmess=%s",
Re: [PATCH] Incorrect cursor position on a long wrapped-line
Hi Kiichi, 2016-11-27(Sun) 0:09:20 UTC+9 Ozaki Kiichi: > https://gist.github.com/ichizok/4d177e3bf8cc9d47d47243577c8d847b > > * add test_number.vim > * separate some functions from test_breakindent.vim and add view.vim I think that file name and function names that can be used with the whole test script should be named accordingly. Maybe we need a prefix? Bram and Vim contributors> How do you think? > * change to easily visible expected values of tests in test_breakindent.vim > > Thank you. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[patch] `:tab drop xx` does not jump to existing xx window
Hi Bram and list, How to reproduce: - Start Vanilla Vim edit xx $ vim -Nu NONE xx - Split verticaly and create window for empty buffer. :vnew - Jump to a such window or create new tabpage. Actually, already xx exists, it jumps to that window. :tab drop xx Expected behavior: - Jumps to xx window. because xx already exists. Actual behavior: - Create a new tabpage unexpectedly. NOTE: When `:new` is used instead of `:vnew`, it will be the expected behavior. Investigation result: do_arg_all()'s 3rd argument `keep_tabs` is false that means for mainly `:all` command. And... [src/buffer.c] 4860 if (buf->b_ffname == NULL 4861 || (!keep_tabs && (buf->b_nwindows > 1 4862 || wp->w_width != Columns))) Also `wp->w_width != Columns` should for only `!keep_tabs` (:all command). I wrote a patch contained a test. Check and include it please. BTW, the following description(at L4846) does not seem to be written in the document of `:all`. [src/buffer.c] 4844 /* 4845 * Try closing all windows that are not in the argument list. 4846 * Also close windows that are not full width; Add to a document? or remove a code? -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/buffer.c b/src/buffer.c index e5d2dde..e77fc04 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -4858,8 +4858,8 @@ do_arg_all( wpnext = wp->w_next; buf = wp->w_buffer; if (buf->b_ffname == NULL - || (!keep_tabs && buf->b_nwindows > 1) - || wp->w_width != Columns) + || (!keep_tabs && (buf->b_nwindows > 1 + || wp->w_width != Columns))) i = opened_len; else { diff --git a/src/testdir/test_tabpage.vim b/src/testdir/test_tabpage.vim index 3f69fb9..1720107 100644 --- a/src/testdir/test_tabpage.vim +++ b/src/testdir/test_tabpage.vim @@ -65,6 +65,15 @@ function Test_tabpage() call assert_true(tabpagenr() == 2 && tabpagewinnr(2, '$') == 2 && tabpagewinnr(2) == 1) tabclose q +" +" +" Test for ":tab drop vertical-split-window" to jump test1 buffer +tabedit test1 +vnew +tabfirst +tab drop test1 +call assert_equal([2, 2, 2, 2], [tabpagenr('$'), tabpagenr(), tabpagewinnr(2, '$'), tabpagewinnr(2)]) +1tabonly endif " "
[patch] make test error in SetUp() and TearDown() is hard to understand
Hi Bram and list, It is hard to notice even if an error occurs in SetUp() or TearDown() when making a make test How to reproduce: - Explicitly put errors into SetUp() in vim/src/testdir/test_hide.vim. function SetUp() aa" <- Add this line. let s:save_hidden = let s:save_bufhidden = let s:save_autowrite = set nohidden set bufhidden= set noautowrite endfunc - Run make test at vim/src directory. $ make test Expected behavior: - An error is displayed in the test result in an easy-to-understand manner. Actual behavior: - make test error in SetUp() and TearDown() is hard to understand. - An error is displayed for a moment, and no error is displayed in the test result. I wrote a patch. (Attached) After patched `make test` result: 8< >From test_hide.vim: Executing Test_hide() Executed 1 test 1 FAILED: Found errors in Test_hide(): Caught exception in SetUp() before Test_hide(): Vim:E492: Not an editor command: aa @ function RunTheTest[4]..SetUp, line 1 Caught exception in TearDown() after Test_hide(): Vim(let):E121: Undefined variable: s:save_hidden @ function RunTheTest[23]..TearDown, line 1 8< Check and include it please. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/testdir/runtest.vim b/src/testdir/runtest.vim index c4cb847..3ba3b02 100644 --- a/src/testdir/runtest.vim +++ b/src/testdir/runtest.vim @@ -89,7 +89,11 @@ endfunc function RunTheTest(test) echo 'Executing ' . a:test if exists("*SetUp") -call SetUp() +try + call SetUp() +catch + call add(v:errors, 'Caught exception in SetUp() before ' . a:test . ': ' . v:exception . ' @ ' . v:throwpoint) +endtry endif call add(s:messages, 'Executing ' . a:test) @@ -104,7 +108,11 @@ function RunTheTest(test) endtry if exists("*TearDown") -call TearDown() +try + call TearDown() +catch + call add(v:errors, 'Caught exception in TearDown() after ' . a:test . ': ' . v:exception . ' @ ' . v:throwpoint) +endtry endif " Close any extra windows and make the current one not modified. @@ -221,3 +229,5 @@ call append(line('$'), s:messages) write qall! + +" vim: shiftwidth=2 sts=2 expandtab
Re: [vim/vim] Popup menu does not default to below the cursor (#1241)
Hi Matt, Bram and list! 2016-11-9(Wed) 6:00:50 UTC+9 Matt Gardner: > I applied the patch and tested it in a few situations, and it looks to me > like it fixed the problem. Thanks! Thanks for confirming my patch. Bram> Are there concerns about my patch? (I feel somehow you are busy now :-) -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [vim/vim] Popup menu does not default to below the cursor (#1241)
Hi Bram, 2016-11-16(Wed) 6:01:31 UTC+9 Bram Moolenaar: > Hirohito Higashi wrote: > > > > > Hi Matt, Bram and list! > > > > > > 2016-11-9(Wed) 6:00:50 UTC+9 Matt Gardner: > > > > I applied the patch and tested it in a few situations, and it looks to me > > > like it fixed the problem. Thanks! > > > > > > Thanks for confirming my patch. > > > > > > Bram> > > > Are there concerns about my patch? > > > (I feel somehow you are busy now :-) > > > > It's near the top of the todo list. > > > > Yeah, busy. Still send out a couple of patches each day. Crashes have Please keep your good health. ( ˘ω˘) > > priority. And wasted time on trying to figure out this problem: > > > > Test_help_complete sometimes fails on MS-Windows: > > function RunTheTest[9]..Test_help_complete line 22: Expected ['h > test-char@ab', > > 'h test-char@en', 'h test-col@ab', 'h test-col@en'] but got ['h > test-char@en', ' > > h test-char@en\t', 'h test-col@ab', 'h test-col@en'] > > Appears to be related to calling feedkeys() with exactly 8 characters. > > > > Only happens in console version. My MSVC debugger stopped working, it's > > a bit difficult to figure this out without a debugger... I can't reproduce it on my environment. However, I am happy if you can adopt one of the following three patch. Patch 1: I heard from Taro Muraoka ... "It seems to be stable if you insert `sleep 100m` before s:get_cmd_compl_list()." diff --git a/src/testdir/test_help_tagjump.vim b/src/testdir/test_help_tagjump.vim index 778bd9c..2fe57ef 100644 --- a/src/testdir/test_help_tagjump.vim +++ b/src/testdir/test_help_tagjump.vim @@ -111,6 +111,7 @@ func Test_help_complete() " 'helplang=' and help file lang is 'en' and 'ab' set rtp+=Xdir1/doc-ab set helplang= + sleep 100m let list = s:get_cmd_compl_list(":h test") call assert_equal(sort(['h test-col@en', 'h test-col@ab', \ 'h test-char@en', 'h test-char@ab']), sort(list)) Patch 2: Use `c_CTRL-A` instead of loops and `c_CTRL-B`. Attached patch: p2_maybe_fix_help_complete_problem.patch Patch 3: Use getcompletion() function. Attached patch: p3_maybe_fix_help_complete_problem.patch -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/testdir/test_help_tagjump.vim b/src/testdir/test_help_tagjump.vim index 778bd9c..d088f5a 100644 --- a/src/testdir/test_help_tagjump.vim +++ b/src/testdir/test_help_tagjump.vim @@ -78,16 +78,8 @@ func s:doc_config_teardown() endfunc func s:get_cmd_compl_list(cmd) - let list = [] - let str = '' - for cnt in range(1, 999) -call feedkeys(a:cmd . repeat("\", cnt) . "'\let str='\", 'tx') -if str ==# a:cmd[1:] - break -endif -call add(list, str) - endfor - return list + call feedkeys(a:cmd . "\'\let str='\", 'tx') + return filter(split(str), 'v:val !=# "h"') endfunc func Test_help_complete() @@ -100,48 +92,48 @@ func Test_help_complete() set helplang= endif let list = s:get_cmd_compl_list(":h test") -call assert_equal(['h test-col', 'h test-char'], list) +call assert_equal(['test-col', 'test-char'], list) if has('multi_lang') " 'helplang=ab' and help file lang is 'en' set helplang=ab let list = s:get_cmd_compl_list(":h test") - call assert_equal(['h test-col', 'h test-char'], list) + call assert_equal(['test-col', 'test-char'], list) " 'helplang=' and help file lang is 'en' and 'ab' set rtp+=Xdir1/doc-ab set helplang= let list = s:get_cmd_compl_list(":h test") - call assert_equal(sort(['h test-col@en', 'h test-col@ab', -\ 'h test-char@en', 'h test-char@ab']), sort(list)) + call assert_equal(sort(['test-col@en', 'test-col@ab', +\ 'test-char@en', 'test-char@ab']), sort(list)) " 'helplang=ab' and help file lang is 'en' and 'ab' set helplang=ab let list = s:get_cmd_compl_list(":h test") - call assert_equal(sort(['h test-col', 'h test-col@en', -\ 'h test-char', 'h test-char@en']), sort(list)) + call
Re: [vim/vim] c file marco syntax error in 8.0.0086 (#1257)
Hi mattn and Bram, I found a line for which the addition of `\zs` is forgotten. Patch attached. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. --- c.vim.orig 2016-11-13 14:06:02.0 +0900 +++ c.vim 2016-11-16 18:06:30.176761900 +0900 @@ -367,7 +367,7 @@ if !exists("c_no_if0_fold") syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\zs\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell fold else -syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell +syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\zs\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell endif syn region cCppOutElse contained matchgroup=cCppOutWrapper start="^\s*\zs\(%:\|#\)\s*\(else\|elif\)" end="^\s*\zs\(%:\|#\)\s*endif\>"me=s-1 contains=TOP,cPreCondit syn region cCppInWrapper start="^\s*\zs\(%:\|#\)\s*if\s\+0*[1-9]\d*\s*\($\|//\|/\*\||\)" end=".\@=\|$" contains=cCppInIf,cCppInElse fold
Re: Patch 8.0.0090
Hi Bram and list, 2016-11-18(Fri) 3:32:45 UTC+9 Bram Moolenaar: > Patch 8.0.0090 > Problem:Cursor moved after last character when using 'breakindent'. > Solution: Fix the cursor positioning. Turn the breakindent test into new > style. (Christian Brabandt) > Files: src/screen.c, src/testdir/Make_all.mak, > src/testdir/test_breakindent.in, src/testdir/test_breakindent.ok, > src/testdir/test_breakindent.vim, src/Makefile [...] The git commit message of v8.0.0090 got a mistake. It is almost the same content of v8.0.0091. 8< $ git log v8.0.0091 -2 commit 9f0e423c2818c0cacd0810f9c3c67cbb6b80963d Author: Bram Moolenaar <b...@vim.org> Date: Thu Nov 17 19:48:18 2016 +0100 patch 8.0.0091 Problem:Test_help_complete sometimes fails in MS-Windows console. Solution: Use getcompletion() instead of feedkeys() and command line completion. (Hirohito Higashi) commit 6c896867c4f5d759616028ef7cbfce2a9ed32600 Author: Bram Moolenaar <b...@vim.org> Date: Thu Nov 17 19:46:51 2016 +0100 patch 8.0.0090 Problem:Test_help_complete sometimes fails in MS-Windows console. Solution: Use getcompletion() instead of feedkeys() and command line completion. (Hirohito Higashi) 8< Anyway, I only report. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [vim/vim] c file marco syntax error in 8.0.0086 (#1257)
Hi Bram and list! 2016-11-17(Thu) 22:48:45 UTC+9 Bram Moolenaar: > Hirohito Higashi wrote: > > > I found a line for which the addition of `\zs` is forgotten. > > Patch attached. > > Unfortunately that doesn't fix it. Only remove \zs in the other > cCppOutIf2 appears to fix it. Ah, I just understand! And I found that the problem still remains. ``` void main() { #if 0 int i = 0; #else #endif int j = 0; } ``` See the attached image file `wrong_highlight_in_c.png`. I think that `\zs` should not be specified for `syn region` where `contained` is specified. Because `\zs` is already in use at the higher level match. If we use it in `syn region contained`, the regular expression of the start= and the end= will not match. I wrote a patch. (Attached) Check it please. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff -ru vim.orig/runtime/syntax/c.vim vim/runtime/syntax/c.vim --- vim.orig/runtime/syntax/c.vim 2016-11-17 12:30:26.0 +0900 +++ vim/runtime/syntax/c.vim 2016-11-18 16:27:41.246501000 +0900 @@ -363,23 +363,23 @@ if !exists("c_no_if0") syn cluster cCppOutInGroup contains=cCppInIf,cCppInElse,cCppInElse2,cCppOutIf,cCppOutIf2,cCppOutElse,cCppInSkip,cCppOutSkip syn region cCppOutWrapper start="^\s*\zs\(%:\|#\)\s*if\s\+0\+\s*\($\|//\|/\*\|&\)" end=".\@=\|$" contains=cCppOutIf,cCppOutElse,@NoSpell fold - syn region cCppOutIf contained start="0\+" matchgroup=cCppOutWrapper end="^\s*\zs\(%:\|#\)\s*endif\>" contains=cCppOutIf2,cCppOutElse + syn region cCppOutIf contained start="0\+" matchgroup=cCppOutWrapper end="^\s*\(%:\|#\)\s*endif\>" contains=cCppOutIf2,cCppOutElse if !exists("c_no_if0_fold") syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell fold else syn region cCppOutIf2 contained matchgroup=cCppOutWrapper start="0\+" end="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0\+\s*\($\|//\|/\*\|&\)\)\@!\|endif\>\)"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell endif - syn region cCppOutElse contained matchgroup=cCppOutWrapper start="^\s*\zs\(%:\|#\)\s*\(else\|elif\)" end="^\s*\zs\(%:\|#\)\s*endif\>"me=s-1 contains=TOP,cPreCondit + syn region cCppOutElse contained matchgroup=cCppOutWrapper start="^\s*\(%:\|#\)\s*\(else\|elif\)" end="^\s*\(%:\|#\)\s*endif\>"me=s-1 contains=TOP,cPreCondit syn region cCppInWrapper start="^\s*\zs\(%:\|#\)\s*if\s\+0*[1-9]\d*\s*\($\|//\|/\*\||\)" end=".\@=\|$" contains=cCppInIf,cCppInElse fold - syn region cCppInIf contained matchgroup=cCppInWrapper start="\d\+" end="^\s*\zs\(%:\|#\)\s*endif\>" contains=TOP,cPreCondit + syn region cCppInIf contained matchgroup=cCppInWrapper start="\d\+" end="^\s*\(%:\|#\)\s*endif\>" contains=TOP,cPreCondit if !exists("c_no_if0_fold") -syn region cCppInElse contained start="^\s*\zs\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 fold +syn region cCppInElse contained start="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 fold else -syn region cCppInElse contained start="^\s*\zs\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 +syn region cCppInElse contained start="^\s*\(%:\|#\)\s*\(else\>\|elif\s\+\(0*[1-9]\d*\s*\($\|//\|/\*\||\)\)\@!\)" end=".\@=\|$" containedin=cCppInIf contains=cCppInElse2 endif - syn region cCppInElse2 contained matchgroup=cCppInWrapper start="^\s*\zs\(%:\|#\)\s*\(else\|elif\)\([^/]\|/[^/*]\)*" end="^\s*\zs\(%:\|#\)\s*endif\>"me=s-1 contains=cSpaceError,cCppOutSkip,@Spell - syn region cCppOutSkip contained start="^\s*\zs\(%:\|#\)\s*\(if\>\|ifdef\>\|ifndef\>\)" skip="\\$" end="^\s*\zs\(%:\|#\)\s*endif\>" contains=cSpaceError,cCppOutSkip - syn region cCppInSkip contained matchgroup=cCppInWrapper start="^\s*\zs\
[patch] can not write a trail comment to the :hide command
Hi Bram and list, How to reproduce: - Start vanilla Vim with two buffers. $ vim -Nu NONE -o a b - buffer 'a' to modified. :set modofied - exec :hide command with trail comment :hide " command Expected behavior: - :hide command succeed. Actual behavior: - Occurred 'E474: Invalid argument' I wrote a patch. Of course contains a test. Check it please. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/Makefile b/src/Makefile index fef53af..eb67126 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2097,6 +2097,7 @@ test_arglist \ test_gui \ test_hardcopy \ test_help_tagjump \ + test_hide \ test_history \ test_hlsearch \ test_increment \ diff --git a/src/ex_cmds.h b/src/ex_cmds.h index 01126ba..d8fc506 100644 --- a/src/ex_cmds.h +++ b/src/ex_cmds.h @@ -623,7 +623,7 @@ EX(CMD_highlight, "highlight", ex_highlight, BANG|EXTRA|TRLBAR|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_hide, "hide", ex_hide, - BANG|RANGE|NOTADR|COUNT|EXTRA|NOTRLCOM, + BANG|RANGE|NOTADR|COUNT|EXTRA|TRLBAR, ADDR_WINDOWS), EX(CMD_history, "history", ex_history, EXTRA|TRLBAR|CMDWIN, diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 6b4e5fb..9fc4001 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -7572,38 +7572,32 @@ ex_all(exarg_T *eap) static void ex_hide(exarg_T *eap) { -if (*eap->arg != NUL && check_nextcmd(eap->arg) == NULL) - eap->errmsg = e_invarg; -else -{ - /* ":hide" or ":hide | cmd": hide current window */ - eap->nextcmd = check_nextcmd(eap->arg); +/* ":hide" or ":hide | cmd": hide current window */ #ifdef FEAT_WINDOWS - if (!eap->skip) - { +if (!eap->skip) +{ # ifdef FEAT_GUI - need_mouse_correct = TRUE; + need_mouse_correct = TRUE; # endif - if (eap->addr_count == 0) - win_close(curwin, FALSE); /* don't free buffer */ - else - { - int winnr = 0; - win_T *win; + if (eap->addr_count == 0) + win_close(curwin, FALSE); /* don't free buffer */ + else + { + int winnr = 0; + win_T *win; - FOR_ALL_WINDOWS(win) - { - winnr++; - if (winnr == eap->line2) - break; - } - if (win == NULL) - win = lastwin; - win_close(win, FALSE); + FOR_ALL_WINDOWS(win) + { + winnr++; + if (winnr == eap->line2) + break; } + if (win == NULL) + win = lastwin; + win_close(win, FALSE); } -#endif } +#endif } /* diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak index a8ea543..1c0c715 100644 --- a/src/testdir/Make_all.mak +++ b/src/testdir/Make_all.mak @@ -156,6 +156,7 @@ NEW_TESTS = test_arglist.res \ test_gn.res \ test_gui.res \ test_hardcopy.res \ + test_hide.res \ test_history.res \ test_hlsearch.res \ test_increment.res \ diff --git a/src/testdir/test_hide.vim b/src/testdir/test_hide.vim new file mode 100644 index 000..f08bde7 --- /dev/null +++ b/src/testdir/test_hide.vim @@ -0,0 +1,89 @@ +" Tests for :hide command/modifier and 'hidden' option + +function SetUp() + let s:save_hidden = + let s:save_bufhidden = + let s:save_autowrite = + set nohidden + set bufhidden= + set noautowrite +endfunc + +function TearDown() + let = s:save_hidden + let = s:save_bufhidden + let = s:save_autowrite +endfunc + +function Test_hide() + let orig_bname = bufname('') + let orig_winnr = winnr('$') + + new Xf1 + set modified + call assert_fails('edit Xf2') + bwipeout! Xf1 + + new Xf1 + set modified + edit! Xf2 + call assert_equal(['Xf2', 2], [bufname(''), winnr('$')]) + call assert_equal([1, 0], [buflisted('Xf1'), bufloaded('Xf1')]) + bwipeout! Xf1 + bwipeout! Xf2 + + new Xf1 + set modified + " :hide as a command + hide + call assert_equal([orig_bname, orig_winnr], [bufname(''), winnr('$')]) + call assert_equal([1, 1], [buflisted('Xf1'), bufloaded('Xf1')]) + bwipeout! Xf1 + + new Xf1 + set modified + " :hide as a command with trailing comment + hide " comment + call assert_equal([orig_bname, orig_winnr], [bufname(''), winnr('$')]) + call assert_equal([1, 1], [buflisted('Xf1'), bufloaded('Xf1')]) + bwipeout! Xf1 + + new Xf1 + set modified + " :hide as a command with bar + hide | new Xf2 " comment + call assert_equal(['Xf2', 2], [bufname(''), winnr('$')]) + call assert_equal([1, 1], [buflisted('Xf1'), bufloaded('Xf1')]) + bwipeout! Xf1 + bwipeout! Xf2 + + new xf1 + s
Re: [patch] can not write a trail comment to the :hide command
Hi Bram and list, 2016-11-15(Tue) 6:58:08 UTC+9 Bram Moolenaar: > Hirohito Higashi wrote: > > > Hi Bram and list, > > > > How to reproduce: > > - Start vanilla Vim with two buffers. > > $ vim -Nu NONE -o a b > > - buffer 'a' to modified. > > :set modofied > > - exec :hide command with trail comment > > :hide " command > > > > Expected behavior: > > - :hide command succeed. > > > > Actual behavior: > > - Occurred 'E474: Invalid argument' > > > > > > I wrote a patch. Of course contains a test. > > Check it please. > > Can you add a test that does something like this: > > :hide echo "one|two" > > To check that the bar is not recognized to separate commands? Right, I added a test case. Check an attached patch. NOTE: This issue was reported by Norio Takagi. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/Makefile b/src/Makefile index fef53af..eb67126 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2097,6 +2097,7 @@ test_arglist \ test_gui \ test_hardcopy \ test_help_tagjump \ + test_hide \ test_history \ test_hlsearch \ test_increment \ diff --git a/src/ex_cmds.h b/src/ex_cmds.h index 01126ba..d8fc506 100644 --- a/src/ex_cmds.h +++ b/src/ex_cmds.h @@ -623,7 +623,7 @@ EX(CMD_highlight, "highlight", ex_highlight, BANG|EXTRA|TRLBAR|SBOXOK|CMDWIN, ADDR_LINES), EX(CMD_hide, "hide", ex_hide, - BANG|RANGE|NOTADR|COUNT|EXTRA|NOTRLCOM, + BANG|RANGE|NOTADR|COUNT|EXTRA|TRLBAR, ADDR_WINDOWS), EX(CMD_history, "history", ex_history, EXTRA|TRLBAR|CMDWIN, diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 6b4e5fb..9fc4001 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -7572,38 +7572,32 @@ ex_all(exarg_T *eap) static void ex_hide(exarg_T *eap) { -if (*eap->arg != NUL && check_nextcmd(eap->arg) == NULL) - eap->errmsg = e_invarg; -else -{ - /* ":hide" or ":hide | cmd": hide current window */ - eap->nextcmd = check_nextcmd(eap->arg); +/* ":hide" or ":hide | cmd": hide current window */ #ifdef FEAT_WINDOWS - if (!eap->skip) - { +if (!eap->skip) +{ # ifdef FEAT_GUI - need_mouse_correct = TRUE; + need_mouse_correct = TRUE; # endif - if (eap->addr_count == 0) - win_close(curwin, FALSE); /* don't free buffer */ - else - { - int winnr = 0; - win_T *win; + if (eap->addr_count == 0) + win_close(curwin, FALSE); /* don't free buffer */ + else + { + int winnr = 0; + win_T *win; - FOR_ALL_WINDOWS(win) - { - winnr++; - if (winnr == eap->line2) - break; - } - if (win == NULL) - win = lastwin; - win_close(win, FALSE); + FOR_ALL_WINDOWS(win) + { + winnr++; + if (winnr == eap->line2) + break; } + if (win == NULL) + win = lastwin; + win_close(win, FALSE); } -#endif } +#endif } /* diff --git a/src/testdir/Make_all.mak b/src/testdir/Make_all.mak index a8ea543..1c0c715 100644 --- a/src/testdir/Make_all.mak +++ b/src/testdir/Make_all.mak @@ -156,6 +156,7 @@ NEW_TESTS = test_arglist.res \ test_gn.res \ test_gui.res \ test_hardcopy.res \ + test_hide.res \ test_history.res \ test_hlsearch.res \ test_increment.res \ diff --git a/src/testdir/test_hide.vim b/src/testdir/test_hide.vim new file mode 100644 index 000..128b8ff --- /dev/null +++ b/src/testdir/test_hide.vim @@ -0,0 +1,97 @@ +" Tests for :hide command/modifier and 'hidden' option + +function SetUp() + let s:save_hidden = + let s:save_bufhidden = + let s:save_autowrite = + set nohidden + set bufhidden= + set noautowrite +endfunc + +function TearDown() + let = s:save_hidden + let = s:save_bufhidden + let = s:save_autowrite +endfunc + +function Test_hide() + let orig_bname = bufname('') + let orig_winnr = winnr('$') + + new Xf1 + set modified + call assert_fails('edit Xf2') + bwipeout! Xf1 + + new Xf1 + set modified + edit! Xf2 + call assert_equal(['Xf2', 2], [bufname(''), winnr('$')]) + call assert_equal([1, 0], [buflisted('Xf1'), bufloaded('Xf1')]) + bwipeout! Xf1 + bwipeout! Xf2 + + new Xf1 + set modified + " :hide as a command + hide + call assert_equal([orig_bname, orig_winnr], [bufname(''), winnr('$')]) + call assert_equal([1, 1], [buflisted('Xf1'), b
Re: [vim/vim] an action help language CTRL-] in tag.c fixed (#1249)
Hi Tatsuki, 2016-11-12(Sat) 16:49:47 UTC+9 Tatsuki: > When I set translated help(for example: set helplang=ja,en in .vimrc), open > translated help and press CTRL-], Vim opens help in translated help, but open > English help and press CTRL-], Vim opens translated help. > > I'd like vim to open same language help as current opened help. > > So, I fixed tag.c. > > > > You can view, comment on, or merge this pull request online at: > > https://github.com/vim/vim/pull/1249 > > Commit Summary > > an action help language CTRL-] in tag.c fixed > > > File Changes > > > M > src/tag.c > (29) > > > > Patch Links: > > https://github.com/vim/vim/pull/1249.patch > https://github.com/vim/vim/pull/1249.diff Nice patch! It is indeed written in the document. :h helplang >When using CTRL-] and ":help!" in a non-English help file Vim will >try to find the tag in the current language before using this option. I wrote a patch to add a test for this. (Attached) Check it out. BTW, I found a bit wrong indentation. tag.c;1527+ /* Prefer help tags according to 'helplang'. Put the TAB SPC SPC SPC SPC TAB SPC SPC SPC SPC It should be: TAB TAB SPC SPC SPC SPC -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/testdir/test_help_tagjump.vim b/src/testdir/test_help_tagjump.vim index 778bd9c..427d8db 100644 --- a/src/testdir/test_help_tagjump.vim +++ b/src/testdir/test_help_tagjump.vim @@ -150,4 +150,36 @@ func Test_help_complete() endtry endfunc +func Test_help_respect_current_file_lang() + try +let list = [] +call s:doc_config_setup() + +if has('multi_lang') + function s:check_help_file_ext(help_keyword, ext) +exec 'help ' . a:help_keyword +call assert_equal(a:ext, expand('%:e')) +call feedkeys("\<C-]>", 'tx') +call assert_equal(a:ext, expand('%:e')) +pop +helpclose + endfunc + + set rtp+=Xdir1/doc-ab + set rtp+=Xdir1/doc-ja + + set helplang=ab + call s:check_help_file_ext('test-char', 'abx') + call s:check_help_file_ext('test-char@ja', 'jax') + set helplang=ab,ja + call s:check_help_file_ext('test-char@ja', 'jax') + call s:check_help_file_ext('test-char@en', 'txt') +endif + catch +call assert_exception('X') + finally +call s:doc_config_teardown() + endtry +endfunc + " vim: shiftwidth=2 sts=2 expandtab
[patch] Adjustment behavior of insert completion popupmenu with preview window
Hi Bram and list, I found a few issues to the display position of the pop-up menu with preview window. 1) Popup menu often drawing over the preview window. 2) Sometimes, popup menu is displayed in the narrow room side. Preparation before reproduction on Linux: - start terminal emulator (e.g. PuTTY) and set to size 80x24 - goto vim/src/ directory. $ cd (yourvimpath)/vim/src - Prepare test_vimrc. $ cat test_vimrc filetype plugin indent on syntax on colorscheme desert set ttm=50 Step to reproduce for case 1: - Start Vim $ vim -Nu test_vimrc screen.c - Type the following command. :new|wincmd w|norm!2} - Enter insert mode and start omni completion. iex_ Expected behavior: - Popup menu doesn't drawing over the preview window. See attached file: case1_expect.png (We can see the preview window after type ) Actual behavior: - Popup menu drawing over the preview window. See attached file: case1_actual.png Step to reproduce for case 2: - Start Vim $ vim -Nu test_vimrc screen.c - Type the following command. :call feedkeys(":pedit +resize\\ 5\2}2\") - Enter insert mode and start omni completion. iex_ Expected behavior: - popup menu is displayed in the above (narrow room side). See attached file: case2_expect.png Actual behavior: - Popup menu is displayed in the below (wide room side). See attached file: case2_actual.png I wrote a patch. Please check attached file. NOTE: I removed the following comment. Because other case always popup menu drawing over the status line. So my patch follow it. [popupmnu.c : roughly 90 line] /* When the preview window is at the bottom stop just above it. * Also avoid drawing over the status line so that it's clear there * is a window boundary. */ -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/popupmnu.c b/src/popupmnu.c index b479b00..6a75686 100644 --- a/src/popupmnu.c +++ b/src/popupmnu.c @@ -54,18 +54,21 @@ pum_display( int kind_width; int extra_width; int i; -int top_clear; int row; int context_lines; int col; -int above_row = cmdline_row; +int above_row; +int below_row; int redo_count = 0; +win_T *pvwin; redo: def_width = PUM_DEF_WIDTH; max_width = 0; kind_width = 0; extra_width = 0; +above_row = 0; +below_row = cmdline_row; /* Pretend the pum is already there to avoid that must_redraw is set when * 'cuc' is on. */ @@ -76,18 +79,16 @@ redo: row = curwin->w_wrow + W_WINROW(curwin); #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX) -if (firstwin->w_p_pvw) - top_clear = firstwin->w_height; -else -#endif - top_clear = 0; - -#if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX) -/* When the preview window is at the bottom stop just above it. Also - * avoid drawing over the status line so that it's clear there is a window - * boundary. */ -if (lastwin->w_p_pvw) - above_row -= lastwin->w_height + lastwin->w_status_height + 1; +FOR_ALL_WINDOWS(pvwin) + if (pvwin->w_p_pvw) + break; +if (pvwin != NULL) +{ + if (W_WINROW(pvwin) < W_WINROW(curwin)) + above_row = W_WINROW(pvwin) + pvwin->w_height; + else if (W_WINROW(pvwin) > W_WINROW(curwin) + curwin->w_height) + below_row = W_WINROW(pvwin); +} #endif /* @@ -102,8 +103,7 @@ redo: /* Put the pum below "row" if possible. If there are few lines decide on * where there is more room. */ -if (row + 2 >= above_row - pum_height - && row > (above_row - top_clear) / 2) +if (row - above_row >= below_row - row) { /* pum above "row" */ @@ -141,8 +141,8 @@ redo: + curwin->w_cline_height - curwin->w_wrow; pum_row = row + context_lines; - if (size > above_row - pum_row) - pum_height = above_row - pum_row; + if (size > below_row - pum_row) + pum_height = below_row - pum_row; else pum_height = size; if (p_ph > 0 && pum_height > p_ph) @@ -154,13 +154,11 @@ redo: return; #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX) -/* If there is a preview window at the top avoid drawing over it. */ -if (firstwin->w_p_pvw - && pum_row < firstwin->w_height - && pum_height > firstwin->w_height + 4) +/* If there is a preview window at the above avoid drawing over it. */ +if (pvwin !=
Re: [vim/vim] Vim hangs and segfaults with a scratch PHP buffer (#1200)
Hi ChrisBra, Lifepillar and list, 2016-10-27(Thu) 5:19:43 UTC+9 Christian Brabandt: > If that is really the case, I wonder if we can't just get rid of those lines > https://github.com/vim/vim/blob/master/src/popupmnu.c#L585-L593 > > > I could prepare a patch. How about an attached patch? -- Best regards,Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/popupmnu.c b/src/popupmnu.c index d9d1fee..cf5bd16 100644 --- a/src/popupmnu.c +++ b/src/popupmnu.c @@ -582,7 +582,8 @@ pum_set_selected(int n, int repeat) if (curwin->w_p_pvw) { - if (curbuf->b_fname == NULL + if (curwin_save != curwin && curwin_save->w_buffer != curbuf + && curbuf->b_fname == NULL && curbuf->b_p_bt[0] == 'n' && curbuf->b_p_bt[2] == 'f' && curbuf->b_p_bh[0] == 'w') {
Re: Patch 8.0.0047
Hi Bram and list, 2016-10-27(Thu) 21:50:11 UTC+9 Bram Moolenaar: > Patch 8.0.0047 > Problem:Crash when using the preview window from an unnamed buffer. > (lifepillar) > Solution: Do not clear the wrong buffer. (closes #1200) > Files: src/popupmnu.c > > > *** ../vim-8.0.0046/src/popupmnu.c2016-08-29 22:42:20.0 +0200 > --- src/popupmnu.c2016-10-27 14:29:30.530187340 +0200 > *** > *** 582,588 > > if (curwin->w_p_pvw) > { > ! if (curbuf->b_fname == NULL > && curbuf->b_p_bt[0] == 'n' && curbuf->b_p_bt[2] == 'f' > && curbuf->b_p_bh[0] == 'w') > { > --- 582,590 > > if (curwin->w_p_pvw) > { > ! if (!resized > ! && curbuf->b_nwindows == 1 > ! && curbuf->b_fname == NULL > && curbuf->b_p_bt[0] == 'n' && curbuf->b_p_bt[2] == 'f' > && curbuf->b_p_bh[0] == 'w') > { > *** ../vim-8.0.0046/src/version.c 2016-10-21 20:35:32.632943225 +0200 > --- src/version.c 2016-10-27 14:48:11.623357275 +0200 > *** > *** 766,767 > --- 766,769 > { /* Add new patch number below this line */ > + /**/ > + 47, > /**/ Here is a test patch for this. I confirmed fails unpatched my patch, and success patched one. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim index cc93ff8..f1e2c98 100644 --- a/src/testdir/test_popup.vim +++ b/src/testdir/test_popup.vim @@ -378,7 +378,7 @@ func DummyCompleteFour(findstart, base) endif endfunc -" Test that 'completefunc' works when it's OK. +" Test that 'omnifunc' works when it's OK. func Test_omnifunc_with_check() new setlocal omnifunc=DummyCompleteFour @@ -437,5 +437,31 @@ func Test_complete_no_undo() q! endfunc +function! DummyCompleteFive(findstart, base) + if a:findstart +return 0 + else +return [ + \ { 'word': 'January', 'info': "info1-1\n1-2\n1-3" }, + \ { 'word': 'February', 'info': "info2-1\n2-2\n2-3" }, + \ { 'word': 'March', 'info': "info3-1\n3-2\n3-3" }, + \ { 'word': 'April', 'info': "info4-1\n4-2\n4-3" }, + \ { 'word': 'May', 'info': "info5-1\n5-2\n5-3" }, + \ ] + endif +endfunc + +" Test that 'completefunc' on Scratch buffer with preview window works when +" it's OK. +func Test_completefunc_with_scratch_buffer() + new +setlocal\ buftype=nofile\ bufhidden=wipe\ noswapfile + set completeopt+=preview + setlocal completefunc=DummyCompleteFive + call feedkeys("A\\", "x") + call assert_equal(['April'], getline(1, '$')) + pclose + q! + set completeopt& +endfunc " vim: shiftwidth=2 sts=2 expandtab
Re: Patch 8.0.0033
Hi Bram and list, 2016-10-15(Sat) 21:57:02 UTC+9 Bram Moolenaar: > Patch 8.0.0033 > Problem:Cannot use overlapping positions with matchaddpos(). > Solution: Check end of match. (Ozaki Kiichi) Add a test (Hirohito Higashi) > Files: src/screen.c, src/testdir/test_match.vim > > > *** ../vim-8.0.0032/src/screen.c 2016-10-02 23:09:27.643153731 +0200 > --- src/screen.c 2016-10-15 14:52:51.297854046 +0200 > *** > *** 7786,7806 > shl->lnum = 0; > for (i = posmatch->cur; i < MAXPOSMATCH; i++) > { > ! if (posmatch->pos[i].lnum == 0) > break; > ! if (posmatch->pos[i].col < mincol) > continue; > ! if (posmatch->pos[i].lnum == lnum) > { > if (shl->lnum == lnum) > { > /* partially sort positions by column numbers >* on the same line */ > ! if (posmatch->pos[i].col < posmatch->pos[bot].col) > { > ! llpos_T tmp = posmatch->pos[i]; > > ! posmatch->pos[i] = posmatch->pos[bot]; > posmatch->pos[bot] = tmp; > } > } > --- 7786,7808 > shl->lnum = 0; > for (i = posmatch->cur; i < MAXPOSMATCH; i++) > { > ! llpos_T *pos = >pos[i]; > ! > ! if (pos->lnum == 0) > break; > ! if (pos->col + pos->len - 1 <= mincol) > continue; > ! if (pos->lnum == lnum) > { > if (shl->lnum == lnum) > { > /* partially sort positions by column numbers >* on the same line */ > ! if (pos->col < posmatch->pos[bot].col) > { > ! llpos_T tmp = *pos; > > ! *pos = posmatch->pos[bot]; > posmatch->pos[bot] = tmp; > } > } > *** ../vim-8.0.0032/src/testdir/test_match.vim2016-08-27 > 18:28:13.0 +0200 > --- src/testdir/test_match.vim2016-10-15 14:50:58.442694482 +0200 > *** > *** 181,186 > --- 181,196 > redraw! > call assert_equal(screenattr(2,2), screenattr(1,6)) > > + " Check overlapping pos > + call clearmatches() > + call setline(1, ['1234567890', 'NH']) > + call matchaddpos('Error', [[1,1,5], [1,3,5], [2,2]]) > + redraw! > + call assert_notequal(screenattr(2,2), 0) > + call assert_equal(screenattr(2,2), screenattr(1,5)) > + call assert_equal(screenattr(2,2), screenattr(1,7)) > + call assert_notequal(screenattr(2,2), screenattr(1,8)) > + > nohl > syntax off > set hlsearch& > *** ../vim-8.0.0032/src/version.c 2016-10-12 17:52:39.199701825 +0200 > --- src/version.c 2016-10-15 14:54:57.816912413 +0200 > *** > *** 766,767 > --- 766,769 > { /* Add new patch number below this line */ > + /**/ > + 33, > /**/ Regression occurred. When {pos} item specified a number (line number), this line is not highlighted properly. :call matchaddpos('Error', [[1]]) I made a pacth that contains a test. Please check this. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/screen.c b/src/screen.c index 0889db9..2fd1a52 100644 --- a/src/screen.c +++ b/src/screen.c @@ -7790,7 +7790,7 @@ next_search_hl_pos( if (pos->lnum == 0) break; - if (pos->col + pos->len - 1 <= mincol) + if (pos->len == 0 && pos->col < mincol) continue; if (pos->lnum == lnum) { diff --git a/src/testdir/test_match.vim b/src/testdir/test_match.vim index 3b20d5d..9398ef2 100644 --- a/src/testdir/test_match.vim +++ b/src/testdir/test_match.vim @@ -191,7 +191,15 @@ func Test_matchaddpos() call assert_equal(screenattr(2,2), screenattr(1,7)) call assert_notequal(screenattr(2,2), screenattr(1,8)) + call clearmatches() + call matchaddpos('Error', [[1], [2,2]]) + redraw! + call assert_equal(screenattr(2,2), screenattr(1,1)) + call assert_equal(screenattr(2,2), screenattr(1,10)) + call assert_notequal(screenattr(2,2), screenattr(1,11)) + nohl + call clearmatches() syntax off set hlsearch& endfunc
Re: [vim/vim] Fix #1168 completion problem from #875 (#1169)
2016-10-18(Tue) 0:13:48 UTC+9 Shougo: > Issue#1168 repro steps doesn't seem to asynchronous for me. Where is the > asynchronous? > > > > Because it uses complete_check() and complete_add(). (Below is Off topic) No. In this case, Those functions are not asynchronous because they are called from the main loop. main loop ... Test_complete_add() feedkeys("i\\" ...) TestCompleteAdd() complete_add() complete_check() You don't understand about the asynchronous processing. -- Best regards, Hirohito Higashi (a.k.a. h_east) > > > The problem is already fixed by Bram. > > So, closing. -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [vim/vim] Exiting completion menu results in unexpected change (#1312)
Hi Bram and all, 2016-12-8(Thu) 7:08:32 UTC+9 Bram Moolenaar: > > If I write the following in `/tmp/vimrc.vim`: > > > ``` > > > > > > setlocal tw=78 > > > setlocal cc=78 > > > > > > "zzz > > > " zzzyyy > > > > > > ``` > > > > > > Then I launch Vim from the shell like this: > > > > > > vim -Nu /tmp/vimrc.vim /tmp/vimrc.vim > > > > > > Finally, in insert mode I position the cursor after `zzz`, hit `` > > to open the completion menu, hit and `` to exit, here's the result: > > > > > > ``` > > > setlocal tw=78 > > > setlocal cc=78 > > > > > > " > > > zzzyyyzzz > > > " zzzyyy > > > ``` > > > > > > I expected the buffer to not change since I exited the menu. Besides > > > `zzz` is inserted twice. > > > > Looks like a bug. I update a patch. Added a test. I checked that it's okay with patch, and fail without patch Check it please. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/edit.c b/src/edit.c index 0d9e9d4..51a12b3 100644 --- a/src/edit.c +++ b/src/edit.c @@ -3875,7 +3875,7 @@ ins_compl_prep(int c) if (prev_col > 0) dec_cursor(); /* only format when something was inserted */ - if (!arrow_used && !ins_need_undo) + if (!arrow_used && !ins_need_undo && c != Ctrl_E) insertchar(NUL, 0, -1); if (prev_col > 0 && ml_get_curline()[curwin->w_cursor.col] != NUL) diff --git a/src/testdir/test_popup.vim b/src/testdir/test_popup.vim index f1e2c98..96c8d7e 100644 --- a/src/testdir/test_popup.vim +++ b/src/testdir/test_popup.vim @@ -464,4 +464,22 @@ func Test_completefunc_with_scratch_buffer() set completeopt& endfunc +" - select original typed text before the completion started without +" auto-wrap text. +func Test_completion_ctrl_e_without_autowrap() + new + let tw_save= + set tw=78 + let li = [ +\ '"zzz', +\ '" zzzyyy'] + call setline(1, li) + 0 + call feedkeys("A", "tx") + call assert_equal(li, getline(1, '$')) + + let =tw_save + q! +endfunc + " vim: shiftwidth=2 sts=2 expandtab
Re: [vim/vim] Inconsistent behavior of when pattern is not found (#1319)
Hi Lifepillar, 2016-12-11(Sun) 18:52:20 UTC+9 Lifepillar: > Consider a buffer containing the text foobar. Type ofoo. > I would expect the pop-up menu to suggest foobar, but Vim stays in > command-line completion and does not show anything. I think that this is a > bug. I think so. How about this patch? (A patch is attached at vim_dev mailing list https://groups.google.com/d/forum/vim_dev) When patch is okay then I'll write a test later. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/edit.c b/src/edit.c index 0d9e9d4..dbd2bf6 100644 --- a/src/edit.c +++ b/src/edit.c @@ -2286,8 +2286,7 @@ vim_is_ctrl_x_key(int c) return (c == Ctrl_D || c == Ctrl_P || c == Ctrl_N); #endif case CTRL_X_CMDLINE: - return (c == Ctrl_V || c == Ctrl_Q || c == Ctrl_P || c == Ctrl_N - || c == Ctrl_X); + return (c == Ctrl_V || c == Ctrl_Q || c == Ctrl_P || c == Ctrl_N); #ifdef FEAT_COMPL_FUNC case CTRL_X_FUNCTION: return (c == Ctrl_U || c == Ctrl_P || c == Ctrl_N);
Re: [vim/vim] set complete ignores priority order (#1316)
Hi All, 2016-12-12(Mon) 21:58:29 UTC+9 Lifepillar: > I think noinsert or noselect is ignored only when completeopt includes menu > instead of menuone. > > > That would be more acceptable for me, too. My plugin requires menuone, so it > would not be affected. Hmm, Your requires item is `menu`, isn't it? I think that it isn't a good design to change the behavior of only `menuone`. Rather than making that change, it is better to not change the current behavior. ...Or, add a new value to 'completeopt'... For example, "forceinsertone" ... I will not proactively act on this proposal. But I also want to hear opinions from other people. Thanks. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [vim/vim] Ordering of tags in result of taglist call. (#1194)
Hi Duncan, 2016-12-7(Wed) 17:10:17 UTC+9 Duncan McDougall: > I have updated this to be in sync with master again. With help I found a > cleaner way to do this. > > I do not understand why the test coverage has reduced, as there is a test.. > Perhaps this is because of the additions to the documentation? Or perhaps the > test I added is not registered as a test with the system? Yes. Your test is not running. See src/testdir/README.txt You are still only implementing 1). You need to implement 2) or later. Note: Typo in 2). s/.vim/.res/ -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [vim/vim] Inconsistent behavior of when pattern is not found (#1319)
Hi Lifepillar and list, 2016-12-11(Sun) 21:40:07 UTC+9 Lifepillar: > Thanks for the quick reply! I do not think that this is the correct fix, > though. According to the manual (:h i_CTRL-X_CTRL-V), when the pop-up menu > becomes visible after , pressing again behaves like > or . I'm fine with such behaviour, which is justified in the > manual. The problem is only when returns no matches. Then it > doesn't make much sense to stay in command completion mode. Ah, You are right. I update a patch. I changed only when returns no matches. Thanks. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/edit.c b/src/edit.c index 0d9e9d4..6003d7b 100644 --- a/src/edit.c +++ b/src/edit.c @@ -2287,7 +2287,7 @@ vim_is_ctrl_x_key(int c) #endif case CTRL_X_CMDLINE: return (c == Ctrl_V || c == Ctrl_Q || c == Ctrl_P || c == Ctrl_N - || c == Ctrl_X); + || (c == Ctrl_X && compl_matches > 0)); #ifdef FEAT_COMPL_FUNC case CTRL_X_FUNCTION: return (c == Ctrl_U || c == Ctrl_P || c == Ctrl_N);
Re: [vim/vim] set complete ignores priority order (#1316)
Hi Bram, Ruben and list, 2016-12-12(Mon) 1:40:01 UTC+9 Ruben Gonzalez: > Sorry, I find the error, I was using also: > > set completeopt=menuone,noinsert > > But, If I use > > set completeopt=menuone,preview > > Works as expected, the problem was using menuone,noinsert or menuone,noselect > and then I dit not see the dictionary completion. This is a proposal. I want to change to the specification that ignores the specification of noselect and/or noinsert, when there is only one completion candidate. It is hard to understand the current behavior. Patch for complete() function. https://gist.github.com/heavenshell/119fc8cf2d43a36da31957b367e4665e This patch was written by Shinya Ohyanagi. Bram> How about this? If OK, I'll write the remaining patch and test. Thanks. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Patch 8.0.0181
Hi Bram, 2017-1-14(Sat) 22:54:57 UTC+9 Bram Moolenaar: > Patch 8.0.0181 > Summary:with cursorbind set cursor column highlighting is off > Problem:When 'cursorbind' and 'cursorcolumn' are both on, the column > highlignt in non-current windows is wrong. > Solution: Add validate_cursor(). (Masanori Misono, closes #1372) > Files: src/move.c > > > *** ../vim-8.0.0180/src/move.c2016-11-06 15:25:37.693627473 +0100 > --- src/move.c2017-01-12 22:32:01.408155308 +0100 > *** > *** 2841,2846 > --- 2841,2850 > restart_edit_save = restart_edit; > restart_edit = TRUE; > check_cursor(); > + # ifdef FEAT_SYN_HL > + if (curwin->w_p_cuc) > + validate_cursor(); > + # endif > restart_edit = restart_edit_save; > # ifdef FEAT_MBYTE > /* Correct cursor for multi-byte character. */ > *** ../vim-8.0.0180/src/version.c 2017-01-14 14:36:03.229775080 +0100 > --- src/version.c 2017-01-14 14:53:33.111310935 +0100 > *** > *** 766,767 > --- 766,769 > { /* Add new patch number below this line */ > + /**/ > + 181, > /**/ Is the following patch correct? https://groups.google.com/d/msg/vim_dev/afsWQ48bfn0/xF-mCefjBwAJ -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Patch 8.0.0181
hi Bram, > It works for me. The following setting is no works. (set 'cursorline' without 'cursorcolumn') :set cursorbind cursorline nocursorcolumn -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Patch 8.0.0182
Hi Bram, Thanks for the correct fix! -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Patch 8.0.0181
Hi Bram, Here is a patch. (Attached) -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/move.c b/src/move.c index 86b19aa..e1ca9fc 100644 --- a/src/move.c +++ b/src/move.c @@ -2842,7 +2842,7 @@ do_check_cursorbind(void) restart_edit = TRUE; check_cursor(); # ifdef FEAT_SYN_HL - if (curwin->w_p_cuc) + if (curwin->w_p_cuc || curwin->w_p_cul) validate_cursor(); # endif restart_edit = restart_edit_save;
Re: [PATCH] Incorrect cursor position on a long wrapped-line
Hi Kiichi and list, 2016-12-1(Thu) 12:03:09 UTC+9 Ozaki Kiichi: > I updated test patch; modified some test-function names. > > https://gist.github.com/ichizok/4d177e3bf8cc9d47d47243577c8d847b > > @h_east: > > > I think that file name and function names that can be used with the whole > > test script should be named accordingly. Maybe we need a prefix? > > Hmm. like 'test_opt_number.vim' and 'Test_number_xxx()' (or > 'Test_opt_number_xxx()' ? Ah, I mentioned only for `view.vim` and the included functions. I think that they are commonly used from other tests. So, it would be better to add a prefix such as `Util`. :-) -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [patch] Fix document related command-line window
Hi Shuta, 2016-12-31(Sat) 3:10:57 UTC+9 Shuta TODA: > Hi Bram and list, > > In the current document, it is written that executing ":close" in the > command-line window will behave similarly to "CTRL-C", but in reality it > behaves like ":quit". Because it has been changed in the following topic. > > https://groups.google.com/d/msg/vim_dev/_fjJaLEuX0U/2jlAsIi1c2cJ It is supplemental information. Related patch is 7.3.193. https://groups.google.com/d/topic/vim_dev/yMgI3W67QjI/discussion > > The attached patch corrects this difference. > Please confirm. LGTM. -- Best regards,Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Patch 8.0.0148
Hi Bram, Ah, There is no problem because the function body is in front of the use point, right? -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Patch 8.0.0148
Hi Bram, 2017-1-7(Sat) 23:40:11 UTC+9 Bram Moolenaar: > Patch 8.0.0148 > Problem:When a C preprocessor statement has two line continuations the > following line does not have the right indent. (Ken Takata) > Solution: Add the indent of the previous continuation line. (Hirohito > Higashi) > Files: src/misc1.c, src/testdir/test3.in, src/testdir/test3.ok > > > *** ../vim-8.0.0147/src/misc1.c 2016-11-17 21:30:17.15729 +0100 > --- src/misc1.c 2017-01-07 14:09:00.601851661 +0100 > *** > *** 5422,5428 > static int cin_first_id_amount(void); > static int cin_get_equal_amount(linenr_T lnum); > static int cin_ispreproc(char_u *); > - static int cin_ispreproc_cont(char_u **pp, linenr_T *lnump); > static int cin_iscomment(char_u *); > static int cin_islinecomment(char_u *); > static int cin_isterminated(char_u *, int, int); > --- 5422,5427 Thanks including my patch. Perhaps, it seems that some of my patch is not reflected. Please check the following text. diff --git a/src/misc1.c b/src/misc1.c index 3630d7b..1f16958 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -5422,7 +5422,7 @@ static intskip_label(linenr_T, char_u **pp); static int cin_first_id_amount(void); static int cin_get_equal_amount(linenr_T lnum); static int cin_ispreproc(char_u *); -static int cin_ispreproc_cont(char_u **pp, linenr_T *lnump); +static int cin_ispreproc_cont(char_u **pp, linenr_T *lnump, int *amount); static int cin_iscomment(char_u *); static int cin_islinecomment(char_u *); static int cin_isterminated(char_u *, int, int); -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[patch] Fix indentation bug of Preprocessor directive continuation line
Hi Bram and list, How to reproduce: - Run vanilla Vim with 'cindent'. $ vim -Nu NONE +"set cindent" - Input bellow. i#if aaa\bbb\ccc Expect behavior: #if aaa\ bbb\ ccc Actual behavior: #if aaa\ bbb\ ccc After the third line is not indent well. NOTE: This behavior occurs only outside of the curly bracket. I wrote a patch contains test. Sorry, it is still the old style test. I'll challenge it in this spring Check it out. NOTE 2: This issue was reported by Ken Takata. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/misc1.c b/src/misc1.c index 3630d7b..1f16958 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -5422,7 +5422,7 @@ static int skip_label(linenr_T, char_u **pp); static int cin_first_id_amount(void); static int cin_get_equal_amount(linenr_T lnum); static int cin_ispreproc(char_u *); -static int cin_ispreproc_cont(char_u **pp, linenr_T *lnump); +static int cin_ispreproc_cont(char_u **pp, linenr_T *lnump, int *amount); static int cin_iscomment(char_u *); static int cin_islinecomment(char_u *); static int cin_isterminated(char_u *, int, int); @@ -6004,11 +6004,15 @@ cin_ispreproc(char_u *s) * start and return the line in "*pp". */ static int -cin_ispreproc_cont(char_u **pp, linenr_T *lnump) +cin_ispreproc_cont(char_u **pp, linenr_T *lnump, int *amount) { char_u *line = *pp; linenr_T lnum = *lnump; int retval = FALSE; +int candidate_amount = *amount; + +if (*line != NUL && line[STRLEN(line) - 1] == '\\') + candidate_amount = get_indent_lnum(lnum); for (;;) { @@ -6027,6 +6031,8 @@ cin_ispreproc_cont(char_u **pp, linenr_T *lnump) if (lnum != *lnump) *pp = ml_get(*lnump); +if (retval) + *amount = candidate_amount; return retval; } @@ -7390,7 +7396,7 @@ get_c_indent(void) l = skipwhite(ml_get(lnum)); if (cin_nocode(l)) /* skip comment lines */ continue; - if (cin_ispreproc_cont(, )) + if (cin_ispreproc_cont(, , )) continue; /* ignore #define, #if, etc. */ curwin->w_cursor.lnum = lnum; @@ -7845,7 +7851,8 @@ get_c_indent(void) /* * Skip preprocessor directives and blank lines. */ - if (cin_ispreproc_cont(, >w_cursor.lnum)) + if (cin_ispreproc_cont(, >w_cursor.lnum, +)) continue; if (cin_nocode(l)) @@ -7962,7 +7969,8 @@ get_c_indent(void) } /* Skip preprocessor directives and blank lines. */ - if (cin_ispreproc_cont(, >w_cursor.lnum)) + if (cin_ispreproc_cont(, >w_cursor.lnum, +)) continue; /* Finally the actual check for "namespace". */ @@ -8138,7 +8146,7 @@ get_c_indent(void) * unlocked it) */ l = ml_get_curline(); - if (cin_ispreproc_cont(, >w_cursor.lnum) + if (cin_ispreproc_cont(, >w_cursor.lnum, ) || cin_nocode(l)) continue; @@ -8859,7 +8867,7 @@ term_again: /* * Skip preprocessor directives and blank lines. */ - if (cin_ispreproc_cont(, >w_cursor.lnum)) + if (cin_ispreproc_cont(, >w_cursor.lnum, )) continue; if (cin_nocode(l)) @@ -8960,7 +8968,7 @@ term_again: { look = ml_get(--curwin->w_cursor.lnum); if (!(cin_nocode(look) || cin_ispreproc_cont( - , >w_cursor.lnum))) + , >w_cursor.lnum, ))) break; } if (curwin->w_cursor.lnum > 0 diff --git a/src/testdir/test3.in b/src/testdir/test3.in index 096f152..e8648d3 100644 --- a/src/testdir/test3.in +++ b/src/testdir/test3.in @@ -2318,6 +2318,25 @@ i; JSEND STARTTEST +:set cin cino& +/start of define +=/end of define +ENDTEST + +/* start of define */ +{ +} +#define AAA \ +BBB\ +CCC + +#define CNT \ +1 + \ +2 + \ +4 +/* end of define */ + +STARTTEST :g/^STARTTEST/.,/^ENDTEST/d :1;/start of AUTO/,$wq! test.out ENDTEST diff --git a/src/testdir/test3.ok b/src/testdir/test3.ok index 2f9572c..cfb519b 100644 --- a/src/testdir/test3.ok +++ b/src/testdir/test3.ok @@ -2080,3 +2080,17 @@ var a, i; JSEND + +/* start of define */ +{ +} +#define AAA \ + BBB\ + CCC + +#define CNT \ + 1 + \ + 2 + \ + 4 +/* end of define */ +
Re: [vim/vim] Failed to build from source - save_ccline (#1366)
Hi zdohnal, 2017-1-9(Mon) 18:23:40 UTC+9 zdohnal: > Hi, > > when I tried to build vim,m it ended with compile error that save_ccline > variable is not defined. That error happened in part of code, which is in > #ifdef FEAT_CMDWIN, so I solved it by adding this name to line 215. [...] I have already reported it. https://groups.google.com/d/msg/vim_dev/e3sriv8HIUY/VdVTBSVPBgAJ -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: Patch 8.0.0159
Hi Bram and list, 2017-1-9(Mon) 4:00:38 UTC+9 Bram Moolenaar: > Patch 8.0.0159 > Summary:crash on startup when updating tabline > Problem:Using a NULL pointer when using feedkeys() to trigger drawing a > tabline. > Solution: Skip drawing a tabline if TabPageIdxs is NULL. (Dominique Pelle) > Also fix recursing into getcmdline() from the cmd window. > Files: src/screen.c, src/ex_getln.c [...] A build error has occurred with FEATURES=small https://travis-ci.org/vim/vim/jobs/190070102 It is fixed by the attached patch. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/ex_getln.c b/src/ex_getln.c index cf99ae2..62110ac 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -212,7 +212,8 @@ getcmdline( #endif expand_T xpc; long *b_im_ptr = NULL; -#if defined(FEAT_WILDMENU) || defined(FEAT_EVAL) || defined(FEAT_SEARCH_EXTRA) +#if defined(FEAT_WILDMENU) || defined(FEAT_EVAL) || defined(FEAT_SEARCH_EXTRA) \ +|| defined(FEAT_CMDWIN) /* Everything that may work recursively should save and restore the * current command line in save_ccline. That includes update_screen(), a * custom status line may invoke ":normal". */
[patch] Build error occurred with --with-features=small --enable-gui=gnome2 on Fedora
Hi Bram and list, A build error has occurred with the following configure on Fedora 23. $ make distclean $ ./configure --with-features=small --enable-gui=gnome2 --enable-fail-if-missing $ make In file included from gui_gtk.c:34:0: /usr/include/libintl.h:61:14: error: expected identifier or '(' before 'unsigned' extern char *ngettext (const char *__msgid1, const char *__msgid2, ^ vim.h:606:35: error: expected ')' before '==' token # define ngettext(x, xs, n) (((n) == 1) ? (char *)(x) : (char *)(xs)) ^ vim.h:606:41: error: expected ')' before '?' token # define ngettext(x, xs, n) (((n) == 1) ? (char *)(x) : (char *)(xs)) ^ Makefile:2971: recipe for target 'objects/gui_gtk.o' failed make[1]: *** [objects/gui_gtk.o] Error 1 make[1]: Leaving directory '/home/h_east/samba/github/vim/src' Makefile:26: recipe for target 'first' failed make: *** [first] Error 2 I wrote a patch. But I don't know this patch is correct... -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/vim.h b/src/vim.h index ef75ea2..f86589f 100644 --- a/src/vim.h +++ b/src/vim.h @@ -603,7 +603,9 @@ extern char *(*dyn_libintl_textdomain)(const char *domainname); # endif #else # define _(x) ((char *)(x)) -# define ngettext(x, xs, n) (((n) == 1) ? (char *)(x) : (char *)(xs)) +# ifndef FEAT_GUI_GTK +# define ngettext(x, xs, n) (((n) == 1) ? (char *)(x) : (char *)(xs)) +# endif # define N_(x) x # ifdef bindtextdomain # undef bindtextdomain
Re: [patch] Build error occurred with --with-features=small --enable-gui=gnome2 on Fedora
Hi Kazunobu, 2017-1-9(Mon) 15:53:36 UTC+9 Kazunobu Kuriyama: > 2017-01-09 12:27 GMT+09:00 h_east <h.eas...@gmail.com>: > > > Hi Bram and list, > > > > A build error has occurred with the following configure on Fedora 23. > > > > $ make distclean > > $ ./configure --with-features=small --enable-gui=gnome2 > --enable-fail-if-missing > > $ make > > > > In file included from gui_gtk.c:34:0: > > /usr/include/libintl.h:61:14: error: expected identifier or '(' before > 'unsigned' > > extern char *ngettext (const char *__msgid1, const char *__msgid2, > > ^ > > vim.h:606:35: error: expected ')' before '==' token > > # define ngettext(x, xs, n) (((n) == 1) ? (char *)(x) : (char *)(xs)) > > ^ > > vim.h:606:41: error: expected ')' before '?' token > > # define ngettext(x, xs, n) (((n) == 1) ? (char *)(x) : (char *)(xs)) > > ^ > > Makefile:2971: recipe for target 'objects/gui_gtk.o' failed > > make[1]: *** [objects/gui_gtk.o] Error 1 > > make[1]: Leaving directory '/home/h_east/samba/github/vim/src' > > Makefile:26: recipe for target 'first' failed > > make: *** [first] Error 2 > > > > > > I wrote a patch. But I don't know this patch is correct... > > > > I'm afraid the proposed patch is a sort of overkill, because FEAT_GUI_GTK is > broader than FEAT_GUI_GNOME. > > > So, let me explain another way to fix the issue. > > > With the small build, FEAT_GETTEXT is kept undefined (feature.h:607--613), > and hence Vim is supposed not to include libintl.h; instead, Vim defines > ngettext() and other libintl macros such as _() and N_() for itself > (vim.h:584--619). > > > > Meanwhile, when the gnome2 feature is enabled, gui_gtk.c includes gnome.h at > line 72, and, as written in the comment at gui_gtk.c:50, gnome.h is said to > redefine some libintl macros. > > > Seeing the error message, I guess gnome.h also redefines ngettext(). > > > Therefore, I think following the way gui_gtk.c:49--73 does could give another > solution to the issue, namely, > > > > diff --git a/src/gui_gtk.c b/src/gui_gtk.c > index 8686381b0..c015d7ee6 100644 > --- a/src/gui_gtk.c > +++ b/src/gui_gtk.c > @@ -51,6 +51,9 @@ > # ifdef _ > # undef _ > # endif > +# ifdef ngettext > +# undef ngettext > +# endif > # ifdef N_ > # undef N_ > # endif Thank you for the polite explanation! Your suggested way cleared this problem. In fact, I also made the same fix for gui_gtk_x11.c. Patch attached. Thanks again -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/gui_gtk.c b/src/gui_gtk.c index 8686381..c015d7e 100644 --- a/src/gui_gtk.c +++ b/src/gui_gtk.c @@ -51,6 +51,9 @@ # ifdef _ # undef _ # endif +# ifdef ngettext +# undef ngettext +# endif # ifdef N_ # undef N_ # endif diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c index 514ac9e..71bcd6a 100644 --- a/src/gui_gtk_x11.c +++ b/src/gui_gtk_x11.c @@ -35,6 +35,9 @@ # ifdef _ # undef _ # endif +# ifdef ngettext +# undef ngettext +# endif # ifdef N_ # undef N_ # endif
Re: [vim/vim] Fixed indentation of dec_cursor() function of src/misc2.c (#1313)
Hi James! 2016-12-8(Thu) 1:01:15 UTC+9 James McCoy: > My real name is Kashun Yoshida! > > > So update your GitHub profile to show that. :) It maybe true. However, I have not registered my real name on GitHub, but Bram has recognized that Github's h-east is Hirohito Higashi. Probably, I think that he judge by e-mail signature. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [vim/vim] Exiting completion menu results in unexpected change (#1312)
Hi lacygoill, 2016-12-8(Thu) 1:03:00 UTC+9 lacygoill: > Thank you very much for the answer! I'm sorry I don't know much about git and > programming. I don't know where to find the patch and how to apply it.. I > just found this bug and wanted to report it to you. Again sorry for my lack > of knowledge, and thank you very much for your work on Vim! Do not mind. I think my patch is correct. Maybe :-) And, Bram and other developers will judge the validity of this patch. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [vim/vim] Exiting completion menu results in unexpected change (#1312)
Hi lacygoill, 2016-12-7(Wed) 13:26:25 UTC+9 lacygoill: > Hello, > > If I write the following in /tmp/vimrc.vim: > > setlocal tw=78 > setlocal cc=78 > > "zzz > " zzzyyy > > > > Then I launch Vim from the shell like this: > vim -Nu /tmp/vimrc.vim /tmp/vimrc.vim > > > Finally, in insert mode I position the cursor after zzz, hit to > open the completion menu, hit and to exit, here's the result: > setlocal tw=78 > setlocal cc=78 > > " > zzzyyyzzz > " zzzyyy > > > I expected the buffer to not change since I exited the menu. Besides zzz is > inserted twice. I can reproduce it. Please confirm attached patch. When confirming is okay, I'll write a test later. (Maybe write on the weekend :-) Thanks for the reporting. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/edit.c b/src/edit.c index 0d9e9d4..51a12b3 100644 --- a/src/edit.c +++ b/src/edit.c @@ -3875,7 +3875,7 @@ ins_compl_prep(int c) if (prev_col > 0) dec_cursor(); /* only format when something was inserted */ - if (!arrow_used && !ins_need_undo) + if (!arrow_used && !ins_need_undo && c != Ctrl_E) insertchar(NUL, 0, -1); if (prev_col > 0 && ml_get_curline()[curwin->w_cursor.col] != NUL)
Re: [patch] test_clientserver.vim and test_quotestar.vim fails in certain circumstances
Hi Bram, 2017-3-23(Thu) 6:31:02 UTC+9 Bram Moolenaar: > Elimar Riesebieter wrote: > > > > Hirohito Higashi wrote: > > > > > > > My config: > > > > $ ./configure --with-features=huge --enable-gui=gnome2 > > > > --enable-fail-if-missing > > > > My env.: > > > > I am connecting to fedora 25 with ssh via PuTTY on Windows 7. > > > > Vim version: > > > > 8.0.502 > > > > > > > > Executed command: > > > > $ cd vim/src > > > > $ make test > > > > > > > > Execution result: > > > > I got the following error. > > > > >8 > > > > Test results: > > > > > > > > > > > > >From test_clientserver.vim: > > > > Found errors in Test_client_server(): > > > > First run: > > > > function RunTheTest[24]..Test_client_server line 17: Pattern 'XVIMTEST' > > > > does not match '' > > > > Caught exception in Test_client_server(): Vim(call):E240: No connection > > > > to the X server @ function RunTheTest[24]..Test_client_server, line 19 > > > > Second run: > > > > function RunTheTest[24]..Test_client_server line 17: Pattern 'XVIMTEST' > > > > does not match '' > > > > Caught exception in Test_client_server(): Vim(call):E240: No connection > > > > to the X server @ function RunTheTest[24]..Test_client_server, line 19 > > > > > > Why is there no connection to the X server? Anyway, we could catch this > > > error and give up. > > > > There might be the case one builds vim on a headless system. I.e. > > some build servers of distro's? > > Can you try this patch: > > > --- /home/mool/vim/git/vim80/src/testdir/test_clientserver.vim > 2017-03-19 21:20:45.909034204 +0100 > +++ testdir/test_clientserver.vim 2017-03-22 22:19:57.761651837 +0100 > @@ -11,6 +11,12 @@ >if cmd == '' > return >endif > + try > +call serverlist() > + catch /E240:/ > +" No connection to the X server, give up. > +finish > + endtry > >let name = 'XVIMTEST' >let cmd .= ' --servername ' . name In my environment, `:call serverlist()` always succeed and returns the empty string. So, above patch does not change the situation. thanks. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [patch] test_clientserver.vim and test_quotestar.vim fails in certain circumstances
Hi Kazunobu and all, 2017-3-23(Thu) 21:01:32 UTC+9 Kazunobu Kuriyama: > 2017-03-23 18:13 GMT+09:00 Elimar Riesebieter <ries...@lxtec.de>: > > > * Bram Moolenaar <br...@moolenaar.net> [2017-03-22 22:30 +0100]: > > > > > > > > > > Elimar Riesebieter wrote: > > > > > > > > Hirohito Higashi wrote: > > > > > > > > > > > My config: > > > > > > $ ./configure --with-features=huge --enable-gui=gnome2 > > > > >--enable-fail-if-missing > > > > > > My env.: > > > > > > I am connecting to fedora 25 with ssh via PuTTY on Windows 7. > > > > > > Vim version: > > > > > > 8.0.502 > > > > > > > > > > > > Executed command: > > > > > > $ cd vim/src > > > > > > $ make test > > > > > > > > > > > > Execution result: > > > > > > I got the following error. > > > > > > >8 > > > > > > Test results: > > > > > > > > > > > > > > > > > > >From test_clientserver.vim: > > > > > > Found errors in Test_client_server(): > > > > > > First run: > > > > > > function RunTheTest[24]..Test_client_server line 17: Pattern > > > > > 'XVIMTEST' does not match '' > > > > > > Caught exception in Test_client_server(): Vim(call):E240: No > > > > > connection to the X server @ function > > > > > RunTheTest[24]..Test_client_server, line 19 > > > > > > Second run: > > > > > > function RunTheTest[24]..Test_client_server line 17: Pattern > > > > > 'XVIMTEST' does not match '' > > > > > > Caught exception in Test_client_server(): Vim(call):E240: No > > > > > connection to the X server @ function > > > > > RunTheTest[24]..Test_client_server, line 19 > > > > > > > > > > Why is there no connection to the X server? Anyway, we could catch this > > > > > error and give up. > > > > > > > > There might be the case one builds vim on a headless system. I.e. > > > > some build servers of distro's? > > > > > > Can you try this patch: > > > > > > > > > --- /home/mool/vim/git/vim80/src/testdir/test_clientserver.vim > > 2017-03-19 21:20:45.909034204 +0100 > > > +++ testdir/test_clientserver.vim 2017-03-22 22:19:57.761651837 +0100 > > > @@ -11,6 +11,12 @@ > > > if cmd == '' > > > return > > > endif > > > + try > > > + call serverlist() > > > + catch /E240:/ > > > + " No connection to the X server, give up. > > > + finish > > > + endtry > > > > > > let name = 'XVIMTEST' > > > let cmd .= ' --servername ' . name > > > > From test_quotestar.vim: > > Found errors in Test_quotestar(): > > First run: > > function RunTheTest[24]..Test_quotestar[8]..Do_test_quotestar_for_x11 line > 21: Pattern 'XVIMCLIPBOARD' does not match '' > > Caught exception in Test_quotestar(): Vim(call):E240: No connection to the > X server @ function > RunTheTest[24]..Test_quotestar[8]..Do_test_quotestar_for_x11, line 31 > > Second run: > > function RunTheTest[24]..Test_quotestar[8]..Do_test_quotestar_for_x11 line > 21: Pattern 'XVIMCLIPBOARD' does not match '' > > Caught exception in Test_quotestar(): Vim(call):E240: No connection to the > X server @ function > RunTheTest[24]..Test_quotestar[8]..Do_test_quotestar_for_x11, line 31 > > > > From test_clientserver.vim: > > Found errors in Test_client_server(): > > First run: > > function RunTheTest[24]..Test_client_server line 23: Pattern 'XVIMTEST' > does not match '' > > Caught exception in Test_client_server(): Vim(call):E240: No connection to > the X server @ function RunTheTest[24]..Test_client_server, line 25 > > Second run: > > function RunTheTest[24]..Test_client_server line 23: Pattern 'XVIMTEST' > does not match '' > > Caught exception in Test_client_server(): Vim(call):E240: No connection to > the X server @ function RunTheTest[24]..Test_client_server, line 25 > > > > Elimar > > > > Since test_quotestar hasn't been given any handling for E240 yet, the result > is just what we are expecting. > > > > As for test_clientserver, however, the E240 exception should be caught and > hence the test would be skipped gracefully if Bram's patch were included in > test_clientserver.vim. > > > So, the result of test_clientserver looks as if the patch were not included. > I'm wondering if the test was done with the patched test_clientserver.vim. As in mentoring a few hours ago, in my environment `:echo serverlist()` will not raise exceptions. Unfortunately, your guess is out of hand. -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [patch] test_clientserver.vim and test_quotestar.vim fails in certain circumstances
Hi Bram and list, 2017-3-24(Fri) 6:24:42 UTC+9 Bram Moolenaar: > I wrote: > > > Hirohito Higashi wrote: > > > > > > > > > My config: > > > > > > > $ ./configure --with-features=huge --enable-gui=gnome2 > > > > > > > --enable-fail-if-missing > > > > > > > My env.: > > > > > > > I am connecting to fedora 25 with ssh via PuTTY on Windows 7. > > > > > > > Vim version: > > > > > > > 8.0.502 > > > > > > > > > > > > > > Executed command: > > > > > > > $ cd vim/src > > > > > > > $ make test > > > > > > > > > > > > > > Execution result: > > > > > > > I got the following error. > > > > > > > >8 > > > > > > > Test results: > > > > > > > > > > > > > > > > > > > > > >From test_clientserver.vim: > > > > > > > Found errors in Test_client_server(): > > > > > > > First run: > > > > > > > function RunTheTest[24]..Test_client_server line 17: Pattern > > > > > > > 'XVIMTEST' does not match '' > > > > > > > Caught exception in Test_client_server(): Vim(call):E240: No > > > > > > > connection to the X server @ function > > > > > > > RunTheTest[24]..Test_client_server, line 19 > > > > > > > Second run: > > > > > > > function RunTheTest[24]..Test_client_server line 17: Pattern > > > > > > > 'XVIMTEST' does not match '' > > > > > > > Caught exception in Test_client_server(): Vim(call):E240: No > > > > > > > connection to the X server @ function > > > > > > > RunTheTest[24]..Test_client_server, line 19 > > > > > > > > > > > > Why is there no connection to the X server? Anyway, we could catch > > > > > > this > > > > > > error and give up. > > > > > > > > > > There might be the case one builds vim on a headless system. I.e. > > > > > some build servers of distro's? > > > > > > > > Can you try this patch: > > > > > > > > > > > > --- /home/mool/vim/git/vim80/src/testdir/test_clientserver.vim > > > > 2017-03-19 21:20:45.909034204 +0100 > > > > +++ testdir/test_clientserver.vim 2017-03-22 22:19:57.761651837 > > > > +0100 > > > > @@ -11,6 +11,12 @@ > > > >if cmd == '' > > > > return > > > >endif > > > > + try > > > > +call serverlist() > > > > + catch /E240:/ > > > > +" No connection to the X server, give up. > > > > +finish > > > > + endtry > > > > > > > >let name = 'XVIMTEST' > > > > let cmd .= ' --servername ' . name > > > > > > In my environment, `:call serverlist()` always succeed and returns the > > > empty string. > > > So, above patch does not change the situation. > > > > It appears serverlist() can fail silently. > > > > Try this check instead: > > > > func Test_client_server() > > let cmd = GetVimCommand() > > if cmd == '' > > return > > endif > > if has('unix') > > try > > call remote_send('xxx', '') > > catch > > if v:exception =~ 'E240:' > > " No connection to the X server, give up. > > finish > > That should be "return". > > > endif > > " ignore other errors > > endtry > > endif Thanks for the fixing this issue at Patch 8.0.0507 Please also fix the following one as reported first. I attached a patch. > Also, the following code is always true, so we should modify it. > src/testdir/test_quotestar.vim : 112 > > elseif !empty("$DISPLAY") -- Best regards, Hirohito Higashi (a.k.a. h_east) -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. diff --git a/src/testdir/test_quotestar.vim b/src/testdir/test_quotestar.vim index 6e4e4ca..7eb6d0d 100644 --- a/src/testdir/test_quotestar.vim +++ b/src/testdir/test_quotestar.vim @@ -118,7 +118,7 @@ func Test_quotestar() if has('macunix') let skipped = Do_test_quotestar_for_macunix() - elseif !empty("$DISPLAY") + elseif !empty($DISPLAY) let skipped = Do_test_quotestar_for_x11() else let skipped = "Test is not implemented yet for this platform."