Skip to content

Commit

Permalink
Add new refresh command so that refreshing by shortcut is possible
Browse files Browse the repository at this point in the history
Closes #89
  • Loading branch information
phil294 committed Apr 15, 2024
1 parent 1451d83 commit eb724c8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@
"title": "Blame: Focus last commit at cursor position in graph view",
"category": "git log --graph",
"icon": "$(git-commit)"
},
{
"command": "git-log--graph.refresh",
"title": "Refresh the main view",
"category": "git log --graph",
"icon": "$(refresh)"
}
],
"views": {
Expand Down
4 changes: 4 additions & 0 deletions src/extension.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,10 @@ module.exports.activate = (###* @type vscode.ExtensionContext ### context) =>
vscode.commands.executeCommand(START_CMD)
push_message_id 'scroll-to-selected-commit'

context.subscriptions.push vscode.commands.registerCommand 'git-log--graph.refresh', =>
log.appendLine "refresh command"
push_message_id 'refresh-main-view'

# public api of this extension:
{ git, post_message, webview_container, context, state }

Expand Down
4 changes: 3 additions & 1 deletion web/src/views/store.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -197,4 +197,6 @@ export init = =>
await refresh_config()
refresh_main_view()

add_push_listener 'repo-external-state-change', => refresh_main_view()
add_push_listener 'repo-external-state-change', => refresh_main_view()

add_push_listener 'refresh-main-view', => refresh_main_view()

0 comments on commit eb724c8

Please sign in to comment.