Commit Graph

5329 Commits

Author SHA1 Message Date
Maxime Coste
b609adc84c Merge http://github.com/Jonta/kakoune 2021-10-09 15:44:43 +11:00
Maxime Coste
ddcfa0f0e5 Merge remote-tracking branch 'lenormf/fix-1840' 2021-10-09 15:43:43 +11:00
Jonta
e93ebbca78
Grammar 2021-10-07 04:59:03 +02:00
Jonta
123a264894
Merge pull request #1 from Jonta/Jonta-grammar-an-highlighter-1
Grammar
2021-10-07 04:57:53 +02:00
Jonta
4a34ae9c2d
Grammar 2021-10-07 04:57:29 +02:00
Jonta
caea620229
Grammar 2021-10-07 04:54:55 +02:00
Frank LENORMAND
0d87d70bd1 src: Remove spurious break 2021-10-06 08:44:47 +02:00
Frank LENORMAND
a5dd8a7935 src: Allow ga to skip removed buffers
This commit prevents `ga` from returning a “no last buffer” error
when the previously displayed buffer was removed.

Since the jumps list keeps track of the order in which buffers were
displayed already, handling arbitrary `delete-buffer`s as well,
cycle through it to implement `ga` instead of storing a pointer.

Note that this commit doesn't take into account buffer flags that
might exclude some buffers from being cycled over by commands.

Fixes #1840
2021-10-06 08:44:47 +02:00
Maxime Coste
21494e5d78 Merge remote-tracking branch 'lenormf/fix-3976' 2021-10-06 09:00:21 +11:00
Maxime Coste
09f4ef0917 Merge remote-tracking branch 'lenormf/fix-4353' 2021-09-30 20:43:02 +10:00
Maxime Coste
5f8753caec rework selection insert/replace using a for_each method
expose that method so that various commands can take advantage of
it for performance or simplicity purposes.
2021-09-30 20:12:58 +10:00
Maxime Coste
e3bcd6a74b Merge remote-tracking branch 'lenormf/modeline_readonly_status' 2021-09-26 11:09:34 +10:00
Maxime Coste
2eb6b14b14 Merge remote-tracking branch 'lenormf/patch-15' 2021-09-26 11:03:51 +10:00
Maxime Coste
3acf85f267 Restore diff based terminal output optimization when synchronized
terminal_synchronized ui_option now also controls this behaviour,
update out of date documentation for ui_options as well.

As discussed in #4317
2021-09-26 11:03:50 +10:00
Maxime Coste
1456431951 Merge remote-tracking branch 'Screwtapello/add-diagnostic-faces' 2021-09-21 21:11:56 +10:00
Maxime Coste
9ea1d82135 Merge remote-tracking branch 'lenormf/drop-travis' 2021-09-21 21:08:59 +10:00
Frank LENORMAND
e4d6952d8c src: Show a readonly modeline tag when relevant 2021-09-21 12:59:30 +03:00
Frank LENORMAND
b3c62c3e08 src: Error out on unmapped key in g and v
Fixes #4353.
2021-09-15 09:20:53 +03:00
Frank LENORMAND
4afe923945 src: Make g and v case sensitive
The current implementation allows users to declare mappings in the
`goto` and `view` modes with uppercase letters, but doesn't consider
case to be meaningful.

This quirk is also inconsistent as hitting an unmapped key will quit
the mode menu without complaints, but hitting a key that isn't in it
will work if it has a lowercase mapping equivalent.

Fixes #3976
2021-09-14 19:00:50 +03:00
Frank LENORMAND
4b77d011e9
src: Fix on-key usage docstring 2021-09-09 08:22:43 +03:00
Maxime Coste
b3a1017a26 Remove scrolling detection/optimization in terminal output
Just validate if line changed or not. This should avoid flickering
on terminals such as the linux console that eagerly redraw on line
deletions. Unfortunately this means drawing will use more data and
might add a bit of latency on slow links.

Fixes #4317
Fixes #4320
2021-09-09 09:01:42 +10:00
Frank LENORMAND
9f0b241e09
src: Uninstall libexec properly 2021-09-08 14:26:48 +03:00
Maxime Coste
3d8061b975 Fix set-face docstring to include underline color 2021-09-08 08:23:16 +10:00
Tim Allen
dc07c649de Add standard DiagnosticError and DiagnosticWarning faces.
kak-lsp uses these faces to mark errors inside the buffer, instead of the Error
face which is much more jarring, and which does not have an associated warning
face. Since the :spell command marks errors inside the buffer, it's also updated
to use this new face.

Adding these faces to Kakoune makes it more likely that colorschemes will
automatically do the right thing when used with kak-lsp, and makes it possible
to use a subtle appearance (like curly underlines) for in-buffer errors while
keeping Kakoune errors bold and jarring as they should be.
2021-09-07 17:46:50 +10:00
Maxime Coste
3fc8e29d10 Add support for curly underline and separate underline color
Add support for a third color in face definition that controls
the underline and a 'c' attribute for curly underline (that takes
precedence over 'u' if both are specified)

Allow empty colors to mean default, so that `,,red+u` means the
same as `default,default,red+u`

Fixes #4138
2021-09-07 08:21:26 +10:00
Maxime Coste
a6644d3034 Fix strikethrough support in face to string conversion 2021-09-05 09:20:35 +10:00
Maxime Coste
e32b2156d9 Add missing strikethrough in set-face docstring 2021-09-04 13:54:18 +10:00
Maxime Coste
5c6c58ae22 Remove unnecessary c_str() calls 2021-09-02 21:19:21 +10:00
Maxime Coste
b841f3a214 Remove terminal_wheel_up/down_button UI option
It seems nobody uses it, and it is not plugged through anyway.

Closes #2642
2021-09-02 20:46:35 +10:00
Maxime Coste
2edabde919 Do not go through some temporary selections for indent/deindent
This does not seem necessary and simplifies the logic
2021-08-30 16:14:26 +10:00
Maxime Coste
33a80e644c Take a function SelectionList::insert to get string to insert
This makes it unnecessary to allocate Vector<String> to insert and
allows to remove the insert_pos pointer hack by passing it to the
callback.
2021-08-30 16:14:26 +10:00
Maxime Coste
bc11f972c5 Kakoune 2021.08.28 2021-08-28 14:07:42 +10:00
Maxime Coste
726bec4670 Support info markup spanning multiple lines
Preserve the active face accross lines

Fixes #4313
2021-08-28 13:53:23 +10:00
Maxime Coste
e454b393cf Fix readonly behaviour
Make readonly specified on startup only apply to files provided on
the command line, and use the correct scope in `edit -readonly`

Fixes #4278
2021-08-22 22:59:16 +10:00
Maxime Coste
c1e8f57bd6 Merge branch 'roam-hurd-exec-path' of http://github.com/ppentchev/kakoune into HEAD 2021-08-22 22:41:27 +10:00
Peter Pentchev
6eb56a97d2 Find the executable path on the GNU Hurd, too. 2021-08-21 17:14:21 +03:00
Peter Pentchev
aa88f459ff Use the [[gnu::packed]] C++ attribute.
Suggested by: Maxime Coste <mawww@kakoune.org>
2021-08-21 17:06:14 +03:00
Peter Pentchev
6e686af8b5 Do not break non-GCC/g++ compilers. 2021-08-20 17:21:26 +03:00
Peter Pentchev
0e9624f69f Make sure the ParsedRegex structure has the right size.
Some versions of GCC/g++ will not necessarily pad the structure to
a 32-bit boundary, so make the alignment and the filler explicit.

Detected on: Debian/m68k; https://buildd.debian.org/status/fetch.php?pkg=kakoune&arch=m68k&ver=2020.09.01-1&stamp=1629387444&raw=0
2021-08-20 17:13:34 +03:00
Maxime Coste
7187784936 Move control character escaping responsibility to the terminal UI
Fix atom text at display time, allow tabs/eol/etc... in display
atoms and escape them just-in-time

Fixes #4293
2021-08-17 20:40:30 +10:00
Maxime Coste
94388dc51e Merge remote-tracking branch 'alexherbo2/fix-typos' 2021-08-17 08:48:47 +10:00
Maxime Coste
e8e535e1cf Merge remote-tracking branch 'krobelus/no-env-var' 2021-08-17 08:27:49 +10:00
Maxime Coste
cde67c25aa Merge remote-tracking branch 'krobelus/complete-at-percent-delimiter' 2021-08-17 08:27:37 +10:00
Johannes Altmanninger
c1bdafef48 Avoid "env var" in error message for unknown %val expansion
This meaning is only used in C++ sources. The docs use "env
var"/"environment variable" a few times for actual environment
variables.
2021-08-10 08:23:14 +02:00
Johannes Altmanninger
abd833e0dc Restore prompt completion for "%opt{"
Commit 2289f350 ("Remove command parsing Reader and just track a
ParserState") introduced a small regression in parse_percent_token()
because we failed to recognize a token like %val{ as percent-expansion.

I tried to add a test case but a UI test doesn't seem possible, e.g.

	kak -ui json -e "exec ':echo %opt{<tab>}<ret>'"

prints: 'exec': option not found: ''
2021-08-09 22:46:06 +02:00
Maxime Coste
73da47258d Reduce memory usage and allocations in terminal output code
Store data in unique_ptr instead of vectors as we have fixed sizes
Do not allocate new hashes, recompute them on-demand
2021-08-05 11:52:37 +10:00
Maxime Coste
24c23af341 Remove unnecessary fflush call 2021-08-05 10:57:35 +10:00
Maxime Coste
7b126704c7 Fallback to 80x24 terminal size when ioctl fails or returns 0x0
Fixes #4286
2021-08-04 20:51:50 +10:00
Maxime Coste
1b7616b3fc Use a BufferedWriter to output in the terminal ui instead of stdio
Clearer control of buffering and flushing
2021-08-01 20:07:20 +10:00
Maxime Coste
1728274803 Add a format_with format function that takes a FunctionRef append 2021-07-31 09:45:05 +10:00