summaryrefslogtreecommitdiff
path: root/src/command_manager.hh
AgeCommit message (Collapse)Author
2024-10-22Remove now unused CompletionFlagsMaxime Coste
Since shell-script-completions now runs the script asynchronously and unconditionally, there is no use for the CompletionFlags::Fast anymore which means we can remove that type altogether.
2024-08-16include headers cleanupAdrià Arrufat
2023-11-14Use a separate copy of the command completer for each completionMaxime Coste
This make the completer lifetime tied to the Prompt mode and removes the need for the Start flag. It also makes it possible to cleanup on completer destruction.
2023-05-04Add support for recursive expansions with %exp{...}Maxime Coste
%exp{...} just expands its content the same way double quoted strings do, but using a named expansion type makes it possible to use the more quoting mechanism to avoid quoting hell.
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
2022-03-06Add a complete-command command to configure command completionMaxime Coste
This makes it possible to change command completion in hooks and paves the way to more flexibility in how custom commands can be completed
2021-07-09Remove command parsing Reader and just track a ParserStateMaxime Coste
The Reader abstraction was leading to suboptimal code by encouraging decoding utf8 separately from advancing to next codepoint.
2021-06-24Only compute command coordinates when necessaryMaxime Coste
Tracking the line/column of each token takes a surprising big part of the command parsing logic runtime and is only necessary when we hit an error.
2021-05-18Fix completion past explicitely closed tokensMaxime Coste
This fixes an issue where completion would still be provided after the closing character of a token, which could then get frustrating combined with auto-insertion of completions. For example, inserting `%{<newline>}` for a command-completed token (such as the commands for a hook) would still trigger completion right after the `}` and that completion would get auto-inserted **replacing** that closing `}`.
2020-07-19Code style tweaksMaxime Coste
2020-06-16A module is not loaded after failing during loadMaxime Coste
distinguish the loading from loaded state, detect recursive loading.
2020-03-13Handle invalid utf8 in command line a bit betterMaxime Coste
Reduce the amount of decoding by working directly on bytes. Fixes #3388
2019-12-24Fix command error line/column reportingMaxime Coste
2019-10-23Add a -verbatim switch to evaluate-commands for perfect forwardingMaxime Coste
-verbatim will disable argument parsing in evaluate-commands, making it possible to forward a single command to a different context without triggering a reparsing of the arguments. Fixes -try-client support in grep.kak Closes #3153
2019-09-01Introduce FunctionRef to replace std::function when not storingMaxime Coste
std::function is not necessary when we just want to pass a type erased callback that does not need to own its target. FunctionRef provides that functionality for a much lower compile time cost.
2019-05-13Add completion support to load-moduleMaxime Coste
2019-04-08Added 'provide-module' and 'require-module' commandsJustin Frank
2019-04-07Add support for %file{...} expansionsMaxime Coste
This should make the use case exposed in #2836 implementable.
2018-07-05Make expansion of strings support quoting of % by doubling upMaxime Coste
2018-02-15CommandManager: refactor parsing of commands to iterate through tokensMaxime Coste
Avoid storing a big vector of tokens, read them one by one, and store only the current command.
2018-02-09CommandManager: Use byte rather than columns for token positionsMaxime Coste
Not only are display columns rarely used to give error positions, but they make the parsing much slower as for each token we need to compute the column in the line.
2017-11-04CommandManager: tweak namingMaxime Coste
2017-09-01Make Token a simple aggregateMaxime Coste
2017-06-29Remove some dead codeMaxime Coste
2017-04-10Remove some now unneeded uses of const String& paramsMaxime Coste
HashMap supports finding String from StringView.
2017-03-16Fixes some clang-tidy warning and add a few missing meta.hh includeMaxime Coste
2017-03-15Small code tweaks regarding flags handlingMaxime Coste
2017-03-15Migrate WithBitOps template specialization to with_bit_ops functionMaxime Coste
This way we dont depend on knowing the base template to enable bit ops on an enum type.
2017-03-07Replace uses of UnorderedMap with HashMapMaxime Coste
2017-01-29Detect too deep command call stackMaxime Coste
Fixes #1163
2016-12-23Display the command prompt in error face when the command is not foundMaxime Coste
Fixes #1021
2016-12-07Ensure content of expanded strings in modelinefmt is not interpreted as markupMaxime Coste
2016-10-01Support codepoints of variable widthMaxime Coste
Add a ColumnCount type and use it in place of CharCount whenever more appropriate, take column size of codepoints into account for vertical movements and docstring wrapping. Fixes #811
2016-09-18Rewrite PerArgumentCommandCompleter to use compile time dispatchingMaxime Coste
No need to store these vectors of std::functions around anymore.
2016-08-05Regenerate shell-candidates for each completion sessionsMaxime Coste
That should allow fixing the #665 issue while still avoiding to run a potentially long shell command on each keystroke.
2016-03-24Add completion support for alias/unalias commandsMaxime Coste
2016-03-08Use ranked match based completion for command namesMaxime Coste
2015-12-12Optimize the dynregex case where the expression refers directly to a regex ↵Maxime Coste
option
2015-10-23Fix optimized linkageMaxime Coste
2015-10-22Pass ShellContext to commandsMaxime Coste
Fix #427
2015-10-22Wrap the shell params en env vars in a ShellContext structMaxime Coste
2015-09-19Initial support for user configurable modeline with the modelinefmt optionMaxime Coste
modelinefmt is first sent through a command line expander (so %sh{...}, %val{...} et al. are expanded), then through markup expand (so that {face} are interpreted as well)
2015-06-26Add support for command completion on commands, use it for :newMaxime Coste
That means commands can be completed using other commands and their completers. Yes that does makes sense. Closes #296
2015-05-04Make expand function (that expand %...{} tokens) publicMaxime Coste
2015-03-09ArrayView content is not const anymoreMaxime Coste
As in upcoming std c++ array_view, ArrayView<T> points to mutable data, use ArrayView<const T> or alias ConstArrayView<T> for const data.
2015-02-08Add optional helper for commands, to get parameter dependent helpMaxime Coste
Use for the set command to document options.
2015-01-12Yet more trackingMaxime Coste
2015-01-06Rename memoryview to ArrayViewMaxime 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-10-30Add scoped aliasesMaxime Coste
aliases are now stored in window, buffer, or globally.