Skip to content

Commit 9399cab

Browse files
Fix some bugs with pyside and python 2
1 parent 288feb7 commit 9399cab

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

pyqode/python/modes/autoindent.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,14 +134,14 @@ def _between_paren(self, tc, col):
134134
@staticmethod
135135
def _get_last_word(tc):
136136
tc2 = QTextCursor(tc)
137-
tc2.movePosition(QTextCursor.Left, 1)
137+
tc2.movePosition(QTextCursor.Left, tc.MoveAnchor, 1)
138138
tc2.movePosition(QTextCursor.WordLeft, tc.KeepAnchor)
139139
return tc2.selectedText().strip()
140140

141141
@staticmethod
142142
def _get_last_word_unstripped(tc):
143143
tc2 = QTextCursor(tc)
144-
tc2.movePosition(QTextCursor.Left, 1)
144+
tc2.movePosition(QTextCursor.Left, tc.MoveAnchor, 1)
145145
tc2.movePosition(QTextCursor.WordLeft, tc.KeepAnchor)
146146
return tc2.selectedText()
147147

0 commit comments

Comments
 (0)