SF.net SVN: geany:[4883] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Sat May 8 13:10:25 UTC 2010


Revision: 4883
          http://geany.svn.sourceforge.net/geany/?rev=4883&view=rev
Author:   eht16
Date:     2010-05-08 13:10:24 +0000 (Sat, 08 May 2010)

Log Message:
-----------
Don't auto-close short XML tags (closes #2994852).

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/utils.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2010-05-08 13:10:14 UTC (rev 4882)
+++ trunk/ChangeLog	2010-05-08 13:10:24 UTC (rev 4883)
@@ -3,6 +3,8 @@
  * src/highlighting.c:
    Apply foreground and background colours of the folding margin
    style properly (closes #2998347).
+ * src/utils.c:
+   Don't auto-close short XML tags (closes #2994852).
 
 
 2010-05-07  Nick Treleaven  <nick(dot)treleaven(at)btinternet(dot)com>

Modified: trunk/src/utils.c
===================================================================
--- trunk/src/utils.c	2010-05-08 13:10:14 UTC (rev 4882)
+++ trunk/src/utils.c	2010-05-08 13:10:24 UTC (rev 4883)
@@ -292,9 +292,21 @@
 	else
 		cur = &sel[size - 1];
 
-	cur--; /* Skip past the > */
+	/* Skip to the character before the closing brace */
 	while (cur > begin)
 	{
+		if (*cur == '>')
+			break;
+		--cur;
+	}
+	--cur;
+	/* skip whitespace */
+	while (cur > begin && isspace(*cur))
+		cur--;
+	if (*cur == '/')
+		return NULL; /* we found a short tag which doesn't need to be closed */
+	while (cur > begin)
+	{
 		if (*cur == '<') break;
 		else if (! check_tag && *cur == '>') break;
 		--cur;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the Commits mailing list