To: vim_dev@googlegroups.com Subject: Patch 8.1.2181 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.2181 Problem: Highlighting wrong when item follows tab. Solution: Don't use syntax attribute when n_extra is non-zero. (Christian Brabandt, closes #5076) Files: src/drawline.c, src/feature.h, src/testdir/dumps/Test_syntax_c_01.dump *** ../vim-8.1.2180/src/drawline.c 2019-10-18 23:12:16.655427705 +0200 --- src/drawline.c 2019-10-19 17:33:15.693394335 +0200 *************** *** 1399,1412 **** } #endif ! if (extra_check) { ! #ifdef FEAT_TERMINAL if (get_term_attr) syntax_attr = term_get_attr(wp->w_buffer, lnum, vcol); ! #endif ! ! #ifdef FEAT_SYN_HL // Get syntax attribute. if (has_syntax) { --- 1399,1412 ---- } #endif ! #ifdef FEAT_SYN_HL ! syntax_attr = 0; ! if (extra_check && n_extra == 0) { ! # ifdef FEAT_TERMINAL if (get_term_attr) syntax_attr = term_get_attr(wp->w_buffer, lnum, vcol); ! # endif // Get syntax attribute. if (has_syntax) { *************** *** 1463,1470 **** syntax_flags = get_syntax_info(&syntax_seqnr); # endif } - #endif } // Decide which of the highlight attributes to use. attr_pri = TRUE; --- 1463,1470 ---- syntax_flags = get_syntax_info(&syntax_seqnr); # endif } } + #endif // Decide which of the highlight attributes to use. attr_pri = TRUE; *************** *** 1502,1508 **** // Use line_attr when not in the Visual or 'incsearch' area // (area_attr may be 0 when "noinvcur" is set). # ifdef FEAT_SYN_HL ! if (has_syntax) char_attr = hl_combine_attr(syntax_attr, line_attr); else # endif --- 1502,1508 ---- // Use line_attr when not in the Visual or 'incsearch' area // (area_attr may be 0 when "noinvcur" is set). # ifdef FEAT_SYN_HL ! if (syntax_attr != 0) char_attr = hl_combine_attr(syntax_attr, line_attr); else # endif *************** *** 1531,1545 **** else #endif #ifdef FEAT_SYN_HL ! if (has_syntax ! # ifdef FEAT_TERMINAL ! || get_term_attr ! # endif ! ) ! char_attr = syntax_attr; ! else ! #endif char_attr = 0; } } if (char_attr == 0) --- 1531,1540 ---- else #endif #ifdef FEAT_SYN_HL ! char_attr = syntax_attr; ! #else char_attr = 0; + #endif } } if (char_attr == 0) *** ../vim-8.1.2180/src/feature.h 2019-10-17 22:58:59.058497036 +0200 --- src/feature.h 2019-10-19 17:31:36.809788705 +0200 *************** *** 430,447 **** #endif /* - * +textprop Text properties and popup windows - */ - #if defined(FEAT_EVAL) && defined(FEAT_SYN_HL) - # define FEAT_TEXT_PROP - #endif - - #if defined(FEAT_SYN_HL) && defined(FEAT_RELTIME) - // Can limit syntax highlight time to 'redrawtime'. - # define SYN_TIME_LIMIT 1 - #endif - - /* * +spell spell checking * * Disabled for EBCDIC: * Doesn't work (SIGSEGV). --- 430,435 ---- *************** *** 1119,1128 **** # define FEAT_ARP #endif - /* - * +GUI_Athena To compile Vim with or without the GUI (gvim) you have - * +GUI_Motif to edit the Makefile. - */ /* * +ole Win32 OLE automation: Use Makefile.ovc. --- 1107,1112 ---- *************** *** 1138,1143 **** --- 1122,1129 ---- * +tcl TCL interface: "--enable-tclinterp" * +netbeans_intg Netbeans integration * +channel Inter process communication + * +GUI_Athena Athena GUI + * +GUI_Motif Motif GUI */ /* *************** *** 1170,1175 **** --- 1156,1178 ---- #if defined(FEAT_TERMINAL) && !defined(CURSOR_SHAPE) # define CURSOR_SHAPE #endif + #if defined(FEAT_TERMINAL) && !defined(FEAT_SYN_HL) + // simplify the code a bit by enabling +syntax when +terminal is enabled + # define FEAT_SYN_HL + #endif + + /* + * +textprop Text properties and popup windows + */ + #if defined(FEAT_EVAL) && defined(FEAT_SYN_HL) + # define FEAT_TEXT_PROP + #endif + + #if defined(FEAT_SYN_HL) && defined(FEAT_RELTIME) + // Can limit syntax highlight time to 'redrawtime'. + # define SYN_TIME_LIMIT 1 + #endif + /* * +signs Allow signs to be displayed to the left of text lines. *** ../vim-8.1.2180/src/testdir/dumps/Test_syntax_c_01.dump 2019-10-18 23:12:16.659427687 +0200 --- src/testdir/dumps/Test_syntax_c_01.dump 2019-10-19 17:15:50.529370140 +0200 *************** *** 12,20 **** |}| @73 @3|s+0#00e0003&|t|a|t|i|c| +0#0000000&|v+0#00e0003&|o|i|d| +0#0000000&@60 |m|y|F|u|n|c|t|i|o|n|(|c+0#00e0003&|o|n|s|t| +0#0000000&|d+0#00e0003&|o|u|b|l|e| +0#0000000&|c|o|u|n|t|,| |s+0#00e0003&|t|r|u|c|t| +0#0000000&|n|o|t|h|i|n|g|,| |l+0#00e0003&|o|n|g| +0#0000000&|t|h|e|r|e|)| |{| @14 ! @1| +0#0000e05&@6|/@1| |1+0#e000002&|2|3|:+0#0000e05&| |n|o|t|h|i|n|g| |t|o| |e+0&#ffff4012|n|d|i|f| +0&#ffffff0|h|e|r|e| +0#0000000&@37 ! @1| +0#af5f00255&@6|f|o|r| +0#0000000&|(|i+0#00e0003&|n|t| +0#0000000&|i| |=| |0+0#e000002&|;+0#0000000&| |i| |<| |c|o|u|n|t|;| |+@1|i|)| |{| @33 @11|b+0#af5f00255&|r|e|a|k|;+0#0000000&| @57 @8|}| @65 |}| @73 ! |-+2&&@1| |V|I|S|U|A|L| |-@1| +0&&@34|2| @8|1|0|,|3|7| @8|A|l@1| --- 12,22 ---- |}| @73 @3|s+0#00e0003&|t|a|t|i|c| +0#0000000&|v+0#00e0003&|o|i|d| +0#0000000&@60 |m|y|F|u|n|c|t|i|o|n|(|c+0#00e0003&|o|n|s|t| +0#0000000&|d+0#00e0003&|o|u|b|l|e| +0#0000000&|c|o|u|n|t|,| |s+0#00e0003&|t|r|u|c|t| +0#0000000&|n|o|t|h|i|n|g|,| |l+0#00e0003&|o|n|g| +0#0000000&|t|h|e|r|e|)| |{| @14 ! @8|/+0#0000e05&@1| |1+0#e000002&|2|3|:+0#0000e05&| |n|o|t|h|i|n|g| |t|o| |e+0&#ffff4012|n|d|i|f| +0&#ffffff0|h|e|r|e| +0#0000000&@37 ! @8|f+0#af5f00255&|o|r| +0#0000000&|(|i+0#00e0003&|n|t| +0#0000000&|i| |=| |0+0#e000002&|;+0#0000000&| |i| |<| |c|o|u|n|t|;| |+@1|i|)| |{| @33 @11|b+0#af5f00255&|r|e|a|k|;+0#0000000&| @57 @8|}| @65 + @8|N+0&#ffff4012|o|t|e|:+0&#ffffff0| |a|s|d|f| @56 |}| @73 ! |~+0#4040ff13&| @73 ! |-+2#0000000&@1| |V|I|S|U|A|L| |-@1| +0&&@34|2| @8|1|0|,|3|7| @8|A|l@1| *** ../vim-8.1.2180/src/version.c 2019-10-19 17:01:23.468526550 +0200 --- src/version.c 2019-10-19 17:18:45.812726613 +0200 *************** *** 743,744 **** --- 743,746 ---- { /* Add new patch number below this line */ + /**/ + 2181, /**/ -- Clothes make the man. Naked people have little or no influence on society. -- Mark Twain (Samuel Clemens) (1835-1910) /// Bram Moolenaar -- Bram@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 ///