[vim/vim] Fix truncation of text_wrap 'wrap' virtual text after EOL list char (PR #14079)

19 views
Skip to first unread message

Dylan Thacker-Smith

unread,
Feb 22, 2024, 4:42:25 PMFeb 22
to vim/vim, Subscribed

Fixes: #12725

As mentioned in #12725 (comment), the problem was with that || lcs_eol_one == -1 break condition.

It looks like that condition was compensating for an incorrect outer wlv.p_extra != at_end_str that intended to check if the EOL character hadn't been added to the screen line, but that would evaluate to true because when wlv.p_extra is updated to the end of the string without being set to at_end_str, such as when the virtual text has been truncated by text_prop_position and the truncated text as finished being added to the screen line. The inner lcs_eol_one == -1 was compensating for this for the truncation case, but then caused problems for the cause where truncation of the virtual text shouldn't happen. So I moved that problematic inner condition and used it to replace the incorrect outer condition.


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/14079

Commit Summary

  • 1a7a9bc Fix truncation of text_wrap 'wrap' virtual text after EOL list char

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14079@github.com>

zeertzjq

unread,
Feb 22, 2024, 7:50:08 PMFeb 22
to vim/vim, Subscribed

@zeertzjq commented on this pull request.


In src/drawline.c:

> -						&& wlv.p_extra != at_end_str)
+						&& lcs_eol_one != -1)

This makes the at_end_str variable no longer necessary, as it is now only used once in wlv.p_extra = at_end_str, which can now be changed to just wlv.p_extra = "".


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14079/review/1897227547@github.com>

zeertzjq

unread,
Feb 22, 2024, 7:58:01 PMFeb 22
to vim/vim, Subscribed

@zeertzjq commented on this pull request.


In src/drawline.c:

>  	    // When not wrapping and finished diff lines, or when displayed
 	    // '$' and highlighting until last column, break here.
⬇️ Suggested change
-	    // When not wrapping and finished diff lines, or when displayed
-	    // '$' and highlighting until last column, break here.
+	    // When not wrapping and finished diff lines, break here.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14079/review/1897242237@github.com>

Dylan Thacker-Smith

unread,
Feb 23, 2024, 10:30:57 AMFeb 23
to vim/vim, Push

@dylanahsmith pushed 1 commit.

  • f81c3b8 Update comment in src/drawline.c


View it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14079/push/17234171387@github.com>

Dylan Thacker-Smith

unread,
Feb 23, 2024, 10:34:30 AMFeb 23
to vim/vim, Push

@dylanahsmith pushed 1 commit.

  • 9889a23 Remove no longer necessary at_end_str variable.


View it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14079/push/17234230917@github.com>

Dylan Thacker-Smith

unread,
Feb 23, 2024, 10:51:03 AMFeb 23
to vim/vim, Push

@dylanahsmith pushed 1 commit.

  • a38c620 Remove no longer necessary at_end_str variable.


View it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14079/push/17234494763@github.com>

Christian Brabandt

unread,
Feb 24, 2024, 4:12:20 AMFeb 24
to vim/vim, Subscribed

thanks, makes sense.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14079/c1962306467@github.com>

Christian Brabandt

unread,
Feb 24, 2024, 4:19:51 AMFeb 24
to vim/vim, Subscribed

Closed #14079 via f548ae7.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/14079/issue_event/11910413022@github.com>

Reply all
Reply to author
Forward
0 new messages