To: vim_dev@googlegroups.com Subject: Patch 9.0.0188 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.0188 Problem: Strange effects when using virtual text with "text_align" and non-zero column. (Martin Tournoij) Solution: Give an error. (closes #10888) Files: src/textprop.c, src/errors.h, src/testdir/test_textprop.vim *** ../vim-9.0.0187/src/textprop.c 2022-08-08 17:08:01.991471067 +0100 --- src/textprop.c 2022-08-10 19:41:37.178725183 +0100 *************** *** 488,493 **** --- 488,498 ---- if (p == NULL) goto theend; + if (start_col != 0) + { + emsg(_(e_can_only_use_text_align_when_column_is_zero)); + goto theend; + } if (STRCMP(p, "right") == 0) flags |= TP_FLAG_ALIGN_RIGHT; else if (STRCMP(p, "below") == 0) *** ../vim-9.0.0187/src/errors.h 2022-08-06 18:12:02.962750601 +0100 --- src/errors.h 2022-08-10 19:41:38.530722082 +0100 *************** *** 3313,3316 **** --- 3313,3318 ---- #ifdef FEAT_PROP_POPUP EXTERN char e_cannot_use_negative_id_after_adding_textprop_with_text[] INIT(= N_("E1293: Cannot use a negative id after adding a textprop with text")); + EXTERN char e_can_only_use_text_align_when_column_is_zero[] + INIT(= N_("E1294: Can only use text_align when column is zero")); #endif *** ../vim-9.0.0187/src/testdir/test_textprop.vim 2022-08-10 16:48:59.395127789 +0100 --- src/testdir/test_textprop.vim 2022-08-10 19:50:06.097959941 +0100 *************** *** 2530,2535 **** --- 2530,2537 ---- call StopVimInTerminal(buf) call delete('XscriptPropsWithTextAfter') + + call assert_fails('call prop_add(1, 2, #{text: "yes", text_align: "right", type: "some"})', 'E1294:') endfunc func Test_props_with_text_after_below_trunc() *** ../vim-9.0.0187/src/version.c 2022-08-10 17:23:08.983907034 +0100 --- src/version.c 2022-08-10 19:43:24.422556981 +0100 *************** *** 737,738 **** --- 737,740 ---- { /* Add new patch number below this line */ + /**/ + 188, /**/ -- Facepalm statement #7: "Last week I almost got pregnant!" /// Bram Moolenaar -- Bram@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 ///