Commit Graph

331 Commits

Author SHA1 Message Date
Maxime Coste
2cac18545e define_command: remove unused param from parser definition 2012-08-07 14:26:51 +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
4dc9973288 Registers need a context to return their values 2012-08-05 20:13:41 +02:00
Maxime Coste
0164d78c10 Use a context as parameter to keymap functions 2012-08-05 19:39:37 +02:00
Maxime Coste
2071db3558 Tokens are CommandManager implementation details
CommandParameters go back to memoryview<String>
2012-08-01 14:27:34 +02:00
Maxime Coste
36070dd429 CommandManager: rework command parser
a new type of strings is supported inspired by the ruby strings.
%<delimiter>content<delimiter>, if opening delimiter is one of
([{<, then closing delimiter is the matching )]}> and balanced
delimiters in the string needs not to be escaped, else the closing
delimiter is the same as the opening one.

shell expansion is available through %sh<delimiter>command<delimiter>
syntax.

Command flags have been removed, as these strings provide proper nesting
support, so now, you can for example do:

def command %{ echo %sh{ ls } }
2012-07-31 14:22:57 +02:00
Maxime Coste
b65f8cc887 CommandParameters is a list of Tokens instead of Strings
CommandManager string parsing is less ad-hoc.
2012-07-31 00:06:50 +02:00
Maxime Coste
603cfd3108 do not catch exception in commands, let them propagate 2012-06-30 00:44:14 +02:00
Maxime Coste
7aa533c049 simplify Register interface 2012-06-29 13:25:34 +02:00
Maxime Coste
9b6b6b6b17 Rename UI to Client 2012-06-28 14:11:43 +02:00
Maxime Coste
ecb3a737a9 Tweak String class, and cleanup usages
remove String::clear, add operator=(String&&) add str_to_int(const String&)
to replace atoi.
2012-06-27 14:26:29 +02:00
Maxime Coste
c8fdbc2a60 support buffer as a hook target 2012-06-14 20:51:01 +00:00
Maxime Coste
0e8add34ae delete buffer deletes the current buffer when no params given 2012-06-14 18:05:42 +00:00
Maxime Coste
fd8517f91e fix some warnings detected with clang 2012-06-05 13:33:02 +00:00
Maxime Coste
a943e08dc7 Refactor OptionManager, add OptionManagerWatcher
- use set_option to set an option, instead of operator[] (no-const)
- keeps a list of OptionManagerWatcher to notify when an option change
  it also notifies when an option changes in his parent and the option
  is not overridden.
2012-06-14 13:16:44 +00:00
Maxime Coste
c0987ebacc Add a FilterGroup, and cleanup HighlighterGroup
FilterGroup is similar to HighlighterGroup, it permits grouping
together filters for easy removal.
2012-06-12 18:24:29 +00:00
Maxime Coste
e36b3565bf call SetOption hook when setting an option 2012-06-12 13:10:52 +00:00
Maxime Coste
6a416abae2 abstract ui functions in a UI base class 2012-06-05 23:15:19 +00:00
Maxime Coste
02051bb067 fix runtime directory detection on MacOS 2012-06-05 14:23:47 +00:00
Maxime Coste
61bd77d529 fix compilation on MacOS 2012-06-05 13:31:14 +00:00
Maxime Coste
419d5691a1 add a try command
use try <commands...> catch <failure_commands...>
2012-06-04 14:27:34 +00:00
Maxime Coste
f972428823 The def command do not override commands by default, use -allow-override 2012-06-02 15:49:35 +00:00
Maxime Coste
02c89022e4 Correctly set env vars in define_command 2012-05-29 05:43:09 +00:00
Maxime Coste
d599542473 Support -shell-completion option in the def command
-shell-completion takes some shell code as parameter which
should returns a newline separated list of completion candidates.
2012-05-29 05:22:18 +00:00
Maxime Coste
e57ddd3bab Factorize some duplicated completer code in register_commands 2012-05-29 03:34:54 +00:00
Maxime Coste
1257d432b4 the 'menu' commands now takes an optional -auto-single option
-auto-single tell the 'menu' command not to prompt when there
is only a single choice, and to automatically execute it's
command.
2012-05-28 23:50:11 +00:00
Maxime Coste
d96427b831 Add a delbuf (db) command which delete an existing buffer 2012-05-28 22:51:12 +00:00
Maxime Coste
393b9b24e2 Unify command parameter parsing with a ParametersParser class 2012-05-25 05:07:37 +00:00
Maxime Coste
5f2471c147 add an initial menu command, which presents several choices to users
usage is "menu 'label1' 'command1' 'label2' 'command2' ..."
2012-05-18 05:20:46 +00:00
Maxime Coste
ff86d9781d move commands to commands.{cc,hh} 2012-05-07 03:13:34 +00:00