Re: buffer number and python interface
On 12/30/2019 7:05 PM, Tony Mechelynck wrote: On Tue, Dec 31, 2019 at 3:48 AM Ernie Rael wrote: On 12/30/2019 6:42 PM, Tony Mechelynck wrote: On Tue, Dec 31, 2019 at 3:31 AM Ernie Rael wrote: On 12/29/2019 6:11 PM, Ernie Rael wrote:root From python, is it *always* true that "vim.buffer[i].number == i" ? -ernie I've convinced myself that this is true. The docs say A mapping object providing access to the list of vim buffers. ... b.numberBuffer number. Can be used as |python-buffers| key. and the python interface code uses b = buflist_findnr((int) bnr); -ernie To test if it is really _always_ true, test it with invalid values, for instance -1 or . Best regards, Tony. I used bwipe as well as some plain invalid numbers. Invalid numbers generate errors from vim, so the test couldn't complete; the function wouldn't collapse and I guess it's both true and false :-) -ernie In that case I guess you could put that statement inside a Python try..except construct and catch the appropriate vim.error Best regards, Tony. It's true enough (much better than a politician) for my needs. I'm working through a bug in some plugin code, Splice - it turns vim into a great merge tool. There's a variety of stuff that can be simplified by using the buffer.number for what it is. Thanks Tony, -ernie -- -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/7c925811-52a1-b0ee-f99d-40b08524f8f3%40raelity.com.
Re: buffer number and python interface
On Tue, Dec 31, 2019 at 3:48 AM Ernie Rael wrote: > > On 12/30/2019 6:42 PM, Tony Mechelynck wrote: > > On Tue, Dec 31, 2019 at 3:31 AM Ernie Rael wrote: > >> On 12/29/2019 6:11 PM, Ernie Rael wrote:root > >>> From python, is it *always* true that "vim.buffer[i].number == i" ? > >>> > >>> -ernie > >>> > >> I've convinced myself that this is true. The docs say > >> > >> A mapping object providing access to the list of vim buffers. > >> ... > >> b.numberBuffer number. Can be used as |python-buffers| key. > >> > >> and the python interface code uses > >> > >> b = buflist_findnr((int) bnr); > >> > >> -ernie > > To test if it is really _always_ true, test it with invalid values, > > for instance -1 or . > > > > Best regards, > > Tony. > > > I used bwipe as well as some plain invalid numbers. Invalid numbers > generate errors from vim, so the test couldn't complete; the function > wouldn't collapse and I guess it's both true and false :-) > > -ernie > In that case I guess you could put that statement inside a Python try..except construct and catch the appropriate vim.error 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. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/CAJkCKXt6LCC2%3DOM3Zxa50CL5v%2Bgrfhrh7K7NR4F1Rm8k3V%3D_5A%40mail.gmail.com.
Re: buffer number and python interface
On Tue, Dec 31, 2019 at 3:31 AM Ernie Rael wrote: > > On 12/29/2019 6:11 PM, Ernie Rael wrote:root > > From python, is it *always* true that "vim.buffer[i].number == i" ? > > > > -ernie > > > I've convinced myself that this is true. The docs say > > A mapping object providing access to the list of vim buffers. > ... > b.numberBuffer number. Can be used as |python-buffers| key. > > and the python interface code uses > > b = buflist_findnr((int) bnr); > > -ernie To test if it is really _always_ true, test it with invalid values, for instance -1 or . 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. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/CAJkCKXudJxxhnnwZh9x0iw3OwOyjo2VP2oJQ4p-bW6UiYkOx0A%40mail.gmail.com.
Re: buffer number and python interface
On 12/29/2019 6:11 PM, Ernie Rael wrote: From python, is it *always* true that "vim.buffer[i].number == i" ? -ernie I've convinced myself that this is true. The docs say A mapping object providing access to the list of vim buffers. ... b.number Buffer number. Can be used as |python-buffers| key. and the python interface code uses b = buflist_findnr((int) bnr); -ernie -- -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/fb71e338-8aff-f204-2e2a-1d398d46c44d%40raelity.com.
Re: version8.txt wrongly says that :wsverb command was added in vim-8.2
Christian Brabandt wrote: > On Mo, 30 Dez 2019, Bram Moolenaar wrote: > > > > > John Little wrote: > > > > > Just noticed that :help patches gives version8.txt, which lists all the > > > patch descriptions since 7.4.1, 6,600 of them, but stops at 8.1.2424; > > > there's no list for the 50 or so 8.2 patches. > > > > > > Now, version8.txt has become unwieldy; at 1.6 MB it's by far the largest > > > file in the repo, and github grumbles about it: > > > > > > (Sorry about that, but we can’t show files that are this big right > > > now.) > > > > Complain at github? > > > > I think it's nice to be able to search for changes, but perhaps we don't > > need to keep it in the distribution. At least it's also on the ftp > > server: https://ftp.nluug.nl/pub/vim/patches/8.1/ > > > > Opinions? > > I just noticed, that version8.txt contains all patches from version 7.4 > as well. > > So how about moving all patch descriptions from Version 7.4 onwards to > version7.txt? That would be wrong. There was no version 7.5. So the first stable release which includes patches 7.4.* is Vim-8. Dominique -- -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/CAON-T_i4wX4nCadn%2B4eBLoZMS88YtGeDAuZYiM%3DkHHm1vTjp9w%40mail.gmail.com.
Re: version8.txt wrongly says that :wsverb command was added in vim-8.2
On Mo, 30 Dez 2019, Bram Moolenaar wrote: > > John Little wrote: > > > Just noticed that :help patches gives version8.txt, which lists all the > > patch descriptions since 7.4.1, 6,600 of them, but stops at 8.1.2424; > > there's no list for the 50 or so 8.2 patches. > > > > Now, version8.txt has become unwieldy; at 1.6 MB it's by far the largest > > file in the repo, and github grumbles about it: > > > > (Sorry about that, but we can’t show files that are this big right now.) > > Complain at github? > > I think it's nice to be able to search for changes, but perhaps we don't > need to keep it in the distribution. At least it's also on the ftp > server: https://ftp.nluug.nl/pub/vim/patches/8.1/ > > Opinions? I just noticed, that version8.txt contains all patches from version 7.4 as well. So how about moving all patch descriptions from Version 7.4 onwards to version7.txt? Best, Christian -- Man wird zwar für die Verhältnisse, worin man betrogen wurde, künftig klüger; aber man bildet sich dann fälschlich ein, man sei es auch für die geworden, worin man noch nicht betrogen worden. -- Jean Paul -- -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/20191230214830.GQ9787%40256bit.org.
Patch 8.2.0065
Patch 8.2.0065 Problem:Amiga and alikes: autoopen only used on Amiga OS4. Solution: Adjust #ifdefs. (Ola Söder, closes #5413) Files: src/os_amiga.c *** ../vim-8.2.0064/src/os_amiga.c 2019-12-05 20:15:14.0 +0100 --- src/os_amiga.c 2019-12-30 22:26:16.175684071 +0100 *** *** 92,98 static BPTR raw_out = (BPTR)NULL; static intclose_win = FALSE; // set if Vim opened the window ! #ifndef __amigaos4__ // Use autoopen for AmigaOS4 struct IntuitionBase *IntuitionBase = NULL; #endif #ifdef FEAT_ARP --- 92,99 static BPTR raw_out = (BPTR)NULL; static intclose_win = FALSE; // set if Vim opened the window ! /* Use autoopen for AmigaOS4, AROS and MorphOS */ ! #if !defined(__amigaos4__) && !defined(__AROS__) && !defined(__MORPHOS__) struct IntuitionBase *IntuitionBase = NULL; #endif #ifdef FEAT_ARP *** *** 255,261 --- 256,264 void mch_init(void) { + #if !defined(__amigaos4__) && !defined(__AROS__) && !defined(__MORPHOS__) static char intlibname[] = "intuition.library"; + #endif #ifdef AZTEC_C Enable_Abort = 0; // disallow vim to be aborted *** *** 284,290 out_flush(); wb_window = NULL; ! #ifndef __amigaos4__ if ((IntuitionBase = (struct IntuitionBase *) OpenLibrary((UBYTE *)intlibname, 0L)) == NULL) { --- 287,293 out_flush(); wb_window = NULL; ! #if !defined(__amigaos4__) && !defined(__AROS__) && !defined(__MORPHOS__) if ((IntuitionBase = (struct IntuitionBase *) OpenLibrary((UBYTE *)intlibname, 0L)) == NULL) { *** *** 329,335 char *av; char_u*device = NULL; int exitval = 4; ! #ifndef __amigaos4__ struct Library *DosBase; #endif int usewin = FALSE; --- 332,338 char *av; char_u*device = NULL; int exitval = 4; ! #if !defined(__amigaos4__) && !defined(__AROS__) && !defined(__MORPHOS__) struct Library *DosBase; #endif int usewin = FALSE; *** *** 337,343 /* * check if we are running under DOS 2.0x or higher */ ! #ifndef __amigaos4__ DosBase = OpenLibrary(DOS_LIBRARY, 37L); if (DosBase != NULL) // if (((struct Library *)DOSBase)->lib_Version >= 37) --- 340,346 /* * check if we are running under DOS 2.0x or higher */ ! #if !defined(__amigaos4__) && !defined(__AROS__) && !defined(__MORPHOS__) DosBase = OpenLibrary(DOS_LIBRARY, 37L); if (DosBase != NULL) // if (((struct Library *)DOSBase)->lib_Version >= 37) *** *** 361,367 } # endif } ! #endif// __amigaos4__ /* * scan argv[] for the "-f" and "-d" arguments --- 364,370 } # endif } ! #endif/* __amigaos4__ __AROS__ __MORPHOS__ */ /* * scan argv[] for the "-f" and "-d" arguments *** ../vim-8.2.0064/src/version.c 2019-12-30 21:58:58.359667037 +0100 --- src/version.c 2019-12-30 22:31:59.794132862 +0100 *** *** 744,745 --- 744,747 { /* Add new patch number below this line */ + /**/ + 65, /**/ -- GUEST:He's killed the best man! SECOND GUEST: (holding a limp WOMAN) He's killed my auntie. FATHER: No, please! This is supposed to be a happy occasion! Let's not bicker and argue about who killed who ... "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// 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. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/201912302133.xBULXrPU009036%40masaka.moolenaar.net.
Patch 8.2.0064
Patch 8.2.0064 Problem:Diffmode completion doesn't use per-window setting. Solution: Check if a window is in diff mode. (Dominique Pell, closes #5419) Files: src/buffer.c, src/testdir/test_diffmode.vim *** ../vim-8.2.0063/src/buffer.c2019-12-29 23:04:20.290639897 +0100 --- src/buffer.c2019-12-30 21:45:49.905248225 +0100 *** *** 2661,2666 --- 2661,2671 *num_file = 0;// return values in case of FAIL *file = NULL; + #ifdef FEAT_DIFF + if ((options & BUF_DIFF_FILTER) && !curwin->w_p_diff) + return FAIL; + #endif + // Make a copy of "pat" and change "^" to "\(^\|[\/]\)". if (*pat == '^') { *** *** 2706,2713 if (options & BUF_DIFF_FILTER) // Skip buffers not suitable for // :diffget or :diffput completion. ! if (buf == curbuf ! || !diff_mode_buf(curbuf) || !diff_mode_buf(buf)) continue; #endif --- 2711,2717 if (options & BUF_DIFF_FILTER) // Skip buffers not suitable for // :diffget or :diffput completion. ! if (buf == curbuf || !diff_mode_buf(buf)) continue; #endif *** ../vim-8.2.0063/src/testdir/test_diffmode.vim 2019-12-29 13:56:28.692861883 +0100 --- src/testdir/test_diffmode.vim 2019-12-30 21:45:49.905248225 +0100 *** *** 242,284 bwipe! b endfunc func Test_diffget_diffput_completion() ! new Xdiff1 | diffthis ! new Xdiff2 | diffthis ! new Xdiff3 | diffthis ! new Xdiff4 ! ! " :diffput and :diffget completes names of buffers which ! " are in diff mode and which are different then current buffer. ! b Xdiff1 call feedkeys(":diffput \\\"\", 'tx') ! call assert_equal('"diffput Xdiff2 Xdiff3', @:) call feedkeys(":diffget \\\"\", 'tx') ! call assert_equal('"diffget Xdiff2 Xdiff3', @:) ! call assert_equal(['Xdiff2', 'Xdiff3'], getcompletion('', 'diff_buffer')) ! b Xdiff2 call feedkeys(":diffput \\\"\", 'tx') ! call assert_equal('"diffput Xdiff1 Xdiff3', @:) call feedkeys(":diffget \\\"\", 'tx') ! call assert_equal('"diffget Xdiff1 Xdiff3', @:) ! call assert_equal(['Xdiff1', 'Xdiff3'], getcompletion('', 'diff_buffer')) ! b Xdiff3 call feedkeys(":diffput \\\"\", 'tx') ! call assert_equal('"diffput Xdiff1 Xdiff2', @:) call feedkeys(":diffget \\\"\", 'tx') ! call assert_equal('"diffget Xdiff1 Xdiff2', @:) ! call assert_equal(['Xdiff1', 'Xdiff2'], getcompletion('', 'diff_buffer')) ! " No completion when in Xdiff4, it's not in diff mode. ! b Xdiff4 call feedkeys(":diffput \\\"\", 'tx') call assert_equal('"diffput ', @:) call feedkeys(":diffget \\\"\", 'tx') call assert_equal('"diffget ', @:) call assert_equal([], getcompletion('', 'diff_buffer')) %bwipe endfunc --- 242,301 bwipe! b endfunc + " :diffput and :diffget completes names of buffers which + " are in diff mode and which are different then current buffer. + " No completion when the current window is not in diff mode. func Test_diffget_diffput_completion() ! eXdiff1 | diffthis ! botright new Xdiff2 ! botright new Xdiff3 | split | diffthis ! botright new Xdiff4 | diffthis ! ! wincmd t ! call assert_equal('Xdiff1', bufname('%')) call feedkeys(":diffput \\\"\", 'tx') ! call assert_equal('"diffput Xdiff3 Xdiff4', @:) call feedkeys(":diffget \\\"\", 'tx') ! call assert_equal('"diffget Xdiff3 Xdiff4', @:) ! call assert_equal(['Xdiff3', 'Xdiff4'], getcompletion('', 'diff_buffer')) ! " Xdiff2 is not in diff mode, so no completion for :diffput, :diffget ! wincmd j ! call assert_equal('Xdiff2', bufname('%')) call feedkeys(":diffput \\\"\", 'tx') ! call assert_equal('"diffput ', @:) call feedkeys(":diffget \\\"\", 'tx') ! call assert_equal('"diffget ', @:) ! call assert_equal([], getcompletion('', 'diff_buffer')) ! " Xdiff3 is split in 2 windows, only the top one is in diff mode. ! " So completion of :diffput :diffget only happens in the top window. ! wincmd j ! call assert_equal('Xdiff3', bufname('%')) ! call assert_equal(1, &diff) call feedkeys(":diffput \\\"\", 'tx') ! call assert_equal('"diffput Xdiff1 Xdiff4', @:) call feedkeys(":diffget \\\"\", 'tx') ! call assert_equal('"diffget Xdiff1 Xdiff4', @:) ! call assert_equal(['Xdiff1', 'Xdiff4'], getcompletion('', 'diff_buffer')) ! wincmd j ! call assert_equal('Xdiff3', bufname('%')) ! call assert_equal(0, &diff) call feedkeys(":diffput \\\"\", 'tx') call assert_equal('"diffput ', @:) call feedkeys(":diffget \\\"\", 'tx') call assert_equal('"diffget ', @:) call assert_equal([], getcompletion('', 'diff_buffer')) + wincmd j + call assert_equal('Xdiff4', bufname('%')) + call feedkeys(":d
Patch 8.2.0063
Patch 8.2.0063 Problem:Wrong size argument to vim_snprintf(). (Dominique Pelle) Solution: Reduce the size by the length. (related to #5410) Files: src/ops.c *** ../vim-8.2.0062/src/ops.c 2019-12-17 22:10:54.564370706 +0100 --- src/ops.c 2019-12-30 20:37:38.566321032 +0100 *** *** 3813,3820 bom_count = bomb_size(); if (dict == NULL && bom_count > 0) ! vim_snprintf((char *)IObuff + STRLEN(IObuff), IOSIZE, _("(+%lld for BOM)"), (long_long_T)bom_count); if (dict == NULL) { // Don't shorten this message, the user asked for it. --- 3813,3824 bom_count = bomb_size(); if (dict == NULL && bom_count > 0) ! { ! size_t len = STRLEN(IObuff); ! ! vim_snprintf((char *)IObuff + len, IOSIZE - len, _("(+%lld for BOM)"), (long_long_T)bom_count); + } if (dict == NULL) { // Don't shorten this message, the user asked for it. *** ../vim-8.2.0062/src/version.c 2019-12-30 19:59:21.518539566 +0100 --- src/version.c 2019-12-30 20:38:17.422156273 +0100 *** *** 744,745 --- 744,747 { /* Add new patch number below this line */ + /**/ + 63, /**/ -- Advice to worms: Sleep late. /// 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. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/201912301943.xBUJh9xx017544%40masaka.moolenaar.net.
Patch 8.2.0062
Patch 8.2.0062 Problem:Memory test is flaky on FreeBSD. Solution: Add a short sleep before getting the first size. Files: src/testdir/test_memory_usage.vim *** ../vim-8.2.0061/src/testdir/test_memory_usage.vim 2019-08-07 22:05:40.0 +0200 --- src/testdir/test_memory_usage.vim 2019-12-30 19:53:26.055751369 +0100 *** *** 133,138 --- 133,140 let vim = s:vim_new() call vim.start('--clean', '-c', 'set noswapfile', testfile) + " Wait a bit until the process has started and sourced the script. + sleep 200m let before = s:monitor_memory_usage(vim.pid).last call term_sendkeys(vim.buf, ":so %\") *** ../vim-8.2.0061/src/version.c 2019-12-30 19:19:48.686098272 +0100 --- src/version.c 2019-12-30 19:58:58.918617790 +0100 *** *** 744,745 --- 744,747 { /* Add new patch number below this line */ + /**/ + 62, /**/ -- FATHER:You killed eight wedding guests in all! LAUNCELOT: Er, Well ... the thing is ... I thought your son was a lady. FATHER:I can understand that. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// 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. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/201912301859.xBUIxqSM005557%40masaka.moolenaar.net.
Re: RFC: Support for customizing the text displayed in the quickfix window
Or use one of: set qbe=* set qbe=$ set qbe=- set qbe=? to distinguish from function names ?? 在 2019年12月31日星期二 UTC+8上午2:20:37,skywind3000写道: > > Please provide a `raw` reserved option for qfbufexpr, and if it is > initialized as: > > set qbe=raw > > Just keep the original text and don't run any filter function ?? for the > speed purpose. And I don't need to write a > > function! ReturnAsItIs(is_qf, qfid, eidx) > if a:isqf > let qfl = getqflist({'id' : a:qfid, 'idx' : a:eidx, 'items' : > 1}).items > else > let qfl = getloclist(0, {'id' : a:qfid, 'idx' : > a:eidx, 'items' : 1}).items > endif > let e = qfl[0] > return e.text > endfunc > > set qbe=ReturnAsItIs > > It's totally unnecessary for every one to write such function, and it's > too slow, so just a > > set qbe=raw > > can be much helpful. > > -- -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/729e96f8-92e1-4fed-ad1c-47c5ace9f802%40googlegroups.com.
Patch 8.2.0061
Patch 8.2.0061 Problem:The execute stack can grow big and never shrinks. Solution: Reduce the size in gargage collect. Files: src/eval.c *** ../vim-8.2.0060/src/eval.c 2019-12-25 19:33:18.520594684 +0100 --- src/eval.c 2019-12-30 19:12:49.939679473 +0100 *** *** 3857,3862 --- 3857,3886 garbage_collect_at_exit = FALSE; } + // The execution stack can grow big, limit the size. + if (exestack.ga_maxlen - exestack.ga_len > 500) + { + size_t new_len; + char_u *pp; + int n; + + // Keep 150% of the current size, with a minimum of the growth size. + n = exestack.ga_len / 2; + if (n < exestack.ga_growsize) + n = exestack.ga_growsize; + + // Don't make it bigger though. + if (exestack.ga_len + n < exestack.ga_maxlen) + { + new_len = exestack.ga_itemsize * (exestack.ga_len + n); + pp = vim_realloc(exestack.ga_data, new_len); + if (pp == NULL) + return FAIL; + exestack.ga_maxlen = exestack.ga_len + n; + exestack.ga_data = pp; + } + } + // We advance by two because we add one for items referenced through // previous_funccal. copyID = get_copyID(); *** ../vim-8.2.0060/src/version.c 2019-12-30 17:55:30.464513273 +0100 --- src/version.c 2019-12-30 18:49:36.393455543 +0100 *** *** 744,745 --- 744,747 { /* Add new patch number below this line */ + /**/ + 61, /**/ -- 5 out of 4 people have trouble with fractions. /// 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. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/201912301820.xBUIKcYm028960%40masaka.moolenaar.net.
Re: RFC: Support for customizing the text displayed in the quickfix window
Please provide a `raw` reserved option for qfbufexpr, and if it is initialized as: set qbe=raw Just keep the original text and don't run any filter function ?? for the speed purpose. And I don't need to write a function! ReturnAsItIs(is_qf, qfid, eidx) if a:isqf let qfl = getqflist({'id' : a:qfid, 'idx' : a:eidx, 'items' : 1}).items else let qfl = getloclist(0, {'id' : a:qfid, 'idx' : a:eidx, 'items' : 1}).items endif let e = qfl[0] return e.text endfunc set qbe=ReturnAsItIs It's totally unnecessary for every one to write such function, and it's too slow, so just a set qbe=raw can be much helpful. -- -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/da1c7c43-5055-4694-9bd3-a47e9a21efe9%40googlegroups.com.
RFC: Support for customizing the text displayed in the quickfix window
Hi all, I have seen several requests for customizing the text displayed in the quickfix window. I am attaching the updates to the help text for adding a new "qfbufexpr" option that will support this. Any comments and suggestions on this approach? Regards, Yegappan diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 7d8e032cd..6b6614ef0 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -5883,6 +5883,62 @@ A jump table for the options with a short description can be found at |Q_op|. This option cannot be set from a |modeline| or in the |sandbox|, for security reasons. + *'qfbufexpr'* *'qbe'* +'qfbufexpr' 'qbe' string (default "") + global + {only available when compiled with the |+quickfix| + feature} + Expression for text to display in the quickfix and location list + window buffers. The supplied expression should be the name of a Vim + function that accepts three arguments. The first argument is set to + v:true if the expression is called for a quickfix list. The second + argument is the quickfix or location list list identifier. The third + argument is the index of the entry in the quickfix or location list. + The function should return the text to display in the quickfix buffer. + The function is called for each entry in the quickfix list. + + This can be used to customize the information displayed in the + quickfix or location buffer for each entry in the corresponding + quickfix or location list. + + This option can be overriden by using the |setqflist()| and + |setloclist()| functions and setting the 'qfbufexpr' attribute for + a quickfix/location list. + + The example below tries to mimic the default behavior for the quickfix + and location list buffers. + Example: > +func MyQfExpr(is_qf, qfid, eidx) + if a:isqf + let qfl = getqflist({'id' : a:qfid, 'idx' : a:eidx, + \ 'items' : 1}).items + else + let qfl = getloclist(0, {'id' : a:qfid, 'idx' : a:eidx, + \ 'items' : 1}).items + endif + let e = qfl[0] + let s = '' + if e.bufnr != 0 + let bname = bufname(e.bufnr) + let s ..= fnamemodify(bname, ':.') + endif + let s ..= '|' + if e.lnum > 0 + let s ..= e.lnum + if e.col != 0 + let s ..= ' col ' . e.col + endif + elseif e.pattern != '' + let s ..= e.pattern + endif + let s ..= '| ' + let s ..= substitute(e.text, '^\s\+', '', '') + return s +endfunc +set qfbufexpr=MyQfExpr +< + NOTE: This option is set to "" when 'compatible' is set. + *'quoteescape'* *'qe'* 'quoteescape' 'qe' string (default "\") local to buffer diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index a20f56270..26b677eee 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -5438,8 +5438,9 @@ getqflist([{what}]) *getqflist()* id get information for the quickfix list with |quickfix-ID|; zero means the id for the current list or the list specified by "nr" - idx index of the current entry in the quickfix - list specified by 'id' or 'nr'. + idx get information for the quickfix entry at this + index in the list specified by 'id' or 'nr'. + If set to zero, then uses the current entry. See |quickfix-index| items quickfix list entries lines parse a list of lines using 'efm' and return @@ -5475,7 +5476,7 @@ getqflist([{what}]) *getqflist()* If not present, set to "". id quickfix list ID |quickfix-ID|. If not present, set to 0. - idx index of the current entry in the list. If not + idx index of the quickfix entry in the list. If not present, set to 0. items quickfix list entries. If not present, set to an empty list. @@ -8658,6 +8659,13 @@ setqflist({list} [, {action} [, {what}]]) *setqflist()* nr list number in the quickfix stack; zero means the current quickfix list and "$" means the last quickfix list. + qfbufexpr expression to get the text to display in the + quickfix buffer for each entry in the list. + This should be set to a Vim function that is + called for each entry in the list and should + return the text to display. Refer to + |'qfbufexpr'| for more information and an + example. title quickfix list title text. See |quickfix-title| Unsupported keys in {what} are ignored. If the "nr" item is not present, then the current quickfix list -- -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/CAAW7x7nu7zjSkdtG8%3DObOeUE2BDDAvK-yHz9hCcPYd47kMMyAA%40mail.gmail.com.
Patch 8.2.0060
Patch 8.2.0060 Problem:Message test only runs with one encoding. (Dominique Pelle) Solution: Run the test with "utf-8" and "latin1". Fix underflow. (related to #5410) Files: src/message_test.c, src/message.c *** ../vim-8.2.0059/src/message_test.c 2019-12-21 18:25:50.453560468 +0100 --- src/message_test.c 2019-12-30 17:50:00.605392738 +0100 *** *** 100,107 --- 100,113 params.argc = argc; params.argv = argv; common_init(¶ms); + + set_option_value((char_u *)"encoding", 0, (char_u *)"utf-8", 0); init_chartab(); + test_trunc_string(); + set_option_value((char_u *)"encoding", 0, (char_u *)"latin1", 0); + init_chartab(); test_trunc_string(); + return 0; } *** ../vim-8.2.0059/src/message.c 2019-12-29 23:04:20.294639884 +0100 --- src/message.c 2019-12-30 17:53:04.924922715 +0100 *** *** 307,313 } else { ! for (i = (int)STRLEN(s); len + (n = ptr2cells(s + i - 1)) <= room; --i) len += n; } --- 307,314 } else { ! for (i = (int)STRLEN(s); ! i - 1 >= 0 && len + (n = ptr2cells(s + i - 1)) <= room; --i) len += n; } *** ../vim-8.2.0059/src/version.c 2019-12-30 10:56:57.032237969 +0100 --- src/version.c 2019-12-30 17:51:03.397239834 +0100 *** *** 744,745 --- 744,747 { /* Add new patch number below this line */ + /**/ + 60, /**/ -- BLACK KNIGHT: Come on you pansy! [hah] [parry thrust] [ARTHUR chops the BLACK KNIGHT's right arm off] ARTHUR:Victory is mine! [kneeling] We thank thee Lord, that in thy merc- [Black Knight kicks Arthur in the head while he is praying] The Quest for the Holy Grail (Monty Python) /// 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. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/201912301658.xBUGwTM7004898%40masaka.moolenaar.net.
Re: version8.txt wrongly says that :wsverb command was added in vim-8.2
On Tuesday, December 31, 2019 at 12:18:01 AM UTC+13, Bram Moolenaar wrote: >Opinions? I agree the info is useful; I noticed because I didn't find the 8.2.00* patch details. Just as there is presently version4.txt, 5, 6, 7, I suggest version7.4.txt, version8.0.txt, version8.1.txt and version8.2.txt, since support for 8.3 filenames is no longer needed. Separating the discussion about each significant release from the list of patches would be sensible too. I imagine that would make maintaining them easier. Regards, John Little -- -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/f4861bc1-ca07-4bae-b93d-54d8f128bb11%40googlegroups.com.
Re: version8.txt wrongly says that :wsverb command was added in vim-8.2
On Mo, 30 Dez 2019, Bram Moolenaar wrote: > > John Little wrote: > > > Just noticed that :help patches gives version8.txt, which lists all the > > patch descriptions since 7.4.1, 6,600 of them, but stops at 8.1.2424; > > there's no list for the 50 or so 8.2 patches. > > > > Now, version8.txt has become unwieldy; at 1.6 MB it's by far the largest > > file in the repo, and github grumbles about it: > > > > (Sorry about that, but we can’t show files that are this big right now.) Just click on raw. > > Complain at github? > > I think it's nice to be able to search for changes, but perhaps we don't > need to keep it in the distribution. At least it's also on the ftp > server: https://ftp.nluug.nl/pub/vim/patches/8.1/ I'd vote for keeping it. Best, Christian -- Leider ist es eine typisch deutsche Eigenschaft, den Gehorsam schlechthin für eine Tugend zu halten. Wir brauchen die Zivilcourage, 'nein' zu sagen. -- Fritz Max Bauer -- -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/20191230112209.GP9787%40256bit.org.
Re: version8.txt wrongly says that :wsverb command was added in vim-8.2
John Little wrote: > Just noticed that :help patches gives version8.txt, which lists all the > patch descriptions since 7.4.1, 6,600 of them, but stops at 8.1.2424; > there's no list for the 50 or so 8.2 patches. > > Now, version8.txt has become unwieldy; at 1.6 MB it's by far the largest > file in the repo, and github grumbles about it: > > (Sorry about that, but we can’t show files that are this big right now.) Complain at github? I think it's nice to be able to search for changes, but perhaps we don't need to keep it in the distribution. At least it's also on the ftp server: https://ftp.nluug.nl/pub/vim/patches/8.1/ Opinions? -- No letters of the alphabet were harmed in the creation of this message. /// 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. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/201912301117.xBUBHo2P027786%40masaka.moolenaar.net.
Re: Warning for 4 unused variables in scriptfile.c in Tiny and Small (only) after applying patches 8.1. 56 to 58
Tony wrote: > This is probably no problem, but… We like to keep the build warning-free! > gcc -c -I. -Iproto -DHAVE_CONFIG_H -O2 -fno-strength-reduce -Wall > -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1-o objects/scriptfile.o > scriptfile.c > scriptfile.c: In function ‘estack_sfile’: > scriptfile.c:102:10: warning: unused variable ‘done’ [-Wunused-variable] > int done; > ^~~~ > scriptfile.c:101:11: warning: unused variable ‘res’ [-Wunused-variable] > char *res; >^~~ > scriptfile.c:99:10: warning: unused variable ‘idx’ [-Wunused-variable] > int idx; > ^~~ > scriptfile.c:98:10: warning: unused variable ‘len’ [-Wunused-variable] > int len; > ^~~ > > > Using gcc 7.4.1 on openSUSE Linux Leap 15.1 I'll add an #ifdef. -- f y cn rd ths thn y cn hv grt jb n cmptr prgrmmng /// 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. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/201912301117.xBUBHo9C027780%40masaka.moolenaar.net.
Patch 8.2.0059
Patch 8.2.0059 Problem:Compiler warnings for unused variables in small build. (Tony Mechelynck) Solution: Add #ifdef. Files: src/scriptfile.c *** ../vim-8.2.0058/src/scriptfile.c2019-12-29 23:52:58.585005552 +0100 --- src/scriptfile.c2019-12-30 10:55:05.848617132 +0100 *** *** 95,105 char_u * estack_sfile(void) { int len; int idx; - estack_T *entry; char *res; int done; entry = ((estack_T *)exestack.ga_data) + exestack.ga_len - 1; if (entry->es_name == NULL) --- 95,107 char_u * estack_sfile(void) { + estack_T *entry; + #ifdef FEAT_EVAL int len; int idx; char *res; int done; + #endif entry = ((estack_T *)exestack.ga_data) + exestack.ga_len - 1; if (entry->es_name == NULL) *** ../vim-8.2.0058/src/version.c 2019-12-30 00:07:52.877822159 +0100 --- src/version.c 2019-12-30 10:56:34.768315026 +0100 *** *** 744,745 --- 744,747 { /* Add new patch number below this line */ + /**/ + 59, /**/ -- ARTHUR:I command you as King of the Britons to stand aside! BLACK KNIGHT: I move for no man. The Quest for the Holy Grail (Monty Python) /// 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. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/201912301117.xBUBHoNX027774%40masaka.moolenaar.net.
Re: version8.txt wrongly says that :wsverb command was added in vim-8.2
Just noticed that :help patches gives version8.txt, which lists all the patch descriptions since 7.4.1, 6,600 of them, but stops at 8.1.2424; there's no list for the 50 or so 8.2 patches. Now, version8.txt has become unwieldy; at 1.6 MB it's by far the largest file in the repo, and github grumbles about it: (Sorry about that, but we can’t show files that are this big right now.) -- -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/5e64a916-5346-484c-a643-832925bc6508%40googlegroups.com.