Skip to content

Conversation

@ntchjb
Copy link
Contributor

@ntchjb ntchjb commented Dec 28, 2018

I tested using find previous function in search add-ons. It turns out that searching cannot go to previous line if the current result start at column index 0 as seen in the following picture:

screen shot 2561-12-29 at 02 58 08

The current selection (the first meow at second line) is stuck and couldn't continue finding other results. I think it's because lastIndexOf function still do matching string at the beginning of searchStringLine although searchStringLine's length is smaller than searchTerm, which should return -1. I fix the code by adding if clause to check whether the comparing range of searchStringLine is shorter than searchTerm or not.

searchTerm should not be matched if the beginning of matching index < 0
@Tyriar Tyriar added this to the 3.10.0 milestone Dec 28, 2018
Copy link
Member

@Tyriar Tyriar left a comment

Choose a reason for hiding this comment

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

Great catch! 😃

@Tyriar Tyriar merged commit 4375b3c into xtermjs:master Dec 28, 2018
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