summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2017-06-07 20:25:39 +0100
committerMaxime Coste <mawww@kakoune.org>2017-06-07 20:25:39 +0100
commit56b52bdb3de2244438433735e04da282c8256b7d (patch)
tree5ded8129b945ce4c1ce38064498bcf047b2695e6 /src
parente947c20ce03ea0bd0f1c7b247804732b33776a4c (diff)
Filter debug buffers before creating the SafePtr vector in -buffer *
Diffstat (limited to 'src')
-rw-r--r--src/commands.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/commands.cc b/src/commands.cc
index 9983c0ec..790c7c7e 100644
--- a/src/commands.cc
+++ b/src/commands.cc
@@ -1564,11 +1564,11 @@ void context_wrap(const ParametersParser& parser, Context& context, Func func)
// copy buffer list as we might be mutating the buffer list
// in the loop.
auto ptrs = BufferManager::instance() |
- transform(std::mem_fn(&std::unique_ptr<Buffer>::get));
+ transform(std::mem_fn(&std::unique_ptr<Buffer>::get)) |
+ filter([](Buffer* buf) { return not (buf->flags() & Buffer::Flags::Debug); });
Vector<SafePtr<Buffer>> buffers{ptrs.begin(), ptrs.end()};
for (auto buffer : buffers)
- if (not (buffer->flags() & Buffer::Flags::Debug))
- context_wrap_for_buffer(*buffer);
+ context_wrap_for_buffer(*buffer);
}
else
for (auto& name : split(*bufnames, ','))