gv.vim icon indicating copy to clipboard operation
gv.vim copied to clipboard

Add refresh command

Open idbrii opened this issue 7 years ago • 6 comments

As far as I can tell, there's no way to refresh git state (if I create a branch with :Git br hihi), so I added one.

Limitation: only works on one gv instance. I tried using b: instead of s: and it still didn't work (the variable no longer exists on old gv instances?) so I gave up.

Stores GV's options, closes tab, re-runs GV.

Doesn't maintain current diff window, but does maintain current line position. Seems like a good trade-off for a simpler solution.

Mapped to 'r' like fugitive's :Gstatus. (Instead of 'u' like gitv.)

Implemented as a plug because I personally prefer C-l for refresh-like actions (and have already mapped r to cycle refs like gitv).

idbrii avatar Jul 30 '18 17:07 idbrii

Fixed issues where it didn't work gv was the only tab.

Took justinmk's suggestion to use tab-local variables and figured out why buffer-local wasn't working (need to define them from the tab and not before the tab opens). Should work with multiple gv tabs open.

I'm using gv_opts instead of gv.opts because gv doesn't exist (@justinmk were you referring to something already existing?). Can switch if nested is preferred (looks like junegunn usually prefixes instead of nests).

idbrii avatar Jul 30 '18 22:07 idbrii

Removed trailing whitespace.

idbrii avatar Dec 19 '18 23:12 idbrii

What happened here? Has this been abandon?

sodapopcan avatar Jul 14 '20 19:07 sodapopcan

@sodapopcan I use it regularly, but it triggers #84. (I thought I introduced that bug, but turns out it exists in gv without this PR.) Probably best to fix that bug before merging this change, but this works well enough for me so I'm not motivated to debug it.

idbrii avatar Jul 15 '20 07:07 idbrii

I'm using gv_opts instead of gv.opts because gv doesn't exist (@justinmk were you referring to something already existing?).

well, gv doesn't exist but if it's introduced here then it can be used for other purposes later (instead of having gv and gv_opts in the future).

For reference, https://github.com/junegunn/gv.vim/pull/48 also makes use of b:gv

justinmk avatar Aug 18 '20 18:08 justinmk

Squashed the commits and rebased on latest.

idbrii avatar Dec 01 '22 00:12 idbrii