[gnome-builder] auto-indent: try to work around escaped characters in strings.
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] auto-indent: try to work around escaped characters in strings.
- Date: Fri, 17 Oct 2014 01:08:52 +0000 (UTC)
commit 848f21d6dfe70af925880a7bbd2c6d6f1e5d55e1
Author: Christian Hergert <christian hergert me>
Date: Thu Oct 16 18:08:29 2014 -0700
auto-indent: try to work around escaped characters in strings.
src/auto-indent/gb-source-auto-indenter-c.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/auto-indent/gb-source-auto-indenter-c.c b/src/auto-indent/gb-source-auto-indenter-c.c
index 9451f15..c385ad2 100644
--- a/src/auto-indent/gb-source-auto-indenter-c.c
+++ b/src/auto-indent/gb-source-auto-indenter-c.c
@@ -237,7 +237,13 @@ backward_find_matching_char (GtkTextIter *iter,
strcur = gtk_text_iter_get_char (iter);
if (strcur == cur)
{
- /* TODO: Check back for escape char */
+ GtkTextIter copy2 = *iter;
+
+ /* check if the character before this is an escape char */
+ if (gtk_text_iter_backward_char (©2) &&
+ ('\\' == gtk_text_iter_get_char (©2)))
+ continue;
+
break;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]