vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit 703ba7ce6bb6e6b4888ed2e009be4871e3b7d106
parent 7f9abb80b4e5ecd53204d649c08139ddb95ac3db
Author: Marc André Tanner <mat@brain-dump.org>
Date: Sun, 29 May 2016 11:15:53 +0200
vis-menu: improve empty prompt handling (vis-menu -p '')
The textw{,n} functions should probably be changed to not
accomodate for leading and trailing spaces. They should also
be changed to properly calculate the display width of an UTF-8
encoded string. Currently they will just return the number of
codepoints which is obviously wrong.
Diffstat:
| M | vis-menu.c | | | 2 | ++ |
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/vis-menu.c b/vis-menu.c @@ -585,6 +585,8 @@ main(int argc, char **argv) { usage(); } else if (!strcmp(argv[i], "-p")) { prompt = argv[++i]; + if (prompt && !prompt[0]) + prompt = NULL; } else if (!strcmp(argv[i], "-l")) { lines = atoi(argv[++i]); } else {