Vieb icon indicating copy to clipboard operation
Vieb copied to clipboard

Add backwards searching

Open ottopiramuthu opened this issue 4 years ago • 2 comments

Checklist

Addition or change Vim has ? to search backwards which modifies the behavior of n and N to go in the opposite direction. It would be nice if this was also a part of Vieb.

Alternatives considered You can always use N instead of n and vice versa.

ottopiramuthu avatar Jun 15 '21 20:06 ottopiramuthu

Hey I want to work on this issue if no one else is working on it. Since I don't have much experience with electron, kindly suggest me where to look in the code for this issue.

Thanks for this nice project that actually feels vim-like.

w3bdev1 avatar Sep 26 '21 09:09 w3bdev1

Vieb has most of it's code in app/renderer, files of interest for this issue are:

  • actions.js all functions will be exposed as an action inside Vieb (if exported at the end of the file). This is where the nextSearchMatch action is also stored, which should be modified to optionally search backwards if started using ?, which means the toSearchMode action also needs work (or a separate one for entering search in reverse). To implement this in a similar way to Vim, we should only modify the direction if search mode is quit using useEnteredData and not with toNormalMode. These are all function/actions inside this file you might want to check the implementation for before starting with any coding.
  • input.js contains all input handling, including a list of default mappings, to which ? should be added.
  • settings.js not sure if needed, but this is in charge of managing user settings.

I think that's most if not all the files you will need to edit for this issue, all of which are inside the app/renderer folder. Hopefully you can figure it out with this, if not just ask, so most of all: Good luck!

Jelmerro avatar Sep 26 '21 10:09 Jelmerro

Implemented in https://github.com/Jelmerro/Vieb/commit/5dab8e03e4f4468dd0980bc004d618b6fb0db796.

Jelmerro avatar Sep 24 '22 14:09 Jelmerro