From dd6e0cce3bcc6a4e57c5869f6a5ba36c101a17b3 Mon Sep 17 00:00:00 2001 From: Dmitry Ulyanov Date: Mon, 3 Apr 2023 17:22:43 +0300 Subject: [PATCH] Fix line number display for LSP goto pickers (#6559) Line numbers are 0-indexed in the LSP spec but 1-indexed for display and jumping purposes in Helix. --- helix-term/src/commands/lsp.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helix-term/src/commands/lsp.rs b/helix-term/src/commands/lsp.rs index f8e83a46c8b8..78dbc0be9e70 100644 --- a/helix-term/src/commands/lsp.rs +++ b/helix-term/src/commands/lsp.rs @@ -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() }