Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    John Schmidt
    @schmee
    I'll try to figure out in what circumstances it appears, but it seems to have something to with switching branches
    Lewis Russell
    @lewis6991:matrix.org
    [m]
    That image is pretty low res. Can you paste the error in markup?
    John Schmidt
    @schmee
    sure thing:
    Error detected while processing function 380[30]..<SNR>57_callback: line 21: Vim(lua):E16: Invalid range: lua _G.package.loaded.gitsigns._update_cwd_head()
    Lewis Russell
    @lewis6991:matrix.org
    [m]
    Hmm, not too sure about that
    Maybe raise an issue and include more info if you figure out any
    John Schmidt
    @schmee
    will do, and thanks for making the plugin, works really nicely :thumbsup:
    John Schmidt
    @schmee
    @lewis6991:matrix.org I've debugged it a little bit and it seems to be caused by setting autochdir, with autochdir off it works and with it on it breaks
    possibly related to this: lewis6991/gitsigns.nvim#352
    Lewis Russell
    @lewis6991:matrix.org
    [m]
    Hmm ok, I can see how it might do that
    0xRZ
    @0xRZ
    Hi, can someone explain how can i switch to floating window with hunks after executing :lua require"gitsigns".preview_hunk()
    Lewis Russell
    @lewis6991:matrix.org
    [m]
    <C-w>w
    0xRZ
    @0xRZ
    active_2021-11-07-12:56:40.png
    when i press <C-w>w it this configuration it switches to top-right window instead of floating window
    clason
    @clason:matrix.org
    [m]
    then press again
    (it cycles)
    0xRZ
    @0xRZ

    then press again

    but after it goes to another window (non floating) the floating one closes, i dont see any parameters i can pass to nvim_open_win() in :help which prevents that

    clason
    @clason:matrix.org
    [m]
    works for me, is all I can say...
    0xRZ
    @0xRZ
    Oh, i actually needed to press capital w after <C-w>, thats way it goes straight to the floating window
    Martin Roa Villescas
    @mroavi
    I would like to display the hunks in a buffer using a Telescope picker. Does gitsigns provide a way to retrieve a list of all hunks in a given buffer?
    clason
    @clason:matrix.org
    [m]
    yes, :h gitsigns.get_hunks()
    1 reply
    Lasha Kanteladze
    @dakyskye
    image.png
    Hello. How do I get Gitsigns show signs for a line but also show me which line I am on? Currently it only shows a sign
    Lewis Russell
    @lewis6991:matrix.org
    [m]
    What do you mean which line you are on? Do you mean the cursor position?
    Oh, I think you have signcolumn=number, change it to auto or something similar.
    Lasha Kanteladze
    @dakyskye
    @lewis6991:matrix.org at the screenshot I want to see yellow | as well as line number
    Oh, yes I do
    Thank you a lot!
    gegoune
    @gegoune:matrix.org
    [m]
    Lewis Russell: Just noticed partial hunk stage, awesome! How will it work (no docs yet, tried looking)? Will it be staging through visual selection, motion?
    Lewis Russell
    @lewis6991:matrix.org
    [m]
    Yeah through visual selection. It has the effect of staging the signs of the selection. I'd really appreciate it if you could test it. The logic took me ages to figure out.
    Lewis Russell
    @lewis6991:matrix.org
    [m]
    And staging a selection that's completely within a hunk is broken atm
    gegoune
    @gegoune:matrix.org
    [m]
    Will try to give that PR a go later. Thanks for all you work!
    gegoune
    @gegoune:matrix.org
    [m]
    :point_up: Edit: Will try to give that PR a go later. Thanks for all you work! (edit: did not have time at all, apologies Lewis!)
    Martin Roa Villescas
    @mroavi
    Suppose I preview a very large hunk or git blame on a line with a very large commit. Is there a way to scroll through that diff?
    Lewis Russell
    @lewis6991:matrix.org
    [m]
    You should be able to scroll the window if you focus it with <C-w>W
    Martin Roa Villescas
    @mroavi
    hmmm I see.. would it be possible to map <C-d> and <C-u> to scroll down and up without needing to focus?

    You should be able to scroll the window if you focus it with <C-w>W

    thanks for this by the way. Was really needing it.

    Telescope offers such a thing: you can use <C-d> and <C-u> to scroll the preview window.
    Lewis Russell
    @lewis6991:matrix.org
    [m]
    Thing is when the blame window is active, you are still focused on the main buffer so remapping C-d and C-u doesn't seem like a good idea. For telescope it's different
    Martin Roa Villescas
    @mroavi
    Is there a reason why we want to stay focused on the main buffer? I like the idea that when you move the cursor the "pop-up" disappears.. but couldn't this be implemented too while being focused on the hunk buffer?
    Lewis Russell
    @lewis6991:matrix.org
    [m]
    The preview is supposed to act like a hover
    Martin Roa Villescas
    @mroavi
    With what I describe it would still feel like a hover.
    Any movement other than <C-d> and <C-u> would make the buffer close.
    Lewis Russell
    @lewis6991:matrix.org
    [m]
    Ok like vim.lsp.buf.hover specifically
    Martin Roa Villescas
    @mroavi
    Ok. Just throwing ideas out there of how we could make this plugin even better than what it is =)
    But seriously, the "<C-w>W" trick, is already super useful.. i wasn't expecting it to be possible.
    Lewis Russell
    @lewis6991:matrix.org
    [m]
    Fair enough. The behaviour should be consistent with similar features of core as much as possible. Any deviation from that should be done through configuration.
    And the <C-w>W trick is currently what you would do for built in LSP hovers
    Martin Roa Villescas
    @mroavi
    Got it. Thanks!
    mjlbach
    @atrius:matrix.org
    [m]
    We're planning on exposing (in core) some higher level floating window primitives similar to what was done for open_float in the future :)
    (drive by comment)