mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Fix indention in editor(1).
This commit is contained in:
parent
9380ed82ac
commit
82b98b4899
5 changed files with 19 additions and 19 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue