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

Use explicit null check to ensure start/end row is valid #1234

Merged
merged 2 commits into from
Jan 22, 2018

Conversation

Tyriar
Copy link
Member

@Tyriar Tyriar commented Jan 22, 2018

It looks like this could have caused the inconsistent behavior with
links not activating and then working again after scrolling

Fixes #1233

It looks like this could have caused the inconsistent behavior with
links not activating and then working again after scrolling

Fixes xtermjs#1233
@Tyriar Tyriar added this to the 3.1.0 milestone Jan 22, 2018
@Tyriar Tyriar self-assigned this Jan 22, 2018
@@ -82,12 +82,12 @@ export class Linkifier extends EventEmitter implements ILinkifier {
}

// Increase range to linkify
if (!this._rowsToLinkify.start) {
if (this._rowsToLinkify.start === null) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only line that functionally changed, before this condition would fire when this._rowsToLinkify.start was 0, meaning it could have been linkifying all rows:

this._rowsToLinkify.start = 0
this._rowsToLinkify.end = term rows - 1

And then the next call to the function would override it, which means only one row would be checked if start === end.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Good catch!

@Tyriar Tyriar merged commit d85d353 into xtermjs:master Jan 22, 2018
@Tyriar Tyriar deleted the 1233_link_activation branch January 22, 2018 20:53
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.

2 participants