fix(server): Improvements

This commit is contained in:
Myzel394 2025-03-23 17:35:31 +01:00
parent ce7264aded
commit 5e535741d2
No known key found for this signature in database
GPG Key ID: 3B955307C2FC2F11
2 changed files with 1 additions and 3 deletions

View File

@ -177,7 +177,7 @@ func (v KeyEnumAssignmentValue) DeprecatedFetchCompletions(line string, cursor u
) )
if found { if found {
relativePosition := max(1, foundPosition) - 1 relativePosition := min(foundPosition, len(line) - 1)
selectedKey := line[:uint32(relativePosition)] selectedKey := line[:uint32(relativePosition)]
line = line[uint32(relativePosition+len(v.Separator)):] line = line[uint32(relativePosition+len(v.Separator)):]
cursor -= uint32(relativePosition) cursor -= uint32(relativePosition)

View File

@ -50,7 +50,6 @@ func GetCompletion(
optionsValue = fields.DefaultMountOptionsField optionsValue = fields.DefaultMountOptionsField
} }
for _, completion := range optionsValue.DeprecatedFetchCompletions(line, cursor) { for _, completion := range optionsValue.DeprecatedFetchCompletions(line, cursor) {
var documentation string var documentation string
@ -68,7 +67,6 @@ func GetCompletion(
completions = append(completions, completion) completions = append(completions, completion)
} }
return completions, nil return completions, nil
case ast.FstabFieldFreq: case ast.FstabFieldFreq:
value, cursor := getFieldSafely(entry.Fields.Freq, cursor) value, cursor := getFieldSafely(entry.Fields.Freq, cursor)