Commit Graph

1544 Commits

Author SHA1 Message Date
Maxime Coste
088f670fe9 update cpp indent hooks, add align to opening paren support 2013-11-04 22:23:55 +00:00
Maxime Coste
68a27af56e Use InsertChar hook for char insertion, and InsertKey for key press 2013-11-04 22:02:44 +00:00
Maxime Coste
9521413b62 Tweak insert completion behaviour 2013-11-04 22:02:44 +00:00
Maxime Coste
dd6462ed57 regex option highlighter use runtime window rather than creation time one 2013-11-04 22:02:44 +00:00
Maxime Coste
02312fe5ff Allow to ommit the catch part in the try command 2013-11-04 22:02:44 +00:00
Maxime Coste
5e54705e26 simplify clang-enable-autocomplete, no need for shell 2013-11-04 22:02:44 +00:00
Maxime Coste
471aeaab9a remove filters, use hooks instead 2013-11-04 22:02:44 +00:00
Maxime Coste
4c39743b69 cpp.kak: replace filters with hooks 2013-11-04 22:02:44 +00:00
Maxime Coste
3e12507636 Remove IncrementalInserter and move it's code to InputModes::Insert 2013-11-04 22:02:43 +00:00
Maxime Coste
3e1bb777ce Add automatic completion display in prompt mode
Controlled by the autoshowcompl option
Completers now take a CompletionFlag parameter, used to specify
we want fast completion (tag completion can be slow, we do not
want to run it if not explicitely wanted by the user).
2013-11-04 21:59:28 +00:00
Maxime Coste
70e94cb00a Fix select_next_match that would select the end of the buffer in some circumstances 2013-11-04 21:59:28 +00:00
Maxime Coste
7b0eeb26b1 Run new clients in a new process session
When running a terminal emulator containing a kakoune client,
it used to still have the server tty as controlling termnal,
and so received SIGINT's from the user in it. Termnal emulators
then responded by exiting. This is no longer the case.
2013-11-04 21:59:28 +00:00
Maxime Coste
feff965ac6 Remove setg/setb/setw and use set <scope>
(with scope a prefix of global,buffer or window)
2013-10-30 09:38:40 +00:00
Maxime Coste
cc01aab8b8 add <a-gt> for indenting even empty lines 2013-10-30 08:45:47 +00:00
Maxime Coste
dc1fbcdaa2 minor style fix 2013-10-26 19:23:00 +01:00
Maxime Coste
90d499b94d Add a WinClose hook 2013-10-26 18:51:25 +01:00
Maxime Coste
29ab42149c Keep does nothing if an empty regex is entered (rather than crashing) 2013-10-26 18:46:21 +01:00
Maxime Coste
cf6c07d37d Specify key modifiers using constexpr functions for brevity 2013-10-26 18:42:36 +01:00
Maxime Coste
0746e7309e InputMode::Prompt: use an enum for mode rather than bool m_insert_reg 2013-10-26 14:06:27 +01:00
Maxime Coste
ebd768e03d remove unneeded code in client 2013-10-26 11:49:16 +01:00
Maxime Coste
2c09da50be Add key mapping support 2013-10-25 00:30:46 +01:00
Maxime Coste
77ac777526 use prefix matching for hook scope 2013-10-25 00:00:44 +01:00
Maxime Coste
748cc79d0f Add std::hash specialization for std::pair 2013-10-24 22:21:41 +01:00
Maxime Coste
baa9f28714 Add an autoreload YesNoAsk option, for configuring buffer reloading behaviour. 2013-10-21 18:58:11 +01:00
Maxime Coste
76deb60771 Add YesNoAsk type for options 2013-10-21 18:57:48 +01:00
Maxime Coste
60dbec4949 Add Buffer::reload for reloading buffers without loosing options and hooks 2013-10-21 18:57:19 +01:00
Maxime Coste
9e9b503f5d Code style cleanups in ncurses.{cc,hh} 2013-10-17 18:48:12 +01:00
Maxime Coste
44281c8fed More robust Buffer filesystem timestamp handling 2013-10-17 18:47:09 +01:00
Maxime Coste
c3bafea2cd Improve NCurses UI menu scroll bar, use a variable height 2013-10-17 00:32:13 +01:00
Maxime Coste
03c74b7a88 Detect file external modification and ask the user whether to reload or not
* Buffer now store a m_fs_timestamp field.
* Client in Normal mode checks current buffer file every 500 ms, or
  each time it goes back to Normal mode.
2013-10-15 18:51:31 +01:00
Maxime Coste
fe0a4f0d11 Reset normal mode when changing the current editor 2013-10-15 18:50:43 +01:00
Maxime Coste
608196f526 Fix indent code, support indentwidth=0 for using tabs 2013-10-14 13:47:43 +01:00
Maxime Coste
bc3cfb9016 Fix ctags.kak function info support 2013-10-11 18:45:23 +01:00
Maxime Coste
17951bf077 Fix Editor::remove_selection when the main selection is the first one and is the removed one 2013-10-11 18:44:43 +01:00
Maxime Coste
ee0e6dcef9 Display session name in the status line 2013-10-11 18:43:39 +01:00
Maxime Coste
d1159be19c Use { and } for extending selection to object start/end 2013-10-11 09:58:35 +01:00
Maxime Coste
632e7e217e Save last pipe command to the '|' register, and use it for empty cmd 2013-10-11 00:31:03 +01:00
Maxime Coste
3c959cee99 Pass title to UserInterface::info_show
Move unicode box generation and assistant code as
a NcursesUI implementation detail.
2013-10-11 00:17:22 +01:00
Maxime Coste
93f6a2ee43 Display target register name in status line when recording a macro 2013-10-11 00:17:22 +01:00
Maxime Coste
59ae6411f5 Only allow recording macro to register a-z 2013-10-11 00:17:21 +01:00
Maxime Coste
c478a97a2f Let InputModes describe themselves for status line display 2013-10-11 00:17:21 +01:00
Maxime Coste
74fe8b5e8d Remove Context::numeric_param, pass it directly to normal mode functions 2013-10-10 21:22:20 +01:00
Maxime Coste
00c8d1a4fa Fix tabs that appeared in the codebase 2013-10-08 19:28:57 +01:00
Maxime Coste
ab925686ab Improve object selection support
* A count is supported for nestable objects so that we
  can specify the surrounding level.
* more symetric behavior for select to end/ to begin
2013-10-08 19:28:18 +01:00
Maxime Coste
fccb954611 Use WordType enum instead of a bool punctuation_is_word for word selector 2013-10-07 18:44:22 +01:00
Maxime Coste
6e5ff644f2 add <a-R> for rotating selections content 2013-10-02 19:10:43 +01:00
Maxime Coste
6331fb5a61 Add <c-s> for saving current selection in the jump list 2013-10-02 18:49:06 +01:00
Maxime Coste
307fc228d2 Add <c-u> in insert mode for forcing commiting the current undo group 2013-10-02 18:45:39 +01:00
Maxime Coste
bc051c53af Cleanup dynamic registers init, and add # register for selection count 2013-10-01 19:52:19 +02:00
Maxime Coste
fb80ef092e clean up env var registration 2013-10-01 19:47:37 +02:00
Maxime Coste
c312b06e39 Do not push jump on search next 2013-09-27 19:26:52 +01:00
Maxime Coste
560e3397e8 minor cleanup 2013-09-27 19:24:18 +01:00
Maxime Coste
61cc53b325 Support highlighters that add new lines in scroll_to_keep_cursor_visible 2013-09-27 19:16:49 +01:00
Maxime Coste
3021c7f60a Remove $kak_socket replaced with $kak_session
use /tmp/kak-$kak_session to get the socket path
2013-09-25 19:04:52 +01:00
Maxime Coste
b080f456a7 Do not take directories into account when completing buffer name
(except if a / is found in the completion prefix)
2013-09-25 18:59:03 +01:00
Maxime Coste
60f4e1104f complete_filename fallback on subsequence completion if prefix does not work 2013-09-24 10:16:47 +02:00
Maxime Coste
9018bc47df use subsequence instead of regex matching for buffer completion 2013-09-24 10:13:39 +02:00
Maxime Coste
bab10f5b93 add subsequence_match(str, subseq) utility function 2013-09-23 21:17:16 +02:00
Maxime Coste
5ae43acf94 Add prefix_match function and use it instead of adhoc code 2013-09-23 21:16:25 +02:00
Maxime Coste
5a02d38081 small optimization in event manager 2013-09-23 20:32:45 +02:00
Maxime Coste
124be2ac2e extract client main to a run_client function 2013-09-23 20:28:15 +02:00
Maxime Coste
ce4ed44496 Add missing newlines to printed messages 2013-09-21 17:10:37 +02:00
Maxime Coste
b1d62a307d Add a -d command line option for running Kakoune as a headless server 2013-09-19 20:09:53 +01:00
Maxime Coste
415be1d2c7 Add a -s command line option for specifying session name 2013-09-19 19:54:14 +01:00
Maxime Coste
0b63074f90 extract main kakoune code to a kakoune function 2013-09-19 19:53:04 +01:00
Maxime Coste
03588f1b78 Support multiple selections per ligne when aligning 2013-09-18 18:54:04 +01:00
Maxime Coste
e70d75d6a6 Only redraw clients after handling all available events 2013-09-17 18:51:14 +01:00
Maxime Coste
7fef7ec063 Add a InputMode::on_replaced virtual method.
Destructors are not a good place to run mode exit hooks, as they
wont be called until the next mode trash clearing, so we now call
this virtual method on the previous mode just before it gets replaced.
2013-09-16 19:38:28 +01:00
Maxime Coste
168b4b775b Do not clear Client::m_mode_trash in handle_key, but in handle_available_input
handle_key can be called from exec_keys while running a hook, and a previous
key in exec_keys could have changed the mode. This would make the mode that
runned the hook deleted when the controls returns to it.

handle_available_input should always be called at top level, so can safely
clear the mode trash.
2013-09-16 19:25:18 +01:00
Maxime Coste
06e06d6ea6 remove print_status from UserInterface, pass status line to draw
Client store the current status line. This way calls to print status
do not force the user interface to display directly.
2013-09-16 19:15:13 +01:00
Maxime Coste
49903523a7 Resurect Client::handle_available_input() 2013-09-16 18:48:41 +01:00
Maxime Coste
27a1e70b01 Rework client name change 2013-09-13 00:01:47 +02:00
Maxime Coste
000af8e206 Fix clang.kak, now that eval -draft does not use the client user interface 2013-09-12 23:52:43 +02:00
Maxime Coste
fd021de7d7 use directly context.client() for getting the kak_client env var value 2013-09-12 23:49:08 +02:00
Maxime Coste
823812fd1a rename InputHandler to Client 2013-09-12 23:47:23 +02:00
Maxime Coste
ac7e437730 Move Client responsibilities to InputHandler
InputHandler owns it's UserInterface, and is directly stored by the ClientManager.
2013-09-12 23:39:34 +02:00
Maxime Coste
916a0cb52e Allow :exec mode changes to remains when keys are finished
Pass keys one by one to the input handler so that BatchUI is not needed
We can now use :exec to pre-fill the command line without validating
the command.
2013-09-11 18:58:23 +01:00
Maxime Coste
96fc340a5c add alt-& which aligns inserting spaces before selection start 2013-09-02 13:30:46 +01:00
Maxime Coste
70cd671ef6 support absolute filenames in insert mode filename completion 2013-08-29 13:50:55 +01:00
Maxime Coste
2125d95076 Use the Information color alias for auto info boxes 2013-08-29 13:50:24 +01:00
Maxime Coste
1d790541f5 handle client disconnection without crashing 2013-08-28 19:20:12 +01:00
Maxime Coste
ef01cf71ff tolerate empty strings (interpreted as 0) as line and column parameters in edit 2013-08-28 19:05:01 +01:00
Maxime Coste
3150fe97cf selections env var is : separated, and : in selections are escaped 2013-08-28 18:52:29 +01:00
Maxime Coste
535a454349 Line completion: sort and uniquify lines 2013-08-06 11:35:38 +02:00
Maxime Coste
9148b1ae92 Add line completion 2013-08-05 10:23:13 +02:00
Maxime Coste
c05f9f31dd add support for explicit insert mode completion using C-x prefix 2013-08-04 19:34:08 +02:00
Maxime Coste
0f4cecfa3e BufferCompleter refactoring, add support for explicit filename completion with c-f 2013-08-04 18:59:31 +02:00
Maxime Coste
3fe0b8e719 Move insert mode completion functions into BufferCompleter 2013-08-04 17:42:09 +02:00
Maxime Coste
6b66a3dfe5 Add support for filename insert mode completion 2013-08-02 17:58:37 +01:00
Maxime Coste
af17010524 contains: do not check if container is empty 2013-08-01 18:35:13 +01:00
Maxime Coste
a2577b4180 buffer: move Buffer::Flags operator as friends defined inside Buffer 2013-08-01 00:28:01 +02:00
Maxime Coste
c6f08f6c34 fix c++11 union use in remote.cc 2013-07-31 00:32:51 +02:00
Maxime Coste
3c8df764be fix insert mode erase utf-8 handling, add unit test 2013-07-30 19:18:01 +01:00
Maxime Coste
c84b861d2f remove useless SelectionList copy in keep 2013-07-29 13:51:07 +01:00
Maxime Coste
4f452474c8 non-regex based implementation of split_lines 2013-07-29 13:50:31 +01:00
Maxime Coste
af8e8d27d4 Minor code cleanups 2013-07-28 16:40:02 +02:00
Maxime Coste
5dfd4a9869 more auto info for normal commands waiting for a key press 2013-07-27 15:58:06 +02:00
Maxime Coste
0267540985 Do not select the first line indent in inner indent select 2013-07-27 15:37:28 +02:00
Maxime Coste
740a6562d9 enable autoinfo by default 2013-07-26 18:52:25 +01:00
Maxime Coste
c3359f7edc fix some auto info boxes text 2013-07-26 18:52:05 +01:00