Commit Graph

2880 Commits

Author SHA1 Message Date
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
Maxime Coste
689494fb2f Fix reentrency in Normal::handle_key 2015-08-20 19:16:14 +01:00
Maxime Coste
3834a967f8 No reason for NestedBool operator bool to be explicit 2015-08-19 21:20:34 +01:00
Maxime Coste
8af3b52bfa Add alternative names to ^ (caret) and @ (arobase) registers 2015-08-19 21:20:01 +01:00
Maxime Coste
7ee027b125 Use the "<reg> syntax along with a default register for marks and macros
Marks use the '^' register by default, macros the '@' register.
2015-08-19 13:58:37 +01:00
Maxime Coste
baf0203b9d Default register is not handled by the Normal input mode.
Normal input mode will just pass 0 as the reg if it was not specified
by the user, its yank/paste functions that should determine 0 means
use '"' register.
2015-08-19 13:41:16 +01:00
Maxime Coste
3f493fa186 Rename Disableable to more general NestedBool
A NestedBool can be set multiple times, and will be considered false
only when unset the same number.
2015-08-18 23:17:56 +01:00
Maxime Coste
a33c8d9677 Smaller sizeof for in place strings 2015-08-18 21:06:53 +01:00
Maxime Coste
386f41e1c5 Be more explicit about paramater parsing error 2015-08-18 00:28:04 +01:00
Maxime Coste
f2580a366d Cleanup key to codepoint conversion
Fixes #378
Fixes #365
2015-08-18 00:19:14 +01:00
Maxime Coste
043ca99983 Cleanup mouse handling a little 2015-08-16 14:06:07 +01:00
Zak Greant
dc2d12a124 Fixing minor typo
s/prevous/previous/
2015-08-15 16:46:57 +02:00
Maxime Coste
97b871d49e Tweak notify_fatal_error message box title, might not be an assert failed 2015-08-14 13:16:06 +01:00
Maxime Coste
92d3178305 Clamp m_anchor in mouse handler, nothing garantees that it is still valid
Fixes #350
2015-08-14 13:12:44 +01:00
Maxime Coste
d2b82f507f More performant escape/unescape 2015-08-13 22:04:21 +01:00
Maxime Coste
7a36a4644e Detect face being aliased to itself
Fixes #374
2015-08-12 21:49:29 +01:00
Maxime Coste
d2762e6a1a Try to fix compilation on travis 2015-08-12 19:16:52 +01:00
Maxime Coste
7086135fa6 Display auto info on register insertion/explicit insert completion 2015-08-11 20:36:07 +01:00
Maxime Coste
8d9c402f52 Handle registers insert/explicit completion with a nested on_next_key mode 2015-08-11 13:55:56 +01:00
Maxime Coste
d7744308f6 Ensure the command exist before adding an alias
Fixes #371
2015-08-11 13:37:38 +01:00
Maxime Coste
94ec1cdde7 Add an unset command to remove an option value (falling back to parent)
unset is not applicable to global scope.
2015-08-10 13:54:52 +01:00
Maxime Coste
10d8cf64cf Move option docstring obtention to OptionRegistry 2015-08-10 13:53:30 +01:00
Maxime Coste
bfb116b8b4 Move option name completion to the OptionRegistry
Option names are the same for every option manager.
2015-08-10 13:38:06 +01:00
Maxime Coste
2eced81753 clamp coordinates find_buffer_coord 2015-08-09 23:18:26 +01:00
Maxime Coste
9d50dd3886 Use a struct rather than a std::pair for InputHandler::Insertion 2015-08-08 22:46:11 +01:00