Commit Graph

462 Commits

Author SHA1 Message Date
Delapouite
99f38c99ec Fix :prompt command description 2016-12-15 14:42:46 +01:00
Maxime Coste
2fd1414b05 Clean up includes of user_interface.hh 2016-11-29 19:53:11 +00:00
Maxime Coste
12856066b1 Cleanup include dependencies a bit 2016-11-28 23:58:08 +00:00
Maxime Coste
2f3a7112ea Add more memory domains to certain data 2016-11-28 13:59:55 +00:00
Maxime Coste
a4738ace5f :prompt and :onkey (renamed :on-key) now use values instead of registers
:prompt provides the entered text in the `text` value, :on-key provides
the entered key in the `key` value.

Closes #938
2016-11-27 20:57:04 +00:00
Maxime Coste
e340e0ed39 Forward client name to contexts created for write-all
Fixes #937
2016-11-24 13:35:42 +00:00
Maxime Coste
8f2c6eb586 Fix write_all_buffers when BufWrite... hooks create/delete buffers
The buffer list can be mutated during iteration, so it is no safe
to directly iterate on the BufferManager, we need to first create
our own copy of the buffer list.

Fixes #935
2016-11-23 23:51:16 +00:00
Maxime Coste
b884b499dd Rework ensure_all_buffers_are_saved to remove an unneeded Vector 2016-11-23 23:39:42 +00:00
Maxime Coste
0b806cd4f1 Add missing hooks to completion list and validate hook name in hook cmd 2016-11-21 09:51:47 +00:00
Maxime Coste
be03fdce2a Support completing hook names
Fixes #879
2016-11-20 11:17:13 +00:00
Maxime Coste
cd8d51af34 Fix PerArgumentCommandCompleter when completing the non first arg
The actualy query passed was always the first argument.
2016-11-20 11:16:34 +00:00
Maxime Coste
4a2fea8c9e Continue command renaming to improve consistency 2016-11-15 13:49:06 +00:00
Maxime Coste
b3ba769220 Propagate the hooks disabled state through prompt, menu, and command execution
Maintain it as well during buffer creation even if the hooks are not executed
in client context.

Fixes #818
2016-11-14 19:39:35 +00:00
Maxime Coste
dcd733e5fa Do a first phase of command renaming 2016-11-14 00:27:14 +00:00
Maxime Coste
9153663dfa Add -save-regs defaults in the context wrap docstring 2016-11-08 09:49:48 +00:00
Nikolaus Wittenstein
e7970232d3 Fix typo in write_cmd's desc
Should be possessive "its".
2016-10-31 12:42:10 -04:00
Maxime Coste
cc2affea11 Always allow to delete a buffer, just recreate a scratch buffer if needed
Fixes #850
2016-10-13 21:37:44 +01:00
Maxime Coste
1f3e424047 Do not expand filenames when doing insert filename completion
Fixes #855
2016-10-13 19:46:09 +01:00
Frank LENORMAND
f7e2bfd76f Document the optional parameter of the cd command 2016-10-11 10:39:20 +03: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
5dd47e9c33 Preserve shell context through eval command
Fixes #835
2016-10-06 23:22:39 +01:00
Maxime Coste
d50087eabe Change BufWritePre/BufWritePost logic
Run them in client context if possible, and give them the target
filename instead of the buffer name.

Fixes #823
2016-10-01 23:51:53 +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
e3c4bddd3b Make hook disabling work for all hooks, not only user hooks
Fixes #823
2016-09-26 23:43:05 +01:00
Maxime Coste
4f874a3679 Code cleanup in make_completer, use std::decay 2016-09-19 23:26:52 +01:00
Maxime Coste
396b71ecc2 Add an unmap command to remove key mappings 2016-09-19 09:10:41 +01:00
Maxime Coste
44e9da3bee More command completer code cleanup 2016-09-18 16:27:34 +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
4fc20b8d7d Rework client quitting and handling of remote errors
Client quitting no longer immediately unwinds, client is just pushed
for deletion until we get back to the main loop, similarly to what
happens for buffer and window deletion.
2016-09-04 17:56:07 +01:00
Maxime Coste
3831117bc7 style tweak 2016-08-30 23:23:07 +01:00
Maxime Coste
b6cab458ed Use a heap instead of sorting to gather the best shell-candidates matches
O(n + k * log n) (with k = 100 here) instead of O(n log n), much faster
with many candidates.
2016-08-30 13:42:29 +01:00
Maxime Coste
f6cb6319d6 Enable shell-candidates update in fast completion mode 2016-08-30 00:55:01 +01:00
Maxime Coste
911a32a992 Only drop blank prefixed history entries in command/shell prompts
For regex prompts we actually want to save them, as a leading space
is significant

Fixes #767
2016-08-22 20:37:14 +01:00
Maxime Coste
f73e89a716 Add information of types of options 2016-08-06 09:05:50 +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
38d372567b Do not force exec to run in normal mode anymore, run in the current mode 2016-08-05 09:43:33 +01:00
Maxime Coste
2425f4a781 Tweak session renaming code 2016-07-28 00:16:41 +01:00
Maxime Coste
62fa133efd Merge remote-tracking branch 'doppioandante/set_session' 2016-07-28 00:12:09 +01:00
Enrico Lumetti
1a7cd707aa Add 'session' command to change remote session name 2016-07-24 22:46:33 +02:00
Frank LENORMAND
e3bf01d1f9 Replace C-style operators with their alphabetical equivalent 2016-07-24 08:34:49 +03:00
Frank LENORMAND
8a4596bea9 Implement a readonly mode
This commit introduces the `readonly` variable as well as the `-ro`
command line option which prevent buffers from being overwritten on
disk when the `write` command is used without arguments. Some buffers
can selectively be put in readonly mode by setting the `readonly`
variable on the `buffer` scope, the `global` mode will affect all
buffers (even those who will be open subsequently), using the `window`
scope will have no effect.

Closes #685
2016-07-23 10:03:21 +03:00
Maxime Coste
88a9607552 Keep modified selections in non-draft exec/eval -itersel
Fixes #727
2016-07-08 09:52:10 +01:00
Maxime Coste
fcf73c2293 Refactor context_wrap to share more code between draft/non draft case
Fixes #706
2016-06-22 22:27:43 +01:00
Maxime Coste
5cb9cf4cc3 Go back to saving built-in registers by default in non draft :exec/:eval 2016-06-22 19:57:21 +01:00
Maxime Coste
91bf0d4622 Make window scope available to draft contexts
We do want window options/aliases/keymaps/hooks to be available in
draft context, dont we ?

Fixes #702
2016-06-20 19:45:15 +01:00
Maxime Coste
fef37e6a92 Do not preserve registers by default when exec/eval in a non draft context
Fixes #700
2016-06-20 19:40:49 +01:00
Maxime Coste
5cab2078f8 Fix string view created from a temporary string
This is clearly a case where rust style lifetime analysis would
have been nice, hopefully it comes with GSL lifetime extensions...

Fixes #680
2016-05-24 22:36:20 +01:00
Maxime Coste
6181781f3d Change dir to $HOME when no parameters are given to cd
Fixes #678
2016-05-20 09:41:29 +01:00
Maxime Coste
fb01c8c377 Do not force recreate scratch buffers by default, require edit! for that 2016-05-17 19:41:24 +01:00
Maxime Coste
1788126f38 BufferManager now owns the Buffers instead of registering them 2016-05-14 08:33:50 +01:00