[gnome-builder/gnome-builder-3-18] python: fix array boundary when text length is too short



commit 7fbc45e97693f60c02221a0503be3bf49e894766
Author: Christian Hergert <christian hergert me>
Date:   Sat Oct 3 14:35:47 2015 -0700

    python: fix array boundary when text length is too short

 plugins/python-pack/python_indenter.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/plugins/python-pack/python_indenter.py b/plugins/python-pack/python_indenter.py
index 1ca0e48..33e255a 100644
--- a/plugins/python-pack/python_indenter.py
+++ b/plugins/python-pack/python_indenter.py
@@ -486,7 +486,7 @@ class PythonIndenter(GObject.Object): #, Ide.Indenter):
             forward_to_nonspace(end)
             text = prev.get_slice(end)
             i = 0
-            while i < column:
+            while i < column and i < len(text):
                 if text[i] == '\t':
                     if i + 4 > column:
                         break


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]