Commit Graph

464 Commits

Author SHA1 Message Date
Maxime Coste
2c4bc5582a Alt-Space permits to remove a selection by index 2012-05-29 11:15:43 +00:00
Maxime Coste
3bfd774f49 Restore piping support.
Add a ShellManager::pipe method, which pipes a string into the
command. Not quite satisfied with this interface.
2012-05-29 10:39:03 +00:00
Maxime Coste
84c1cad3d5 tweak cpp highlighting 2012-05-29 09:23:53 +00:00
Maxime Coste
c7ad724aec global.kak: support tag name completion 2012-05-29 05:23:36 +00:00
Maxime Coste
02c89022e4 Correctly set env vars in define_command 2012-05-29 05:43:09 +00:00
Maxime Coste
d599542473 Support -shell-completion option in the def command
-shell-completion takes some shell code as parameter which
should returns a newline separated list of completion candidates.
2012-05-29 05:22:18 +00:00
Maxime Coste
62202a46c1 Add some string helpers and unit tests
functions int_to_str(int) and split(const String&, Character),
plus corresponding unit tests
2012-05-29 05:19:50 +00:00
Maxime Coste
96c440fcaa CommandManager::execute can take an optional EnvVarMap argument which is used for shell evaluation 2012-05-29 05:42:26 +00:00
Maxime Coste
8fedbbf07b ShellManager::eval now takes an additional env_var map 2012-05-29 05:19:27 +00:00
Maxime Coste
e57ddd3bab Factorize some duplicated completer code in register_commands 2012-05-29 03:34:54 +00:00
Maxime Coste
30d9e10ac6 DisplayBuffer optimization, suppressed some paranoid checks 2012-05-29 00:33:55 +00:00
Maxime Coste
6fa40796e7 Fix Window::scroll_to_keep_cursor_visible_ifn 2012-05-29 00:14:05 +00:00
Maxime Coste
7451423ce3 global.kak: the 'tag' command uses 'menu -auto-single' 2012-05-28 23:52:26 +00:00
Maxime Coste
1257d432b4 the 'menu' commands now takes an optional -auto-single option
-auto-single tell the 'menu' command not to prompt when there
is only a single choice, and to automatically execute it's
command.
2012-05-28 23:50:11 +00:00
Maxime Coste
d96427b831 Add a delbuf (db) command which delete an existing buffer 2012-05-28 22:51:12 +00:00
Maxime Coste
393b9b24e2 Unify command parameter parsing with a ParametersParser class 2012-05-25 05:07:37 +00:00
Maxime Coste
05442857e6 add rc/global.kak file which provides the tag command using GNU GLOBAL 2012-05-18 05:23:02 +00:00
Maxime Coste
5f2471c147 add an initial menu command, which presents several choices to users
usage is "menu 'label1' 'command1' 'label2' 'command2' ..."
2012-05-18 05:20:46 +00:00
Maxime Coste
56efb42962 add a selection environement variable to access the last selection content 2012-05-07 06:56:53 +00:00
Maxime Coste
ff86d9781d move commands to commands.{cc,hh} 2012-05-07 03:13:34 +00:00
Maxime Coste
dd7228b098 fix DisplayBuffer::atom_containing when where is before first atom 2012-05-04 06:39:03 +00:00
Maxime Coste
55516af9d7 remove {add,rm}grouphl, go back to a -group arg in {add,rm}hl
more consistency, more shared code
2012-05-04 04:25:09 +00:00
Maxime Coste
7158aa00b7 use ShellManager in do_pipe 2012-05-03 07:33:13 +00:00
Maxime Coste
0c596a9d64 Add a ShellManager which handles executing shell commands
ShellManager provides shell commands with environement variable
to retrieve some internal values in the shell parameters.
2012-05-03 07:25:13 +00:00
Maxime Coste
2a291e6868 add an eval command which send it's arguments to the command evaluator 2012-05-03 07:24:27 +00:00
Maxime Coste
b8fe942dbb Implement our own String class in preparation to encoding support. 2012-04-14 01:23:20 +00:00
Maxime Coste
9337938403 replace std::string references with String 2012-04-14 01:17:09 +00:00
Maxime Coste
af5c528f04 use std::upper_bound in DisplayBuffer::atom_containing to run in O(log n) 2012-04-05 02:00:34 +00:00
Maxime Coste
e4b872abd2 remove ModificationListener and use a list of iterators to update instead
This permits to fix a bug in BufferIterator::upgrade, replaced by
BufferIterator::on_insert and BufferIterator::on_erase. ModificationListener
was only used to updating iterators anyway.
2012-04-04 13:56:19 +00:00
Maxime Coste
6cedff8fb2 fix some corner cases in Buffer modification 2012-04-04 12:25:42 +00:00
Maxime Coste
46c65fea10 Option name completion support 2012-04-03 18:25:27 +00:00
Maxime Coste
1d106fd31e add set{g,global,b,buffer,w,window} command to allow changing options 2012-04-03 14:04:02 +00:00
Maxime Coste
873c853f7c gdb: do not catch throw, but break when constructing an assert_failed exception 2012-04-03 13:42:20 +00:00
Maxime Coste
f3dd65fbf1 add an OptionManager class and use it to manage tabstops
OptionManager map names to options, and may delegate option resolution
to it's parent if it does not contains the asked for option. That way
Buffers can override global options, and Windows can override Buffer
options.
2012-04-03 13:39:20 +00:00
Maxime Coste
c8447658c0 fix tab insertion 2012-04-03 13:38:01 +00:00
Maxime Coste
30bc1bad8f WindowHighlighterFactory class which passes the Window to the higlighter function 2012-04-03 13:22:07 +00:00
Maxime Coste
d1cc86d95d fix error message in HighlighterGroup 2012-04-03 13:08:13 +00:00
Maxime Coste
9444c84b1c rename HooksManager to HookManager 2012-04-03 12:01:01 +00:00
Maxime Coste
2cd318e50d fix BufferIterator::update when removing an end of line 2012-04-01 15:40:25 +00:00
Maxime Coste
7f425c4467 add an editor unit test 2012-04-01 15:39:53 +00:00
Maxime Coste
07e1fcf67b specialize BufferIterator::operator-- 2012-03-31 15:21:14 +00:00
Maxime Coste
45e362d213 specialize BufferIterator::operator++ to speed up Kakoune 2012-03-30 12:01:18 +00:00
Maxime Coste
2e7cd2233c add a Line::length method 2012-03-30 12:00:40 +00:00
Maxime Coste
0ba7c7286d Store buffer content in a list of lines
Instead of a big std::string, buffer now store it's content in a
list of lines. In order to achieve O(log(n)) random access, lines
contains both their content and their offset since the start of
the file, making binary search usable.

BufferIterator now have a LineAndColumn coordinate into the buffer
instead of an offset so that access is still O(1).
2012-03-30 11:37:18 +00:00
Maxime Coste
c336bf1365 set print pretty in gdbinit 2012-03-27 13:27:35 +00:00
Maxime Coste
f43d206e4e remove unused measure_string from window.cc 2012-03-26 23:13:09 +00:00
Maxime Coste
63d1c4471c catch throw in gdbinit 2012-03-26 14:23:27 +00:00
Maxime Coste
a555e28b4e add basic unit tests run at startup 2012-03-21 19:27:36 +00:00
Maxime Coste
0748aa042b add a COMMA macro for assert parameters 2012-03-25 20:15:54 +00:00
Maxime Coste
3dd96565b3 display modified buffers names when quit fails 2012-03-25 20:12:35 +00:00
Maxime Coste
792f0f7f2e BufferManager no longer owns buffers, only register them 2012-03-26 14:21:49 +00:00
Maxime Coste
3c798a4ee8 remove useless Window::cursor_{position,iterator} 2012-03-21 19:26:42 +00:00
Maxime Coste
60fb523d62 add some missing operators to LineAndColumn 2012-03-21 14:13:26 +00:00
Maxime Coste
3dd82a2b85 get rid of Buffer::at 2012-03-19 14:04:33 +00:00
Maxime Coste
a377ff79aa buffer style fix 2012-03-12 21:39:54 +00:00
Maxime Coste
3c105592e0 get rid of Buffer::compute_lines 2012-03-12 21:31:27 +00:00
Maxime Coste
97b8905a6d fix update_lines on empty buffer 2012-03-12 14:26:46 +00:00
Maxime Coste
cd615b35a2 generalize do_select_surrounding in do_select_object and add a whole word selector 2012-03-12 14:23:30 +00:00
Maxime Coste
df0f7b4689 rename BufferString to String 2012-03-08 21:23:29 +00:00
Maxime Coste
f2fd2b125a support read error in shell_eval 2012-03-08 21:15:37 +00:00
Maxime Coste
97648b1fda add some highlighting for git 2012-03-08 20:58:22 +00:00
Maxime Coste
c98657a512 fix some unitialized variable use (thanks valgrind) 2012-03-08 20:49:10 +00:00
Maxime Coste
8bc6ed6cbb add gdb pretty printers for kakoune data structures 2012-03-08 20:32:13 +00:00
Maxime Coste
782b557660 factor word and WORD selectors 2012-03-07 19:20:32 +00:00
Maxime Coste
7e01867d55 'I' now inserts before the first non blank character of the line instead of the first character of the line 2012-03-07 19:19:33 +00:00
Maxime Coste
c183acb800 use an Editor in write_debug 2012-03-06 23:12:48 +00:00
Maxime Coste
c99a6a3e4c fix last line handling in window display buffer 2012-03-06 14:27:49 +00:00
Maxime Coste
0ce3bc4621 simplify and optimize buffer line handling 2012-03-06 14:27:03 +00:00
Maxime Coste
0a385885ff correctly handle boost::regex_error in selectors 2012-03-04 20:11:22 +00:00
Maxime Coste
583de3ba6e do not take a std::string by value in runtime_error constructor 2012-03-04 20:10:09 +00:00
Maxime Coste
ded05bb5d3 NCurses: support default colors 2012-03-04 19:55:38 +00:00
Maxime Coste
d91ac911e7 fix complete_filename when directory does not exist 2012-03-04 19:43:47 +00:00
Maxime Coste
454258a495 fix shell_eval when no buffer in context 2012-03-04 19:42:31 +00:00
Maxime Coste
1f854bc0cc fix select_surrounding when selection is on the closing char 2012-02-29 14:27:25 +00:00
Maxime Coste
8275fe30f9 support appending with search 2012-02-28 20:50:47 +00:00
Maxime Coste
c4ad372d91 call compute_lines before hooks at Buffer construction 2012-02-28 14:23:52 +00:00
Maxime Coste
bc3d20bf2a document Selection class 2012-02-27 20:01:59 +00:00
Maxime Coste
5bddd166f1 fix Buffer::line_length for last line 2012-02-27 19:52:36 +00:00
Maxime Coste
c03506ca04 save and restore " and / registers in exec_keys 2012-02-27 19:51:30 +00:00
Maxime Coste
13d74414e1 fix exec_commands_in_file parsing of [\'"`] strings 2012-02-27 14:25:07 +00:00
Maxime Coste
b6b66aecc9 fix number_lines line count computing 2012-02-27 14:24:14 +00:00
Maxime Coste
7f175da3fd Selection: handle last buffer character deleted case 2012-02-22 22:03:11 +00:00
Maxime Coste
416a1805b3 Fix last line handling in buffer 2012-02-22 22:02:43 +00:00
Maxime Coste
a386315bde Buffer: optimize line updating when applying a modification 2012-02-22 21:54:25 +00:00
Maxime Coste
030450838a fix Buffer::line_length for last line 2012-02-22 21:49:00 +00:00
Maxime Coste
275c0c67d4 Final attribute support for DisplayAtom
When DisplayAtoms have the Final attributes, highlighters
may not modify them anymore.
2012-02-22 21:48:14 +00:00
Maxime Coste
aeac9484b0 compute the number of digits needed in number_lines highlighter 2012-02-22 20:43:59 +00:00
Maxime Coste
46c614c4a2 fix skip_while 2012-02-16 14:28:22 +00:00
Maxime Coste
7026693ecd move ncurses function to ncurses.{cc,hh} 2012-02-16 14:25:16 +00:00
Maxime Coste
d548037922 tweak kakrc highlighting 2012-02-16 14:04:19 +00:00
Maxime Coste
6aacebd2e0 Add an echo command which print it's params in the status line 2012-02-15 14:24:52 +00:00
Maxime Coste
91f2292ec5 Support shell expansion in place of command name in command manager 2012-02-15 14:19:57 +00:00
Maxime Coste
e9af61eb9f def command takes an optional argument for parameter policy
-env-params puts parameters in kak_param{0..9}
-append-params appends parameters to the ones defined in the command
2012-02-15 13:58:08 +00:00
Maxime Coste
03976e0a01 edit command supports optional line and column parameter 2012-02-13 21:54:30 +00:00
Maxime Coste
3019ce3d3c edit command switch to the given buffer if it is already opened
use edit! (or e!) to force reloading of the buffer
2012-02-13 21:48:16 +00:00
Maxime Coste
38d921f3d2 add alt command which alternate between c/cpp and h/hpp file 2012-02-13 21:43:22 +00:00
Maxime Coste
3273551665 add 'def' command to define new user commands 2012-02-13 21:40:09 +00:00
Maxime Coste
5f86941b8f support multiline strings when executing file commands 2012-02-13 21:39:41 +00:00
Maxime Coste
2c8a6ca56a Support shell commands expansion in CommandManager 2012-02-13 21:38:07 +00:00
Maxime Coste
b49279503b fix include in context.hh 2012-02-13 21:32:54 +00:00