vi: check layer state before opening or closing

This commit is contained in:
Liam
2024-01-17 22:03:40 -05:00
parent ce89580749
commit e4bbb24dcf
4 changed files with 27 additions and 12 deletions

View File

@@ -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: