Merge pull request #405 from vkbo/issue_396
Issue #396: Select Paragraph Fix
This commit is contained in:
@@ -1165,7 +1165,19 @@ class GuiDocEditor(QTextEdit):
|
|||||||
theCursor = self.textCursor()
|
theCursor = self.textCursor()
|
||||||
theCursor.clearSelection()
|
theCursor.clearSelection()
|
||||||
theCursor.select(selMode)
|
theCursor.select(selMode)
|
||||||
|
|
||||||
|
if selMode == QTextCursor.BlockUnderCursor:
|
||||||
|
# This selection mode also selects the preceding oaragraph
|
||||||
|
# separator, which we want to avoid.
|
||||||
|
posS = theCursor.selectionStart()
|
||||||
|
posE = theCursor.selectionEnd()
|
||||||
|
selTxt = theCursor.selectedText()
|
||||||
|
if selTxt.startswith(nwUnicode.U_PSEP):
|
||||||
|
theCursor.setPosition(posS+1, QTextCursor.MoveAnchor)
|
||||||
|
theCursor.setPosition(posE, QTextCursor.KeepAnchor)
|
||||||
|
|
||||||
self.setTextCursor(theCursor)
|
self.setTextCursor(theCursor)
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def _beginSearch(self):
|
def _beginSearch(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user