summaryrefslogtreecommitdiffstats
path: root/src/drawline.c
AgeCommit message (Collapse)Author
2024-03-20patch 9.1.0189: Memory leak with "above" virttext and 'relativenumber'v9.1.0189zeertzjq
Problem: Memory leak with "above" virtual text and 'relativenumber'. Solution: Free "text_props" and "text_prop_idxs" before returning. Also fix off-by-one error causing line number to be drawn beyond end of window (zeertzjq). fixes: #14239 closes: #14241 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-17patch 9.1.0186: cursor pos wrong on mouse click after eol with 'rl', 've' ↵v9.1.0186zeertzjq
and conceal Problem: Wrong cursor position when clicking after end of line with 'rightleft', 'virtualedit' and conceal. Solution: Set values in ScreenCols[] also with SLF_RIGHTLEFT. Also fix off-by-one cursor position with 'colorcolumn' (zeertzjq). closes: #14218 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-17patch 9.1.0185: 'wincolor' hl missing with 'rightleft', "below" virttext, ↵v9.1.0185zeertzjq
'nowrap' Problem: 'wincolor' highlight missing with 'rightleft', "below" virtual text and 'nowrap'. Solution: Handle 'rightleft' in draw_screen_line() (zeertzjq). closes: #14216 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-16patch 9.1.0184: Cursor pos wrong when clicking with conceal and wrapv9.1.0184zeertzjq
Problem: Cursor position wrong when clicking with conceal and wrap. Solution: Use the virtual column of the last char for ScreenCols[] in boguscols. Remove use of MAXCOL in ScreenCols[]. Rename third argument of wlv_screen_line() to "clear_end" as that's clearer what it does (zeertzjq). related: 14192 closes: #14200 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-14patch 9.1.0180: Cursor pos wrong when double-width chars are concealedv9.1.0180zeertzjq
Problem: Cursor pos wrong when double-width chars are concealed. Solution: Advance one more virtual column for a double-width char. Run some tests with both 'wrap' and 'nowrap' (zeertzjq). closes: #14197 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-14patch 9.1.0179: 'wincolor' highlight missing with "below" virtual textv9.1.0179zeertzjq
Problem: 'wincolor' highlight missing with "below" virtual text. Solution: Subtract n_attr_skip from n_attr. Combine 'wincolor' with other highlights when 'nowrap' is set. (zeertzjq) closes: #14196 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-13patch 9.1.0176: Cursor column wrong with 'virtualedit' and concealv9.1.0176zeertzjq
Problem: Cursor column wrong with 'virtualedit' and conceal. Solution: Correct cursor column at end of line if never reached. (zeertzjq) closes: #14190 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-13patch 9.1.0174: 'cursorline' and 'wincolor' hl missing with conceal and wrapv9.1.0174zeertzjq
Problem: 'cursorline' and 'wincolor' highlight missing with concealed and wrapped lines. Solution: Apply 'cursorline' and 'wincolor' highlight to boguscols. (zeertzjq) Since 'cursorline' and 'wincolor' highlight apply after the end of the line, it is more consistent to have them also apply to boguscols. Assigning MAXCOL to values in ScreenCols[] make mouse click behave the same with 'cursorline' and 'nocursorline', but such behavior may be incorrect, as it puts the cursor on the next screen line. That may be fixed in a future PR. closes: #14192 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-03-12patch 9.1.0172: More code can use ml_get_buf_len() instead of STRLEN()v9.1.0172zeertzjq
Problem: More code can use ml_get_buf_len() instead of STRLEN(). Solution: Change more STRLEN() calls to ml_get_buf_len(). Also do not set ml_line_textlen in ml_replace_len() if "has_props" is set, because "len_arg" also includes the size of text properties in that case. (zeertzjq) closes: #14183 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-24patch 9.1.0129: Fix truncation of text_wrap 'wrap' virt text after EOL list charv9.1.0129Dylan Thacker-Smith
Problem: Virtual text with text_wrap 'wrap' was effectively being truncated by a break conditional on the EOL list character being added to the screen line. (BigPeet) Solution: Remove the condition that was leading to the early break and instead fix a similar but incorrectly written outer condition that checks if there is more to add at the end of the screen line. (Dylan Thacker-Smith) Also, related: - update comment in win_line() - remove no longer necessary at_end_str variable in win_line() fixes: #12725 closes: #14079 Co-authored-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Dylan Thacker-Smith <dylan.ah.smith@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-21patch 9.1.0125: unused init of text_prop_idxs in win_line()v9.1.0125Dylan Thacker-Smith
Problem: unused init of text_prop_idxs in win_line Solution: Remove it, fix typo (Dylan Thacker-Smith) Later use of text_prop_idxs treats it as empty, incrementing text_props_active as new elements are added to this array, so remove this unused conditional initialization when text_props_active is 0. closes: #14063 Signed-off-by: Dylan Thacker-Smith <dylan.ah.smith@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-09patch 9.1.0084: Visual hl wrong when it ends before multibyte 'showbreak'v9.1.0084zeertzjq
Problem: Visual hl wrong when it ends before multibyte 'showbreak'. (lacygoil) Solution: Use vcol_sbr instead of adding n_extra. (zeertzjq) fixes: #11272 closes: #13996 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-02-06patch 9.1.0079: LineNrAbove/Below highlighting wrong on wrapped linesv9.1.0079zeertzjq
Problem: LineNrAbove and LineNrBelow background wrong on wrapped lines. Solution: Update number column also for wrapped part of a line. (zeertzjq) closes: #13974 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2024-01-23patch 9.1.0047: issues with temp curwin/buf while cmdwin is openv9.1.0047Sean Dewar
Problem: Things that temporarily change/restore curwin/buf (e.g: win_execute, some autocmds) may break assumptions that curwin/buf is the cmdwin when "cmdwin_type != 0", causing issues. Solution: Expose the cmdwin's real win/buf and check that instead. Also try to ensure these variables are NULL if "cmdwin_type == 0", allowing them to be used directly in most cases without checking cmdwin_type. (Sean Dewar) Alternatively, we could ban win_execute in the cmdwin and audit all places that temporarily change/restore curwin/buf, but I didn't notice any problems arising from allowing this (standard cmdwin restrictions still apply, so things that may actually break the cmdwin are still forbidden). closes: #12819 Signed-off-by: Sean Dewar <seandewar@users.noreply.github.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-12-28patch 9.0.2189: Wrong display with 'briopt=sbr' and 'nobreakindent'v9.0.2189zeertzjq
Problem: Wrong display when 'breakindentopt' contains "sbr" and 'showbreak' and 'nobreakindent' are set. Solution: Always reset wlv->need_showbreak regardless of the values of 'breakindent' and 'showbreak', as they aren't checked when setting wlv->need_showbreak (zeertzjq) closes: #13785 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-12-27patch 9.0.2187: Visual not drawn with 'breakindent' when line doesn't fitv9.0.2187zeertzjq
Problem: Visual selection isn't drawn with 'breakindent' when the line doesn't fit in the window (Jaehwang Jung) Solution: Adjust wlv->fromcol also for 'breakindent' (zeertzjq) closes: #13767 closes: #13768 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-12-05patch 9.0.2151: 'breakindent' is not drawn after diff filler linesv9.0.2151zeertzjq
Problem: 'breakindent' is not drawn after diff filler lines. Solution: Correct check for whether 'breakindent' should be drawn. closes: #13624 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-12-03patch 9.0.2144: Text properties causes wrong line wrappingv9.0.2144zeertzjq
Problem: Text properties causes wrong line wrapping to be drawn. Solution: Find the index of the last text property that inserts text. closes: #13611 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-10-11patch 9.0.2017: linebreak applies for leading whitespacev9.0.2017Christian Brabandt
Problem: linebreak applies for leading whitespace Solution: only apply linebreak, once we have found non-breakat chars in the line closes: #13228 closes: #13243 Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-09-24patch 9.0.1938: multispace wrong when scrolling horizontallyv9.0.1938zeertzjq
Problem: multispace wrong when scrolling horizontally Solution: Update position in "multispace" or "leadmultispace" also in skipped chars. Reorder conditions to be more consistent. closes: #13145 closes: #13147 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-09-21patch 9.0.1923: curswant wrong on click with 've' and 'wrap' setv9.0.1923zeertzjq
Problem: curswant wrong on click with 've' and 'wrap' set Solution: Add w_leftcol to mouse click column. closes: #13142 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-09-11patch 9.0.1896: "below" virtual text doesn't work with 'rightleft'v9.0.1896zeertzjq
Problem: "below" virtual text doesn't work with 'rightleft'. Solution: Use column from right border with 'rightleft'. closes: #13071 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-09-02patch 9.0.1851: breakindent missing by virt textv9.0.1851zeertzjq
Problem: Virtual text at a column causes 'breakindent' and 'showbreak' to be missing (after patch 9.0.1124). Solution: Add check for "tp_col" in another place where TP_FLAG_WRAP is checked. closes: #12769 closes: #13008 closes: #13010 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-09-01patch 9.0.1836: display wrong with virttext, linebreak and breakindentv9.0.1836zeertzjq
Problem: Wrong display with "above" virtual text and 'linebreak' or 'breakindent' and 'showbreak'. Solution: Exclude size of "above" virtual text when calculating them. closes: #13000 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-28patch 9.0.1813: linebreak incorrect drawn with breakindentv9.0.1813zeertzjq
Problem: 'linebreak' is incorrectly drawn after 'breakindent'. Solution: Don't include 'breakindent' size when already after it. closes: #12937 closes: #12940 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-27patch 9.0.1800: Cursor position still wrong with 'showbreak' and virtual textv9.0.1800zeertzjq
Problem: Cursor position still wrong with 'showbreak' and virtual text after last character or 'listchars' "eol". Solution: Remove unnecessary w_wcol adjustment in curs_columns(). Also fix first char of virtual text not shown at the start of a screen line. closes: #12478 closes: #12532 closes: #12904 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-22patch 9.0.1783: Display issues with virt text smoothscroll and showbreakv9.0.1783zeertzjq
Problem: Wrong display with wrapping virtual text or unprintable chars, 'showbreak' and 'smoothscroll'. Solution: Don't skip cells taken by 'showbreak' in screen lines before "w_skipcol". Combined "n_skip" and "skip_cells". closes: #12597 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-20patch 9.0.1759: Visual highlight not working with cursor at end of screen linev9.0.1759zeertzjq
Problem: Visual highlight not working with cursor at end of screen line and 'showbreak'. Solution: Only update "vcol_prev" when drawing buffer text. closes: #12865 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-19patch 9.0.1756: failing cursorline sign testv9.0.1756Christian Brabandt
Problem: failing cursorline sign test Solution: only reset char attr, if cursorline option is not set Unfortunately, commit dbeadf05b6a152e7d9c5cc23d9202057f8e99884 causes a failure with the sign test Test_sign_cursor_position() The root cause is, that resetting the character attribute will also reset the existing cursor line highlighting and this breaks the test, that expects the cursor line highlighting to overrule the sign line highlighting. So change the condition to reset the character attribute by making sure that this only happens, if the 'cursorline' option is not active and the cursor is not at the same line as the line to be drawn closes: #12854 closes: #12859 Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-19patch 9.0.1749: Text property highlight doesn't override a sign highlight on TABv9.0.1749Christian Brabandt
Problem: Text property highlight doesn't override a sign highlight over a tab character Solution: Let text_property override tab highlighting This fixes a few problems of text properties: - text property highlighting when override=true does not overwrite TAB highlighting - text property highlighting when override=true does not overwrite TAB highlighting with :set list - text property highlighting is used instead of sign highlight after the actual text ends when signs are present with linehl is set closes: #21584 closes: #21592 Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-08-17patch 9.0.1731: blockwise Visual highlight not working with virtual textv9.0.1731zeertzjq
Problem: blockwise Visual highlight not working with virtual text Solution: Reset the correct variable at the end of virtual selection and Check for double-width char inside virtual text. closes: #12606 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-17patch 9.0.1725: cursor pos wrong after concealed text with 'virtualedit'v9.0.1725zeertzjq
Problem: Wrong cursor position when clicking after concealed text with 'virtualedit'. Solution: Store virtual columns in ScreenCols[] instead of text columns, and always use coladvance() when clicking. This also fixes incorrect curswant when clicking on a TAB, so now Test_normal_click_on_ctrl_char() asserts the same results as the ones before patch 9.0.0048. closes: #12808 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-13patch 9.0.1705: cursor position wrong when clicking on an unprintable charv9.0.1705zeertzjq
Problem: cursor position wrong when clicking on an unprintable char Solution: Don't update prev_ptr when wlv.n_extra is not zero. closes: #12664 Signed-off-by: Christian Brabandt <cb@256bit.org> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2023-08-12patch 9.0.1695: Crash with overlong textprop abovev9.0.1695Christian Brabandt
Problem: Crash with overlong textprop above Solution: Consider only positive padding closes: #12665 closes: #12661 Signed-off-by: Christian Brabandt <cb@256bit.org>
2023-06-10patch 9.0.1626: Visual area not shown when using 'showbreak'v9.0.1626Bram Moolenaar
Problem: Visual area not shown when using 'showbreak' and start of line is not visible. (Jaehwang Jung) Solution: Adjust "fromcol" for the space taken by 'showbreak'. (closes #12514)
2023-06-04patch 9.0.1606: using freed memory when 'foldcolumn' is setv9.0.1606zeertzjq
Problem: Using freed memory when 'foldcolumn' is set. Solution: Save extra pointer to free it later. (closes #12492)
2023-06-03patch 9.0.1602: stray character visible if marker on top of double-wide charv9.0.1602zeertzjq
Problem: Stray character is visible if 'smoothscroll' marker is displayed on top of a double-wide character. Solution: When overwriting a double-width character with the 'smoothscroll' marker clear the second half. (closes #12469)
2023-05-31patch 9.0.1595: line pointer becomes invalid when using spell checkingv9.0.1595Luuk van Baal
Problem: Line pointer becomes invalid when using spell checking. Solution: Call ml_get() at the right places. (Luuk van Baal, closes #12456)
2023-05-27patch 9.0.1585: weird use of static variables for spell checkingv9.0.1585Luuk van Baal
Problem: Weird use of static variables for spell checking. Solution: Move the variables to a structure and pass them from win_update() to win_line(). (Luuk van Baal, closes #12448)
2023-05-25patch 9.0.1578: SpellCap highlight not always updated when neededv9.0.1578Luuk van Baal
Problem: SpellCap highlight not always updated when needed. Solution: Handle updating line below closed fold and other situations where only part of the window is redrawn. (Luuk van Baal, closes #12428, closes #12420)
2023-05-02patch 9.0.1506: line number not displayed when using 'smoothscroll'v9.0.1506zeertzjq
Problem: Line number not displayed when using 'smoothscroll'. Solution: Adjust condition for showing the line number. (closes #12333)
2023-04-23patch 9.0.1482: crash when textprop has a very large "padding" valuev9.0.1482Bram Moolenaar
Problem: Crash when textprop has a very large "padding" value. (Yegappan Lakshmanan) Solution: Avoid the "after" count to go negative.
2023-04-17patch 9.0.1463: virtual text truncation only works with Unicode 'encoding'v9.0.1463h-east
Problem: Virtual text truncation only works with Unicode 'encoding'. Solution: Convert the ellipsis character to 'encoding' if needed. (Hirohito Higashi, closes #12233)
2023-03-02patch 9.0.1373: wrong text displayed when using both 'linebreak' and 'list'v9.0.1373h-east
Problem: Wrong text displayed when using both 'linebreak' and 'list'. Solution: Only set "c_extra" to NUL when "p_extra" is not empty. (Hirohito Higashi, closes #12065)
2023-02-19patch 9.0.1326: relative line number not updated with virtual text abovev9.0.1326Bram Moolenaar
Problem: Relative line number not updated with virtual text above. Solution: Adjust the row for the line number for virtual text above. (closes #12004)
2023-02-19patch 9.0.1325: 'colorcolumn' highlight wrong with virtual text abovev9.0.1325Bram Moolenaar
Problem: 'colorcolumn' highlight wrong with virtual text above. Solution: Adjust column of 'colorcolumn' for text propertly. (closes #12004)
2023-02-12patch 9.0.1304: "$" for 'list' option displayed in wrong positionv9.0.1304Bram Moolenaar
Problem: "$" for 'list' option displayed in wrong position when there are text properties. Solution: Adjust logic for order of displayed items. (closes #11959)
2023-02-11patch 9.0.1301: virtual text below empty line not displayedv9.0.1301Bram Moolenaar
Problem: Virtual text below empty line not displayed. Solution: Adjust flags and computations. (closes #11959)
2023-01-21patch 9.0.1226: spurious empty line when using text propertiesv9.0.1226Bram Moolenaar
Problem: Spurious empty line when using text propertie and virtual text. Solution: Do not set "text_prop_follows" when the other text property is not virtual text. (closes #11846)
2023-01-04patch 9.0.1141: 'cursorcolumn' and 'colorcolumn' wrong after concealingv9.0.1141Alexey Radkov
Problem: 'cursorcolumn' and 'colorcolumn' wrong after concealing and wrapping line. Solution: Reset "wlv.vcol_off" after each screen line. (Alexey Radkov, closes #11777)