Commit Graph

3120 Commits

Author SHA1 Message Date
Maxime Coste
9b4bd611ef Replace menu and info when they actually moved
Previous logic worked only when the buffer moved in the window, but
not if some highlighter (like line numbering or flag lines) moved
the text around.
2016-03-30 19:46:43 +01:00
Maxime Coste
5332378419 Fix spaces_to_tabs implementation accessing past end
Fixes #643
2016-03-30 19:27:36 +01:00
Maxime Coste
7dd05d675c RankedMatch constructor handles empty query just fine 2016-03-29 13:48:01 +01:00
Maxime Coste
94f4531bc8 Tweak subsequence_match_smart_case 2016-03-28 15:18:15 +01:00
Maxime Coste
2a9875bd58 Use manual lexicographic comparison in RankedMatch::operator< 2016-03-28 14:44:49 +01:00
Maxime Coste
75e9bbfa43 Uniquify candidates in -shell-candidates mode 2016-03-28 14:16:45 +01:00
Maxime Coste
1bd356473b Use UsedLetters for shell-candidates filtering 2016-03-25 20:38:27 +00:00
Maxime Coste
c756f8f124 Move UsedLetters with RankedMatch 2016-03-25 20:38:27 +00:00
Maxime Coste
d3ef2d36ea Add a SplitView container view 2016-03-25 20:38:26 +00:00
Maxime Coste
87704227ad Tweak implementation of subsequence_match_smart_case
Remove use of utf8 iterators and use directly utf8 functions
2016-03-24 23:45:56 +00:00
Maxime Coste
e5afacba70 Optimize split implementation, avoid growing strings char by char 2016-03-24 23:25:58 +00:00
Maxime Coste
7b52b00b94 Small code tweak 2016-03-24 22:15:11 +00:00
Maxime Coste
50a64a0544 Correctly handle temporaries in container views
Move temporaries into the view itself and keep a reference on
non temporaries
2016-03-24 22:14:18 +00:00
Maxime Coste
ccb53eca42 Fix uninitialized value in RankedMatch 2016-03-24 22:04:56 +00:00
Maxime Coste
840b7658fd Add an alternative -shell-candidates shell completion support
-shell-candidates use a shell script that returns all the candidates
and then sort them using Kakoune ranked matches system instead of
delegating the whole completion to the shell script (as shell-completion does)
2016-03-24 14:01:59 +00:00
Maxime Coste
b0d72ebce0 Support getting back to original prefix with tab/shift-tab in prompts
Fixes #124
2016-03-24 13:39:27 +00:00
Maxime Coste
b02883a112 Remove forced redraw in ncurses ui 2016-03-24 13:19:36 +00:00
Maxime Coste
1d646c03f5 Add completion support for alias/unalias commands 2016-03-24 00:05:40 +00:00
Maxime Coste
abd5afe012 Support mosue event in key_to_str 2016-03-23 13:39:52 +00:00
Maxime Coste
5bf9243006 User mappings and :exec are always executed in normal mode
Fix #551
2016-03-22 22:54:29 +00:00
Maxime Coste
38f146d849 Fix another bug in Buffer::replace implementation 2016-03-17 12:38:09 +00:00
Maxime Coste
d277ef6d6c Slight code tweaks in normal mode pipe function 2016-03-17 12:08:11 +00:00
Maxime Coste
c6ca3af9b4 Fix bug introduced in Buffer::do_insert 2016-03-17 12:07:20 +00:00
Maxime Coste
55ee6f970e Write the hook parameter in the debug buffer on error in hook 2016-03-17 11:45:22 +00:00
Maxime Coste
131b0a8298 Use ByteCoords directly for buffer insert/erase/replace 2016-03-16 13:59:30 +00:00
Maxime Coste
ad5da15cfa Use replace in Buffer unit test 2016-03-16 13:52:39 +00:00
Maxime Coste
de1433d30a Avoid the spurious newline insertion when replacing at end of buffer
Add a Buffer::replace method to handle the replacements properly
Fixes #633
2016-03-16 13:48:11 +00:00
Maxime Coste
c5b24e2a8a More cleanups in Buffer::do_insert 2016-03-16 13:22:11 +00:00
Maxime Coste
338462e94f Refactor Buffer::do_insert 2016-03-15 23:37:18 +00:00
Maxime Coste
d2dfb9ecb1 Slight cleanup in Buffer::do_insert 2016-03-15 23:15:57 +00:00
Maxime Coste
5fe2872904 Reset line editor display pos when the text is reset 2016-03-15 13:55:01 +00:00
Maxime Coste
e82c3410a5 Redisplay prompt on Prompt mode enabled
Fixes #603
2016-03-15 13:51:47 +00:00
Maxime Coste
6739c5047e Support an optional column param with the +<line>[:<column>] syntax 2016-03-15 13:21:28 +00:00
Maxime Coste
b014093c97 Quit on SIGINT when using a DummyUI 2016-03-15 00:24:42 +00:00
Maxime Coste
dca9bccc6a Disable key mapping handling when executing a user mapping
Fixes #629
2016-03-14 20:58:55 +00:00
Maxime Coste
b53f1271a2 Support ~/ in insert mode filename completion 2016-03-14 13:59:54 +00:00
Maxime Coste
7ecd65e1af Code cleanups 2016-03-14 13:41:20 +00:00
Maxime Coste
3a699c8ac3 Include tweak 2016-03-14 13:41:20 +00:00
Maxime Coste
06c1c5f28b Do not include the debug buffer in word completion 2016-03-12 16:44:55 +00:00
Maxime Coste
92f96f9455 Change custom object syntax, use a single prompt
Take a description of the object, in <open>,<close> format
2016-03-11 00:14:42 +00:00
Maxime Coste
428b18c0c1 Formatting fix 2016-03-11 00:09:13 +00:00
Robert J. Ennis
7f648bcd06 Update Makefile for OSX build with homebrew ncurses
This adds compilation flags to include the homebrew installed ncurses 6.0 library during compilation.
2016-03-10 15:07:50 +01:00
Maxime Coste
517abf5e74 Redisplay info when menu appears so that info adapts its position 2016-03-09 23:28:23 +00:00
Maxime Coste
99ca7ead37 Only select a completion when the menu was visible (or its the only one) 2016-03-09 23:24:20 +00:00
Maxime Coste
90d446b2f4 It can happen during an undo/redo that the buffer be temporarily empty
Fix is_end in that case.
2016-03-09 23:16:14 +00:00
Maxime Coste
84a1796a48 Try to please gcc 4.8 with parenthesis instead of curly braces 2016-03-08 23:36:54 +00:00
Maxime Coste
eea75c6daf Add missing curly braces in containers helpers 2016-03-08 23:22:32 +00:00
Maxime Coste
9e15181dc9 Rework container helpers, use pipe syntax and cleanup implementation
use 'container | filter(func) | reverse() | transform(func)' instead
of 'transform(reverse(filter(container), func), func)' to express
container transformations.
2016-03-08 21:35:56 +00:00
Maxime Coste
21ae662151 Use ranked match based completion for command names 2016-03-08 13:56:37 +00:00
Maxime Coste
3cbc0d0b39 Force redraw everything, not just refresh 2016-03-08 13:42:00 +00:00
Maxime Coste
23f52d591c Support parsing booleans in json 2016-03-08 00:28:53 +00:00
Maxime Coste
6f78c7f910 Fix handling of bool when writing json 2016-03-07 23:14:28 +00:00
Maxime Coste
6c8f8fe691 Rework client redrawing, delay menu/info methods until next refresh
That avoid sending lots of spurious info_hide/menu_hide, just set
a flag and wait until the client is asked to redraw.
2016-03-07 23:11:59 +00:00
Maxime Coste
a15cdeae6e Fix json escaping of strings 2016-03-07 22:38:37 +00:00
Maxime Coste
2626ce858f Move <c-l> handling to normal mode from client
Client handling prevents :exec from triggering a redraw
2016-03-07 22:14:03 +00:00
Maxime Coste
4d4f18a78a Select ui at launch through the -ui <ui_name> switch 2016-03-07 21:44:50 +00:00
Maxime Coste
f1fb2114da Handle <c-l> redrawing on the server side
That way we can force a redraw at any moment, including during
batch execution.
2016-03-07 21:44:50 +00:00
Maxime Coste
b832a61193 Cleanup JsonUI and add support for a resize method 2016-03-07 21:44:50 +00:00
Maxime Coste
433940485f Initial, WIP json ui implementation
The JsonUI writes json rpc user interface commands on stdout and
reads json rpc requests on stdin.
2016-03-07 21:44:50 +00:00
Maxime Coste
52525a156f Remove complete_prefix option and behaviour
Now that we use subsequence based completion almost everywhere,
completing the common prefix does not make sense anymore.
2016-03-07 20:17:41 +00:00
Maxime Coste
cdbd81523a Fix Value constructor, we never want to create reference values 2016-03-06 15:12:36 +00:00
Maxime Coste
fb2fb3811f Tweak useage of skip_while and move the functions in utils.hh 2016-03-06 15:12:36 +00:00
Maxime Coste
72b6340b35 Only call UserInterface::refresh when the UI has been modified 2016-03-06 15:12:36 +00:00
Maxime Coste
134be9a1f6 Just write to stderr when exceptions are uncaught 2016-03-03 14:05:07 +00:00
Maxime Coste
b5b5b82c70 destroy buffer manager first but clear clients before destroying buffers.
Fixes #612
2016-03-03 14:05:07 +00:00
Maxime Coste
67849f2db7 BufferManager should outlive ClientManager in the end
If not, clients end up keeping references on a buffer while
it it being deleted.
2016-03-02 20:27:47 +00:00
Maxime Coste
2df7b1f6da In buffer name completion, give priority to filename (not dirname) matches
First list filename matches, then full path matches to allow fast selection
of buffers in deep hierarchies where queries match the path of every buffers
2016-03-02 13:51:50 +00:00
Maxime Coste
6d5900af16 Use RankedMatch for filename based completion (file and command completion) 2016-03-02 13:51:16 +00:00
Maxime Coste
1fd7e80f04 Rename prefix to query in complete helper function and tweak static_assert 2016-03-02 13:33:11 +00:00
Maxime Coste
761d316af6 Tweak RankedMatch ordering, give priority to prefix matches 2016-03-02 13:30:54 +00:00
Maxime Coste
72dc8e6774 Ensure ClientManager is always outliving the BufferManager 2016-03-02 13:30:11 +00:00
Maxime Coste
068ca08b4c Use the general code path for reload info box handling in Client 2016-03-02 13:14:21 +00:00
Maxime Coste
13d039c228 Ensure the BufferManager is destroyed first so that buffer hooks can access other managers
Fixes #612
2016-03-02 13:12:14 +00:00
Maxime Coste
7906704e3b Remove code that should not have been commited 2016-02-29 22:16:59 +00:00
Maxime Coste
2214421df5 Use a StringView in notify_fatal_error 2016-02-29 22:15:36 +00:00
Maxime Coste
92b56cbda0 Avoid a gcc warning in enum option_to_string impl 2016-02-29 20:15:23 +00:00
Maxime Coste
b0e12f2bcb Add <C-d> and <C-u> for scroll down/up half a page
Fixes #606
2016-02-29 14:00:09 +00:00
Maxime Coste
1138264a83 Notify when searching for next match wraps around buffer
Fixes #215
2016-02-29 13:50:18 +00:00
Maxime Coste
9b70346a00 Take subsequence matches index when sorting RankedMatch 2016-02-28 23:05:51 +00:00
Maxime Coste
548e10597c Code cleanup 2016-02-28 18:30:35 +00:00
Maxime Coste
3987463e75 Remove direct access to ui, go through client
Client can now update menu/info positions when the window move
around.
2016-02-27 17:23:13 +00:00
Maxime Coste
f0edf40543 Slight refactor in ncurses_ui, group info and menu data in structs 2016-02-27 17:22:31 +00:00
Maxime Coste
53821be7cc Tweak RankedMatch::operator< 2016-02-22 23:07:29 +00:00
Maxime Coste
ab20e2e5eb Merge remote-tracking branch 'lenormf/manpage' 2016-02-18 19:24:22 +00:00
Frank LENORMAND
d317448407 Disable interactive mode when moving documentation manpages 2016-02-18 14:53:14 +02:00
Maxime Coste
fbb326173a Tweak utils.hh, remove unused index sequence 2016-02-18 09:53:01 +00:00
Maxime Coste
47df1374fe Refactor use selection as search pattern implementation 2016-02-17 23:40:14 +00:00
Maxime Coste
85a8a0c26d Fix count_word_boundaries_match 2016-02-17 23:05:08 +00:00
Maxime Coste
c9f01e2168 Hide info box when selecting empty insert completion 2016-02-17 23:03:22 +00:00
Frank LENORMAND
e74878c299 Cleanup/fix some code 2016-02-17 16:09:34 +02:00
Frank LENORMAND
ac08a1fa75 Format the options' documentation properly 2016-02-17 16:02:05 +02:00
Frank LENORMAND
f408cf7ed3 Allow users to chose how the buffers are padded 2016-02-17 15:48:09 +02:00
Maxime Coste
8bd3395d4d Do not allow / in highlighter names as it is used for hierachies
/ are replaced with <slash> in the highlighter names.
Fixes #553
2016-02-13 12:59:27 +00:00
Maxime Coste
318f1ae781 Give more precise titles to assistant for object and next char selection
Fixes #584
2016-02-13 11:38:24 +00:00
Maxime Coste
6f65f4b3a5 Fix face completion, avoid a spurious temporary 2016-02-12 19:14:06 +00:00
Maxime Coste
0fc0702983 indentwidth can actually take 0 as a parameter 2016-02-12 13:53:54 +00:00
Maxime Coste
dfe3098b18 Fix buffer deletion logic
'eval -buffer * db' was failing in certain cases
2016-02-11 23:07:42 +00:00
Maxime Coste
b365ee3bc3 Merge remote-tracking branch 'jjthrash/osx-asciidoc-fixes' 2016-02-11 22:09:52 +00:00
Maxime Coste
986c91a835 Support validating some options values before setting them
Fixes #583
2016-02-11 22:07:18 +00:00
Jimmy Thrasher
3485de717e Remove A2X variable from Makefile since it doesn't fix the OSX homebrew problem
Per suggestion by @lenormf
2016-02-11 13:26:11 -05:00