Commit Graph

390 Commits

Author SHA1 Message Date
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
Maxime Coste
954373d3cf Support multi-line replace-ranges
This likely has lots of rough edges, but should be an initial proof
of concept to support folding.
2020-04-27 17:39:21 +10:00
Maxime Coste
65620fb830 Display all failing ui_out in tests instead of just the first one 2020-04-27 17:39:21 +10:00
Maxime Coste
cb119251bc Do not replace partially selected ranges in replace-ranges highlighter
Partially selected ranges should not be replaced to make it possible
to see what is actually selected.
2020-04-27 17:39:21 +10:00
Maxime Coste
0fdfbdfd15 Fix highlighting empty ranges at end of line and begin of line 2020-04-27 14:31:26 +10:00
Maxime Coste
a33b938652 Fix issue with select object and empty matches 2020-04-21 13:21:35 +10:00
Maxime Coste
952aa0ed0a Drop trailing EOL in test commands 2020-04-13 13:36:29 +10:00
Maxime Coste
562ee6143a Parse ascii newline/tab/escape as special keys instead of control keys
Fixes #3439
2020-04-13 12:44:15 +10:00
Maxime Coste
0282cc022e Use %file in the test run script instead of %sh 2020-03-14 13:52:04 +11:00
Maxime Coste
7545fa58ae Fix invalid access to deleted line when updating insert completion
The computation of the completion end position was taking place too
early, before we checked if the buffer did get modified.

Fixes #3349
2020-03-14 13:49:52 +11:00
Maxime Coste
31caae20eb Allow reading from fifo in readonly buffers
readonly is supposed to prevent the user from modifying the buffer
and it can be useful to generate a readonly fifo buffer.

Fixes #3398
2020-03-14 12:58:22 +11:00
Maxime Coste
21dc5284b2 Fix use of non-posix \x printf escape 2020-03-13 09:33:19 +11:00
Maxime Coste
149da2064d Handle invalid utf8 in command line a bit better
Reduce the amount of decoding by working directly on
bytes.

Fixes #3388
2020-03-13 08:02:58 +11:00
Maxime Coste
0a66eb9c47 Expand env vars as list of strings
This makes it possible to do :select `%val{selections_decs}` and to
correctly combine $kak_quoted with those.
2020-03-02 20:53:28 +11:00
Maxime Coste
f808539dea Update inserted range when generating InsertCompletionHide hook param
The buffer might have been mutated in the mean time.

Fixes #3270
2020-01-08 20:33:26 +11:00
Maxime Coste
b37638dda4 Split RegexHighlighters matches per requested buffer ranges
When a region calls the regex highlighter, it is incorrect to share
the regex cache as it means we can get matches that span multiple
regions.

Fixes #3041
2020-01-05 18:58:32 +11:00
Maxime Coste
7470b22c97 Merge remote-tracking branch 'eraserhd/lisp-nested-brackets' 2020-01-05 09:55:37 +11:00
Jason Felice
0ed3bd662c {clojure,lisp}.kak: handle doubled brackets 2020-01-03 15:14:56 -05:00
Maxime Coste
8b6ed26e8c Few style changes on history exposition code 2020-01-02 22:36:26 +11:00
Maxime Coste
43dc494e5c Merge remote-tracking branch 'eraserhd/history-api' 2020-01-02 21:13:43 +11:00
Jason Felice
b03b51d27a Add 'history' and 'uncommitted_modifications' expansions 2020-01-01 19:47:29 -05:00
Maxime Coste
a17a0345cf Fix replacing at begining of buffer
Fixes #3275
2019-12-31 12:49:24 +11:00
Maxime Coste
b68490ef11 Cleanup replaced range selection logic
Do not access Buffer::m_changes to find the inserted range, return
it directly from Buffer::insert and Buffer::replace. This fixes a
wrong behaviour where replacing at eof would lose the selected end
of line (as the implementation does not actually replace that end
of line)
2019-12-18 11:36:17 +11:00
Tim Allen
c7356b363e test: number-lines highlighter now reserves 2 digits by default.
Fixes regression caused by #3261.
2019-12-17 00:57:28 +11:00
Maxime Coste
7b3ab23780 Add a regression test for #3219, which does not seem to fail 2019-11-24 18:11:29 +11:00
Maxime Coste
8528dcd621 Fix test/run ui_out diff display 2019-11-24 18:11:29 +11:00
Maxime Coste
22d9ffa63a Fix crash when deleting buffers in a BufClose hook 2019-11-22 20:29:55 +11:00
Maxime Coste
4d7ea276c4 Use fullwidth latin character in test to try to fix travis 2019-11-18 23:00:19 +11:00
Maxime Coste
25429a905b Try to fix select-display-column test 2019-11-17 10:52:25 +11:00
Maxime Coste
f9d3b0f671 Add select display columns test 2019-11-13 20:13:49 +11:00
Jason Felice
e712138ebd Fix test suite freeze
The issue is that the `test/regression/2056-assert-on-small-window`
sent JSON UI input without waiting for for the JSON UI to be
initialized.

Closes #3196
2019-11-12 09:39:37 -05:00
Maxime Coste
7a8f57f97b Add support for a -codepoint switch to the select command 2019-11-12 21:21:24 +11:00
Jason Felice
5fae16faef Implement %val{selections_char_desc}
Fixes #3194
2019-11-12 20:54:32 +11:00
Jan-Jaap Korpershoek
fcc8ed5df3 [html] Fix indentation when entering a newline while in the middle of a tag
Example:

```
        <tag>|</tag>
```
Then press enter

Old behaviour:
```
        <tag>
            </tag>
```
New behaviour:
```
        <tag>
        </tag>
```

I also added a test for it
2019-11-03 12:25:02 +01:00
Jason Felice
e888f4341c test: Allow expect-style UI tests, testing any var 2019-10-13 14:57:24 -04:00
Jason Felice
2b1ca43328 test: Clear socket correctly when XDG_RUNTIME_DIR is set 2019-10-13 14:56:55 -04:00
Maxime Coste
f1047181cb Fallback to wrapping in between 'word' when 'WORD' fails
First try to break at a whitespace, if that fails (likely because
that last WORD is too long for the wrapping width), then try to
wrap at a 'word' boundary (on a non alphanumeric character).

Fixes #3048
2019-08-12 18:40:56 +10:00
Maxime Coste
1c6aa9baed Fix bug in WrapHighlighter::do_compute_display_setup
Additional lines were not pulled correctly when a line was removed
due to its wrapping hiding the cursor.

Fixes #2999
2019-08-05 20:16:59 +10:00
Maxime Coste
e840140b38 Add indent tests for brace after else indent 2019-07-25 17:27:08 +10:00
Maxime Coste
e42c81c8eb Ensure current context switches away from buffer on delete-buffer
Fixes #3025
2019-07-22 20:26:39 +10:00
Maxime Coste
be3d0f8b33 Filter non-extra_word_chars completion candidates using Codepoints
Fixes #3010
2019-07-09 19:36:57 +10:00
Maxime Coste
9363f98f5b Fix indent/sh/deindent-after-esac test case 2019-07-01 22:04:04 +10:00
Maxime Coste
5c219cc743 Merge remote-tracking branch 'sjjf/sh_indent_v2' 2019-07-01 22:00:31 +10:00
Simon Fowler
c5dd013235 Add tests.
Probably overkill, but at least this is comprehensive . . .
2019-06-30 12:57:59 +10:00
Maxime Coste
e4d6bff5ec Fix quoting of tuple options
Fixes #2990
2019-06-27 22:42:12 +10:00
Maxime Coste
c9858bb6d1 Fix tests with new opt-in quoting 2019-06-23 12:04:21 +10:00
Dmitry Matveyev
01159a9e72 Add support for autoformatting after do keyword in Ruby 2019-06-12 09:03:24 +03:00
Maxime Coste
1ebea85e6f Do not merge selections on backspace in insert mode
Fixes #2861
2019-05-29 23:12:04 +10:00
Maxime Coste
91386a535c Support discarding selections in exec/eval -itersel
Only fail if all selections are discarded.
Fixes #2841
2019-05-13 17:34:43 +10:00
Maxime Coste
229768841b Fix parsing of faces with a base but no attributes 2019-04-28 00:35:52 +01:00
Maxime Coste
1c8f1cbc2f Fix wrapping of words with 'wrap col - indent < word len < wrap col'
Add a test case for those, and refactor bits of the wrap highlighter.

This explains part of the needed complexity in #2820.
2019-04-24 11:40:57 +01:00
Maxime Coste
4e24ba86cc Change faces alias to be a base that can be modified
Using <fg>,<bg>+<attr>@<base> will apply the given fg color,
bg color and attributes on top of base dynamically. Simply giving
<base> is a shorthand for default,default@<base>.

Inspired by the discussion in #2862
2019-04-23 23:15:23 +01:00
Alex Leferry 2
d1ae1cf971 Replace egrep with grep 2019-04-17 14:49:59 +02:00
Maxime Coste
6b79c1e000 Support named captures in hooks
Fixes #2857
2019-04-15 23:56:49 +10:00
Maxime Coste
41f19f8dc9 Add support for %file{...} expansions
This should make the use case exposed in #2836 implementable.
2019-04-07 09:43:40 +10:00
Maxime Coste
744778be30 Add a -to-file <filename> switch to the echo command
As discussed in #2836
2019-04-07 09:32:17 +10:00
Maxime Coste
baae0c899b Add -timestamp switch support to the select command
Fixes #2829
2019-04-01 22:11:18 +11:00
Grant Moyer
d8e4c6801f Fix autoindent issues with paren in literal 2019-03-31 00:07:12 -04:00
Maxime Coste
2c283d46a5 Merge remote-tracking branch 'GrantMoyer/rust-block-indent' 2019-03-29 20:12:34 +11:00
Grant Moyer
71c5077bec Block indent on newline when previous line is '(stuff' and move 'stuff' to own line
Also, align closing paren on own line with opening paren
2019-03-28 13:17:57 -04:00
Grant Moyer
61840c8b11 Preserve tabs during autoindent and alignment with '(' for c-family languages
Also add test for tab preservation during c-family autoindentation, and correct alignment of '}' with opening of block in cases of wrap between '(' and ')' in c-family languages
2019-03-28 13:08:02 -04:00
Maxime Coste
b531bab1ce Add support for -shell-script-* completion in :prompt
Fixes #2754
2019-03-24 19:28:46 +11:00
Alex Leferry 2
c0dccdd90d Add categories in rc/
Closes #2783
2019-03-21 01:06:16 +01:00
Alex Leferry 2
25630f4c91 Refactor colorize function away from the test script 2019-03-12 23:22:03 +01:00
Maxime Coste
4843149b6a Make error description available as "%val{error}" during catch blocks
Fixes #2761
2019-03-05 20:46:23 +11:00
Maxime Coste
f9d421130f Fix use of invalidated iterators in highlight_range
Fixes #2755
2019-03-05 20:31:40 +11:00
Maxime Coste
bb2aa86388 Merge remote-tracking branch 'stevenyvr987/update-test/README.asciidoc' 2019-02-17 11:21:41 +11:00
Maxime Coste
a61b6d7649 Add a test case for WinDisplay segfault
Fixes #2737
2019-02-17 11:21:26 +11:00
Dimitri Merejkowsky
0b9164e7bc Fix wording used in test runner 2019-02-17 11:21:26 +11:00
Steven Chan
fe0c357b66 Include more details in test/README.asciidoc
Define the role and content of each test file.
Further changes to test/README.asciidoc
2019-02-15 11:45:06 -08:00
Steven Chan
56bc1750cc Include more details in test/README.asciidoc
Define the role and content of each test file.
2019-02-12 13:00:35 -08:00
Justin Frank
58c15b0240 Indent and deindent c-family single line else properly 2019-02-08 15:16:29 -08:00
Maxime Coste
5c0175d90a Remove peephole regex optimization pass
The current implementation is wrong as it crosses basic blocks
boundaries. Doing basic block decomposition of regex is probably
a tad too complex for this single optimization.

Fixes #2711
2019-02-04 22:10:19 +11:00
Maxime Coste
370d10ccc7 Always select inserted text after piping
Relying on general selection update code is error prone due to
diffing.

Fixes #2394
2019-01-23 20:14:08 +11:00
Maxime Coste
0600724a8b Improve some corner cases in c-family auto-indenting 2019-01-14 23:42:57 +11:00
Maxime Coste
328c497be2 Add support for named captures to the regex impl and regex highlighter
ECMAScript is adding support for it, and it is a pretty isolated
change to do.

Fixes #2293
2019-01-03 22:55:50 +11:00
Maxime Coste
0e1e0fc57b Improve deindent behaviour with mixed indent 2018-12-13 17:35:16 +11:00
Maxime Coste
1875ff51a0 Gather the list of hooks to run before running the parent
This will prevent hooks added by the parent hook manager to be
gathered, as was decided during the discussion for #2603
2018-12-09 10:07:40 +11:00
Maxime Coste
16908bf091 Fix hooks triggering on unset-option even if parent has same value 2018-11-28 21:45:40 +11:00
Maxime Coste
c6d6060502 Add a test case for dropping full whitespace selections on trim 2018-11-27 21:05:35 +11:00
Maxime Coste
1553d91d27 Make '_' the default extra_word_chars, and remove built-in support
Fixes #2599
2018-11-27 18:16:21 +11:00
Maxime Coste
31d3cef093 Merge remote-tracking branch 'lenormf/rename-auto_complete' 2018-11-25 23:01:02 +11:00
Maxime Coste
b9ca3ee6dc Fix column highlighter adding display atoms past the window width 2018-11-14 17:47:11 +11:00
Delapouite
c08ec08513 test: add end-extending-parent/braces for }B}B - Ref #2479 2018-10-27 13:49:45 -04:00
Maxime Coste
a383ce3045 Fix LineRangeSet::udpate not updating some traling ranges correctly
Fixes #2499
2018-10-21 11:49:30 +11:00
Maxime Coste
da13b5f814 Fix handling of capture matching in region highlighter
Also extend the highlight/regions test to validate that.
Thanks to lenormf for reviewing my change and finding this bug.
2018-10-15 21:21:12 +11:00
Maxime Coste
ed84a2d60c Buffer begin and end are not end-of-words
Buffer begin never has a word character before, and end is always
preceeded by an end-of-line.

Fixes #2420
2018-10-08 12:40:52 +11:00
Justin Frank
ab6bc41358 Added shell command completion support to define-command and prompt
This commit also introduces a regression in that I decided that the best way to
avoid overly long and confusing names was to rename the current shell-*
switches to script-*, and have the shell command completion be
shell-completion.

renamed script-{completion,candidates} to shell-script-*

Updated docs with new switch names

Added -shell-completion switch to x11-repl and kitty-repl
2018-10-03 09:46:31 -07:00
Olivier Perret
93f913705a Misc fixes 2018-09-24 09:54:21 +02:00
Maxime Coste
cb8b882878 Fix broken test after change in cursor faces 2018-09-24 08:15:12 +10:00
Maxime Coste
1631a7d8d9 Replace the Exclusive face attribute with Final
Final is more granular, it consists of FinalFg (f), FinalBg (g)
and FinalAttr (a) which control if a face's fg, bg, or attributes
fully overwrite the previous face (instead of merging) and if
following faces apply on top of this face or not.

Fixes #2388 if the Whitespace face has the FinalFg flag.
2018-09-23 23:27:14 +10:00
Maxime Coste
c8fd1e1cf6 Merge remote-tracking branch 'laelath/c-indent-edits' 2018-09-13 20:42:04 +10:00
Justin Frank
de839d14c4 added test for deindentation 2018-09-12 12:25:36 -07:00
Maxime Coste
0c3d9ccd20 Change remove-hooks to take a regular expression
All hooks whose group match this regex will be removed.

Fixes #2380.
2018-09-12 21:26:21 +10:00
Maxime Coste
8536adc5ac Merge remote-tracking branch 'eraserhd/2367-surround-with-tight-nesting' 2018-09-12 20:57:59 +10:00
Maxime Coste
d3be78cca2 Only commit undo groups when buffer was modified
This fixes an interaction with kak-lsp that would trigger undo group
commit when setting a buffer option value.
2018-09-12 20:02:57 +10:00
Jason Felice
83244af106 Don't skip opening brace twice when finding closing
Fixes #2367
Fixes #2129
2018-09-09 10:15:41 -04:00