vis

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

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

commit 5cd1522408c6a53dc8a778807d37e3f29e69a4b6
parent f271f553f2d56210632ee35d084b6440c342d0b5
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Fri, 16 Jan 2015 10:41:18 +0100

Reorder if/else clause in order to avoid dead code

Diffstat:
Meditor.c | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/editor.c b/editor.c @@ -412,7 +412,10 @@ bool editor_window_new(Editor *ed, const char *filename) { return false; } - if (filename) { + if (original) { + window_syntax_set(win->win, window_syntax_get(original->win)); + window_cursor_to(win->win, window_cursor_get(original->win)); + } else if (filename) { text_filename_set(text, filename); for (Syntax *syn = ed->syntaxes; syn && syn->name; syn++) { if (!regexec(&syn->file_regex, filename, 0, NULL, 0)) { @@ -420,9 +423,6 @@ bool editor_window_new(Editor *ed, const char *filename) { break; } } - } else if (original) { - window_syntax_set(win->win, window_syntax_get(original->win)); - window_cursor_to(win->win, window_cursor_get(original->win)); } editor_draw(ed);