Skip to content

Fix "grand grand <scope>" on scope boundaries #2138

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

Open
pokey opened this issue Dec 14, 2023 · 0 comments
Open

Fix "grand grand <scope>" on scope boundaries #2138

pokey opened this issue Dec 14, 2023 · 0 comments

Comments

@pokey
Copy link
Member

pokey commented Dec 14, 2023

          I believe this approach will break down if cursor is between adjacent scopes. Let's say scopes look like the following (document text is `0123`):
   0123
a:   - 
b:    - 
c:  -- 
d:  --- 

And cursor is between 2 and 3 and scope preference breaks left, so containing scope is a. If you say "grand grand scope", you will get b, when you should get d. I think you need to keep a currentScope, initialize it to the original containing scope, filter out scopes that are not a parent of the current scope, and keep updating it and increment ancestor count each time you find a matching scope. Not sure if that makes sense?

Originally posted by @pokey in #2130 (comment)

@pokey pokey mentioned this issue Dec 14, 2023
3 tasks
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

No branches or pull requests

1 participant