summaryrefslogtreecommitdiff
path: root/src/normal.cc
AgeCommit message (Collapse)Author
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-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-06-07Fix select wiping capturesMaxime Coste
It turns out `v = std::move(v)` with v a std::vector is not a no-op, it clears the vector.
2020-05-29Avoid to_remove vector in select helper functionMaxime Coste
Remove the need to allocate anything when removing selections.
2020-03-20Remove posB from information given by the diff algorithmMaxime Coste
posB is always the sum of previous add len and previous keep len, so very easy to keep track of.
2020-03-15Merge remote-tracking branch 'Anfid/scroll-test'Maxime Coste
2020-02-27Make `on_next_key_with_autoinfo()` respect `idle_timeout`Nicolas Ouellet-Payeur
The prompt and autocomplete normally wait for `idle_timeout` before showing suggestions, however commands like `g`, `v`, or the lead-key show Clippy instantly. This fixes the issue by making `on_next_key_with_autoinfo()` wait for `idle_timeout` before displaying suggestions. Fixes mawww/kakoune#3365 Fixes mawww/kakoune#2066
2020-02-02Use ReverseView to perform fewer allocationsgeppettodivacin
The first attempt at a bug fix for @ symbols in selection buffer names worked, but it was very inefficient. In particular, it allocated three different vectors, and we really only needed the correct elements. Manipulating iterators to give us the right slices of the existing vector is far more efficient. By reversing the original content and taking the last two, we're able to get the number of selections and main selection without too much hassle. The buffer name is everything from the start of the content to the selection count. This gets us through with only one vector allocation. Credit to @mawww for the optimization idea and for fixing my types.
2020-01-26Add support for `@` symbols in selection buffergeppettodivacin
The selection descriptions use the format `<buffer>@<timestamp>@<main_index>`. This fails when file paths have `@` symbols in them: the parser splits on `@` symbols and finds more values than it expects. We here modify the behavior to require *at least* two @ symbols, using the last two for `<timestamp>` and `<main_index>` and leaving the remaining text for the <buffer>. This should work for any number of `@` symbols, since `<timestamp>` and `<main_index>` are numbers and should never contain `@` symbols.
2019-12-18Cleanup replaced range selection logicMaxime Coste
Do not access Buffer::m_changes to find the inserted range, return it directly from Buffer::insert and Buffer::replace. This fixes a wrong behaviour where replacing at eof would lose the selected end of line (as the implementation does not actually replace that end of line)
2019-12-14Code style tweak in insert_outputMaxime Coste
2019-12-14Merge remote-tracking branch 'lenormf/reevaluate-exclamation-point'Maxime Coste
2019-11-30Refactor diff to make allocating a diff vector optionalMaxime Coste
The diff interface now goes through a for_each_diff function that uses a callback for each found diff.
2019-11-28Update scroll behaviorMikhail Pogretskiy
2019-11-25src: Use `begin()` to get iteratorsFrank LENORMAND
When compiling the code with `-Wp,-D_GLIBCXX_ASSERTIONS`, the process gets aborted, likely because iterators to standard containers are not obtained in a safe way. Fixes #3226.
2019-11-13Fix typoMaxime Coste
2019-11-12Add support for selecting and exporting selections in display columnsMaxime Coste
Fixes #2724
2019-11-12Add support for a -codepoint switch to the select commandMaxime Coste
2019-11-11Add mode information to next-key mode nameMaxime Coste
Currently expose an additional name, the format is up for discussion. Fixes #1855 Fixes #2569 Fixes #2672
2019-11-09Add static or const where usefulJason Felice
2019-11-07Merge selection list parsing into selection_list_from_stringsJason Felice
2019-10-17Remove explicit sizes from make_array callsMaxime Coste
2019-10-10Add unambiguous titles for infobox "enter combining operator"Delapouite
fix #3089
2019-09-15Make arrow keys normal mode mappings instead of commandsMaxime Coste
2019-07-22Ensure current context switches away from buffer on delete-bufferMaxime Coste
Fixes #3025
2019-07-21More functional style for '*' codeMaxime Coste
2019-07-01src: Use all selections to generate a pattern upon hitting `*`Frank LENORMAND
This commit makes the `*` and <a-*> primitives compose a search pattern comprised of all the current selections, as opposed to only the main one. All selections are OR'd into the default search register, which makes it convenient to search for several identifiers already selected. To retain the old behaviour, the following mappings can be used: ``` map global normal * ': exec -draft -save-regs "" %{<space>*}<ret>' map global normal <a-*> ': exec -draft -save-regs "" %{<space><a-*>}<ret>' ``` Fixes #2994
2019-06-23Tweak history restoring behaviourMaxime Coste
2019-06-23Use register to store prompt historyMaxime Coste
2019-06-19Refactor option_to_string quoting support, introduce Quoting::RawMaxime Coste
2019-05-13Support discarding selections in exec/eval -iterselMaxime Coste
Only fail if all selections are discarded. Fixes #2841
2019-03-16Make keymap fully constexprMaxime Coste
2019-02-17Add object mode expansionsJason Felice
2019-02-14Add object commandJason Felice
2019-02-04Remove references to SelectionList from selectorsMaxime Coste
2019-02-04Remove target_eol and small code cleanupsMaxime Coste
2019-01-23Change pipe diffing to work linewiseMaxime Coste
This should greatly improve performances as we only need to diff lines instead of individual characters. Closes #2678 Fixes #2037
2019-01-23Always select inserted text after pipingMaxime Coste
Relying on general selection update code is error prone due to diffing. Fixes #2394
2019-01-20Split compile time regex flags from runtime onesMaxime Coste
2018-12-13Improve deindent behaviour with mixed indentMaxime Coste
2018-11-27Merge remote-tracking branch 'lenormf/fix-trim-selections'Maxime Coste
2018-11-27Make '_' the default extra_word_chars, and remove built-in supportMaxime Coste
Fixes #2599
2018-10-23Change next_key title for <a-f>, <a-t>, <a-F> and <a-T>Delapouite
2018-09-30src: Implement <a-m> and <a-M>Frank LENORMAND
Closes #2425
2018-09-30src: Move <a-m> to <a-_>Frank LENORMAND
2018-09-27src: Drop selections that only contain whitespace on `_`Frank LENORMAND
Fixes #2387
2018-07-26Cleanup some trailing whitespaces and double semicolonMaxime Coste
2018-07-26Replace a few loops with rangesMaxime Coste
2018-07-23Merge remote-tracking branch 'lenormf/fix-C-skip-empty-lines'Maxime Coste
2018-07-05Tolerate restoring invalid coordinates from registerMaxime Coste
Clamp those selection after updating them to the current timestamp Fixes #2078