Skip to content

Commit

Permalink
Remove unused parameter
Browse files Browse the repository at this point in the history
Since 320e4b9 the "smart line
indentation" explicitly doesn't restore cursor position, and doesn't
make use of the position parameter, which no caller really use anyway.
Remove it altogether to avoid confusion.
  • Loading branch information
b4n committed Jun 15, 2018
1 parent 4641ce3 commit 99851b5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
5 changes: 1 addition & 4 deletions src/editor.c
Expand Up @@ -3931,7 +3931,7 @@ static void smart_line_indentation(GeanyEditor *editor, gint first_line, gint la


/* simple indentation to indent the current line with the same indent as the previous one */
void editor_smart_line_indentation(GeanyEditor *editor, gint pos)
void editor_smart_line_indentation(GeanyEditor *editor)
{
gint first_line, last_line;
gint first_sel_start, first_sel_end;
Expand All @@ -3949,9 +3949,6 @@ void editor_smart_line_indentation(GeanyEditor *editor, gint pos)
last_line = sci_get_line_from_position(sci, first_sel_end - editor_get_eol_char_len(editor));
last_line = MAX(first_line, last_line);

if (pos == -1)
pos = first_sel_start;

sci_start_undo_action(sci);

smart_line_indentation(editor, first_line, last_line);
Expand Down
2 changes: 1 addition & 1 deletion src/editor.h
Expand Up @@ -258,7 +258,7 @@ void editor_insert_alternative_whitespace(GeanyEditor *editor);

void editor_indent(GeanyEditor *editor, gboolean increase);

void editor_smart_line_indentation(GeanyEditor *editor, gint pos);
void editor_smart_line_indentation(GeanyEditor *editor);

void editor_indentation_by_one_space(GeanyEditor *editor, gint pos, gboolean decrease);

Expand Down
2 changes: 1 addition & 1 deletion src/keybindings.c
Expand Up @@ -2489,7 +2489,7 @@ static gboolean cb_func_format_action(guint key_id)
editor_indentation_by_one_space(doc->editor, -1, TRUE);
break;
case GEANY_KEYS_FORMAT_AUTOINDENT:
editor_smart_line_indentation(doc->editor, -1);
editor_smart_line_indentation(doc->editor);
break;
case GEANY_KEYS_FORMAT_TOGGLECASE:
on_toggle_case1_activate(NULL, NULL);
Expand Down

0 comments on commit 99851b5

Please sign in to comment.