Skip to content

Commit

Permalink
Fix line number display for LSP goto pickers (helix-editor#6559)
Browse files Browse the repository at this point in the history
Line numbers are 0-indexed in the LSP spec but 1-indexed for display
and jumping purposes in Helix.
  • Loading branch information
sillent authored and Triton171 committed Jun 18, 2023
1 parent 17e645b commit a4e6bd9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion helix-term/src/commands/lsp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl ui::menu::Item for lsp::Location {

// Most commonly, this will not allocate, especially on Unix systems where the root prefix
// is a simple `/` and not `C:\` (with whatever drive letter)
write!(&mut res, ":{}", self.range.start.line)
write!(&mut res, ":{}", self.range.start.line + 1)
.expect("Will only failed if allocating fail");
res.into()
}
Expand Down

0 comments on commit a4e6bd9

Please sign in to comment.