Skip to content

off-by-one symbol range for headings ending with emoji #453

Description

@drowning-cat

I'm not very skilled with this kind of things, so I apologize in advance.

It looks like there might be an off-by-one error when returning textDocument/documentSymbol selectionRange for a heading that ends with an emoji. This was originally reported here: folke/snacks.nvim#2704.

For a markdown file like:

## 45
## 🚀

I would expect the second heading to have the following selection range:

"selectionRange": {
  "start": { "line": 1, "character": 0 },
  "end":   { "line": 1, "character": 5 }
},

However, the actual result appears to be "character": 6 for the end position.

Could you please confirm whether this is a valid issue?

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions