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

toggle_current_line_blame can't turn off current_line_blame #1072

Closed
icefed opened this issue Jun 27, 2024 · 2 comments · May be fixed by #1040
Closed

toggle_current_line_blame can't turn off current_line_blame #1072

icefed opened this issue Jun 27, 2024 · 2 comments · May be fixed by #1040
Labels
bug Something isn't working

Comments

@icefed
Copy link
Contributor

icefed commented Jun 27, 2024

Description

Default opts.current_line_blame set to false.

If I turn on current_line_blame use :Gitsigns toggle_current_line_blame or :lua require"gitsigns".toggle_current_line_blame(), it will show virtual text(need move cursor, another issue?), repeat toggle_current_line_blame, still show virtual text if I move cursor, I can not turn it off.

Neovim version

0.10.0

Operating system and version

macos 14

Expected behavior

use toggle_current_line_blame will show virtual text without move cursor after current_line_blame_opts.delay.

repeat toggle_current_line_blame, virtual text will disappear immediately, and I move the cursor it will not show virtual text too.

Actual behavior

...

Minimal config

-- init.lua
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "https://github.com/folke/lazy.nvim.git",
    "--branch=stable", -- latest stable release
    lazypath,
  })
end
vim.opt.rtp:prepend(lazypath)

require("lazy").setup({
  {
    "lewis6991/gitsigns.nvim",
    opts = {
      signs = {
        add = { text = "+" },
        change = { text = "~" },
        delete = { text = "_" },
        topdelete = { text = "" },
        changedelete = { text = "~" },
        untracked = { text = "" },
      },
      current_line_blame_opts = {
        delay = 200,
      },
    },
  },
})

Steps to reproduce

  1. :Gitsigns toggle_current_line_blame -> turn on current_line_blame
  2. :Gitsigns toggle_current_line_blame -> turn off current_line_blame

It still show blame virtual text.

Gitsigns debug messages

No response

Gitsigns cache

No response

@icefed icefed added the bug Something isn't working label Jun 27, 2024
@lewis6991
Copy link
Owner

I'd appreciate it if you followed the issue template properly. Luckily, this issue was easy to fix.

@icefed
Copy link
Contributor Author

icefed commented Jun 27, 2024

@lewis6991
Thanks for your work, but it still have a problem that toggle_current_line_blame to turn on current_line_blame will not show virtual text until I move cursor.

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