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 search pos on file with leading whitespace #40

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

tom93
Copy link
Contributor

@tom93 tom93 commented Jan 26, 2024

This fixes a bug when using the File Editor's search feature on a file that contains leading whitespace. The bug is that when pressing the "<" and ">" buttons to go to the prev/next match, the cursor position is wrong -- it is shifted left by the amount of whitespace at the start of the file. (Note that this this about the cursor position; the highlighting does not have this issue.)

From the commit message:

The extension property EditText.value trims leading/trailing whitespace, so using it to calculate the locations of the search matches produces incorrect indices if the file has leading whitespace.

(This affects the cursor position when going to the next/prev match. It does not affect the highlighting of matches.)

The extension property EditText.value trims leading/trailing
whitespace, so using it to calculate the locations of the search
matches produces incorrect indices if the file has leading whitespace.

(This affects the cursor position when going to the next/prev match.
It does not affect the highlighting of matches.)
@Aga-C
Copy link
Member

Aga-C commented Jan 27, 2024

Looks like it's working fine, but next time please add some demonstration video or screenshots (like it's asked in the template you've removed) if you aren't fixing any already raised bug. It saves us time on understanding the problem and comparing between versions, especially that here it wasn't so obvious.

@naveensingh
Copy link
Member

Okay, looks good. Thanks :)

@naveensingh naveensingh merged commit d78f7cb into FossifyOrg:master Mar 13, 2024
@tom93 tom93 deleted the fix-search-leading-spaces branch March 13, 2024 15:18
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.

3 participants