Summary: | New highlight yank feature doesn't play nice with block mode selection (CTRL-V) | ||
---|---|---|---|
Product: | [Applications] kate | Reporter: | Fabian <0inkane> |
Component: | Vi Input Mode | Assignee: | Fabian <0inkane> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | dhaumann, kdedevel |
Priority: | NOR | ||
Version: | Git | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/kate/c4589f9346633793af9599656a8c06c283307786 | Version Fixed In: | |
Sentry Crash Report: |
Description
Fabian
2013-09-09 11:30:00 UTC
This looks like - void KTextEditor::MovingRange::setBlockMode(bool blockMode) - bool KTextEditor::MovingRange::blockMode() const are missing in the MovingRange class. A possible workaround: create N MovingRanges, for each line one. Fabian, do you plan to send a patch? Git commit fface1586b1e32067292862e63b000cf9f0d436a by Dominik Haumann. Committed on 09/09/2013 at 12:32. Pushed by dhaumann into branch 'master'. todo KDE 5 note in KDE5, maybe add - void MoivingRange::setBlockMode(bool enableBlockMode); - bool MoivingRange::blockMode() const; This way, arbitrary highlighting would work for colums as well. In fact, if implemented correctly in the Kate Renderer, drawing block selection mode could use this, too. The vi in put mode yank highlighting could use it, too: https://bugs.kde.org/show_bug.cgi?id=324695 A correct implementation needs to take care of MovingRangeFeedback, especially of mouseEnteredRange(), mouseExitedRange(), caretEnteredRange() and caretEnteredRange() M +10 -0 ktexteditor/movingrange.h http://commits.kde.org/kate/fface1586b1e32067292862e63b000cf9f0d436a Yes, I plan on creating a workaround for this. I'll create a review request once it's done. Sounds like the workaround of using N highlighted ranges would be the best short-term solution; I'll see if I can get this done for KDE 4.12, and leave a note to re-visit in KDE5. Thanks for the report - I'm embarrassed I didn't think to check this! N highlightings will work. But as soon as you rely on mouse or caret interaction, this will break again, since you get notified for each moving range. This is not a problem currently, though, since the yank highlighting does not use the moving range feedback anyway. Best would be an implementation in kate part that supports block mode, see comment #2. :-) Since the vi input mode is Kate Part internal, it even could use this implementation directly through Kate::TextRange (which inherits KTextEditor::MovingRange). Maybe you can give this route a try? The vi code then would need to cast the MovingRange* to Kate::TextRange* and then access the added setBlockMode() function. Git commit c4589f9346633793af9599656a8c06c283307786 by Michal Humpula. Committed on 30/11/2013 at 09:53. Pushed by michalhumpula into branch 'master'. vi-mode: fix yanking in visual block mode REVIEW: 114220 M +31 -20 part/vimode/katevinormalmode.cpp M +4 -3 part/vimode/katevinormalmode.h M +12 -0 tests/vimode_test.cpp http://commits.kde.org/kate/c4589f9346633793af9599656a8c06c283307786 |