noice.nvim icon indicating copy to clipboard operation
noice.nvim copied to clipboard

fix(hacks): cursor jumps in cmdline

Open piz-ewing opened this issue 1 year ago • 4 comments

fix #931 #923

After setting the cursor of nvim__redraw to false. the cursor no longer jumps, it works well for me.

piz-ewing avatar Aug 22 '24 02:08 piz-ewing

LGTM. Tested on macOS 14.6.1 with

NVIM v0.10.1
Build type: Release
LuaJIT 2.1.1724232689

b0ae989c avatar Aug 22 '24 16:08 b0ae989c

Would you be willing to share the line of config to set redraw to false??

cjasaMHC avatar Aug 23 '24 13:08 cjasaMHC

Would you be willing to share the line of config to set redraw to false??

you can get it in the commit, see here

piz-ewing avatar Aug 23 '24 15:08 piz-ewing

Would you be willing to share the line of config to set redraw to false??

you can get it in the commit, see here

Thank you so much!!

cjasaMHC avatar Aug 23 '24 15:08 cjasaMHC

Would you be willing to share the line of config to set redraw to false??

you can get it in the commit, see here

Would you be willing to share the line of config to set redraw to false??

you can get it in the commit, see here

that's really nice of u to fix that problem mate

thanks

pacman314159 avatar Sep 12 '24 12:09 pacman314159

That cursor redraw is there for a reason, so I can't merge this.....

folke avatar Sep 18 '24 06:09 folke

So it seems that this is probably the right fix afterall :)

I thought this was set to false in the cmdline code.

Will further debug and see if this is good to merge.

folke avatar Sep 18 '24 17:09 folke

@folke I can confirm on Windows changing this to false as well fixes it. But strangely enough instead of changing cursor = false. Adding win = Cmdline.win() also fixes the issue.

Not sure what the correct fix per say is.

if not Util.is_search() then
  if vim.api.nvim__redraw then
      vim.api.nvim__redraw({ flush = true, cursor = true, win = Cmdline.win() })
    else
      vim.cmd.redraw()
    end
  end

JustBarnt avatar Sep 18 '24 17:09 JustBarnt