Commit Graph

255 Commits

Author SHA1 Message Date
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
d9c3de3fc0 small cleanup in context_wrap 2013-12-16 23:51:57 +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
7267b8281f Move insert and erase to normal.cc, and move edition management to context 2013-12-15 20:23:02 +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
ce0e71aacb Remove Editor::select methods, add a non-const selections getter 2013-12-14 18:38:14 +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
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
e348c35b25 Write errors while sourcing a file in the debug buffer 2013-12-04 00:27:19 +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
d880465f38 Do not pass a window to highlighters factories 2013-11-28 18:48:40 +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
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
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
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
02312fe5ff Allow to ommit the catch part in the try command 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
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
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
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
44281c8fed More robust Buffer filesystem timestamp handling 2013-10-17 18:47:09 +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
e70d75d6a6 Only redraw clients after handling all available events 2013-09-17 18:51:14 +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
27a1e70b01 Rework client name change 2013-09-13 00:01:47 +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
ef01cf71ff tolerate empty strings (interpreted as 0) as line and column parameters in edit 2013-08-28 19:05:01 +01:00
Maxime Coste
eedd37c09a memoryview: always pass by value 2013-07-26 01:50:36 +02:00
Maxime Coste
3da97c4269 decl command support bool type options 2013-07-24 22:56:21 +02:00
Maxime Coste
2a74b0e9e2 Buffer: insert and erase go back to taking iterators, and return iterators 2013-06-06 19:44:08 +02:00
Maxime Coste
245e68e26e utf8_iterators: rename underlying_iterator to base 2013-06-06 19:44:07 +02:00
Maxime Coste
6b667bc803 remove BufferIterator conversion to/from BufferCoord 2013-06-06 19:44:07 +02:00
Maxime Coste
76f55f5256 remove useless iterator_at calls 2013-06-04 14:21:07 +02:00
Maxime Coste
93dd1ff3c7 Remove begin/end from Ranges, replace with min/max
Ranges should not be utf8 aware (needed for end), and a lot of
uses for end() were in fact looking for max.
2013-05-30 13:59:38 +02:00
Maxime Coste
c3d53d588d revive str_to_int so that the good exception type is thrown on error 2013-05-17 14:09:42 +02:00
Maxime Coste
26f0fd4cc6 Use more std::* for string handling 2013-05-13 18:43:38 +02:00
Maxime Coste
8bfe2d62e5 echo: rename -col option to -color 2013-04-26 18:48:31 +02:00
Maxime Coste
681f30dd28 support renaming buffers
Changing buffer name allows to save a *make* or *grep* buffer when
launching another one for exemple.
2013-04-22 13:49:07 +02:00
Maxime Coste
21f487417b context_wrap options are allowed only at start 2013-04-17 19:10:06 +02:00
Maxime Coste
cc91a71a96 move Client as a public class instead of a ClientManager implementation detail 2013-04-15 14:28:21 +02:00
Maxime Coste
dbffcb226b echo command can take a -col parameter to specify the colors to use 2013-04-12 14:22:01 +02:00
Maxime Coste
1b5760f1a1 delete buffer if needed when creating a scratch buffer 2013-04-11 23:09:17 +02:00
Maxime Coste
107e95622d Hooks can have an (shareable) identifier, and thus be removed 2013-04-11 14:29:10 +02:00
Maxime Coste
9999e5698d Use the buffer manager to delete buffer, throw when a client is inserting 2013-04-10 18:54:01 +02:00
Maxime Coste
bdd617006b add a 'debug' command, which write to the debug buffer 2013-04-10 13:45:17 +02:00
Maxime Coste
5adee4a6a7 rename assert to kak_assert to avoid collisions 2013-04-09 20:04:11 +02:00
Maxime Coste
34b8604f90 move context implementation to context.cc 2013-04-09 19:39:03 +02:00
Maxime Coste
7b94925898 force redraw window if needed in context_wrap 2013-04-09 14:21:48 +02:00
Maxime Coste
f540566b1b UserInterface: status line messages are now DisplayLines
This add color support for the status line
2013-04-04 18:50:00 +02:00
Maxime Coste
6ffdfd7735 Add get_color helper function 2013-04-04 18:47:34 +02:00
Maxime Coste
1822b81d58 pass a color pair when displaying an information window 2013-04-04 14:04:38 +02:00
Maxime Coste
b58f614f40 Pass a fg and bg color when displaying a menu 2013-04-04 14:04:38 +02:00
Maxime Coste
0395f3b9fc fix compilation with clang++ 2013-04-03 18:51:40 +02:00
Maxime Coste
76e73866e5 ParameterParser takes flags
Only implemented flag is OptionsOnlyAtStart which considers
options given after the first positional parameter as a positional one
2013-04-02 14:22:55 +02:00
Maxime Coste
0325e7f312 minor cleanup in assist function 2013-04-02 14:03:39 +02:00
Maxime Coste
f09e24607a add support for adding to options instead of replacing 2013-03-31 14:53:32 +02:00
Maxime Coste
a80cee0d2c Add support for tuple Options, implement LineAndFlag using that 2013-03-29 19:35:48 +01:00
Maxime Coste
29f79346c3 Move parameter count validation to the ParameterParser 2013-03-27 14:27:12 +01:00
Maxime Coste
a48672b3bc factor addhl/rmhl/addfilter/rmfilter completion functions 2013-03-27 14:19:07 +01:00
Maxime Coste
996e5999ed permit do declare regex option 2013-03-26 14:26:07 +01:00
Maxime Coste
1982144b04 Add a special option type LineAndFlag, use it for FlagLines highlighter 2013-03-26 00:14:38 +01:00
Maxime Coste
9429b662ca move absolute path logic to Buffer class 2013-03-25 19:58:23 +01:00
Maxime Coste
58caeaa8a8 add a cd command 2013-03-25 19:19:44 +01:00
Maxime Coste
ce67d29871 Always use absolute path for file buffer names, compact paths for display 2013-03-25 19:11:26 +01:00
Maxime Coste
a160fd6984 open_fifo delete existing buffer if needed 2013-03-22 18:39:00 +01:00
Maxime Coste
0082238c75 use canonicalized filenames for buffers 2013-03-22 14:27:30 +01:00
Maxime Coste
5bba01ca9c BufferManager notify the ClientManager when a buffer dies 2013-03-22 14:26:44 +01:00
Maxime Coste
a2476a8fbf setb can take a -buffer argument 2013-03-22 13:44:40 +01:00
Maxime Coste
eeadb59f7f eval,exec: -restore-selections become -draft, and restore the buffer as well 2013-03-22 13:42:29 +01:00
Maxime Coste
e5d93c2194 BufferManager: replace Buffer* get_buffer with Buffer& get_buffer 2013-03-21 19:09:31 +01:00
Maxime Coste
3883bffacc user defined hooks can access the hook parameter in shell with $kak_hook_param 2013-03-20 19:11:58 +01:00
Maxime Coste
2de0d0fccf add a reg command to set a register 2013-03-18 22:44:39 +01:00
Maxime Coste
a981d41cde Editor: replace selections().back() with main_selection() 2013-03-15 18:22:08 +01:00
Maxime Coste
066876a131 add str-list option support to decl command 2013-03-14 14:11:00 +01:00
Maxime Coste
50d9c4dfda add support for regex options, make ignored_files one 2013-03-14 13:42:07 +01:00
Maxime Coste
b309d1df61 move complete_filename to file.cc 2013-03-13 19:39:38 +01:00
Maxime Coste
17f7607a30 write_buffer: consider buffer as saved only if we used it's filename 2013-03-13 18:51:36 +01:00
Maxime Coste
e4240448b1 colalias: always override 2013-03-06 20:30:02 +01:00
Maxime Coste
fb7234544e HighlightersFactories takes back a Window parameter 2013-03-06 14:27:33 +01:00
Maxime Coste
0e2ba188dc Add support for int list options, specified using a comma seperated list of int 2013-03-06 14:27:00 +01:00
Maxime Coste
fac222a427 Strongly typed options support
* non builtins options require declaration using the decl command

* At the moment, only int and string options are supported, however
the goal of this change is to provide a consistent way to support
more complex options, namely lists and booleans
2013-03-05 18:49:26 +01:00
Maxime Coste
d23694e31f Do not use a factory for window builtins highlighters
This helps cleanup up the code, as factories no longer takes
a window as parameter.
2013-03-01 19:15:05 +01:00
Maxime Coste
6318f2268f assistant: no need for raw strings 2013-03-01 14:29:28 +01:00
Maxime Coste
849f225e70 use a 16K buffer when reading from fifo 2013-02-28 18:51:11 +01:00
Maxime Coste
cd8c36fc50 Add a debug option to Makefile, and use KAK_DEBUG define to remove debug code 2013-02-27 19:02:01 +01:00
Maxime Coste
3d19111570 Use unicode box drawing character for the assistant 2013-02-26 14:28:42 +01:00
Maxime Coste
dc7227b983 Add the most important missing feature of Kakoune 2013-02-25 19:38:20 +01:00
Maxime Coste
577734dae7 expose exec_keys function in commands.hh 2013-02-18 18:57:08 +01:00
Maxime Coste
32e6184210 context_wrap: create a DynamicSelectionList only when needed 2013-02-07 19:25:07 +01:00
Maxime Coste
6c7d646d35 exec keys: push_jump if editor has changed 2013-02-07 13:35:21 +01:00
Maxime Coste
bc63be3388 open_fifo uses fcntl for more portable CLOEXEC bit setting 2013-01-30 19:08:16 +01:00
Maxime Coste
84ea452ed2 info command take a -anchor <pos> instead of -inline params 2013-01-29 18:56:14 +01:00
Maxime Coste
38a67e72bc Do not pass a context to InputHandler methods 2013-01-29 13:49:01 +01:00
Maxime Coste
94bbf47cd4 InputHandler have it's own context 2013-01-28 13:48:34 +01:00
Maxime Coste
edb5dbc56f move {exec,eval}_string common code to a helper context_wrap function 2013-01-17 14:06:06 +01:00