Commit Graph

8243 Commits

Author SHA1 Message Date
Maxime Coste
df4f71aaed Merge remote-tracking branch 'lenormf/fix-write-switches' 2020-02-15 18:34:18 +11:00
Maxime Coste
940b1b6175 Fix invalid memory access when getting the main entry of empty registers
Fixes #3370
2020-02-15 15:42:08 +11:00
Tim Allen
9277121695 rc lint: Change flag symbols for lint errors and warnings.
As suggested in code review.
2020-02-14 17:27:36 +11:00
Guest0x0
ab091bcf69 improve syntax highlighting 2020-02-14 07:33:47 +08:00
Guest0x0
ddb5d47584 Guest0x0 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-02-14 07:26:15 +08:00
Tim Allen
59e273c316 rc lint: Teach lint-{next,previous}-message to wrap around the buffer.
This matches the behaviour of make-{next,previous}-error.
2020-02-13 20:27:28 +11:00
Tim Allen
48bd7387bb rc lint: When parsing lint messages, use "remove shortest prefix" pattern.
There might legitimately be "|" characters in the message, so
we want to stop at the first one, the one that delimits the message location
from the message text.
2020-02-13 20:27:24 +11:00
Tim Allen
cad0572ca5 rc lint: Re-add missing kakquote functions. 2020-02-13 20:27:19 +11:00
Tim Allen
c1e9f46301 rc lint: Don't start a comment with "shellcheck".
That confuses shellcheck into expecting a warning pragma.
2020-02-13 20:27:12 +11:00
Frank LENORMAND
744336ef2b src: Only remove objects and dependencies for the current target 2020-02-09 19:12:40 +01:00
Frank LENORMAND
e06d61a3e0 src: Allow :write-all to use -atomic, fix usage
It seems that when -atomic was implemented for `:write`, the usage
strings were not updated to reflect that a new flag was available.

The `write-all` command didn't benefit from the implementation of
the new flag despite also writing files - this commit fixes that.
2020-02-09 17:07:47 +01:00
Frank LENORMAND
c0cb5db6a4 src: Let :set-register complete register names
This commit allows the `set-register` command to suggest candidates
named after punctuated registers, similarly to %reg{…} expansions.
2020-02-09 15:31:08 +01:00
Tim Allen
09f067d585 rc lint: More code-review comments.
Don't ask Kakoune to quote values we know can never contain shell-sensitive
characters, and flatten the kakquote() function to a single line for ease
of copy/pasting.
2020-02-09 14:01:35 +11:00
Tim Allen
673d081823 rc lint: Address code-review comments. 2020-02-09 13:23:58 +11:00
Alex Leferry 2
796eb20730 Fix typo 2020-02-07 16:57:09 +01:00
Frank LENORMAND
7790e31eb8 src: Don't show startup information when opening a file
Follow-up to #3317
2020-02-07 12:27:54 +01:00
Tim Allen
51fcea7ce0 rc lint: Add a lint-selections command to lint part of a buffer.
Fixes #2302, #3336.

Addresses parts of #3155.

Changes include:

- New `lint-selections` command that only lints the current selections,
  and allows a custom lint command.
- New `lint-buffer` command that always lints the whole buffer with
  the linter specified in the lintcmd option.
- `lint` alias for `lint-buffer`, for backwards compatibility.
- Errors and warnings are now shown in the Error and Information faces,
  not hard-coded red and yellow.
- Error and warning flags now use "!" and "?" symbols respectively,
  instead of a unicode block, so they can still be distinguished
  in a monochrome colour-scheme or by colour-blind users.
- An error flag on a given line always takes precedence over a warning.
- All messages for the same line are collected into a multi-line message.
- We no longer escape tildes in messages, since that change was added
  in commit ae339dc (2016) when we started using `%~~` to quote messages.
  We stopped using `%~~` in commit 1a2eecd (2018).
- Anything the linter writes to stderr is logged to the *debug* buffer,
  not lost.
- If the linter writes to stderr, an error is shown to the user instead
  of the usual error/warning count.
- The `lint_errors` hidden option is replaced by `lint_messages`,
  because it contains warnings as well as errors.
- `lint-next-error` renamed to `lint-next-message`,
  and `lint-previous-error` renamed to `lint-previous-message`
  for the same reason.
    - New `lint-next-error` and `lint-previous-error` aliases,
      for backwards compatibility.
- `lint-next-message` and `lint-previous-message` show the message
  they jump to.
- Where `lint_errors` was a range-specs option, `lint_messages` is a
  line-specs option to keep things simpler. This means lint-next-message
  and lint-previous-message no longer jump to a specific column.
2020-02-07 19:22:47 +11:00
Maxime Coste
e9cf0f23f2 Fix regex start desc computation for case insensitive ranges
Fixes #3345
2020-02-07 07:37:29 +11:00
Maxime Coste
8eb84c6f5d Merge branch 'master' of http://github.com/velrest/kakoune 2020-02-07 07:03:33 +11:00
Maxime Coste
fbd75d91ec Merge remote-tracking branch 'maximbaz/notes-formatting' 2020-02-07 07:02:32 +11:00
Maxime Coste
8b633aa79a Merge remote-tracking branch 'jo-he/master' 2020-02-07 07:01:17 +11:00
Maxime Coste
a105111593 Merge remote-tracking branch 'lenormf/startup_info-no_kakrc' 2020-02-07 07:00:25 +11:00
Dan Rosén
8dd2373db1 Remove duplicated scopes highlight in kakrc.kak 2020-02-06 17:33:16 +01:00
Frank LENORMAND
1ebab6c269 src: Show the startup information in no-load mode
This commit allows the changelog to be shown at startup even when
the editor was run with the -n flag.
2020-02-05 11:39:23 +01:00
Maxime Coste
bb28477c48 Merge remote-tracking branch 'chambln/master' 2020-02-05 20:54:49 +11:00
Maxime Coste
e348219fee Merge remote-tracking branch 'omasanori/startup_info_version' 2020-02-05 20:51:17 +11:00
Maxime Coste
fef9f69a70 Merge remote-tracking branch 'jkonecny/master-backport-spec' 2020-02-05 20:48:20 +11:00
Maxime Coste
1a2bf7b105 Merge branch 'patch-2' of http://github.com/Ordoviz/kakoune 2020-02-05 20:47:25 +11:00
Maxime Coste
9cc22f2596 Merge remote-tracking branch 'lenormf/fix-3330' 2020-02-05 20:42:33 +11:00
Maxime Coste
a3749d6c20 Merge remote-tracking branch 'lenormf/patch-3' 2020-02-05 20:41:40 +11:00
Maxime Coste
14e7b641dc Merge remote-tracking branch 'lenormf/fix-describe-sessions' 2020-02-05 20:40:36 +11:00
Maxime Coste
7d4ae422d2 Merge remote-tracking branch 'lenormf/docstring-pretty' 2020-02-05 20:40:10 +11:00
Maxime Coste
22ebb25b1b Merge remote-tracking branch 'geppettodivacin/selections_with_at_buffer' 2020-02-05 20:38:48 +11:00
Frank LENORMAND
5791e8bb04 contrib describe_sessions: Look for sessions in XDG_RUNTIME_DIR
The sessions are stored in `$XDG_RUNTIME_DIR` when that variable
is defined.
2020-02-04 13:19:36 +01:00
geppettodivacin
bf286fc8a8 Eric Dilmore Copyright Waver
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-02-03 21:02:31 -06:00
Lennard Hofmann
8dbc86c54a [sh] Do not highlight keywords if preceded/succeeded by a hyphen 2020-02-03 21:34:36 +01:00
Frank LENORMAND
275abb227e rc: Make docstrings more readable
This cosmetics commit makes use of the auto-deindentation syntax,
available to docstrings.
2020-02-03 20:53:28 +01:00
Lennard Hofmann
75bb796b2b
[sh] Allow more characters in aliases and function names
Which characters are allowed?
- Aliases: https://www.gnu.org/software/bash/manual/html_node/Aliases.html
- Functions: https://unix.stackexchange.com/questions/245331/shell-valid-function-name-characters

For aliases I chose [\w-.] instead of blacklisting many forbidden characters. For functions I chose \S.
2020-02-03 18:59:46 +00:00
Lennard Hofmann
c6eb9bd8f0
Fix #2832 2020-02-03 18:33:27 +00:00
geppettodivacin
39a2ab84fa Use ReverseView to perform fewer allocations
The first attempt at a bug fix for @ symbols in selection buffer names
worked, but it was very inefficient. In particular, it allocated three
different vectors, and we really only needed the correct elements.
Manipulating iterators to give us the right slices of the existing
vector is far more efficient.

By reversing the original content and taking the last two, we're able to
get the number of selections and main selection without too much hassle.
The buffer name is everything from the start of the content to the
selection count. This gets us through with only one vector allocation.

Credit to @mawww for the optimization idea and for fixing my types.
2020-02-02 22:12:18 -06:00
Gregory Chamberlain
548c6b0b7e rc git: Use git-log filetype for ‘:git show’
The git-log filetype is more appropriate for ‘git show’ output
because it highlights both diffs and commit data.
2020-02-02 00:26:46 +00:00
Frank LENORMAND
90ba4d0903 rc spell: Handle errors returned on the first line
The first line returned by `aspell` isn't always an identification
string, it can also be an error.

This commit prevents the first line from being ignored in any case,
and allows errors to be reported consistently.

Related to #3330
2020-02-01 16:04:58 +01:00
Frank LENORMAND
0c4c744362 rc: Highlight embedded documentation
This commit adds a `documentation` face to the builtin themes, used
to highlight common documentation syntaxes:

	/**
	 * JavaDoc
	 */

	/*!
	 * QtDoc
	 */

	/// Inline documentation

	## Inline documentation

The face is only an alias to the `comment` one for now.

Closes #1944
2020-01-29 20:03:21 +01:00
Gregory Chamberlain
f4e8585981 rc git: Expand highlighting of git status
Adds support for highlighting git-status(1) output in short format
(--short) and with branch name (--branch), including file renames and
commits ahead/behind information.
2020-01-29 17:19:23 +00:00
Gregory Chamberlain
eb1b629829 rc git: Improve git-log highlighters
Adds support for highlighting git-log(1) output with the ‘--graph’
and ‘--pretty=oneline’ options.
2020-01-29 12:48:08 +00:00
Gregory Chamberlain
766b050d84 Gregory Chamberlain 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-01-29 11:58:18 +00:00
Frank LENORMAND
5ea2f26efa
rc ctags: Escape backslash in {\} faces
Using `{\}` in an Awk script results in the following error being printed:

```
awk: cmd. line:18: warning: escape sequence `\}' treated as plain `}'
```
2020-01-28 10:05:10 +00:00
Maxime Coste
9842e24fc4 Merge remote-tracking branch 'alexherbo2/crystal' 2020-01-27 16:27:06 +11:00
geppettodivacin
5596b4b2b9 Add support for @ symbols in selection buffer
The selection descriptions use the format
`<buffer>@<timestamp>@<main_index>`. This fails when file paths have `@`
symbols in them: the parser splits on `@` symbols and finds more values
than it expects.

We here modify the behavior to require *at least* two @ symbols, using
the last two for `<timestamp>` and `<main_index>` and leaving the
remaining text for the <buffer>. This should work for any number of `@`
symbols, since `<timestamp>` and `<main_index>` are numbers and should
never contain `@` symbols.
2020-01-26 16:03:03 -06:00
Alex Leferry 2
2f05aebfff Use POSIX -E of sed for extended regular expressions 2020-01-21 14:45:33 +01:00