Commit Graph

171 Commits

Author SHA1 Message Date
Maxime Coste
6d111d4bd7 Re-introduce aliases in command name completion
Aliases are considered again in command name completion, but only
if they are more than 3 charactes long. This should prevent cluttering
with aliases while still letting long ones being completed.
2018-02-20 23:32:31 +11:00
Maxime Coste
76f5fb937c Fix bug in command parsing post refactoring
Fixes #1857
2018-02-19 08:29:04 +11:00
Maxime Coste
536fa29ed5 CommandManager: unescape % while parsing the string 2018-02-18 14:56:52 +11:00
Maxime Coste
bde1f5349d CommandManager: refactor parsing of commands to iterate through tokens
Avoid storing a big vector of tokens, read them one by one, and
store only the current command.
2018-02-15 23:24:19 +11:00
Maxime Coste
b7a3d80bde CommandManager: Use byte rather than columns for token positions
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.
2018-02-09 20:30:33 +11:00
Maxime Coste
e2c1d44a7f Fix parsing of percent tokens with unicode separators 2018-02-06 20:29:08 +11:00
Maxime Coste
05f57ace07 CommandManager: parse command lines as utf8 instead of ascii
Fixes #1829
2018-02-04 09:21:15 +11:00
Maxime Coste
6bac767124 CommandManager: tweak naming 2017-11-04 16:02:21 +08:00
Maxime Coste
ddc307b8e9 Optimize CommandManager::execute handling of tokens
Instead of walking a list of tokens and inserting eventual new
ones in the middle, use a stack of token and push new ones on top.
2017-10-17 10:25:20 +08:00
Maxime Coste
64183b1e4c Make Token a simple aggregate 2017-09-01 17:09:34 +07:00
Maxime Coste
ab6a999431 Rename containers.hh to ranges.hh (and Container to Range) 2017-08-29 15:23:03 +07:00
Maxime Coste
eb2984807c Remove some dead code 2017-06-29 07:43:20 +01:00
Frank LENORMAND
8d24768d5d src: Add a commands debug flag
This commit allows setting the `commands` flag to the `debug` option, in
order to have the engine write on the *debug* buffer the commands that are
being executed, along with their arguments.
2017-06-17 11:27:07 +03:00
Maxime Coste
575e6fe325 Remove unneeded unknown_expand exception type 2017-06-07 19:01:26 +01:00
Maxime Coste
a0d848da8d Do not allow whitespaces as % string delimiters 2017-06-07 13:09:45 +01:00
Maxime Coste
261e0fabcc Improve readability of command docstrings by changing formatting
Fixes #1378
2017-06-04 08:37:51 +01:00
Maxime Coste
f014eb7052 Fix command parsing bug when commenting after a command
When a comment was present directly on the same line after a command,
we did not correctly see the command as terminated and would join
continue parsing the next line.
2017-05-25 08:30:49 +01:00
Maxime Coste
6a97455b3b Do not push a final spurious command separators when parsing commands
Fixes #1336
2017-05-08 11:46:03 +01:00
Maxime Coste
3a3144f3f5 Fix use of invalidated iterator in the command map on exception
The command map can get mutated by command execution, so the iterators
can get invalidated (now that we use our curstom HashMap implementation,
all iterators are potentially invalidated by insert/removal)
2017-05-07 16:25:34 +01:00
Maxime Coste
5103b15b84 Safer code for parsing commands
Fix some possible past the end of target string reads
Fixes #1310 (maybe, probably, who knows)
2017-04-19 22:04:03 +01:00
Maxime Coste
c1c40a4b56 Remove some now unneeded uses of const String& params
HashMap supports finding String from StringView.
2017-04-10 21:33:20 +01:00
Maxime Coste
e44f95820e Fixes some clang-tidy warning and add a few missing meta.hh include 2017-03-16 23:34:02 +00:00
Maxime Coste
7d9f1df73a Small code tweaks regarding flags handling 2017-03-15 18:25:59 +00:00
Maxime Coste
6373338c50 Replace uses of UnorderedMap with HashMap 2017-03-07 01:03:26 +00:00
Maxime Coste
2052b225d9 Detect too deep command call stack
Fixes #1163
2017-01-29 13:56:05 +00:00
Maxime Coste
753f3a50d1 Make StringView and unit types trivial types 2017-01-29 13:49:45 +00:00
Maxime Coste
9f0bca53c4 Small code cleanups 2017-01-08 23:26:15 +00:00
Maxime Coste
dcd8f6ef01 Apply clang-tidy modernize to the codebase 2017-01-08 22:39:01 +00:00
Maxime Coste
84c2ca1cdc Merge remote-tracking branch 'leira/empty_param_crash' 2016-12-27 22:00:32 +00:00
Leira Hua
f79018cffd Added string length check when checking switch params
Fixes #1051
2016-12-24 17:42:31 -08:00
Maxime Coste
d17bed9b80 Display the command prompt in error face when the command is not found
Fixes #1021
2016-12-23 16:23:31 +00:00
Maxime Coste
03eb128536 Ensure content of expanded strings in modelinefmt is not interpreted as markup 2016-12-07 20:07:32 +00:00
Maxime Coste
2f704eab16 Small command parsing refactoring 2016-12-07 13:26:11 +00:00
Maxime Coste
47a82b9855 Make ArrayView::subrange size arguement optional 2016-11-20 11:15:15 +00:00
Maxime Coste
5249df78d4 Do not include aliases in command completion candidates anymore
Fuzzy matching makes it redundant.
Closes #817
2016-11-14 00:29:43 +00:00
Maxime Coste
025b91baca Convert some uses of lambda to more concise std::mem_fn 2016-10-10 23:44:18 +01:00
Maxime Coste
35559b65dd Support codepoints of variable width
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-10-01 13:45:00 +01:00
Maxime Coste
d14c39ebdd Rewrite PerArgumentCommandCompleter to use compile time dispatching
No need to store these vectors of std::functions around anymore.
2016-09-18 16:07:00 +01:00
Maxime Coste
5b7b6eebaf Regenerate shell-candidates for each completion sessions
That should allow fixing the #665 issue while still avoiding to
run a potentially long shell command on each keystroke.
2016-08-05 13:53:19 +01:00
Maxime Coste
471c75d738 Trim trailing end of lines in %sh outputs
Fixes #698
2016-06-19 17:01:56 +01:00
Maxime Coste
2435949fae Add support for env var name completion
Fixes #659
2016-04-17 19:21:43 +01:00
Maxime Coste
1d646c03f5 Add completion support for alias/unalias commands 2016-03-24 00:05:40 +00:00
Maxime Coste
9e15181dc9 Rework container helpers, use pipe syntax and cleanup implementation
use 'container | filter(func) | reverse() | transform(func)' instead
of 'transform(reverse(filter(container), func), func)' to express
container transformations.
2016-03-08 21:35:56 +00:00
Maxime Coste
21ae662151 Use ranked match based completion for command names 2016-03-08 13:56:37 +00:00
Maxime Coste
5b9d30c088 Optimize the dynregex case where the expression refers directly to a regex option 2015-12-12 06:50:58 +00:00
Maxime Coste
2a8a329b83 Remove support for %arg{#}, can be added back if we got a use case
It is very unlikely we need %arg{#} without needing a %sh anyway.
2015-12-02 01:08:41 +00:00
Maxime Coste
a02ad38fb4 Forward each params in %arg{@} separately 2015-12-02 01:01:48 +00:00
Maxime Coste
b2648053f9 Add argument expansion support 2015-12-01 20:07:14 +00:00
Maxime Coste
cb108b248a Fix alias completion and overwritting 2015-11-17 13:55:27 +00:00
Maxime Coste
5118e13aee Remove useless std::move 2015-10-23 13:46:55 +01:00