[gnome-builder/gnome-builder-3-18] python: copy string rank indentation
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder/gnome-builder-3-18] python: copy string rank indentation
- Date: Tue, 13 Oct 2015 07:34:46 +0000 (UTC)
commit 7d4dc32932ace006a5eb066dc145e5d1b90dc5e1
Author: Christian Hergert <christian hergert me>
Date: Sat Oct 3 15:23:35 2015 -0700
python: copy string rank indentation
plugins/python-pack/python_indenter.py | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/plugins/python-pack/python_indenter.py b/plugins/python-pack/python_indenter.py
index cfcfe65..94386cd 100644
--- a/plugins/python-pack/python_indenter.py
+++ b/plugins/python-pack/python_indenter.py
@@ -488,6 +488,12 @@ class PythonIndenter(GObject.Object): #, Ide.Indenter):
suffix = '# '
return self.copy_indent(view, iter, suffix=suffix)
+ # Copy the indentation for the beginning of the string if we are
+ # possibily in a multi-line string.
+ if nearest.rank == Rank.STRING:
+ indent = self.get_indent_at_visual_column(nearest.column, iter)
+ return '\n' + indent, 0
+
if self.settings.align_params \
and discoveries.select_tail(Rank.FUNCTION, Rank.TUPLE):
# indent for the tuple begin position plus a space to move
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]