Sorry for the confusion I caused with the first version of this patch containing
an old local change of mine changing tr(1) to sed(1).
v1 -> v2: actually use awk(1)
[PATCH] vis-complete: split words using awk(1) instead of tr(1)
Florian Fischer <florian.fischer@muhq.space> wrote:
> Similar to d3e4af1f0a33849b36196b035fddf64037e0c282 the> lack of unicode support in GNU's tr(1) implementation prevents> word completions for word containing unicode glyphs.> > Apparently, most awk implementations support unicode.> > Signed-off-by: Florian Fischer <florian.fischer@muhq.space>> ---> vis-complete | 2 +-> 1 file changed, 1 insertion(+), 1 deletion(-)> > diff --git a/vis-complete b/vis-complete> index db925f69..e7bf5796 100755> --- a/vis-complete> +++ b/vis-complete> @@ -48,7 +48,7 @@ fi> PATTERN="$1"> > if [ $COMPLETE_WORD = 1 ]; then> - tr -s '\t {}()[],<>%^&.\\' '\n' |> + awk '{gsub(/([^[:alnum:]_])/,"\n")}1' |> grep "^$(basic_regex_quote "$PATTERN")." |> sort -u> else
Sorry for the delay in response but I wanted to have a better
solution prepared before replying. I will reject this because the
character classes still don't work properly with onetrueawk even
though unicode is supported.
I sent a different patch to the list which works with all the
examples given. I would appreciate any review!
- Randy
--
https://rnpnr.xyz/
GPG Fingerprint: B8F0 CF4C B6E9 415C 1B27 A8C4 C8D2 F782 86DF 2DC5