From 3f9c4e5ae437f2ecfe71fa40de0ff8209259c572 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sun, 8 Nov 2015 14:33:09 +0100 Subject: [PATCH] Remove trailing white space from source files --- ui-curses.c | 10 +++++----- ui.h | 2 +- view.c | 16 ++++++++-------- view.h | 2 +- vis-cmds.c | 10 +++++----- vis-core.h | 2 +- vis.c | 8 ++++---- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/ui-curses.c b/ui-curses.c index d8f83a9..cb9d6ea 100644 --- a/ui-curses.c +++ b/ui-curses.c @@ -742,7 +742,7 @@ static void ui_draw(Ui *ui) { UiCurses *uic = (UiCurses*)ui; erase(); ui_arrange(ui, uic->layout); - + for (UiCursesWin *win = uic->windows; win; win = win->next) ui_window_draw((UiWin*)win); @@ -898,7 +898,7 @@ static UiWin *ui_window_new(Ui *ui, View *view, File *file) { win->view = view; win->file = file; view_ui(view, &win->uiwin); - + if (uic->windows) uic->windows->prev = win; win->next = uic->windows; @@ -924,7 +924,7 @@ static void ui_info(Ui *ui, const char *msg, va_list ap) { static void ui_info_hide(Ui *ui) { UiCurses *uic = (UiCurses*)ui; - if (uic->info[0]) { + if (uic->info[0]) { uic->info[0] = '\0'; ui_draw(ui); } @@ -1024,7 +1024,7 @@ static const char *ui_getkey(Ui *ui) { if (poll(&fd, 1, termkey_get_waittime(uic->termkey)) == 0) ret = termkey_getkey_force(uic->termkey, &key); } - + if (ret != TERMKEY_RES_KEY) return NULL; termkey_strfkey(uic->termkey, uic->key, sizeof(uic->key), &key, TERMKEY_FORMAT_VIM); @@ -1106,7 +1106,7 @@ Ui *ui_curses_new(void) { sa.sa_handler = sigwinch_handler; sigaction(SIGWINCH, &sa, NULL); sigaction(SIGCONT, &sa, NULL); - + ui_resize(ui); return ui; diff --git a/ui.h b/ui.h index 51f5ec3..621342d 100644 --- a/ui.h +++ b/ui.h @@ -6,7 +6,7 @@ #include typedef struct Ui Ui; -typedef struct UiWin UiWin; +typedef struct UiWin UiWin; enum UiLayout { UI_LAYOUT_HORIZONTAL, diff --git a/view.c b/view.c index bf6fca6..3dc3d51 100644 --- a/view.c +++ b/view.c @@ -111,7 +111,7 @@ static Cell cell_blank = { .data = " " }; static void view_clear(View *view); static bool view_addch(View *view, Cell *cell); -static bool view_coord_get(View *view, size_t pos, Line **retline, int *retrow, int *retcol); +static bool view_coord_get(View *view, size_t pos, Line **retline, int *retrow, int *retcol); static void view_cursors_free(Cursor *c); /* set/move current cursor position to a given (line, column) pair */ static size_t cursor_set(Cursor *cursor, Line *line, int col); @@ -334,7 +334,7 @@ static bool view_coord_get(View *view, size_t pos, Line **retline, int *retrow, row = view->height - 1; } - if (retline) *retline = line; + if (retline) *retline = line; if (retrow) *retrow = row; if (retcol) *retcol = col; return true; @@ -551,7 +551,7 @@ void view_update(View *view) { for (Selection *s = view->selections; s; s = s->next) { Filerange sel = view_selections_get(s); - if (text_range_valid(&sel)) { + if (text_range_valid(&sel)) { Line *start_line; int start_col; Line *end_line; int end_col; view_coord_get(view, sel.start, &start_line, NULL, &start_col); @@ -641,13 +641,13 @@ View *view_new(Text *text, lua_State *lua, ViewEvent *events) { view_free(view); return NULL; } - + view->text = text; view->lua = lua; view->events = events; view->tabwidth = 8; view_options_set(view, 0); - + if (!view_resize(view, 1, 1)) { view_free(view); return NULL; @@ -953,7 +953,7 @@ bool view_syntax_set(View *view, const char *name) { /* loop through all _TOKENSTYLES and parse them */ lua_getfield(L, -1, "_TOKENSTYLES"); lua_pushnil(L); /* first key */ - + while (lua_next(L, -2)) { size_t id = lua_tointeger(L, -1); //const char *name = lua_tostring(L, -2); @@ -1188,7 +1188,7 @@ void view_cursors_selection_set(Cursor *c, Filerange *r) { c->sel = view_selections_new(c->view); if (!c->sel) return; - + view_selections_set(c->sel, r); } @@ -1240,7 +1240,7 @@ void view_cursors_clear(View *view) { } } view_draw(view); -} +} void view_selections_swap(Selection *s) { Mark temp = s->anchor; diff --git a/view.h b/view.h index 5513dcf..d43deb4 100644 --- a/view.h +++ b/view.h @@ -144,7 +144,7 @@ Register *view_cursors_register(Cursor*); * will affect the selected region. */ void view_cursors_selection_start(Cursor*); /* detach cursor from selection, further cursor movements will not affect - * the selected region. */ + * the selected region. */ void view_cursors_selection_stop(Cursor*); /* clear selection associated with this cursor (if any) */ void view_cursors_selection_clear(Cursor*); diff --git a/vis-cmds.c b/vis-cmds.c index 0ddb2bc..83f16ea 100644 --- a/vis-cmds.c +++ b/vis-cmds.c @@ -306,7 +306,7 @@ static bool cmd_set(Vis *vis, Filerange *range, enum CmdOpt cmdopt, const char * } else { opt &= ~UI_OPTION_LINE_NUMBERS_ABSOLUTE; } - view_options_set(vis->win->view, opt); + view_options_set(vis->win->view, opt); break; } case OPTION_NUMBER_RELATIVE: { @@ -317,7 +317,7 @@ static bool cmd_set(Vis *vis, Filerange *range, enum CmdOpt cmdopt, const char * } else { opt &= ~UI_OPTION_LINE_NUMBERS_RELATIVE; } - view_options_set(vis->win->view, opt); + view_options_set(vis->win->view, opt); break; } case OPTION_CURSOR_LINE: { @@ -867,7 +867,7 @@ static void print_mode(Mode *mode, Text *txt, bool recursive) { static bool cmd_help(Vis *vis, Filerange *range, enum CmdOpt opt, const char *argv[]) { if (!vis_window_new(vis, NULL)) return false; - + Text *txt = vis->win->file->text; text_appendf(txt, "vis %s, compiled " __DATE__ " " __TIME__ "\n\n", VERSION); @@ -887,7 +887,7 @@ static bool cmd_help(Vis *vis, Filerange *range, enum CmdOpt opt, const char *ar i == VIS_MODE_INSERT); } } - + text_appendf(txt, "\n Text objects\n\n"); print_mode(&vis_modes[VIS_MODE_TEXTOBJ], txt, false); @@ -994,7 +994,7 @@ static Command *lookup_cmd(Vis *vis, const char *name) { if (!vis->cmds) { if (!(vis->cmds = map_new())) return NULL; - + for (Command *cmd = cmds; cmd && cmd->name[0]; cmd++) { for (const char **name = cmd->name; *name; name++) map_put(vis->cmds, *name, cmd); diff --git a/vis-core.h b/vis-core.h index 1333eab..614a206 100644 --- a/vis-core.h +++ b/vis-core.h @@ -21,7 +21,7 @@ typedef struct Mode Mode; struct Mode { Mode *parent; /* if no match is found in this mode, search will continue there */ - Map *bindings; + Map *bindings; const char *name; /* descriptive, user facing name of the mode */ const char *status; /* name displayed in the window status bar */ const char *help; /* short description used by :help */ diff --git a/vis.c b/vis.c index 31e4ecf..0001501 100644 --- a/vis.c +++ b/vis.c @@ -67,10 +67,10 @@ static void file_free(Vis *vis, File *file) { return; if (--file->refcount > 0) return; - + text_free(file->text); free((char*)file->name); - + if (file->prev) file->prev->next = file->next; if (file->next) @@ -111,7 +111,7 @@ static File *file_new(Vis *vis, const char *filename) { text = text_load(NULL); if (!text) return NULL; - + File *file = file_new_text(vis, text); if (!file) { text_free(text); @@ -748,7 +748,7 @@ static const char *vis_keys_raw(Vis *vis, Buffer *buf, const char *input) { char *keys = buf->data, *start = keys, *cur = keys, *end; bool prefix = false; KeyBinding *binding = NULL; - + while (cur && *cur) { if (!(end = (char*)vis_keys_next(vis, cur))) -- 2.11.4.GIT