Skip to content

Commit

Permalink
fix: NOSUGGEST may be more than 1 char
Browse files Browse the repository at this point in the history
  • Loading branch information
jdkato committed Jan 2, 2024
1 parent 2c68f5c commit 5bdb7f9
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions internal/spell/aff.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ type dictConfig struct {
CamelCase int
CompoundMin int64
compoundMap map[rune][]string
NoSuggestFlag rune
NoSuggestFlag string
}

// expand expands a word/affix using dictionary/affix rules
Expand Down Expand Up @@ -229,12 +229,7 @@ func newDictConfig(file io.Reader) (*dictConfig, error) { //nolint:funlen
if len(parts) < 2 {
return nil, fmt.Errorf("NOSUGGEST stanza had %d fields, expected 2", len(parts))
}
// should use runes or parse correctly
chars := []rune(parts[1])
if len(chars) != 1 {
return nil, fmt.Errorf("NOSUGGEST stanza had more than one flag: %q", parts[1])
}
aff.NoSuggestFlag = chars[0]
aff.NoSuggestFlag = parts[1]
case "WORDCHARS":
if len(parts) < 2 {
return nil, fmt.Errorf("WORDCHAR stanza had %d fields, expected 2", len(parts))
Expand Down

0 comments on commit 5bdb7f9

Please sign in to comment.