Commit Graph

3567 Commits

Author SHA1 Message Date
Maxime Coste
bb688cf42d Do not throw when recursive hook calls are detected
Running hooks is non critical, and should never `fail` as far as
caller is concerned.
2016-07-11 19:44:29 +01:00
Maxime Coste
530ecf212e Ensure buffer create/close hooks are run at appropriate times
They used to be ran before the buffer was added to the buffer list
we now run them afterwards.
2016-07-10 16:34:16 +01:00
Maxime Coste
88a9607552 Keep modified selections in non-draft exec/eval -itersel
Fixes #727
2016-07-08 09:52:10 +01:00
Maxime Coste
439f168928 Use named keys for Return and Tab instead of <c-m> and <c-i>
Fixes #722
2016-07-05 20:08:13 +01:00
Maxime Coste
8270f9299f Improve robustness of json parsing and execution
Fixes #720
2016-07-04 19:31:09 +01:00
Maxime Coste
469eb6ec44 Avoid possible access to an invalid, being deleted buffer list. 2016-07-04 19:20:22 +01:00
Maxime Coste
ca7f647562 Refactor Optional::operator== 2016-07-04 19:19:40 +01:00
Maxime Coste
e262dc1257 Support Resize modifiers in key_to_str
As seen in #715, that was not supported correctly
2016-06-30 23:49:21 +01:00
Maxime Coste
c8f5204202 Try to make the json ui more tolerant with the json input
Should improve the issues raised #714
2016-06-29 21:08:16 +01:00
Maxime Coste
511367f977 Change end of line format detection logic to match vims
Only consider a buffer to be Crlf if *all* of its lines use it, else
consider it as Lf with embedded Cr chars.

Fixes #686
2016-06-28 20:46:20 +01:00
Frank LENORMAND
eca7850203 Fix a warning about the forward declaration of SelectionList 2016-06-27 20:59:46 +01:00
Maxime Coste
e07ff0c669 Use tparm instead of tiparm as built in OSX ncurses does not support it 2016-06-27 20:59:02 +01:00
Maxime Coste
089eaa52e0 Detect recursive hook run and abort in that case
Fixes #709
2016-06-27 20:55:07 +01:00
Maxime Coste
fcf73c2293 Refactor context_wrap to share more code between draft/non draft case
Fixes #706
2016-06-22 22:27:43 +01:00
Maxime Coste
a8cf2a84c4 Add an Optional::emplace method 2016-06-22 22:17:13 +01:00
Maxime Coste
5cb9cf4cc3 Go back to saving built-in registers by default in non draft :exec/:eval 2016-06-22 19:57:21 +01:00
Maxime Coste
532ae5a1a6 Do not go backward to when selecting to end of line from the end of line
Fixes #699
2016-06-22 19:56:40 +01:00
Maxime Coste
c032306e04 Merge remote-tracking branch 'doppioandante/fix-json' 2016-06-21 23:51:15 +01:00
Maxime Coste
b77eff1b72 Fix parameter order in fputs 2016-06-21 00:47:46 +01:00
Maxime Coste
2edea2e0f6 Use fputs and fflush in ncurses_ui direct stdout access to respect buffering
Ncurses will write using the FILE* interface, using the fd based one is error
prone.

Fixes #703
2016-06-20 23:43:21 +01:00
Maxime Coste
91bf0d4622 Make window scope available to draft contexts
We do want window options/aliases/keymaps/hooks to be available in
draft context, dont we ?

Fixes #702
2016-06-20 19:45:15 +01:00
Maxime Coste
fef37e6a92 Do not preserve registers by default when exec/eval in a non draft context
Fixes #700
2016-06-20 19:40:49 +01:00
Enrico Lumetti
97680827b8 Fix JSON integer parsing 2016-06-20 16:59:32 +02:00
Maxime Coste
471c75d738 Trim trailing end of lines in %sh outputs
Fixes #698
2016-06-19 17:01:56 +01:00
Maxime Coste
b8908f2dc6 Add a String::resize method 2016-06-19 17:01:27 +01:00
Maxime Coste
f2ba54b2d4 Keep prompt displayed on <c-r> and <c-v> in prompt mode 2016-06-18 11:07:18 +01:00
Maxime Coste
34c8e6a9cf Clear up info/menus and eventual prompts when reseting to normal mode
Fixes #697
2016-06-16 19:35:43 +01:00
Maxime Coste
04d24b22bd Fix parsing of empty json objects/arrays and recover parse errors
Fixes #694
2016-06-11 13:42:25 +01:00
Maxime Coste
3059b3a253 Extract ui type parsing to its own function 2016-06-11 13:22:24 +01:00
Maxime Coste
c73e64882c Check session valididty on kak -l and support kak -clear for clearing the dead ones
Fixes #689
2016-06-06 19:28:56 +01:00
Maxime Coste
e2bfd9e3b2 Diagnose empty selection desc string
Fixes #690
2016-06-06 17:17:18 +01:00
Maxime Coste
5cab2078f8 Fix string view created from a temporary string
This is clearly a case where rust style lifetime analysis would
have been nice, hopefully it comes with GSL lifetime extensions...

Fixes #680
2016-05-24 22:36:20 +01:00
Maxime Coste
fa35330b42 Fix RankedMatch ordering where 'a < a' was true
Fixes #679
2016-05-20 18:42:01 +01:00
Maxime Coste
7280525672 Dont overwrite registers with empty macros
Fixes #674
2016-05-20 09:44:05 +01:00
Maxime Coste
6181781f3d Change dir to $HOME when no parameters are given to cd
Fixes #678
2016-05-20 09:41:29 +01:00
Maxime Coste
365887539b Reject '//' as a file completion prefix to avoid cygwin network hosts listing 2016-05-19 21:46:27 +01:00
Maxime Coste
1834a67b87 Go back to libc locale and use c_regex_traits
Unfortunately, cygwin does not support c++ locales.
2016-05-19 21:45:23 +01:00
Maxime Coste
e1703204f8 fix bug in utf8_iterator 2016-05-19 20:20:42 +01:00
Maxime Coste
fb01c8c377 Do not force recreate scratch buffers by default, require edit! for that 2016-05-17 19:41:24 +01:00
Maxime Coste
49e674fe55 Fix RankedMatch::operator< with matching prefix candidates 2016-05-17 19:40:36 +01:00
Maxime Coste
f51ba6089c Use variadic macros for kak_assert to remove the need for COMMA 2016-05-17 19:39:55 +01:00
Maxime Coste
3b6d6956e2 We do need a force redraw on resize for menu, info and status bar 2016-05-16 10:23:47 +01:00
Maxime Coste
8c6849bb04 Make HookManager safe counted 2016-05-15 10:37:42 +01:00
Maxime Coste
baf219ee2f Fix duplicate buffer problem, fix real_path beahviour 2016-05-15 10:37:01 +01:00
Maxime Coste
1788126f38 BufferManager now owns the Buffers instead of registering them 2016-05-14 08:33:50 +01:00
Maxime Coste
ba421e45f7 Delay window deletion until we get back to main loop
Avoid WinResize hooks while redrawing, ensure window resize only
take place while handling user input.

Fixes #672
2016-05-14 08:17:52 +01:00
Maxime Coste
4c8089009d Tolerate failure in setting current locale 2016-05-12 00:00:03 +01:00
Maxime Coste
84f62e6ff2 Use C++ locale based functions instead of the libc ones 2016-05-11 09:49:45 +01:00
Maxime Coste
6b1bd84e8e Allow access to end of line with horizontal moves (h and l)
Lets enable that for some time, get some feedback on that behaviour
change, and see if we keep it.
2016-05-11 00:03:45 +01:00
Maxime Coste
dd41a46c4c Correctly set c++ locale on startup
Fixes #595
2016-05-10 22:06:02 +01:00
Maxime Coste
abac6a9436 Use boost::wregex implementation and manually utf8 decode into it
That way we get proper unicode support in regular expressions as long
as the current locale treats wchar_t as unicode codepoints.

Fixes #638
Fixes #595
Fixes #162
2016-05-10 09:38:21 +01:00
Maxime Coste
bff9d45bdb Make utf8_iterator codepoint type and difference type configurable 2016-05-09 21:56:08 +01:00
Maxime Coste
e3cddf3783 Fix use of potentially null local_client
Fixes #667
2016-05-09 13:56:15 +01:00
Maxime Coste
d3aff03062 Keep a pointer to current client in windows so that window hooks can access it 2016-05-09 13:48:48 +01:00
Maxime Coste
457e11bdc9 time window display buffer update in debug profile mode 2016-05-06 00:24:54 +01:00
Maxime Coste
a132eb6b5b Expose a WinResize hook when a window changes size
Fixes #661
2016-05-04 23:27:28 +01:00
Maxime Coste
d4e9f30e5f Merge branch 'master' of git://github.com/pierroelmito/kakoune 2016-05-04 23:20:49 +01:00
pierroelmito
3044eff356 fix whitespace label
The author of this work hereby waives all claim of copyright (economic and moral) in this work and immediately places it in the public domain; it may be used, distorted or destroyed in any manner whatsoever without further attribution or notice to the creator
2016-04-30 11:59:53 +02:00
Maxime Coste
25a31534ec Fix splitting selecting the first buffer char when there is a match at buffer begin 2016-04-30 10:37:31 +01:00
pierroelmito
d4b8e28d0a add face to change whitespace colors 2016-04-30 10:35:25 +02:00
Maxime Coste
da40828801 Check all buffer are saved in :kill, and add :kill! to avoid that 2016-04-29 21:58:04 +01:00
Maxime Coste
61c155fc40 Fix wrap_lines 2016-04-27 13:55:32 +01:00
Maxime Coste
75d22a8da7 Add another missing include in shell_manager.cc 2016-04-27 09:46:53 +01:00
Maxime Coste
cf142872dc Add missing include in file.cc 2016-04-27 09:46:53 +01:00
Maxime Coste
e01a658cea Make use of strongly typed number to size_t conversion 2016-04-27 09:46:53 +01:00
Maxime Coste
717e37f2f3 Add checked, explicit conversion from strongly typed number for size_t 2016-04-27 09:46:53 +01:00
Maxime Coste
21644d17d6 Fix comparison operators in utf8_iterator and tag it as bidirectional 2016-04-27 09:46:53 +01:00
Maxime Coste
e4b9e30b31 Fix missing include in json_ui.cc 2016-04-21 20:46:41 +01:00
Maxime Coste
de033d2915 Allow equality comparison between buffer iterators from differnt buffers 2016-04-21 20:42:23 +01:00
Maxime Coste
a22b1b6bc8 Fix BufferIterator::difference_type, it should be signed 2016-04-21 20:42:16 +01:00
Maxime Coste
66a40a37cd prompt: zero password memory after running the command to be slightly more secure 2016-04-20 13:31:34 +01:00
Maxime Coste
199ccb4021 Add a -password switch to :prompt to allow for more secure password entering
Fixes #660
2016-04-19 09:51:09 +01:00
Maxime Coste
2435949fae Add support for env var name completion
Fixes #659
2016-04-17 19:21:43 +01:00
Maxime Coste
e784db4ad6 Use common completion system for OptionManager::complete_option_name 2016-04-17 19:21:08 +01:00
Maxime Coste
013519b3cb Remove iterator based regex constructor 2016-04-16 21:41:04 +01:00
Maxime Coste
f877c388fe Fix mistake in input_handler.cc 2016-04-13 23:50:49 +01:00
Maxime Coste
7833b53272 Fix support for macro being recorded and replay during :exec (non draft) 2016-04-13 21:21:49 +01:00
Maxime Coste
b0060ed79e Fix modified range computation when erasing multiple times past current buffer end
Fixes #654
2016-04-13 21:21:00 +01:00
Maxime Coste
d1b693270e ShellManager: do not open child stdin if there is no data to write to it
Fixes #383
2016-04-12 13:41:21 +01:00
Maxime Coste
a2d426abba Use padding face on the whole line 2016-04-11 21:12:27 +01:00
Maxime Coste
064e965500 Remove padding control options from ncurses ui 2016-04-11 13:54:47 +01:00
Maxime Coste
815924e4da Merge remote-tracking branch 'lenormf/buffer-padding' 2016-04-11 13:44:10 +01:00
Maxime Coste
d4b1138e2f Use a specific startup_error exception type to get a nicer message
Fixes #424
2016-04-09 09:13:35 +01:00
Maxime Coste
c51ca6b3fa Fix is_word ambiguous overload 2016-04-09 07:57:55 +01:00
Maxime Coste
c768ff9b6f Small style tweak, we know buffer begin coord is always {0,0} 2016-04-09 01:08:38 +01:00
Maxime Coste
a12475d88c Merge branch 'expose-cursor-byte-offset' of git://github.com/pauldub/kakoune 2016-04-09 01:05:18 +01:00
Maxime Coste
0a863c21e4 fix word completion taking the words being edited as candidates 2016-04-09 01:03:24 +01:00
Maxime Coste
a36ee22760 Pass the selection list to insert mode completer functions 2016-04-09 01:03:24 +01:00
Paul d'Hubert
eb8ad56c87 expose cursor_byte_offset env variable
Update README.asciidoc
2016-04-08 13:29:31 +02:00
Maxime Coste
3eca90f2b1 Only offer directories when completing :cd arguments
Refactor code in file.cc, avoid many double stat when searching
commands

Fixes #646
2016-04-07 22:47:41 +01:00
Maxime Coste
989d64abd4 Tweak RankedMatch behaviour 2016-04-04 13:42:58 +01:00
Maxime Coste
0478a8f11a Give priority to lower case in RankedMatch 2016-04-04 13:42:58 +01:00
Maxime Coste
ab5daeb365 Refactor wrap_lines and add some unit tests 2016-04-04 13:42:58 +01:00
Maxime Coste
15e82518d3 Tweak categorize(Codepoint) implementation 2016-04-04 13:42:58 +01:00
Maxime Coste
b5a68307ba Use a specific option type completions for insert completion
Fix escaping in jedi.kak as well
2016-04-04 13:42:58 +01:00
Maxime Coste
d1732673ce Document the null register 2016-03-31 09:21:09 +01:00
Maxime Coste
8badcdc0d5 Make DynamicRegister statically dispatch to its function 2016-03-31 09:17:02 +01:00
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
Jimmy Thrasher
311d7852a6 Convert GNU sed extension into more general expression to work with BSD/OSX 2016-02-11 08:50:33 -05:00
Jimmy Thrasher
4c355488aa Turn off xmllint for a2x.py
The docbook DTD is not locally available in OSX, and the a2x.py
command calls xmllint with `--nonet` so it can't fetch the DTD.
Easier to just turn off linting.
2016-02-11 08:50:06 -05:00
Maxime Coste
8701a53252 Fix use of dead temporary strings in completions 2016-02-10 13:33:49 +00:00
Maxime Coste
8d37a716fb Use a custom SSO aware string backend 2016-02-10 09:44:42 +00:00
Maxime Coste
87769c9b03 Migrate most completion to ranked match 2016-02-09 22:50:10 +00:00
Maxime Coste
c8dedf458d Use the ranked word completion logic for buffer name completion 2016-02-09 20:04:23 +00:00
Maxime Coste
3030775414 Cleanup doc manpages generation 2016-02-06 00:01:42 +00:00
Maxime Coste
51c9a1563a Merge remote-tracking branch 'lenormf/manpage' 2016-02-05 09:39:40 +00:00
Maxime Coste
263ef0b149 Get rid of SharedString 2016-02-05 09:38:33 +00:00
Maxime Coste
94cbd5a837 More string usage cleanup 2016-02-05 09:13:07 +00:00
Maxime Coste
ff6eacffa3 dont intern SharedStrings but StringDataPtr 2016-02-05 00:20:45 +00:00
Maxime Coste
a8eddd03f0 String usage cleanups 2016-02-04 23:54:22 +00:00
Frank LENORMAND
8d0988d541 Prevent unconditional generation of the man pages, fix the executable name for a2x on Mac OS X 2016-02-04 15:10:04 +02:00
Frank LENORMAND
eb62327a4c Rename the man page to kak 2016-02-04 12:58:59 +02:00
Frank LENORMAND
9d6d2b767f Properly install the man page when using a custom prefix 2016-02-04 11:58:18 +02:00
Frank LENORMAND
80f7a350e4 Fix the installation of documentation pages 2016-02-04 11:46:12 +02:00
Maxime Coste
eb99c0f39e Merge remote-tracking branch 'occivink/master' 2016-02-04 09:30:25 +00:00
O. Perret
92ddbac1e8 Adapt 'make install' to rc/ reorganization 2016-02-03 23:31:35 +01:00
Maxime Coste
b59714bf2a Merge remote-tracking branch 'lenormf/manpage' 2016-02-03 22:16:40 +00:00
Frank LENORMAND
985b7a188a Generate the documentation pages in the troff format
This commit introduces the `doc` target in the Makefile, which
generates man pages from the `asciidoc`-formatted documentation in the
`doc/manpages` directory.

Before being installed into the `$(sharedir)/doc` directory, the
generated raw man pages have to be striped of a few sections without
which `a2x` won't convert the `asciidoc` data: the shady block of shell
script in the `doc` target does just that, along with compressing the
resulting man page.

New dependency hereby introduced: `asciidoc`.
2016-02-03 21:09:41 +02:00
Frank LENORMAND
b6e930a57d Migrate the raw troff kakoune man page to the asciidoc format 2016-02-03 14:51:32 +02:00
Maxime Coste
dc3c7d593c Do not use a hash to determine if a window must be redrawn
Collision happens
Fixes #569
2016-02-03 09:51:56 +00:00
Frank LENORMAND
043f742ec3 Add a basic man page 2016-02-02 21:13:25 +02:00
Maxime Coste
f2dac6ca15 Small cleanup 2016-01-28 20:29:10 +00:00
Maxime Coste
f3ec218a1c Support user given text objects 2016-01-28 19:30:34 +00:00
Maxime Coste
b7530b021a StringView based surround selection 2016-01-27 19:36:31 +00:00
Maxime Coste
f8106690b1 Make BufferIterator::operator* return a const ref to be more compatible 2016-01-27 08:27:23 +00:00
Maxime Coste
04119d6207 Make find_surrounding more reusable and add unit tests 2016-01-26 07:23:18 +00:00
Maxime Coste
99b4dc9929 Support connecting to other users sessions by using <user>/<session> 2016-01-20 22:58:39 +00:00
Frank LENORMAND
ffde7e4787 Fix the name of ranges highlighters upon initialization 2016-01-16 21:12:01 +02:00
Maxime Coste
032219b119 Rename set_signal_wrapper to set_signal_handler and tweak SignalHandler def 2016-01-10 20:46:15 +00:00
Maxime Coste
2f8612f8e7 Merge remote-tracking branch 'danlrobertson/safe_signal' 2016-01-10 03:00:25 +00:00
Maxime Coste
f358579e42 Merge remote-tracking branch 'occivink/master' 2015-12-29 23:06:35 +00:00
Maxime Coste
e938040e35 Cleanup InsertCompleter get rid of unneeded candidate vector copy 2015-12-28 00:18:38 +00:00
Maxime Coste
5217089902 Fix uses of non-keyword logical operators (replace &&, || and ! with and, or and not) 2015-12-27 23:28:34 +00:00
Maxime Coste
11652ce230 Remove the exec_keys function 2015-12-27 23:15:09 +00:00
Maxime Coste
43f1fcf616 Slight refactor 2015-12-27 23:09:32 +00:00
Maxime Coste
a5dcca6f78 Formatting fix 2015-12-27 23:07:06 +00:00
O. Perret
6a8507ce40 Keep match whose end is closest to the selection in reverse regex
search.
2015-12-27 16:53:52 +01:00
Maxime Coste
c39a4d5879 Add a static_words str-list option always considered for word completion
Fixes #313
2015-12-27 08:53:31 +00:00
Maxime Coste
978e8d18b9 Center the initial target line 2015-12-25 07:17:54 +00:00
Maxime Coste
c16b9a2ec4 Set window dimensions when setting it in a context 2015-12-25 07:17:36 +00:00
Maxime Coste
a051250204 Do not try to access the local client if it was not succesfully created 2015-12-24 04:09:30 +00:00
Maxime Coste
4d230e4051 Support passing +<line number> parameter to specify the first buffer target line on open
Fixes #336
2015-12-23 22:56:33 +00:00
Maxime Coste
1d748a4017 Pass flags to the regex engine to correct anchors
Current behaviour was matching ^ $ for the current search start/end
(and \b was always matching begin/end as well).

Fixes #536
2015-12-23 22:20:25 +00:00
Daniel Robertson
f5f7bc80e8 Add a signal function using sigaction
Use a wrapper for sigaction in place of signal to ensure that the
SA_RESTART flag is set for all signals used.

Signed-off-by: Daniel Robertson <danlrobertson89@gmail.com>
2015-12-23 14:03:31 -05:00
Maxime Coste
669fccc5e9 Remove drop jump (c-d) 2015-12-23 02:47:32 +00:00
Maxime Coste
1288a1d385 Support collapsing jumps in eval and exec
Fixes #535
2015-12-23 02:46:13 +00:00
Maxime Coste
aa92ca96c8 Use an index for jump list current rather than an iterator 2015-12-23 02:31:03 +00:00
Maxime Coste
411e5a9486 Extract jump list handling in a JumpList struct 2015-12-23 01:56:54 +00:00
Maxime Coste
9e664318af Tweak Context::push_jump implementation, simplify code 2015-12-22 22:18:25 +00:00
Maxime Coste
24411569fc Slight refactor in selection update code 2015-12-17 04:56:44 +00:00
Maxime Coste
8dcffd8f5a Initial, WIP spelling implementation
Add a ranges highlighter that takes a timestamped list of ranges and
associated face. Add a spell.kak file that uses aspell pipe interface
to fill a range-faces option.
2015-12-17 04:07:49 +00:00
Maxime Coste
ac5bc7e95d Add missing erasing of invalid line flags 2015-12-15 02:22:29 +00:00
Maxime Coste
d2b0dba39d Support quitting while executing RuntimeError hooks
Fixes #529
2015-12-14 19:06:30 +00:00
Maxime Coste
515231e824 Fix input mode keep alive handling, use a refcount for input modes
Fixes #528
2015-12-12 23:51:51 +00:00
Maxime Coste
80b1d88bb0 Fix Buffer::changes_since if we get passed an invalid timestamp 2015-12-12 23:50:01 +00:00
Maxime Coste
b6105fa106 Use markup for line-flags instead of a single face 2015-12-12 23:16:07 +00:00
Maxime Coste
8d7e16a8e6 Merge remote-tracking branch 'doppioandante/safer-autoload' 2015-12-12 17:03:38 +00:00
Maxime Coste
37210218fd Merge remote-tracking branch 'lenormf/fix-face-format-check' 2015-12-12 16:53:18 +00:00
Maxime Coste
4cb74623bb Store the buffer timestamp in line flags options respect it for highlighting
Option content is auto updated to match current buffer, so that line flags
are updated according to buffer modifications.
2015-12-12 11:45:45 +00:00
Maxime Coste
70250fc1e3 Pass directly the StringView to option_add and let it do the option parsing 2015-12-12 11:26:34 +00:00
Frank LENORMAND
bd56ed5fad Avoid instanciation of a String object everytime the parse_color
function is called.
2015-12-12 12:00:52 +03:00
Maxime Coste
5b9d30c088 Optimize the dynregex case where the expression refers directly to a regex option 2015-12-12 06:50:58 +00:00
Enrico Lumetti
f9d1ef830f Remove deprecated userconfig rule 2015-12-12 01:00:32 +01:00
Frank LENORMAND
49a5bbf3ca Ensure that at least one character follows a ',' or a '+' sign in a face
description (respectively a background color and attributes).
2015-12-11 22:58:28 +03:00
Frank LENORMAND
df31b88187 Fix "unused result" warnings for several system calls. 2015-12-10 11:00:10 +03:00
Maxime Coste
bde0975d9b Filter mode require an event manager
Fixes #519
2015-12-08 00:12:56 +00:00
Maxime Coste
89821e9471 Move grench.rc in the correct directory 2015-12-08 00:10:26 +00:00
Maxime Coste
888ff33683 Merge remote-tracking branch 'alexherbo2/grench-rc' 2015-12-07 13:52:24 +00:00
Maxime Coste
937bef69d9 Add support for adding saved selections to current ones with <a-z> 2015-12-07 13:43:09 +00:00
Maxime Coste
966ac90fe7 Change eolformat and BOM options to be enums instead of strings 2015-12-06 12:51:55 +00:00
Maxime Coste
39fffec104 Improve info box placement behaviour in some corner cases 2015-12-05 10:51:46 +00:00
Maxime Coste
eac6d63371 Small code refactor 2015-12-05 10:14:04 +00:00
Maxime Coste
9799f34f78 Refactor some code in shell_manager.cc 2015-12-05 10:00:11 +00:00
Maxime Coste
84fc4bd6cb Support -e in filter mode to give commands to execute (executed before keys) 2015-12-03 13:48:30 +00:00
Maxime Coste
c4a9f059dc Fix unset option when using the current scope and it points to global 2015-12-02 19:25:40 +00:00
Maxime Coste
9a6347d6aa Another try to fix csr problems (#469) 2015-12-02 01:12:24 +00:00
Maxime Coste
2a8a329b83 Remove support for %arg{#}, can be added back if we got a use case
It is very unlikely we need %arg{#} without needing a %sh anyway.
2015-12-02 01:08:41 +00:00
Maxime Coste
a02ad38fb4 Forward each params in %arg{@} separately 2015-12-02 01:01:48 +00:00
Maxime Coste
b2648053f9 Add argument expansion support 2015-12-01 20:07:14 +00:00
Maxime Coste
550a95a3d7 Change def -shell-params to def -params and take the counts as parameters 2015-12-01 14:00:55 +00:00
Maxime Coste
7335065d20 Update buffer display names after changing working directory
Fixes #501
2015-12-01 13:42:42 +00:00
Maxime Coste
1745344869 Run InsertIdle after reseting completer to permit InsertIdle to display an info box 2015-11-30 13:54:59 +00:00
Maxime Coste
e91da2bd43 Try to just reset the scroll region to workaround #469 2015-11-30 13:35:15 +00:00
Maxime Coste
a8d81e395b Support dropping last jump and use it to fix :tag double jump push
Fixes #492
2015-11-27 13:57:46 +00:00
Maxime Coste
516e999a28 Disable history in all non interactive contexts 2015-11-27 13:50:40 +00:00
Maxime Coste
b4df57d369 Small cleanups 2015-11-27 13:50:40 +00:00
Maxime Coste
a81dbd90a1 Consolidate writing to fd 2015-11-27 13:50:40 +00:00
Maxime Coste
0b57103c72 Remind user hooks disable when replaying last insert
Fixes #495
2015-11-26 23:02:59 +00:00
Maxime Coste
de72c7d5d3 Add missing <cstdio> include
Fixes #498
2015-11-26 22:51:39 +00:00
Alex Leferry 2
5da00a0f14 add rc/grench.kak 2015-11-26 15:23:02 +01:00
Maxime Coste
f66bbdf209 select/split interpret count parameter as the capture group to use
count being 0 by default, we use the whole match, but we can now
specify to use capture 1 with 1s<regex><ret>.
2015-11-26 13:36:26 +00:00
Maxime Coste
9e08cf8ea4 Preserve default registers in exec/eval by default 2015-11-26 13:34:46 +00:00
Maxime Coste
001da44e11 Add -save-regs <regs> option to exec and eval to preserve registers
Fixes #279
2015-11-25 23:40:38 +00:00
Maxime Coste
3644f2a056 Refactor registers to initialize all of them at startup and add null register
Fixes #497
2015-11-25 21:48:17 +00:00
Maxime Coste
ec91ea17fe Add a static const String::ms_empty empty string 2015-11-25 21:07:41 +00:00
Maxime Coste
3b5b781c5d Reject non ascii register names
Fixes #493
2015-11-25 20:12:11 +00:00
Maxime Coste
e45b0c3ffc Add StatusLine{Mode,Info,Value} built in faces
Fixes #491
2015-11-24 13:53:15 +00:00
Maxime Coste
ad5c8db7a8 Add support for various completions in :prompt
Fixes #489
2015-11-23 13:57:36 +00:00
Maxime Coste
36bf145b02 Support opening new files on kak -c command line
Fixes #485
2015-11-22 11:48:02 +00:00
Maxime Coste
7cf7f121e8 Fix onkey autoinfo 2015-11-21 17:21:21 +00:00
Maxime Coste
b0d696d994 Merge remote-tracking branch 'somasis/master' 2015-11-21 15:39:27 +00:00
Maxime Coste
a8d2c93ac8 Add a profiling debug flag to get timings for hooks/shell eval 2015-11-21 12:11:19 +00:00
Maxime Coste
5e4f5cd2a0 Move enum option handling in enum.hh and refactor enum options 2015-11-20 09:06:53 +00:00
Kylie McClain
77ba471020 Makefile: Allow for passing include/ncursesw path 2015-11-19 20:09:24 -05:00
Maxime Coste
c0f1b7b99f Introduce a debug flags option to control some tracing
Support shell|hooks and write traces in debug buffer
2015-11-19 21:58:26 +00:00
Maxime Coste
2977cc97b3 Merge branch 'ws' of git://github.com/jubalh/kakoune 2015-11-19 21:56:45 +00:00
Maxime Coste
bf213b01dd Keep an empty last line in debug buffer to provide auto scrolling 2015-11-19 21:33:50 +00:00
Kylie McClain
1ed66e9b6a Fix building with musl libc 2015-11-19 20:23:55 +00:00
Maxime Coste
788c358720 Fix some cases where menu items are truncated needlessly 2015-11-19 20:23:27 +00:00
Michael Vetter
71f6ee3234 Remove trailing whitespaces 2015-11-19 16:31:00 +01:00
Maxime Coste
daf041e839 Implement some generic utilities to convert flags to/from strings 2015-11-19 00:17:52 +00:00
Maxime Coste
784ab635ee Splitting an empty string now returns an empty vector 2015-11-19 00:17:18 +00:00
Maxime Coste
9656f088e7 Change autoinfo option to be a flags option, document flags options
Support the value1|value2|value3 syntax for flag options.
2015-11-18 23:47:28 +00:00
Maxime Coste
5c37f0dd5e Propagate shell context through prompt/onkey/menu commands 2015-11-18 20:15:51 +00:00
Maxime Coste
5743ea7384 Respect count argument on search 2015-11-18 20:13:03 +00:00
Maxime Coste
8d47cf0674 Fix correctly ncurses menu size computations and avoid divide by 0 2015-11-18 20:12:16 +00:00
Maxime Coste
6925ff33b1 Send client dimensions on connection, avoid a race condition.
Fixes #429
2015-11-18 13:43:43 +00:00
Maxime Coste
a37858ece7 Put count and register normal mode params in the shell context
'10:echo %val{count}' will display 10
Fixes #10
2015-11-17 23:47:59 +00:00
Maxime Coste
6bd71c68e5 NCurses: Fix max menu item width computation 2015-11-17 23:34:03 +00:00
Maxime Coste
cb108b248a Fix alias completion and overwritting 2015-11-17 13:55:27 +00:00
Maxime Coste
97cc166885 Try to restore the previously opened buffer when converting to client mode
Fixes #483
2015-11-16 13:52:33 +00:00
Maxime Coste
1bf0a964ce Move is_basic_alpha to unicode.hh 2015-11-15 13:24:39 +00:00
Maxime Coste
111732005a Support <c-v> to insert raw value in insert/prompt mode 2015-11-13 13:52:54 +00:00
Maxime Coste
67d1b7dcd1 Faster BufferIterator::operator++/-- 2015-11-12 13:59:36 +00:00
Maxime Coste
2113b829df Show an info box explaining that spaces disable history recording in command prompt
Fixes #477
2015-11-12 13:57:14 +00:00
Maxime Coste
d6168a90fc Fix access to dead temporary 2015-11-11 19:14:35 +00:00
Maxime Coste
b73a890f8c Document i attribute in face command info 2015-11-11 19:05:47 +00:00
Maxime Coste
a5c8437873 Remove unneeded conversion 2015-11-11 19:05:32 +00:00
Maxime Coste
892c3647e4 Fix to_lower/to_upper handling to correctly support non unicode chars
require a proper unicode locale setup on the system
Fixes #94
2015-11-11 00:21:20 +00:00
Maxime Coste
7bd3f4306d Remove useless checks, buffer has always at list one line 2015-11-10 23:06:57 +00:00
Maxime Coste
217dd6a1de Disable history when executing maps
Fixes #476
2015-11-10 21:24:47 +00:00
Maxime Coste
a0bcdd83df Document default registers 2015-11-10 20:39:17 +00:00
Maxime Coste
9134066e85 Try to switch to last buffer when removing the current one 2015-11-10 13:52:48 +00:00
Maxime Coste
53184829ee Avoid unneeded inc/dec rec in RefPtr::operator= 2015-11-10 13:50:15 +00:00
Maxime Coste
6e08716899 Refactor Normal input mode on_key method 2015-11-09 21:30:07 +00:00
Maxime Coste
6ecccf4119 Regex based normal mode command honor the selected register
They default to the '/' register for the default regex, but can
use another if specified with "<reg>
2015-11-09 21:28:18 +00:00
Maxime Coste
9b8e2526f9 Merge search hihglighter and regex option highlighter in dynregex 2015-11-09 09:34:03 +00:00
Maxime Coste
62c981fe2d Small tweak in DynamicRegexHighlighter 2015-11-09 08:50:17 +00:00
Maxime Coste
a2d78941ba Catch expression evaluation errors in line/column highlighters 2015-11-09 08:42:40 +00:00
Maxime Coste
12abb54a88 Slightly more performant regex capture gathering in select_all_matches 2015-11-09 08:42:12 +00:00
Maxime Coste
6840f7ce9c Store the last used buffer in clients
Fixes #474
2015-11-07 18:25:49 +00:00
Maxime Coste
6bb775241c Optimize BufferIterator to avoid a lot of pointer chasing 2015-11-07 16:55:48 +00:00
Maxime Coste
04c8334c98 Avoid useless StringDataPtr copy 2015-11-07 16:55:20 +00:00
Maxime Coste
28d451b844 Support 'current' scope in set/unset command 2015-11-06 13:56:48 +00:00
Maxime Coste
65e67b0656 Remove unused _ss UDL 2015-11-06 13:37:51 +00:00
Maxime Coste
33253a8fd5 Support 'V' for locked view control
Fixes #343
2015-11-05 13:40:40 +00:00
Maxime Coste
05f7337eb0 Change ncurses wheel down default button to 5 2015-11-05 13:28:58 +00:00
Maxime Coste
48a296dc71 Avoid an unneeded call to ensure_char_start 2015-11-04 20:10:12 +00:00
Maxime Coste
d6a2d77857 Fix double check_invariant in SelectionList construction, and set main selection to last 2015-11-04 19:53:47 +00:00
Maxime Coste
2ce0a5a8a8 Merge https://github.com/alpha123/kakoune 2015-11-04 19:49:21 +00:00
Maxime Coste
1c831b41da always_inline a few RefPtr operators 2015-11-04 19:47:26 +00:00
Maxime Coste
e82ca36117 Avoid unneeded sort_and_merge_ovelapping call in select_all_matches 2015-11-04 19:43:25 +00:00
Maxime Coste
719997f0ab Do not tag BufferIterator as random access
Boost regex considers that random access means fast distance
computation, which is not the case for BufferIterator where
Buffer::distance is O(num lines between them) which can get
big on large files.

Fixes #462
2015-11-04 01:01:52 +00:00
Maxime Coste
6273aa9443 Rework Buffer::distance implementation 2015-11-04 01:01:52 +00:00
alpha123
97c92368bc Build on FreeBSD 2015-11-03 11:51:27 -07:00
Maxime Coste
e8239feddf Minor cleanup in normal.cc 2015-11-03 13:59:05 +00:00
sinetek
4b8c03afe6 Adding support for DragonFlyBSD. 2015-11-03 01:14:34 +07:00
Maxime Coste
c8d2417646 Support horizontal centering in view commands (using m)
Fixes #442
2015-11-02 19:51:59 +00:00
Maxime Coste
17eef4a7dc Use explicit lambda captures 2015-11-02 13:44:03 +00:00
Maxime Coste
2bf44b6b49 Make word insert completion work better with unicode char 2015-10-30 13:57:46 +00:00
Maxime Coste
f556ef12c4 Fix preservation of entered text in option insert completer 2015-10-30 13:08:07 +00:00
Maxime Coste
34d7bdbc01 Minor code cleanup in insert_completer.cc 2015-10-30 13:07:48 +00:00
Maxime Coste
32b51e2cc3 Use ranked matches for option completion as well 2015-10-29 13:57:50 +00:00
Maxime Coste
8030897708 Merge branch 'master' into ranked-word-completion 2015-10-29 13:44:55 +00:00
Maxime Coste
24043bbffe Use an heuristic based match ranking algorithm inspired by what YouCompleteMe does 2015-10-29 13:36:30 +00:00
Maxime Coste
4b7b04bf59 Fix mouse scrolling up stopping at line 2
Fixes #448
2015-10-28 00:01:25 +00:00
Maxime Coste
89d22f3335 Move more logic into RankedMatch 2015-10-27 21:25:18 +00:00
Maxime Coste
2eba789610 Merge branch 'master' into ranked-word-completion 2015-10-27 13:33:15 +00:00
Maxime Coste
40c6edf243 Document exclusive attribute 2015-10-23 13:49:02 +01:00
Maxime Coste
5118e13aee Remove useless std::move 2015-10-23 13:46:55 +01:00
Maxime Coste
e7152bad56 Add an exclusive attribute that overrides existing face 2015-10-23 13:46:41 +01:00
Maxime Coste
1ba37bacd8 Fix optimized linkage 2015-10-23 09:49:06 +01:00
Maxime Coste
c77cb7c777 Extract WordDB::RankedWord as RankedMatch in its own file 2015-10-22 19:49:08 +01:00
Maxime Coste
da7fc3311f Pass ShellContext to commands
Fix #427
2015-10-22 13:59:23 +01:00
Maxime Coste
e51ef6c3c2 Wrap the shell params en env vars in a ShellContext struct 2015-10-22 13:48:57 +01:00
Maxime Coste
7346220e38 Fix :set completion when -add switch is given 2015-10-22 13:29:34 +01:00
Maxime Coste
5938712d1f Support :set -add on strings, using concatenation 2015-10-22 13:21:59 +01:00
Maxime Coste
019b3235b0 Remove legacy WordDB::find_matching method 2015-10-21 20:16:36 +01:00
Maxime Coste
2bf391f36d Sort insert completer words by name favoring lower case and then stable sort by rank 2015-10-20 13:50:55 +01:00
Maxime Coste
9449f763e0 Fix removal of duplicated words in insert completion 2015-10-19 19:39:05 +01:00
Maxime Coste
73e438be07 Fix handling of explicit insert completers 2015-10-19 13:43:23 +01:00
Maxime Coste
364914afbd Do not filter completions in InsertCompleter anymore
Just rerun the actual completers
2015-10-18 17:51:13 +01:00
Maxime Coste
4f2584a091 Experiment with ranked word completion depending on word boundaries 2015-10-18 16:55:21 +01:00
Maxime Coste
944d8f53fb Fix OSX compilation 2015-10-18 12:45:27 +01:00
Maxime Coste
2cd0ce41ac Do not try to extend last match when updating regex matches
It does not work well with regexes starting with a lookbehind, as
we would need to reparse from further away, leading to the last
match just being removed. It seems safer not to remove it, as
the motivating use case (multiline macros) is better left to
regions anyway.

Fixes #440
2015-10-18 11:37:04 +01:00
Maxime Coste
76fadd8108 More cleanups in the buffer open/reload code 2015-10-17 11:33:09 +01:00
Maxime Coste
fe704b9b84 Move line parsing and to Buffer.cc directly 2015-10-17 11:33:09 +01:00
Maxime Coste
3795ff735a Refactor buffer creation and reloading to be more explicit
Reloading used to be implicit in the buffer creation function,
which is not always nice, as code that explicitely wanted to
reload a buffer could not say so.
2015-10-17 11:33:09 +01:00
Maxime Coste
776059a4c3 Fix double destruction of local ui 2015-10-14 13:21:27 +01:00
Maxime Coste
43fb216772 Remove unneeded constructor 2015-10-14 08:49:13 +01:00
Maxime Coste
572cf9d6b2 Fix file change detection not working in certain cases
Files opened from the command line where not handled correctly.
2015-10-13 19:31:24 +01:00
Maxime Coste
49557f5b17 Restore info box after a resize as well
Fixes #425
2015-10-13 13:58:39 +01:00
Maxime Coste
9f78f9bfd5 Try to restore menu after a resize 2015-10-13 13:52:02 +01:00
Maxime Coste
e5240ba4ff Fix NCursesUI::m_items not being empty after a resize
Fixes #435
2015-10-13 13:40:04 +01:00
Maxime Coste
2d7e99da98 Tweak file change checking timeout handling 2015-10-10 14:18:43 +01:00
Maxime Coste
50f5140cbd When displaying a prompt content with line break char, replace them with their unicode control picture 2015-10-09 13:55:55 +01:00
Maxime Coste
256e4d7862 NCursesUI: Remove color restoring support 2015-10-09 13:43:13 +01:00
Maxime Coste
a4447819e5 Fix OSX compilation 2015-10-09 13:41:28 +01:00
Maxime Coste
0d8b9c6677 Tweak handling of SIGINT 2015-10-08 20:23:32 +01:00
Maxime Coste
473196e18d Store color/color pairs mapping in the ncurses ui instance 2015-10-08 20:23:32 +01:00
Maxime Coste
bd01171861 Auto fork server when suspending the local client
That way, other clients can still be serviced by the server.
2015-10-08 20:05:47 +01:00
Maxime Coste
7776c38755 Detect ungraceful exits, and backup modified buffers in these cases 2015-10-08 13:43:39 +01:00
Maxime Coste
3098cd12f8 Check for terminal resize on SIGCONT
Fixes #423
2015-10-08 13:24:58 +01:00
Maxime Coste
5e4443812c Fix warning in ncurses_ui.cc 2015-10-06 21:15:13 +01:00
Maxime Coste
67646cd45a Cleanup insert_completer code and use markup for option completion menu entry 2015-10-06 13:37:16 +01:00
Maxime Coste
c41a7eed09 Fix display of path insert completion for absolute paths 2015-10-05 23:30:20 +01:00
Maxime Coste
31cc61b6fc Allow parsing empty strings as default color in face descs 2015-10-05 20:32:51 +01:00
Maxime Coste
db2fa6f5cb Support markup in menu command 2015-10-05 13:51:13 +01:00
Maxime Coste
69b16d814b Display word insert completion buffer name in a different color 2015-10-05 01:48:00 +01:00
Maxime Coste
c54e6738b9 Use DisplayLine for menu choices 2015-10-05 01:25:23 +01:00
Maxime Coste
38e9bf4f96 Fix OSX compilation 2015-10-03 11:21:35 +01:00
Maxime Coste
f7ba2a896c Tweak ui_options docstring 2015-10-02 13:56:19 +01:00
Eike Plack
faa3b3b173 Add self documentation to ui_options
* For now the non ui code will hold this information. Ideally the UI would
be able to describe its options in some way.
2015-10-02 13:54:08 +01:00
Maxime Coste
a6cd764042 Add ncurses_enable_mouse ui option 2015-10-02 13:52:41 +01:00
Maxime Coste
bb96ad44b2 Refactor ShellManager process spawning 2015-10-02 13:37:06 +01:00
Maxime Coste
1cb4d2965f Fix '*' word boundary detection at begin/end of buffer 2015-10-01 19:35:42 +01:00
Maxime Coste
77408becbd Fix removing shared highlighters 2015-09-30 00:18:37 +01:00
Maxime Coste
6913d5427c Try to fix OSX compilation 2015-09-27 18:48:01 +01:00
Maxime Coste
9fdb822c27 Add support for italic text attribute 2015-09-27 14:24:42 +01:00
Maxime Coste
e2720f1fbe Store timespec for buffer fs timestamps, not just time_t
time_t has a resolution of one second, which cause troubles when
a file changes multiple time during that same second.
2015-09-27 11:55:34 +01:00
Maxime Coste
3262a6902c Allow custom separator for line numbers
the number_lines highlighter accepts a -separator <arg> switch
to change the default '│' separator.

Fixes #295
2015-09-25 13:47:57 +01:00
Maxime Coste
4ea89def3b Avoid (*it++) pattern in utf8.hh 2015-09-25 13:19:21 +01:00
Maxime Coste
48a7448b11 Merge remote-tracking branch 'freefull/master' 2015-09-24 23:01:20 +01:00
Filip Szczepański
47e6eed7c9 Add Haiku support. 2015-09-24 22:36:29 +00:00
Maxime Coste
aa4b98af7c Add utf8::read_codepoint that both gets the codepoint and advance iterator 2015-09-24 23:00:47 +01:00
Maxime Coste
12ef466f3a Avoid redundant calls to get_face in highlight_selections 2015-09-24 13:55:06 +01:00
Maxime Coste
e601bd5fe8 Minor additional cleanup in utf8.hh 2015-09-23 22:09:37 +01:00
Maxime Coste
ceafa5459a Avoid unneeded iterator copies in utf8.hh 2015-09-23 19:48:15 +01:00
Maxime Coste
27571a7716 Refactor utf8::iterator to be on the safe side
utf8::iterator now knows the iterator valid range, and pass
it to utf8 functions.
2015-09-23 19:39:21 +01:00
Maxime Coste
b5972cd647 Tweak utf8::iterator::distance implementation, remove unused advance method 2015-09-23 19:30:47 +01:00
Maxime Coste
6ec693d598 Cleanup compute_needed_size implementation 2015-09-23 00:43:40 +01:00
Maxime Coste
eed3e5459d Cleanup ncurses string writing code 2015-09-23 00:40:09 +01:00
Maxime Coste
3c000cbd0d Error when trying to run an empty register as a macro 2015-09-22 19:01:24 +01:00
Maxime Coste
8529720aef Fix some redrawing problems after resize 2015-09-21 22:12:23 +01:00
Maxime Coste
8b9452680a Use different object filenames between debug/non-debug builds 2015-09-21 13:39:11 +01:00
Maxime Coste
459d0baf79 Tweak string unit tests 2015-09-20 17:18:43 +01:00
Maxime Coste
22f3881cad Fix prompt history handling when pressing the down key 2015-09-20 17:02:37 +01:00
Maxime Coste
01152d7cd9 Improve escaping of % in command parsing 2015-09-20 11:48:11 +01:00
Maxime Coste
ca2043d9f2 Fix unescape implementation 2015-09-20 11:47:20 +01:00
Maxime Coste
2b4b73ae8e Remove the default_face parameter of parse_display_line
No need to define a default face there, we will pass a default face
to UserInterface::draw_status later.
2015-09-20 11:34:13 +01:00
Maxime Coste
b3e0e27d1f Do not allow '\n' in display lines, replace with a space 2015-09-20 11:23:10 +01:00
Maxime Coste
574e337132 Improve command completion by taking into account quoting of arguments 2015-09-20 11:19:10 +01:00
Maxime Coste
f59108072f Initial support for user configurable modeline with the modelinefmt option
modelinefmt is first sent through a command line expander (so %sh{...},
%val{...} et al. are expanded), then through markup expand (so that
{face} are interpreted as well)
2015-09-19 12:43:39 +01:00
Maxime Coste
6bc5f8c3a3 Add simple markup support to generate display lines from strings
The syntax is simply {face} to enable the given face, use \{ to
escape a {, and \\ to escape a \.
2015-09-19 12:19:17 +01:00
Maxime Coste
db8c12fd2a Be tolerant to modifiers in <c-x> bindings
<c-x><c-f> should be accepted, as it is cumbersome to unpress
control before hitting f in that case.
2015-09-19 11:55:55 +01:00
Maxime Coste
96b6b1b647 Tweak NCursesUI behaviour to reduce flickering on resize 2015-09-19 11:30:17 +01:00
Maxime Coste
d2c4d22d1f Keep it simple, remove all that sorted id map thing 2015-09-18 13:52:32 +01:00
Maxime Coste
6a6b22d92c Fix libstdc++ 4.8 compatibility 2015-09-17 20:03:58 +01:00
Maxime Coste
e7a8f64722 Use a sorted IdMap for aliases 2015-09-16 22:32:02 +01:00
Maxime Coste
bab95491c8 Keep sorted state when transmitting id maps 2015-09-16 22:29:19 +01:00
Maxime Coste
36828e6059 IdMaps can be sorted, in which case the find method uses a binary search 2015-09-16 22:22:51 +01:00