[geany/geany] b6fe9f: Merge pull request #1878 from b4n/issue-1876

Colomban Wendling git-noreply at xxxxx
Sun Dec 16 17:55:06 UTC 2018


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Sun, 16 Dec 2018 17:55:06 UTC
Commit:      b6fe9f17aeae40ab48e73481e618877e65db464b
             https://github.com/geany/geany/commit/b6fe9f17aeae40ab48e73481e618877e65db464b

Log Message:
-----------
Merge pull request #1878 from b4n/issue-1876

Various fixes reported in #1876


Modified Paths:
--------------
    ctags/parsers/perl.c
    src/dialogs.c
    src/editor.c
    src/editor.h
    src/keybindings.c

Modified: ctags/parsers/perl.c
1 lines changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -324,6 +324,7 @@ static void findPerlTags (void)
 				if (true == isSubroutineDeclaration(cp)) {
 					if (true == PerlKinds[K_SUBROUTINE_DECLARATION].enabled) {
 						kind = K_SUBROUTINE_DECLARATION;
+						e.kind = &(PerlKinds[kind]);
 					} else {
 						vStringClear (name);
 						continue;


Modified: src/dialogs.c
1 lines changed, 1 insertions(+), 0 deletions(-)
===================================================================
@@ -492,6 +492,7 @@ static gboolean handle_save_as(const gchar *utf8_filename, gboolean rename_file)
 	GeanyDocument *doc = document_get_current();
 	gboolean success = FALSE;
 
+	g_return_val_if_fail(doc != NULL, FALSE);
 	g_return_val_if_fail(!EMPTY(utf8_filename), FALSE);
 
 	if (doc->file_name != NULL)


Modified: src/editor.c
15 lines changed, 5 insertions(+), 10 deletions(-)
===================================================================
@@ -3115,7 +3115,7 @@ void editor_do_comment_toggle(GeanyEditor *editor)
 	gint count_commented = 0, count_uncommented = 0;
 	gchar sel[256];
 	const gchar *co, *cc;
-	gboolean break_loop = FALSE, single_line = FALSE;
+	gboolean single_line = FALSE;
 	gboolean first_line_was_comment = FALSE;
 	gboolean last_line_was_comment = FALSE;
 	gsize co_len;
@@ -3147,7 +3147,7 @@ void editor_do_comment_toggle(GeanyEditor *editor)
 
 	sci_start_undo_action(editor->sci);
 
-	for (i = first_line; (i <= last_line) && (! break_loop); i++)
+	for (i = first_line; i <= last_line; i++)
 	{
 		gint buf_len;
 
@@ -3207,7 +3207,6 @@ void editor_do_comment_toggle(GeanyEditor *editor)
 			}
 
 			/* break because we are already on the last line */
-			break_loop = TRUE;
 			break;
 		}
 	}
@@ -3286,7 +3285,7 @@ gint editor_do_comment(GeanyEditor *editor, gint line, gboolean allow_empty_line
 	gint count = 0;
 	gchar sel[256];
 	const gchar *co, *cc;
-	gboolean break_loop = FALSE, single_line = FALSE;
+	gboolean single_line = FALSE;
 	GeanyFiletype *ft;
 
 	g_return_val_if_fail(editor != NULL && editor->document->file_type != NULL, 0);
@@ -3319,7 +3318,7 @@ gint editor_do_comment(GeanyEditor *editor, gint line, gboolean allow_empty_line
 
 	sci_start_undo_action(editor->sci);
 
-	for (i = first_line; (i <= last_line) && (! break_loop); i++)
+	for (i = first_line; i <= last_line; i++)
 	{
 		gint buf_len;
 
@@ -3371,7 +3370,6 @@ gint editor_do_comment(GeanyEditor *editor, gint line, gboolean allow_empty_line
 				count = 1;
 
 				/* break because we are already on the last line */
-				break_loop = TRUE;
 				break;
 			}
 		}
@@ -3932,7 +3930,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;
@@ -3950,9 +3948,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(-)
===================================================================
@@ -2491,7 +2491,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