From 7d9f1df73a982c93a654ad67b70e34b3a9902aad Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Wed, 15 Mar 2017 18:25:59 +0000 Subject: [PATCH] Small code tweaks regarding flags handling --- src/buffer.cc | 1 + src/buffer.hh | 1 - src/command_manager.cc | 1 + src/command_manager.hh | 2 -- src/completion.hh | 1 - src/context.hh | 4 +--- src/file.cc | 1 + src/file.hh | 3 +-- src/parameters_parser.cc | 2 ++ src/parameters_parser.hh | 2 +- src/selectors.cc | 1 + src/selectors.hh | 1 - 12 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/buffer.cc b/src/buffer.cc index 09535366..dac1e19c 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -7,6 +7,7 @@ #include "context.hh" #include "diff.hh" #include "file.hh" +#include "flags.hh" #include "shared_string.hh" #include "unit_tests.hh" #include "utils.hh" diff --git a/src/buffer.hh b/src/buffer.hh index f535c387..7e4b54be 100644 --- a/src/buffer.hh +++ b/src/buffer.hh @@ -3,7 +3,6 @@ #include "clock.hh" #include "coord.hh" -#include "flags.hh" #include "safe_ptr.hh" #include "scope.hh" #include "shared_string.hh" diff --git a/src/command_manager.cc b/src/command_manager.cc index e3aea006..9d42b0a9 100644 --- a/src/command_manager.cc +++ b/src/command_manager.cc @@ -3,6 +3,7 @@ #include "alias_registry.hh" #include "assert.hh" #include "context.hh" +#include "flags.hh" #include "register_manager.hh" #include "shell_manager.hh" #include "utils.hh" diff --git a/src/command_manager.hh b/src/command_manager.hh index 36cfe423..be2dd7d6 100644 --- a/src/command_manager.hh +++ b/src/command_manager.hh @@ -3,7 +3,6 @@ #include "coord.hh" #include "completion.hh" -#include "flags.hh" #include "array_view.hh" #include "shell_manager.hh" #include "parameters_parser.hh" @@ -36,7 +35,6 @@ enum class CommandFlags None = 0, Hidden = 1, }; - constexpr bool with_bit_ops(Meta::Type) { return true; } struct CommandInfo { String name, info; }; diff --git a/src/completion.hh b/src/completion.hh index 281c120f..335cfbd6 100644 --- a/src/completion.hh +++ b/src/completion.hh @@ -4,7 +4,6 @@ #include #include -#include "flags.hh" #include "units.hh" #include "string.hh" #include "vector.hh" diff --git a/src/context.hh b/src/context.hh index ba981f69..9fe54a77 100644 --- a/src/context.hh +++ b/src/context.hh @@ -3,7 +3,6 @@ #include "selection.hh" #include "optional.hh" -#include "flags.hh" namespace Kakoune { @@ -86,6 +85,7 @@ public: None = 0, Transient = 1, }; + friend constexpr bool with_bit_ops(Meta::Type) { return true; } Context(InputHandler& input_handler, SelectionList selections, Flags flags, String name = ""); @@ -183,8 +183,6 @@ private: NestedBool m_history_disabled; }; -constexpr bool with_bit_ops(Meta::Type) { return true; } - struct ScopedEdition { ScopedEdition(Context& context) diff --git a/src/file.cc b/src/file.cc index 585c309a..29e285e9 100644 --- a/src/file.cc +++ b/src/file.cc @@ -3,6 +3,7 @@ #include "assert.hh" #include "buffer.hh" #include "exception.hh" +#include "flags.hh" #include "ranked_match.hh" #include "regex.hh" #include "string.hh" diff --git a/src/file.hh b/src/file.hh index 1ecb1090..7cb5f88c 100644 --- a/src/file.hh +++ b/src/file.hh @@ -2,7 +2,7 @@ #define file_hh_INCLUDED #include "array_view.hh" -#include "flags.hh" +#include "meta.hh" #include "units.hh" #include "vector.hh" @@ -78,7 +78,6 @@ enum class FilenameFlags OnlyDirectories = 1 << 0, Expand = 1 << 1 }; - constexpr bool with_bit_ops(Meta::Type) { return true; } CandidateList complete_filename(StringView prefix, const Regex& ignore_regex, diff --git a/src/parameters_parser.cc b/src/parameters_parser.cc index 30154483..9ca475f7 100644 --- a/src/parameters_parser.cc +++ b/src/parameters_parser.cc @@ -1,5 +1,7 @@ #include "parameters_parser.hh" +#include "flags.hh" + namespace Kakoune { diff --git a/src/parameters_parser.hh b/src/parameters_parser.hh index a790aa6e..dc9f6612 100644 --- a/src/parameters_parser.hh +++ b/src/parameters_parser.hh @@ -3,8 +3,8 @@ #include "exception.hh" #include "hash_map.hh" +#include "meta.hh" #include "array_view.hh" -#include "flags.hh" #include "optional.hh" #include "string.hh" diff --git a/src/selectors.cc b/src/selectors.cc index 5ab25e5d..ece2b9ce 100644 --- a/src/selectors.cc +++ b/src/selectors.cc @@ -1,6 +1,7 @@ #include "selectors.hh" #include "buffer_utils.hh" +#include "flags.hh" #include "optional.hh" #include "regex.hh" #include "string.hh" diff --git a/src/selectors.hh b/src/selectors.hh index e873d9ab..8b2ced6d 100644 --- a/src/selectors.hh +++ b/src/selectors.hh @@ -1,7 +1,6 @@ #ifndef selectors_hh_INCLUDED #define selectors_hh_INCLUDED -#include "flags.hh" #include "selection.hh" namespace Kakoune