Commit Graph

105 Commits

Author SHA1 Message Date
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
9444c84b1c rename HooksManager to HookManager 2012-04-03 12:01:01 +00:00
Maxime Coste
3c798a4ee8 remove useless Window::cursor_{position,iterator} 2012-03-21 19:26:42 +00:00
Maxime Coste
d84d085cc2 Merge captures into registers, implements register insertion 2012-02-09 23:47:55 +00:00
Maxime Coste
04a37d8895 Editor refactoring, merge undo and batch management 2012-02-07 23:41:10 +00:00
Maxime Coste
96b167859a batches support in Editor, used by IncrementalInserter and exec_string
Editor groups all modification together in one undo group when batching.
nested batches are supported.
2012-02-03 13:55:22 +00:00
Maxime Coste
69d96c90da extract an Editor class from Window and refactor 2012-01-31 19:12:06 +00:00
Maxime Coste
a72d185f79 remove DynamicBufferIterator and make Selection a ModificationListener
DynamicBufferIterator is only used by Selections. And each selection
had two iterators, resulting in two ModificationListeners registered
in the buffer instead of one now.
2012-01-25 19:32:06 +00:00
Maxime Coste
d1c29d2b78 moving no longer clears multiple selections 2012-01-25 14:23:02 +00:00
Maxime Coste
c38f244c06 Window have it's own hooks manager 2012-01-23 13:57:24 +00:00
Maxime Coste
2824bd9a46 HighlighterGroup: move to it's own file, Window uses them directly 2012-01-19 20:37:29 +00:00
Maxime Coste
541872cafa completion support for addgrouphl and rmgrouphl 2012-01-18 11:33:58 +00:00
Maxime Coste
2cfa70a466 Window: add get_highlighter_group method 2012-01-15 13:46:12 +00:00
Maxime Coste
50ce3d1549 Document some Kakoune concepts, as Window, Buffer, DisplayAtom... 2012-01-11 14:21:58 +00:00
Maxime Coste
9557167f26 <space> with a count argument replaces current selections with the counth selection. 2012-01-09 14:28:01 +00:00
Maxime Coste
f77fc3980b Window: store a stack of selections 2011-12-21 19:06:26 +00:00
Maxime Coste
2239fb6e49 Filters: move from buffer to window 2011-12-07 14:29:10 +00:00
Maxime Coste
4252e0d610 Window: use an idvaluemap to store highlighters 2011-12-02 14:20:11 +00:00
Maxime Coste
0859b20bcf Rename Filter to Highlighter to be more explicit 2011-11-29 22:37:20 +00:00
Maxime Coste
95f87a6694 Window: add replace method
permits to replace selection by a string in a single undo step
2011-11-22 14:23:46 +00:00
Maxime Coste
18913cfbff IncrementalInserter: add insert_capture method bound to ^B<num> 2011-11-16 19:24:37 +00:00
Maxime Coste
52b8abfe02 Selections: add captures field
Selections now can have associated captures, for backreferences when
selections are created from a regex search
2011-11-16 19:23:09 +00:00
Maxime Coste
0203b904e1 Window: add multi_select method
multi_select provides Selection -> SelectionList operations
2011-11-16 14:04:45 +00:00
Maxime Coste
0dc8442ca4 Completions: add filterid completion for rmfilter 2011-11-12 14:15:35 +00:00
Maxime Coste
f12929abad Filters: refactoring 2011-11-09 23:56:22 +00:00
Maxime Coste
3af1b89034 Window: support adding and removing filters with :addfilter :rmfilter 2011-11-08 14:29:52 +00:00
Maxime Coste
4982620c4c IncrementalInserter: support insert at line begin and append at line end 2011-11-02 20:03:41 +00:00
Maxime Coste
55cd4949e0 Selection: more intelligent merging 2011-10-27 14:22:17 +00:00
Maxime Coste
d2c6ceb47b DynamicBufferIterator: add and use in Selections
DynamicBufferIterator are a new type of BufferIterators that
automatically update themselves when their buffer is modified.

Selections now uses this type of iterators instead of plain ones
2011-10-24 14:26:21 +00:00
Maxime Coste
dc74934e59 DisplayBuffer: refactoring, correct support of replacements
DisplayAtoms now know where they are on the screen and have
line_and_column_at and iterator_at methods.
2011-10-15 04:45:49 +00:00
Maxime Coste
26459abf8a WindowCoord: rename to DisplayCoord and move with DisplayBuffer 2011-10-14 14:29:53 +00:00
Maxime Coste
2d54a7818e Window: privatize coordinates conversion methods 2011-10-12 18:54:48 +00:00
Maxime Coste
be043ffe1e Window: move_cursor_to takes a BufferIterator parameter 2011-10-12 18:53:38 +00:00
Maxime Coste
12535e1099 Window: get rid of select_mode 2011-10-07 14:03:25 +00:00
Maxime Coste
571e4772b4 IncrementalInserter: support OpenLineBelow and OpenLineAbove mode 2011-10-06 21:12:55 +00:00
Maxime Coste
ff730380ed Window: empty_selections -> clear_selections
clear_selections also reset select_mode to Normal,
most editing operations now do a clear_selections.
2011-10-05 14:24:52 +00:00
Maxime Coste
c8cf7bbaa9 Window: add a basic status line 2011-10-04 18:49:41 +00:00
Maxime Coste
ba2800ddac Window: refactor DisplayBuffer generation 2011-09-28 20:54:11 +00:00
Maxime Coste
e619a81375 IncrementalInserter: Append, Insert or Change mode specified at construction 2011-09-28 19:14:39 +00:00
Maxime Coste
43fb64a913 Window: selection behaviour now depends on a window state
more vi-like behaviour, hit the v key to toggle append selection mode,
this means much more keys become available for mapping, as caps are now
longer reserved to append mode.
2011-09-28 14:23:43 +00:00
Maxime Coste
309b722df9 Window: cursors are now implicit, taken from current selections
Window hence guarantees that there is always at least one selection.
2011-09-27 18:45:22 +00:00
Maxime Coste
838ceb5958 Window: add selection_content method
it returns the content of the last selection, or the character under the
cursor if there are no selections.
2011-09-23 14:31:15 +00:00
Maxime Coste
662ba0c904 Selection: do not use [begin, end) semantics but [first, last]
selections are now defined with inclusive iterators, which means that
Selection(cursor, cursor) is a valid selection of the charateter pointed
by cursor.

On the user interface side, that means that the cursor is now part of
the selection, selectors were adapted to this behavior (and word
selectors are now much more intuitive)
2011-09-23 09:17:19 +00:00
Maxime Coste
5a46ad49ea Window: add move_cursor_to method 2011-09-22 14:00:04 +00:00
Maxime Coste
3012f69c4d Selection: fix canonicalize 2011-09-22 13:59:07 +00:00
Maxime Coste
9da8fbe630 Window: add a IncrementalInserter class for insert mode 2011-09-19 21:56:29 +00:00
Maxime Coste
85e2a31b31 Window: code cleanup and more intelligent Selection class 2011-09-17 14:57:35 +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
76b7c60afb Buffer is now responsible for window creation 2011-09-08 14:30:36 +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
f88d1dbe06 Window: basic binding of bufffer undo feature 2011-09-06 18:52:52 +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
535285d9e6 Initial commit 2011-09-02 16:51:20 +00:00