[geany/geany] 99851b: Remove unused parameter

Colomban Wendling git-noreply at xxxxx
Sun Dec 16 18:06:48 UTC 2018


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Fri, 15 Jun 2018 21:06:10 UTC
Commit:      99851b592a77d06229cc1b5a14d89c3db347a268
             https://github.com/geany/geany/commit/99851b592a77d06229cc1b5a14d89c3db347a268

Log Message:
-----------
Remove unused parameter

Since 320e4b9d762e0bd7d550c62be614873db5a04ac4 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.


Modified Paths:
--------------
    src/editor.c
    src/editor.h
    src/keybindings.c

Modified: src/editor.c
5 lines changed, 1 insertions(+), 4 deletions(-)
===================================================================
@@ -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;
@@ -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);


Modified: src/editor.h
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -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);
 


Modified: src/keybindings.c
2 lines changed, 1 insertions(+), 1 deletions(-)
===================================================================
@@ -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);



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Commits mailing list