Commit Graph

10124 Commits

Author SHA1 Message Date
Maxime Coste
b34bd239fa Merge remote-tracking branch 'alexherbo2/fix-edit-readonly' 2021-04-18 16:29:44 +10:00
Maxime Coste
6f56f02924 Restore previous line-compose test 2021-04-18 16:27:15 +10:00
Ben Judd
db3203fe59 mallinfo is deprecated in favor of mallinfo2 2021-04-17 13:49:21 -07:00
Ben Judd
161ca6d4d1 hash unit tests. 2021-04-17 13:19:35 -07:00
Ben Judd
88e6fd64ad Ben Judd 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.
2021-04-17 13:19:02 -07:00
Johannes Altmanninger
0a9c90fecf rc: use a separate *-insert hook to auto-insert comments
This should cover all filetypes that already auto-insert comments,
except for rust.kak, which is left for a follow-up.

Most of these are straightforward, some explanation for special cases:

rc/filetype/zig.kak rc/filetype/cue.kak

  These indent hooks used their own logic to indent after "{" only if
  no comment was inserted. Replace this logic by checking if a comment
  was inserted. This works because these "*-insert" hooks are run
  before their respective "*-indent" hooks.
 
rc/filetype/php.kak

  This also has some logic to insert "*" after "/*" lines. Basic
  usage seems to work still. In future this should borrow from the
  c-family one, which works a bit better.
2021-04-17 20:56:23 +02:00
Johannes Altmanninger
0264c84742 rc: when auto-inserting comments, include trailing spaces from previous line
We already do this in most places.
2021-04-17 20:56:23 +02:00
Johannes Altmanninger
eb3beff959 rc: make insertion hooks more consistent 2021-04-17 20:56:23 +02:00
Johannes Altmanninger
3ab2b98ec3 rc: remove spurious tabs
This makes it easier to be consistent.

Also replace "<<-EOF" by "<<EOF", since the former only does trims
tabs, not spaces.
2021-04-17 20:56:23 +02:00
Johannes Altmanninger
787ff5d002 rc sass: highlight and copy full comments, and support CSS comments 2021-04-17 20:56:23 +02:00
Johannes Altmanninger
9fadda0df4 rc nim: follow our convention 2021-04-17 20:56:23 +02:00
Johannes Altmanninger
997059fed1 rc javascript: fix line comment prefix 2021-04-17 20:56:23 +02:00
Taupiqueur
aa6ec5987c Fix edit -readonly command not setting readonly option 2021-04-14 02:36:25 +02:00
Tw
41833d7b7d fix line completion with prefix
There's a bug in current line completion, fix it.

Signed-off-by: Tw <tw19881113@gmail.com>
2021-04-11 11:54:48 +08:00
Maxime Coste
5696ed02e4 Fix invalid insertion of ; after } closing some functions
Function taking a parameter with a struct tag on the last line
before the opening { were wrongly treated as structs. Add some
additional regex logic to try to catch those cases.

Fixes #4136
2021-04-08 20:14:02 +10:00
Maxime Coste
abf68320fa Merge remote-tracking branch 'c7skasku/d-nested-block-comments' 2021-04-07 20:08:21 +10:00
Maxime Coste
2f31fc7744 Merge remote-tracking branch 'SeerLite/markdown-fixes' 2021-04-07 19:49:33 +10:00
Cormac Stephenson
710f121a54 d.kak: highlight nested block comments recursively
https://dlang.org/spec/lex.html#comment
2021-04-06 13:45:04 +01:00
Cormac Stephenson
1e13bfe334 c7s 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.
2021-04-06 13:45:04 +01:00
nojhan
2d263d3bd7 Johann Dreo 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.
2021-04-05 20:22:30 +02:00
nojhan
daa63ba879 [feat] add ui_options: padding_char & padding_fill
In some cases, it may be difficult to easily spot the area out of the buffer
(bad color scheme, small font, superimposed windows).

This patch adds two ncurses ui_options to bypass this problem:
- `ncurses_padding_char`, to configure the padding character,
- `ncurses_padding_fill`, to indicate whether to fill the padding line
  (or to display a single character).

The default config is the legacy one (a single "~").
2021-04-05 20:21:48 +02:00
SeerLite
3397737b16 rc markdown: Fix code fence regex
The invalid regex `)\b` currently matches anything, so this didn't cause
any errors.
It is still invalid though, so I fixed it by moving the `\b` to the end
of the non-raw_attribute language name (like the original regex). The
raw_attribute one shouldn't need this because the `}` marks the end of
the language name anyway.

Fixes #4025
2021-04-01 22:53:44 -03:00
SeerLite
e84dd80244 rc markdown: Fix trailing whitespace removal
Modified the test cases accordingly too
2021-04-01 22:27:30 -03:00
SeerLite
5c03e2bd54 rc markdown: Add -insert hook 2021-04-01 22:22:08 -03:00
nojhan
be20a88f8e Johann Dreo 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.
2021-04-01 11:33:48 +02:00
Carson Riker
b98ec3836b Stripped directory prefix from c-family autogenerated header guards 2021-03-31 17:33:04 -04:00
nojhan
ba344be51f fix show-whitespace: add missing NNBSP character
- Add the Narrow No-Break SPace (0x202F, NNBSP) to the list of handled
  spaces in the show-whitespace highlighter.
- Do not add an aditional option, just handle it like NBSP, with the same highlight character.
2021-03-31 15:28:23 +02:00
Maxime Coste
212242cc60 Slight cleanup of the c-family highlighters
* Extract raw strings to the C++ specific section
* Merge different documetnation comment formats in single regions
2021-03-31 21:24:45 +11:00
Maxime Coste
4be6df9d02 Parse more data at each fifo buffer read 2021-03-31 17:19:20 +11:00
Maxime Coste
da9a196fa0 Profile individual command runtime
Different approach than the one suggested by eraserhd

Closes $4095
2021-03-31 17:17:22 +11:00
Maxime Coste
d1e19727ff Tweak completion quoting behaviour once again
Quote by wrapping in quotes if we are replacing the whole token,
using backspaces if the completion only adds to it.

This ensure that the inserted completion will be correctly parsed
once validated.

Fixes #4121
2021-03-31 17:15:31 +11:00
Tim Allen
3aaf32f48f src/ncurses_ui: Teach Kakoune about all the numeric keypad keys.
Kakoune now knows about all the keypad keys listed in:

https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-PC-Style-Function-Keys
https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-VT220-Style-Function-Keys

The VT220-style encodings are used to for modified numeric keys when NumLock is
off. For example, consider the 8/Up key:

| Modifiers       | Sequence    | Notes             |
|-----------------|-------------|-------------------|
| Unmodified      | CSI A       | Ordinary up arrow |
| Shift           | SS3 2 x     | Shift-8           |
| NumLock         | 8           | Ordinary 8        |
| Shift + NumLock | CSI 1 ; 2 A | Shift-Up          |

Note that even though the terminal distinguishes between keypad and regular keys,
Kakoune maps keypad keys onto regular keys - keypad Enter is still <ret>, it
just supports more modifiers than the regular Enter key.
2021-03-26 15:43:42 +11:00
Tim Allen
f7c1702965 src/ncurses_ui: move the parse_mask() helper outside parse_csi().
It's useful for parsing modifier masks in all kinds of sequences, not just CSI
sequences. Also, since the modifier mask always has "1" as "no modifiers",
do the subtraction inside parse_mask() instead of when calling it.
2021-03-26 15:17:41 +11:00
SolitudeSF
fe66b8a390
rc nim: update suffix spec 2021-03-24 17:11:26 +02:00
Maxime Coste
c507863a00 Merge remote-tracking branch 'Eluminae/wayland' 2021-03-23 21:50:27 +11:00
Maxime Coste
d8fbe3105d Merge branch 'lua-auto-indent-improvement' of http://github.com/cipharius/kakoune 2021-03-23 19:57:46 +11:00
Maxime Coste
c123c7ef06 Merge remote-tracking branch 'hristost/hristost/line-number-active-separator' 2021-03-23 19:55:03 +11:00
cipharius
78a0b5e4c7 Improves Lua auto indent and end insertion
Current solution makes it difficult to use common Lua practices of having one-liner if statements and using anonymous functions.
New solution prevents auto-indentation and end insertion, if the previous line contains an "end" keyword.
It does not attempt to match each structure with corresponding end, since using multiple end keywords in single line is a very rare occurance in Lua.
2021-03-23 10:36:05 +02:00
hss
49f5917125 Rename separator-cursor to cursor-separator 2021-03-22 19:38:33 -04:00
Maxime Coste
d904a64d1e Merge remote-tracking branch 'Ordoviz/markdown-code' 2021-03-22 19:50:33 +11:00
Maxime Coste
59ab4af57d Merge remote-tracking branch 'hristost/hristost/line-number-active-separator' 2021-03-22 19:48:55 +11:00
hss
3e539c963e Don't use optionals for storing active separator string 2021-03-21 19:52:19 -04:00
Reed Wade
feab20260a
Permit usage on wayland environments.
Some wayland wm will not setup a DISPLAY environment variable. Kakoune
should allow x11 windowing toolkit for those wm also.
2021-03-21 13:41:40 +01:00
Stacy Harper
b8cad23616
Stacy Harper 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.
2021-03-21 13:40:33 +01:00
Lennard Hofmann
8d24041c1a rc markdown: Fix HTML highlighting in inline code
Because the HTML highlighter was higher up in the hierarchy than the code
highlighter, it took precedence. I fixed it by making it an inline region.
Using my new knowledge of "inline" I was able to remove one line of code.

Fixes #4091
2021-03-21 09:52:00 +01:00
hss
07e2b03c11 Only use separator-cursor for the first line number in a wrapped line 2021-03-20 21:53:31 -04:00
hss
73ecd3356f Compare column_length of line-number separators 2021-03-20 21:33:53 -04:00
Maxime Coste
739ed7ef67 Merge remote-tracking branch 'SeerLite/first-line-specials' 2021-03-21 11:01:31 +11:00
Maxime Coste
99dca978e3 Merge remote-tracking branch 'kconner/doc/edits' 2021-03-21 11:00:30 +11:00
hss
8df2bb8bd5 Use optionals more wisely in line-numbers 2021-03-20 02:48:33 -04:00