Revision cd060f7...

Go back to digest for 14th July 2013

Features in KDE Base

Simon Paul St James committed changes in [kate] /:

This is a pretty ugly one :/ Essentially, we want "/" and "?" to be usable as motions so that we can do e.g. d3/bar<enter> to delete up to the third occurrence of bar. We also want them to be usable in Visual Mode.

Firstly: get rid of the "/" and "?" commands - they're not really commands, plus if they are they make us exit Visual Mode whenever we press them. Make them motions instead.

Problem: we don't have the m_commandRange for the motion until the user has interacted with the search bar and dismissed it. So we need to special case "/" and "?" by manually invoking the search bar when they are pressed, then exiting the key handler. The user will then choose the search term and press Enter or whatever, so we can now deduce the m_commandRange and execute the command with the search motion. We trigger this execution by (ugh) having the search bar send a synthetic keypress back round the Vi keypress handler that either aborts the current command (if we aborted the search bar) or completes the motion, allowing us to execute the command. This is very ugly (especially as this synthetic keypress must not be logged for replay via "."!) but it's tough to think of an alternative.

This commit also makes searches countable.

Some more of the KateViVisualMode::goToPos code had to be removed to get this working when using "?" with no wraparound in Visual Mode, but I think this part of the code (which resets the whole selection to m_commandRange under certain conditions e.g. pressing "iB" when we have already moved around in Visual Mode) has been broken for a while :/ I'm going to try a different approach to fixing this.

File Changes

Modified 9 files
  •   tests/vimode_test.cpp
  •   part/vimode/kateviemulatedcommandbar.cpp
  •   part/vimode/kateviemulatedcommandbar.h
  •   part/vimode/kateviinputmodemanager.cpp
  •   part/vimode/katevimodebase.cpp
  •   part/vimode/katevimodebase.h
  •   part/vimode/katevinormalmode.cpp
  •   part/vimode/katevinormalmode.h
  •   part/vimode/katevivisualmode.cpp
9 files changed in total