DocumentPrivate: Review del/backspace
Needs ReviewPublic

Authored by loh.tar on Mar 15 2019, 2:03 PM.

Details

Reviewers
None
Group Reviewers
KTextEditor
Summary
  • Avoid bad selection in some case of undo in block mode
  • Don't try to expand selection in block mode when cursor is in col 0 on backspace
  • Improve/fix documentation
  • Code cosmetic

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
loh.tar created this revision.Mar 15 2019, 2:03 PM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptMar 15 2019, 2:03 PM
Restricted Application added subscribers: kde-frameworks-devel, kwrite-devel. · View Herald Transcript
loh.tar requested review of this revision.Mar 15 2019, 2:03 PM

This patch is the byproduct of some playing with RTL text, Bug 385694.
But a sane solution may need some more effort, so I tend to not offer my current state of that playing.

Wow! Great :)
Thanks for looking into this, but I'm afraid that the problem isn't with backspace/del, but with the cursor positioning, at least for RTL and mixed text.
I actually found this to be a problem in Qt after trying to solve it myself in KTextEditor: https://bugreports.qt.io/browse/QTBUG-65508
Not sure what's the root of the problem :(

I had recently submit a patch which was also affected by RTL text D19621. Should this patch here be accepted I can upload my current state of the mentioned playing, which works similar as that D19621. It's for me very frustrating to test because I never know what is to be expect or what currently happens. Your Qt report make it even worse.

Probably can we not much do for a perfect solution as long Qt has some serious problem as your Qt bug report says.

BTW I noticed that typing a bracket in RTL text these is shown mirrored, very confusing too.

I'm afraid that the problem isn't with backspace/del, but with the cursor positioning

hm, currently is by backspace something to the right removed and by del to the left. So I think that's wrong and my patch fix that at least for backspace...in most cases IIRC. Then I stopped my playing.