Skip to content

Commit 23aa04d

Browse files
committed
Continue reducing header dependencies
Remove option_manager.hh from profile.hh, event_manager.hh from client.hh, client.hh from window.hh, keymap_manager.hh from normal.hh
1 parent 835b7ee commit 23aa04d

File tree

14 files changed

+28
-14
lines changed

14 files changed

+28
-14
lines changed

src/client.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "client_manager.hh"
1212
#include "event_manager.hh"
1313
#include "hook_manager.hh"
14+
#include "keymap_manager.hh"
1415
#include "option_manager.hh"
1516
#include "shell_manager.hh"
1617
#include "face_registry.hh"

src/client.hh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "clock.hh"
66
#include "display_buffer.hh"
77
#include "env_vars.hh"
8+
#include "event_manager.hh"
89
#include "input_handler.hh"
910
#include "safe_ptr.hh"
1011
#include "unique_ptr.hh"

src/command_manager.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include "file.hh"
99
#include "hook_manager.hh"
1010
#include "optional.hh"
11+
#include "option_manager.hh"
1112
#include "option_types.hh"
1213
#include "profile.hh"
1314
#include "ranges.hh"

src/commands.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include "highlighters.hh"
2020
#include "input_handler.hh"
2121
#include "insert_completer.hh"
22+
#include "keymap_manager.hh"
2223
#include "normal.hh"
2324
#include "option_manager.hh"
2425
#include "option_types.hh"
@@ -1753,7 +1754,7 @@ const CommandDesc source_cmd = {
17531754
filename_completer<true>,
17541755
[](const ParametersParser& parser, Context& context, const ShellContext&)
17551756
{
1756-
ProfileScope profile{context, [&](std::chrono::microseconds duration) {
1757+
ProfileScope profile{context.options()["debug"].get<DebugFlags>(), [&](std::chrono::microseconds duration) {
17571758
write_to_debug_buffer(format("sourcing '{}' took {} us", parser[0], (size_t)duration.count()));
17581759
}};
17591760

src/hook_manager.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include "context.hh"
66
#include "display_buffer.hh"
77
#include "face_registry.hh"
8-
#include "option.hh"
8+
#include "option_manager.hh"
99
#include "option_types.hh"
1010
#include "profile.hh"
1111
#include "ranges.hh"
@@ -136,7 +136,7 @@ void HookManager::run_hook(Hook hook, StringView param, Context& context)
136136
m_hooks_trash.clear();
137137
});
138138

139-
ProfileScope profile{context, [&](std::chrono::microseconds duration) {
139+
ProfileScope profile{context.options()["debug"].get<DebugFlags>(), [&](std::chrono::microseconds duration) {
140140
write_to_debug_buffer(format("hook '{}({})' took {} us", hook_name, param, (size_t)duration.count()));
141141
}};
142142

src/input_handler.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "event_manager.hh"
88
#include "hook_manager.hh"
99
#include "face_registry.hh"
10+
#include "keymap_manager.hh"
1011
#include "option_manager.hh"
1112
#include "insert_completer.hh"
1213
#include "normal.hh"

src/input_handler.hh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include "utils.hh"
1515
#include "safe_ptr.hh"
1616
#include "display_buffer.hh"
17-
#include "event_manager.hh"
1817

1918
namespace Kakoune
2019
{
@@ -42,6 +41,8 @@ class InputMode;
4241
enum class KeymapMode : char;
4342
enum class CursorMode;
4443

44+
class Timer;
45+
4546
using PromptCompleter = Function<Completions (const Context&, StringView, ByteCount)>;
4647
enum class InsertMode : unsigned
4748
{
@@ -88,7 +89,7 @@ public:
8889
// execute callback on next keypress and returns to normal mode
8990
// if callback does not change the mode itself
9091
void on_next_key(StringView mode_name, KeymapMode mode, KeyCallback callback,
91-
Timer::Callback idle_callback = Timer::Callback{});
92+
Function<void (Timer& timer)> idle_callback = {});
9293

9394
// process the given key
9495
void handle_key(Key key, bool synthesized = true);

src/insert_completer.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "command_manager.hh"
77
#include "changes.hh"
88
#include "context.hh"
9+
#include "client.hh"
910
#include "display_buffer.hh"
1011
#include "face_registry.hh"
1112
#include "file.hh"

src/main.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
#include "highlighters.hh"
1616
#include "insert_completer.hh"
1717
#include "json_ui.hh"
18+
#include "keymap_manager.hh"
1819
#include "terminal_ui.hh"
20+
#include "option_manager.hh"
1921
#include "option_types.hh"
2022
#include "parameters_parser.hh"
2123
#include "profile.hh"

src/normal.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "buffer_manager.hh"
77
#include "buffer_utils.hh"
88
#include "changes.hh"
9+
#include "client.hh"
910
#include "command_manager.hh"
1011
#include "context.hh"
1112
#include "coord.hh"
@@ -14,6 +15,8 @@
1415
#include "face_registry.hh"
1516
#include "file.hh"
1617
#include "flags.hh"
18+
#include "input_handler.hh"
19+
#include "keymap_manager.hh"
1720
#include "option_manager.hh"
1821
#include "option_types.hh"
1922
#include "ranges.hh"

0 commit comments

Comments
 (0)