summaryrefslogtreecommitdiff
path: root/src/input_handler.cc
AgeCommit message (Collapse)Author
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
2017-10-20Move keymap as an implementation detail of the normal mode keysMaxime Coste
Only expose a free function that tries to get the NormalCmd from a key.
2017-09-28Distinguish between modes being disabled temporarily and definitelyMaxime Coste
That way, insert mode knows when it can restore selections/avoid eol instead of (wrongly) doing it in the destructor that ends up running unpredictibly (as the mode is kept alive during its on_key call, even though it can happen that it is not the active mode anymore at the end of that call). Fixes #1580
2017-09-27Display selections count in insert mode the same it's displayed in normal modeDelapouite
2017-09-21Use <esc> to exit on-key modesOlivier Perret
2017-09-12Hide info box and eventual status message after handling a mouse eventMaxime Coste
Fixes #1566
2017-08-29avoid literal eol in status lines, replace them with another symbolMaxime Coste
2017-08-16Do not consider the 8th bit to mean Alt on keys that are mouse eventsMaxime Coste
Fix handling of mouse events for columns 128 to 223, we are still limited by ncurses for columns > 223. Fixes #1532
2017-07-23Merge remote-tracking branch 'Delapouite/main_index'Maxime Coste
2017-07-19Detect overflow using a long long for the computation result.Maxime Coste
Closes #1306
2017-07-16Tolerate that the cursor might not be visibleMaxime Coste
Sometimes, like if the window is not high enough, we might not be able to display any buffer lines, hence not have the cursor visible. Fixes #1502
2017-07-12Add main selection index in mode_infoDelapouite
2017-07-08Merge remote-tracking branch 'Delapouite/stars-less'Maxime Coste
2017-07-07Formatting fixesMaxime Coste
2017-07-06Make register and completion autoinfo lists uniform with all the other onesDelapouite
2017-06-29Merge remote-tracking branch 'danr/Expose-last-entered-command-in-register'Maxime Coste
2017-06-27Do not allow repeating last insert when we are not in normal modeMaxime Coste
<a-;>. is not accepted anymore. Note that <a-;> are not repeatable currently anyway (That could be fixed, athough not trivial). Fixes #1469
2017-06-25Remember count when repeating last insertMaxime Coste
Fixes #1465
2017-06-23Merge remote-tracking branch 'nuao/autoshowcompl_opt'Maxime Coste