| Age | Commit message (Collapse) | Author |
|
Calling it as part of the insert method was error prone and often
led to slightly surprising behaviour, such as the <c-r><esc> hiding
the menu on <esc>.
|
|
Make last insert and macro recording closer together, paving the
way towards moving last insert to a register.
Use a FunctionRef for insert completer key insertion support.
|
|
Only record non-synthetized insertions, removing the need to
re-record on replay and fixing the last replay getting dropped by
macro execution.
Fixes #5122
|
|
|
|
Since C++20 (a != b) get automatically rewritten as !(a == b) if
the != operator does not exist.
|
|
|
|
Insert mode completions are accepted by typing any key. For example,
if there is a completion "somefunction()", then typing
some<c-n>;
will insert
somefunction();
and then the InsertCompletionHide hook will fire. The hook parameter
is a range that contains the entire thing: the actual completion plus
the trailing semicolon that closed the completion menu.
The [original motivation] for the hook parameter was to support
removing text inserted by completion, so we can apply text edits
or expand snippets instead. One problem is that we don't want to
remove the semicolon. Another problem came up in a discussion
about [snippets]: let's say we have a snippet "add" that expands to
add(?, ?)
where ? are placeholders. After snippet expansion the cursor replaces
the first placeholder. If I type "ad<c-n>1" I expect to get "add(1, ?)".
If the InsertCompletionHide hook only runs after processing the "1"
keystroke, this is not possible without evil hacks.
Fix these problems by running InsertCompletionHide when a completion is
accepted _before_ inserting anything else into the buffer. This should
make it much easier to fully implement [LSP text edits]. I doubt
that anyone besides kak-lsp is using the hook parameter today so this
should be a low-risk fix.
[original motivation]: https://github.com/mawww/kakoune/issues/2898
[snippets]: https://github.com/kak-lsp/kak-lsp/pull/616#discussion_r883208858
[LSP text edits]: https://github.com/kak-lsp/kak-lsp/issues/40
|
|
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
|
|
Keep track of inserted ranges instead of trying to re-derive them.
Fixes #3556
|
|
We can have the previous behaviour by just passing the docstring to
`info -placement menu`.
|
|
Fixes #2208
|
|
|
|
the JsonUI now supports a "menu_select(int)" RPC call that should
trigger explicit selection of the provided item index.
As discussed for issue #2019.
|
|
set-face now takes a scope argument, and faces can be overridden on
a buffer or window basis.
colorscheme apply on global scope, which should be good enough for
now.
Fixes #1411
|
|
- via completers option with line=all vs line=buffer
- via <c-x> L mapping
|
|
|
|
|
|
|
|
We should never destruct anything through an OptionManagerWatcher
pointer, so having all those destructor virtual makes no sense.
|
|
|
|
Introduce Meta::Type<T> to store a type as value, and pass it
around, migrate enum_desc and option_type_name to this.
|
|
Closes #1241
|
|
|
|
|
|
Add a ColumnCount type and use it in place of CharCount whenever
more appropriate, take column size of codepoints into account for
vertical movements and docstring wrapping.
Fixes #811
|
|
|
|
|
|
|
|
|
|
Fix escaping in jedi.kak as well
|
|
|
|
and not)
|
|
Fixes #313
|
|
|
|
|
|
|
|
Display buffer of origin in word completion menu
|
|
|
|
Instead of storing the real 'select next completion' keystroke,
generate fake backspace/delete/char keystrokes so that replay
of the insert will insert the exact same text.
Fixes #135
|
|
|
|
|
|
|
|
The context options might change, as the context might have a different
window/buffer from the one at creation. So we need to store the correct
option manager rather than ask the context for it.
|
|
|
|
|
|
|
|
Use a specific type for InsertCompleterDesc with checks in
the option_{from,to}_string functions
|
|
BufferCoord -> ByteCoord
DisplayCoord -> CharCoord
Moved their definition along with LineAndColumn into coord.hh
|
|
|