[geany/geany] 444a18: calltips: Allow for C++-style explicit specialization after the name

Colomban Wendling git-noreply at xxxxx
Wed Feb 17 17:49:32 UTC 2016


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Wed, 17 Feb 2016 17:49:32 UTC
Commit:      444a18b5e14ea089dbd7f3c294f87f8f32c2d17c
             https://github.com/geany/geany/commit/444a18b5e14ea089dbd7f3c294f87f8f32c2d17c

Log Message:
-----------
calltips: Allow for C++-style explicit specialization after the name

Closes #496.

Based on PR#496 by @DThought, thanks.


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

Modified: src/editor.c
11 lines changed, 11 insertions(+), 0 deletions(-)
===================================================================
@@ -2026,6 +2026,17 @@ gboolean editor_show_calltip(GeanyEditor *editor, gint pos)
 	while (pos > 0 && isspace(sci_get_char_at(sci, pos - 1)))
 		pos--;
 
+	/* skip possible generic/template specification, like foo<int>() */
+	if (sci_get_char_at(sci, pos - 1) == '>')
+	{
+		pos = sci_find_matching_brace(sci, pos - 1);
+		if (pos == -1)
+			return FALSE;
+
+		while (pos > 0 && isspace(sci_get_char_at(sci, pos - 1)))
+			pos--;
+	}
+
 	word[0] = '\0';
 	editor_find_current_word(editor, pos - 1, word, sizeof word, NULL);
 	if (word[0] == '\0')



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