Commit Graph

77 Commits

Author SHA1 Message Date
Maxime Coste
d33554a1cc Add support for long names for registers
We can now access register / with the name slash, * with star,
and | with pipe

Fixes #23
2014-06-06 00:49:36 +01:00
Maxime Coste
2d5c730441 Replace CommandManager::register_command*s* with register_alias 2014-06-06 00:21:12 +01:00
Maxime Coste
8356e44ad5 Improve error reporting when parsing commands
*debug* will contain line and column informations along
with the responsible command name.
2014-05-07 20:39:59 +01:00
Maxime Coste
36620f8cc8 Wrap command completion containing spaces, semicolons or quotes in double quotes 2014-05-05 12:54:23 +01:00
Maxime Coste
5db3b51843 Add command aliases in command info
Fixes #101
2014-05-03 16:00:03 +01:00
Maxime Coste
65c818b859 Use StringView in CommandManager 2014-04-21 21:49:25 +01:00
Maxime Coste
20d20ae1dc formatting changes in command_manager.cc 2014-04-08 19:55:31 +01:00
Maxime Coste
3c40ac50af Add %rec{...} string that recursively expand %block inside
the result is then used as one token
2014-04-03 23:57:14 +01:00
Maxime Coste
8e0b5d67aa Fix segfault in get_until_delimiter 2014-03-05 20:57:12 +00:00
Maxime Coste
8ac19edf67 Add a docstring to commands 2014-03-02 01:08:11 +00:00
Maxime Coste
486d1269e0 Consistently name -foo things 'switches' 2014-03-02 01:08:11 +00:00
Maxime Coste
9451782648 Add command switches information, and automatically display it 2014-03-02 01:08:11 +00:00
Maxime Coste
7f9f887b4a All commands now take directly a parameter parser
The command parameters description are now stored in a ParameterDesc
structure.
2014-03-02 01:08:11 +00:00
Maxime Coste
aceee75ed9 Tolerate invalid %...{} when completing 2014-02-27 06:44:14 +00:00
Maxime Coste
37b4eacdc8 Rework command completion to allow partial token completion
Implement hook completion.

fixes #44
2014-01-27 19:51:58 +00:00
Maxime Coste
26e8c45282 CommandManager: support completion of chained commands
Command completion now work after a command separator (;)

fixes #19
2014-01-03 20:07:40 +00:00
Maxime Coste
a34b943749 Support completing %opt{...} and %sh{...} in command manager 2013-12-30 14:22:18 +00:00
Maxime Coste
56c3d9d137 Few cleanups in the command line parsing code 2013-12-29 18:37:48 +00:00
Maxime Coste
fd17ea00dd CommandManager: use aliases for commands rather than duplicating data
Completion now only proposes full command names
2013-12-24 02:06:22 +00:00
Maxime Coste
7f4d906774 move is_horizontal_blank to unicode.hh 2013-11-17 23:06:40 +00:00
Maxime Coste
04ae48c346 indent cleanup, correct erroneous 3 spaces indent 2013-11-14 00:12:15 +00:00
Maxime Coste
0244112af4 Add support for hidden commands, that will not show on completion 2013-11-12 19:38:19 +00:00
Maxime Coste
3e1bb777ce Add automatic completion display in prompt mode
Controlled by the autoshowcompl option
Completers now take a CompletionFlag parameter, used to specify
we want fast completion (tag completion can be slow, we do not
want to run it if not explicitely wanted by the user).
2013-11-04 21:59:28 +00:00
Maxime Coste
5ae43acf94 Add prefix_match function and use it instead of adhoc code 2013-09-23 21:16:25 +02:00
Maxime Coste
af8e8d27d4 Minor code cleanups 2013-07-28 16:40:02 +02:00
Maxime Coste
eedd37c09a memoryview: always pass by value 2013-07-26 01:50:36 +02:00
Maxime Coste
b1f31d2e12 change string parsing behaviour in command manager
* single and doubly quoted strings correctly remove the \ when their
delimiter is quoted ('\'' is interpreted as ', not \')

* %{} strings do not support quoting when using matching pairs, so
  %{\} is interpreted as \, however when using same ending character
  as delimiter quoting still works: %~\~~ is interpreted as ~.
2013-06-27 19:07:26 +01:00
Maxime Coste
6d125e6c36 do not use std::{to_string,stoi} as they cause problems with cygwin 2013-06-19 19:29:05 +01:00
Maxime Coste
26f0fd4cc6 Use more std::* for string handling 2013-05-13 18:43:38 +02:00
Maxime Coste
385241d2c0 remove String::replace, use boost::regex_replace directly 2013-04-12 19:16:55 +02:00
Maxime Coste
270e950cf1 sort includes directives 2013-04-09 20:05:40 +02:00
Maxime Coste
5adee4a6a7 rename assert to kak_assert to avoid collisions 2013-04-09 20:04:11 +02:00
Maxime Coste
a19a788b94 CommandManager: fix some crashes 2013-03-19 18:58:21 +01:00
Maxime Coste
fac222a427 Strongly typed options support
* non builtins options require declaration using the decl command

* At the moment, only int and string options are supported, however
the goal of this change is to provide a consistent way to support
more complex options, namely lists and booleans
2013-03-05 18:49:26 +01:00
Maxime Coste
4b649d386c various code style fixes 2013-01-04 18:39:13 +01:00
Maxime Coste
b090465e80 Command line parsing: support empty strings 2012-12-15 17:47:50 +01:00
Maxime Coste
73c446e379 code style cleanup in CommandManager 2012-11-22 14:28:14 +01:00
Maxime Coste
3b5530ac09 rename (hook|option)_manager to (hook|option)s.
And Global(Hook|Option)Manager to Global(Hook|Option)s
2012-11-22 13:50:29 +01:00
Maxime Coste
9d04c773c1 CommandManager: diagnose unterminated strings 2012-11-21 13:56:52 +01:00
Maxime Coste
0ce6bd9bf5 use ByteCount instead of CharCount when we are really counting bytes
(that is most of the time when we are not concerned with displaying)
2012-10-11 00:41:48 +02:00
Maxime Coste
c7272e427d get rid of Character 2012-10-08 19:33:53 +02:00
Maxime Coste
ae76b7dddc Add support for shell script parameters
Now %sh{ ... } can access positional parameters through
standard shell construct, allowing simple handling of variable
parameters.

def command accepts -shell-params flag to use this facility.
2012-09-09 17:10:53 +02:00
Maxime Coste
d530a2d864 Support # comments in commands 2012-09-04 00:04:49 +02:00
Maxime Coste
2825bc3d7b Fix escaped whitespace handling in command manager 2012-08-29 21:50:48 +02:00
Maxime Coste
e4fd839dda use a strongly typed int CharCount for character counts 2012-08-23 23:56:35 +02:00
Maxime Coste
346108ec62 CommandManager::parse: fix invalid memory read 2012-08-15 17:34:01 +02:00
Maxime Coste
0a976cd309 CommandManager: support %reg{<reg>} and %opt{<option>} syntax 2012-08-11 12:13:48 +02:00
Maxime Coste
a38a9c3bf2 Commands take a mutable context, main_context is gone ! 2012-08-06 22:02:11 +02:00
Maxime Coste
a712dd5bbe Completions functions take a Context parameter 2012-08-06 21:37:43 +02:00
Maxime Coste
39797f87dc command_manager: cleanup command execution, lazy exec shell commands 2012-08-06 19:29:51 +02:00