Commit Graph

4305 Commits

Author SHA1 Message Date
Maxime Coste
1cdeace128 Merge remote-tracking branch 'Delapouite/doc-commands' 2018-03-21 06:42:31 +11:00
Maxime Coste
5c1a5c6d15 Revert "Throw when trying to remove a child highlighter that does not exists"
This reverts commit 56237aa8f8.

Throwing seems more correct, but it breaks lots of existing scripts.
reverting for now until we have a nice solution.
2018-03-20 20:11:15 +11:00
Delapouite
00cb49438a Docs: add missing [<switches>] in commands signatures 2018-03-20 09:13:09 +01:00
Maxime Coste
bec849ae14 Tolerate empty filenames in real_path 2018-03-20 05:56:20 +11:00
Maxime Coste
f7f84b7402 NCursesUI: Rework menu_show to shrink menu height when needed
Closes #1886
2018-03-20 05:54:19 +11:00
Maxime Coste
826977eb1b Fix remove of highlighters with trailing / in their name
Fixes #1914
2018-03-20 05:35:37 +11:00
Maxime Coste
56237aa8f8 Throw when trying to remove a child highlighter that does not exists 2018-03-20 05:35:15 +11:00
Maxime Coste
b27d4afa8d Regex: Only allow SyntaxCharacter and - to be escaped in a character class
Letting any character to be escaped is error prone as it looks like
\l could mean [:lower:] (as it used to with boost) when it only means
literal l.

Fix the haskell.kak file as well.

Fixes #1945
2018-03-20 04:57:47 +11:00
Maxime Coste
6e695e37be Fix real_path again 2018-03-19 20:49:05 +11:00
Maxime Coste
6d8747b886 Fix introduced bug in real_path 2018-03-19 06:28:06 +11:00
Maxime Coste
9518f279fb Tweak option documentation helper to support -add
Fixes #1939
2018-03-19 03:04:50 +11:00
Maxime Coste
8a7e844207 NCursesUI: refactor info_show code
Show MenuDoc info on the left of the menu if necessary. Cleanup the
code.
2018-03-19 01:23:32 +11:00
Maxime Coste
cf37623f1a Refactor read_fd '\r' removal logic 2018-03-18 23:43:18 +11:00
Maxime Coste
ac91a79b12 Fix implementation of real_path to handle non-existing directories in /
Fixes #1937
2018-03-18 23:23:00 +11:00
Maxime Coste
7ba4ef897b Fix crash on expanding command line strings 2018-03-18 04:58:15 +11:00
Maxime Coste
0a2807e652 RangesHighlighter: a range that goes up to buffer end is not valid 2018-03-16 23:25:37 +11:00
Maxime Coste
08df409a53 RankedMatch: Do not compare word boundary match count on single word matches
As the computation of word boundary matches is separate from the
actual subsequence matching, we sometimes have candidate that match
as a single word while still having multiple word boundary matches.

For example, with query "expresins", candidate "expressionism's"
will match as single word ("expressins" is a subsequence of
"expressionism"), and will have two word boundaries match (it does
match the last "s", which is considered as a separate word).

This should not be taken into account when compared against
candidate "expresions", which should be considered a better
match.

Fixes #1925
2018-03-15 23:20:03 +11:00
Maxime Coste
6f2b093eec NCursesUI: Show full menu rather than triming to respect anchor 2018-03-13 15:18:06 +11:00
Maxime Coste
a480e566dc ranges: Add transform overload taking directly a pointer to member
This overload will forward to the general transform implementation
using std::mem_fn to generate a callable.
2018-03-13 14:24:03 +11:00
Maxime Coste
c82bf31378 NCursesUI: Use accumulate algorithm to gather the longest element in menu 2018-03-13 14:14:16 +11:00
Maxime Coste
bfaf52f8c0 Do not jump to buffer start on g. with no previous modifications 2018-03-13 14:00:57 +11:00
Delapouite
d5d23834f6 Handle hyphens in user-mode names
Fix #1921
2018-03-11 14:58:53 +01:00
Maxime Coste
e66073bc94 Detect infinit recursion in reference highlighting
Reference highlighters allow for potential mutual recursion between
highlighters. This is usually fine, but if the recursion happens on
the same buffer range, it means we will recurse infinitely.

Fixes #1920
2018-03-11 11:44:10 +11:00
Maxime Coste
4584ecac77 Move WORD text object to <a-w>
It improves consistency and it looked like there was support for that
change on github.
Fixes #1861
2018-03-10 00:25:19 +11:00
Maxime Coste
f801d0064a Merge remote-tracking branch 'Delapouite/hls' 2018-03-10 00:07:03 +11:00
Maxime Coste
9125b01fa8 Detect no-op replaces and do not act on them
This avoids recording no-op undo groups.
2018-03-09 23:07:05 +11:00
Delapouite
abc2d28570 Docs: extend explanations about line_flags, ranges and replace-ranges 2018-03-06 12:15:55 +01:00
Maxime Coste
9c85d9b389 Support changing autoreload option directly from the reload message
Pressing Y or N will set the buffer (or window, if it is set at that
scope) autoreload option to the corresponding value, avoiding infinite
loops where a file getting constantly modified prevents the user from
using Kakoune.
2018-03-05 11:17:57 +11:00
Maxime Coste
07113e7ee5 Add a GlobalSetOption hook 2018-03-05 10:39:14 +11:00
Maxime Coste
642b711d94 Merge remote-tracking branch 'Delapouite/scratch' 2018-03-05 07:10:57 +11:00
Maxime Coste
fb65fa60f8 Regex: take the full subject range as a parameter
To allow more general look arounds out of the actual search range,
pass a second range (the actual subject). This allows us to remove
various flags such as PrevAvailable or NotBeginOfSubject, which are
now easy to check from the subject range.

Fixes #1902
2018-03-05 05:48:10 +11:00
Maxime Coste
d9e44dfacf Regex: Remove helper functions from regex_impl.hh
They were close duplicates from the ones in regex.hh and not used
anywhere else.
2018-03-05 03:10:47 +11:00
Maxime Coste
6c4faf2050 Merge remote-tracking branch 'fsub/unused-lambda-capture' 2018-03-05 00:39:56 +11:00
Maxime Coste
a2fc89a6ec Remove SelectionList::update_timestamp()
This single line member function was only used once, inline it
directly.
2018-03-04 10:35:24 +11:00
Maxime Coste
2fd42fe5fc Insert: Do not move end of line on open line (o/O)
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-03-04 10:32:21 +11:00
fsub
44d381ce79 Remove unused lambda capture 2018-03-03 17:57:51 +01:00
Delapouite
c4eb4438d2 Remove <scope> from user-modes commands 2018-03-02 09:28:27 +01:00
Maxime Coste
7a54c0edfe Update status message with new breaking changes 2018-03-01 15:36:25 +11:00
Maxime Coste
28716ec058 Change x behaviour to select full line first even if on EOL
x will always first select current line fully, and only then select
next line.
2018-03-01 15:34:31 +11:00
Maxime Coste
f907e6cc46 Reintroduce complex selection merging behaviour
Selection merging is necessary if we want X to work nicely when we are
on EOL (jumping to next line is as nice as it could be, and we are much
more often on EOL nowadays).
2018-03-01 15:21:55 +11:00
Maxime Coste
7dfd439263 Merge remote-tracking branch 'Delapouite/user-mode-lock' 2018-03-01 14:04:52 +11:00
Maxime Coste
2193947b71 InsertCompleter: refactor line completer implementation 2018-02-28 15:40:42 +11:00
Maxime Coste
4e6b24eea2 Merge remote-tracking branch 'Delapouite/line_complete' 2018-02-28 15:32:31 +11:00
Maxime Coste
44a5082aaf Commands: Refactor generate_switches_doc 2018-02-28 15:32:11 +11:00
Maxime Coste
a6fd70c456 Ranges: Fix copiability of some range view iterators
Some iterators were refering to to their view with a const ref, this
was making them non-copiable. Change those const ref into const pointers
in order to fix that.
2018-02-28 15:16:49 +11:00
Maxime Coste
edee85a847 Merge remote-tracking branch 'aver-d/option_display' 2018-02-28 15:09:26 +11:00
Maxime Coste
d498a059c4 Prompt: update completions after inserting register or raw ke 2018-02-28 15:05:38 +11:00
Maxime Coste
bebc81ebe1 RefPtr: use inconditional noexcept specification on destructor
The conditional specification could end up being recursive,
assume destructors must be (as is the C++ default) noexcept.
2018-02-28 15:04:00 +11:00
Delapouite
a6a1c34288 Add -lock switch to enter-user-mode command 2018-02-27 19:55:00 +01:00
Delapouite
0568836943 Add support for line completion in all buffers
- via completers option with line=all vs line=buffer
- via <c-x> L mapping
2018-02-27 09:48:49 +01:00