Commit Graph

185 Commits

Author SHA1 Message Date
Maxime Coste
8aa35c0724 doc.kak: Use a github compatible anchor generation
Convert session names to lowercase and replace spaces with minus
to generate anchor names.
2017-11-08 20:15:46 +08:00
Maxime Coste
b8fdcff7b0 doc.kak: anchor/section completion support 2017-11-08 17:20:37 +08:00
Maxime Coste
b63f16e7a2 doc.kak: Support anchors and internal links
Underline links, support jumping to a specific anchor either in
the current page or another one, use those new features in some
pages.
2017-11-08 16:32:49 +08:00
Maxime Coste
d6b5240bdf doc.kak: Remove unused lines 2017-11-06 20:53:50 +08:00
Maxime Coste
73182de20c doc.kak: Support jumping on links using <ret> 2017-11-06 20:52:24 +08:00
Maxime Coste
19cda837ff doc.kak: Simplify completion script 2017-11-06 20:47:12 +08:00
Maxime Coste
9b216e0e79 Merge remote-tracking branch 'lenormf/fix-rc-aliases' 2017-11-03 19:32:30 +08: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
Kylie McClain
79f725a558 sh: support mksh 2017-11-02 23:23:54 -04:00
Maxime Coste
b3daf6b746 doc.kak: Support rendering _italic_ text as well 2017-11-02 17:42:16 +08:00
Maxime Coste
4fabba3d12 doc.kak: Render documentation internally instead of relying on man
doc.kak now behaves as a basic asciidoc renderer. Asciidoc is unfortunately
still a dependency to generate the manpage of the `kak` command.
2017-11-02 10:03:24 +08:00
Maxime Coste
90865b65cd asciidoc.kak: Highlight ^=+ syntax sections 2017-11-02 09:52:18 +08:00
Maxime Coste
424b2389cb kakrc.kak: Fix highlighting of key words at start of buffer 2017-11-02 01:28:37 +08:00
Maxime Coste
c8257a58a5 kakrc.kak: set '-' as an additional word char 2017-10-28 13:43:04 +08:00
Maxime Coste
d7671f0cdf kakrc.kak: Fix static word definition 2017-10-28 13:43:04 +08: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
d09924d24b asciidoc.kak: use a more tolerant block regex for
Get rid of the nasty backreference we were relying on.
2017-10-25 10:29:27 +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
Maxime Coste
214f321951 Merge remote-tracking branch 'danr/Fix-introduced-mistake-in-kakrc-highlighting' 2017-10-23 16:33:26 +08:00
Maxime Coste
6d65d8e778 kakrc.kak: refactor grammar handling 2017-10-23 10:56:45 +08:00
Dan Rosén
577d84217a Fix introduced mistake in kakrc highlighting 2017-10-22 01:23:12 +02:00
Maxime Coste
6740e3cc0c Add some more keywords to kakrc highlighting 2017-10-21 18:48:35 +08:00
Dan Rosén
5b0f070300 Improve kakrc highlighter 2017-10-21 10:08:50 +02:00
Frank LENORMAND
1cfee17a16 rc man/doc: Don't show groff warnings
Sometimes the implementation of `man` will display errors, e.g.

```
<standard input>:4808: warning [p 54, 13.2i]: can't break line
```

Those errors are harmless but are still reported on the debug buffer,
so we hide them by redirecting the standard error stream to /dev/null.
2017-09-30 08:23:10 +03:00
Frank LENORMAND
1e3c343773 rc doc: Use POSIX flag -name instead of -iname 2017-09-30 08:15:14 +03:00
Frank LENORMAND
18e64c5c7d rc doc: Implement the -i flag of sed in a POSIX manner 2017-09-29 22:16:31 +03:00
Frank LENORMAND
f26854694e rc doc: Remove window hooks automatically assigned
When using the `man` filetype to make use of the text highlighters
of the `man.kak` script, the documentation pages inherit from the
window resizing hooks that won't work on `doc` buffers.

Fixes #1591
2017-09-29 22:12:09 +03:00
Maxime Coste
902724e558 c-family: auto close unions with a semicolon as well 2017-09-18 09:41:26 +09:00
Maxime Coste
420c6aca23 Change documentation directory towards $kak_runtime/doc 2017-08-03 15:00:02 +07:00
Maxime Coste
4dac61c864 Fix grep-next/prev-match not jumping correctly to first/last match
When used just after grepping, grep-next-match ended up jumping to
the second match, as `0g` is the same as `g`.

The fix itself is pretty ugly, a better one might be to distinguish
the `0` count from no count given, so that `0g` could fail with
"no such line" or similar.
2017-07-29 03:02:11 +07:00
Maxime Coste
6ab98f8bf8 Fix grep-jump on eol 2017-07-29 03:02:11 +07: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
21847a5f85 rc man: Avoid undefined behavior on expr
Looking up the man page for `index` was failing on systems using
GNU/coreutils. The `:man` command matched whatever page it was given with
the `expr` utility. This tool behaves as expected when it follows strictly
the POSIX standard but the GNU implementation introduces additional commands
(including `index`), about which the standard states:

```
The use of string arguments length, substr, index, or match produces unspecified results.
```

As a result, parsing the man page number is now implemented with pure
shell expansions, to avoid triggering an undefined behavior when the topic
searched is one of the keywords above.
2017-07-17 21:24:41 +03:00
Frank LENORMAND
74babc36b1 rc formatter: Don't force selection restoration
The `|` primitive now correctly restores selections, we don't need to
forcibly restore the main one after formatting anymore.
2017-07-14 11:21:48 +03:00
Frank LENORMAND
50b635ce2d rc c-family: Add a hook to the insert group 2017-06-29 13:29:48 +03:00
Delapouite
a932b6b21e Add error message when using format command with no formatcmd specified 2017-06-26 22:10:04 +02: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
Frank LENORMAND
6376aa6206 rc formatter: Make sure the formatter returned successfully
The previous implementation used to replace the contents of the buffer with
whatever the `formatcmd` was returning, regardless of the exit code of the
command, which led to the buffer being wiped out on error.

This commit does the formatting in a temporary file, and only replaces the
current buffer with the contents of the -formatted- temporary file if the
`formatcmd` returned successfully.

Fixes #1357
2017-06-23 15:12:23 +03: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
Maxime Coste
e73cd78288 Fix corner case in C family indenting 2017-06-13 10:19:38 +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
Maxime Coste
81118552c8 Fix missing hook removal command in c-family.kak 2017-06-07 12:44:00 +01:00
Frank LENORMAND
8794687f36 Revert "doc: Fix the documentation of the alt_dirs option"
This reverts commit ef88b28392.
2017-06-04 11:24:10 +03:00
Frank LENORMAND
ef88b28392 doc: Fix the documentation of the alt_dirs option 2017-06-03 21:49:10 +03:00
Maxime Coste
d8a90ad5d3 Merge remote-tracking branch 'danr/Remove-ad-hoc-rules-in-kakrc-highlighter' 2017-06-03 15:16:49 +01:00
Maxime Coste
f3f6ac9e8a Merge remote-tracking branch 'danr/Improve-kakrc-highlighter-with-more-static-words' 2017-06-03 15:16:14 +01:00