Commit Graph

9869 Commits

Author SHA1 Message Date
Ivan Tham
56e12013c8 Rust indent keyword check boundary 2020-09-28 00:09:12 +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
antab
737134b993 fix: improve regex for build region 2020-09-22 13:49:11 +02:00
Maxime Coste
dd1a582b30 Merge branch 'patch-3' of http://github.com/blaggacao/kakoune into master 2020-09-22 21:28:41 +10:00
Maxime Coste
c6bfce0350 Merge remote-tracking branch 'Screwtapello/spell-replace-prompt' into master 2020-09-22 21:26:22 +10:00
Maxime Coste
3dcdd6617f Merge remote-tracking branch 'Screwtapello/master' into master 2020-09-22 21:23:53 +10:00
Maxime Coste
fa375d1c46 Merge remote-tracking branch 'krobelus/dont-highlight-escaped-expansion' into master 2020-09-22 21:23:00 +10:00
Maxime Coste
154e11181f Merge remote-tracking branch 'krobelus/perl-quoting' into master 2020-09-22 21:20:14 +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
David Arnold
0d476aaa95
just: highlight function expressions 2020-09-22 00:24:29 -05:00
Tim Allen
93e5a3b51f spell.kak: Replace "kak -f" with "sed" for efficiency. 2020-09-22 01:29:03 +10:00
antab
d0ee3dfe94 fix: add subninja and include to static_words 2020-09-21 13:41:19 +02:00
antab
d5ccdcfed4 fix(ninja filetype): add subninja and include declarations and fix builddir highlights 2020-09-21 13:34:27 +02:00
Tim Allen
f75f484b84 spell.kak: Present spelling suggestions with :prompt
Previously, spelling suggestions were presented with the :menu command,
requiring the user to cycle through wild and fanciful alternatives to get to the
one they wanted. Now, we present suggestions with the :prompt command, which
allows the user to type to filter down the list, and also to customise the
replacement after they've chose it (perhaps to fix capitalisation or add
apostrophe-S).

We also use the mispelled word as the initial content of the prompt. That
filters out the wildest alternatives by default, and allows the user to edit the
original word instead of forcing them to choose from among the suggestions. To
get the full list of suggestions, it's easy enough to just backspace until the
word you want appears in the list.
2020-09-21 21:07:35 +10:00
Tim Allen
9bc00b6853 doc: Document the form of next-key sub-modes in the ModeChange hook. 2020-09-21 17:28:18 +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
Johannes Altmanninger
50775b26e4 *sh.kak: do not highlight expansions if their $ is escaped 2020-09-19 08:06:46 +02:00
Johannes Altmanninger
19b54a8a6e Highlight more Perl quoting syntaxes
This adds highlighting for

- quoting operators qw, qr, and qx, like `qw< some words >`
- angle brackets after a quoting operator, like `q<string>`
- punctuation as quoting delimiter, like `q|string|`
- POD sections, which start with ^=\w and and with ^=cut
- heredocs; the marker can be a bare word, or a quoted word, like

	print <<~ 'EOF'
		single quoted heredoc
	EOF

Closes #3736

No attempt is made to use different highlighting for interpolated (qq or
"") strings just yet. Recognizing quote boundaries is more important.
2020-09-18 20:55:12 +02:00
Frank LENORMAND
4025ac8167 rc modeline: Print the final command directly 2020-09-18 15:12:13 +03:00
Frank LENORMAND
2a51ebf105 rc modeline: Factorise the use of kakquote 2020-09-18 15:12:13 +03:00
Frank LENORMAND
2d78b0760d rc modeline: Error out on unsupported formats
This commit makes `:modeline-parse` grab all lines that look like
modelines, and lets the parser deal with invalid formats.

This allows actually printing an error on unsupported modelines
formats, instead of ignoring them upfront.
2020-09-18 14:54:57 +03:00
Frank LENORMAND
30ee97386d rc modeline: Use more idiomatic shell 2020-09-18 14:54:57 +03:00
luka null
1296922d66 Add illumos/Solaris support 2020-09-18 05:22:25 -05:00
Frank LENORMAND
7731fe4cb2 rc modeline: Print error messages correctly 2020-09-18 09:01:32 +03:00
Frank LENORMAND
d02cb43a88 test: Implement a regression test for #3735 2020-09-18 09:01:32 +03:00
Frank LENORMAND
6976b1dce4 rc modeline: Prevent command execution
This commit prevents specially crafted modelines from making the
editor execute arbitrary Kakoune commands.

By using a tabulation character as a separator, commands can be
injected in the value of the options listed in the modeline. For
example:

	# kak: tabstop=2;set-option	buffer	pwned	yes

Fixes #3735.
2020-09-18 09:01:32 +03:00
Maxime Coste
dbd7e4da79 Merge remote-tracking branch 'voroskoi/gopls' into master 2020-09-17 19:49:33 +10:00
Maxime Coste
fd658f6995 Merge remote-tracking branch 'lenormf/fix-3733' into master 2020-09-17 19:39:48 +10:00
Maxime Coste
b8f56a65ed Merge remote-tracking branch 'deviant/add-go-alternative-file' into master 2020-09-17 19:38:59 +10:00
Maxime Coste
0e58d4702c Merge branch 'patch-1' of http://github.com/xiaq/kakoune into master 2020-09-17 19:35:56 +10:00
Maxime Coste
cb047a4a7d Merge remote-tracking branch 'tototest99/ninja-syntax' into master 2020-09-17 19:34:54 +10:00
Maxime Coste
81163ce48a Merge remote-tracking branch 'Aajn/python-highlighter' into master 2020-09-17 19:33:51 +10:00
VÖRÖSKŐI András
9fe1a2a9a4 gopls: fixes based on krobelus@ review 2020-09-16 21:58:22 +02:00
antab
810689ad60 fix: variables adjacent to = and in build declaration 2020-09-16 21:09:27 +02:00
Frank LENORMAND
643bf2bb59 test: Implement a regression test for #3733 2020-09-16 11:00:15 +03:00
Frank LENORMAND
95c095f3fb rc modeline: Don't select more lines than configured
This commit addresses an off-by-one error that selected `modelines`+1
lines when looking for modelines in a buffer.

Note that setting `modelines` to 0 will still select one line.

Fixes #3733.
2020-09-16 11:00:15 +03:00
antab
ea4f2b8837 feat: add basic ninjafile support 2020-09-16 00:03:17 +02:00
David Arnold
1ff9895fe4 just: re-implment bash/sh interpreter 2020-09-15 16:32:07 -05:00
David Arnold
3857696df6
just-highlighter: pre call out to shebang regions 2020-09-15 16:10:40 -05:00
David Arnold
3770baaab0 fix justfile highlighter
This fixes serveral shortcomings of the current implementation:

- valid recipt definitions eg
foo bar="quz":
where previously interrupted by justfile/double_string
and therefore they where not highlighted correctly

- global variable assignments where not captured at all
2020-09-15 15:52:00 -05:00
antab
b5a7f63f7e tototest99 Copyright Waiver
I dedicate any and all copyright interest in this software to the
public domain.  I make this dedication for the benefit of the public at
large and to the detriment of my heirs and successors.  I intend this
dedication to be an overt act of relinquishment in perpetuity of all
present and future rights to this software under copyright law.
2020-09-15 22:48:00 +02:00
Piotr Chrominski
bfbf4d2080 Fix python docstring highlighter
Escaped ' or " at the end of a docstring no longer break highlighting.
2020-09-15 22:01:55 +02:00
Piotr Chrominski
ef10d07be8 Piotr Chrominski Copyright Waiver
I dedicate any and all copyright interest in this software to the
public domain.  I make this dedication for the benefit of the public at
large and to the detriment of my heirs and successors.  I intend this
dedication to be an overt act of relinquishment in perpetuity of all
present and future rights to this software under copyright law.
2020-09-15 21:56:05 +02:00
VÖRÖSKŐI András
2b18b1d088 rc/go-tools.kak: remove
Working functions replaced by gopls
Use kak-lsp if you need in place documentation and autocompletion
2020-09-15 01:02:19 +02:00