Trim completions and ensure final newline (#609)

Trim whitespace at beginning and end of generated completions.
Additionally, since some editors will automatically insert a final
newline into text files, make sure a final newline is present.
This commit is contained in:
Casey Rodarmor
2020-03-14 21:41:57 -07:00
committed by GitHub
parent 1dbc765390
commit 784232e98b
5 changed files with 8 additions and 5 deletions

View File

@@ -1,4 +1,3 @@
edit:completion:arg-completer[just] = [@words]{
fn spaces [n]{
repeat $n ' ' | joins ''

View File

@@ -1,4 +1,3 @@
using namespace System.Management.Automation
using namespace System.Management.Automation.Language

View File

@@ -60,4 +60,4 @@ _just_commands() {
_describe -t commands 'just commands' commands "$@"
}
_just "$@"
_just "$@"