summaryrefslogtreecommitdiff
path: root/src/input_handler.cc
AgeCommit message (Collapse)Author
2019-06-23Use register to store prompt historyMaxime Coste
2019-05-29Do not merge selections on backspace in insert modeMaxime Coste
Fixes #2861
2019-05-17Introduce Menu completion flags to auto select best candidateMaxime Coste
2019-04-28Fix typoAlex Leferry 2
2019-02-27Fixed all reorder warningsJustin Frank
2019-01-24Header and dependency cleanupMaxime Coste
2018-12-20src: Add support for right click eventsFrank LENORMAND
The current implementation treats left mouse button clicks as a generic "mouse press" modifier, this commit extends the list of modifiers by adding a "right mouse click" one. The proper way to implement this would be to ship the coordinates of mouse key press events in each `Key` object, and pass whichever button was clicked as a codepoint value (instead of coordinates currently), but this would require more work. This commit allows: * right clicks to set the cursor of the main selection * control-right clicks to merge all the selections, and then set its cursor Fixes #843
2018-11-25Merge remote-tracking branch 'lenormf/rename-auto_complete'Maxime Coste
2018-10-23Refactor Hook management to have a well defined list of hooksMaxime Coste
Hooks are now an enum class instead of passing strings around.
2018-09-04Add readline word erase bindings, throw in clipboard for good measureMaxime Coste
Add <c-w> and <a-d> (along with <c-W> and <a-D> that work on WORDs), and <c-y> which pastes the transient clipboard contant (which saves big erase, such as word erase and line end/begin erase). Fixes #2355
2018-09-03Change line editing bindings to match readline'sMaxime Coste
In the end, no better solution materialized so far, and custom Kakoune line editing bindings are hard to remember. Using well known readline bindings seems just more convenient. Closes #800, although it does not contain all the binding proposed by it (I might accept a few additional ones, such as <c-w>, but not too much, I still see that as a hack pending a nicer solution).
2018-08-27Add toggling capabilities for <c-o> in Insert and Prompt modeDelapouite
Ref #2121
2018-07-26Cleanup some trailing whitespaces and double semicolonMaxime Coste
2018-07-19src: Rename `auto_complete` to `autocomplete`Frank LENORMAND
Removing the underscore seems to make the option name more in line with the others (even though some do use a separator, e.g. `disabled_hooks`).
2018-07-15Fix manual insert completion menu not getting automatically hiddenMaxime Coste
Fixes #2208
2018-07-15Add support for <a-;> in prompt modeMaxime Coste
Fixes #2096 Closes #2060
2018-07-15Change autoshowcompl to auto_complete with insert|prompt possible valuesMaxime Coste
2018-07-05Change `a` on end of line behaviour to be consistentMaxime Coste
`a` will just jump on next line, `a` on last end of line opens a new line beneath it. Fixes #1164
2018-06-19Fix two <s-tab> requiered to access last completion in promptMaxime Coste
A single <s-tab> should be enough.
2018-06-03Add MenuStyle::Search that prevents the menu from hiding buffer textMaxime Coste
Fixes #2042
2018-05-26Do not expose C++ typeid().name to user facing errors on wrong option typeMaxime Coste
Fixes #2079
2018-05-14Rename Context::Flags::Transient to Context::Flags::DraftMaxime Coste
Draft is well establish and all draft context are transient.
2018-05-03Add support for explicit menu selection from the UIMaxime Coste
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.
2018-05-02Refactor buffer undo treeMaxime Coste
Store the undo tree as an array of undo nodes, instead of as a pointer based tree.
2018-04-11Add support for the shift modifier.Tim Allen
Because keyboard layouts vary, the shift-modifier `<s-…>` is only supported for special keys (like `<up>` and `<home>`) and for ASCII lowercase where we assume the shift-modifier just produces the matching uppercase character. Even that's not universally true, since in Turkish `i` and `I` are not an uppercase/lowercase pair, but Kakoune's default keyboard mappings already assume en-US mappings for mnemonic purposes. Mappings of the form `<s-x>` are normalized to `<X>` when `x` is an ASCII character. `<backtab>` is removed, since we can now say `<s-tab>`.
2018-04-07Make FaceRegistry scopedMaxime Coste
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
2018-04-06Make error messages more consistentDelapouite
2018-04-04Prompt: add <a-!> to expand the typed expansions in current lineMaxime Coste
Fixes #1952
2018-03-29Add status message when commiting an undo group in insert modeDelapouite
2018-03-28Fix uninitialized m_empty_text StringView in LineEditorMaxime Coste
2018-03-27Prompt: Do not call callback in on_enabledMaxime Coste
Schedule it for later, when we get "idle". It currently can lead to crashed because after the callback, the current mode might be different, leading to a crash when doing the ModeChange hook call.
2018-03-27Fix 'O' not putting the cursor on the correct lineMaxime Coste
2018-03-26Formatting fixMaxime Coste
2018-03-04Insert: Do not move end of line on open line (o/O)Maxime Coste
Change the logic of open line commands so that if a selection lies on the end of line character of the line from which we open a new line, that selection does not move. If we have two clients, A and B, with B's cursor on the eol character of line L, and A hits `o` while on line L, B's cursor should stay on the same (logical) line. Previous behaviour would make B's cursor jump on the newly inserted line.
2018-02-28Merge remote-tracking branch 'Delapouite/line_complete'Maxime Coste
2018-02-28Prompt: update completions after inserting register or raw keMaxime Coste
2018-02-27Add support for line completion in all buffersDelapouite
- via completers option with line=all vs line=buffer - via <c-x> L mapping
2018-02-25Remove avoidance of end of linesMaxime Coste
Various places in Kakoune code used to modify selections so that cursors would not lie on an end of line. Remove those to increase Kakoune's consistency and simplicity. Now that end of lines are highlighted separately, they should not be handled specially in most commands.
2018-02-11Refuse modification of ReadOnly buffers and make Debug buffer readonlyMaxime Coste
The debug buffer is a bit special as lots of events might mutate it, permitting it to be modified leads to some buggy behaviour: For example, `pipe` uses a ForwardChangeTracker to track buffer changes, but when applied on a debug buffer with the profile flag on, each shell execution will trigger an additional modification of the buffer while applying the changes, leading to an assertion failing as changes might not be happening in a forward way anymore. Trying to modify a debug buffer will now raise an error immediatly.
2018-01-21Rename InputModeChange hook to ModeChangeMaxime Coste
InputModeChange is a bit long to type and its pretty clear in Kakoune that "Mode" means "Input mode", so use a shorter and as clear name.
2018-01-15Slight code refactor in InputHandler::handle_keyMaxime Coste
2017-12-21InputHandler: Preserve no-hooks on insert mode from single command normal modeMaxime Coste
Fixes #1775
2017-12-18Introduce InputModeChange hookMaxime Coste
InputModeChange <old mode>:<new mode> is intended to replace the various <Mode>Begin/<Mode>End hooks. Fixes #1772
2017-12-06Ensure that normal mode restores disabled hook status on disabledMaxime Coste
Fixes #1744
2017-11-20Remove extraneous common_prefix in input_handlerDelapouite
Related to: 52525a156ff2a9f5c8c6fbb2e933ec412afb4728
2017-11-08InputHandler: handle of last insert keys happening in nested modesMaxime Coste
Move recording of keys to the input handler itself instead of the Insert mode so that eventual nested modes (potentially introduced by <a-;> will get their keys recorded as well). Fixes #1680
2017-10-31Prompt: display the fallback text everytime the prompt is emptyMaxime Coste
2017-10-30Do not auto apply the fallback regex when in regex promptsMaxime Coste
Fixes #1653
2017-10-28Display the fallback value in promptsMaxime Coste
Fixes #1654
2017-10-24Add distinct w (curr buf) / W (all buf) word completion for <c-x>Delapouite