From 82b98b4899c131cd33277f19d6259732b09df371 Mon Sep 17 00:00:00 2001 From: Alexandros Alexandrou Date: Sun, 11 Mar 2018 18:10:09 +0200 Subject: [PATCH] Fix indention in editor(1). --- editor/command.c | 8 ++++---- editor/cursor.c | 4 ++-- editor/highlight.c | 18 +++++++++--------- editor/input.c | 6 +++--- editor/terminal.h | 2 +- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/editor/command.c b/editor/command.c index 883d6bf0..46a5c3f9 100644 --- a/editor/command.c +++ b/editor/command.c @@ -235,8 +235,8 @@ void editor_type_exit_select_right(struct editor* editor) { size_t column, row; row_column_biggest(editor->cursor_row, editor->cursor_column, - editor->select_row, editor->select_column, - &column, &row); + editor->select_row, editor->select_column, + &column, &row); editor_cursor_set(editor, column, row); return; } @@ -409,7 +409,7 @@ void editor_type_control_select_up(struct editor* editor) void editor_type_down(struct editor* editor) { editor_type_exit_select_right(editor); - if ( editor->cursor_row+1 == editor->lines_used ) + if ( editor->cursor_row+1 == editor->lines_used ) { editor_cursor_column_set(editor, editor->lines[editor->cursor_row].used); return; @@ -423,7 +423,7 @@ void editor_type_down(struct editor* editor) void editor_type_select_down(struct editor* editor) { - if ( editor->select_row+1 == editor->lines_used ) + if ( editor->select_row+1 == editor->lines_used ) { editor_select_column_set(editor, editor->lines[editor->select_row].used); return; diff --git a/editor/cursor.c b/editor/cursor.c index b290f350..b6676012 100644 --- a/editor/cursor.c +++ b/editor/cursor.c @@ -34,7 +34,7 @@ size_t editor_select_column_set(struct editor* editor, size_t x) if ( rx < editor->page_x_offset ) editor->page_x_offset = rx; if ( editor->page_x_offset + editor->viewport_width <= rx ) - editor->page_x_offset = rx + 1- editor->viewport_width; + editor->page_x_offset = rx + 1 - editor->viewport_width; } return editor->select_column = x; } @@ -46,7 +46,7 @@ size_t editor_select_row_set(struct editor* editor, size_t y) if ( y < editor->page_y_offset ) editor->page_y_offset = y; if ( editor->page_y_offset + editor->viewport_height <= y ) - editor->page_y_offset = y + 1- editor->viewport_height; + editor->page_y_offset = y + 1 - editor->viewport_height; } return editor->select_row = y; } diff --git a/editor/highlight.c b/editor/highlight.c index 6589586b..90acfb97 100644 --- a/editor/highlight.c +++ b/editor/highlight.c @@ -33,15 +33,15 @@ enum language language_of_path(const char* path) size_t path_length = strlen(path); if ( 2 <= path_length && (!strcmp(path+path_length-2, ".c") || - !strcmp(path+path_length-2, ".h")) ) + !strcmp(path+path_length-2, ".h")) ) return LANGUAGE_C_CXX; if ( 4 <= path_length && (!strcmp(path+path_length-4, ".c++") || - !strcmp(path+path_length-4, ".h++") || - !strcmp(path+path_length-4, ".cxx") || - !strcmp(path+path_length-4, ".hxx") || - !strcmp(path+path_length-4, ".cpp") || - !strcmp(path+path_length-4, ".hpp")) ) + !strcmp(path+path_length-4, ".h++") || + !strcmp(path+path_length-4, ".cxx") || + !strcmp(path+path_length-4, ".hxx") || + !strcmp(path+path_length-4, ".cpp") || + !strcmp(path+path_length-4, ".hpp")) ) return LANGUAGE_C_CXX; if ( (5 <= path_length && !strcmp(path+path_length-5, ".diff")) || (6 <= path_length && !strcmp(path+path_length-6, ".patch")) ) @@ -111,7 +111,7 @@ static size_t recognize_constant(const wchar_t* string, size_t string_length) string[result] == L'L') ) result++; else if ( result < string_length && (string[result] == L'f' || - string[result] == L'F') ) + string[result] == L'F') ) result++; } else @@ -120,10 +120,10 @@ static size_t recognize_constant(const wchar_t* string, size_t string_length) string[result] == L'U') ) result++; if ( result < string_length && (string[result] == L'l' || - string[result] == L'L') ) + string[result] == L'L') ) result++; if ( result < string_length && (string[result] == L'l' || - string[result] == L'L') ) + string[result] == L'L') ) result++; } return result; diff --git a/editor/input.c b/editor/input.c index fa9f8eaa..c6327ec7 100644 --- a/editor/input.c +++ b/editor/input.c @@ -311,9 +311,9 @@ void editor_input_process(struct editor_input* editor_input, if ( full_match ) { editor_emulate_kbkey(editor, - terminal_sequences[match].kbkey, - terminal_sequences[match].control, - terminal_sequences[match].shift); + terminal_sequences[match].kbkey, + terminal_sequences[match].control, + terminal_sequences[match].shift); memmove(editor_input->termseq, editor_input->termseq + match_size, editor_input->termseq_used - match_size); diff --git a/editor/terminal.h b/editor/terminal.h index b898f7c9..5fd1bfee 100644 --- a/editor/terminal.h +++ b/editor/terminal.h @@ -76,7 +76,7 @@ void row_column_smallest(size_t ra, size_t ca, size_t rb, size_t cb, __attribute__((unused)) static inline void row_column_biggest(size_t ra, size_t ca, size_t rb, size_t cb, - size_t* row, size_t* column) + size_t* row, size_t* column) { if ( is_row_column_lt(ra, ca, rb, cb) ) *row = rb, *column = cb;