Ignore default mark in icon border for single selectable mark
ClosedPublic

Authored by croick on Aug 6 2017, 6:29 PM.

Details

Summary
  • do not pop up menu if the only selectable mark (i.e. bookmark) is not the default mark for left click on icon border
Test Plan
  • select "Breakpoint" as default mark in KDevelop
  • left click on icon border in Kate and insert bookmark directly

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.
croick created this revision.Aug 6 2017, 6:29 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptAug 6 2017, 6:29 PM
Restricted Application added subscribers: Frameworks, kwrite-devel. · View Herald Transcript
dhaumann requested changes to this revision.Sep 18 2017, 4:48 PM
dhaumann added a subscriber: dhaumann.

I think the patch makes sense, but I would prefer using a Qt function qPopulationCount to count the bits instead of doing own bitmask magic. Could you provide an updated patch?

src/view/kateviewhelpers.cpp
2145

I would prefer using qPopulationCounte (see http://doc.qt.io/qt-5/qtalgorithms.html#qPopulationCount):

// is the default or the only editable mark
const uint singleMark = (qPopulationCount(editBits) > 1)
    ? editBits & config->defaultMarkType() : editBits;
This revision now requires changes to proceed.Sep 18 2017, 4:48 PM
croick updated this revision to Diff 19807.Sep 22 2017, 7:44 PM
  • use qPopulationCount to count editable marks
croick marked an inline comment as done.Sep 22 2017, 7:47 PM

I think the patch makes sense, but I would prefer using a Qt function qPopulationCount to count the bits instead of doing own bitmask magic. Could you provide an updated patch?

It's insignificantly slower now, but certainly easier to read. Thanks.

croick added a comment.Oct 6 2017, 9:14 PM

Should I commit?

dhaumann accepted this revision.Oct 7 2017, 5:25 AM

Yes, sorry, I thought I already accepted. Please commit.

This revision is now accepted and ready to land.Oct 7 2017, 5:25 AM
This revision was automatically updated to reflect the committed changes.