Commit Graph

1959 Commits

Author SHA1 Message Date
Maxime Coste
30d36c0f1d change ncurses menu scroll bar style 2014-03-24 19:36:34 +00:00
Maxime Coste
a4070d9037 Use an info box to prompt for reloading of modified files 2014-03-24 19:31:40 +00:00
Maxime Coste
93ecc3efd6 style tweak 2014-03-22 21:00:24 +00:00
Maxime Coste
459cb212e5 Correctly handle failing to connect to the given session in client mode 2014-03-21 13:42:37 +00:00
Maxime Coste
2cdf578834 Store key names in a constexpr array 2014-03-20 19:52:11 +00:00
Maxime Coste
0cdeb55968 Container utility functions now use the free begin/end functions 2014-03-20 19:51:25 +00:00
Maxime Coste
dc953197c3 Fix support for switches style option in user commands 2014-03-20 19:50:42 +00:00
Maxime Coste
c48bdbe4f1 exec and eval support the -no-hooks option
Hooks gets disabled during the execution of the commands
2014-03-20 08:29:41 +00:00
Maxime Coste
be417d3616 Remove dangling forward declaration of Editor class 2014-03-20 08:11:35 +00:00
Maxime Coste
86fd00d1ea Fix comment 2014-03-20 08:10:31 +00:00
Maxime Coste
0db39ccfd0 Automatic insert filename completion kicks in only if prefix contains slash 2014-03-19 08:05:28 +00:00
Maxime Coste
dc087b3b7c EventManager: fix busy loop when no timer events exists. 2014-03-18 18:53:35 +00:00
Maxime Coste
36b016226c Insert mode completion execute completers in order, and supports multiple option
The 'completions' option is gone, just add option=completion_option_name
in the completers list.
2014-03-15 03:17:17 +00:00
Maxime Coste
19f5eb65e8 Clamp cursor position on buffer reloading 2014-03-07 01:05:51 +00:00
Maxime Coste
8e0b5d67aa Fix segfault in get_until_delimiter 2014-03-05 20:57:12 +00:00
Maxime Coste
11c62e583c Add -p <session> option to kak, which forward commands on stdin to session
This allows using directly the kak binary in place of socat for piping commands
to a foreing session.
2014-03-02 02:01:09 +00:00
Maxime Coste
e9442ea307 Rename connect_to's pid parameter to session 2014-03-02 02:00:13 +00:00
Maxime Coste
aab390ab92 Add -docstring option to the 'def' command
used defined commands can have their own documentation strings
2014-03-02 01:08:11 +00:00
Maxime Coste
4b9d49d7ab Add support for -buffer <comma separated names> to eval and exec commands
fixes #47
2014-03-02 01:08:11 +00:00
Maxime Coste
15223cba1e tweak docstring 2014-03-02 01:08:11 +00:00
Maxime Coste
8aaeaa3187 Declare commands in a CommandDesc structure 2014-03-02 01:08:11 +00:00
Maxime Coste
8ac19edf67 Add a docstring to commands 2014-03-02 01:08:11 +00:00
Maxime Coste
e6f5b3c038 Display command info only when the autoinfo option is true 2014-03-02 01:08:11 +00:00
Maxime Coste
486d1269e0 Consistently name -foo things 'switches' 2014-03-02 01:08:11 +00:00
Maxime Coste
9451782648 Add command switches information, and automatically display it 2014-03-02 01:08:11 +00:00
Maxime Coste
7f9f887b4a All commands now take directly a parameter parser
The command parameters description are now stored in a ParameterDesc
structure.
2014-03-02 01:08:11 +00:00
Maxime Coste
bd331742d2 Add @ command for tabs to spaces and alt-@ for spaces to tabs 2014-03-02 01:06:13 +00:00
Maxime Coste
0cd82d0ebe Rename align indent to more correct copy indent 2014-03-02 01:06:05 +00:00
Maxime Coste
c49e79c9e8 Add buffile env var for getting the buffer filename 2014-02-27 06:44:22 +00:00
Maxime Coste
aceee75ed9 Tolerate invalid %...{} when completing 2014-02-27 06:44:14 +00:00
Maxime Coste
6d651c59d0 regionref highlighter just ignore invalid references
fixes #68
2014-02-25 00:19:31 +00:00
Maxime Coste
daeefe2f33 Add support for strings
fixes #53
2014-02-15 00:36:00 +00:00
Maxime Coste
14f91e7132 Use a scoped edition when pasting 2014-02-12 00:03:01 +00:00
Maxime Coste
410932330c EventManager now wakes up for next timer rather than running a 10Hz 2014-02-12 00:03:01 +00:00
Maxime Coste
938f66badd Check for buffer external change when entering insert mode 2014-02-12 00:03:00 +00:00
Maxime Coste
d2a1c5ce46 Prompt handles scrolling in the line being edited 2014-02-12 00:03:00 +00:00
Maxime Coste
209a4a3ddf ClientManager: use lifo behaviour for free windows 2014-02-12 00:03:00 +00:00
Maxime Coste
22f2f68d58 Fix LineChangeWatcher behaviour when inserting at buffer end 2014-01-28 19:07:36 +00:00
Maxime Coste
2159fc9563 Rename selections first,last to more explicit anchor,cursor 2014-01-28 19:06:52 +00:00
Maxime Coste
dbd194cea8 Fix autoinfo for angle bracket object 2014-01-27 21:11:45 +00:00
Maxime Coste
e364137196 Fix compilation with clang 3.4 2014-01-27 20:28:38 +00:00
Maxime Coste
2dd4761f89 remove unused Singleton::delete_instance 2014-01-27 19:53:33 +00:00
Maxime Coste
a6d14cecbe Remove session socket on error signal 2014-01-27 19:53:17 +00:00
Maxime Coste
bbf48e1d39 Honor incsearch option for select/split/keep
fixes #37
2014-01-27 19:51:58 +00:00
Maxime Coste
37b4eacdc8 Rework command completion to allow partial token completion
Implement hook completion.

fixes #44
2014-01-27 19:51:58 +00:00
Maxime Coste
a32cac2f66 update gdbinit 2014-01-27 19:51:58 +00:00
Maxime Coste
ad818853a2 WordDB now uses a LineChangeWatcher based implementation 2014-01-27 19:51:58 +00:00
Maxime Coste
a96b2d3cd2 Rework regions highlighter, refactor and extract line tracking 2014-01-27 19:51:58 +00:00
Maxime Coste
f6e5deae5a Add 'a' alias to angle brackets text object
fixes #39
2014-01-23 19:45:09 +00:00
Maxime Coste
cccb07c7cd Catch parameter errors on startup and display option informations 2014-01-23 19:36:07 +00:00
Maxime Coste
c0bc7b6644 write_debug: fallback to stderr if the BufferManager does not exists yet
fixes #40
2014-01-23 19:21:00 +00:00
Maxime Coste
4f4a626754 Fix adapt_view_pos when the cursor is not on a display atom by itself 2014-01-21 18:52:51 +00:00
Maxime Coste
2cbb0bb27f Add a show_matching highlighter 2014-01-20 21:02:43 +00:00
Maxime Coste
f6eaaf1e78 WordDB: use an ordered map for storing words
This way we can use lower_bound to find the first prefix match
in logarithm time and we know all other prefix matches will
follow.
2014-01-19 19:43:19 +00:00
Maxime Coste
2ac545d306 RegionHighlighter: correct coordinates that are one past end of line
As region highlighters store per lines matches, end of line ones
are not valid buffer coordinates and must be corrected as begining
of next line.
2014-01-18 11:47:18 +00:00
Maxime Coste
5cffc48efc Pass a HighlightFlags parameter to highlighters
When only highlighting for finding character position on screen
pass HighlightFlags::MoveOnly so that non moving highlighters do
not need to run.
2014-01-18 01:59:37 +00:00
Maxime Coste
e1eec8903a only highlight actually displayed regions 2014-01-17 23:39:01 +00:00
Maxime Coste
79c6d609c9 FunctionGroup: fix incorrect parameter for operator() 2014-01-17 13:13:08 +00:00
Maxime Coste
997aadd33f Word completion use a WordDB stored as a buffer value. 2014-01-16 22:07:42 +00:00
Maxime Coste
a6b386e9b8 RegionHighlighter: Find the lines to be reparsed using the changes 2014-01-15 20:28:58 +00:00
Maxime Coste
c2f18e6e78 Use inplace_merge for sorting matches in region highlighter 2014-01-14 19:42:57 +00:00
Maxime Coste
ab508ea3da Much faster implementation of SelectionList::merge_overlapping 2014-01-13 22:23:40 +00:00
Maxime Coste
86eaa64982 Optimization and code cleanup in the region highlighter. 2014-01-13 21:40:02 +00:00
Maxime Coste
219f4c9c19 minor code cleanup 2014-01-12 21:25:21 +00:00
Maxime Coste
737837216b minor code cleanup 2014-01-12 21:24:59 +00:00
Maxime Coste
3248829f5b rename buffer_iterator.inl.hh as buffer.inl.hh and inline some more methods 2014-01-12 17:19:05 +00:00
Maxime Coste
faabd24e11 Region highlighters track line changes in the buffer
This way, region highlighters only need to regex-parse lines that
actually changed. matches on lines that just moved around but whose
content did not change can be updated simply by updating their line
coordinate.
2014-01-12 16:28:11 +00:00
Maxime Coste
4aed32d152 Store timestamp of last content modification in buffer lines
That means that lines that move around keep their timestamp.
2014-01-12 16:26:31 +00:00
Maxime Coste
ba5b21d43e Clear buffer values explicitely in destructor
Buffer values could be registered as a listener, so we need to
get rid of them before asserting that all listeners have been
unregistered.
2014-01-11 19:05:09 +00:00
Maxime Coste
1d51e6922a minor code cleanup 2014-01-10 13:36:40 +00:00
Maxime Coste
d466193ee7 Use a per line caching strategy for region highlighter 2014-01-09 22:52:39 +00:00
Maxime Coste
b247a05e43 Buffer: maintain a per line timestamp 2014-01-09 22:51:50 +00:00
Maxime Coste
d96b5aa04d Move highlighter cache logic to BufferSideCache template 2014-01-09 22:51:23 +00:00
Maxime Coste
85cc740de0 Use Buffer values for storing highlighting caches 2014-01-09 21:57:37 +00:00
Maxime Coste
85387b3efe Buffers can hold arbitrary values for for other systems 2014-01-09 21:01:29 +00:00
Maxime Coste
e6884f989c Style changes, replace typedefs with usings 2014-01-09 19:59:26 +00:00
Maxime Coste
560b4ab0b5 Fix DynamicSelectionList selecting buffer end on Buffer::reload 2014-01-08 19:36:18 +00:00
Maxime Coste
c8119885fa Use Win32 MessageBox for asserts on cygwin 2014-01-08 19:23:59 +00:00
Maxime Coste
518bc4e7f3 Use a single edition for -itersel
-itersel would not make sense with changing context buffer, so
it should be safe.

Fixes #14
2014-01-06 20:10:46 +00:00
Maxime Coste
9455303a1e Do not allow changing buffer when the context is editing 2014-01-06 20:07:08 +00:00
Maxime Coste
aadbd390c7 Use wide character function for categorizing codepoints
Previously we used the is... rather than isw...
These functions were not supporting non ascii characters correctly
2014-01-05 15:14:58 +00:00
Maxime Coste
1e6fbf548b Fix some tabs in the code 2014-01-05 14:30:26 +00:00
Maxime Coste
feaf197cae Add support for the erase key in prompt and insert mode
Fixes #18
2014-01-04 18:18:59 +00:00
Maxime Coste
8168cba1a3 Fix small misbehaviour in split_selections 2014-01-04 14:23:08 +00:00
Maxime Coste
540d82c452 shell_completion use command completion after | and &&
Fixes #21
2014-01-03 22:29:11 +00:00
Maxime Coste
3017531699 shell_completion uses command completion after semicolons 2014-01-03 20:47:49 +00:00
Maxime Coste
6c4c32eb59 Rewrite join_select_spaces
Stop using regex for selecting spaces at the begining of the line
2014-01-03 20:41:47 +00:00
Maxime Coste
26e8c45282 CommandManager: support completion of chained commands
Command completion now work after a command separator (;)

fixes #19
2014-01-03 20:07:40 +00:00
Maxime Coste
ae5115c31f Add support for absolute paths in find_file
fixes #11
2014-01-03 19:32:42 +00:00
Maxime Coste
3be77842db fix select_to_eol behaviour when on empty line
fixes #3
2014-01-03 19:00:19 +00:00
Maxime Coste
e12bf4978c Try prefix completion and then subsequence completion for option names
fixes #4
2014-01-03 19:00:05 +00:00
Maxime Coste
608098cdde InputHandler: selection first item when entering menu mode 2014-01-02 19:19:41 +00:00
Maxime Coste
ad7145dda4 Minor code cleanup in normal.cc 2014-01-01 18:45:28 +00:00
Maxime Coste
bcb53d8417 Add q and Q alias for single quote and double quote text object 2014-01-01 13:59:25 +00:00
Maxime Coste
d9b7eaef2b NCursesUI: no item is selected on menu_show 2013-12-30 22:41:08 +00:00
Maxime Coste
a34b943749 Support completing %opt{...} and %sh{...} in command manager 2013-12-30 14:22:18 +00:00
Maxime Coste
0b509735ca Extract shell_complete lambda as a proper function 2013-12-30 14:20:05 +00:00
Maxime Coste
56c3d9d137 Few cleanups in the command line parsing code 2013-12-29 18:37:48 +00:00
Maxime Coste
257f589e22 Add D for erasing with concatenated yanking 2013-12-26 10:40:22 +00:00
Maxime Coste
983abefc30 Add alt-| for piping and appending rather than replacing 2013-12-24 16:48:52 +00:00
Maxime Coste
fd17ea00dd CommandManager: use aliases for commands rather than duplicating data
Completion now only proposes full command names
2013-12-24 02:06:22 +00:00
Maxime Coste
22102951e2 make userconfig: install all kak scripts 2013-12-23 21:52:59 +00:00
Maxime Coste
fa72d27f9a Make kak more installable
* Kak relies on the kakrc file to be in ../share/kak/kakrc relative
to kak binary rather than in the same directory
* Added an install target to the Makefile
2013-12-23 21:36:05 +00:00
Maxime Coste
bcba5287ad Add complete_command for completing commands in PATH
use it for pipe completion
2013-12-23 20:43:55 +00:00
Maxime Coste
a0d4a44dd5 Fix prefix completion in prompt 2013-12-23 20:43:29 +00:00
Maxime Coste
c0973075fa Get rid of Editor for good
ClientManager now stores only the free windows, clients take
ownership of its own.
2013-12-20 20:14:57 +00:00
Maxime Coste
cb324a4b88 highlighters: add some optimization flags to regexes 2013-12-17 20:03:54 +00:00
Maxime Coste
0e6bbbb8c4 remove useless code in Buffer constructor 2013-12-16 23:53:04 +00:00
Maxime Coste
d9c3de3fc0 small cleanup in context_wrap 2013-12-16 23:51:57 +00:00
Maxime Coste
d1ac813f61 Pass a Context rather than a Window to highlighters 2013-12-16 23:24:08 +00:00
Maxime Coste
ae75594d25 Window: refactor center_selection/display_selection_at
Take the line we are intersted in as a parameter rather than getting
the main selection last char line.
2013-12-16 19:08:19 +00:00
Maxime Coste
94c9e4e99b Fix select_coord that could select invalid positions 2013-12-16 13:39:02 +00:00
Maxime Coste
6641583a68 cleanup editor.hh, remove editor.cc... 2013-12-15 22:10:19 +00:00
Maxime Coste
f83d5672f8 Fix replace_with_char behaviour, keep the same selections 2013-12-15 20:52:57 +00:00
Maxime Coste
ea95632709 Move Editor::selections_content to Context 2013-12-15 20:37:07 +00:00
Maxime Coste
ad0682ec75 remove unused Editor::check_invariant 2013-12-15 20:32:58 +00:00
Maxime Coste
8047cc97d3 Move Editor::{undo,redo} to free functions in normal.cc 2013-12-15 20:23:02 +00:00
Maxime Coste
cb9384f8a7 move InsertMode to normal.hh 2013-12-15 20:23:02 +00:00
Maxime Coste
7267b8281f Move insert and erase to normal.cc, and move edition management to context 2013-12-15 20:23:02 +00:00
Maxime Coste
e369b60258 Remove insert_hide_sel option 2013-12-15 14:57:55 +00:00
Maxime Coste
eb81eef03e Move SelectMode enum as an implementation detail in normal.cc 2013-12-15 14:38:04 +00:00
Maxime Coste
39b43f4c3c Less uses of Editor, in favor of Context 2013-12-15 14:33:09 +00:00
Maxime Coste
935bc3cec9 Add Context::selections method, and use it in priority to the Editor's one 2013-12-15 14:25:23 +00:00
Maxime Coste
9b6639eb27 Remove Editor::move_selections 2013-12-15 14:14:52 +00:00
Maxime Coste
4e3d551426 split_lines sets the last selection as the main one 2013-12-14 19:25:56 +00:00
Maxime Coste
49ee2495a4 Remove Editor::rotate_selections 2013-12-14 18:41:55 +00:00
Maxime Coste
d0d9717fcf Fix select_next_match 2013-12-14 18:40:29 +00:00
Maxime Coste
ce0e71aacb Remove Editor::select methods, add a non-const selections getter 2013-12-14 18:38:14 +00:00
Maxime Coste
0c4d523b22 Move template selectors to the header 2013-12-14 14:49:10 +00:00
Maxime Coste
93b561983a Rename MultiSelector to Selector 2013-12-14 14:38:17 +00:00
Maxime Coste
6afef079b6 Remove Editor::main_selection(|index), directly use the SelectionList method 2013-12-14 14:38:17 +00:00
Maxime Coste
eced7d4c24 SelectionList should never be empty 2013-12-14 14:38:17 +00:00
Maxime Coste
77590fe2e8 Move (keep|flip|remove|clear)_selections from editor method to free selectors 2013-12-14 14:38:17 +00:00
Maxime Coste
dad27fe1a0 Remove simple selectors, always go through a multi selector 2013-12-14 14:38:17 +00:00
Maxime Coste
f53ba0baed MultiSelectors takes a reference to the current selection and mutate it 2013-12-14 14:38:17 +00:00
Maxime Coste
db048a0792 MultiSelectors now transforms the whole selection 2013-12-14 14:38:17 +00:00
Maxime Coste
894ee0297e Move main selection index to SelectionList 2013-12-14 14:38:17 +00:00
Maxime Coste
dffd68a8ca honor jumpclient for grep 2013-12-13 14:00:14 +00:00
Maxime Coste
6966bf3303 make.kak: errjump tries to recognize current make directory 2013-12-13 13:58:12 +00:00
Maxime Coste
9a2e72f23c Fix cpp strings highlight 2013-12-13 13:55:08 +00:00
Maxime Coste
ed484dc333 Region highlighter takes regexes for region start/end 2013-12-12 22:49:41 +00:00
Maxime Coste
563f62b467 Fix Buffer::char_next when the line ends with an invalid utf8 sequence 2013-12-12 13:45:14 +00:00
Maxime Coste
bd80cf0404 Add DisplayAtom::check_invariant method 2013-12-12 13:45:08 +00:00
Maxime Coste
277b02eee6 Add experimental region_ref highlighter
highlights a region using another highlighter.
2013-12-11 23:19:24 +00:00
Maxime Coste
39512914ad Add BufWritePre and BufWritePost hooks 2013-12-11 13:58:38 +00:00
Maxime Coste
1b1031627c Add Buffer::run_hook_in_own_context helper method 2013-12-11 13:57:10 +00:00
Maxime Coste
91cc8dd8bf Add cursor_char_column env variable 2013-12-11 13:46:33 +00:00
Maxime Coste
f0c336a283 ctags.kak: Show message with Information colalias in gentags 2013-12-07 13:57:24 +00:00
Maxime Coste
9ecfcfad43 use -try-client in kak files rather than ad-hoc shell logic 2013-12-07 13:56:56 +00:00
Maxime Coste
0b473ffe58 eval and exec can use a -try-client option
When -try-client <client_name> is used, the context used for the
command is either the given client's context if the client is found,
or the  current one if not.
2013-12-07 13:44:23 +00:00
Maxime Coste
05d0397936 Add Client* ClientManager::get_client_ifp() that can return nullptr 2013-12-07 13:43:48 +00:00
Maxime Coste
3dde0b2260 fix strings in comment being highlighted as strings 2013-12-04 18:53:17 +00:00
Maxime Coste
35f12bc5a0 Use a cache for region highlighter 2013-12-04 18:52:16 +00:00
Maxime Coste
054ae08a9f use region highlighter for cpp 2013-12-04 00:48:57 +00:00
Maxime Coste
8b2f340238 Add basic region highlighter 2013-12-04 00:48:46 +00:00
Maxime Coste
e348c35b25 Write errors while sourcing a file in the debug buffer 2013-12-04 00:27:19 +00:00
Maxime Coste
c9eb65b04c Change rc files to use shared highlighters 2013-12-03 22:15:59 +00:00
Maxime Coste
45d5dbcc85 Add support for defining and referencing highlighters
* defhl <name> defines a shared highlighter
* addhl -def-group <name> adds highlighters to the defined highlighter
* addhl ref <name> add the defined highlighter to the window's ones
2013-12-03 22:07:23 +00:00
Maxime Coste
d5a5b1c329 fixup cpp.kak 2013-12-03 21:21:02 +00:00
Maxime Coste
a443ff7ea6 indent fixes 2013-12-03 19:49:09 +00:00
Maxime Coste
df57870470 rework cpp indenter, try to make them more readable 2013-12-03 19:49:09 +00:00
Maxime Coste
d880465f38 Do not pass a window to highlighters factories 2013-11-28 18:48:40 +00:00
Maxime Coste
a9d832965f RegexColorizer maintains a per buffer cache 2013-11-28 18:48:39 +00:00
Maxime Coste
255a747fdd Simplify FlagLines, do not try to update the option 2013-11-28 18:48:39 +00:00
Maxime Coste
2d55ff5feb Window: forget timestamp when options changes 2013-11-28 18:48:38 +00:00
Maxime Coste
fcf3e9e138 Improve ctags support
* cleanup tag command
* add a tag-complete command
* add a gentags command for launching ctags in the background
2013-11-28 18:48:09 +00:00
Maxime Coste
50325e62b0 fix prompt completion handling misbehaving with history 2013-11-28 18:48:09 +00:00
Maxime Coste
b83414ddf7 add alt-& for align indent 2013-11-22 09:55:32 +00:00
Maxime Coste
90ea3023fe reenable undo support on fifo buffers when the fifo closes 2013-11-20 22:18:40 +00:00
Maxime Coste
b90594353c NCursesUI: info_show do not require previous call to info_hide 2013-11-19 19:51:39 +00:00
Maxime Coste
44b0957e10 NCursesUI: fix redraw when showing a new menu 2013-11-19 19:51:39 +00:00
Maxime Coste
9a6712e56b rename idvaluemap to id_map, remove Id template param, use String 2013-11-18 22:24:31 +00:00
Maxime Coste
d27548dd15 Resurect idvaluemap, order of traversal matters
This reverts commit 2b9b161d42.
2013-11-18 22:17:50 +00:00
Maxime Coste
f57f065d76 Fix prompt completion 2013-11-18 21:47:16 +00:00
Maxime Coste
56c0d2de95 Fix insert completion 2013-11-18 21:45:42 +00:00
Maxime Coste
69113f30d1 fix git blame support in git-tools.kak 2013-11-18 01:37:03 +00:00
Maxime Coste
7f4d906774 move is_horizontal_blank to unicode.hh 2013-11-17 23:06:40 +00:00
Maxime Coste
2b9b161d42 remove idvaluemap, use unordered_map in place 2013-11-17 23:06:40 +00:00
Maxime Coste
c764fa7e25 write assert failed info to debug buffer 2013-11-17 13:25:58 +00:00
Maxime Coste
cb7ef23c44 fix invalid value handling for yes no ask options 2013-11-16 00:26:56 +00:00
Maxime Coste
62137f364d tweak initial debug infos 2013-11-15 23:47:44 +00:00
Maxime Coste
8c25d62056 extract InputHandler to input_handler.{cc,hh} 2013-11-14 21:12:59 +00:00
Maxime Coste
f8cadc0c57 move Client::m_name to context, no more need for DraftUI 2013-11-14 20:51:25 +00:00
Maxime Coste
ad275d1d1c Extract InputHandler from Client 2013-11-14 18:09:15 +00:00
Maxime Coste
fe55d51e9f Use Q for macro recording and q for replay, document macros in README 2013-11-14 13:59:32 +00:00
Maxime Coste
f287df2139 align always insert at selection begin 2013-11-14 13:44:55 +00:00
Maxime Coste
9a1d50d9a2 deindent now deindent non completely indented lines
If indent is 4 spaces, and a line has only 3 leading spaces, they
will get removed. a-< can be used to avoid this behaviour.
2013-11-14 13:44:54 +00:00
Maxime Coste
04ae48c346 indent cleanup, correct erroneous 3 spaces indent 2013-11-14 00:12:15 +00:00
Maxime Coste
9679b17b16 tweak style cpp.kak 2013-11-14 00:11:27 +00:00
Maxime Coste
323997041d Do not use eval for grepcmd, as it will evaluate \ escapes as well 2013-11-14 00:07:14 +00:00
Maxime Coste
d2e360a1c8 move cpp indentation to helper hidden commands 2013-11-13 13:11:22 +00:00
Maxime Coste
b2cb5b421c Centralize file mimetype detection in mime.kak
This way, 'file --mime-type $buffer' is called only once per file
rather than once per filetype detection hook.
2013-11-12 20:38:00 +00:00
Maxime Coste
db5050fab0 Add BufSetOption hook support 2013-11-12 20:36:42 +00:00
Maxime Coste
0244112af4 Add support for hidden commands, that will not show on completion 2013-11-12 19:38:19 +00:00
Maxime Coste
5a4650aecc Add support for hidden options, not showed by completion
the decl command can take a -hidden parameter to hide an option
2013-11-12 19:21:07 +00:00
Maxime Coste
c4de866903 Fix select_to_previous_word when cursor is on last buffer char 2013-11-12 18:59:19 +00:00
Maxime Coste
67452c3441 Tweak prompt auto show completion
* Auto show completion even before the first key is pressed
* Auto show next completions when validating a single choice completion
2013-11-12 18:56:48 +00:00
Maxime Coste
6877ae151f Do not require call to menu_hide before menu_show in ncurses ui 2013-11-12 18:52:30 +00:00
Maxime Coste
83a6375263 Fix StronglyTypedInteger::operator%= 2013-11-11 19:11:17 +00:00
Maxime Coste
6b77860fc0 Make Context a class, not a struct 2013-11-11 19:10:49 +00:00
Maxime Coste
bc1d1ba59f Fix warnings 2013-11-10 22:51:52 +00:00
Maxime Coste
03a6561f50 use abreviated form for keys in client.cc 2013-11-10 22:48:56 +00:00
Maxime Coste
4b518ee6b9 Add support for function keys F1-F12 2013-11-09 11:12:55 +00:00
Maxime Coste
a7ed017ef3 cleanup Makefile 2013-11-09 11:12:25 +00:00
Maxime Coste
b4cc8edd35 Use eval ${kak_opt_(make|grep}cmd} in (make|grep).kak
Quotes in the variable are preserved that way.
2013-11-08 19:05:30 +00:00
Maxime Coste
414a1332eb update cpp indentation hooks, indent after visibilty specifier 2013-11-08 19:04:28 +00:00
Maxime Coste
82b1619b05 cleanup cpp hooks 2013-11-07 21:58:19 +00:00
Maxime Coste
a11bccaa12 fix Buffer constructor exception safety 2013-11-07 21:43:18 +00:00
Maxime Coste
d4216efd75 clang.kak: wrap clang-autocomplete hook in a try %{} 2013-11-07 18:50:16 +00:00
Maxime Coste
bfbb44d994 Makefile: use boost_regex-mt on Cygwin 2013-11-07 18:49:12 +00:00
Maxime Coste
0b23a4f67b cpp indent improvement
* auto inserts a ; after } if it closes a class or struct
* auto copy the // comment of the previous line
2013-11-07 18:45:08 +00:00
Maxime Coste
2eb1a323d9 fix kakrc string highlighting 2013-11-07 18:44:27 +00:00
Maxime Coste
79883f6a51 make align tab-aware 2013-11-06 19:13:06 +00:00
Maxime Coste
f2a902f682 Add modulo operators to StronglyTypedNumber 2013-11-06 19:10:35 +00:00
Maxime Coste
7495d04a47 Add support for -itersel option in exec/eval
-itersel makes a -draft eval/exec run once for each selections
separately rather than with all selections at a time.
2013-11-05 23:50:44 +00:00
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