aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2018-05-17 21:50:18 +0200
committerMarc André Tanner <mat@brain-dump.org>2018-05-17 21:51:41 +0200
commit9cbe218f271ac97c5562b610fc2e2ebbd947fc3a (patch)
treea7cd9c44a24ef8480e3dff66527f7f6c69205e12
parent50b49e661aea8d7b9873a9e84a51f72b3121ad52 (diff)
downloadvis-9cbe218f271ac97c5562b610fc2e2ebbd947fc3a.tar.gz
vis-9cbe218f271ac97c5562b610fc2e2ebbd947fc3a.tar.xz
vis: display count/input queue content in status bar
Fix #695
-rw-r--r--lua/vis-std.lua8
-rw-r--r--vis-lua.c7
2 files changed, 15 insertions, 0 deletions
diff --git a/lua/vis-std.lua b/lua/vis-std.lua
index f0607f2..05bf832 100644
--- a/lua/vis-std.lua
+++ b/lua/vis-std.lua
@@ -91,6 +91,14 @@ vis.events.subscribe(vis.events.WIN_STATUS, function(win)
table.insert(left_parts, (file.name or '[No Name]') ..
(file.modified and ' [+]' or '') .. (vis.recording and ' @' or ''))
+ local count = vis.count
+ local keys = vis.input_queue
+ if keys ~= '' then
+ table.insert(right_parts, keys)
+ elseif count then
+ table.insert(right_parts, count)
+ end
+
if #win.selections > 1 then
table.insert(right_parts, selection.number..'/'..#win.selections)
end
diff --git a/vis-lua.c b/vis-lua.c
index 0031421..e1c39ca 100644
--- a/vis-lua.c
+++ b/vis-lua.c
@@ -79,6 +79,13 @@ static void window_status_update(Vis *vis, Win *win) {
vis_macro_recording(vis) ? " @": "");
left_count++;
+ int count = vis_count_get(vis);
+ const char *keys = buffer_content0(&vis->input_queue);
+ if (keys && keys[0])
+ snprintf(right_parts[right_count++], sizeof(right_parts[0]), "%s", keys);
+ else if (count != VIS_COUNT_UNKNOWN)
+ snprintf(right_parts[right_count++], sizeof(right_parts[0]), "%d", count);
+
int sel_count = view_selections_count(view);
if (sel_count > 1) {
Selection *s = view_selections_primary_get(view);