[geany/geany] 018408: Fix an assertion failure when trying to scope-complete in a 2-characters C++ file

Colomban Wendling git-noreply at xxxxx
Thu Dec 4 13:38:57 UTC 2014


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Thu, 04 Dec 2014 13:38:57 UTC
Commit:      0184083a7e1216169d0879d66b67799e9bf638c9
             https://github.com/geany/geany/commit/0184083a7e1216169d0879d66b67799e9bf638c9

Log Message:
-----------
Fix an assertion failure when trying to scope-complete in a 2-characters C++ file


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

Modified: src/editor.c
4 lines changed, 2 insertions(+), 2 deletions(-)
===================================================================
@@ -709,9 +709,9 @@ static void autocomplete_scope(GeanyEditor *editor)
 
 	if (ft->id == GEANY_FILETYPES_C || ft->id == GEANY_FILETYPES_CPP)
 	{
-		if (match_last_chars(sci, pos, "->") || match_last_chars(sci, pos, "::"))
+		if (pos >= 2 && (match_last_chars(sci, pos, "->") || match_last_chars(sci, pos, "::")))
 			pos--;
-		else if (ft->id == GEANY_FILETYPES_CPP && match_last_chars(sci, pos, "->*"))
+		else if (ft->id == GEANY_FILETYPES_CPP && pos >= 3 && match_last_chars(sci, pos, "->*"))
 			pos-=2;
 		else if (typed != '.')
 			return;



--------------
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