Do not include the debug buffer in word completion

This commit is contained in:
Maxime Coste 2016-03-12 16:44:55 +00:00
parent 35d3679703
commit 06c1c5f28b
3 changed files with 7 additions and 6 deletions

View File

@ -102,10 +102,11 @@ public:
enum class Flags enum class Flags
{ {
None = 0, None = 0,
File = 1, File = 1 << 0,
New = 2, New = 1 << 1,
Fifo = 4, Fifo = 1 << 2,
NoUndo = 8, NoUndo = 1 << 3,
Debug = 1 << 4
}; };
Buffer(String name, Flags flags, StringView data = {}, Buffer(String name, Flags flags, StringView data = {},

View File

@ -176,7 +176,7 @@ void write_to_debug_buffer(StringView str)
else else
{ {
String line = str + (eol_back ? "\n" : "\n\n"); 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);
} }
} }

View File

@ -124,7 +124,7 @@ InsertCompletion complete_word(const Buffer& buffer, ByteCoord cursor_pos, const
{ {
for (const auto& buf : BufferManager::instance()) for (const auto& buf : BufferManager::instance())
{ {
if (buf.get() == &buffer) if (buf.get() == &buffer or buf->flags() & Buffer::Flags::Debug)
continue; continue;
add_matches(*buf); add_matches(*buf);
} }