Commit Graph

5585 Commits

Author SHA1 Message Date
Maxime Coste
4bd34caf4f Fix modified keys not being mappable in goto mode
The test was invalid, non-codepoint keys should be considered mappable.

Fixes #4521
2022-02-01 13:36:36 +11:00
Maxime Coste
bfbce2a1c1 Merge remote-tracking branch 'Screwtapello/fix-session-name-error' 2022-01-24 22:11:50 +11:00
Maxime Coste
f8a86149e5 Use strerror to display execve failures
Fixes #4501
2022-01-24 21:59:16 +11:00
Maxime Coste
6f135c0c8e Do not insert any end-of-line when piping data out
This will unfortunately break some use case which will require
using wrapper scripts to add the necessary newline. It is however
harder to do the contrary, and it makes a lot of other use case
possible, such as checksuming.

Fixes #3669
2022-01-24 21:53:33 +11:00
Maxime Coste
f4ff59f8b2 Restore goto case insensitiveness, refuse to map upper case
After a while it seems clear changing this is much more ergonomic
and restoring it with pure config is impractical as we need to map
all lower case keys.
2022-01-23 21:00:45 +11:00
Tim Allen
4bfb0c6b93 When reporting an invalid session name, report the correct name.
At this point, the session name has already been moved from the `session_name`
parameter to the `m_session` member variable.
2022-01-18 14:44:09 +11:00
Johannes Altmanninger
6f7c5aed10 Do not show custom completions when autocomplete is off
As reported in [1], completions provided by "set global completers
option=my_completion" activate insert mode autocompletion, even when
the autocomplete option does not have the insert mode flag.

This happens because InsertCompleter::on_option_changed() calls
InsertCompleter::setup_ifn(), which shows the completion pager.
Fix this by computing whether the completion pager is enabled;
otherwise we can return early from setup_ifn().
The completion pager is enabled if the autocompletion bit is set,
or if the user has requested explicit completion.

[1]: https://github.com/kak-lsp/kak-lsp/issues/585
2022-01-09 20:23:51 +01:00
Maxime Coste
f68e8313b2 Fix invalid line joining logic with multiple selection per line
Fixes #4476
2021-12-20 09:13:53 +11:00
Sidharth Kshatriya
02f9db616c Bug fix: use only iswlower() in RankedMatch::is_word_boundary() 2021-12-14 15:10:01 +05:30
Chris Webb
4a10220db8 Fix mode line inconsistency between normal and insert modes
In normal mode, the mode line contains "1 sel" or "n sels (k)" when n > 1,
whereas in insert mode, it contains "n sels (k)" even for n == 1. Change
the contents in insert mode to match normal mode.
2021-12-11 12:11:08 +00:00
Maxime Coste
6029ee9815 Fix explicit line completion
trim_indent call was incorrect, trim_indent is intended to work
on multi-line strings and trims trailing whitespace as well (could
benefit from a better name).

Fixes #4378
2021-12-11 09:34:51 +11:00
Maxime Coste
7648d56fc3 Fix parsing nul bytes in regex
Fixes #4460
2021-12-11 09:01:03 +11:00
Maxime Coste
b65df4bebf Fix spurious warning likely due to String::Data not being std compliant 2021-12-11 08:44:19 +11:00
Maxime Coste
658b6b0f1a Make space a named key to correctly handle shift modifier 2021-12-11 08:12:08 +11:00
Maxime Coste
716f1f967a Clang is still unhappy, trying another approach with defining my own concept 2021-11-25 22:32:10 +11:00
Maxime Coste
4122b64ecd Avoid using standard concepts
Turns out those are unimplemented in clang < 13, use custom code
instead.
2021-11-25 22:09:01 +11:00
Maxime Coste
28ac8adbfc Templatize parse_quoted to avoid utf8 decoding with ascii delimiter 2021-11-25 13:23:56 +11:00
Maxime Coste
16493a99bb small regex impl code style tweak 2021-11-25 09:59:45 +11:00
Maxime Coste
860b20ef0a Try to fix more CI failures related to C++20 2021-11-21 20:16:58 +11:00
Maxime Coste
532a7d7a9e Fix clang C++20 compilation issues 2021-11-21 20:06:14 +11:00
Maxime Coste
91550639bb More C++20 refactorings
Use CTAD instead of make functions, requires instead of enable_if
2021-11-21 11:41:50 +11:00
Maxime Coste
bea23c6bf2 Use std::remove_cvref instead of std::decay 2021-11-21 09:44:57 +11:00
Maxime Coste
ab9d78f50d Convert comparisons to spaceship operator 2021-11-21 09:44:56 +11:00
Maxime Coste
fb4cef5b61 Replace std::enable_if with requires
Introduce some concepts for enum and flags handling, goodbye and
thanks for all the fish std::enable_if.
2021-11-21 09:44:56 +11:00
Maxime Coste
ba379cba52 Micro-optimize regex character class/type matching
Also force-inline step_thread as function call overhead has a
mesurable impact.
2021-11-21 09:44:22 +11:00
Maxime Coste
8566ae14a0 Reduce the amount of Regex VM Instruction code
Merge all lookarounds into the same instruction, merge splits, merge
literal ignore case with literal...

Besides reducing the amount of almost duplicated code, this improves
performance by reducing pressure on the (often failing) branch target
prediction for instruction dispatching by moving branches into the
instruction code themselves where they are more likely to be well
predicted.
2021-11-21 09:44:18 +11:00
Maxime Coste
6a204c31ed Merge remote-tracking branch 'lenormf/debug_mode-gdb_script' 2021-11-21 09:36:25 +11:00
Maxime Coste
da3ddbf4fe Merge branch 'doc_highlighter_switch' of http://github.com/fennewald/kakoune 2021-11-21 09:35:14 +11:00
Carson
336c1d29b5 Documented -override switch for add-highlighter 2021-11-16 00:45:47 -05:00
Sidharth Kshatriya
dd92391036 Fixes #4432: JSON UI only shows stdin when connecting to an existing session
Only ui type Terminal is intended to be a user interactive session.
If your ui type is not Terminal, don't worry about making
the tty your stdin if fd 0 is not a tty.

This allows json-rpc commands sent via stdin to be acted up rather
than sent to a fifo (which is the default behavior for kakoune).

Does not change the behavior for Terminal ui sessions
2021-11-15 11:11:28 +05:30
Maxime Coste
e7100dc874 Recognize both <tab> and <c-i> as forward jump
Now that Kakoune opts into extended key reporting, <c-i> is correctly
reported and hence needs to be mapped to forward jump.

We still need to keep <tab> mapped to it for legacy terminals.

Should fix #4333
2021-11-11 13:29:42 +11:00
Frank LENORMAND
36166d8b0f src makefile: Install GDB types in debug mode 2021-11-08 13:39:55 +03:00
Maxime Coste
1b8574449f Kakoune 2021.11.08 2021-11-07 16:51:39 +11:00
Frank LENORMAND
6cadffa090 src highlighters: Factorise docstrings
Fixes #4367.
2021-11-05 11:30:35 +03:00
Frank LENORMAND
4eb8a100a8 src highlighters: Sort instantiations 2021-11-04 07:38:13 +03:00
Jason Felice
a70dbda54c use shifted key codes on kitty 2021-11-02 08:26:39 -04:00
Maxime Coste
19e2225153 Keep command_fifo read fd open instead of closing/reopening
Closing/reopening the read side seems to sometimes lead to
end-of-file not being received, leaving some extra data unexecuted.

The FDWatcher stays disabled during the executing of the fifo
commands so this should not enable any more commands to be executed
until we get back from the CommandManager and reset the FDWatcher
fd to to fifo read end.

Fixes #4410
2021-11-02 21:50:37 +11:00
Maxime Coste
e7adb01316 Merge remote-tracking branch 'sidkshatriya/remove-kak-history-file' 2021-11-02 21:09:25 +11:00
Maxime Coste
0f688656a4 Fix DECRPM parsing for 2026
As discovered in #4320 the previous code was buggy and would enable
synchronized output on any response.
2021-11-02 19:43:16 +11:00
Maxime Coste
8299d1da1f Fix pasting all from empty register
Raise an error if the register is empty for paste-all

Fixes #4414
2021-11-01 09:05:57 +11:00
Maxime Coste
d2e2caaae6 Fix incorrect reading logic and EAGAIN handling
This is one of the issues raised by #4410
2021-10-29 22:34:19 +11:00
Maxime Coste
be4659097c Complete alias command with existing alias names 2021-10-29 08:20:08 +11:00
Maxime Coste
874f3e0764 Fix terminal underline color not being properly reset 2021-10-29 07:51:29 +11:00
Maxime Coste
da10ce817e Kakoune 2021.10.28 2021-10-28 09:13:34 +11:00
Robert Clausecker
120e4b5a5d src/main.cc: Fix inline assembly syntax error on ARM
ARM uses @ as a comment character, so %progbits must be
used in place of @progbits here.  This change fixes the
build on armv7 FreeBSD 13.0.

Fixes		mawww/kakoune/issues#4385
See also	https://bugs.freebsd.org/259434
2021-10-25 15:17:49 +02:00
Maxime Coste
6e635ea301 Merge remote-tracking branch 'lenormf/fix-2164' 2021-10-24 18:42:37 +11:00
Frank LENORMAND
16dfe977b2 src: Make gf open all selected paths
The buffer whose path is under the main selection will be focused
after all others have been opened.

Closes #2164
2021-10-24 09:01:24 +02:00
Maxime Coste
502e3f6857 Fallback to basic path on platforms where _CS_PATH is not defined
This happens on termux for example.
2021-10-24 09:37:59 +11:00
Maxime Coste
7c6f111d5f Ensure rename-buffer uses a filename for file buffers
Fixes #4391
2021-10-24 09:30:31 +11:00
Maxime Coste
5c1e10decb Merge remote-tracking branch 'lenormf/fix-4340' 2021-10-24 09:04:14 +11:00
Frank LENORMAND
c57a86ce62 src: Fix undefined behaviour
Cppcheck produces the following warnings:

```
shared_string.hh:27:49: portability: Shifting signed 32-bit value by 31 bits is implementation-defined behaviour
shared_string.hh:27:49: error: Signed integer overflow for expression '1<<31'.
```

Fixes #4340
2021-10-23 10:36:37 +02:00
Frank LENORMAND
367879ddcf src: Use pre-increment iterator syntax
Cppcheck produces the following warning:

```
string_utils.cc:24:9: performance: Prefer prefix ++/-- operators for non-primitive types.
```

Fixes #4340
2021-10-23 10:34:27 +02:00
Frank LENORMAND
aff303190d src: Fix the API of KeymapManager::add_user_mode()
Cppcheck produces the following warning:

```
keymap_manager.hh:54:37: performance: Function parameter 'user_mode_name' should be passed by const reference.
```

Fixes #4340
2021-10-23 10:34:27 +02:00
Maxime Coste
60165bacf9 Use DECRQM/DECRPM to detect support for synchronized output
Enable it if supported by default, let the user override it with
the existing terminal_synchronized ui option.

This should finalize work discussed on #4317
2021-10-23 09:42:31 +11:00
Frank LENORMAND
0af234a329 src: Implement the enumerate() range filter 2021-10-21 10:58:46 +02:00
Maxime Coste
689553c2e9 Split InsertMode into InsertMode and PasteMode
They are quite different use cases, and this allow moving InsertMode
to input_handler.hh which is what uses it.

This also cleans up the code as we can get rid of get_insert_pos and
rely more on SelectionList::for_each.
2021-10-10 11:02:09 +11:00
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
Maxime Coste
a566a22cbc Expose BufferedWriter 2021-07-31 09:44:24 +10:00
Maxime Coste
914f4f8c19 Fix FunctionRef copy construction
The template constructor was mistaken as a copy constructor.
2021-07-31 09:43:49 +10:00
Maxime Coste
b57dc7c512 Code style tweak for Regex implementation TestVM 2021-07-31 08:55:52 +10:00
Maxime Coste
cf52379422 Do not run unit tests in release builds
They mostly rely on assertions that are disabled in those builds
anyway.
2021-07-26 16:57:07 +10:00
Maxime Coste
cbba348a83 always inline custom operator new/delete to avoid spurious warnings
GCC 11 warns incorrectly about mismatched new/delete because it auto
inlines one but not the other, force inline those function to fix that.
2021-07-26 16:55:36 +10:00
Maxime Coste
15aa4fe137 Document the new write behaviour 2021-07-20 22:45:33 +10:00
Maxime Coste
7f41a277a0 Merge remote-tracking branch 'occivink/nop-ignore-unknown-switches' 2021-07-20 22:37:09 +10:00
Maxime Coste
40e3614cf4 Prevent overwriting existing file in :write <explicit filename>
Add a -force (equivalent to w!) switch that enables overwriting.
2021-07-20 22:30:41 +10:00
Maxime Coste
4d99434ddd Remove unnecessary forward declaration 2021-07-20 22:30:41 +10:00
Maxime Coste
3c1199f665 Add missing new/delete overload in UseMemoryDomain 2021-07-20 22:30:41 +10:00
Maxime Coste
63b67d0f31 Remove some unnecessary string copies in TerminalUI 2021-07-20 22:30:41 +10:00
Maxime Coste
e3957bb24c Generate different parse_quoted_balanced for each quote pair
This seems to slightly improve parse speed which is where kakoune
spends most of its time during startup.
2021-07-20 22:30:41 +10:00
Maxime Coste
a4dd89f214 Improve code-generation for Strings
Make String::Data use trivial copy of the short/long union to avoid
unnecessary branching there, inline release() as it can be elided by
the compiler on moved-from Strings.
2021-07-20 22:30:41 +10:00
Olivier Perret
55f9a69465 nop: ignore unknown switches instead of failing 2021-07-19 11:47:07 +02:00
Maxime Coste
c643cd4467 Fix blitting of windows halfway through double-width codepoint
Display a whitespace in place of the uncovered half of the codepoint.

(I know this is incorrect and we should be considering grapheme clusters
instead of codepoints, but this is a far bigger refactoring and another
can of worms to handle with terminal emulators).

Fixes #4262
2021-07-14 20:51:25 +10:00
Maxime Coste
ac6420ee8d Refactor TerminalUI::set_ui_options
Take advantage of Optional monadic operations
2021-07-12 10:25:59 +10:00
Maxime Coste
428ddeb97b Add 'terminal_synchronized' ui_option to opt-in synchronized output
Synchronized output does not work well with various terminals
(including the linux console). It should also be unnecessary when
not going through a slow link.

This will eventually be removed if it is not proven to be useful
to some users.
2021-07-12 10:25:59 +10:00
Jason Felice
5d497dc46e src: Support strikethrough faces 2021-07-12 10:25:59 +10:00
Maxime Coste
cbd0dc571b Fix crash when displaying a menu on a too small terminal
The code could position the menu at a negative line leading to
invalid array accesses.
2021-07-12 10:25:59 +10:00
Maxime Coste
76e5d11c8b Small cleanups in terminal ui 2021-07-12 10:25:59 +10:00
Maxime Coste
44deaeb4eb Do not trust saved active face when force redrawing 2021-07-12 10:25:59 +10:00
Maxime Coste
7bbc057cd7 Slight code simplification 2021-07-12 10:25:58 +10:00
Maxime Coste
b3025b87d0 Fix race on resize in terminal ui 2021-07-12 10:25:58 +10:00
Maxime Coste
86025f88c4 Fix force redraw handling
Fixes #3559
2021-07-12 10:25:58 +10:00
Maxime Coste
cd613da050 Tolerate bliting window that overflow the target
Although we try to avoid those, ensuring it never happens is tricky,
and tolerating them avoids the crash.

Fixes #3498
2021-07-12 10:25:58 +10:00
Kylie McClain
89e0b4b830 terminal_ui.cc: fix build on musl libc 2021-07-12 10:25:58 +10:00
Tim Allen
de065dad2d terminal_ui: restore termios settings before suspending Kakoune.
TerminalUI::suspend() is responsible for undoing all Kakoune's modifications to
the terminal state, actually suspending the process, then re-applying all the
modifications after Kakoune wakes back up.

Previously, the "undo" and "reapply" steps for termios settings were both after
the suspend point, so on some platforms they were incorrect when the user
arrived back at the shell prompt.

Now, the termios "undo" step is back before the suspend point, and the undo and
reapply steps should be in exactly reversed order.

Fixes #3488.
2021-07-12 10:25:58 +10:00
Tim Allen
e760f2df6b Use iTerm2 "synchronised update" sequences around redraws.
In terminals that support it, this sequence causes the terminal to not redraw
*its* output until the application has finished, reducing redraw flickering.

The sequence is defined in:

    https://gitlab.com/gnachman/iterm2/-/wikis/synchronized-updates-spec

...and is apparently also supported by kitty and libVTE.

Fixes #3482.
2021-07-12 10:25:58 +10:00
Maxime Coste
72271ce529 Handle skipped characters with erase line (EL) instead of insert blank (ICH)
insert blank seems to behave differently between terminals and would
be less efficient because it still has to shift all following characters
(that we will overwrite anyway).

Fixes #3437
2021-07-12 10:25:58 +10:00
Maxime Coste
b0dcb07540 Reduce amount of SGR escapes emitted by tracking the active face 2021-07-12 10:25:58 +10:00
Maxime Coste
63310370f8 Remove explicit whitespace padding in menu/info
Rely on the backend to clear content to eol
2021-07-12 10:25:58 +10:00
Maxime Coste
484cfae9d1 Use CSI @ instead of emitting lots of spaces
This greatly reduces the amount of data written for a redraw especially
on big terminals where most of the data is trailing blanks
2021-07-12 10:25:58 +10:00
Maxime Coste
8e1b79b1b7 Remove the concept of cursor in TerminalUI::Window 2021-07-12 10:25:58 +10:00
Maxime Coste
65fbabcb86 Fix another display corruption issue in the terminal output code 2021-07-12 10:25:58 +10:00
Maxime Coste
5c3b0b7503 Fix another terminal update issue in the latest code change
Fixes #3426
2021-07-12 10:25:58 +10:00
Maxime Coste
e6801867c7 Fix bug in terminal output line delete logic 2021-07-12 10:25:58 +10:00
Maxime Coste
5a31b9f351 Fix tab character that got introduced by mistake 2021-07-12 10:25:58 +10:00
Maxime Coste
68f0bcce7c Reduce the number of added/removed lines when redrawing screen
This should reduce flickering.
2021-07-12 10:25:58 +10:00
Maxime Coste
0506de8443 Fix compute_pos behaviour not to overflow by one line
Thanks to eraserhd for debugging this and proposing an initial fix.

Fixes #3414
Close #3418
2021-07-12 10:25:58 +10:00
Maxime Coste
5466f63eeb Use insert/remove lines escapes to reduce terminal traffic
Diff against known state and insert/erase relevant lines.

Erase everything first to avoid insertion invalidating lines that
get out of the terminal at bottom.
2021-07-12 10:25:58 +10:00
Maxime Coste
9e8f555a82 Only redraw updated lines 2021-07-12 10:25:58 +10:00
Maxime Coste
07750656a8 Blit all window together before outputing them to the tty
This should reduce flicker, by avoiding transient states where
info/menu windows are not displayed, and paves the way for proper
diffing of the screen.
2021-07-12 10:25:58 +10:00
Maxime Coste
03563d51aa Fix crash on resize in TerminalUI 2021-07-12 10:25:58 +10:00
Maxime Coste
7e66846172 Rename NCursesUI to TerminalUI 2021-07-12 10:25:58 +10:00
Maxime Coste
3b4d2b63c6 Remove references to ncurses in Makefile 2021-07-12 10:25:58 +10:00
Maxime Coste
c12699d2e9 Replace ncurses with a naive custom terminal backend 2021-07-12 10:25:58 +10:00
Maxime Coste
7622ebcc92 Quit server on SIGINT when it was not signaled by Kakoune itself
Fixes #3974
2021-07-12 10:08:17 +10:00
Maxime Coste
c30a0e0ca2 Inline String::Data no-copy constructor 2021-07-09 17:03:22 +10:00
Maxime Coste
2289f350df Remove command parsing Reader and just track a ParserState
The Reader abstraction was leading to suboptimal code by encouraging
decoding utf8 separately from advancing to next codepoint.
2021-07-09 17:03:22 +10:00
Maxime Coste
86c5e8f75b Avoid temporary vector in expand_token
Instead of return a vector, take the target vector as a parameter
and push tokens to it.
2021-07-09 17:03:22 +10:00
Maxime Coste
cd67f2cf11 Avoid copying token content strings in expand_token
We can move that data instead of copying
2021-07-09 17:03:22 +10:00
Maxime Coste
64e306f64b Document command-fifo in changelog 2021-07-07 19:46:47 +10:00
Maxime Coste
5ed9e1b356 Catch errors while executing shell commands
Log error to debug buffer and Change the 'waiting for shell' face
to 'Error'.

Update the 'waiting for shell' message when the shell has exited
but Kakoune is still waiting on stdin/stdout/stderr to be closed.
2021-07-07 19:25:06 +10:00
Maxime Coste
3d7fb8ddbc Add support for $kak_command_fifo and $kak_response_fifo
Those fifos are accessible during %sh{...} blocks, the command fifo
executes commands written to it once the write end side is closed
(multiple open/write/close sequences are supported), the response
fifo is a simple helper fifo available to write response back to
the shell process

An example use of this feature is to request some list options
content from without being limited by the environment size:
```
%sh{
    echo "echo -to-file $kak_response_fifo -quoting shell -- %opt{some_list}" > $kak_command_fifo
    eval "set -- $(cat $kak_response_fifo)"
}
```
2021-07-07 19:25:06 +10:00
Maxime Coste
6215bff764 Decouple generate_env from actual ShellManager env var collection 2021-07-07 19:25:06 +10:00
Maxime Coste
0c92ec8a23 Merge remote-tracking branch 'Screwtapello/save-restore-window-title' 2021-07-07 19:16:07 +10:00
Dmitry Matveyev
dbfbb1b5a6 Restore terminal during suspend before changing alternate screen 2021-06-27 16:49:39 +06:00
Maxime Coste
c68f85659f Handle Ctrl+Z key later in the terminal input stack
The previous handling code was at a pretty random location and broke
terminals that could send <c-z> encoded in a non pure ascii way.

See #4238
2021-06-27 16:56:29 +10:00
Maxime Coste
f0f3c0f735 Merge remote-tracking branch 'SolitudeSF/mode' 2021-06-26 09:59:45 +10:00
Sidharth Kshatriya
c5a1ddeaff Better style 2021-06-24 19:53:38 +05:30
Sidharth Kshatriya
5244ecbe9b Also deal with variables named kak_quoted_* by using a more generic approach 2021-06-24 19:49:54 +05:30
Sidharth Kshatriya
0ca81e7cec Fix: Kakoune passed environment variables in shell invocations are repeated
If a %sh{} script refers to any variables multiple times they are all multiply
included in the environment. Example: if a %sh{} invocation refers to
${kak_buffile} 5 times, the environment will have "kak_buffile=..." repeated 5
times and so on. This repetition happens for each multiply used variable that
is passed into the environment.

The variable should, of course, be only passed into the environment once. This
commit should fix this issue.
2021-06-24 14:03:58 +05:30
Maxime Coste
be9b2de0ee Only compute command coordinates when necessary
Tracking the line/column of each token takes a surprising big part
of the command parsing logic runtime and is only necessary when we
hit an error.
2021-06-24 17:20:37 +10:00
Maxime Coste
49e2ecdcdb Fix invalid command profiling logic 2021-06-24 17:14:10 +10:00
SolitudeSF
9fff572aab
Restore terminal before switching from alternate screen 2021-06-18 08:22:59 +03:00
Tim Allen
7c48a72e11 src: Restore the window title when quitting or suspending Kakoune.
Fixes #4228.
2021-06-15 12:04:21 +10:00
Taupiqueur
ad1dc79789 Fix typos 2021-06-13 04:12:03 +02:00
Maxime Coste
95b0627e54 Fix focus_in/focus_out keys not having user friendly names 2021-05-28 20:32:12 +10:00
Maxime Coste
049b9a28d1 Fix File Buffer flag not being correctly applied 2021-05-28 20:31:28 +10:00
Maxime Coste
fb9dbfed2a Canonicalize <s-ascii> into uppercase in csi key parsing code
Fixes #4159
2021-05-28 20:15:56 +10:00
Maxime Coste
e4a23a64fa Support opening files bigger than 2 GiB
The real technical limit is with lines bigger than 2 GiB and buffers
with more than 2 Gi lines, refactor buffer loading to make it possible
to load those files.

Fix an overflow with the hash_data function at the same time
2021-05-28 17:03:41 +10:00
Maxime Coste
0cecea6593 Fix completion past explicitely closed tokens
This fixes an issue where completion would still be provided after
the closing character of a token, which could then get frustrating
combined with auto-insertion of completions.

For example, inserting `%{<newline>}` for a command-completed token
(such as the commands for a hook) would still trigger completion right
after the `}` and that completion would get auto-inserted **replacing**
that closing `}`.
2021-05-18 20:50:56 +10:00
Maxime Coste
47c0d20388 Request xterm 'modifyOtherKeys' mode to opt-in CSI u key reporting
Various terminal emulators now support this `CSI > 4 ; 1 m` sequence
to enable CSI u style reporting, opt into it on startup.

Closes #4103
2021-05-02 17:06:43 +10:00
Maxime Coste
db9ef82398 Rework session directory logic
Do not use a shared kakoune/ directory for all users to avoid the
complexity of having to set the sticky bit on that dir, resolve the
session directoy only once by using a static variable and an
immediately evaluated lambda.

This fixes an annoyance whenver using `su` and having Kakoune refuse
to start due to XDG_RUNTIME_DIR still being set.
2021-05-01 15:29:50 +10:00
Maxime Coste
2288be3257 Merge remote-tracking branch 'markus-oberhumer/ux-improve-prompt' 2021-05-01 14:37:54 +10:00
Markus F.X.J. Oberhumer
e57fe4fb90 Improve prompt handling
As a long time vi user I find it highly irritating that
you cannot backspace out of the command prompt.
2021-04-30 19:42:08 +02:00
Tim Allen
f78adeda49 src: Fix mouse modifier support in the ncurses UI.
For historical reasons, mouse events represent keyboard modifiers as a bitfield,
but keyboard events represent modifiers as a bitfield-plus-one. For example, a
mouse event with an Alt modifier will use the value 4, but a keyboard event will
use the value 5.

Previously, I refactored the parse_mask() helper to do the subtraction itself,
instead of requiring the caller to do it. This made keyboard-event decoding much
cleaner, but I didn't realise it broke mouse-event decoding. Now the subtraction
is done only for keyboard events.

Fixes #4176.
2021-04-30 14:48:37 +10:00
Maxime Coste
970a0b8997 Merge remote-tracking branch 'markus-oberhumer/ux-debug-buffer' 2021-04-28 08:11:57 +10:00
Maxime Coste
7394307a3d Merge remote-tracking branch 'nojhan/feat_padding-options' 2021-04-28 08:11:15 +10:00
nojhan
a9d33a8796 fix ncurses' padding option
- Use less iterations when drawing padding fill with multiple characters.
- Use column_length to handle null-width character as no character.
2021-04-27 15:27:57 +02:00
Markus F.X.J. Oberhumer
27d6361210 Improve UX: better error message about debug buffer on startup errors
Minuscule things like these can make a huge difference if you are
a first time user of a new text editor.
2021-04-27 12:52:10 +02:00
Ben Judd
272b70298e elif over "else if" 2021-04-19 11:53:19 -07:00
Maxime Coste
f7be47fb95 Merge remote-tracking branch 'Icantjuddle/fix_deprexated_mallinfo_call' 2021-04-19 20:56:55 +10:00
Maxime Coste
1683f7f5f5 Merge remote-tracking branch 'Icantjuddle/add_hash_unit_test' 2021-04-19 20:54:43 +10:00
Ben Judd
b09eb5e010 Comments 2021-04-18 16:28:11 -07:00
Ben Judd
56875088d4 comments 2021-04-18 16:06:05 -07:00
Maxime Coste
94c0162da7 Merge remote-tracking branch 'Screwtapello/support-keypad-keys' 2021-04-18 17:06:53 +10:00
Maxime Coste
b34bd239fa Merge remote-tracking branch 'alexherbo2/fix-edit-readonly' 2021-04-18 16:29:44 +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
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
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
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
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
hss
49f5917125 Rename separator-cursor to cursor-separator 2021-03-22 19:38:33 -04:00
hss
3e539c963e Don't use optionals for storing active separator string 2021-03-21 19:52:19 -04: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
hss
8df2bb8bd5 Use optionals more wisely in line-numbers 2021-03-20 02:48:33 -04:00
hss
f16783b0a8 line-number: Add option to use a different separator on the current line 2021-03-19 23:23:01 -04:00
Maxime Coste
545db22ae4 Fix typo in file.cc 2021-03-12 09:10:19 +11:00
Maxime Coste
8e463e63ea Do not use replace write method when writing to a non-regular file
Fixes #4098
2021-03-11 20:48:44 +11:00
Maxime Coste
d5282735f2 Always redraw after getting some user input 2021-03-11 09:08:35 +11:00
Maxime Coste
4a59018dcd Do not select on non-urgent fd when handling only urgent events
This avoids 100% CPU usage when we have pending fifo input while running
a shell process, as we will not end-up busy looping in pselect but not
reading the available data due to being only processing urgent events.
2021-03-11 09:02:02 +11:00
Maxime Coste
0b234f7f67 Merge remote-tracking branch 'eraserhd/fifo-performance-fixes' 2021-03-11 07:49:20 +11:00
Jason Felice
d3824f3211 Use inplace_merge() for ranges 2021-03-09 10:13:31 -05:00
Jason Felice
c9be6730f6 Binary search for first range to change 2021-03-08 16:55:43 -05:00
Maxime Coste
f6c8ebc4d0 Refactor pipe reader/writer 2021-03-04 20:59:15 +11:00
Maxime Coste
da80a8cf6a Raise ThreadedVM initial thread capacity to 16
Threads are 4 bytes, an initial capacity of 4 led to allocating 16
bytes, raising that to 64 bytes seems quite reasonable.
2021-03-03 20:51:24 +11:00
Maxime Coste
f4a639e078 Re-use the Regex VM when completing filenames to reduce allocations
By re-using the VM we avoid re-allocating the threads and saves
buffers over and over again. We can just re-use the ones from the
previous matching.
2021-03-03 20:33:02 +11:00
Maxime Coste
eb292f1f00 Re-tweak command name completion behaviour
It turns out the fix for #4061 was breaking auto-selection with
space of command names.
2021-03-02 20:20:58 +11:00
Jacob Collins
9dfab2f1fb Follow ECMA specification for regex whitespace
Changes the behaviour of the \s and \h character classes to include
all WhiteSpace and LineTerminator characters defined in the ECMA
specification.
 - <https://262.ecma-international.org/11.0/#sec-white-space>
 - <https://262.ecma-international.org/11.0/#sec-line-terminators>
 - <https://262.ecma-international.org/11.0/#sec-characterclassescape>

Fixes #4034
2021-02-25 11:03:18 -05:00
Maxime Coste
7c321e121d Tweak requoting behaviour
Only requote when completion is replacing the whole token

Do not requote command names as they should not require it, tag
them as quoted.

Fixes #4061
2021-02-25 21:04:06 +11:00
Maxime Coste
978dfe4bdf Fix splitting display line in front of a replaced range
When a replaced buffer range atom was starting exactly at the
location we wanted to split onto the code would split *after*
that atom instead of before.

Fixes #4052
2021-02-16 12:35:25 +11:00
Maxime Coste
fa3aa3c1a3 Add + key to duplicate selections and <a-+> to merge overlapping ones
This is an experiment and might get reverted if overlapping selections
prove too cumbersome.

Fixes #4041
2021-02-15 09:01:14 +11:00
Maxime Coste
e6905552cf Fix CSI u support for escape key 2021-02-11 20:23:08 +11:00
Maxime Coste
26cf5cd1dc Fix resizing strings to -1 length
Fixes #4042
2021-02-01 20:16:30 +11:00
Maxime Coste
7751c7e188 Check XDG_RUNTIME_DIR owner before creating session directory
This avoids an issue when using `su` and running Kakoune which creates
a session directory owned by root and prevents the user from creating
more sessions.
2021-01-26 09:28:24 +11:00
Maxime Coste
74fc52b3de Write to stderr if execve fails
This should be rare but should not happen silently, this way it will
show in the parent process debug buffer.
2021-01-22 17:22:15 +11:00
Maxime Coste
04a64e6e29 Fix performance issue in show-matching highlighter on big buffers
Stop searching for the matching character when getting out of view
instead of going until the buffer edge.
2021-01-22 17:21:59 +11:00
Maxime Coste
0fd5a9d995 Slight code cleanup in generate_env 2021-01-22 17:21:59 +11:00
Tim Allen
a7ed1f03fb Distinguish <c-h> and Backspace on terminals where that is possible.
Different terminals send different codes to indicate backspace, usually one of
\x08 or \x7f, so Kakoune blindly treated both as backspace. However, a given
terminal is only likely to use one of those, and mnemonic control codes like
<c-h> are a precious resource so we should endeavour to keep backspace and
<c-h> separate when we can. Luckily, termios tells us what code our terminal is
currently using, and Kakoune already reads the information at startup, so we can
just use that information.

Thanks to @krobelus for figuring out the C++ syntax required.

Fixes #3863.
2021-01-15 18:49:53 +11:00
Maxime Coste
df7b33bc7b Merge branch 'master' of http://github.com/Woolworths/kakoune 2021-01-04 09:50:45 +11:00
Maxime Coste
49d1d4666d Merge remote-tracking branch 'cole-h/trim-only-one-newline' 2021-01-04 09:45:53 +11:00
Cole Helbling
7cde146807
command_manager: only remove last eol in %sh{} expansions
This makes it possible to keep significant EOL in shell expansions (e.g.
for use with clipboard helpers).
2021-01-02 19:53:40 -08:00
Maxime Coste
f1e45579a6 Merge remote-tracking branch 'jimt/master' 2021-01-03 11:15:11 +11:00
Maxime Coste
a0c23ccb72 Add missing limits includes
Fixes #4003
2021-01-03 10:58:09 +11:00
Jim Tittsler
a7fb4c042a Fix message typo 2021-01-01 15:15:27 +09:00
Maxime Coste
958a943121 Avoid non-POSIX ln -r switch
Fixes #3985
2020-12-25 12:07:13 +11:00
Cole Helbling
266e388c6b
commands: add "registers" subcommand to :debug
This prints all non-empty registers and their value(s) to the `*debug*`
buffer.
2020-12-23 14:22:44 -08:00
Jean Abed
650a7143be remove unused variable changes_tracker 2020-12-22 21:31:11 +11:00
Maxime Coste
e50b5fe137 Add Timer::disable() to be more explicit than set_next_date(TimePoint::max()) 2020-12-20 11:32:15 +11:00
Maxime Coste
74c337df5d Add a libexec/ directory and use it to find the kak command
Add that libexec directory to the PATH instead of the current kak
binary directory to avoid impacting other commands.

The libexec directory currently only contains a symlink back to
the Kakoune binary.
2020-12-09 09:13:45 +11:00
Maxime Coste
489404befa Merge remote-tracking branch 'occivink/no-sel-remaining-alt-space' 2020-12-05 08:47:04 +11:00
Olivier Perret
f2fb5a3214 Throw no_selections_remaining when using <a-space>
This makes it possible to use the mechanism introduced by 91386a53
2020-12-03 21:42:14 +01:00
Maxime Coste
95606d2336 Avoid potential use after free of the mode name
This can be an issue with NextKey that now does not have a static
mode name.
2020-12-01 21:56:55 +11:00
Maxime Coste
586f79c30d Ensure InputModes are kept alive during their idle logic
Various paths can run arbitrary commands (callbacks, hooks) which
could lead to the InputMode being popped off the mode stack, but
contrarily to the on_key method, we had no guarantees to be kept
alive.

Add a keep_alive RefPtr to this to ensure the mode survives till
the end.

Fixes #3915
2020-12-01 20:00:38 +11:00
Maxime Coste
a8d43ce6ce Merge remote-tracking branch 'AndrewVos/ignore-indent-on-line-completion' 2020-11-22 16:52:37 +11:00
Andrew Vos
f3f3f80624
Ignore indent when completing lines
When doing line completion, we previously used to not complete the line
if it had different indent to the potential completion.

This commit changes the behaviour to ignore indentation when completing lines.
2020-11-20 20:00:46 +00:00