diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-05-22 18:42:09 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-05-22 18:47:45 +0200 |
| commit | 440e36f12b694f12dc64d2d1653c598e9d702f86 (patch) | |
| tree | 55aac1a04ac2131a279552e6a70db7c6382a0f3f | |
| parent | a794d3c59a5119fcd1ce0b94e12cbd73c3dc9e58 (diff) | |
| download | vis-440e36f12b694f12dc64d2d1653c598e9d702f86.tar.gz vis-440e36f12b694f12dc64d2d1653c598e9d702f86.tar.xz | |
vis: only display mode in status bar of active window
| -rw-r--r-- | vis-lua.c | 5 | ||||
| -rw-r--r-- | vis.lua | 2 |
2 files changed, 4 insertions, 3 deletions
@@ -21,12 +21,13 @@ static void window_status_update(Vis *vis, Win *win) { int width = vis_window_width_get(win); int delim_len = 1, delim_count = 0; enum UiOption options = view_options_get(win->view); + bool focused = vis->win == win; const char *filename = win->file->name; const char *mode = vis->mode->status; int left_len = snprintf(left, sizeof(left)-1, "%s%s%s%s%s", - mode ? mode : "", - mode && ++delim_count ? " » " : "", + focused && mode ? mode : "", + focused && mode && ++delim_count ? " » " : "", filename ? filename : "[No Name]", text_modified(win->file->text) ? " [+]" : "", vis_macro_recording(vis) ? " @": ""); @@ -303,7 +303,7 @@ vis.events.win_status = function(win) local delim_len = 1 local mode = modes[vis.mode] - if mode ~= '' then + if mode ~= '' and vis.win == win then table.insert(left, mode) end |
