Commit Graph

897 Commits

Author SHA1 Message Date
Maxime Coste
948443a077 Buffer: add line_count method 2011-09-22 13:58:35 +00:00
Maxime Coste
2efa120612 o key to open a line after the current one 2011-09-22 09:24:16 +00:00
Maxime Coste
cff69b2556 Selectors: add a basic select_matching selector for <([{]])> pairs 2011-09-21 19:09:49 +00:00
Maxime Coste
3af66276f0 Move selectors function to their own file 2011-09-21 14:37:09 +00:00
Maxime Coste
3c06846aa3 RegexSelector: wrap on top if needed 2011-09-20 12:00:06 +00:00
Maxime Coste
13d14d4ff5 Insert: refactoring using IncrementalInserter 2011-09-19 22:00:29 +00:00
Maxime Coste
9da8fbe630 Window: add a IncrementalInserter class for insert mode 2011-09-19 21:56:29 +00:00
Maxime Coste
2f093d78b5 LineAndColumn: fix operator[+-]= 2011-09-19 21:55:58 +00:00
Maxime Coste
8a4a3e447b Window: fix erase 2011-09-18 20:09:25 +00:00
Maxime Coste
85e2a31b31 Window: code cleanup and more intelligent Selection class 2011-09-17 14:57:35 +00:00
Maxime Coste
0513b4de29 Shift-{H,J,K,L} keys move cursor while selecting. 2011-09-17 14:28:23 +00:00
Maxime Coste
34c9b0d30f LineAndColumn: move to it's own header and add operator[+-]=?
LineAndColumn is now a template so that WindowCoords and BufferCoords
cannot be added together.
2011-09-17 14:13:33 +00:00
Maxime Coste
49fce28dec select_to_next_word{,_end}: words are [a-zA-Z0-9] 2011-09-16 09:20:36 +00:00
Maxime Coste
3afbbefd9b Configure filename completer for edit and write commands 2011-09-16 09:20:01 +00:00
Maxime Coste
63191f1900 CommandManager: support per command configurable completion 2011-09-16 09:18:51 +00:00
Maxime Coste
aeea1c610c complete_filename: accept cursor_position as additional parameter 2011-09-16 09:17:55 +00:00
Maxime Coste
635e76eb4c prompt: rework tu support arrows and completion cycling 2011-09-14 19:15:09 +00:00
Maxime Coste
b59ad6a174 Completion: dedicated completion header and basic filename completion 2011-09-14 15:41:56 +00:00
Maxime Coste
4b38cd3cd0 utils: add auto_raii helper function
this helper permits to register a resource and cleanup function to keep
exception safety with C like resource. For exemple, to be sure that a
FILE* will be closed, you can use:

auto file = auto_raii(fopen("filename"), fclose);

file will auto cast to FILE* when needed, and will call fclose when
going out of scope.
2011-09-14 15:36:35 +00:00
Maxime Coste
eecc5a184e CommandManager: basic command name completion support 2011-09-13 21:16:48 +00:00
Maxime Coste
030c5caf0a assert: custom implementation 2011-09-09 19:24:18 +00:00
Maxime Coste
3caf962110 exception: refactoring 2011-09-09 18:40:59 +00:00
Maxime Coste
0676eaec5c gitignore: ignore tags file 2011-09-09 13:04:02 +00:00
Maxime Coste
84682b7590 Add a buffer command to switch between existing buffers 2011-09-08 14:32:36 +00:00
Maxime Coste
76b7c60afb Buffer is now responsible for window creation 2011-09-08 14:30:36 +00:00
Maxime Coste
60e673acba Makefile: add rule for tags 2011-09-08 14:28:42 +00:00
Maxime Coste
d3499ecd9c Window lifetime is now handled by it's buffer.
A window cannot outlive it's buffer, so it makes sense to keep only a
reference on it hand have the buffer manage the window lifetime.
2011-09-08 00:13:19 +00:00
Maxime Coste
535e200587 Add a BufferManager singleton class, handling buffer lifetime
it also provide access to buffers by name
2011-09-08 00:11:48 +00:00
Maxime Coste
511df5b660 utils: add operator== (const std::unique_ptr<T>&, T*) 2011-09-08 00:08:55 +00:00
Maxime Coste
03f1520b43 Refactor commands handling and parsing in a CommandManager class 2011-09-07 18:16:56 +00:00
Maxime Coste
8baf43ece1 binding of undo to 'u' and redo to 'U' 2011-09-06 18:53:12 +00:00
Maxime Coste
f88d1dbe06 Window: basic binding of bufffer undo feature 2011-09-06 18:52:52 +00:00
Maxime Coste
1e87fe17c6 Buffer: Undo/Redo implementation
Currently only a linear undo, i.e. if you undo and then make some new
changes, previous undoed changes are lost. Final undo system should
support an undo tree, with timestamped modifications.
2011-09-06 18:49:32 +00:00
Maxime Coste
f58cbf0b98 utils: Add reversed template helper for container iteration
this permits to use range-based for loops to iterate on reversed
containers. Should work on any container implementing rbegin and rend.
2011-09-06 18:33:35 +00:00
Maxime Coste
3f51feaaef Buffer: accept initial content in constructor 2011-09-06 18:33:18 +00:00
Maxime Coste
6668151c78 LineAndColumn: segregate into WindowCoord and BufferCoord
Having the same type to specify coordinates in window space or buffer
space is error prone, now the compiler will tell if we use one for
another.
2011-09-05 19:06:31 +00:00
Maxime Coste
d5012c9379 window: support scrolling 2011-09-05 18:55:31 +00:00
Maxime Coste
04c7ce8f01 window: cursor position is now stored in window coordinate
It was stored in buffer coordinates. Conversion methods added
2011-09-05 18:54:17 +00:00
Maxime Coste
2224118de2 insert: print '-- INSERT --' in status line 2011-09-02 18:45:57 +00:00
Maxime Coste
61b37a6057 RegexSelector: search the entire buffer instead of the current line 2011-09-02 18:38:10 +00:00
Maxime Coste
39f12a1766 add const BufferIterator::Buffer& buffer() method 2011-09-02 18:35:22 +00:00
Maxime Coste
19123186d7 better exception handling in edit and write_buffer 2011-09-02 18:02:29 +00:00
Maxime Coste
11d82b11b3 create_buffer_from_file: throw file_not_found instead of open_file_error when ENOENT 2011-09-02 18:01:20 +00:00
Maxime Coste
955744e5d0 prompt: correctly handle backspace when empty 2011-09-02 17:07:35 +00:00
Maxime Coste
053b2e233e main: catch all exceptions, close ncurses and rethrow 2011-09-02 17:05:44 +00:00
Maxime Coste
f1631de4e0 add basic gitignore 2011-09-02 16:53:34 +00:00
Maxime Coste
535285d9e6 Initial commit 2011-09-02 16:51:20 +00:00