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
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
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
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
9b6639eb27
Remove Editor::move_selections
2013-12-15 14:14:52 +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
2d55ff5feb
Window: forget timestamp when options changes
2013-11-28 18:48:38 +00:00
Maxime Coste
ad275d1d1c
Extract InputHandler from Client
2013-11-14 18:09:15 +00:00
Maxime Coste
90d499b94d
Add a WinClose hook
2013-10-26 18:51:25 +01:00
Maxime Coste
2c09da50be
Add key mapping support
2013-10-25 00:30:46 +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
3862b5cbb8
LineAndColumns: always pass by value
2013-07-26 01:50:09 +02:00
Maxime Coste
d6425f1d50
merge AtomContent into DisplayAtom
2013-07-24 13:55:57 +01:00
Maxime Coste
62fdacb757
Add scroll left/right support
2013-07-24 01:38:30 +02:00
Maxime Coste
8633a37dad
Try to keep the selection start visible if possible
2013-07-24 01:34:00 +02:00
Maxime Coste
c7e52a650d
DisplayLine no longer map to a single buffer line, but to a buffer range
2013-07-24 01:33:12 +02:00
Maxime Coste
486ebed098
try to preserve display column rather than buffer column when moving line
2013-07-23 20:46:15 +02:00
Maxime Coste
2dcdc0cf4b
more horizontal scrolling fixes
2013-06-29 16:50:51 +02:00
Maxime Coste
e510bf8b96
Fix horizontal scrolling support with replaced buffer ranges
...
tab character were not properly handled when scrolling horizontally
2013-06-28 00:03:11 +02:00
Maxime Coste
60dfeb2821
fix highlighting bug with inserting at eol on lines with tabs
2013-06-21 18:50:45 +01:00
Maxime Coste
70bf71e51f
remove Buffer:char_{distance,advance} use line access instead
2013-06-06 19:44:07 +02:00
Maxime Coste
5c2e3b25fa
Window: use AtomContent::length in scroll_to_keep_cursor_visible_ifn
2013-06-04 14:21:07 +02:00
Maxime Coste
4ef1bfa4db
Use coord instead of iterators for selections
2013-06-04 14:21:07 +02:00
Maxime Coste
52b77c1915
window, editor: take coords rather than iterators parameters
2013-05-30 13:59:38 +02:00
Maxime Coste
d5b190369a
DisplayBuffer: use coords rather than iterators
2013-05-30 13:59:38 +02:00
Maxime Coste
81ce4e4720
pass window param to highlighters
2013-05-29 18:58:20 +02:00
Maxime Coste
400e46719d
Add scrolloff option support
2013-05-16 19:22:44 +02:00
Maxime Coste
46deca4f3f
Add zj and zk command for scrolling the window
2013-04-12 01:31:21 +02:00
Maxime Coste
fb87c7ac9f
add Window::display_selection_at(LineCount)
2013-04-11 21:01:00 +02:00
Maxime Coste
270e950cf1
sort includes directives
2013-04-09 20:05:40 +02:00
Maxime Coste
5adee4a6a7
rename assert to kak_assert to avoid collisions
2013-04-09 20:04:11 +02:00
Maxime Coste
42fae29391
Add an 'insert_hide_sel' option, which hides selection when inserting
2013-03-19 14:04:24 +01:00
Maxime Coste
354ae7ad89
Editor: keep selections sorted and use an index for the main one
2013-03-18 19:09:07 +01:00
Maxime Coste
a981d41cde
Editor: replace selections().back() with main_selection()
2013-03-15 18:22:08 +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
6b812d9f6c
Window: segregate builtins highlighters from the others
2013-03-01 14:29:59 +01:00
Maxime Coste
6d4552e7d8
Add an expand_unprintable highlighter which replaces unprintable char with U+XXXX
2013-02-26 14:12:21 +01:00
Maxime Coste
b08749285e
move status line generation code to client manager
2013-02-18 19:03:39 +01:00
Maxime Coste
4eea0a4ce1
Window: try to show as much of the selection as possible
2013-02-12 19:01:25 +01:00
Maxime Coste
9002059c0d
Window: fix display position, count utf8 characters for column
2013-01-17 19:49:49 +01:00
Maxime Coste
c45838cc57
Move Insertion Hooks handing to the input handler
2013-01-17 13:58:57 +01:00
Maxime Coste
621be2ceab
Hooks now takes a non-const context
2013-01-17 13:45:43 +01:00
Maxime Coste
28cf772deb
tweak window status line format
2012-12-28 13:53:00 +01:00
Maxime Coste
cfd7ee049a
move selection updating code out of selection, to DynamicSelectionList
...
this avoids a lot of unnecessary (add|remove)_change_listener as
creating temporary Selections do not call that anymore.
Use can choose between a SelectionList which or a DynamicSelectionList
depending on wethear the buffer will be modified or not during the
selections lifetime.
2012-12-13 18:50:27 +01:00
Maxime Coste
b764a0a63e
Selection: refactoring, move CaptureList to Selection
2012-11-30 18:32:49 +01:00
Maxime Coste
d2f811a8d5
Refactor filter and highlighter registry into a common template
2012-11-23 13:40:20 +01:00
Maxime Coste
11e885e5a5
Cleanups and minor refactoring on Buffer
2012-11-22 18:54:37 +01:00
Maxime Coste
3b5530ac09
rename (hook|option)_manager to (hook|option)s.
...
And Global(Hook|Option)Manager to Global(Hook|Option)s
2012-11-22 13:50:29 +01:00
Maxime Coste
a41bb34b21
Window: maintain the timestamp of last display buffer update
2012-11-05 19:54:09 +01:00
Maxime Coste
ea17525b2a
Window: sanitize position in set_position
2012-10-31 14:28:47 +01:00
Maxime Coste
98b6618658
merge contiguous DisplayAtoms after highlighting DisplayBuffer
2012-10-22 13:20:02 +02:00
Maxime Coste
4f1ab5b749
fix Window::scroll_to_keep_cursor_visible_ifn
2012-10-11 14:23:20 +02:00
Maxime Coste
0ce6bd9bf5
use ByteCount instead of CharCount when we are really counting bytes
...
(that is most of the time when we are not concerned with displaying)
2012-10-11 00:41:48 +02:00
Maxime Coste
801e3eaae2
Add a Window::display_position(const BufferIterator&) method
2012-09-30 16:22:03 +02:00
Maxime Coste
a8d2482eb6
Editor now stores selections as SelectionAndCapturesList
2012-09-26 20:33:47 +02:00
Maxime Coste
730f39aaa0
remove selection stack from editor
2012-09-24 20:47:06 +02:00
Maxime Coste
e4fd839dda
use a strongly typed int CharCount for character counts
2012-08-23 23:56:35 +02:00
Maxime Coste
0d8cce2728
use a strongly typed int LineCount for line counts
2012-08-22 23:33:52 +02:00
Maxime Coste
c9a7cf50f3
add Window::center_selection method
2012-08-21 20:05:56 +02:00
Maxime Coste
9fcb89c8fc
Window: tolerate invisible cursor when it is the end of the buffer
2012-08-02 07:04:42 +02:00
Maxime Coste
1d5180e782
Window: handle horizontal scrolling correctly
...
Window::scroll_to_keep_cursor_visible_ifn now highlights the cursor
line in order to find its real display position (for example if the
number_lines highlighter is present it may modify the position).
2012-07-15 01:48:50 +02:00
Maxime Coste
03d8efc249
DisplayBuffer: add range and compute_range methods
2012-07-12 23:51:13 +02:00
Maxime Coste
b1a087485c
DisplayBuffer rewrite, a DisplayBuffer is now a list of DisplayLines
...
Code is now greatly simplified using this architecture, and
DisplayAtoms no longer know their DisplayCoords and can be in any
order.
2012-07-12 23:19:10 +02:00
Maxime Coste
71fcc123bc
Window: remove iterator_at and line_and_column_at methods
2012-07-12 14:28:58 +02:00
Maxime Coste
5cbded8221
make display buffers and highlighters handle better longer than display lines
...
still work in progress, I think the whole display system will in fact need
a rewrite.
2012-07-03 23:23:07 +02:00
Maxime Coste
f7ee2801e9
Windows call the WinSetOption hook when an option changes
2012-06-14 13:19:38 +00:00
Maxime Coste
c0987ebacc
Add a FilterGroup, and cleanup HighlighterGroup
...
FilterGroup is similar to HighlighterGroup, it permits grouping
together filters for easy removal.
2012-06-12 18:24:29 +00:00
Maxime Coste
9bcfda3226
HookManager are now hierarchical from window to buffer to global
...
window hooks also executes buffer hook which also execute global hooks
2012-06-07 13:29:44 +00:00
Maxime Coste
6fa40796e7
Fix Window::scroll_to_keep_cursor_visible_ifn
2012-05-29 00:14:05 +00:00
Maxime Coste
9337938403
replace std::string references with String
2012-04-14 01:17:09 +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
9444c84b1c
rename HooksManager to HookManager
2012-04-03 12:01:01 +00:00
Maxime Coste
f43d206e4e
remove unused measure_string from window.cc
2012-03-26 23:13:09 +00:00
Maxime Coste
3c798a4ee8
remove useless Window::cursor_{position,iterator}
2012-03-21 19:26:42 +00:00
Maxime Coste
df0f7b4689
rename BufferString to String
2012-03-08 21:23:29 +00:00
Maxime Coste
c99a6a3e4c
fix last line handling in window display buffer
2012-03-06 14:27:49 +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
382d5a334c
do not use a DynamicBufferIterator in IncrementalInserter::IncrementalInserter
2012-01-25 18:59:11 +00:00
Maxime Coste
d1c29d2b78
moving no longer clears multiple selections
2012-01-25 14:23:02 +00:00
Maxime Coste
e0b216d576
HooksManager: do not propagate hooks runtime exception
2012-01-24 23:17:26 +00:00
Maxime Coste
c38f244c06
Window have it's own hooks manager
2012-01-23 13:57:24 +00:00
Maxime Coste
945ad361fb
HooksManager: forward declare Context instead of including context.hh
2012-01-23 13:56:43 +00:00
Maxime Coste
db9040e29e
HooksManager: extract the Singleton version as GlobalHooksManager
2012-01-23 13:40:42 +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
9557167f26
<space> with a count argument replaces current selections with the counth selection.
2012-01-09 14:28:01 +00:00
Maxime Coste
67c08e598b
IncrementalInserter: preserve selection through hook call
2011-12-21 19:06:51 +00:00
Maxime Coste
f77fc3980b
Window: store a stack of selections
2011-12-21 19:06:26 +00:00
Maxime Coste
70bb4847ee
IncrementalInserter: catch exception thrown by the hook
2011-12-21 18:57:07 +00:00
Maxime Coste
6c817c8117
Window: do not manage undo groups when an inserter is active
2011-12-21 18:56:32 +00:00
Maxime Coste
ba1fe056f4
Add an exec command, similar to vim normal command
2011-12-20 19:22:05 +00:00
Maxime Coste
7116ed6d61
Window: throw when multiselect results in no selections
2011-12-20 19:27:13 +00:00
Maxime Coste
e77f58c010
better rvalue reference forwarding
2011-12-07 18:57:07 +00:00
Maxime Coste
2239fb6e49
Filters: move from buffer to window
2011-12-07 14:29:10 +00:00