Skip to content

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

Description

@pokey
          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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions