ModeBase::goToPos: Ensure jump target is valid
ClosedPublic

Authored by loh.tar on Feb 28 2019, 3:13 AM.

Details

Summary

BUG:377200
FIXED-IN: 5.56

Diff Detail

Repository
R39 KTextEditor
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
loh.tar created this revision.Feb 28 2019, 3:13 AM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptFeb 28 2019, 3:13 AM
Restricted Application added subscribers: kde-frameworks-devel, kwrite-devel. · View Herald Transcript
loh.tar requested review of this revision.Feb 28 2019, 3:13 AM
  • Is "Fixed in" the right term and number?
  • I noticed that the cursor jumps one line where I would expect not to move, but I don't use vi-mode

It's FIXED-IN: 5.56...

Hm, who is passing an invalid range here? Would it be the same to check r.isValid()?

Hm, who is passing an invalid range here?

Does it matter? Can't remember. Want to see the bt?

Would it be the same to check r.isValid()?

No. No such function :p It's a vimode range (?)

loh.tar edited the summary of this revision. (Show Details)Mar 1 2019, 7:21 PM

Ah, r.toEditorRange().isValid() is the trick, yes, would work.

cullmann accepted this revision.Mar 2 2019, 3:05 PM
cullmann added a subscriber: cullmann.

In any case, I think it is OK to make this function save for invalid cursors.

This revision is now accepted and ready to land.Mar 2 2019, 3:05 PM
This revision was automatically updated to reflect the committed changes.