Commit Graph

2904 Commits

Author SHA1 Message Date
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
Maxime Coste
c859e8ab5f Create directory with 0777 mode in make_directory
Fixes #408
2015-09-16 20:17:31 +01:00
Maxime Coste
693d9a4861 Store key hash in IdMap 2015-09-16 20:02:12 +01:00
Maxime Coste
afad50514b Simpler IdMap::operator== 2015-09-16 19:25:12 +01:00
Maxime Coste
73c0fa175e Use IdMap instead of UnorderedMap for ui options and env vars 2015-09-16 19:04:19 +01:00
Maxime Coste
85918d9f15 use getpwuid(geteuid())->pw_name rather than getlogin()
getlogin() can fail when stdin is not a tty on certain configuration
as it needs to find a controling terminal.
2015-09-15 13:32:26 +01:00
Maxime Coste
0338c0f437 Fix compilation with std regex 2015-09-15 13:28:36 +01:00
Maxime Coste
fd0567c730 Do not touch the first 16 colors in ncurses UI 2015-09-14 14:47:37 +01:00
Maxime Coste
a4804afa42 Restore redraw on <c-l> in ncurses ui 2015-09-14 14:30:01 +01:00
Maxime Coste
e0049bb587 Fix backward search searching from on char before the corret one.
Fixes #406
2015-09-14 14:28:45 +01:00
Maxime Coste
a2b4bf09fd Fix color restoring 2015-09-12 10:54:55 +01:00
Maxime Coste
ad2aa35546 Fix ncurses info box avoiding dead menus 2015-09-12 10:51:46 +01:00
Maxime Coste
5173dad470 Add some missing memory domains 2015-09-12 10:51:16 +01:00
Maxime Coste
8aca7622bf Restore keypad support in ncurses ui 2015-09-11 13:54:37 +01:00
Maxime Coste
2334a57970 Reduce allocation count in file.cc 2015-09-11 13:49:08 +01:00
Maxime Coste
afbe2f10d5 Slight refactor of NCursesUI ui_options handling 2015-09-11 13:20:37 +01:00
Maxime Coste
6ac1ae56fb Small code style tweak in insert_completer.cc 2015-09-11 13:07:51 +01:00
Maxime Coste
6292d451cf Small code cleanup in ncurses_ui.cc 2015-09-11 13:07:51 +01:00
Maxime Coste
5a5a78c608 Improve redraw behaviour on resize 2015-09-11 11:46:39 +01:00
Maxime Coste
34d0f63fd9 Use wgetch rather than getch to avoid unwanted redraws 2015-09-11 00:05:31 +01:00
Maxime Coste
80726a789b Refactor NCursesUI implementation, use pads instead of windows 2015-09-10 23:39:19 +01:00
Maxime Coste
a685a928f7 Try to restore colors to hard coded xterm palette on ncurses quit
Fixes #327
2015-09-10 23:38:05 +01:00
Maxime Coste
182cc368a0 Tweak BufferManager::delete_buffer implementation 2015-09-08 13:10:22 +01:00
Maxime Coste
fede8da14b Delete all existig window before resizing 2015-09-07 23:52:34 +01:00
Maxime Coste
29b508a894 Avoid wrapping lines with negative max width 2015-09-07 23:29:01 +01:00
Maxime Coste
53b65401f8 Small info box handling in cleanup in ncurses 2015-09-07 23:15:21 +01:00
Maxime Coste
30ad9a0475 Complete aliases in command prompt 2015-09-06 18:09:32 +01:00
Maxime Coste
a45876124b Avoid restoring selections in regex_prompt when they cannot have been modified 2015-09-04 19:00:42 +01:00
Maxime Coste
ae720b90b1 Small code tweak in show_whitespaces highlighter 2015-09-04 13:47:16 +01:00
Maxime Coste
ededc84c8c Remove some useless code in remote.cc 2015-09-03 23:17:57 +01:00
Maxime Coste
f81e5593db Tweak headers in shell_manager.hh, no need for regex.hh 2015-09-03 13:54:21 +01:00
Maxime Coste
e69db0f671 Regex are overkill for shell manager env vars, we just need exact match or prefix match 2015-09-03 13:21:35 +01:00
Maxime Coste
ea7f76f7f2 Change ncurses title logic, use hard coded \033]2;<title>\007 sequence
And add a ncurses_set_title ui option defaulting to true.
2015-09-03 00:03:07 +01:00
Maxime Coste
995a094471 Fallback on /usr/share/kak if the relative runtime path does not exists 2015-09-02 22:28:41 +01:00
Maxime Coste
a7d93fa11e std::accumulate is in <numeric> not <algorithm> 2015-09-02 21:15:16 +01:00
Maxime Coste
da5e662cf8 Add missing include 2015-09-02 20:59:45 +01:00
Maxime Coste
64a5948e1c comparison ops for MatchAndBuffer should be const 2015-09-02 13:54:17 +01:00
Maxime Coste
455cca19db Add support for a separate menu text in insert completions
Display buffer of origin in word completion menu
2015-09-02 13:43:07 +01:00
Maxime Coste
1295bc95cc Fix clang compilation 2015-09-02 13:35:50 +01:00
Maxime Coste
adcd0a03b1 Fix forward declare struct/class mismatch 2015-09-02 13:34:18 +01:00
Maxime Coste
e9d7d70e47 Cache buffer display name 2015-09-01 20:49:47 +01:00
Maxime Coste
ae7dc3c576 Simplify runtime_directory 2015-09-01 13:51:57 +01:00
Maxime Coste
b512f3220f Detect normal mode count overflow 2015-08-31 20:34:45 +01:00
Maxime Coste
c603d39a20 Merge remote-tracking branch 'elegios/master' 2015-08-31 00:02:59 +01:00
Maxime Coste
6071e636a2 Use a named struct for insert completion candidates 2015-08-30 23:02:20 +01:00
Maxime Coste
f666cd9c69 Merge remote-tracking branch 'Maroniemann/master' 2015-08-30 15:48:45 +01:00
Clemens Stadlbauer
3db95ce50c Prevented incorrect softlink from being created
If the "autoload" directory softlink has already been created,
"make install" would place a recursive softlink inside it on the
next install, which made future installs fail.
2015-08-30 13:30:15 +02:00
Maxime Coste
64c21b93a5 Additional code tweak in command_manager.cc 2015-08-29 21:39:23 +01:00
Maxime Coste
ac78cfa11c Add missing std::move, avoid a needless string copy 2015-08-28 13:54:12 +01:00
Maxime Coste
1249df9c76 Avoid using an UnorderedMap for 4 elements... 2015-08-27 21:36:49 +01:00
Maxime Coste
36b82c42e5 Refactor command parsing, maintain coordinates while reading the string 2015-08-27 21:32:04 +01:00
Maxime Coste
b529288176 Small code cleanup in command_manager.cc 2015-08-27 13:57:56 +01:00
Maxime Coste
04536657d1 Add a kill command that kills the current session
Fixes #331
A given session can be killed with 'echo kill | kak -p <session>'
2015-08-26 19:34:19 +01:00
Maxime Coste
0c41c14187 Reorganize slightly local client creation 2015-08-26 19:33:52 +01:00
Viktor Palmkvist
b53d9e282e Fix segfault in edge case when jumping backwards in jumplist
Closes #380
2015-08-26 11:54:51 +02:00
Viktor Palmkvist
1bdaf0675d Argument text object no longer handles <> 2015-08-25 15:56:49 +02:00
Maxime Coste
0755366cb1 Rework resize handling
Fixes #383
2015-08-23 15:18:18 +01:00
Maxime Coste
a2e90c2c25 Add support for listing existing sessions with kak -l
Fixes #381
2015-08-23 14:22:23 +01:00
Maxime Coste
71e362e2f9 Move session socket to /tmp/kakoune/<user name>/<session> 2015-08-23 14:13:46 +01:00
Maxime Coste
ae839fc471 Remove Client::window() method, use a force_redraw() one
We cannot assume Client::m_window is always non-null, as when
changing current buffer its temporarily null, at the point
where WinCreate hook might get called.

Fixes #382
2015-08-23 13:29:24 +01:00
Maxime Coste
dc504284c3 Change flag lines highlighter to use faces instead of colors
Fixes #130
2015-08-23 12:13:14 +01:00
Maxime Coste
504862fce7 Avoid double session closing 2015-08-22 11:27:48 +01:00
Maxime Coste
47ab4038ec Format session socket name in place into the sockaddr_un 2015-08-22 11:27:04 +01:00
Maxime Coste
564ab7d942 Merge remote-tracking branch 'zakgreant/reference-sheet-scripts' 2015-08-20 20:13:48 +01:00