aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2017-01-27 08:26:16 +0100
committerMarc André Tanner <mat@brain-dump.org>2017-01-27 08:31:11 +0100
commit7dc877164eb4e33a1a6537ea391066464e932956 (patch)
tree3ae5d097da9409742498ae155edb4a3279e0c50d
parentcdd8c4b9a1544b64f2176df64dd7e24a2e08b74a (diff)
downloadvis-7dc877164eb4e33a1a6537ea391066464e932956.tar.gz
vis-7dc877164eb4e33a1a6537ea391066464e932956.tar.xz
vis: do not set count when handling 0 motion
A count of zero is different than specifying no count. This fixes `0G` which previously moved to the start of the file. Fix #474
-rw-r--r--main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/main.c b/main.c
index a42d8cd..046e90c 100644
--- a/main.c
+++ b/main.c
@@ -1680,7 +1680,8 @@ static const char *count(Vis *vis, const char *keys, const Arg *arg) {
if (0 <= digit && digit <= 9) {
if (digit == 0 && count == 0)
vis_motion(vis, VIS_MOVE_LINE_BEGIN);
- vis_count_set(vis, count * 10 + digit);
+ else
+ vis_count_set(vis, count * 10 + digit);
}
return keys;
}