Patch 8.0.0040
Patch 8.0.0040 (after 8.0.0033) Problem:Whole line highlighting with matchaddpos() does not work. Solution: Check for zero length. (Hirohito Higashi) Files: src/screen.c, src/testdir/test_match.vim *** ../vim-8.0.0039/src/screen.c2016-10-15 14:56:25.868257421 +0200 --- src/screen.c2016-10-16 14:28:48.026766302 +0200 *** *** 7773,7778 --- 7773,7782 } } + /* + * If there is a match fill "shl" and return one. + * Return zero otherwise. + */ static int next_search_hl_pos( match_T *shl, /* points to a match */ *** *** 7781,7835 colnr_T mincol) /* minimal column for a match */ { int i; ! int bot = -1; - 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; } } else ! { ! bot = i; ! shl->lnum = lnum; ! } } } posmatch->cur = 0; ! if (shl->lnum == lnum && bot >= 0) { ! colnr_T start = posmatch->pos[bot].col == 0 !? 0 : posmatch->pos[bot].col - 1; ! colnr_T end = posmatch->pos[bot].col == 0 ! ? MAXCOL : start + posmatch->pos[bot].len; shl->rm.startpos[0].lnum = 0; shl->rm.startpos[0].col = start; shl->rm.endpos[0].lnum = 0; shl->rm.endpos[0].col = end; shl->is_addpos = TRUE; ! posmatch->cur = bot + 1; ! return TRUE; } ! return FALSE; } #endif --- 7785,7836 colnr_T mincol) /* minimal column for a match */ { int i; ! int found = -1; for (i = posmatch->cur; i < MAXPOSMATCH; i++) { llpos_T *pos = >pos[i]; if (pos->lnum == 0) break; ! if (pos->len == 0 && pos->col < mincol) continue; if (pos->lnum == lnum) { ! if (found >= 0) { ! /* if this match comes before the one at "found" then swap !* them */ ! if (pos->col < posmatch->pos[found].col) { llpos_T tmp = *pos; ! *pos = posmatch->pos[found]; ! posmatch->pos[found] = tmp; } } else ! found = i; } } posmatch->cur = 0; ! if (found >= 0) { ! colnr_T start = posmatch->pos[found].col == 0 ! ? 0 : posmatch->pos[found].col - 1; ! colnr_T end = posmatch->pos[found].col == 0 ! ? MAXCOL : start + posmatch->pos[found].len; + shl->lnum = lnum; shl->rm.startpos[0].lnum = 0; shl->rm.startpos[0].col = start; shl->rm.endpos[0].lnum = 0; shl->rm.endpos[0].col = end; shl->is_addpos = TRUE; ! posmatch->cur = found + 1; ! return 1; } ! return 0; } #endif *** ../vim-8.0.0039/src/testdir/test_match.vim 2016-10-15 14:56:25.868257421 +0200 --- src/testdir/test_match.vim 2016-10-16 14:16:10.376350417 +0200 *** *** 191,197 --- 191,205 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 *** ../vim-8.0.0039/src/version.c 2016-10-15 20:46:13.580656069 +0200 --- src/version.c 2016-10-16 14:30:29.174020816 +0200 *** *** 766,767 --- 766,769 { /* Add new patch number below this line */ + /**/ + 40, /**/ -- It is illegal for anyone to give lighted cigars to dogs, cats, and other domesticated animal kept as pets. [real standing law in Illinois, United States of America] /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net \\\ ///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org/// \\\
Re: Patch 8.0.0033
Hirohito Higashi wrote: > 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 > > [...] > > 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. Thanks. That code is quite confusing. The function returns TRUE or FALSE but the caller checks for 1 or 0. I'll clean it up a bit. Perhaps we need some more tests for this. -- Any sufficiently advanced technology is indistinguishable from magic. Arthur C. Clarke Any sufficiently advanced bug is indistinguishable from a feature. Rich Kulawiec /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net \\\ ///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org/// \\\help me help AIDS victims -- http://ICCF-Holland.org/// -- -- 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: ":set cmdheight=2" doesn't work
On Sun, Oct 16, 2016 at 4:04 PM, Tony Mechelynckwrote: > I don't know exactly when this appeared but gvim 8.0.0040 (Huge, GTK3, > Linux64) is affected. > > After ":set cmdheight=2" the command -line height (between the bottom > statusline and the bottom of the Vim GUI) is still only one line, and > after ":xa | wv", which generates two lines of output, I get a > hit-enter prompt; yet ":set cmdheight?" answers " cmdheight=2". > > Best regards, > Tony. P.S. It seems to be an off-by-one error: after ":set ch=3" the command-line height is 2 lines, after ":set ch=4" 3 lines, etc. Best regards, Tony. -- -- 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: ":set cmdheight=2" doesn't work
gvim 8.0.0041 seems unaffected and yet the description of patch 41 seems to be for something else. I shall have to check if and when the problem reappears. Best regards, Tony. -- -- 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: ":set cmdheight=2" doesn't work
Oops: I meant ":wa | wv" On Sun, Oct 16, 2016 at 4:04 PM, Tony Mechelynckwrote: > I don't know exactly when this appeared but gvim 8.0.0040 (Huge, GTK3, > Linux64) is affected. > > After ":set cmdheight=2" the command -line height (between the bottom > statusline and the bottom of the Vim GUI) is still only one line, and > after ":xa | wv", which generates two lines of output, I get a > hit-enter prompt; yet ":set cmdheight?" answers " cmdheight=2". > > Best regards, > Tony. -- -- 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] Is it possible that vim support php like Python? (#1172)
On 2016-10-16, 07:29 GMT, Rick Woo wrote: >> I personally don't think it is worthwile to have yet another >> language embedded into Vim. > > Then why put lua, perl, python 2 and 3 and tcl in Vim. > Why phper can't have right or fun like them??? I agree … we should get rid of TCL, Lua, and Perl support in vim. In reality I see plugins either in plain VimL, or (when more serious programming language is needed) in Python (py2 and py3 is just temporary problem given the situation in the Python world, in few years py2k will be finally gone). Did anybody see any Perl, Lua, or TCL vim plugin lately? Best, Matěj -- https://matej.ceplovi.cz/blog/, Jabber: mc...@ceplovi.cz GPG Finger: 3C76 A027 CA45 AD70 98B5 BC1D 7920 5802 880B C9D8 If the Good Lord had wanted us to enjoy ourselves, he wouldn’t have granted us His precious gift of relentless misery. -- Jean Calvin in "Calvin and the Chipmunks" comic strip https://mcepl.fedorapeople.org/tmp/calvin_and_the_chipmunks.jpg -- -- 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 8.0.0041
Patch 8.0.0041 Problem:When using Insert mode completion but not actually inserting anything an undo item is still created. (Tommy Allen) Solution: Do not call stop_arrow() when not inserting anything. Files: src/edit.c, src/testdir/test_popup.vim *** ../vim-8.0.0040/src/edit.c 2016-10-15 17:06:42.086912756 +0200 --- src/edit.c 2016-10-16 15:34:26.985734970 +0200 *** *** 2799,2807 ins_compl_prep(' '); ins_compl_clear(); - if (stop_arrow() == FAIL) - return; - compl_direction = FORWARD; if (startcol > curwin->w_cursor.col) startcol = curwin->w_cursor.col; --- 2799,2804 *** *** 3876,3882 /* put the cursor on the last char, for 'tw' formatting */ if (prev_col > 0) dec_cursor(); ! if (stop_arrow() == OK) insertchar(NUL, 0, -1); if (prev_col > 0 && ml_get_curline()[curwin->w_cursor.col] != NUL) --- 3873,3880 /* put the cursor on the last char, for 'tw' formatting */ if (prev_col > 0) dec_cursor(); ! /* only format when something was inserted */ ! if (!arrow_used && !ins_need_undo) insertchar(NUL, 0, -1); if (prev_col > 0 && ml_get_curline()[curwin->w_cursor.col] != NUL) *** ../vim-8.0.0040/src/testdir/test_popup.vim 2016-10-15 17:06:42.094912699 +0200 --- src/testdir/test_popup.vim 2016-10-16 15:33:41.586069579 +0200 *** *** 378,384 endif endfunc ! :"Test that 'completefunc' works when it's OK. func Test_omnifunc_with_check() new setlocal omnifunc=DummyCompleteFour --- 378,384 endif endfunc ! " Test that 'completefunc' works when it's OK. func Test_omnifunc_with_check() new setlocal omnifunc=DummyCompleteFour *** *** 400,403 --- 400,429 q! endfunc + function UndoComplete() + call complete(1, ['January', 'February', 'March', + \ 'April', 'May', 'June', 'July', 'August', 'September', + \ 'October', 'November', 'December']) + return '' + endfunc + + " Test that no undo item is created when no completion is inserted + func Test_complete_no_undo() + set completeopt=menu,preview,noinsert,noselect + inoremap =UndoComplete() + new + call feedkeys("ixxx\\yyy\k", 'xt') + call feedkeys("iaaa\0", 'xt') + call assert_equal('aaa', getline(2)) + call feedkeys("i\\", 'xt') + call assert_equal('aaa', getline(2)) + call feedkeys("u", 'xt') + call assert_equal('', getline(2)) + + iunmap + set completeopt& + q! + endfunc + + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.0.0040/src/version.c 2016-10-16 14:35:44.547696415 +0200 --- src/version.c 2016-10-16 15:35:09.805419375 +0200 *** *** 766,767 --- 766,769 { /* Add new patch number below this line */ + /**/ + 41, /**/ -- Sometimes I think the surest sign that intelligent life exists elsewhere in the universe is that none of it has tried to contact us. (Calvin) /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net \\\ ///sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org/// \\\help me help AIDS victims -- http://ICCF-Holland.org/// -- -- 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.
":set cmdheight=2" doesn't work
I don't know exactly when this appeared but gvim 8.0.0040 (Huge, GTK3, Linux64) is affected. After ":set cmdheight=2" the command -line height (between the bottom statusline and the bottom of the Vim GUI) is still only one line, and after ":xa | wv", which generates two lines of output, I get a hit-enter prompt; yet ":set cmdheight?" answers " cmdheight=2". Best regards, Tony. -- -- 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.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
command line encoding
vim version: 8.0.13 python version: 3.5.2 Linux 4.7.6-1-ARCH: archlinux When running the following command from the gvim command line: :!python -c "print(input('Prompt: '))" the output when entering '0' from the main keyboard: Prompt: 0 0 and the output when entering 0 from the numeric keypad (set to numeric of course): Prompt: › KC Traceback (most recent call last): File "", line 1, in UnicodeDecodeError: 'utf-8' codec can't decode byte 0x9b in position 0: invalid start byte shell returned 1 Executed from the shell, this same python command runs fine in both cases and prints '0'. This regression seems to have been created after last july, either in Vim or in Python. Wondering if someone else can reproduce it or has any idea what might cause this problem. -- Xavier Les Chemins de Lokoti: http://lokoti.alwaysdata.net -- -- 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: command line encoding
On 10/16/2016 10:26 PM, Xavier de Gaye wrote: > vim version: 8.0.13 > python version: 3.5.2 > Linux 4.7.6-1-ARCH: archlinux > > When running the following command from the gvim command line: > :!python -c "print(input('Prompt: '))" > > the output when entering '0' from the main keyboard: > Prompt: 0 > 0 > and the output when entering 0 from the numeric keypad (set to numeric of course): > Prompt: › KC > Traceback (most recent call last): > File "", line 1, in > UnicodeDecodeError: 'utf-8' codec can't decode byte 0x9b in position 0: invalid start byte > > shell returned 1 > > Executed from the shell, this same python command runs fine in both cases and prints '0'. > This regression seems to have been created after last july, either in Vim or in Python. I am not really sure anymore now that I had been using the numeric keypad before. Use case: Running a python script from Vim to download grib files through IMAP. The script asks for a password and the problem occured after a password change. > Wondering if someone else can reproduce it or has any idea what might cause this problem. -- Xavier Les Chemins de Lokoti: http://lokoti.alwaysdata.net -- -- 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] ctrl-w,ctrl-u not work in insert-mode (#1177)
That's because your 'backspace' option does not include "start". Try this :set bs+=start and see :help 'backspace' Regards, Gary -- -- 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.