aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkristoffer.lunden <kristoffer.lunden@dd23f896-6e2b-0410-bc3e-d184d5eb269a>2010-07-02 08:22:02 (GMT)
committerkristoffer.lunden <kristoffer.lunden@dd23f896-6e2b-0410-bc3e-d184d5eb269a>2010-07-02 08:22:02 (GMT)
commit0d0df659d8bdd643f5f0b48eff6affb06996fd61 (patch)
treebd4b35704dabf5e8d2807a4a58c97d23bc32b9ae
parentb212245d0e4cb0fc40da8592e1bad8f1985e36b5 (diff)
downloadgedit-autotab-0d0df659d8bdd643f5f0b48eff6affb06996fd61.zip
gedit-autotab-0d0df659d8bdd643f5f0b48eff6affb06996fd61.tar.gz
gedit-autotab-0d0df659d8bdd643f5f0b48eff6affb06996fd61.tar.bz2
better loop, don't slice the string over and over, thanks to nevdelap
git-svn-id: http://gedit-autotab.googlecode.com/svn/trunk@26 dd23f896-6e2b-0410-bc3e-d184d5eb269a
-rw-r--r--autotab.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/autotab.py b/autotab.py
index a4facfe..1f51ca9 100644
--- a/autotab.py
+++ b/autotab.py
@@ -166,9 +166,9 @@ class AutoTab(gedit.Plugin):
seen_spaces += 1
indent = 0
- while line.startswith(' '):
- indent += 1
- line = line[1:]
+ for indent in range(0, len(line)):
+ if line[indent] != ' ':
+ break
if indent == last_indent:
if last_indent_spaces: