| Age | Commit message (Collapse) | Author |
|
Reduce the amount of decoding by working directly on
bytes.
Fixes #3388
|
|
Completion candidates are currently escaped with a backslash `\`
character, which leads to ugly interactive commands on the prompt,
especially when they contain space characters.
This commit makes completion candidates be escaped by simple quoting.
Examples:
candidate\ with\ spaces
\%opt{foo}
\"dquote
\'quote
become:
'candidate with spaces'
'%opt{foo}'
'"dquote'
'''quote'
|
|
This makes it possible to do :select `%val{selections_decs}` and to
correctly combine $kak_quoted with those.
|
|
|
|
|
|
|
|
Builtin registers have name aliases that can be completed upon when
using a `%reg{}` expansion from the prompt.
|
|
|
|
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.
|
|
This clarifies, that the hook is run *after* the module is loaded.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This should make the use case exposed in #2836 implementable.
|
|
Sometimes we really need to have a String instead of a StringView,
but some of those strings might not need to own their data. Make
it possible to explicitely construct a String that does not own
the underlying buffer.
Use it when parsing balanced strings.
|
|
Add a test case to validate roundtrips between Kakoune and the
shell.
|
|
Fixes #1467
|
|
Balanced quoted parsing does not need to decode utf8, neither does
unquoted word parsing. This improves startup time a bit, helping
for issue #2152
|
|
|
|
|
|
Now that we have a nice standard way to express lists of strings,
registers can be fully exposed. An new $kak_main_reg_... env var
was added to provide the previous behaviour which is relied on by
doc.kak.
|
|
Option lists and maps are specified using separate arguments, avoiding
the need for additional escaping of their separator and reusing the
existing command line spliting logic instead.
As discussed on #2087, this should make it much easier to work with
list options, and make the general option system feel cleaner.
|
|
|
|
Command line parsing now works as follow:
* Quoted strings ('...', "..." and %~...~ with '~' non nestable)
use 'doubling-up' for escaping their delimiter, if the delimiter
appears twice in a row, it is considered as part of the string and
represent one delimiter character. So 'abc''def' == "abc'def". No
other escaping takes place in those strings.
* Balanced strings (%{...}) do not support any kind of escaping, but
finds the matching closing delimiter by taking nesting into account.
So %{abc{def}} == "abc{def}".
* Non quoted words support escaping of `;` and whitespaces with `\`,
`%`, `'` and '"` can be escaped with `\` at the start of the word,
they do not need escaping (and will not be escaped) else where in
a word where they are treated literally. Any other use of '\' is a
literal '\'. So \%abc%\;\ def == "%abc%; def"
As discussed in #2046 this should make our command line syntax more
robust, provide a simple programmatic way to escape a string content
(s/<delim>/<delim><delim>/g), be well defined instead of ad-hoc
undocumented behaviour, and interact nicely with other common
escaping by avoiding escaping hell (:grep <regex> can in most case
be written with the regex unquoted).
|
|
Automatic reparsing of %sh{...}, while convenient in many cases,
can be surprising as well, and can lead to security problems:
'echo %sh{ printf "foo\necho bar" }' runs 'echo foo', then 'echo bar'.
we make this danger explicit, and we fix the 'nop %sh{...}' pattern.
To reparse %sh{...} strings, they can be passed to evaluate-commands,
which has been fixed to work in every cases where %sh{...} reparsing
was used..
|
|
`fail` triggers "expected" errors, and hence should just display
the provided message.
|
|
Fixes #2079
|
|
|
|
|
|
|
|
This overload will forward to the general transform implementation
using std::mem_fn to generate a callable.
|
|
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.
|
|
Fixes #1857
|
|
|
|
Avoid storing a big vector of tokens, read them one by one, and
store only the current command.
|
|
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.
|
|
|
|
Fixes #1829
|
|
|
|
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.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
Fixes #1378
|