Skip to content

feature: Reveal text in operator-pending mode, and when jumping with flash.nvim (or similar plugins) #43

Closed

Description

@oblitzitate

Is your feature request related to a problem? Please describe.

When manipulating textobjects, I would like the text revealed so that I could better see what's going on.

Describe the solution you'd like

The solution is to reveal text during operator-pending mode.

I'm also unsure if plugins like flash.nvim make use of the operator-pending mode, so if they don't, this plugin should also allow to reveal text when using jump mode or enhanced f/t motions.

Describe alternatives you've considered

The alternative is just disabling the concealment.

Additional information

No response

Activity

  1. MeanderingProgrammer commented on Jun 27, 2024

    @MeanderingProgrammer
    Owner

    Hi, thanks for the feedback! I agree not rendering during operator pending mode makes a lot of sense.

    Have pushed a change: 467ad24, lmk if it works as expected.

    Disabling concealing is also possible if you want to do that for any reason in the future:

    require('render-markdown').setup({
        win_options = {
            conceallevel = { default = 0, rendered = 0 },
        },
    })

    As far as interacting with the various navigation helper plugins, I personally don't use them and don't particularly want to try out all the options so will let users bring up any poor behaviors and go from there.

    Thanks again!

  2. oblitzitate commented on Jun 27, 2024

    @oblitzitate
    Author

    Still not working for me. No changes when I enter an operator (e.g. d) as the initial keystroke.

    My current config:

       {1 "MeanderingProgrammer/markdown.nvim"
        :name "render-markdown"
        :dependencies ["nvim-treesitter/nvim-treesitter"
                       "nvim-tree/nvim-web-devicons"]
        :opts
         {:headings [ "󰼏 " "󰎨 " "󰼑 " "󰎲 " "󰼓 " "󰎴 "]}}
    
  3. MeanderingProgrammer commented on Jun 27, 2024

    @MeanderingProgrammer
    Owner

    I gotta ask, did you update the plugin?

  4. oblitzitate commented on Jun 27, 2024

    @oblitzitate
    Author

    Yes. Lazy shows the markdown.nvim commit to be 467ad24.

    I found out the issue occurs when I run require("which-key").register(). If I comment that out, it works, but I would rather not since which-key is integral to my workflow (and many other users).

    Not sure if it's a timing issue, or interruption issue, or a which-key bug, or what, but you may need to investigate that since a lot of users use which-key as a foundation for their config.

    Edit: Both markdown.nvim's reveal (if it worked) and which-key's popup would occur roughly at the same time so I'm assume the bug stems from there. My guess is that it accidentally grabs the mode of the which-key popup instead of the main buffer? Or maybe it applies the reveal on the which-key popup instead of the main buffer?

  5. MeanderingProgrammer commented on Jun 27, 2024

    @MeanderingProgrammer
    Owner

    Ah I also use which-key, but have most of the presets disabled. In this case the operators preset is what causes the behavior.

    I'm seeing that with operators enabled which-key prevents the mode change from happening at all. As in it forces the editor to stay in normal mode. Which kind of makes sense, but that means with which-key the operator pending state doesn't exist.

    I don't think there's really anything to do. I can't infer an event that's not being triggered, will make a note of this somewhere though.

    Found an issue on which-key's side, it's expected behavior: folke/which-key.nvim#534.

  6. khangnm1340 commented on Mar 21, 2025

    @khangnm1340

    buf_toggle() happens after flash.nvim even when placed first .
    I have this key map

    local flash = require("flash")
    vim.keymap.set("n", "s", function()
      require("render-markdown").buf_toggle()
      flash.jump()
      require("render-markdown").buf_toggle()
    end, { desc = "Flash (Conceal Off)" })
    

    even though render-markdown is place first, flash.nvim still grey out the screen without the unconcealment. Only when i press the first key does it unconceal. But when I tried replacing require("render-markdown").buf_toggle() with another command, that command executes first like normal.

    output.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions