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 {