summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2024-08-14 22:04:35 +1000
committerMaxime Coste <mawww@kakoune.org>2024-08-14 22:04:35 +1000
commit01cb818c2077f5059bfa84834298bb813aa9baca (patch)
treecd87ab8afc5a92551299ae98cff16cdc11aaf119
parent575f49f1b4cf93e8d91545f2e8959111bf6e7f2b (diff)
Reduce number of included headers
-rw-r--r--src/client.cc5
-rw-r--r--src/completion.hh1
-rw-r--r--src/display_buffer.hh5
-rw-r--r--src/shared_string.hh1
-rw-r--r--src/shell_manager.cc3
5 files changed, 5 insertions, 10 deletions
diff --git a/src/client.cc b/src/client.cc
index 77fb7dcc..3f7494d9 100644
--- a/src/client.cc
+++ b/src/client.cc
@@ -1,7 +1,7 @@
#include "client.hh"
-#include "face_registry.hh"
#include "context.hh"
+#include "face_registry.hh"
#include "buffer_manager.hh"
#include "buffer_utils.hh"
#include "debug.hh"
@@ -10,8 +10,9 @@
#include "option.hh"
#include "option_types.hh"
#include "client_manager.hh"
-#include "command_manager.hh"
#include "event_manager.hh"
+#include "shell_manager.hh"
+#include "command_manager.hh"
#include "user_interface.hh"
#include "window.hh"
#include "hash_map.hh"
diff --git a/src/completion.hh b/src/completion.hh
index e9321d5a..78024e19 100644
--- a/src/completion.hh
+++ b/src/completion.hh
@@ -1,7 +1,6 @@
#ifndef completion_hh_INCLUDED
#define completion_hh_INCLUDED
-#include <functional>
#include <algorithm>
#include "units.hh"
diff --git a/src/display_buffer.hh b/src/display_buffer.hh
index b1a18098..613832dd 100644
--- a/src/display_buffer.hh
+++ b/src/display_buffer.hh
@@ -7,9 +7,6 @@
#include "string.hh"
#include "vector.hh"
#include "hash_map.hh"
-#include "ranges.hh"
-
-#include <functional>
namespace Kakoune
{
@@ -139,7 +136,7 @@ public:
template<typename It>
iterator insert(iterator pos, It beg, It end)
{
- auto has_buffer_range = std::mem_fn(&DisplayAtom::has_buffer_range);
+ auto has_buffer_range = [](const DisplayAtom& atom) { return atom.has_buffer_range(); };
auto had_range = any_of(*this, has_buffer_range);
if (auto first = std::find_if(beg, end, has_buffer_range); first != end)
{
diff --git a/src/shared_string.hh b/src/shared_string.hh
index 78e9fef4..79c34830 100644
--- a/src/shared_string.hh
+++ b/src/shared_string.hh
@@ -6,7 +6,6 @@
#include "utils.hh"
#include "hash_map.hh"
-#include <numeric>
#include <cstring>
namespace Kakoune
diff --git a/src/shell_manager.cc b/src/shell_manager.cc
index d08c4dbd..7346f2c1 100644
--- a/src/shell_manager.cc
+++ b/src/shell_manager.cc
@@ -10,7 +10,6 @@
#include "face_registry.hh"
#include "file.hh"
#include "flags.hh"
-#include "option.hh"
#include "option_types.hh"
#include "regex.hh"
@@ -118,7 +117,7 @@ Shell spawn_shell(const char* shell, StringView cmdline,
if (pid_t pid = vfork())
return {pid, std::move(stdin_pipe[1]), std::move(stdout_pipe[0]), std::move(stderr_pipe[0])};
- auto renamefd = [](int oldfd, int newfd) {
+ constexpr auto renamefd = [](int oldfd, int newfd) {
if (oldfd == newfd)
return;
dup2(oldfd, newfd);