Skip to content

Support negative line numbers for goto#841

Open
barkure wants to merge 1 commit intomicrosoft:mainfrom
barkure:support-negative-line-goto
Open

Support negative line numbers for goto#841
barkure wants to merge 1 commit intomicrosoft:mainfrom
barkure:support-negative-line-goto

Conversation

@barkure
Copy link
Copy Markdown
Contributor

@barkure barkure commented May 1, 2026

Summary

Implements the request from #684.

  • Support negative line numbers for file goto targets, e.g. edit README.md:-1 opens at the last line and edit README.md:-5 opens at the fifth line from the end.
  • Apply the same negative line behavior to the interactive Go To dialog, so CLI and in-editor navigation stay consistent.
  • Keep columns positive-only; values like README.md:10:-5 are not treated as goto targets.

Test plan

  • Built successfully with:
cargo build -p edit --release
  • Ran parser coverage with:
cargo test -p edit documents::tests::test_parse_last_numbers
  • Manually tested:
    target/release/edit README.md:-1
    target/release/edit README.md:-5

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.

1 participant