summaryrefslogtreecommitdiff
path: root/src/hook_manager.hh
AgeCommit message (Collapse)Author
2025-07-08Replace std::unique_ptr with a custom implementationMaxime Coste
<memory> is a costly header we can avoid by just implementing UniquePtr ourselves, which is a pretty straightforward in modern C++, this saves around 10% of the compilation time here.
2024-08-19Merge remote-tracking branch 'arrufat/includes-cleanup'Maxime Coste
2024-08-16include headers cleanupAdriĆ  Arrufat
2024-08-15Remove unused ConstexprVector and rename constexpr_utils.hh to array.hhMaxime Coste
2024-08-12Reduce headers dependency graphMaxime Coste
Move more code into the implementation files to reduce the amount of code pulled by headers.
2024-06-24Add EnterDirectory hookPhilipp Jungkamp
This hook runs on `change-directory` and is also emitted just before KakBegin after kakrc has been sourced.
2024-04-12Introduce "local" scope in evaluate-commandsMaxime Coste
When using `eval` a new scope named 'local' gets pushed for the whole evaluation, this makes it possible to temporarily set an option/hook/alias... Local scopes nest so nested evals do work as expected. Remove the now trivial with-option command
2024-03-27Add SessionRenamed hookTobias Pisani
2024-03-27Add ClientRenamed hookTobias Pisani
2023-02-14Immediately execute ModuleLoaded hooks for already loaded modulesMaxime Coste
This is trickier than expected because ModuleLoaded hooks can (as any other hooks) use arbitrary regular expressions for their filter. Fixes #4841
2020-07-19Add a RegisterModified hookMaxime Coste
This one has been a long time coming, I am still concerned this could impact performance a lot. This hook does *not* trigger for capture registers (0-9) or any other dynamic registers (that are not writable). Fixes #859
2020-07-04Add User hook supportMaxime Coste
2020-02-27Make `on_next_key_with_autoinfo()` respect `idle_timeout`Nicolas Ouellet-Payeur
The prompt and autocomplete normally wait for `idle_timeout` before showing suggestions, however commands like `g`, `v`, or the lead-key show Clippy instantly. This fixes the issue by making `on_next_key_with_autoinfo()` wait for `idle_timeout` before displaying suggestions. Fixes mawww/kakoune#3365 Fixes mawww/kakoune#2066
2019-10-17Remove explicit sizes from make_array callsMaxime Coste
2019-10-16Replace ModeChange hooks by ModePush and ModePopMaxime Coste
Remove deprecated InsertBegin, InsertEnd, NormalBegin, NormalEnd hooks. Closes #2545
2019-06-25Rename ModuleLoad hook to ModuleLoadedcodesoap
This clarifies, that the hook is run *after* the module is loaded.
2019-04-25Merge remote-tracking branch 'laelath/provides-requires'Maxime Coste
2019-04-17Remove InsertCompletionSelect hookMaxime Coste
2019-04-08Added ModuleLoad hook that uses the module name as the parameterJustin Frank
2019-04-08Add a ClientCreate and ClientClose hookMaxime Coste
As discussed in #2830. Closes #2500.
2019-01-24Header and dependency cleanupMaxime Coste
2018-10-23Refactor Hook management to have a well defined list of hooksMaxime Coste
Hooks are now an enum class instead of passing strings around.
2018-09-12Change remove-hooks to take a regular expressionMaxime Coste
All hooks whose group match this regex will be removed. Fixes #2380.
2018-08-06src: Allow hooks to be run only onceFrank LENORMAND
This commit implements the -once flag on the `:hook` command, which automatically removes a hook after it was run, to avoid having to declare a group and remove it in the hook implementation. Closes #2277
2018-04-26Add a -always switch to hook command to ignore hooks disabledMaxime Coste
Hooks specified as always will run regardless of the hook disabled status.
2017-10-06Move HookManager::Hook definition in the cppMaxime Coste
This avoids including regex.hh in the header.
2017-08-04Fix SafeCountable and RefCountable copy/move logicMaxime Coste
The safe and ref counts should not get copied around.
2017-06-07Fix memory errors due to sharing the MatchResults in the Hooks structMaxime Coste
A hook execution triggered by another hook execution would change the shared MatchResults object, which is a wrong behaviour and makes it point to dead string data.
2017-06-07Move hook executing logic into HookManagerMaxime Coste
The existing HookManager was able to run arbitrary hook functions, but in practice was only used for user provided textual hooks. That separation was causing some suboptimal performances, by moving that logic directly in the hook manager we can improve hook filtering performance which is a big part of startup time when opening lots of files.
2017-06-07Avoid expensive copies of Hooks in HookManager::run_hooksMaxime Coste
Use a deferred deletion mechanism to ensure hooks are kept alive for the duration of run_hooks.
2017-06-07Use a vector instead of a hash map to store hooksMaxime Coste
2017-03-07Replace IdMap with HashMapMaxime Coste
2017-02-19Small naming tweak in HookManagerMaxime Coste
2016-11-28Add more memory domains to certain dataMaxime Coste
2016-06-27Detect recursive hook run and abort in that caseMaxime Coste
Fixes #709
2016-05-15Make HookManager safe countedMaxime Coste
2015-03-17Remove unneeded includeMaxime Coste
2015-03-05Use a IdMap for storing hooksMaxime Coste
The number of hook names is small (<20), using an UnorderedMap is overkill, and prevents using StringView for key searching.
2015-01-12Yet more trackingMaxime Coste
2014-12-23Remove trailing blank linesMaxime Coste
2014-12-23Rename id_map to IdMapMaxime Coste
2014-12-23Unify completion from container content logicMaxime Coste
2014-12-16Rework hashing, use a more extensible framework similar to n3876 proposalMaxime Coste
std::hash specialization is a pain to work with, stop using that, and just specialize a 'size_t hash_value(const T&)' free function.
2014-11-12Cleanup includesMaxime Coste
2014-10-30Add scope class and encapsulate Options, Keymaps, Aliases and Hooks in itMaxime Coste
2014-10-20Port more code to StringView instead of const String&Maxime Coste
2014-07-24Disable hooks on a per context basis, and propagate that to Insert modeMaxime Coste
using \ before entering insert mode will disable hooks during the whole insert session rather than only the entering phase. That gives a nice way of pasting text into kakoune.
2014-07-21Add completion support for rmhooksMaxime Coste
2014-06-21Only user hooks can be disabledMaxime Coste
2014-06-16Use -group rather than -id in hooks to mirror highlighters closerMaxime Coste