Link failure if FEAT_PROP_POPUP is defined without FEAT_SPELL or FEAT_QUICKFIX
Hi All, mingw64 (gcc 11.3.0) link fails if FEAT_PROP_POPUP is defined but FEAT_QUICKFIX and FEAT_SPELL are not with this error message: gcc -I. -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 -DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -D__USE_MINGW_ANSI_STDIO -pipe -march=native -Wall -O3 -fomit-frame-pointer -freg-struct-return -fpie -fPIE -Wl,-nxcompat,-dynamicbase -municode -s -o vim.exe objnative/alloc.o objnative/arabic.o objnative/arglist.o objnative/autocmd.o objnative/beval.o objnative/blob.o objnative/blowfish.o objnative/buffer.o objnative/bufwrite.o objnative/change.o objnative/charset.o objnative/cindent.o objnative/clientserver.o objnative/clipboard.o objnative/cmdexpand.o objnative/cmdhist.o objnative/crypt.o objnative/crypt_zip.o objnative/debugger.o objnative/dict.o objnative/diff.o objnative/digraph.o objnative/drawline.o objnative/drawscreen.o objnative/edit.o objnative/eval.o objnative/evalbuffer.o objnative/evalfunc.o objnative/evalvars.o objnative/evalwindow.o objnative/ex_cmds.o objnative/ex_cmds2.o objnative/ex_docmd.o objnative/ex_eval.o objnative/ex_getln.o objnative/fileio.o objnative/filepath.o objnative/findfile.o objnative/float.o objnative/fold.o objnative/getchar.o objnative/gui_xim.o objnative/hardcopy.o objnative/hashtab.o objnative/help.o objnative/highlight.o objnative/if_cscope.o objnative/indent.o objnative/insexpand.o objnative/json.o objnative/list.o objnative/locale.o objnative/main.o objnative/map.o objnative/mark.o objnative/match.o objnative/memfile.o objnative/memline.o objnative/menu.o objnative/message.o objnative/misc1.o objnative/misc2.o objnative/mouse.o objnative/move.o objnative/mbyte.o objnative/normal.o objnative/ops.o objnative/option.o objnative/optionstr.o objnative/os_mswin.o objnative/os_win32.o objnative/pathdef.o objnative/popupmenu.o objnative/popupwin.o objnative/profiler.o objnative/quickfix.o objnative/regexp.o objnative/register.o objnative/scriptfile.o objnative/screen.o objnative/search.o objnative/session.o objnative/sha256.o objnative/sign.o objnative/spell.o objnative/spellfile.o objnative/spellsuggest.o objnative/strings.o objnative/syntax.o objnative/tag.o objnative/term.o objnative/testing.o objnative/textformat.o objnative/textobject.o objnative/textprop.o objnative/time.o objnative/typval.o objnative/ui.o objnative/undo.o objnative/usercmd.o objnative/userfunc.o objnative/version.o objnative/vim9cmds.o objnative/vim9compile.o objnative/vim9execute.o objnative/vim9expr.o objnative/vim9instr.o objnative/vim9script.o objnative/vim9type.o objnative/viminfo.o objnative/winclip.o objnative/window.o objnative/os_w32exe.o objnative/vimres.o objnative/xdiffi.o objnative/xemit.o objnative/xprepare.o objnative/xutils.o objnative/xhistogram.o objnative/xpatience.o objnative/iscygpty.o -lkernel32 -luser32 -lgdi32 -ladvapi32 -lcomdlg32 -lcomctl32 -lnetapi32 -lversion -lole32 -luuid d:/users/john/documents/software/mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: objnative/popupwin.o:popupwin.c:(.text+0xd96): undefined reference to `ml_append_buf' d:/users/john/documents/software/mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: objnative/popupwin.o:popupwin.c:(.text+0xdf5): undefined reference to `ml_append_buf' d:/users/john/documents/software/mingw/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/11.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: objnative/popupwin.o:popupwin.c:(.text+0xe4a): undefined reference to `ml_append_buf' collect2.exe: error: ld returned 1 exit status make: *** [Make_cyg_ming.mak:1107: vim.exe] Error 1 make: Target 'all' not remade because of errors. The attached patch seems to fix it. Cheers John -- -- 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/b6cd9081-20cc-34c2-8709-45229727c5dd%40internode.on.net. --- memline.c.orig 2022-04-16 05:45:42.822622300 +1000 +++ memline.c 2022-05-16 06:48:24.486973300 +1000 @@ -3361,7 +3361,7 @@ } -#if defined(FEAT_SPELL) || defined(FEAT_QUICKFIX) || defined(PROTO) +#if defined(FEAT_SPELL) || defined(FEAT_QUICKFIX) || defined(FEAT_PROP_POPUP) || defined(PROTO) /* * Like ml_append() but for an arbitrary buffer. The buffer must already have * a memline.
Patch 8.2.4960
Patch 8.2.4960 Problem:Text properties that cross line boundary are not correctly updated for a deleted line. Solution: Correct computing location of text property entry. (Paul Ollis, closes #10431, closes #10430) Files: src/memline.c, src/testdir/test_textprop.vim *** ../vim-8.2.4959/src/memline.c 2022-04-15 13:53:30.052708679 +0100 --- src/memline.c 2022-05-15 22:24:08.216227438 +0100 *** *** 3501,3508 #ifdef FEAT_PROP_POPUP /* * Adjust text properties in line "lnum" for a deleted line. ! * When "above" is true this is the line above the deleted line. ! * "del_props" are the properties of the deleted line. */ static void adjust_text_props_for_delete( --- 3501,3509 #ifdef FEAT_PROP_POPUP /* * Adjust text properties in line "lnum" for a deleted line. ! * When "above" is true this is the line above the deleted line, otherwise this ! * is the line below the deleted line. ! * "del_props[del_props_len]" are the properties of the deleted line. */ static void adjust_text_props_for_delete( *** *** 3569,3575 : TP_FLAG_CONT_PREV; textprop_T prop_this; ! mch_memmove(_this, text + textlen + done_del, sizeof(textprop_T)); if ((prop_this.tp_flags & flag) && prop_del.tp_id == prop_this.tp_id --- 3570,3576 : TP_FLAG_CONT_PREV; textprop_T prop_this; ! mch_memmove(_this, text + textlen + done_this, sizeof(textprop_T)); if ((prop_this.tp_flags & flag) && prop_del.tp_id == prop_this.tp_id *** *** 3577,3583 { found = TRUE; prop_this.tp_flags &= ~flag; ! mch_memmove(text + textlen + done_del, _this, sizeof(textprop_T)); break; } --- 3578,3584 { found = TRUE; prop_this.tp_flags &= ~flag; ! mch_memmove(text + textlen + done_this, _this, sizeof(textprop_T)); break; } *** ../vim-8.2.4959/src/testdir/test_textprop.vim 2022-05-15 13:07:58.366684986 +0100 --- src/testdir/test_textprop.vim 2022-05-15 22:23:43.248253327 +0100 *** *** 1645,1650 --- 1645,1701 bwipe! enddef + " This test is to detect a regression related to #10430. It is not an attempt + " fully cover deleting lines in the presence of multi-line properties. + def Test_delete_line_within_multiline_prop() + new + setline(1, '# Top.') + append(1, ['some_text = """', 'A string.', '"""', '# Bottom.']) + prop_type_add('Identifier', {'highlight': 'ModeMsg', 'priority': 0, 'combine': 0, 'start_incl': 0, 'end_incl': 0}) + prop_type_add('String', {'highlight': 'MoreMsg', 'priority': 0, 'combine': 0, 'start_incl': 0, 'end_incl': 0}) + prop_add(2, 1, {'type': 'Identifier', 'end_lnum': 2, 'end_col': 9}) + prop_add(2, 13, {'type': 'String', 'end_lnum': 4, 'end_col': 4}) + + # The property for line 3 should extend into the previous and next lines. + var props = prop_list(3) + var prop = props[0] + assert_equal(1, len(props)) + assert_equal(0, prop['start']) + assert_equal(0, prop['end']) + + # This deletion should run without raising an exception. + try + :2 del + catch + assert_report('Line delete should have workd, but it raised an error.') + endtry + + # The property for line 2 (was 3) should no longer extend into the previous + # line. + props = prop_list(2) + prop = props[0] + assert_equal(1, len(props)) + assert_equal(1, prop['start'], 'Property was not changed to start within the line.') + + # This deletion should run without raising an exception. + try + :3 del + catch + assert_report('Line delete should have workd, but it raised an error.') + endtry + + # The property for line 2 (originally 3) should no longer extend into the next + # line. + props = prop_list(2) + prop = props[0] + assert_equal(1, len(props)) + assert_equal(1, prop['end'], 'Property was not changed to end within the line.') + + prop_type_delete('Identifier') + prop_type_delete('String') + bwip! + enddef + func Test_prop_in_linebreak() CheckRunVimInTerminal *** ../vim-8.2.4959/src/version.c 2022-05-15 14:50:08.738042956 +0100 --- src/version.c 2022-05-15 22:22:14.592345742 +0100 *** *** 748,749 --- 748,751 { /* Add new patch number below this line */ + /**/ +
Capturing error messages on exit
Every now and then when I exit Vim, I see a few error messages at the bottom of the screen just before Vim terminates. Is there some way to capture those messages? Would using a VimLeave autocommand to write :messages to a file capture all messages? I tried putting a script wrapper around Vim, but it doesn't work for all use cases. I've noticed this only on my work PC, which means it could be either Windows gvim or Cygwin vim in a mintty terminal. 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. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/20220515210443.GB11054%40phoenix.
Patch 8.2.4959
Patch 8.2.4959 Problem:Using NULL regexp program. Solution: Check for regexp program becoming NULL in more places. Files: src/buffer.c, src/testdir/test_buffer.vim *** ../vim-8.2.4958/src/buffer.c2022-05-11 11:42:24.048585612 +0100 --- src/buffer.c2022-05-15 14:48:02.490143778 +0100 *** *** 2642,2654 if (*p == '^' && !(attempt & 1)) // add/remove '^' ++p; regmatch.regprog = vim_regcomp(p, magic_isset() ? RE_MAGIC : 0); - if (regmatch.regprog == NULL) - { - vim_free(pat); - return -1; - } FOR_ALL_BUFS_FROM_LAST(buf) if (buf->b_p_bl == find_listed #ifdef FEAT_DIFF && (!diffmode || diff_mode_buf(buf)) --- 2642,2656 if (*p == '^' && !(attempt & 1)) // add/remove '^' ++p; regmatch.regprog = vim_regcomp(p, magic_isset() ? RE_MAGIC : 0); FOR_ALL_BUFS_FROM_LAST(buf) + { + if (regmatch.regprog == NULL) + { + // invalid pattern, possibly after switching engine + vim_free(pat); + return -1; + } if (buf->b_p_bl == find_listed #ifdef FEAT_DIFF && (!diffmode || diff_mode_buf(buf)) *** *** 2674,2679 --- 2676,2682 } match = buf->b_fnum;// remember first match } + } vim_regfree(regmatch.regprog); if (match >= 0) // found one match *** *** 2766,2777 if (attempt > 0 && patc == pat) break; // there was no anchor, no need to try again regmatch.regprog = vim_regcomp(patc + attempt * 11, RE_MAGIC); - if (regmatch.regprog == NULL) - { - if (patc != pat) - vim_free(patc); - return FAIL; - } } // round == 1: Count the matches. --- 2769,2774 *** *** 2792,2798 --- 2789,2804 #endif if (!fuzzy) + { + if (regmatch.regprog == NULL) + { + // invalid pattern, possibly after recompiling + if (patc != pat) + vim_free(patc); + return FAIL; + } p = buflist_match(, buf, p_wic); + } else { p = NULL; *** *** 2921,2926 --- 2927,2933 /* * Check for a match on the file name for buffer "buf" with regprog "prog". + * Note that rmp->regprog may become NULL when switching regexp engine. */ static char_u * buflist_match( *** *** 2939,2945 } /* ! * Try matching the regexp in "prog" with file name "name". * Return "name" when there is a match, NULL when not. */ static char_u * --- 2946,2953 } /* ! * Try matching the regexp in "rmp->regprog" with file name "name". ! * Note that rmp->regprog may become NULL when switching regexp engine. * Return "name" when there is a match, NULL when not. */ static char_u * *** *** 2951,2957 char_u*match = NULL; char_u*p; ! if (name != NULL) { // Ignore case when 'fileignorecase' or the argument is set. rmp->rm_ic = p_fic || ignore_case; --- 2959,2966 char_u*match = NULL; char_u*p; ! // extra check for valid arguments ! if (name != NULL && rmp->regprog != NULL) { // Ignore case when 'fileignorecase' or the argument is set. rmp->rm_ic = p_fic || ignore_case; *** ../vim-8.2.4958/src/testdir/test_buffer.vim 2022-05-11 11:42:24.052585610 +0100 --- src/testdir/test_buffer.vim 2022-05-15 14:45:19.350273994 +0100 *** *** 419,424 --- 419,430 vsplit 00 silent! buf [0--]\&\zs*\zs*e bwipe! + + " similar case with different code path + split 0 + edit ÿ + silent! buf [0--]\&\zs*\zs*0 + bwipe! endfunc " Test for the 'maxmem' and 'maxmemtot' options *** ../vim-8.2.4958/src/version.c 2022-05-15 13:59:08.704167482 +0100 --- src/version.c 2022-05-15 14:49:14.386086360 +0100 *** *** 748,749 --- 748,751 { /* Add new patch number below this line */ + /**/ + 4959, /**/ -- $ echo pizza > /dev/oven /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\sponsor Vim, vote for features --
Patch 8.2.4958
Patch 8.2.4958 Problem:A couple conditions are always true. Solution: Remove the conditions. (Goc Dundar, closes #10428) Files: src/evalfunc.c, src/quickfix.c *** ../vim-8.2.4957/src/evalfunc.c 2022-05-09 14:12:10.712386673 +0100 --- src/evalfunc.c 2022-05-15 13:55:36.020293197 +0100 *** *** 9788,9830 } #ifdef FEAT_SPELL ! if (*curwin->w_s->b_p_spl != NUL) { ! str = tv_get_string([0]); ! if (argvars[1].v_type != VAR_UNKNOWN) { ! maxcount = (int)tv_get_number_chk([1], ); ! if (maxcount <= 0) return; - if (argvars[2].v_type != VAR_UNKNOWN) - { - need_capital = (int)tv_get_bool_chk([2], ); - if (typeerr) - return; - } } ! else ! maxcount = 25; ! spell_suggest_list(, str, maxcount, need_capital, FALSE); ! for (i = 0; i < ga.ga_len; ++i) ! { ! str = ((char_u **)ga.ga_data)[i]; ! li = listitem_alloc(); ! if (li == NULL) ! vim_free(str); ! else ! { ! li->li_tv.v_type = VAR_STRING; ! li->li_tv.v_lock = 0; ! li->li_tv.vval.v_string = str; ! list_append(rettv->vval.v_list, li); ! } } - ga_clear(); } curwin->w_p_spell = wo_spell_save; #endif } --- 9788,9827 } #ifdef FEAT_SPELL ! str = tv_get_string([0]); ! if (argvars[1].v_type != VAR_UNKNOWN) { ! maxcount = (int)tv_get_number_chk([1], ); ! if (maxcount <= 0) ! return; ! if (argvars[2].v_type != VAR_UNKNOWN) { ! need_capital = (int)tv_get_bool_chk([2], ); ! if (typeerr) return; } ! } ! else ! maxcount = 25; ! spell_suggest_list(, str, maxcount, need_capital, FALSE); ! for (i = 0; i < ga.ga_len; ++i) ! { ! str = ((char_u **)ga.ga_data)[i]; ! li = listitem_alloc(); ! if (li == NULL) ! vim_free(str); ! else ! { ! li->li_tv.v_type = VAR_STRING; ! li->li_tv.v_lock = 0; ! li->li_tv.vval.v_string = str; ! list_append(rettv->vval.v_list, li); } } + ga_clear(); curwin->w_p_spell = wo_spell_save; #endif } *** ../vim-8.2.4957/src/quickfix.c 2022-04-15 13:53:30.052708679 +0100 --- src/quickfix.c 2022-05-15 13:57:42.356181713 +0100 *** *** 2494,2500 // store directory on the stack if (vim_isAbsName(dirbuf) || (*stackptr)->next == NULL ! || (*stackptr && is_file_stack)) (*stackptr)->dirname = vim_strsave(dirbuf); else { --- 2494,2500 // store directory on the stack if (vim_isAbsName(dirbuf) || (*stackptr)->next == NULL ! || is_file_stack) (*stackptr)->dirname = vim_strsave(dirbuf); else { *** ../vim-8.2.4957/src/version.c 2022-05-15 13:07:58.366684986 +0100 --- src/version.c 2022-05-15 13:56:37.960238583 +0100 *** *** 748,749 --- 748,751 { /* Add new patch number below this line */ + /**/ + 4958, /**/ -- panic("Fod fight!"); -- In the kernel source aha1542.c, after detecting a bad segment list /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\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/20220515130024.9C8E91C076B%40moolenaar.net.
Patch 8.2.4957
Patch 8.2.4957 Problem:Text properties in a wrong position after a block change. Solution: Adjust the properties columns. (closes #10427) Files: src/ops.c, src/testdir/test_textprop.vim *** ../vim-8.2.4956/src/ops.c 2022-05-14 11:52:19.205341190 +0100 --- src/ops.c 2022-05-15 13:04:10.262911144 +0100 *** *** 1814,1819 --- 1814,1825 oldp += bd.textcol; STRMOVE(newp + offset, oldp); ml_replace(linenr, newp, FALSE); + #ifdef FEAT_PROP_POPUP + // Shift the properties for linenr as edit() would do. + if (curbuf->b_has_textprop) + adjust_prop_columns(linenr, bd.textcol, +vpos.coladd + ins_len, 0); + #endif } } check_cursor(); *** ../vim-8.2.4956/src/testdir/test_textprop.vim 2022-05-14 18:47:58.807259718 +0100 --- src/testdir/test_textprop.vim 2022-05-15 13:07:48.026695212 +0100 *** *** 2003,2006 --- 2003,2039 bwipe! endfunc + func Test_prop_blockwise_change() + new + call AddPropTypes() + + call setline(1, ['foo', 'bar', 'bz']) + call prop_add(1, 1, #{end_col: 3, type: 'one'}) + call prop_add(2, 1, #{end_col: 3, type: 'two'}) + call prop_add(3, 1, #{end_col: 3, type: 'three'}) + + " Replace the first two columns with '123', since 'start_incl' is false the + " prop is not extended. + call feedkeys("gg\2jc123\", 'nxt') + + let lines =<< trim END + 123oo + 123ar + 123z + END + call assert_equal(lines, getline(1, '$')) + let expected = [ + \ {'lnum': 1, 'id': 0, 'col': 4, 'type_bufnr': 0, 'end': 1, 'type': 'one', + \ 'length': 1, 'start': 1}, + \ {'lnum': 2, 'id': 0, 'col': 4, 'type_bufnr': 0, 'end': 1, 'type': 'two', + \ 'length': 1, 'start': 1}, + \ {'lnum': 3, 'id': 0, 'col': 4, 'type_bufnr': 0, 'end': 1 , + \ 'type': 'three', 'length': 1, 'start': 1} + \ ] + call assert_equal(expected, prop_list(1, #{end_lnum: 10})) + + call DeletePropTypes() + bwipe! + endfunc + " vim: shiftwidth=2 sts=2 expandtab *** ../vim-8.2.4956/src/version.c 2022-05-14 21:29:40.665782815 +0100 --- src/version.c 2022-05-15 13:06:04.546797716 +0100 *** *** 748,749 --- 748,751 { /* Add new patch number below this line */ + /**/ + 4957, /**/ -- Spam seems to be something useful to novices. Later you realize that it's a bunch of indigestable junk that only clogs your system. Applies to both the food and the e-mail! /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\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/20220515121200.4367F1C076B%40moolenaar.net.