diff --git a/src/buffer.hh b/src/buffer.hh index c8870509..a7ab127c 100644 --- a/src/buffer.hh +++ b/src/buffer.hh @@ -102,10 +102,11 @@ public: enum class Flags { None = 0, - File = 1, - New = 2, - Fifo = 4, - NoUndo = 8, + File = 1 << 0, + New = 1 << 1, + Fifo = 1 << 2, + NoUndo = 1 << 3, + Debug = 1 << 4 }; Buffer(String name, Flags flags, StringView data = {}, diff --git a/src/buffer_utils.cc b/src/buffer_utils.cc index 5d1b6d5e..9a70a864 100644 --- a/src/buffer_utils.cc +++ b/src/buffer_utils.cc @@ -176,7 +176,7 @@ void write_to_debug_buffer(StringView str) else { String line = str + (eol_back ? "\n" : "\n\n"); - new Buffer(debug_buffer_name.str(), Buffer::Flags::NoUndo, line, InvalidTime); + new Buffer(debug_buffer_name.str(), Buffer::Flags::NoUndo | Buffer::Flags::Debug, line, InvalidTime); } } diff --git a/src/insert_completer.cc b/src/insert_completer.cc index 27275363..c33673e6 100644 --- a/src/insert_completer.cc +++ b/src/insert_completer.cc @@ -124,7 +124,7 @@ InsertCompletion complete_word(const Buffer& buffer, ByteCoord cursor_pos, const { for (const auto& buf : BufferManager::instance()) { - if (buf.get() == &buffer) + if (buf.get() == &buffer or buf->flags() & Buffer::Flags::Debug) continue; add_matches(*buf); }