Commit Graph

402 Commits

Author SHA1 Message Date
Ivan Tham
8df5621334 Support dedent with rust fn qualifiers 2021-03-07 14:12:01 +08:00
Ivan Tham
4e594e034a Dedent rust await function with ? 2021-02-17 01:17:17 +08:00
Ivan Tham
049591f6b4 Dedent rust empty match 2021-02-17 01:17:14 +08:00
Maxime Coste
978dfe4bdf Fix splitting display line in front of a replaced range
When a replaced buffer range atom was starting exactly at the
location we wanted to split onto the code would split *after*
that atom instead of before.

Fixes #4052
2021-02-16 12:35:25 +11:00
Maxime Coste
fa3aa3c1a3 Add + key to duplicate selections and <a-+> to merge overlapping ones
This is an experiment and might get reverted if overlapping selections
prove too cumbersome.

Fixes #4041
2021-02-15 09:01:14 +11:00
Maxime Coste
841ec2e588 Support a DEBUGGER env-var to run tests
Setting it to `gdbserver :12345` makes it easy to debug a test
case with the correct setup.
2021-01-22 17:21:59 +11:00
Ivan Tham
a955d99fe3 Rust test rename deindent to dedent 2020-12-17 20:08:26 +08:00
Ivan Tham
1965b909e1 Rust dedent after .await 2020-12-17 20:07:44 +08:00
Ivan Tham
ffbdcaa95c Rust handle [ indent like { and ( 2020-12-17 11:19:23 +08:00
Maxime Coste
14f7d2637c Fix test and re-add triple_string support in python highlighting
Triple strings are now distinct from docstrings, triple strings
only preceeded by blanks on the line are considered docstrings.

Avoid highlighting of the closing marker using a lookahead, this
is not fully correct as it will break on a double quote triple
docstring containing a single quote triple string but that seems
improbable enough; if we encounter this in the wild we can split
the two docstring formats into separate regions.
2020-11-23 08:45:59 +11:00
Maxime Coste
13ada43dd9 Merge remote-tracking branch 'Screwtapello/test-doc-updates' 2020-11-22 16:54:09 +11:00
Tim Allen
19115aa524 test: Update the README to describe the current test API.
I removed files which are no longer significant (ui-in, ui-out, selections,
state), added new files which are now important (enabled, script, kak_*),
and reordered the files to reflect the order in which they are applied -
in particular, cmd is applied *after* the input is read.
2020-11-21 16:57:08 +11:00
Andrew Vos
f3f3f80624
Ignore indent when completing lines
When doing line completion, we previously used to not complete the line
if it had different indent to the potential completion.

This commit changes the behaviour to ignore indentation when completing lines.
2020-11-20 20:00:46 +00:00
Maxime Coste
9a5cf2fc9f Support explicit register for :, |, ! and $ commands
Giving an explicit register uses its content for the default value
to use if the user does not enter anything. This enables:

`set-register a %{commands}; execute-keys '"a:<ret>'`
`set-register a %{shell script}; execute-keys '"a|<ret>'`
...

This provides a nice way to avoid the need to escape keys to use
those normal mode commands.

Fixes #3825
2020-10-20 21:56:51 +11:00
Maxime Coste
246a32797a Fix region regexes incorrectly matching ^$ at end of line
Because no flags were set for regex matching, the regex engine was
assuming that the subject string past-the-end matched a end-of-line.
As the subject string already ended with a \n character, the regex
engine processing of the "past-the-end" position would match '^$'
as ^ matched past the existing \n and $ matched the assumed
end-of-line.

Fixes #3799
2020-10-12 12:41:21 +11:00
Ivan Tham
c148fdbe9a Rust always indent after { 2020-10-04 23:40:49 +08:00
Ivan Tham
b0ae30a443 Add missing rust indent after function { 2020-10-04 14:19:33 +08:00
Maxime Coste
fcabffefe1 Merge remote-tracking branch 'pickfire/rust-indent' into master 2020-10-01 19:07:05 +10:00
Ivan Tham
bfca07da4d Rust not to indent on hash 2020-09-30 00:37:35 +08:00
Ivan Tham
df68a77ed2 Rust reindent where to match block 2020-09-28 00:03:53 +08:00
Ivan Tham
785cbaeaed Add rust test for empty line indent 2020-09-27 23:34:08 +08:00
Ivan Tham
5c8dfcdfa9 Rust improve align after partial statement 2020-09-27 15:53:15 +08:00
Ivan Tham
11d98a07dc Rust align open paren for if and for 2020-09-27 15:52:42 +08:00
Simon Fowler
83277d5545 Improve shell indentation implementation.
Use the custom object match command for copying indentation of blocks,
rather than simply increasing/decreasing indentation when start and end
statements are encountered.

This fixes an issue where a newline added after an already correctly
placed `else` or `fi` would trigger an unnecessary deindent. Tests have
been added to ensure no regression in this behaviour.
2020-09-26 22:10:31 +10:00
Maxime Coste
57208a5481 Merge remote-tracking branch 'm-kru/go_kak_fix' into master 2020-09-22 21:18:52 +10:00
Maxime Coste
0ef858da64 Merge remote-tracking branch 'lenormf/fix-3735' into master 2020-09-22 21:17:12 +10:00
Maxime Coste
5d17e1132f Ensure that the capture group actually matched in select_matches
We were creating selections from default constructed iterators,
which happened to have 0,0 coords and led to out-of-order selection
lists.

Fixes #3757
2020-09-22 21:14:40 +10:00
Michał Kruszewski
f78cd6daf8 Improve '}' auto inserting for go language.
Adding "} else if ... {" was not correctly handled.
2020-09-20 12:25:26 +02:00
Frank LENORMAND
d02cb43a88 test: Implement a regression test for #3735 2020-09-18 09:01:32 +03:00
Frank LENORMAND
643bf2bb59 test: Implement a regression test for #3733 2020-09-16 11:00:15 +03:00
Michał Kruszewski
0f63dd339a Provide better support for Go language.
1. Highlight short variable declaration operator :=.
2. 'while' is not go keyword.
3. Auto insert ')', '}', when line ends with '(' or '{'.
2020-09-07 21:48:06 +02:00
Johannes Altmanninger
266fe6f659 Support count argument for [s and ]s
Part of #795
2020-08-02 11:30:14 +02:00
Johannes Altmanninger
98a1afcab0 Support count argument for [p and ]p
Part of #795
2020-08-02 11:30:14 +02:00
Johannes Altmanninger
581f17970d Move tests to accommodate tests with count 2020-08-02 11:30:14 +02:00
Maxime Coste
1c9e460053 Fix escaping of single quotes in rust value highlighting test 2020-07-31 07:55:27 +10:00
Maxime Coste
8d51a99a3b Merge remote-tracking branch 'pickfire/rust-highlight' 2020-07-31 07:50:14 +10:00
John Isom
428232d2fa Add tests for javascript deindenting 2020-07-29 15:05:49 -06:00
John Isom
504d309894 Add go test cases for bad indentation edge case 2020-07-27 12:18:40 -06:00
John Isom
26f4681c3b Add rust test cases for bad indentation edge case 2020-07-27 12:13:23 -06:00
John Isom
2e6e507d42 Add c-family test cases for bad indentation edge case 2020-07-27 12:02:32 -06:00
John Isom
0439128007 Add test cases for go closing brace indentation 2020-07-26 20:28:33 -06:00
John Isom
d2437b468d Add test cases for rust closing brace indentation 2020-07-26 20:03:54 -06:00
John Isom
46ea52a0a8 Add test cases for c-family closing brace indentation 2020-07-26 19:04:08 -06:00
Ivan Tham
974684aa68 Improve rust comment closing handling
/// foo
    ///%( )

    /// foo
    /// %( )

With `c<ret>bar<esc>`,

    /// foo
    bar

    /// foo
    ///
    /// bar

Based on c-family block comment handling, this patch also add rust
block comment indentation.

This affects `o` behavior on empty comment but it allows a way more
efficient way to clear comments.
2020-07-09 23:02:50 +08:00
Ivan Tham
dd6684a17d Split rust comment tests 2020-07-09 00:21:11 +08:00
Ivan Tham
21c38f37cd Fix rust character highlight 2020-07-09 00:21:11 +08:00
Ivan Tham
7bd459f774 Fix rust comment end 2020-07-09 00:21:11 +08:00
Ivan Tham
74e16a0623 Fix rust comment test 2020-07-09 00:21:11 +08:00
Ivan Tham
eac5986323 Fix rust doctest non-hidden macro highlight 2020-07-09 00:21:11 +08:00
Maxime Coste
8abf18209e Fix selections getting unsorted on scroll
Fixes #3478
2020-07-05 10:13:57 +10:00