From 7bb34c32b4972867a3ee953409e619cf2dbb332c Mon Sep 17 00:00:00 2001 From: Myzel394 <50424412+Myzel394@users.noreply.github.com> Date: Tue, 17 Sep 2024 23:27:09 +0200 Subject: [PATCH] fix(sshd_config): Some bugfixes --- handlers/sshd_config/handlers/completions.go | 2 +- handlers/sshd_config/indexes/indexes.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/handlers/sshd_config/handlers/completions.go b/handlers/sshd_config/handlers/completions.go index 034a30e..e076030 100644 --- a/handlers/sshd_config/handlers/completions.go +++ b/handlers/sshd_config/handlers/completions.go @@ -79,6 +79,6 @@ func GetOptionCompletions( line := entry.OptionValue.Value.Raw return option.FetchCompletions( line, - common.CursorToCharacterIndex(cursor)-entry.OptionValue.Start.Character, + common.CursorToCharacterIndex(cursor-entry.OptionValue.Start.Character), ), nil } diff --git a/handlers/sshd_config/indexes/indexes.go b/handlers/sshd_config/indexes/indexes.go index bd7f07e..37247c4 100644 --- a/handlers/sshd_config/indexes/indexes.go +++ b/handlers/sshd_config/indexes/indexes.go @@ -144,7 +144,7 @@ func addOption( Err: errors.New(fmt.Sprintf( "Option '%s' has already been defined on line %d", option.Key.Key, - firstDefinedOption.Start.Line, + firstDefinedOption.Start.Line+1, )), }) } else {