Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix wrong tablen with above virtual text #14178

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Conversation

julio-b
Copy link
Contributor

@julio-b julio-b commented Mar 11, 2024

First tab is not calculated correctly with above virtual text. To reproduce the problem run this:

vim --clean - +so <<-END
	%d
	set bt=nowrite list listchars=tab:>\ 
	call append(0, ["\t\taaaa bb","\tccccccc cc"])
	call prop_type_add("type", {"highlight":"NonText"})
	call prop_add(1,0,{'text_padding_left': 16, 'type': 'type', 'text': '┌─above 1', 'text_align': 'above'})
	call prop_add(1,0,{'text_padding_left': 16, 'type': 'type', 'text': '┌─above 2', 'text_align': 'above'})
	call prop_add(2,0,{'text_padding_left': 8, 'type': 'type', 'text': '┌─above 1', 'text_align': 'above'})
	33vsp
END

and resize the left window.
asciicast

@julio-b
Copy link
Contributor Author

julio-b commented Mar 11, 2024

Hm, cursor position is broken now

@julio-b
Copy link
Contributor Author

julio-b commented Mar 12, 2024

Ok cursor position looks good, but this is probably not the right solution. Suggestions?

@julio-b julio-b marked this pull request as ready for review March 12, 2024 15:49
Comment on lines +3164 to +3165
vcol_adjusted -= (wp->w_width - win_col_off(wp))
* wlv.text_prop_above_count % wp->w_buffer->b_p_ts;

Check failure

Code scanning / CodeQL

Multiplication result converted to larger type High

Multiplication result may overflow 'int' before it is converted to 'long'.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant