diff options
author | Hubert Hirtz <hubert@hirtz.pm> | 2021-10-23 11:26:29 +0200 |
---|---|---|
committer | Hubert Hirtz <hubert@hirtz.pm> | 2021-10-23 11:26:29 +0200 |
commit | cc8aae7d300e7529fc8113b9d356702630f36df5 (patch) | |
tree | 77408852ad47009dcdb5006dcbdd3c343178d8ac /window.go | |
parent | doc: fix indentation and use _ instead of ` for keywords (diff) |
Don't display buffer numbers on empty command
Diffstat (limited to 'window.go')
-rw-r--r-- | window.go | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -63,19 +63,19 @@ func (app *App) setStatus() { func (app *App) setBufferNumbers() { input := app.win.InputContent() - if len(input) < 2 || input[0] != '/' { + if !isCommand(input) { app.win.ShowBufferNumbers(false) return } commandEnd := len(input) - for i := 0; i < len(input); i++ { + for i := 1; i < len(input); i++ { if input[i] == ' ' { commandEnd = i break } } - command := string(input[:commandEnd]) - showBufferNumbers := strings.HasPrefix("/buffer", command) + command := string(input[1:commandEnd]) + showBufferNumbers := len(command) != 0 && strings.HasPrefix("buffer", command) app.win.ShowBufferNumbers(showBufferNumbers) } |