Skip to content

Commit

Permalink
Avoid auto refreshing git view when working on Remote mode (this coul…
Browse files Browse the repository at this point in the history
…d lead to non responsive UI)

Signed-off-by: Eran Ifrah <[email protected]>
  • Loading branch information
eranif committed Dec 18, 2024
1 parent 287ff78 commit 115ea50
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
5 changes: 5 additions & 0 deletions git/GitConsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "StringUtils.h"
#include "bitmap_loader.h"
#include "clAnsiEscapeCodeColourBuilder.hpp"
#include "clStrings.h"
#include "clToolBar.h"
#include "cl_aui_tool_stickness.h"
#include "cl_config.h"
Expand Down Expand Up @@ -862,6 +863,10 @@ void GitConsole::OnResetFileUI(wxUpdateUIEvent& event)
void GitConsole::OnOutputViewTabChanged(clCommandEvent& event)
{
event.Skip();
// Avoid auto refreshing the view on a remote workspace, this could lead to non responsive UI
if (m_git->m_isRemoteWorkspace || !clGetManager()->IsPaneShown(PANE_OUTPUT, GIT_TAB_NAME)) {
return;
}
if (m_git && event.GetString() == GIT_TAB_NAME) {
m_git->DoRefreshView(false);
}
Expand Down
13 changes: 9 additions & 4 deletions git/git.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@
#include <sys/wait.h>
#endif

#define CHECK_VIEW_SHOWN() \
if (!clGetManager()->IsPaneShown(PANE_OUTPUT, GIT_TAB_NAME)) { \
return; \
#define CHECK_VIEW_SHOWN() \
if (m_isRemoteWorkspace || !clGetManager()->IsPaneShown(PANE_OUTPUT, GIT_TAB_NAME)) { \
return; \
}

namespace
Expand Down Expand Up @@ -1109,6 +1109,7 @@ void GitPlugin::OnWorkspaceLoaded(clWorkspaceEvent& e)
RefreshFileListView();

// Try to set the repo, usually to the workspace path
CHECK_VIEW_SHOWN();
CallAfter(&GitPlugin::DoRefreshView, false);
}

Expand Down Expand Up @@ -2545,6 +2546,7 @@ void GitPlugin::OnCommandEnded(clCommandEvent& event)
m_commandProcessor = NULL;

// Perform a tree refresh
CHECK_VIEW_SHOWN();
DoRefreshView(false);
}

Expand Down Expand Up @@ -2891,13 +2893,16 @@ void GitPlugin::OnEditorChanged(wxCommandEvent& event)
{
event.Skip();
CHECK_ENABLED_RETURN();
// Git the basic git blame
CHECK_VIEW_SHOWN();

// Get the basic git blame
DoLoadBlameInfo(false);
}

void GitPlugin::DoLoadBlameInfo(bool clearCache)
{
CHECK_ENABLED_RETURN();

if (!(m_configFlags & GitEntry::ShowCommitInfo))
return;

Expand Down

0 comments on commit 115ea50

Please sign in to comment.