mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 10:10:08 -08:00
trim trailing space from commands
This commit is contained in:
parent
9aeb813cf5
commit
04f0b2c48d
3 changed files with 5 additions and 3 deletions
|
|
@ -101,9 +101,11 @@ func parseLine(line string) (StringCode, []string) {
|
|||
var parts []string
|
||||
if colonIndex := strings.IndexRune(line, ':'); colonIndex >= 0 {
|
||||
lastArg := norm.NFC.String(line[colonIndex+len(":"):])
|
||||
line = norm.NFKC.String(line[:colonIndex-len(" ")])
|
||||
line = strings.TrimRight(line[:colonIndex], " ")
|
||||
line = norm.NFKC.String(line)
|
||||
parts = append(spacesExpr.Split(line, -1), lastArg)
|
||||
} else {
|
||||
line = strings.TrimRight(line, " ")
|
||||
line = norm.NFKC.String(line)
|
||||
parts = spacesExpr.Split(line, -1)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue