Commit Graph

6571 Commits

Author SHA1 Message Date
Maxime Coste
64d0fd91ae Auto-generate highlighter name if only path is given 2018-07-05 07:54:28 +10:00
Maxime Coste
b0ccf97b44 Refactor RegionsHighlighters to define each region as a separate command 2018-07-05 07:54:28 +10:00
Maxime Coste
c9cdae4364 Add HashMap::items to access item list 2018-07-05 07:54:28 +10:00
Maxime Coste
d6b0297ac8 Fix ParameterParser::position_from with arbitrary indices 2018-07-05 07:54:28 +10:00
Maxime Coste
b4b335155e Refactor add-highlighter to make naming explicit
The highlighter name must be given as part of the path of the
highlighter, as the last element.

Fixes #1712
2018-07-05 07:54:28 +10:00
Maxime Coste
18dfecfa9d Introduce a "double_up" function for doubling up escaping 2018-07-05 07:54:28 +10:00
Maxime Coste
6a31d0ebc7 Fix auto escaping of command argument completion 2018-07-05 07:54:28 +10:00
Maxime Coste
51cff07821 jedi.kak: Fix post command line parsing refactoring 2018-07-05 07:54:28 +10:00
Shachaf Ben-Kiki
1b9474cd44 Fix remaining static_words and spell.kak for the new list syntax 2018-07-05 07:54:28 +10:00
Maxime Coste
7abf04babd Improve highlighting of Kakrc string regions
Unfortunately Strings that start with a quoted quote (like '''str')
are still incorrectly highlighted, a deeper refactoring of the regions
highlighter will be necessary.
2018-07-05 07:54:28 +10:00
Maxime Coste
759a253923 Change kakrc string highlighting to follow the new string syntax 2018-07-05 07:54:28 +10:00
Maxime Coste
eab98c88bd Refactor handling of startup info to make it configurable
A new `status_info_version` option allows user to disable info
message regarding changes that happened at that version or
earlier.
2018-07-05 07:54:28 +10:00
Maxime Coste
30c52eab7e Formatting fix of expansions.asciidoc 2018-07-05 07:54:28 +10:00
Maxime Coste
74e4925de0 Expand %reg{} inside double quotes only to the main selection value 2018-07-05 07:54:28 +10:00
Maxime Coste
124a5d4905 Tolerate restoring invalid coordinates from register
Clamp those selection after updating them to the current timestamp

Fixes #2078
2018-07-05 07:54:28 +10:00
Maxime Coste
ed123a2cc9 Reference the big breaking refactoring in the startup message 2018-07-05 07:54:28 +10:00
Maxime Coste
cc851d5c28 Update Changelog to describe the list syntax overhaul 2018-07-05 07:54:28 +10:00
Maxime Coste
27163106c7 Make register expansions expand to the full register content
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.
2018-07-05 07:54:28 +10:00
Maxime Coste
d6c6ed9bbf Store each selection as a separate element in a register
It makes more sense to use the list nature of the register to store
the selections instead of storing them as a single string separated
by spaces.
2018-07-05 07:54:28 +10:00
Maxime Coste
8aba0b3cb4 Change set-register command to take a list of values
Registers are lists of strings, so this make it possible to set
the whole list instead of forcing registers to a single element
when going through the set-register command.
2018-07-05 07:54:28 +10:00
Maxime Coste
183f32803b Fix selection save/restore from registers post selection list syntax change 2018-07-05 07:54:28 +10:00
Maxime Coste
087a940fbe Add 'skip(size_t)' range utility to skip a number of elements 2018-07-05 07:54:28 +10:00
Maxime Coste
9387abed81 tests: Update selections files to match the new selection list syntax 2018-07-05 07:54:28 +10:00
Maxime Coste
4e2e971033 Update commands.asciidoc, options.asciidoc and expansions.asciidoc pages 2018-07-05 07:54:28 +10:00
Maxime Coste
76093f252c Change env vars that are lists to use the general list syntax 2018-07-05 07:54:28 +10:00
Maxime Coste
a6ba65c121 doc.kak: Fix post list syntax refactoring 2018-07-05 07:54:28 +10:00
Maxime Coste
8b2e5ea862 Make selection lists use the option list syntax 2018-07-05 07:54:28 +10:00
Maxime Coste
2729042f83 Fix c-family.kak static_words definition 2018-07-05 07:54:28 +10:00
Maxime Coste
55f857dd2b Fix extra-word-chars test post list option refactoring 2018-07-05 07:54:28 +10:00
Maxime Coste
e9fc54538d Convert some of the rc/ scripts to the new list syntax
Other scripts relying on lists are broken at the moment, and will
be fixed. This commit is a proof of concept of the new way to work
with lists.
2018-07-05 07:54:28 +10:00
Maxime Coste
b548dd3a6f Change option lists to be specified as separate arguments on commands line
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.
2018-07-05 07:54:28 +10:00
Maxime Coste
5eeec8bd4d Make expansion of strings support quoting of % by doubling up 2018-07-05 07:54:28 +10:00
Maxime Coste
20f70d9177 doc/pages: Add command-parsing.asciidoc to describe command line parsing 2018-07-05 07:54:28 +10:00
Maxime Coste
c829595d01 Refactor command line parsing
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).
2018-07-05 07:54:28 +10:00
Maxime Coste
cad5f37efd Fix register saving post -save-regs behaviour change 2018-07-05 07:54:28 +10:00
Maxime Coste
b5dd9f4094 test/run: Fix script post hook behaviour change 2018-07-05 07:54:28 +10:00
Maxime Coste
a77710e098 ctags.kak: remove -no-hooks from execute-keys 2018-07-05 07:54:28 +10:00
Maxime Coste
24d8a58b0d Add -with-hooks to execute-keys and make -no-hooks evaluate-commands specific 2018-07-05 07:54:28 +10:00
Maxime Coste
9082564ab7 Make -with-maps only available for execute-keys command
It does not make a lot of sense to have this switch for
evaluate-commands.
2018-07-05 07:54:28 +10:00
Maxime Coste
5902c7b790 Do not save any registers by default in evaluate-commands 2018-07-05 07:54:28 +10:00
Maxime Coste
ec16969609 Do not reparse %sh{...} strings
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..
2018-07-05 07:54:28 +10:00
Maxime Coste
3b9818c10b Merge remote-tracking branch 'lenormf/edit-readonly-flag' 2018-07-04 19:47:05 +10:00
Maxime Coste
86616c207d Merge remote-tracking branch 'lenormf/synchronized-write' 2018-07-04 19:46:40 +10:00
Maxime Coste
220458839d Fix git-tools.kak use of $@ 2018-07-04 19:46:06 +10:00
Frank LENORMAND
ab2eade28d rc: Synchronize important file writes
Fixes #2178
2018-07-04 09:55:05 +03:00
Frank LENORMAND
5309b7b5e5 src: Add a -sync flag to the write commands 2018-07-04 09:49:53 +03:00
Maxime Coste
956c0e32e8 Merge remote-tracking branch 'maximbaz/add-missing-python3-keyword-nonlocal' 2018-07-03 22:18:08 +10:00
Maxime Coste
c40ab126d6 Merge remote-tracking branch 'maximbaz/git-gutter-further-improvements' 2018-07-03 22:17:51 +10:00
Frank LENORMAND
dd17b20bbf src: Allow the edit command to create readonly buffers 2018-07-03 14:34:48 +03:00
Maxim Baz
44f0230fe1
Add missing python3 keyword: nonlocal 2018-07-02 23:28:25 +02:00