[geany/geany-plugins] 3c3ff8: Automark: Don't try to get some selection if line is empty

Frank Lanitz git-noreply at xxxxx
Wed Jan 4 19:47:03 UTC 2017


Branch:      refs/heads/master
Author:      Frank Lanitz <frank at frank.uvena.de>
Committer:   Frank Lanitz <frank at frank.uvena.de>
Date:        Wed, 04 Jan 2017 19:47:03 UTC
Commit:      3c3ff8c2a70cc615d26db14387d79587d23bf465
             https://github.com/geany/geany-plugins/commit/3c3ff8c2a70cc615d26db14387d79587d23bf465

Log Message:
-----------
Automark: Don't try to get some selection if line is empty


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

Modified: automark/src/automark.c
3 lines changed, 3 insertions(+), 0 deletions(-)
===================================================================
@@ -87,6 +87,9 @@ get_current_word(ScintillaObject *sci)
 	gint start = SSM(sci, SCI_WORDSTARTPOSITION, pos, TRUE);
 	gint end = SSM(sci, SCI_WORDENDPOSITION, pos, TRUE);
 
+	if (end == start)
+		return NULL;
+
 	if ((guint)(end - start) >= GEANY_MAX_WORD_LENGTH)
 		end = start + (GEANY_MAX_WORD_LENGTH - 1);
 	return sci_get_contents_range(sci, start, end);



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


More information about the Plugins-Commits mailing list