Skip to content

checking off todos changes last search register, interacts with :hlsearch #23

@davidscotson

Description

@davidscotson

In (neo)Vim I leave my last search highlighted until I clear it manually (Ctr+l mapped to :noh) as I like the visual hint of where I can jump to next.

With vim-bujo, this reveals that the command for (un)ticking a checkbox is done via a search and replace, as all the the opposite tickboxes on the page become highlighted afterwards.

I've added :noh to the mapping, but it still flickers very briefly. I can probably live with that, but as a result of this I noticed that the search history gets updated e.g. if you were searching for every item on the list that said "bacon" you could jump to the first, tick it off, but then trying to jump to the next one will instead search for the next checkbox.

Again, not exactly a massive problem, but I think I should be able to save the search register, and restore it afterwards, possibly even disabling the hlsearch for this specific search to avoid the flicker but not actually got that all working as a mapping yet. (When trying to google for helpful info, it's mostly people wanting to turn hlsearch off entirely or after manually searching that comes up)

I'm currently looking into different ways to achieve the same edit without a search as an alternative if that is possible, but thought I'd mention it in case there's an obvious solution I'm missing.

Thanks for a great plugin.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions