[gnome-builder] xml: don't add matching closing element for <! style elements.
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] xml: don't add matching closing element for <! style elements.
- Date: Sun, 11 Jan 2015 07:46:46 +0000 (UTC)
commit b0e8c997d692368aa217285430a1ca10a822dfc6
Author: Christian Hergert <christian hergert me>
Date: Sat Jan 10 23:46:20 2015 -0800
xml: don't add matching closing element for <! style elements.
src/auto-indent/gb-source-auto-indenter-xml.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/auto-indent/gb-source-auto-indenter-xml.c b/src/auto-indent/gb-source-auto-indenter-xml.c
index 4406c12..ee47854 100644
--- a/src/auto-indent/gb-source-auto-indenter-xml.c
+++ b/src/auto-indent/gb-source-auto-indenter-xml.c
@@ -23,6 +23,7 @@
#include "gb-log.h"
#include "gb-source-auto-indenter-xml.h"
#include "gb-gtk.h"
+#include "gb-string.h"
/*
* TODO:
@@ -318,11 +319,15 @@ gb_source_auto_indenter_xml_maybe_add_closing (GbSourceAutoIndenterXml *xml,
if (gtk_text_iter_forward_find_char (&match_end, find_end, NULL, begin))
{
gchar *slice;
- gchar *ret;
+ gchar *ret = NULL;
slice = gtk_text_iter_get_slice (&match_begin, &match_end);
- ret = g_strdup_printf ("</%s>", slice);
- *cursor_offset = -strlen (ret);
+
+ if (!gb_str_empty0 (slice) && (*slice != '!'))
+ {
+ ret = g_strdup_printf ("</%s>", slice);
+ *cursor_offset = -strlen (ret);
+ }
g_free (slice);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]