[gnome-builder] libide: Fix parsing indent-tabs-mode in modelines
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] libide: Fix parsing indent-tabs-mode in modelines
- Date: Wed, 28 Oct 2015 18:01:06 +0000 (UTC)
commit c203c4761de1143a8de6e77d058668544d9f36f3
Author: Philip Withnall <philip withnall collabora co uk>
Date: Wed Oct 28 09:09:36 2015 +0000
libide: Fix parsing indent-tabs-mode in modelines
If a modeline contains (for example) ‘indent-tabs-mode: t’, libide was
explicitly setting IDE_INDENT_STYLE_SPACES. It was assuming that
MODELINE_SET_INSERT_SPACES being set meant that spaces were in use,
rather than the intended meaning of options.insert_spaces being
meaningful.
https://bugzilla.gnome.org/show_bug.cgi?id=757236
libide/modelines/modeline-parser.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/libide/modelines/modeline-parser.c b/libide/modelines/modeline-parser.c
index 8b074bf..a0fdf92 100644
--- a/libide/modelines/modeline-parser.c
+++ b/libide/modelines/modeline-parser.c
@@ -722,7 +722,9 @@ modeline_parser_apply_modeline (GtkTextBuffer *buffer,
we set them before */
if (has_option (&options, MODELINE_SET_INSERT_SPACES))
{
- ide_file_settings_set_indent_style (file_settings, IDE_INDENT_STYLE_SPACES);
+ IdeIndentStyle style;
+ style = options.insert_spaces ? IDE_INDENT_STYLE_SPACES : IDE_INDENT_STYLE_TABS;
+ ide_file_settings_set_indent_style (file_settings, style);
}
else
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]