[gnome-builder] auto-indent: avoid extra close elements on extraneous >
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] auto-indent: avoid extra close elements on extraneous >
- Date: Tue, 13 Jan 2015 00:59:00 +0000 (UTC)
commit d83925f270d9bafa34e0d858ab801c397bbd4af2
Author: Christian Hergert <christian hergert me>
Date: Mon Jan 12 16:58:53 2015 -0800
auto-indent: avoid extra close elements on extraneous >
src/auto-indent/gb-source-auto-indenter-xml.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/src/auto-indent/gb-source-auto-indenter-xml.c b/src/auto-indent/gb-source-auto-indenter-xml.c
index ee47854..2781337 100644
--- a/src/auto-indent/gb-source-auto-indenter-xml.c
+++ b/src/auto-indent/gb-source-auto-indenter-xml.c
@@ -310,6 +310,18 @@ gb_source_auto_indenter_xml_maybe_add_closing (GbSourceAutoIndenterXml *xml,
if (gtk_text_iter_backward_search (©, "<", GTK_TEXT_SEARCH_TEXT_ONLY,
&match_begin, &match_end, NULL))
{
+ gchar *text;
+
+ /* avoid closing elements on spurious > */
+ gtk_text_iter_backward_char (©);
+ text = gtk_text_iter_get_slice (&match_begin, ©);
+ if (strchr (text, '>'))
+ {
+ g_free (text);
+ return NULL;
+ }
+ g_free (text);
+
gtk_text_iter_forward_char (&match_begin);
if (gtk_text_iter_get_char (&match_begin) == '/')
return NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]