[gnome-builder] sourceview: Fix overriding closing '
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] sourceview: Fix overriding closing '
- Date: Tue, 22 Mar 2022 17:42:02 +0000 (UTC)
commit 5b8b483f817d077e9ec97a0a76d39fff018ba134
Author: Florian Müllner <fmuellner gnome org>
Date: Tue Mar 22 15:55:12 2022 +0100
sourceview: Fix overriding closing '
When a matching character is the same as the opening one, then
comparing the counts in the line isn't useful, as they are the
same by definition.
The current code recognizes that by special-casing `"`. Do the
same for `'` to get the correct behavior for chars/single-quote
strings as well.
src/libide/sourceview/ide-source-view.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/src/libide/sourceview/ide-source-view.c b/src/libide/sourceview/ide-source-view.c
index 34b73af31..3254f15eb 100644
--- a/src/libide/sourceview/ide-source-view.c
+++ b/src/libide/sourceview/ide-source-view.c
@@ -1496,7 +1496,7 @@ ide_source_view_maybe_overwrite (IdeSourceView *self,
case ')': case ']': case '}': case '"': case '\'': case ';':
if (ch == next_ch)
{
- if (ch == '"')
+ if (ch == '"' || ch == '\'')
break;
switch (ch)
@@ -1504,7 +1504,6 @@ ide_source_view_maybe_overwrite (IdeSourceView *self,
case ']': match = '['; break;
case '}': match = '{'; break;
case ')': match = '('; break;
- case '\'': match = '\''; break;
case '>': match = '<'; break;
default: match = 0; break;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]