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

Finding first non-white-space fails sometimes #5

Closed
avih opened this issue Sep 14, 2016 · 1 comment
Closed

Finding first non-white-space fails sometimes #5

avih opened this issue Sep 14, 2016 · 1 comment

Comments

@avih
Copy link

avih commented Sep 14, 2016

gitCodeLensProvider.ts has the following line:

         let startChar = line.text.search(`\\b${symbol.name}\\b`); //line.firstNonWhitespaceCharacterIndex;

However, it seems that on some cases symbol.name ends up as the entire source code line with whatever chars it has in it, and sometimes it breaks the regex.

I've replaced it locally with this which seems to work:

        var startChar = -1;
        try {
            startChar = line.text.search("\\b\\" + symbol.name + "\\b"); //line.firstNonWhitespaceCharacterIndex;
        } catch (e) {
            var i = 0, c;
            while ((c = line.text[i]) && (c == ' ' || c == '\t'))
                i++;
            startChar = c ? i : -1;
        }

but there are probably cleaner approaches for the fix.

billsedison added a commit to noside911/vscode-gitlens that referenced this issue Jan 4, 2019
Closes gitkraken#5: The aggregated diff window should not scroll with the commit lists
@github-actions
Copy link

github-actions bot commented Dec 9, 2020

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant