Commit Graph

386 Commits

Author SHA1 Message Date
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
Maxime Coste
74e3e5efd3 Drain ui-out to avoid deadlock with small pipe buffers 2020-06-10 09:26:32 +10:00
Maxime Coste
66f15cf4ad Fix select wiping captures
It turns out `v = std::move(v)` with v a std::vector is not a no-op,
it clears the vector.
2020-06-07 14:12:54 +10:00
Maxime Coste
d32d185d48 Merge remote-tracking branch 'pickfire/rust-doctests' 2020-06-02 18:44:53 +10:00
Maxime Coste
d43b6799cf Merge remote-tracking branch 'pickfire/rust-dedent' 2020-06-02 18:40:09 +10:00
Ivan Tham
12cafe3ed4 Rust dedent { after where clause 2020-06-02 00:26:47 +08:00
Ivan Tham
b1beea8638 Rust indent after standalone where 2020-05-31 18:13:04 +08:00
Ivan Tham
de4b7f3864 Rust indent block comment 2020-05-31 18:07:17 +08:00
Ivan Tham
4ccb5fd315 Highlight doc tests in rust
Feels a big laggy when system overloaded
2020-05-31 11:47:47 +08:00
Ivan Tham
dd3257e3f2 Rust take indentation before comment to next line 2020-05-30 10:54:55 +08:00
Ivan Tham
7c791f130c Handle dedent in rust syntax
Naively handle dedent after , and ; which works most of the cases but
does not work with multi level dedent.
2020-05-30 10:54:55 +08:00
Maxime Coste
ec4980df34 Merge commit 'krobelus/05-highlight-replace-ranges-crash^' 2020-05-30 09:18:35 +10:00
Maxime Coste
08e0b663f7 Fix unintended interpretation of ranges length syntax
Ranges specified with a +<length> were inconsistent, with +0 meaning
an empty range, while +1 meant a two character long range (first character
+ the following one). Change that to mean a single character.

Fixes #3479
2020-05-29 12:25:57 +10:00
Johannes Altmanninger
61f474fd9d Fix typo in readme 2020-05-28 21:41:21 +02:00
Maxime Coste
109abbeed4 Fix invalid regions with begin > end being generated
Fixes #3495
2020-05-28 20:58:46 +10:00
Johannes Altmanninger
fc63eef695 Fix crash when selecting previous paragraph at buffer begin
Fixes #3489

When there are multiple empty lines between a paragraph and the cursor
(C in the example below), <a-[>p skips over one of them. Prevent the
check for the extra newline from going out of bounds.

```
a paragraph

C	after <a-[>p, the first two lines will be selected
```
2020-05-17 14:15:48 +02:00
Maxime Coste
2104af0771 Fix select_sentence going past the end of the buffer
Fixes #3472
2020-05-10 15:13:15 +10:00