vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit abedff08f00ee4b91fd2714684a84236c643374a
parent 29b4d19d11098d3f9412bd47455a948bec3f49a4
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Tue, 27 Jun 2017 21:00:32 +0200

vis: properly set initial window ui options

This should keep the EOF markers visible when another option is enabled.
The whole UI option handling is a bit of a mess. In the longterm more of
the drawing code should be moved into Lua.

Diffstat:
Mview.c | 2+-
Mvis.c | 3++-
2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/view.c b/view.c @@ -510,7 +510,7 @@ View *view_new(Text *text) { .data = " ", }; view->tabwidth = 8; - view_options_set(view, UI_OPTION_SYMBOL_EOF); + view_options_set(view, 0); if (!view_resize(view, 1, 1)) { view_free(view); diff --git a/vis.c b/vis.c @@ -468,6 +468,7 @@ Win *window_new_file(Vis *vis, File *file, enum UiOption options) { return NULL; } file->refcount++; + view_options_set(win->view, view_options_get(win->view)); view_tabwidth_set(win->view, vis->tabwidth); if (vis->windows) @@ -574,7 +575,7 @@ bool vis_window_new(Vis *vis, const char *filename) { File *file = file_new(vis, filename); if (!file) return false; - Win *win = window_new_file(vis, file, UI_OPTION_STATUSBAR); + Win *win = window_new_file(vis, file, UI_OPTION_STATUSBAR|UI_OPTION_SYMBOL_EOF); if (!win) { file_free(vis, file); return false;