-
-
Notifications
You must be signed in to change notification settings - Fork 198
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(highlight): fix eol highlight not displaying #1988
Conversation
3cb4f26
to
19d97b6
Compare
@@ -33,7 +37,18 @@ export function calculateEditorColFromVimScreenCol(line: string, screenCol: numb | |||
} | |||
|
|||
if (currentCharIdx >= line.length) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ollien Here we cannot use width; what we need is character index
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch. I had a test failure on one of the double-wide unit tests but must have fixed it otherwise
977426c
to
1fccc2d
Compare
1fccc2d
to
3308c52
Compare
@@ -630,6 +630,26 @@ describe("processHighlightCellsEvent", () => { | |||
}, | |||
], | |||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for carrying this over. If you would be so kind, would you mind adding a case for where the Math.max
will trigger return 0, when calculating eolCol
?
@@ -17,10 +17,14 @@ export function expandTabs(line: string, tabWidth: number): string { | |||
return expanded; | |||
} | |||
|
|||
/** | |||
* Note: This function is for use by the highlight module only. | |||
*/ | |||
export function calculateEditorColFromVimScreenCol(line: string, screenCol: number, tabSize: number): number { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
off topic: this could be named getColFromNvimCol
without any loss of clarity, while reducing verbosity.
Close #1987