Skip to content

Commit

Permalink
Another attempt to make nested user screens work
Browse files Browse the repository at this point in the history
  • Loading branch information
alabuzhev committed Dec 27, 2023
1 parent f581055 commit 90d8c73
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
5 changes: 5 additions & 0 deletions far/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
--------------------------------------------------------------------------------
drkns 2023-12-27 23:11:57+00:00 - build 6236

1. Another attempt to make nested user screens work.

--------------------------------------------------------------------------------
drkns 2023-12-23 21:23:54+00:00 - build 6235

Expand Down
2 changes: 1 addition & 1 deletion far/cmdline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ void CommandLine::ExecString(execute_info& Info)
SCOPE_EXIT
{
if (ExecutionContext)
ExecutionContext->DoEpilogue(Info.Echo && !Info.Command.empty());
ExecutionContext->DoEpilogue(Info.Echo && !Info.Command.empty(), true);

if (!IsUpdateNeeded)
return;
Expand Down
12 changes: 7 additions & 5 deletions far/console_session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class context final: noncopyable, public i_context
m_Finalised = false;
}

void DoEpilogue(bool Scroll) override
void DoEpilogue(bool Scroll, bool IsLastInstance) override
{
if (!m_Activated)
return;
Expand All @@ -149,7 +149,8 @@ class context final: noncopyable, public i_context
std::wcout.flush();
Global->ScrBuf->FillBuf();

m_Consolised = false;
if (IsLastInstance)
m_Consolised = false;
}

if (Scroll && DoWeReallyHaveToScroll(Global->Opt->ShowKeyBar? 3 : 2))
Expand All @@ -161,7 +162,8 @@ class context final: noncopyable, public i_context

Global->WindowManager->Desktop()->TakeSnapshot();

m_Finalised = true;
if (IsLastInstance)
m_Finalised = true;
}

~context() override
Expand All @@ -187,7 +189,7 @@ void console_session::EnterPluginContext(bool Scroll)
}
else
{
m_PluginContext->DoEpilogue(Scroll);
m_PluginContext->DoEpilogue(Scroll, false);
}

m_PluginContext->DoPrologue();
Expand All @@ -202,7 +204,7 @@ void console_session::LeavePluginContext(bool Scroll)

if (m_PluginContext)
{
m_PluginContext->DoEpilogue(Scroll);
m_PluginContext->DoEpilogue(Scroll, !m_PluginContextInvocations);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion far/console_session.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class i_context
virtual void Deactivate() = 0;
virtual void DrawCommand(string_view Command) = 0;
virtual void DoPrologue() = 0;
virtual void DoEpilogue(bool Scroll) = 0;
virtual void DoEpilogue(bool Scroll, bool IsLastInstance) = 0;
virtual void Consolise(bool SetTextColour = true) = 0;
};

Expand Down
2 changes: 1 addition & 1 deletion far/vbuild.m4
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6235
6236

0 comments on commit 90d8c73

Please sign in to comment.