Skip to content

Bug: First file open with telescope shows all lines in file as being new in the parent commit #31

@SalTor

Description

@SalTor

When I start up neovim (opens to an empty buffer) then open a file with telescope, vcsigns shows all the lines as having been added in the parent commit (they're all green)

I'm on version 3e1569e

When I don't use telescope and instead use <Ctrl-o> or :edit

Opened with <Ctrl-o> or :edit <file> Opened with Telescope
Image Image

This is my configuration with Lazy

  {
    'algmyr/vcsigns.nvim',
    config = function()
      local vcsigns = require 'vcsigns'

      vcsigns.setup { target_commit = 0 }

      local actions = vcsigns.actions

      -- stylua: ignore start
      nmap('[r', function() actions.target_older_commit(0, vim.v.count1) end, 'Move diff target back')
      nmap(']r', function() actions.target_newer_commit(0, vim.v.count1) end, 'Move diff target forward')
      nmap('[h', function() actions.hunk_prev(0, vim.v.count1) end, 'Go to previous hunk')
      nmap(']h', function() actions.hunk_next(0, vim.v.count1) end, 'Go to next hunk')
      nmap('<leader>sd', function() actions.toggle_hunk_diff(0) end, 'Show hunk diffs inline in the current buffer')
      -- stylua: ignore end
    end,
  },

If I Telescope into a file and I see this, then I telescope another file, I don't have this behavior

My solve for this is to move the target back and forth once, which is a bit of a pain lol

In writing this issue, though, I have come up with a workaround: have neovim open an actual file on startup, and in my case I've opted to use a dashboard plugin which shows a list of last edited files. I guess this works for now 🤷

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