Commit Graph

310 Commits

Author SHA1 Message Date
Maxime Coste
b27d4afa8d Regex: Only allow SyntaxCharacter and - to be escaped in a character class
Letting any character to be escaped is error prone as it looks like
\l could mean [:lower:] (as it used to with boost) when it only means
literal l.

Fix the haskell.kak file as well.

Fixes #1945
2018-03-20 04:57:47 +11:00
Dan Rosén
6fdb9db5d9 Improve JS/TS highlighter slightly 2018-03-19 11:31:38 +01:00
Maxime Coste
8479b33861 Merge remote-tracking branch 'Screwtapello/more-markdown-highlighting-improvements' 2018-03-15 23:23:44 +11:00
Tim Allen
0a4a9f1c3d Markdown inline formatting should not span paragraphs.
Previously, two underscore characters in a document would mark the entire
space between them as italic, no matter how far apart. Now we only accept a
single consecutive newline within an inline-formatted span, so hard-wrapped
documents will still format nicely but stray characters won't mess up your
entire document.

Note that the highlighter for backtick-enclosed spans was modified,
even though it's redundant with the code-block highlighting introduced
in 5bc62c694.
2018-03-15 18:26:20 +11:00
Tim Allen
78f1e1ca98 Highlight footnote-style hyperlinks.
As well as the traditional `[text](url)` syntax, Markdown allows the text to
be followed by a tag in square brackets. If the text is followed by nothing
at all, then the tag for that link is the text itself. The actual URL
is supplied later in the document, like a footnote at the bottom of the page:

	Some text with [a link][tag] and [another link].

	[tag]: http://www.example.com/link1
	[another link]: http://www.example.com/link2

This adds the "link" face to the URL in such footnote lines.
2018-03-15 18:16:47 +11:00
Alex Leferry 2
1ede2b89bb Add application media-type to file-type detection 2018-03-14 17:04:03 +01:00
Delapouite
e46251db69 Add ctagscmd option
Fixes #1611
2018-03-11 15:13:19 +01:00
Maxime Coste
65258934d3 lua.kak: Rework 'end' auto insertion logic
Fixes #1525
2018-03-04 10:36:32 +11:00
Maxime Coste
4d11bb20c3 Always collapse jumps in exec/eval, remove -collapse-jumps switch
There does not seem to be any reasonable use cases of not collapsing
jumps when the input is not comming from the user. Always collapse
them.

It could make sense to move jump collapsing out of context_wrap as
in general any action not comming directly from the user should
collapse them, at the moment a comment or mapping will not collapse
jumps, which is unfortunate.
2018-02-24 19:02:15 +11:00
Maxime Coste
4f75358ce3 lua.kak: Fix string highlighting with -match-capture regions
With the introduction of -match-capture for the lua region highlighter,
the string closing regex had spurious captures that were not going to
match.

Fixes #1850
2018-02-18 16:21:05 +11:00
Maxime Coste
f8861734cf rc/: Replace simple uses of sed with tr 2018-02-18 15:00:30 +11:00
Maxime Coste
82c8a6e9dd Merge remote-tracking branch 'alexherbo2/rc-ruby' 2018-02-18 11:36:42 +11:00
Alex Leferry 2
04b57539e8 Recognize .gemspec files as Ruby 2018-02-18 00:49:09 +01:00
Frank LENORMAND
f25e8640b8 base javascript: Tweak variable highlighting
This commit avoids false positives when highlighting literals such as
`$window`, which is a regular variable but still highlighted as a
special value.

Special highlighting of variables that start with a dollar sign `$`
was also removed, as not all variables start with a dollar sign,
and we don't have a reliable way yet to detect variables.
2018-02-17 11:53:56 +03:00
Maxime Coste
f5e39972eb Merge remote-tracking branch 'jacobdufault/lua-better-strings' 2018-02-15 23:35:01 +11:00
Jacob Dufault
42f78dfac3 Highlight nested == comments/strings in lua.
For example,

  [==[ string ]==]
2018-02-11 22:23:49 -08:00
Maxime Coste
d95530b171 lint.kak: Update lint info when the linting data changed
Fixes #1836
2018-02-11 22:03:24 +11:00
Maxime Coste
c939c30135 ocaml.kak: remove invalid unset-option static_words hook
unsetting static_words whenever any buffer filetype is set to non ocaml
is wrong, it breaks static_words for every filetype whose filetype hook
run before the ocaml ones.
2018-02-11 21:51:32 +11:00
Maxime Coste
01259bf22c Merge remote-tracking branch 'MilanVasko/lua-comment-fix' 2018-02-11 19:10:24 +11:00
Milan Vaško
128e0f53ff Fixed Lua block comment highlighting
Block comments in Lua were broken, apparently due to the opening
sequence being interpreted as a line comment. Changing the order in the
highlighter seems to fix this issue.
2018-02-10 13:40:48 +01:00
Alex Leferry 2
39c0c03351 Highlight Ruby control access keywords 2018-02-08 13:34:40 +01:00
Dan Rosén
3ac328c1f7 Highlight JSX
Additionally merges the javascript and typescript highlighters.

Fixes #1700
2018-02-04 08:31:03 +01:00
Maxime Coste
cfa497362c Merge remote-tracking branch 'alexherbo2/rc-javascript' 2018-01-31 09:39:40 +11:00
Alex Leferry 2
6fe8b9eb70 Highlight JavaScript static keywords 2018-01-30 19:19:12 +01:00
Jimmy Thrasher
7bf235b0ee Add heredoc support for ruby.kak 2018-01-26 07:56:36 -05:00
Maxime Coste
43f50c0852 Convert bundled scripts to ModeChange hook 2018-01-21 10:35:05 +11:00
Dan Rosén
969f416027 Generate the markdown highlighter code 2017-12-13 07:27:45 +01:00
Maxime Coste
cb2ff7eb5f Merge remote-tracking branch 'danr/fence' 2017-12-12 17:57:26 +11:00
Dan Rosén
5bc62c6942 Fix highlight references in Markdown fenced code blocks
Fixes #1735

We need \K to not interfer with languages own interpretation of ` like multiline strings in javascript

We need \b in e.g. java\b otherwise it blocks javascript

I couldn't get the bare ``` to not block the other highlighters when introducing \K any other way than negative lookahead of all possible highlighers
2017-12-10 23:00:26 +01:00
Francesco Mazzoli
fa61d7aac0 fix regression in highlighting of qualified Haskell variables
Commit 870d2d22d7 introduced a regression
in the highlighting of qualified Haskell variables, such as `Foo.bar`.
After that commit `Fo` was highlighted as a constructor (note, not
`Foo`, just `Fo` without the trailing `o`). This restores the original
behavior.
2017-12-10 21:04:03 +01:00
Maxime Coste
19556d5fbe Merge remote-tracking branch 'Geemili/fix-inline-markdown' 2017-12-10 10:18:51 +11:00
Maxime Coste
9071e2a6bf Merge remote-tracking branch 'Geemili/feature-restructuredtext' 2017-12-10 10:18:23 +11:00
LeRoyce Pearson
4f069edca6 Add reStructuredText support script
- headers
- bold emphasis
- regular emphasis
- code highlighting
- inline literals
2017-12-09 14:15:00 -06:00
LeRoyce Pearson
3acf3aa5a2 Fix overlapping inline markup
Make it some some text like "**bold**" wil not be marked as italic and bold.
2017-12-08 16:04:43 -06:00
Nicholas Ochiel
908e0c1f8c * Crude implementation of focus: use the current region to switch to the desired window.
- The proper way to do this would be to switch focus to the target client's region but GNU Screen offers no obvious way to do that.

- Remove screen region after client is closed.

- Assumed: Kak server runs in screen.
2017-12-03 20:05:02 +03:00
valerdi
4d4c6aa82b
added AbstractString to keywords 2017-11-30 15:44:12 +01:00
Maxime Coste
386f595a49 screen.kak: use define-command full name instead of def alias 2017-11-16 12:56:42 +08:00
Nicholas Ochiel
133fcb0ce4 code review: typos. 2017-11-15 17:42:37 +03:00
Nicholas Ochiel
d9a574acd5 Integration with GNU screen; based on tmux.kak
- Hack: kak sets `/proc/self/fd/0 -> /dev/null`. Get the client process tty because Screen needs to know the controlling terminal. Else Screen will use the last known tty and will open new windows on a different terminal if one is connected.
2017-11-15 06:10:26 +03:00
Delapouite
29e2a73638 Fix lint.kak evaluate-commands → eval 2017-11-06 10:51:55 +01:00
Tim Allen
f9351d65eb rust.kak: Support Rust's documentation comments.
As well as ordinary `//` line-comments, Rust regards `///` comments
as documentation applying to the following item, and `//!` comments as
documentation applying to the enclosing item, so we should copy those
to new lines, too.
2017-11-04 21:54:48 +11:00
Frank LENORMAND
9127ed0d55 src rc: Rename exec/eval into execute-keys/evaluate-commands 2017-11-03 11:09:45 +03:00
Frank LENORMAND
c9b280b712 rc: Don't use command aliases to highlight keywords properly 2017-11-03 10:34:41 +03:00
Maxime Coste
5e6077acc2 html.kak: Change </...> align hook to only run after inserting '>'
Improve the hook to support nesting of tags as well.
2017-10-30 17:04:54 +11:00
Maxime Coste
d49555fc75 Move highlighters into Scopes
That means we can now have highlighters active at global, buffer, and
window scope. The add-highlighter and remove-highlighter syntax changed
to take the parent path (scope/group/...) as a mandatory argument,
superseeding the previous -group switch.
2017-10-28 13:43:04 +08:00
Maxime Coste
c95bd83ea1 haskell.kak: remove complex lookarounds
Highlighting is going to be slightly less correct, but we get rid
of the last incompatible regex in rc/
2017-10-25 10:29:27 +08:00
Maxime Coste
591ddb86e3 markdown.kak: Remove fenced block support from
Its not in the spec, except for code blocks that we handle differently
anyway. More importantly it currently relies on backreference.
2017-10-25 10:29:11 +08:00
Maxime Coste
870d2d22d7 haskell.kak: Remove some complex lookarounds 2017-10-25 10:28:59 +08:00
Maxime Coste
0fa59e5fd2 rc/: Tweak some regexes to be compatible with our impl limitations
The upcoming custom implementation does not support arbitrary lookarounds,
and other advanced regex features. Simplify the regexes to avoid those.
2017-10-25 10:27:39 +08:00
Maxime Coste
bf6e5daa08 Use stricter regex syntax
boost regex tolerates non-escaped special characters, and escaped
non-special characters. Standardize on stricter syntax, where
special characters must be escaped, and non-special characters must
not.
2017-10-25 10:27:39 +08:00
Maxime Coste
80d661e6a7 rc/: More consistent uses of regex syntax
Always use \A \z for subject start/end, always \b for word boundaries
2017-10-25 10:27:25 +08:00
helvetie
7edc1a57a3 ini.kak: add ';' as a valid comment character 2017-10-19 15:05:17 +02:00
exitium
a4ba9b339e Fix Lua comment delimiter insertion (see #1584) 2017-09-23 10:20:02 -04:00
Maxime Coste
a303cf5698 Merge remote-tracking branch 'lenormf/fix-perl' 2017-09-18 10:08:13 +09:00
Maxime Coste
9fea868e9e Merge remote-tracking branch 'Delapouite/css' 2017-09-18 10:02:43 +09:00
Frank LENORMAND
1b11412796 rc perl: Don't highlight regex, fix string escapes
Highlighting perl regex patterns with regular expressions (with
highlighters) caused several misses that made most of the file
unreadable. This commit makes `perl.kak` not try to highlight
those patterns in the code, and also addresses issues with string
highlighting.
2017-09-14 14:16:58 +03:00
Maxime Coste
661047795c Merge remote-tracking branch 'lenormf/mercurial-support' 2017-09-11 21:11:27 +08:00
Frank LENORMAND
90961b0990 rc: Add support for MySQL, SQL Server and MS Access
Closes #1540
2017-09-09 11:54:24 +03:00
Frank LENORMAND
3cb159f056 rc: Add support for Mercurial
The script only highlights comments in commit messages, but it's a basis
to improve upon if more features are needed in a later time.
2017-09-08 14:44:55 +03:00
Delapouite
2001a9a087 css.kak: add hl to more common CSS length units 2017-09-06 12:08:49 +02:00
Frank LENORMAND
4f8211ecea rc base html: Highlight attributes with no value 2017-08-29 14:17:28 +03:00
Maxime Coste
716816966f Merge remote-tracking branch 'lenormf/fix-html' 2017-08-26 16:16:07 +07:00
Frank LENORMAND
eb0786e001 rc base html: Highlight the DOCTYPE and tag attributes 2017-08-26 11:28:56 +03:00
Dan Rosén
ef1a1e6bd3 Improve Haskell highlighter
Import keywords are put in keyword face instead of meta face.
This leaves room for pragmas and macros to be in the meta face.

Operator keywords are put in keyword face too.

Finally, expression keywords are put in face attribute.
2017-08-22 16:29:27 +02:00
Tim Allen
e640e6d859 Consecutive markdown list bullets are not a valid list prefix.
Previously, if you opened a new line after an underlined heading (what
the CommonMark spec calls a "Setext heading") or inserted a newline into
a line that started with `**strong emphasis**` the Markdown autoindent
hook would assume the leading symbols were list bullets and paste them
at the beginning of the new line.

However, the CommonMark specification says that list bullets must be
followed by at least one horizontal whitespace character, so Setext
heading underlines and strong emphasis are not valid list bullets and
should not be matched by the autoindent pattern.

This commit changes the regex that selects the pastable prefix of the
previous line so that it must match either:

  - One or more `>` characters with optional whitespace between them
    (a blockquote prefix), optionally followed by a list bullet; or
  - An optional blockquote prefix and a list bullet

Since we don't strictly need either the blockquote prefix nor the list
bullet, we could concievably just make both optional... but for lines
without either, the regex would find a zero-length match, and for the
purposes of copy/paste Kakoune treats that as a one-character match.
Therefore, the regex is written to fail if neither pattern is found.
2017-08-01 20:36:40 +10:00
Maxime Coste
337a38552b Fix sakura termcmd setup
Sakura `-e` is xterm compatible, so would require a `sh -c`, but it
also provides `-x` which takes a single argument, switch to that.
2017-07-25 10:26:52 +02:00
Maxime Coste
d1de9912c0 Merge remote-tracking branch 'lenormf/fix-git' into c++14 2017-07-19 17:20:18 +02:00
Maxime Coste
9c4448ac41 Remove echo -color support, superseeded by echo -markup
`echo -color Error "blah"` is the same as `echo -markup '{Error}blah'`
Fixes #1512
2017-07-19 17:18:52 +02:00
Frank LENORMAND
8687222518 rc git: Don't force a highlighting format on commits 2017-07-17 08:36:47 +03:00
Maxime Coste
52c8dc9d09 Highliight git MERGE_MSG files as commit messages 2017-07-08 13:39:48 +09:00
Maxime Coste
f41d78083a Use the extra_word_chars option in word based normal commands
the completion_extra_word_chars is now gone, superseeded by
extra_word_chars that gets used both for completion and for normal mode.

Fixes #1304
2017-06-26 15:28:41 +01:00
Maxime Coste
45ac100c21 Merge remote-tracking branch 'lenormf/fix-ctags-command-names' 2017-06-23 10:22:15 +01:00
Maxime Coste
d9edd3f013 Merge remote-tracking branch 'dianne/string-highlighter-fix' 2017-06-21 16:56:06 +01:00
Dianne Wagner
57cb2d0682 apply '"' highlighting fix to haskell as well 2017-06-18 19:18:14 -07:00
Dianne Wagner
3ae0d86b27 rust highlighter: '"' is not the start of a string
this uses the string opening regex from the c-family highlighter to prevent
highlighting the rest of the file as a string on encountering the character
literal '"'
2017-06-18 18:39:45 -07:00
Alex Leferry 2
585778057f Update command names 2017-06-16 13:53:03 +02:00
Frank LENORMAND
cb9a2e562b rc: Fix calls to mktemp
The GNU and BSD implementations differ on several points, this commit
hopefully finds a middle ground.
2017-06-16 11:51:46 +03:00
Frank LENORMAND
9a10d79ae8 rc ctags: Make commands follow the naming convention 2017-06-15 15:40:15 +03:00
Maxime Coste
398b2b115c Merge remote-tracking branch 'lenormf/fix-tmpdir-modules' 2017-06-12 05:06:14 +01:00
Frank LENORMAND
813d09a101 rc: Fix calls to mktemp
Allow `mktemp` to make use of the `TMPDIR` environment variable when
calling it with a template.

Don't use the deprecated `-t` flag.
2017-06-09 14:30:54 +03:00
Alex Leferry 2
105b35192f Add Alacritty 2017-06-08 19:02:44 +02:00
Delapouite
2acdafa325 Add SVG detection as xml in file.kak 2017-06-02 15:43:51 +02:00
Maxime Coste
f2f04d55fc Make the lint_errors a range-specs option in lint.kak
lint_errors are now maintained up to date with buffer changes.
2017-05-25 19:54:08 +01:00
Maxime Coste
c4db46b58b Rename line-flags option type to line-specs
Generalize this option type, which is a timestamped list of
<line number>|<arbitrary string>. That way this type is not strongly
coupled with the flag-lines highlighter, and can be reused for other
use cases.
2017-05-24 15:41:43 +01:00
Maxime Coste
c6508ee101 Merge remote-tracking branch 'lenormf/doc-public-options' 2017-05-21 07:09:37 +01:00
Maxime Coste
55d1d1020d Merge remote-tracking branch 'lenormf/rc-misc-fixes' 2017-05-19 21:53:02 +01:00
Maxime Coste
803895d581 Merge remote-tracking branch 'danr/Highlight-object-keys-in-yaml' 2017-05-19 21:37:31 +01:00
Maxime Coste
be8692bcdb Merge remote-tracking branch 'danr/Fix-reference-to-kakrc-highlighter-for-markdown' 2017-05-19 21:34:45 +01:00
Maxime Coste
eec8239c78 Highlight 'copied' file action in git-commit buffers 2017-05-17 20:19:56 +01:00
Maxime Coste
dfaafcd49a Rename range-faces to range-specs
range-faces are now used to replace-range highlighters, where the string
part is not interpretted as a face but as a display line, so the name was
not relevant anymore.
2017-05-17 19:40:52 +01:00
Frank LENORMAND
56837eaece rc: Use POSIX command -v instead of which 2017-05-16 18:20:19 +03:00
Frank LENORMAND
b9cdccd53a rc: Document non-hidden options with -docstring 2017-05-16 14:35:43 +03:00
Dan Rosén
736720f31a Highlight object keys in yaml 2017-05-16 09:30:01 +02:00
Dan Rosén
80570a0dc7 Fix reference to kakrc highlighter for markdown 2017-05-15 21:58:57 +02:00
Frank LENORMAND
9a138af17f rc: Properly modify tmux's environment with env 2017-04-17 22:55:37 +03:00
Frank LENORMAND
b6d055a87b rc: Export $TMPDIR to new tmux processes
`tmux` will start new processes (e.g. when creating panes or windows)
with the same environment it was started with, which means that if the
$TMPDIR variable was overriden for the kakoune server from within
`tmux`, newly created panes/windows won't have access to the server
socket to sustain a session.

This commit fixes the issue by always exporting the $TMPDIR variable
from the parent `tmux` environment to the new processes.

Fixes #1319
2017-04-09 09:20:25 +03:00
Maxime Coste
fa7f29a120 spell.kak: preserve spelling language from :spell in :spell-replace 2017-03-28 08:32:21 +01:00
Maxime Coste
b9317ba38c Change lint.kak column display to put it at the end 2017-03-10 12:41:01 +00:00
Maxime Coste
e888dae787 Merge remote-tracking branch 'kurkale6ka/lint_cols' 2017-03-10 12:28:17 +00:00
Maxime Coste
a0b42323ed Add a -debug flag to :edit to set the buffer as debug data
As for the *debug* buffer, buffers with the debug flag wont get
used for cycling through buffer, or word completion.
2017-03-08 19:33:25 +00:00