Disable buggy composer backspace override

This commit is contained in:
miruka
2020-03-09 08:09:58 -04:00
parent 0fa16400df
commit ca8dd65f34
2 changed files with 24 additions and 22 deletions

View File

@@ -45,10 +45,10 @@ Rectangle {
readonly property string lineTextUntilCursor:
lineText.substring(0, cursorX)
readonly property int deleteCharsOnBackspace:
lineTextUntilCursor.match(/^ +$/) ?
lineTextUntilCursor.match(/ {1,4}/g).slice(-1)[0].length :
1
// readonly property int deleteCharsOnBackspace:
// lineTextUntilCursor.match(/^ +$/) ?
// lineTextUntilCursor.match(/ {1,4}/g).slice(-1)[0].length :
// 1
function takeFocus() { areaScrollView.forceActiveFocus() }
@@ -199,16 +199,17 @@ Rectangle {
return
}
if (ev.modifiers === Qt.NoModifier &&
ev.key === Qt.Key_Backspace &&
! textArea.selectedText)
{
ev.accepted = true
textArea.remove(
cursorPosition - deleteCharsOnBackspace,
cursorPosition
)
}
// FIXME: buggy
// if (ev.modifiers === Qt.NoModifier &&
// ev.key === Qt.Key_Backspace &&
// ! textArea.selectedText)
// {
// ev.accepted = true
// textArea.remove(
// cursorPosition - deleteCharsOnBackspace,
// cursorPosition
// )
// }
})
}
}