Commit Graph

431 Commits

Author SHA1 Message Date
aver-d
da009b0ef5 Fix typos in C++ string literals
informations, dont, incrementaly, alignement
2018-02-22 20:28:01 +00:00
Maxime Coste
99d1fee44c Merge remote-tracking branch 'Delapouite/trim' 2018-02-22 22:06:27 +11:00
Maxime Coste
f88195d2d9 Merge remote-tracking branch 'Delapouite/user-mode' 2018-02-18 20:20:35 +11:00
Maxime Coste
84d70f8aeb normal mode: Fail if ':' is pressed with no CommandManager 2018-02-18 14:53:37 +11:00
Maxime Coste
74fd602569 '*' uses escaping of meta characters instead of \Q and \E
Fixes #1825
2018-02-17 20:36:07 +11:00
Delapouite
fccfc76e89 Add trim_selections primitive 2018-02-13 14:35:10 +01:00
Delapouite
6b447a0ecb Add declare-user-mode / enter-user-mode commands 2018-02-12 14:19:58 +01:00
Maxime Coste
e46a5697e5 Add a limit to the size of selection with which we will try to diff on pipe
Limit to 100K of data for now, as we diff at the byte level.
2018-02-09 21:47:18 +11:00
Maxime Coste
81eb2ee428 Do not strip whitespaces with '*'
Stripping whitespaces there is a failed experiment as it breaks the
ability to use multi-selections consistently: Using '*' followed by some
`N` to add following matches, we end up with mismatched selections
due to whitespace stripping the original selection still contains
whitespaces where all the new ones do not. Once we get to this state,
most selection commands will give different results for the initial
selection and the other ones, breaking predictible multiselection use,
one of the cornerstones of Kakoune editing model.
2018-01-31 09:31:18 +11:00
Maxime Coste
9c25e955df Use '/' register as the default register for <a-k> and <a-K>
Fixes #1808
2018-01-26 14:15:18 +11:00
Maxime Coste
220be30f02 Support multiline selections in C/<a-C>
Fixes #1725
2018-01-24 10:33:22 +11:00
Maxime Coste
55621fb4cc Do not save last command/pipe/regex in register when history is disabled 2018-01-19 09:48:57 +11:00
Maxime Coste
e74b581b0a Save/restore main selection from/to strings
Always consider that the first selection in the list is the main
one, save selections that way.

This approach was suggested by PR #1786 but the implementation here
is different, and is used more generally whenever we save selections
to strings.

This is also the prefered way to work only on the main selection:
save selections with Z, reduce to main with <space>, restore with z.

Closes #1786
Fixes #1750
2018-01-12 07:51:19 +11:00
Maxime Coste
6333ae207f Correctly set the NotBeginOfSubject/NotEndOfSubject flags for regex matching
Fixes #1778
2017-12-29 09:55:53 +11:00
Delapouite
b81c6b5840 Use existing window reference in view mode 2017-12-17 14:42:09 +01:00
Maxime Coste
99636c6230 Remove Vector returning split functions, use range adaptor
Do not allocate temporary vectors to store splitted data, use the
'split' range adaptor along with transform(unescape) to provide the
same feature with less allocations.
2017-12-06 17:18:44 +08:00
Maxime Coste
73a239d3be Text-Objects: Use regex to select surroundings
Fixes #925
2017-12-03 17:15:24 +08:00
Maxime Coste
413f880e9e Regex: Support forward and backward matching code in the same CompiledRegex
No need to have two separate regexes to handle forward and backward
matching, just passing RegexCompileFlags::Backward will add support
for backward matching to the regex. For backward only regex, pass
RegexCompileFlags::NoForward as well to disable generation of
forward matching code.
2017-12-01 19:57:02 +08:00
fsub
66ca53466f Remove unused lambda captures
This eliminates some warnings emitted by clang++.
2017-11-22 18:43:54 +01:00
Maxime Coste
706c1672d5 Normal: add <a-S> to select first and last char of selection
Fixes #550
2017-11-13 17:36:04 +08:00
Delapouite
a071e5b226 Add count support to jumps (<c-o> and <c-i>). Add jumps tests 2017-11-13 08:38:43 +01:00
Maxime Coste
04993de687 Fix pipe logic in the case where the selections were accessed in the cmdline
When using an env var that needed the selections in the pipe command line,
say $kak_selection, the selection update code would run, modifying the
selections to adapt to eventual changes. But the rest of the pipe logic
was assuming the selections would not change, leading to bugs.
2017-11-08 00:02:49 +08:00
Frank LENORMAND
8900690288 src: Don't save whitespace-led commands in the : register 2017-11-04 09:18:26 +03:00
Maxime Coste
1c95074657 Make use of custom regex backward searching support for reverse search 2017-11-01 14:05:14 +08:00
Maxime Coste
065bbc8f59 Regex: switch to custom impl, use boost for checking 2017-11-01 14:05:14 +08:00
Maxime Coste
6272847ace Prompt: display the fallback text everytime the prompt is empty 2017-10-31 12:54:21 +11:00
Maxime Coste
6d78b06405 Do not auto apply the fallback regex when in regex prompts
Fixes #1653
2017-10-30 18:58:47 +11:00
Maxime Coste
9a449a3344 Display the fallback value in prompts
Fixes #1654
2017-10-28 10:07:28 +08:00
Maxime Coste
d6cb10d693 Disable constexpr keymap as it breaks compilation with gcc 5 2017-10-20 19:12:21 +08:00
Maxime Coste
7c06667bdf Make the normal mode keymap a compile time hash map
This hash map is now fully constexpr, and ends up stored in the read
only data segment instead of being recomputed at each startup.
2017-10-20 12:21:22 +08:00
Maxime Coste
ddff35e5ab Move keymap as an implementation detail of the normal mode keys
Only expose a free function that tries to get the NormalCmd from a
key.
2017-10-20 12:21:22 +08:00
Delapouite
0e62518d89 Docs: add missing normal keys <c-[bfud]> 2017-10-04 12:47:56 +02:00
Maxime Coste
100be4b836 Merge remote-tracking branch 'Delapouite/runtime-error' 2017-09-28 10:39:44 +08:00
Delapouite
7224fe3840 Convert status info into proper runtime_errors 2017-09-27 17:53:52 +02:00
Delapouite
6b339b7a97 Add status info when navigating through jumplist (<c-o>, <c-i>) 2017-09-27 17:26:39 +02:00
Maxime Coste
626ccc09cc Merge remote-tracking branch 'Delapouite/next-history-id' 2017-09-23 13:18:58 +09:00
Maxime Coste
3a5bb051a8 Small code style tweak 2017-09-23 13:18:00 +09:00
Maxime Coste
002e77534f Merge remote-tracking branch 'occivink/quit-on-esc' 2017-09-23 13:13:51 +09:00
Delapouite
0b310b64ad Add count support for indent / deindent 2017-09-21 12:26:22 +02:00
Olivier Perret
a20ecf6b00 Use <esc> to exit on-key modes 2017-09-21 11:53:10 +02:00
Delapouite
b46c9ac630 Add max_history_id in status printed with <a-u> and <a-U> 2017-09-20 07:32:45 +02:00
Maxime Coste
a3644f49a3 Merge remote-tracking branch 'Delapouite/custom-text-object' 2017-09-18 10:05:51 +09:00
Delapouite
e52003049c Add count support for scroll keys (PageUp, PageDown, C-bfud) 2017-09-17 19:55:06 +02:00
Maxime Coste
ab6a999431 Rename containers.hh to ranges.hh (and Container to Range) 2017-08-29 15:23:03 +07:00
Maxime Coste
1709886873 avoid literal eol in status lines, replace them with another symbol 2017-08-29 10:01:43 +07:00
Maxime Coste
82d23bc400 Remove now trivial Selection::merge_with method 2017-08-18 08:52:40 +07:00
Maxime Coste
d3f438810e Fix main selection handling in keep pipe ($)
$kak_reg_hash will properly contain the current selection index when
executing the shell command, fixing its use.

Fixes #1503
2017-07-19 17:42:41 +02:00
Maxime Coste
580eae0388 | now applies the diff of the modification instead of plain replace
Fixes #312
Fixes #1501
2017-07-14 16:16:40 +09:00
Maxime Coste
26cc8b3ee0 Fix undo handling in <a-o>/<a-O> 2017-07-13 08:24:55 +09:00
Maxime Coste
74076ef9b7 Alternative, and hopefully safer implementation of <a-o>/<a-O>
Fixes #1495
2017-07-11 22:35:42 +09:00