aboutsummaryrefslogtreecommitdiff
path: root/vis-lua.c
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2016-05-22 18:42:09 +0200
committerMarc André Tanner <mat@brain-dump.org>2016-05-22 18:47:45 +0200
commit440e36f12b694f12dc64d2d1653c598e9d702f86 (patch)
tree55aac1a04ac2131a279552e6a70db7c6382a0f3f /vis-lua.c
parenta794d3c59a5119fcd1ce0b94e12cbd73c3dc9e58 (diff)
downloadvis-440e36f12b694f12dc64d2d1653c598e9d702f86.tar.gz
vis-440e36f12b694f12dc64d2d1653c598e9d702f86.tar.xz
vis: only display mode in status bar of active window
Diffstat (limited to 'vis-lua.c')
-rw-r--r--vis-lua.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/vis-lua.c b/vis-lua.c
index bb238e1..7cecde3 100644
--- a/vis-lua.c
+++ b/vis-lua.c
@@ -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) ? " @": "");