Skip to content

Refresh git log buffer with r #96

Open
BertrandSim wants to merge 2 commits intojunegunn:masterfrom
BertrandSim:refresh
Open

Refresh git log buffer with r #96
BertrandSim wants to merge 2 commits intojunegunn:masterfrom
BertrandSim:refresh

Conversation

@BertrandSim
Copy link

In a GV buffer, hit r to refresh the git log print out.

This achieves the same goal as (#53), but uses a different implementation.

In particular:

  • Hitting r will call s:refresh().
  • s:refresh() first empties the current GV buffer, then s:fill()s it with the same git_log_cmd
  • git_log_cmd is changed to be a buffer-local variable (b:), so that one can reuse the same git log command for the same buffer.

The third point enables s:refresh() to be used with multiple GV instances.
In addition, other split windows (such as the diff window) are also preserved in the current tab.

Bertrand Sim added 2 commits August 31, 2021 15:02
store the git_log_cmd as a buffer-local variable.
`b:git_log_cmd` can then be used to refresh,
by passing this variable to s:fill().
work out b:git_log_cmd _after_ buffer is opened
@BertrandSim
Copy link
Author

rebased on latest master

somini added a commit to somini/gv.vim that referenced this pull request Oct 17, 2021
Includes some tweaks, plus merges with the rest of the previous merges.

See junegunn#96
@somini
Copy link

somini commented Oct 17, 2021

I merged this with #48 on my fork (https://github.com/somini/gv.vim). This stores the command on the existing metadata dict at b:gv.

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.

2 participants