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
{
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 = {},

View File

@ -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);
}
}

View File

@ -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);
}