Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • K KTextEditor
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 1
    • Issues 1
    • List
    • Boards
    • Service Desk
    • Milestones
  • Bugzilla
    • Bugzilla
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • FrameworksFrameworks
  • KTextEditor
  • Merge requests
  • !53

[Vimode]Fix search inside fold ranges

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Jan Paul Batrina requested to merge jbatrina/ktexteditor:vimode-find-folded into master Dec 27, 2020
  • Overview 8
  • Commits 1
  • Pipelines 0
  • Changes 1

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 Jan 02, 2021 by Christoph Cullmann
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: vimode-find-folded