Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange smearing behavior over external windows (lazygit.nvim) #105

Closed
nadiamoe opened this issue Feb 6, 2025 · 2 comments · Fixed by #107
Closed

Strange smearing behavior over external windows (lazygit.nvim) #105

nadiamoe opened this issue Feb 6, 2025 · 2 comments · Fixed by #107
Labels
bug Something isn't working

Comments

@nadiamoe
Copy link

nadiamoe commented Feb 6, 2025

Hi there, thanks for the great work on this plugin, I'm really liking it!

I've found however an issue on how it interacts with https://github.com/kdheepak/lazygit.nvim, which brings lazygit inside neovim and I use extensively.

While editing text inside this window, the animation seems glitchy, covering characters while it feels like it shouldn't:

output.mp4

This is my config:

{
    "sphamba/smear-cursor.nvim",

    opts = {
      -- Smear cursor when switching buffers or windows.
      smear_between_buffers = true,

      -- Smear cursor when moving within line or to neighbor lines.
      -- Use `min_horizontal_distance_smear` and `min_vertical_distance_smear` for finer control
      smear_between_neighbor_lines = true,

      -- Draw the smear in buffer space instead of screen space when scrolling
      scroll_buffer_space = true,

      -- Set to `true` if your font supports legacy computing symbols (block unicode symbols).
      -- Smears will blend better on all backgrounds.
      legacy_computing_symbols_support = false,

      -- Smear cursor in insert mode.
      -- See also `vertical_bar_cursor_insert_mode` and `distance_stop_animating_vertical_bar`.
      smear_insert_mode = true,

      min_horizontal_distance_smear = 4,

      filetypes_disabled = {
        "lazygit", -- Behaves weirdly
      },
    },
  },

I've tried to disable the lazygit buftype, but that doesn't seem to help either.

Environment

  • OS: Linux Nadiarch 6.12.9-arch1-1 #1 SMP PREEMPT_DYNAMIC Fri, 10 Jan 2025 00:39:41 +0000 x86_64 GNU/Linux
  • Terminal: Alacritty
  • Neovim version: NVIM v0.10.4
  • Smear-cursor version/commit: 110f7d8
@nadiamoe nadiamoe added the bug Something isn't working label Feb 6, 2025
@sphamba
Copy link
Owner

sphamba commented Feb 8, 2025

Thanks for your report!

I did some quick tests and found out that the smear goes to the previous position instead of the new. The vimscript functions for getting the cursor current position return outdated values... As a temporary fix, you can increase the value of delay_after_key from the default 1 ms. 5 ms seems to work for me.

opts = {
  delay_after_key = 5,
}

What still needs to be investigated:

  • why moving the cursor in lazygit.nvim triggers on_key but seemingly not the Neovim events
  • why the smear goes to the bottom right corner when opening lazygit.vim

@sphamba
Copy link
Owner

sphamba commented Feb 10, 2025

#107 Now disables smear in terminal mode by default. @nadiamoe Feel free to reopen this issue if you expect something else

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants