Skip to content

Commit

Permalink
fix 4656.2 & minor
Browse files Browse the repository at this point in the history
  • Loading branch information
alabuzhev committed May 4, 2016
1 parent 31b1f07 commit b53e34f
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 14 deletions.
8 changes: 7 additions & 1 deletion far/changelog
@@ -1,4 +1,10 @@
drkns 03.05.2016 16:58:07 +0200 - build 4660
drkns 04.05.2016 10:20:21 +0200 - build 4661

1. Уточнение 4656.2.

2. Пара мелочей.

drkns 03.05.2016 16:58:07 +0200 - build 4660

1. Уточнение 4656.2.

Expand Down
5 changes: 4 additions & 1 deletion far/cmdline.cpp
Expand Up @@ -896,11 +896,14 @@ class execution_context: noncopyable

Global->WindowManager->ActivateWindow(Global->CtrlObject->Desktop);
Global->WindowManager->ShowBackground();

// ShowCommand is false when there is no "command" - class instantiated by FCTL_GETUSERSCREEN.
if (m_ShowCommand)
{
Global->CtrlObject->CmdLine()->DrawFakeCommand(m_Command);
ScrollScreen(1);
}
ScrollScreen(1);

Global->CtrlObject->Desktop->TakeSnapshot();
int X1, Y1, X2, Y2;
Global->CtrlObject->CmdLine()->GetPosition(X1, Y1, X2, Y2);
Expand Down
9 changes: 9 additions & 0 deletions far/common.hpp
Expand Up @@ -213,6 +213,15 @@ class writable_blob: public blob
bool m_Allocated;
};

namespace enum_helpers
{
template<class O, class R = void, class T>
constexpr auto operation(T a, T b)
{
return static_cast<std::conditional_t<std::is_same<R, void>::value, T, R>>(O()(static_cast<std::underlying_type_t<T>>(a), static_cast<std::underlying_type_t<T>>(b)));
}
}

#ifdef _DEBUG
#define SELF_TEST(code) \
namespace \
Expand Down
15 changes: 4 additions & 11 deletions far/scrbuf.hpp
Expand Up @@ -48,24 +48,17 @@ enum class flush_type
all = screen | cursor | title
};

inline auto operator|(flush_type a, flush_type b)
inline constexpr auto operator|(flush_type a, flush_type b)
{
return static_cast<flush_type>(
static_cast<std::underlying_type_t<flush_type>>(a) |
static_cast<std::underlying_type_t<flush_type>>(b)
);
return enum_helpers::operation<std::bit_or<>>(a, b);
}

inline auto operator&(flush_type a, flush_type b)
inline constexpr auto operator&(flush_type a, flush_type b)
{
return
static_cast<std::underlying_type_t<flush_type>>(a) &
static_cast<std::underlying_type_t<flush_type>>(b);
return enum_helpers::operation<std::bit_and<>, std::underlying_type_t<flush_type>>(a, b);
}


class ScreenBuf: noncopyable

{
public:
ScreenBuf();
Expand Down
2 changes: 1 addition & 1 deletion far/vbuild.m4
@@ -1 +1 @@
m4_define(BUILD,4660)m4_dnl
m4_define(BUILD,4661)m4_dnl

0 comments on commit b53e34f

Please sign in to comment.