summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2020-12-25Avoid non-POSIX ln -r switchMaxime Coste
Fixes #3985
2020-12-23commands: add "registers" subcommand to :debugCole Helbling
This prints all non-empty registers and their value(s) to the `*debug*` buffer.
2020-12-22remove unused variable changes_trackerJean Abed
2020-12-22src: Catch “kill exceptions”’cleanlyFrank LENORMAND
When the `kill` command is called in the `-E` CLI flag, the resulting exception is not caught and crashes the server. This commit allows the server to terminate cleanly. Since `KakEnd` hooks also need to be executed should the user run a command like `kak -E 'kill 0'`, the execution of `KakBegin` hooks is now performed *before* the command provided in `-E` is executed. The documentation for `KakBegin` (executed after the `-E` command prior to this commit) consequently becomes more truthful, as it states: KakBegin session name kakoune has started, this hook is called just after reading the user configuration files Fixes #3972
2020-12-20Add Timer::disable() to be more explicit than set_next_date(TimePoint::max())Maxime Coste
2020-12-09Add a libexec/ directory and use it to find the kak commandMaxime Coste
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-05Merge remote-tracking branch 'occivink/no-sel-remaining-alt-space'Maxime Coste
2020-12-03Throw no_selections_remaining when using <a-space>Olivier Perret
This makes it possible to use the mechanism introduced by 91386a53
2020-12-01Avoid potential use after free of the mode nameMaxime Coste
This can be an issue with NextKey that now does not have a static mode name.
2020-12-01Ensure InputModes are kept alive during their idle logicMaxime Coste
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-11-22Merge remote-tracking branch 'AndrewVos/ignore-indent-on-line-completion'Maxime Coste
2020-11-20Ignore indent when completing linesAndrew Vos
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-18Restore auto-select on return, add a flag to disable that for commandsMaxime Coste
Fixes #3849 Again
2020-11-17Revert "Auto-insert prompt menu completions on <ret> if any text was entered"Maxime Coste
Unfortunately this breaks some pretty useful use cases, such as inserting a command ending with a new-line (as it now leads to an addtional command being auto-completed on validation) This reverts commit aab0be529f77f3a8e86185a030838e6d547d0286.
2020-11-11Merge remote-tracking branch '6112/msys2-wcwidth' into masterMaxime Coste
2020-11-07Fix performance issue with word completionMaxime Coste
When pasting many words with <a-p> we can end-up with a huge concatenated word and many selections, the previous code ended up iterating from each selection cursor to that word start and end to find the word under the cursor. This could lead to performance issue as each selection would trigger iteration on that huge word. This is unnecessary as word completion has a word length limit, so we now take it into account to avoid iterating to far from the cursor position.
2020-11-07Fix performance issue when pasting many selectionMaxime Coste
The previous code was advancing from the general insertion point for all selection, instead of iterating only once from insertion point until the end of inserted text.
2020-11-02Handle reading from stdin returning 0Maxime Coste
0 means stdin was closed, this is quite unexpected as we would usually get a SIGHUP, but it looks like in some rare case this happens and it leads to an infinite loop trying to handle stdin events (as it will always be readable from now on). Fixes #3557
2020-11-01Auto-insert prompt menu completions on <ret> if any text was enteredMaxime Coste
Previously we would only auto-insert if the current token had some text, but this breaks auto-selection of the first match. Fixes #3849
2020-10-31src/ncurses_ui.cc: Teach Kakoune about ctrl-symbol keys.Tim Allen
Previously, Kakoune only handled ctrl-codes less than 27, representing them as lower-case ASCII codes. For regular keys like <c-a>, that worked fine. However, NUL became the unorthodox <c-`> and other ctrl-symbols (<c-\>, <c-]>, <c-_>) weren't supported at all. Now NUL is rendered as the more comfortable <c-space>, and the other ctrl-symbol codes are properly decoded. Fixes #2553.
2020-10-27Replace `write -atomic` with `write -method <method>`Maxime Coste
`-atomic` becomes `-method replace` and `-method overwrite` is now supported explicitely instead of only available through the writemethod option. Fixes #3827
2020-10-20Support explicit register for :, |, ! and $ commandsMaxime Coste
Giving an explicit register uses its content for the default value to use if the user does not enter anything. This enables: `set-register a %{commands}; execute-keys '"a:<ret>'` `set-register a %{shell script}; execute-keys '"a|<ret>'` ... This provides a nice way to avoid the need to escape keys to use those normal mode commands. Fixes #3825
2020-10-20Disable auto-insertion of menu completion when no text was enteredMaxime Coste
This avoids a frustrating behaviour where Kakoune autoinserts the first command name when hitting <space> after a ; in a command line. It also fixes the empty prompt case that was auto-completed instead of executing the default command.
2020-10-20Notify prompt completion changes in startup messageMaxime Coste
2020-10-19Fix wcwidth() compile error with MSYS2Nicolas Ouellet-payeur
We try to detect when compiling under Cygwin, so we can set the _XOPEN_SOURCE define which lets us use wcwidth(). We look for the string "CYGWIN" in the uname, which looks like: CYGWIN_NT-10.0 MSYS2 is also based on Cygwin, so all of the above should still work. However, we detect Cygwin by looking for the string "CYGWIN" in the uname. In MSYS2, the uname looks like: MSYS_NT-10.0-18362 This patch looks for the string "_NT" instead of the string "CYGWIN" in the uname, since it's common to both environments. This fixes a compilation error on MSYS2.
2020-10-19Auto-insert best completion on space for menu completionsMaxime Coste
The menu flag signifies that only the completions are valid arguments, hence it makes sense to auto insert the best one on space. Because full match is always considered the best match in completion ranking, this should always have a reasonable behaviour. This makes it harder to enter a hidden command, but completion can always be disabled via <c-o> or by quoting in those rare cases.
2020-10-19Allow quiting last client with unsaved buffer in daemon modeMaxime Coste
Because the server will out-live that client's disconnection it is still ok to have modified buffers, the server will complain on `kill`. Fixes #3801
2020-10-19Remove the rename-client's nc aliasMaxime Coste
Closes #3789
2020-10-19Merge remote-tracking branch 'm-kru/vhdl' into masterMaxime Coste
2020-10-19Add support for explicit completion in prompt modeMaxime Coste
2020-10-12Code cleanup in insert completerMaxime Coste
2020-10-12Fix region regexes incorrectly matching ^$ at end of lineMaxime Coste
Because no flags were set for regex matching, the regex engine was assuming that the subject string past-the-end matched a end-of-line. As the subject string already ended with a \n character, the regex engine processing of the "past-the-end" position would match '^$' as ^ matched past the existing \n and $ matched the assumed end-of-line. Fixes #3799
2020-09-30Merge branch 'add-illumos' of http://github.com/luka-devnull/kakoune into masterMaxime Coste
2020-09-22Ensure that the capture group actually matched in select_matchesMaxime Coste
We were creating selections from default constructed iterators, which happened to have 0,0 coords and led to out-of-order selection lists. Fixes #3757
2020-09-18Add illumos/Solaris supportluka null
2020-09-09Add support for removing from optionsMaxime Coste
`set -remove ...` will remove from the current option value, substracting from int, removing elements from vectors and maps.
2020-09-01Kakoune 2020.09.01Maxime Coste
2020-08-30Trigger InsertCompletionHide hook when switching to explicit completionMaxime Coste
Previously we would just bypass that hook making it impossible to act on the inserted text when triggering an explicit completion after inserting text from the previous completer.
2020-08-30Fix face attributes to string conversion with F shorthandMaxime Coste
Previously a `F` attribute would end up being converted to Ffga which is confusing as F *means* fga.
2020-08-18Clear inserted_ranges after updating insert completions candidatesMaxime Coste
They were getting out-of-sync with the stored timestamp, leading to invalid ranges being computed and crashes. Fixes #3666 Fixes #3571
2020-08-17Do not fork in daemon modeMaxime Coste
Leave that to the shell or external service management tools Fixes #3618
2020-08-08Rename DefinedHighlighters to SharedHighlightersMaxime Coste
Matches the user facing name and seems more correct.
2020-08-06Merge remote-tracking branch 'eraserhd/runtime-var'Maxime Coste
2020-08-04Override runtime by setting $KAKOUNE_RUNTIMEJason Felice
2020-08-04Kakoune 2020.08.04 startup infoMaxime Coste
2020-08-02Support count argument for [s and ]sJohannes Altmanninger
Part of #795
2020-08-02Support count argument for [p and ]pJohannes Altmanninger
Part of #795
2020-08-02Do not flush input buffer in UI creationMaxime Coste
Fixes #3635
2020-07-31Fix alpha of merged facesMaxime Coste
2020-07-21Do not trigger RegisterModified hooks on register about to be restoredMaxime Coste
This greatly reduces the amount of hooks triggered.