Re: fix matchit bug
On Fr, 15 Sep 2017, Bram Moolenaar wrote: > Thanks. I'll include it. > > Hmm, there is quite a bit of half finished and commented-out code. > I'll remove a few lines, but some more cleanup should be done. Well, there is still #955 laying around, that cleans up quite some of those normal mode command and instead uses winsaveview() which is a lot clearer. There have been some patches sent in the past to vim-dev from various people (me included) that have not been included so matchit has been started to bit rot a little. Best, Christian -- -- 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.1112
Patch 8.0.1112 Problem:Can't get size or current index from quickfix list. Solution: Add "idx" and "size" options. (Yegappan Lakshmanan) Files: runtime/doc/eval.txt, src/quickfix.c, src/testdir/test_quickfix.vim *** ../vim-8.0./runtime/doc/eval.txt2017-09-11 19:30:58.585288878 +0200 --- runtime/doc/eval.txt2017-09-15 22:39:14.326660616 +0200 *** *** 4642,4647 --- 4642,4648 id get information for the quickfix list with |quickfix-ID|; zero means the id for the current list or the list specifed by "nr" + idx index of the current entry in the list items quickfix list entries lines use 'errorformat' to extract items from a list of lines and return the resulting entries. *** *** 4650,4655 --- 4651,4657 nr get information for this quickfix list; zero means the current quickfix list and "$" means the last quickfix list + sizenumber of entries in the quickfix list title get the list title winid get the |window-ID| (if opened) all all of the above quickfix properties *** *** 4669,4676 --- 4671,4680 The returned dictionary contains the following entries: context context information stored with |setqflist()| id quickfix list ID |quickfix-ID| + idx index of the current entry in the list items quickfix list entries nr quickfix list number + sizenumber of entries in the quickfix list title quickfix list title text winid quickfix |window-ID| (if opened) *** ../vim-8.0./src/quickfix.c 2017-09-14 13:57:33.280856020 +0200 --- src/quickfix.c 2017-09-15 22:39:14.326660616 +0200 *** *** 2212,2219 old_qf_ptr = qf_ptr; qf_index = qi->qf_lists[qi->qf_curlist].qf_index; old_qf_index = qf_index; ! if (dir == FORWARD || dir == FORWARD_FILE || ! dir == BACKWARD || dir == BACKWARD_FILE)/* next/prev valid entry */ { qf_ptr = get_nth_valid_entry(qi, errornr, qf_ptr, _index, dir); if (qf_ptr == NULL) --- 2212,2218 old_qf_ptr = qf_ptr; qf_index = qi->qf_lists[qi->qf_curlist].qf_index; old_qf_index = qf_index; ! if (dir != 0)/* next/prev valid entry */ { qf_ptr = get_nth_valid_entry(qi, errornr, qf_ptr, _index, dir); if (qf_ptr == NULL) *** *** 4726,4731 --- 4725,4732 QF_GETLIST_WINID = 0x8, QF_GETLIST_CONTEXT= 0x10, QF_GETLIST_ID = 0x20, + QF_GETLIST_IDX= 0x40, + QF_GETLIST_SIZE = 0x80, QF_GETLIST_ALL= 0xFF }; *** *** 4882,4887 --- 4883,4894 if (dict_find(what, (char_u *)"items", -1) != NULL) flags |= QF_GETLIST_ITEMS; + if (dict_find(what, (char_u *)"idx", -1) != NULL) + flags |= QF_GETLIST_IDX; + + if (dict_find(what, (char_u *)"size", -1) != NULL) + flags |= QF_GETLIST_SIZE; + if (flags & QF_GETLIST_TITLE) { char_u *t; *** *** 4934,4939 --- 4941,4959 status = dict_add_nr_str(retdict, "id", qi->qf_lists[qf_idx].qf_id, NULL); + if ((status == OK) && (flags & QF_GETLIST_IDX)) + { + int idx = qi->qf_lists[qf_idx].qf_index; + if (qi->qf_lists[qf_idx].qf_count == 0) + /* For empty lists, qf_index is set to 1 */ + idx = 0; + status = dict_add_nr_str(retdict, "idx", idx, NULL); + } + + if ((status == OK) && (flags & QF_GETLIST_SIZE)) + status = dict_add_nr_str(retdict, "size", + qi->qf_lists[qf_idx].qf_count, NULL); + return status; } *** ../vim-8.0./src/testdir/test_quickfix.vim 2017-09-11 19:30:58.589288855 +0200 --- src/testdir/test_quickfix.vim 2017-09-15 22:39:14.330660592 +0200 *** *** 430,435 --- 430,448 call delete('Xqftestfile1') call delete('Xqftestfile2') + + " Should be able to use next/prev with invalid entries + Xexpr "" + call assert_equal(0, g:Xgetlist({'idx' : 0}).idx) + call assert_equal(0, g:Xgetlist({'size' : 0}).size) + Xaddexpr ['foo', 'bar', 'baz', 'quux', 'shmoo'] + call assert_equal(5, g:Xgetlist({'size' : 0}).size) + Xlast + call assert_equal(5, g:Xgetlist({'idx' : 0}).idx) + Xfirst + call assert_equal(1,
Re: fix matchit bug
Christian Brabandt wrote: > Bram, > there is a bug in the matchit plugin. It makes use of the v:count1 > variable in the function s:MultiMatch(). However when it accesses the > variable, it might be reset from the previous normal mode commands for > restoring the cursor position. So save it a little bit earlier: > > > diff --git a/runtime/pack/dist/opt/matchit/plugin/matchit.vim > b/runtime/pack/dist/opt/matchit/plugin/matchit.vim > index 4c9b845..7165067 100644 > --- a/runtime/pack/dist/opt/matchit/plugin/matchit.vim > +++ b/runtime/pack/dist/opt/matchit/plugin/matchit.vim > @@ -704,6 +704,8 @@ fun! s:MultiMatch(spflag, mode) > let skip = 's:comment\|string' >endif >let skip = s:ParseSkip(skip) > + " save v:count1 variable, might be reset from the restore_cursor command > + let level = v:count1 >" let restore_cursor = line(".") . "G" . virtcol(".") . "|" >" normal! H >" let restore_cursor = "normal!" . line(".") . "Gzt" . restore_cursor > @@ -726,7 +728,6 @@ fun! s:MultiMatch(spflag, mode) > execute "if " . skip . "| let skip = '0' | endif" >endif >mark ' > - let level = v:count1 >while level > if searchpair(openpat, '', closepat, a:spflag, skip) < 1 >call s:CleanUp(restore_options, a:mode, startline, startcol) > > > CC'ing Benji, not sure if he reads his mail, I haven't heard from him in > a long while. Thanks. I'll include it. Hmm, there is quite a bit of half finished and commented-out code. I'll remove a few lines, but some more cleanup should be done. -- You cannot have a baby in one month by getting nine women pregnant. /// 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: Test failure building 8.0.1111
* Bram Moolenaar[2017-09-15 20:43 +0200]: > > Elimar Riesebieter wrote: > > > on a 32bit (i386) system I get: > > > > Found errors in Test_peek_and_get_char(): > > function RunTheTest[24]..Test_peek_and_get_char line 7: Expected 97 but got > > 3 > > Found errors in Test_stop_all_in_callback(): > > function RunTheTest[24]..Test_stop_all_in_callback line 3: Expected 1 but > > got 2 > > > > > > On a 64bit (amd64) system the build went fine. > > Strange, I have not seen that fail. Is it just flaky perhaps? I've build in a clean chroot. Both i386 and ppc failed with the same errors. Tried clang-5 and gcc 7.2. Nothing helped. Elimar -- Do you smell something burning or is it me? -- -- 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 failure building 8.0.1111
Elimar Riesebieter wrote: > on a 32bit (i386) system I get: > > Found errors in Test_peek_and_get_char(): > function RunTheTest[24]..Test_peek_and_get_char line 7: Expected 97 but got 3 > Found errors in Test_stop_all_in_callback(): > function RunTheTest[24]..Test_stop_all_in_callback line 3: Expected 1 but got > 2 > > > On a 64bit (amd64) system the build went fine. Strange, I have not seen that fail. Is it just flaky perhaps? -- I'm writing a book. I've got the page numbers done. /// 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: [vim/vim] Ctrl-F mapping in mswin.vim (#1457)
On Friday, September 15, 2017 at 4:05:20 AM UTC-5, plbowers wrote: > I couldn't get the au to work, but I just put unmap/iunmap/cunmap on separate > lines in my Prog.../Vim/_vimrc after the mswin.vim and it solved the problem. > Thanks for your help! > > I see this as a workaround - I really think that redefining ctrl-F by default > for all Windows vim users is not a good idea. > And I really think that sourcing mswin.vim in general is a bad idea. You can choose not to include "mappings for standard Windows shortcuts" or whatever the option is when you install Vim... -- -- 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: Improper indent of structs in return (#2090)
On Friday, September 15, 2017 at 12:37:29 PM UTC-5, Ben Fritz wrote: > On Friday, September 15, 2017 at 10:31:10 AM UTC-5, Sam Pagenkopf wrote: > > It seems to be consistent across indentation methods. > > > > > > That doesn't make any sense, can you explain what options you actually tried? > > 'autoindent' obviously won't do that, 'smartindent' is somewhat deprecated > and does stupid stuff like that all the time, and 'indentexpr' could do > anything at all depending on what plugin you have or function you've assigned > to it manually. So is it using 'cindent' or not? I decided to check myself: yes, that's the behavior of 'cindent', with my 'cinoptions' set to "(0,W2s". -- -- 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: Improper indent of structs in return (#2090)
On Friday, September 15, 2017 at 10:31:10 AM UTC-5, Sam Pagenkopf wrote: > It seems to be consistent across indentation methods. > > That doesn't make any sense, can you explain what options you actually tried? 'autoindent' obviously won't do that, 'smartindent' is somewhat deprecated and does stupid stuff like that all the time, and 'indentexpr' could do anything at all depending on what plugin you have or function you've assigned to it manually. So is it using 'cindent' or not? -- -- 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.
Test failure building 8.0.1111
Hi all, on a 32bit (i386) system I get: Found errors in Test_peek_and_get_char(): function RunTheTest[24]..Test_peek_and_get_char line 7: Expected 97 but got 3 Found errors in Test_stop_all_in_callback(): function RunTheTest[24]..Test_stop_all_in_callback line 3: Expected 1 but got 2 On a 64bit (amd64) system the build went fine. Elimar -- The path to source is always uphill! -unknown- -- -- 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.1111
Patch 8.0. Problem:Syntax error in configure when using Perl. Solution: Add missing quote Files: src/configure.ac, src/auto/configure *** ../vim-8.0.1110/src/configure.ac2017-09-14 23:06:19.221486638 +0200 --- src/configure.ac2017-09-15 12:38:30.286389661 +0200 *** *** 1009,1015 perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \ -e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[[^ ]]*//' \ -e 's/-fdebug-prefix-map[[^ ]]*//g' \ ! -e 's/\(-Wp,\)\?-D_FORTIFY_SOURCE=.//g` dnl Remove "-lc", it breaks on FreeBSD when using "-pthread". perllibs=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed -e 'ldopts' | \ sed -e '/Warning/d' -e '/Note (probably harmless)/d' \ --- 1009,1015 perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \ -e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[[^ ]]*//' \ -e 's/-fdebug-prefix-map[[^ ]]*//g' \ ! -e 's/\(-Wp,\)\?-D_FORTIFY_SOURCE=.//g'` dnl Remove "-lc", it breaks on FreeBSD when using "-pthread". perllibs=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed -e 'ldopts' | \ sed -e '/Warning/d' -e '/Note (probably harmless)/d' \ *** ../vim-8.0.1110/src/auto/configure 2017-09-14 23:06:19.225486615 +0200 --- src/auto/configure 2017-09-15 12:38:43.126314893 +0200 *** *** 5720,5726 perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \ -e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[^ ]*//' \ -e 's/-fdebug-prefix-map[^ ]*//g' \ ! -e 's/\(-Wp,\)\?-D_FORTIFY_SOURCE=.//g` perllibs=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed -e 'ldopts' | \ sed -e '/Warning/d' -e '/Note (probably harmless)/d' \ -e 's/-bE:perl.exp//' -e 's/-lc //'` --- 5720,5726 perlcppflags=`$vi_cv_path_perl -Mlib=$srcdir -MExtUtils::Embed \ -e 'ccflags;perl_inc;print"\n"' | sed -e 's/-fno[^ ]*//' \ -e 's/-fdebug-prefix-map[^ ]*//g' \ ! -e 's/\(-Wp,\)\?-D_FORTIFY_SOURCE=.//g'` perllibs=`cd $srcdir; $vi_cv_path_perl -MExtUtils::Embed -e 'ldopts' | \ sed -e '/Warning/d' -e '/Note (probably harmless)/d' \ -e 's/-bE:perl.exp//' -e 's/-lc //'` *** ../vim-8.0.1110/src/version.c 2017-09-14 23:06:19.225486615 +0200 --- src/version.c 2017-09-15 12:39:34.038018407 +0200 *** *** 771,772 --- 771,774 { /* Add new patch number below this line */ + /**/ + , /**/ -- "Microsoft is like Coke. It's a secret formula, all the money is from distribution, and their goal is to get Coke everywhere. Open source is like selling water. There are water companies like Perrier and Poland Spring, but you're competing with something that's free." -- Carl Howe /// 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: Patch 8.0.1110
Tony Mechelynck wrote: > Warnings in configure for Huge buid, see below. My Tiny build is of > course configured with --disable-perlinterp > > On Thu, Sep 14, 2017 at 11:07 PM, Bram Moolenaarwrote: > > > > Patch 8.0.1110 > > Problem:FORTIFY_SOURCE from Perl causes problems. (Scott Baker) > > Solution: Filter out the flag. (Christian Brabandt, closes #2068) > > Files: src/configure.ac, src/auto/configure > [...] > > The following is from the console output (not configure's own logging to > disk): > > [...] > checking --enable-perlinterp argument... yes > checking for perl... /usr/bin/perl > checking Perl version... OK > auto/configure: command substitution: line 5723: unexpected EOF while > looking for matching `'' > auto/configure: command substitution: line 5724: syntax error: > unexpected end of file > checking if compile and link flags for Perl are sane... yes > checking --enable-pythoninterp argument... yes > [...] > checking linker --as-needed support... yes > configure: updating cache auto/config.cache > configure: creating auto/config.status > config.status: creating auto/config.mk > config.status: creating auto/config.h > config.status: auto/config.h is unchanged > > > The only modules recompiled for patches 1109 and 1110 together were > ex_cmds2.c ex_docmd.c auto/pathdef.c and version.c but nothing > Perl-related. Should I "make reconfig" to force a full rebuild? > > src/shadow-huge/auto/configure is a symlink to ../../auto/configure > (i.e. src/auto/configure) which was changed in patch 1110. There is a quote missing. I thought I ran configure to check this, apparently it didn't get to this point. -- A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail? /// 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.
fix matchit bug
Bram, there is a bug in the matchit plugin. It makes use of the v:count1 variable in the function s:MultiMatch(). However when it accesses the variable, it might be reset from the previous normal mode commands for restoring the cursor position. So save it a little bit earlier: diff --git a/runtime/pack/dist/opt/matchit/plugin/matchit.vim b/runtime/pack/dist/opt/matchit/plugin/matchit.vim index 4c9b845..7165067 100644 --- a/runtime/pack/dist/opt/matchit/plugin/matchit.vim +++ b/runtime/pack/dist/opt/matchit/plugin/matchit.vim @@ -704,6 +704,8 @@ fun! s:MultiMatch(spflag, mode) let skip = 's:comment\|string' endif let skip = s:ParseSkip(skip) + " save v:count1 variable, might be reset from the restore_cursor command + let level = v:count1 " let restore_cursor = line(".") . "G" . virtcol(".") . "|" " normal! H " let restore_cursor = "normal!" . line(".") . "Gzt" . restore_cursor @@ -726,7 +728,6 @@ fun! s:MultiMatch(spflag, mode) execute "if " . skip . "| let skip = '0' | endif" endif mark ' - let level = v:count1 while level if searchpair(openpat, '', closepat, a:spflag, skip) < 1 call s:CleanUp(restore_options, a:mode, startline, startcol) CC'ing Benji, not sure if he reads his mail, I haven't heard from him in a long while. Best, Christian -- Besser heimlich schlau als unheimlich blöd. -- -- 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.