Loading ui/textedit_area.py +0 −12 Original line number Diff line number Diff line Loading @@ -192,19 +192,7 @@ class SourceTextEdit(QTextEdit): input_method_used = True self.input_method_from = -1 elif self.change_added > 0: text = self.toPlainText() len_text = len(text) cursor = self.textCursor() if self.change_added > len_text or change_from + self.change_added > len_text: self.change_added = 1 change_from = self.textCursor().position() - 1 cursor.setPosition(change_from) cursor.setPosition(change_from + self.change_added, QTextCursor.MoveMode.KeepAnchor) added_text = cursor.selectedText() if added_text == '…' or added_text == '—': self.change_added = 2 change_from -= 1 cursor.setPosition(change_from) cursor.setPosition(change_from + self.change_added, QTextCursor.MoveMode.KeepAnchor) added_text = cursor.selectedText() Loading ui/textitem.py +0 −18 Original line number Diff line number Diff line Loading @@ -102,25 +102,7 @@ class TextBlkItem(QGraphicsTextItem): self.input_method_from = -1 elif self.change_added > 0: len_text = len(self.toPlainText()) cursor = self.textCursor() # if self.change_added > len_text: # self.change_added = 1 # change_from = self.textCursor().position() - 1 # input_method_used = True # cursor.setPosition(change_from) # cursor.setPosition(change_from + self.change_added, QTextCursor.MoveMode.KeepAnchor) if self.change_added > len_text or change_from + self.change_added > len_text: self.change_added = 1 change_from = self.textCursor().position() - 1 cursor.setPosition(change_from) cursor.setPosition(change_from + self.change_added, QTextCursor.MoveMode.KeepAnchor) added_text = cursor.selectedText() if added_text == '…' or added_text == '—': self.change_added = 2 change_from -= 1 cursor.setPosition(change_from) cursor.setPosition(change_from + self.change_added, QTextCursor.MoveMode.KeepAnchor) Loading Loading
ui/textedit_area.py +0 −12 Original line number Diff line number Diff line Loading @@ -192,19 +192,7 @@ class SourceTextEdit(QTextEdit): input_method_used = True self.input_method_from = -1 elif self.change_added > 0: text = self.toPlainText() len_text = len(text) cursor = self.textCursor() if self.change_added > len_text or change_from + self.change_added > len_text: self.change_added = 1 change_from = self.textCursor().position() - 1 cursor.setPosition(change_from) cursor.setPosition(change_from + self.change_added, QTextCursor.MoveMode.KeepAnchor) added_text = cursor.selectedText() if added_text == '…' or added_text == '—': self.change_added = 2 change_from -= 1 cursor.setPosition(change_from) cursor.setPosition(change_from + self.change_added, QTextCursor.MoveMode.KeepAnchor) added_text = cursor.selectedText() Loading
ui/textitem.py +0 −18 Original line number Diff line number Diff line Loading @@ -102,25 +102,7 @@ class TextBlkItem(QGraphicsTextItem): self.input_method_from = -1 elif self.change_added > 0: len_text = len(self.toPlainText()) cursor = self.textCursor() # if self.change_added > len_text: # self.change_added = 1 # change_from = self.textCursor().position() - 1 # input_method_used = True # cursor.setPosition(change_from) # cursor.setPosition(change_from + self.change_added, QTextCursor.MoveMode.KeepAnchor) if self.change_added > len_text or change_from + self.change_added > len_text: self.change_added = 1 change_from = self.textCursor().position() - 1 cursor.setPosition(change_from) cursor.setPosition(change_from + self.change_added, QTextCursor.MoveMode.KeepAnchor) added_text = cursor.selectedText() if added_text == '…' or added_text == '—': self.change_added = 2 change_from -= 1 cursor.setPosition(change_from) cursor.setPosition(change_from + self.change_added, QTextCursor.MoveMode.KeepAnchor) Loading