[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.
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 Range
s 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