Skip to content

Add refresh command#53

Open
idbrii wants to merge 1 commit intojunegunn:masterfrom
idbrii:add-refresh
Open

Add refresh command#53
idbrii wants to merge 1 commit intojunegunn:masterfrom
idbrii:add-refresh

Conversation

@idbrii
Copy link
Contributor

@idbrii idbrii commented Jul 30, 2018

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 idbrii force-pushed the add-refresh branch 3 times, most recently from 477df61 to e2f28cb Compare July 30, 2018 22:21
@idbrii
Copy link
Contributor Author

idbrii commented Jul 30, 2018

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
Copy link
Contributor Author

idbrii commented Dec 19, 2018

Removed trailing whitespace.

somini added a commit to somini/gv.vim that referenced this pull request Apr 3, 2019
@sodapopcan
Copy link

What happened here? Has this been abandon?

@idbrii
Copy link
Contributor Author

idbrii commented Jul 15, 2020

@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.

@justinmk
Copy link
Contributor

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, #48 also makes use of b:gv

somini added a commit to somini/gv.vim that referenced this pull request Dec 9, 2020
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).

Store restore variables in buffer instead of tab because if you :GV and
then :wincmd T, then the t: variables disappear. I can't think of a way
we'd lose the buffer. We create the new buffer with the old buffer's
arguments, so they're still pointing to the right ones.
@idbrii
Copy link
Contributor Author

idbrii commented Dec 1, 2022

Squashed the commits and rebased on latest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants