Skip to content

[Vimode]Fix search inside fold ranges

Jumping to search matches in vimode (n/N) are implemented as motions and they are handled by NormalViMode::handleKeyPress which excludes code folds when jumping to lines. This works fine for most motions (e.g. jkG should skip folds to be consistent with Normal Kate mode), but introduces problems when matching searches as the cursor will be placed in position without the range being unfolded.

BUG: 376934 (link)

This is a very hacky fix, but I think more appropriate fixes would need a lot of changes which would probably affect a lot of things (e.g. maybe adding a concept of Virtual/Real to vimode Ranges just like in cursors). Adding a m_view->setCursorPosition to ModeBase::motionFindNext|motionFindePrevious might also fix this, but then I think the function would be going beyond its scope.

EDIT: For context

Before kate_vimode_search_fold_bug

After kate_vimode_search_fold_fix

Edited by Christoph Cullmann

Merge request reports

Loading