Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tab Completion: Add one more whitespace #11

Closed
skaldesh opened this issue Jan 13, 2020 · 2 comments · Fixed by #16
Closed

Tab Completion: Add one more whitespace #11

skaldesh opened this issue Jan 13, 2020 · 2 comments · Fixed by #16
Labels

Comments

@skaldesh
Copy link
Member

If by pressing Tab a command can be completed, and this command is not a prefix for another command, add one more whitespace to the result, to allow for quick completion of the next.

Example:

  • commands: "Command1", "OtherCommand" -> user types "Comm" -> hits Tab -> "Command1 " (! mind the whitespace)
  • commands: "Command1", "Command2" -> user types "Comm" -> hits Tab -> "Command" (! no whitespace, as multiple results possible)
@skaldesh
Copy link
Member Author

skaldesh commented Feb 2, 2020

In completer.go line 133, I found this:

// If a single full match was found, then append a space.
if len(suggestions) == 0 && fullMatch != nil && fullMatchCount == 1 {
	suggestions = append(suggestions, []rune(" "))
}

So, this feature was intended to work already, but does not. Labeling as bug

@skaldesh skaldesh added the bug label Feb 2, 2020
@r0l1
Copy link
Member

r0l1 commented Feb 2, 2020

That line appends a space if tab is pressed once more. Maybe append the completion suggestions with a space to fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants