summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2016-03-12 16:44:55 +0000
committerMaxime Coste <frrrwww@gmail.com>2016-03-12 16:44:55 +0000
commit06c1c5f28bb4b246c6832cd5de9ddc79c028e26f (patch)
treef55ab40b578d4c782082835253ea1f945691e899 /src
parent35d3679703901da81081dc52233f3963c093dfe9 (diff)
Do not include the debug buffer in word completion
Diffstat (limited to 'src')
-rw-r--r--src/buffer.hh9
-rw-r--r--src/buffer_utils.cc2
-rw-r--r--src/insert_completer.cc2
3 files changed, 7 insertions, 6 deletions
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);
}