Commit Graph

346 Commits

Author SHA1 Message Date
Maxime Coste
dbfed1306f git.kak: Refactor commit message highlighting
Use regions to avoid highlighting the commit message as a diff.
The new method will fail if one line of the commit message matches
'^diff --git' but that is fairly unlikely.

Fixes #2371
2018-09-23 18:00:51 +10:00
Maxime Coste
49645f8efc Merge remote-tracking branch 'laelath/spell-clear' 2018-09-23 17:05:51 +10:00
Jason Felice
538f2a74c7 Fix clojure numbers
- Fix issue where numbers which were part of symbols were highlighted.
- Fix issue where hexidecimals weren't highlighted past the 'x'
2018-09-22 16:16:36 -04:00
Justin Frank
5700587926 added spell-clear convenience command 2018-09-21 12:30:13 -07:00
Delapouite
425aa56eaf Use remove-hooks regex in rc 2018-09-19 19:59:57 +02:00
Maxime Coste
0fca6ae3dd Merge remote-tracking branch 'Screwtapello/code-regions-for-markdown' 2018-09-18 22:30:07 +10:00
Tim Allen
9e142c6643 markdown.kak: Use lookahead/lookbehind assertions for formatting spans.
Previously, one of the syntaxes for italic was (greatly summarized) something
like this:

    [^_]_[^_]+_[^_]

That is to say, the regex matched the blanks on both sides of the italic span,
as well as the actual span content. That means that if you had consecutive
italic words:

    _some_ _italic_ _words_

...only the odd-numbered words would be highlighted: the space after "_some_"
was counted as part of that span, so it wasn't available as part of "_italic_"
and therefore "_italic_" wouldn't be highlighted. Likewise, if the first word
in a buffer was italic, it wouldn't be highlighted because the first underscore
was not preceded by a non-underscore character!

Now we use lookahead/lookbehind assertions, which don't count as part of the
matched span, so consecutive spans don't interfere with one another.

Fixes #2111.
2018-09-18 19:21:28 +10:00
Tim Allen
535abe2ba7 markdown.kak: Clean up code-block and code-span formatting.
Previously, a code block was anything between triple-backtics, including inline
blocks:

        some text ```
        not a codeblock, but highlighted as one
        ``` other text

and even if the closing backticks had the wrong indent:

        ```
        this is a code block containing a triple backtick
            ```
        this is still a code block, but Kakoune thinks otherwise
        ```

Now we use the -match-capture flag to ensure the start and end fences have
exactly the same indent.

Previously, the generic code-block region was defined first, which meant that
it took priority over all the language-specific highlighters. Now we define
the generic code-block highlighting *after* the others, which fixes #2304.

Previously, code-spans were defined as ordinary inline markup, but in Markdown
ordinary formatting doesn't work inside code-spans. Therefore, they are now
regions unto themselves, defined according to section 6.3 of the CommonMark
spec <https://spec.commonmark.org/0.28/#code-spans>, which addresses a comment
on #2111.
2018-09-18 19:18:32 +10:00
Jason Felice
fbd733f49c Homebrew Brewfile is ruby 2018-09-17 10:29:05 -04:00
Jason Felice
1b1119e85c Improve Clojure highlighting 2018-09-04 20:44:25 -04:00
Maxime Coste
a91fc83bfe Merge remote-tracking branch 'lenormf/fix-git' 2018-08-20 07:56:32 +10:00
Maxime Coste
1904202d05 Merge remote-tracking branch 'lenormf/fix-lisp' 2018-08-20 07:49:21 +10:00
Frank LENORMAND
802f51c02a rc git: Support new rebase commands 2018-08-19 07:44:00 +03:00
Maxime Coste
1485150b68 Use -once hooks to remove fifo directories 2018-08-19 08:04:31 +10:00
Frank LENORMAND
afd44ddaea rc lisp: Highlight basic numeral forms 2018-08-13 20:49:15 +03:00
Frank LENORMAND
93e1b3c254 rc lisp: Extend the range of identifier characters 2018-08-13 20:48:53 +03:00
Frank LENORMAND
36d94cecb4 rc lisp: Fix variable highlighting
Fixes #2289
2018-08-11 10:13:38 +03:00
Maxime Coste
ae75032936 Merge remote-tracking branch 'Screwtapello/support_rust_raw_strings' 2018-08-05 11:44:15 +01:00
Frank LENORMAND
5953a38bdd rc lint: Be more resilient to null coordinates
Some syntax checkers (such as `cppcheck`) like to pass
extra-information using a regular diagnostic line - but with null
coordinates (0:0).

This commit makes the `:lint` command ignore such messages, to prevent
`set-option` from failing when assigning coordinates to `lint_flags`, and to avoid unecessary information in the `*lint-output*` buffer.
2018-08-02 14:20:16 +03:00
Tim Allen
8a9471ca5c rust.kak: Support Rust's raw-string syntax.
According to the Rust language reference[1], a raw string starts with an 'r',
zero or more '#' characters, and a '"', and doesn't close until a '"' is
immediately followed by the matching number of '#' characters.

[1]: https://doc.rust-lang.org/reference/tokens.html#raw-string-literals
2018-08-02 15:16:25 +10:00
Maxime Coste
1c0cc61ccc Merge remote-tracking branch 'lenormf/fix-lint' 2018-07-31 16:05:00 +01:00
Hao Deng
b2b7672eb3
sql is case insensitive
make sql hilighter case insensitive.
2018-07-30 14:49:21 -04:00
Frank LENORMAND
eee0035a0f rc lint: Create temporary file with the same buffer extension
Fixes #2189
2018-07-30 15:12:41 +03:00
Jan-Jaap Korpershoek
db6f51b411 Fix unclosed string due to unescaped ' 2018-07-26 11:16:44 +02:00
Jan-Jaap Korpershoek
0a1c4ecf3d Add / behind add-highlighter path 2018-07-26 10:59:42 +02:00
Frank LENORMAND
64c7f8c564 rc: Highlight systemd files in a dedicated script 2018-07-24 11:28:09 +03:00
Maxime Coste
5fb43478ff Merge remote-tracking branch 'lenormf/fix-lint' 2018-07-22 21:12:06 +10:00
Maxim Baz
6cc46dd307
Recognize systemd timer syntax 2018-07-22 01:33:44 +02:00
Frank LENORMAND
929ef9f5ec rc lint: Escape pipes in diagnostics 2018-07-20 13:18:33 +03:00
Maxime Coste
ab94d1745e mail.kak: Recognize Date header 2018-07-19 18:40:48 +10:00
Maxime Coste
2a3e3f0514 Tweak various scripts to improve the time they take to load
As requested in #2152, startup time should be slightly better.
2018-07-19 18:32:29 +10:00
Maxime Coste
d8cf4f3f3b Merge remote-tracking branch 'lenormf/fix-lint' 2018-07-19 08:27:40 +10:00
Frank LENORMAND
4bd6fe55d4 rc lint: Fix diagnosis displaying 2018-07-18 17:42:56 +03:00
Frank LENORMAND
6f35f41ba0 rc lint: Adapt to upstream changes in the format of string lists 2018-07-18 15:48:34 +03:00
Frank LENORMAND
4612d0928a rc lint: Print an error when lintcmd is empty 2018-07-18 14:16:05 +03:00
Maxim Baz
b0b466e0d3
Recognize .gitconfig syntax 2018-07-08 18:10:12 +02:00
Maxime Coste
79ec8d0010 Rename highlighters that used an underscore to use a dash
For example `show_matching` is now `show-matching`.
2018-07-08 19:14:15 +10:00
Maxim Baz
a4b8954934
Remove the -highlight suffix 2018-07-07 01:51:18 +02:00
Maxim Baz
4e0f404eaa
Fix highlighter in lint.kak 2018-07-06 12:43:21 +02:00
Maxime Coste
2e0e206951 Make recurse regex opt-in with a -recurse switch instead of opt-out 2018-07-05 07:54:28 +10:00
Shachaf Ben-Kiki
619184bdf6 Fix static_words in go.kak 2018-07-05 07:54:28 +10:00
Shachaf Ben-Kiki
1a2eecd037 Fix clang.kak and part of lint.kak
* Make clang.kak compatible with POSIX `[`.
* Make lint.kak dump range/line-specs correctly. It still doesn't read them
  correctly -- that'll be easier after the upcoming $kak_ changes for lists.
2018-07-05 07:54:28 +10:00
Maxime Coste
9ea6b88c1f Fix remaining kak scripts to use the new highlighter syntax 2018-07-05 07:54:28 +10:00
Maxime Coste
43223fba8c Fix various scripts highlighter commands 2018-07-05 07:54:28 +10:00
Maxime Coste
96c9718144 Parse unknown switches as positional for region highlighters 2018-07-05 07:54:28 +10:00
Maxime Coste
f61bcef469 Fix tests and required scripts to get back to green make test 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
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
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
a77710e098 ctags.kak: remove -no-hooks from execute-keys 2018-07-05 07:54:28 +10:00