mirror of
https://git.suyu.dev/suyu/suyu
synced 2026-05-30 02:59:13 +00:00
vi: check layer state before opening or closing
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include "common/common_types.h"
|
||||
|
||||
@@ -75,12 +76,12 @@ public:
|
||||
return open;
|
||||
}
|
||||
|
||||
void Close() {
|
||||
open = false;
|
||||
bool Close() {
|
||||
return std::exchange(open, false);
|
||||
}
|
||||
|
||||
void Open() {
|
||||
open = true;
|
||||
bool Open() {
|
||||
return !std::exchange(open, true);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user