vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 10ae3e3f1138a38ef8aec83fadda2e491c82c9bc parent da28390de51c7c7597f0d15b40a530f88277f1a6 Author: Michel Martens <michel@soveran.com> Date: Thu, 19 May 2016 11:06:47 +0200 vis: fix behavior of complete-word on BSD Diffstat:
| M | main.c | | | 4 | ++-- |
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/main.c b/main.c @@ -2148,7 +2148,7 @@ static const char *complete_word(Vis *vis, const char *keys, const Arg *arg) { buffer_init(&cmd); char *prefix = get_completion_prefix(vis); if (prefix && buffer_printf(&cmd, "tr \" ;:$<>#?{}()[],.'\" '\n' | " - " grep '^%s' | sort | uniq | " VIS_MENU " | tr -d '\n' | sed 's/%s//'", prefix, prefix)) { + " grep '^%s.' | sort | uniq | " VIS_MENU " | sed 's/%s//' | tr -d '\n'", prefix, prefix)) { Filerange all = text_range_new(0, text_size(txt)); insert_dialog_selection(vis, &all, (const char*[]){ buffer_content0(&cmd), NULL }); } @@ -2162,7 +2162,7 @@ static const char *complete_filename(Vis *vis, const char *keys, const Arg *arg) buffer_init(&cmd); char *prefix = get_completion_prefix(vis); if (prefix && buffer_printf(&cmd, "ls | grep '^%s' | sort | " VIS_MENU - " | tr -d '\n' | sed 's/%s//'", prefix, prefix)) { + " | sed 's/%s//' | tr -d '\n'", prefix, prefix)) { Filerange empty = text_range_new(0, 0); insert_dialog_selection(vis, &empty, (const char*[]){ buffer_content0(&cmd), NULL }); }