Maxime Coste
0b63074f90
extract main kakoune code to a kakoune function
2013-09-19 19:53:04 +01:00
Maxime Coste
03588f1b78
Support multiple selections per ligne when aligning
2013-09-18 18:54:04 +01:00
Maxime Coste
e70d75d6a6
Only redraw clients after handling all available events
2013-09-17 18:51:14 +01:00
Maxime Coste
7fef7ec063
Add a InputMode::on_replaced virtual method.
...
Destructors are not a good place to run mode exit hooks, as they
wont be called until the next mode trash clearing, so we now call
this virtual method on the previous mode just before it gets replaced.
2013-09-16 19:38:28 +01:00
Maxime Coste
168b4b775b
Do not clear Client::m_mode_trash in handle_key, but in handle_available_input
...
handle_key can be called from exec_keys while running a hook, and a previous
key in exec_keys could have changed the mode. This would make the mode that
runned the hook deleted when the controls returns to it.
handle_available_input should always be called at top level, so can safely
clear the mode trash.
2013-09-16 19:25:18 +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
49903523a7
Resurect Client::handle_available_input()
2013-09-16 18:48:41 +01:00
Maxime Coste
27a1e70b01
Rework client name change
2013-09-13 00:01:47 +02:00
Maxime Coste
000af8e206
Fix clang.kak, now that eval -draft does not use the client user interface
2013-09-12 23:52:43 +02:00
Maxime Coste
fd021de7d7
use directly context.client() for getting the kak_client env var value
2013-09-12 23:49:08 +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
96fc340a5c
add alt-& which aligns inserting spaces before selection start
2013-09-02 13:30:46 +01:00
Maxime Coste
70cd671ef6
support absolute filenames in insert mode filename completion
2013-08-29 13:50:55 +01:00
Maxime Coste
2125d95076
Use the Information color alias for auto info boxes
2013-08-29 13:50:24 +01:00
Maxime Coste
1d790541f5
handle client disconnection without crashing
2013-08-28 19:20:12 +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
3150fe97cf
selections env var is : separated, and : in selections are escaped
2013-08-28 18:52:29 +01:00
Maxime Coste
535a454349
Line completion: sort and uniquify lines
2013-08-06 11:35:38 +02:00
Maxime Coste
9148b1ae92
Add line completion
2013-08-05 10:23:13 +02:00
Maxime Coste
c05f9f31dd
add support for explicit insert mode completion using C-x prefix
2013-08-04 19:34:08 +02:00
Maxime Coste
0f4cecfa3e
BufferCompleter refactoring, add support for explicit filename completion with c-f
2013-08-04 18:59:31 +02:00
Maxime Coste
3fe0b8e719
Move insert mode completion functions into BufferCompleter
2013-08-04 17:42:09 +02:00
Maxime Coste
6b66a3dfe5
Add support for filename insert mode completion
2013-08-02 17:58:37 +01:00
Maxime Coste
af17010524
contains: do not check if container is empty
2013-08-01 18:35:13 +01:00
Maxime Coste
a2577b4180
buffer: move Buffer::Flags operator as friends defined inside Buffer
2013-08-01 00:28:01 +02:00
Maxime Coste
c6f08f6c34
fix c++11 union use in remote.cc
2013-07-31 00:32:51 +02:00
Maxime Coste
3c8df764be
fix insert mode erase utf-8 handling, add unit test
2013-07-30 19:18:01 +01:00
Maxime Coste
c84b861d2f
remove useless SelectionList copy in keep
2013-07-29 13:51:07 +01:00
Maxime Coste
4f452474c8
non-regex based implementation of split_lines
2013-07-29 13:50:31 +01:00
Maxime Coste
af8e8d27d4
Minor code cleanups
2013-07-28 16:40:02 +02:00
Maxime Coste
5dfd4a9869
more auto info for normal commands waiting for a key press
2013-07-27 15:58:06 +02:00
Maxime Coste
0267540985
Do not select the first line indent in inner indent select
2013-07-27 15:37:28 +02:00
Maxime Coste
740a6562d9
enable autoinfo by default
2013-07-26 18:52:25 +01:00
Maxime Coste
c3359f7edc
fix some auto info boxes text
2013-07-26 18:52:05 +01:00
Maxime Coste
8281d8c626
git-tools: use : as list separator, escape it correctly
2013-07-26 02:01:01 +02:00
Maxime Coste
233cb530fc
read<T>(int socket): type aliasing compliance
2013-07-26 01:50:36 +02:00
Maxime Coste
a4138201b0
Key: always pass by value
2013-07-26 01:50:36 +02:00
Maxime Coste
eedd37c09a
memoryview: always pass by value
2013-07-26 01:50:36 +02:00
Maxime Coste
3862b5cbb8
LineAndColumns: always pass by value
2013-07-26 01:50:09 +02:00
Maxime Coste
5d681f9efe
StronglyTypedNumber: take parameters by value
2013-07-26 01:49:57 +02:00
Maxime Coste
d5453152b3
Color,ColorPair: always pass by copy
2013-07-26 00:54:58 +02:00
Maxime Coste
8f73d3c173
fix last eol matching in regex highlighters
2013-07-25 00:18:50 +02:00
Maxime Coste
3da97c4269
decl command support bool type options
2013-07-24 22:56:21 +02:00
Maxime Coste
38c7197770
go back to : as set/list separator in options
2013-07-24 22:41:41 +02:00
Maxime Coste
d29fb6f2c4
list,set and tuple options support escaping the separator
2013-07-24 22:41:13 +02:00
Maxime Coste
b5db256384
string escaping support functions
...
the split function now takes an additional escape parameter and
does not split on separators that have the escaper before it.
An utility escape function that adds escape before separators
is also added.
2013-07-24 22:37:17 +02:00
Maxime Coste
d6425f1d50
merge AtomContent into DisplayAtom
2013-07-24 13:55:57 +01:00
Maxime Coste
f6308409a1
pipe: auto insert and end of line if needed
2013-07-24 13:38:26 +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
5a6922a045
expand_unprintable: use iscntrl rather than isprint which does not work as expected
2013-07-23 20:42:35 +02:00
Maxime Coste
c58bab0f66
Add indent object type (bound to i)
2013-07-23 19:12:53 +01:00
Maxime Coste
8ab7496058
use C isalnum instead of C++ std::isalnum
2013-07-15 13:49:50 +01:00
Maxime Coste
ee2d18df04
fix selection to search pattern word begin detection
2013-07-15 13:49:04 +01:00
Maxime Coste
90b92aed3c
add support for tolower (), toupper (~), and swap case become alt-
2013-07-12 13:55:48 +01:00
Maxime Coste
81b5c477f6
Compile with gnu++11 so that cygwin is happy, and remove unneeded -lmenu
2013-07-12 13:17:12 +01:00
Maxime Coste
fcb3594e4a
NCursesUI::draw_menu: be tolerant when the menu_win was not created
2013-07-12 13:15:56 +01:00
Maxime Coste
1388c0d540
Editor: clamp coordinates in select(BufferCoord)
2013-07-12 13:15:31 +01:00
Maxime Coste
0ba1ab04f0
cpp.kak: wrap trailing whitespace cleanup hook in a try catch
2013-07-12 13:13:54 +01:00
Maxime Coste
37807ba19b
Add support for arrow keys in normal mode
...
use a Direction enum instead of a bool forward parameter
2013-07-02 19:48:05 +01:00
Maxime Coste
6484fead0c
replace with char only replaces when entered character is printable
2013-07-02 19:48:04 +01:00
Maxime Coste
c1b2f7ef6a
use C locale function instead of C++ ones
2013-07-02 19:48:04 +01: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
5b4ef23b9d
more tolerant Buffer::string
2013-06-27 23:49:34 +02:00
Maxime Coste
b1f31d2e12
change string parsing behaviour in command manager
...
* single and doubly quoted strings correctly remove the \ when their
delimiter is quoted ('\'' is interpreted as ', not \')
* %{} strings do not support quoting when using matching pairs, so
%{\} is interpreted as \, however when using same ending character
as delimiter quoting still works: %~\~~ is interpreted as ~.
2013-06-27 19:07:26 +01:00
Maxime Coste
56bb0f9f2c
clang.kak: use socat in unidirectional mode
2013-06-21 18:51:18 +01: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
c6bf0b4cc3
add missing errno include to file.cc
2013-06-19 19:29:05 +01:00
Maxime Coste
a3e032abd6
enable /proc/ method for runtime_directory with cygwin
2013-06-19 19:29:05 +01:00
Maxime Coste
6d125e6c36
do not use std::{to_string,stoi} as they cause problems with cygwin
2013-06-19 19:29:05 +01:00
Maxime Coste
a642026e7c
more portable use of ncurses
2013-06-19 19:29:04 +01:00
Maxime Coste
3e9439ac9f
restore compilation with gcc 4.7
2013-06-18 21:44:00 +02:00
Maxime Coste
ea9414fa21
Fix input completion on multiple selection
2013-06-12 00:43:11 +02:00
Maxime Coste
bd8daac3a1
Fix UndoGroupOptimizer
2013-06-12 00:14:05 +02:00
Maxime Coste
7306f6b33b
Buffer: always use {line_count(), 0} as end in Modifications
2013-06-06 20:02:20 +02:00
Maxime Coste
59b996be75
add an UndoGroupOptimizer test
2013-06-06 19:54:13 +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
cf454ef904
UndoGroupOptimizer: fix count_byte_to
2013-06-06 19:44:08 +02:00
Maxime Coste
357799c966
replace remaining plain assert with kak_assert
2013-06-06 19:44:08 +02:00
Maxime Coste
3d8eecbbb6
minor cleanups Editor
2013-06-06 19:44:08 +02:00
Maxime Coste
bd504058d9
remove unused Buffer::char_at
2013-06-06 19:44:07 +02:00
Maxime Coste
12d3b64a1b
avoid_eol: use direct line access
2013-06-06 19:44:07 +02:00
Maxime Coste
58ff97d51d
use_selection_as_search_pattern: use iterators instead of coords
2013-06-06 19:44:07 +02:00
Maxime Coste
43ff1909fb
add utf8::make_iterator helper function
2013-06-06 19:44:07 +02:00
Maxime Coste
245e68e26e
utf8_iterators: rename underlying_iterator to base
2013-06-06 19:44:07 +02:00
Maxime Coste
70bf71e51f
remove Buffer:char_{distance,advance} use line access instead
2013-06-06 19:44:07 +02:00
Maxime Coste
580749a91d
Buffer: remove line_length and replace line_content with operator[]
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
777158e86d
remove BufferIterator::is_valid()
2013-06-04 18:56:28 +02:00
Maxime Coste
a23aa10797
remove BufferIterator::buffer()
2013-06-04 18:55:06 +02:00
Maxime Coste
9fb4d42408
remove BufferIterator::is_{begin,end}
2013-06-04 18:53:56 +02:00
Maxime Coste
51acd456cc
remove BufferIterator::{line,column}()
2013-06-04 18:53:28 +02:00
Maxime Coste
ee22596d61
tweak Buffer::{,char_}prev
2013-06-04 18:53:28 +02:00
Maxime Coste
cf1f26ac91
fix Editor::move_selections(LineCount...) on buffer bounds
2013-06-04 18:53:13 +02:00
Maxime Coste
cc70e3ed70
selectors.cc: avoid dereferencing buffer end
2013-06-04 14:21: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
76f55f5256
remove useless iterator_at calls
2013-06-04 14:21:07 +02:00
Maxime Coste
c4f9253634
Remove Buffer::iterator_at_line_{begin,end}, use iterator_at(line{,+1})
2013-06-04 14:21:07 +02:00
Maxime Coste
503f0cce25
IncrementalInserter: use coords instead of iterators
2013-06-04 14:21:07 +02:00
Maxime Coste
fb41e1fdf9
tweak Buffer::do_insert
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
02b33c7d8f
Buffer: add methods for char access instead of byte access
2013-06-03 18:56:48 +02:00
Maxime Coste
b198f6a5fb
Fix select_whole_paragraph so that buffer end is not selected
2013-06-03 14:27:51 +02:00
Maxime Coste
24ffd6abae
DynamicSelectionList check that buffer end is not selected
2013-06-03 14:26:05 +02:00
Maxime Coste
b51799a2b2
Explicitly pass buffer to selectors
2013-06-01 14:22:57 +02:00
Maxime Coste
3453ebbd52
BufferChangeListener: pass buffer to on_{inser,erase}
2013-06-01 00:48:46 +02:00
Maxime Coste
8ddeb141c8
Fix insert completion at beginning of buffer
2013-05-30 18:52:03 +02:00
Maxime Coste
2d96f853f8
Add utf8::codepoint_size function
2013-05-30 18:49:50 +02:00
Maxime Coste
28e127a48a
remove avoid_eol parameter from Buffer::{iterator_at,clamp}
2013-05-30 14:23:25 +02:00
Maxime Coste
07c8379313
BufferIterator are Random Access iterators
2013-05-30 14:05:05 +02:00
Maxime Coste
d2df6a9f15
remove BufferIterator::clamp
2013-05-30 14:00:41 +02:00
Maxime Coste
5e64f6d1ec
remove Selection::buffer
2013-05-30 13:59:38 +02:00
Maxime Coste
5b0087b545
InputHandler: pass buffer and BufferCoord to completers
2013-05-30 13:59:38 +02:00
Maxime Coste
ae947b456d
remove BufferIterator::offset
2013-05-30 13:59:38 +02:00
Maxime Coste
dbb1c57ec9
minor code cleanups in filters.cc
2013-05-30 13:59:38 +02:00
Maxime Coste
557acc5068
reorganize check_invariant in SelectionList
2013-05-30 13:59:38 +02:00
Maxime Coste
7f8d5c1fd0
Remove Range::content
2013-05-30 13:59:38 +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
a07fde181a
Add Buffer::{next,prev,at}(BufferCoord) methods and use them in iterators
2013-05-30 13:59:38 +02:00
Maxime Coste
9a80a58ff4
buffer end should not be in a selection
2013-05-30 13:59:38 +02:00
Maxime Coste
462da52218
InputHandler: less iterators, more coords
2013-05-30 13:59:38 +02:00
Maxime Coste
52b77c1915
window, editor: take coords rather than iterators parameters
2013-05-30 13:59:38 +02:00
Maxime Coste
4f1ba860f8
minor tweak buffer iterator
2013-05-30 13:59:38 +02:00
Maxime Coste
7f17644a6b
Buffer insert and erase takes coord rather than iterators
2013-05-30 13:59:38 +02:00
Maxime Coste
2902cc3275
BufferIterator convert implicitly to const BufferCoord&
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
97df6f2222
AtomContent uses coord rather than iterators
2013-05-29 18:58:20 +02:00
Maxime Coste
81ce4e4720
pass window param to highlighters
2013-05-29 18:58:20 +02:00
Maxime Coste
6c290eff9a
Buffer::do_{erase,insert} takes coord parameters rather than iterators
...
BufferChangeListeners do as well use coord rather than iterators
2013-05-29 18:58:20 +02:00
Maxime Coste
f23f48172f
Buffer: add some method to work directly with coord instead of iterators
2013-05-29 18:58:20 +02:00
Maxime Coste
6cb8d69d29
Context: return DynamicSelectionLists in jump_{forward,backward}
2013-05-29 18:56:14 +02:00
Maxime Coste
9630990b74
Remove Selection::avoid_eol, move as static func in editor.cc
...
Conflicts:
src/editor.cc
2013-05-29 18:53:57 +02:00
Maxime Coste
9991292bd3
tweak number line highlighter style
2013-05-24 18:39:28 +02:00
Maxime Coste
ad178e383b
insert mode completion for all selection that matches the main one prefix
2013-05-21 19:21:55 +02:00
Maxime Coste
eab1213555
throw an error when gf does not find any file to open
2013-05-21 14:01:04 +02:00
Maxime Coste
258637222f
Word completion can optionally look for candidates in all buffers
...
completers option accept word=buffer or word=all values
2013-05-20 14:10:53 +02:00
Maxime Coste
f3ad51444d
move line_with_cursor as LineEditor::build_display_line
2013-05-17 14:29:15 +02:00
Maxime Coste
48f98eae97
Allow macros to call other macros, only recursive macro calls are forbidden
2013-05-17 14:22:48 +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
37a2363301
cpp.kak: fix alt now that alt_dirs is a proper list
2013-05-17 14:08:02 +02:00
Maxime Coste
585c8ba3cf
Show an info box with available option when waiting for a key
...
Controled with the autoinfo option (disabled by default)
2013-05-16 22:33:48 +02:00
Maxime Coste
c91cea9dc3
fix ncurses info box placement
2013-05-16 22:33:28 +02:00
Maxime Coste
23f43376df
fix NCurses info box, avoid trailing space on each lines
2013-05-16 21:46:15 +02:00
Maxime Coste
b2dffbabb6
more robust NCursesUI::menu_show
2013-05-16 21:44:58 +02:00
Maxime Coste
310e0f5bd3
cpp.kak: fix alt_dirs option default value
2013-05-16 19:23:54 +02:00
Maxime Coste
400e46719d
Add scrolloff option support
2013-05-16 19:22:44 +02:00
Maxime Coste
389438164d
add '&' for aligning selections
2013-05-15 18:47:50 +02:00
Maxime Coste
64b20729a5
Full object selection support for paragraphs and sentences
2013-05-15 14:24:09 +02:00
Maxime Coste
ef7d90cbfa
colalias can reference another alias
2013-05-15 14:01:23 +02:00
Maxime Coste
1fb971e389
Editor::select(Selection, SelectMode::Extend) now only keeps the extended main selection
2013-05-14 13:58:41 +02:00
Maxime Coste
9cbf790d13
tweak Range::merge_with behaviour
2013-05-14 13:58:35 +02:00
Maxime Coste
2b12b72d6e
fix overlaps(Range, Range)
2013-05-14 13:58:19 +02:00
Maxime Coste
42be2b23ca
fix regex prompt whith empty regex
2013-05-13 18:43:38 +02:00
Maxime Coste
26f0fd4cc6
Use more std::* for string handling
2013-05-13 18:43:38 +02:00
Maxime Coste
56ab33c9d6
support specifying colors with RGB components
2013-05-13 14:25:05 +02:00
Maxime Coste
3a49e05832
Option can be declared with a checker function.
...
The checker function may throw if to be set option value is invalid.
Implemented with the completers option.
2013-05-06 13:52:41 +02:00
Maxime Coste
c1615b5c15
add unordered_set option support, use it for completers
2013-05-06 13:52:20 +02:00
Maxime Coste
2342e7686f
add specialized contains function for unordered_set
2013-05-06 13:51:23 +02:00
Maxime Coste
42d7fcacd8
add a completers option for specifying which completer to use for BufferCompleter
2013-05-03 18:44:27 +02:00
Maxime Coste
39f9ca33c8
BufferCompleter: avoid modifying the buffer when not needed
2013-05-03 18:44:27 +02:00
Maxime Coste
33740d06ee
Editor: tweak behaviour on undo/redo when selecting modified ranges
2013-05-03 18:44:26 +02:00
Maxime Coste
564cfb084e
Editor: undo and redo select all ranges modified instead of the last one
2013-05-03 18:44:26 +02:00
Maxime Coste
4c4b6a404d
add SelectionList::check_invariant
2013-05-03 18:44:26 +02:00
Maxime Coste
9b3e0c8055
Move selection update code to SelectionList
2013-05-02 19:04:59 +02:00
Maxime Coste
4ab5c7a203
DisplayBuffer: optimize Text and ReplacedBufferRange as well
2013-05-02 18:57:15 +02:00
Maxime Coste
d238707e6d
Fix UndoGroupOptimizer
2013-04-30 19:01:20 +02:00
Maxime Coste
b69c9ea753
add paragraph (p) object
2013-04-30 14:29:18 +02:00
Maxime Coste
4bb3863f95
add sentence (s) object
2013-04-30 14:21:48 +02:00
Maxime Coste
bef48b7df0
Fix UndoGroupOptimizer
2013-04-29 14:25:38 +02:00
Maxime Coste
11bc24f992
FlagLines: use a shared updaters for options
...
previously, having two windows showing the same buffer with
the same line flags would have updated the options twice, resulting
in wrong lines in option. Now line flags options are updated only
once by a shared object along all FlagLines highlighter using the
same option.
2013-04-29 14:20:42 +02:00
Maxime Coste
ba562367f0
catch errors when opening files given on command line
2013-04-29 13:50:13 +02:00
Maxime Coste
4a0aa96160
fix bug in compact_path
2013-04-29 13:49:47 +02:00
Maxime Coste
d49f35817e
fix handling of ~ in filenames so that :edit ~ does not open a file named '~'
2013-04-26 20:18:16 +02:00
Maxime Coste
70d65dac79
git-tools.kak: support add and diff command
2013-04-26 18:48:31 +02:00
Maxime Coste
8bfe2d62e5
echo: rename -col option to -color
2013-04-26 18:48:31 +02:00
Maxime Coste
7ce3212fb2
When committing an undo group, run an optimization pass on it
...
With incremntal insertion, undo groups tends to be a lot of single
character insertion/deletions at the same point, but the end
result is most of the time a single string insertion. Buffer
now tries to optimize the undo group.
2013-04-26 18:48:31 +02:00
Maxime Coste
b16c967f9c
Buffer::Modification::Position is a BufferCoord instead of a BufferIterator
2013-04-26 18:46:42 +02:00
Maxime Coste
f8c3b6c9ef
Buffer: rename character_count method to byte_count
2013-04-24 13:56:36 +02:00
Maxime Coste
7c4e79ef98
BufferCompleter: change behaviour to handle non prefix completions
...
Try to have a nice behaviour when the completions do not share
a prefix with the [completion begin, cursor pos] string.
For example an address book completion may provide candidates
for frrrwww that are 'Maxime Coste <frrrwww@gmail.com>', not
having frrrwww as a prefix.
2013-04-23 19:08:50 +02:00
Maxime Coste
ef07b98215
utils: add is_in_range function
2013-04-23 19:08:44 +02:00
Maxime Coste
6913510e67
use alt-J for joining and selecting the spaces replacing line breaks
2013-04-23 18:54:31 +02:00
Maxime Coste
72ef210e1b
Buffer: add is_valid(BufferCoord) method
2013-04-23 18:46:18 +02:00
Maxime Coste
dd3a7f739d
FlagLines: do not create a new local option in window if the option comes from the buffer
2013-04-23 14:03:54 +02:00
Maxime Coste
c844f6f5cf
git-tools.kak: use a single git command with subcommands
2013-04-23 14:03:23 +02:00
Maxime Coste
6df60f5d2f
use a DynamicSelectionList when searching as the buffer may be modified during the prompt
2013-04-22 18:49:52 +02:00
Maxime Coste
86f6282cbe
selecting a surrounding object goes up one level if what we find is already selected
2013-04-22 14:18:49 +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
362e346728
rename go function to goto_commands
2013-04-19 13:49:47 +02:00
Maxime Coste
38bd8c243f
add KakBegin and KakEnd hooks
2013-04-19 13:45:44 +02:00
Maxime Coste
ca69981cc6
Ncurses: display status line in terminal title as well
2013-04-18 20:22:19 +02:00
Maxime Coste
7af98eae43
add man.kak which provides a man command for displaying man pages in kakoune
2013-04-18 19:07:31 +02:00
Maxime Coste
5b61672948
add window_{width,height} env var
2013-04-18 14:28:53 +02:00
Maxime Coste
9a361e2657
Tweak status line
2013-04-18 14:28:35 +02:00
Maxime Coste
f4e7da8826
change swapped_case implementation
2013-04-17 19:31:31 +02:00
Maxime Coste
b229584e95
ShellManager: env_var_regex is an implementation detail
2013-04-17 19:26:44 +02:00
Maxime Coste
0a8f51bddd
ctags.kak: fix zc changed to vc
2013-04-17 19:15:34 +02:00
Maxime Coste
8d83a5ff9e
toolsclient option support is back, add docsclient for git-diff
2013-04-17 19:15:15 +02:00
Maxime Coste
021756dfd4
redeclaring an option with the same type is not an error
2013-04-17 19:10:51 +02:00
Maxime Coste
21f487417b
context_wrap options are allowed only at start
2013-04-17 19:10:06 +02:00
Maxime Coste
d3961768ec
add alt-X for trimming non full lines
2013-04-16 14:30:11 +02:00
Maxime Coste
979cfc1ff2
normal.cc: remove useless do_ prefix on function names
2013-04-16 14:08:15 +02:00
Maxime Coste
5b50b32e68
move view commands to v prefix instead of z
2013-04-16 13:54:04 +02:00
Maxime Coste
485a50bb4b
handle client_removed exception out of ClientManager as well
2013-04-15 18:55:41 +02:00
Maxime Coste
da4be95c90
Handle SIGHUP gracefully
2013-04-15 18:50:45 +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
385241d2c0
remove String::replace, use boost::regex_replace directly
2013-04-12 19:16:55 +02:00
Maxime Coste
b6d21514e4
BufOpen hook is only called for file buffers
2013-04-12 19:11:28 +02:00
Maxime Coste
5653af15ed
move normal mode implementation to normal.{cc,hh}
2013-04-12 14:28:13 +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
46deca4f3f
Add zj and zk command for scrolling the window
2013-04-12 01:31:21 +02:00
Maxime Coste
e4d87ee1f1
hide ncurses.h include in ncurses.cc
2013-04-12 01:28:22 +02:00
Maxime Coste
e68f3cfe35
git-tools.kak: initial git-show command
2013-04-11 23:09:42 +02:00
Maxime Coste
1b5760f1a1
delete buffer if needed when creating a scratch buffer
2013-04-11 23:09:17 +02:00
Maxime Coste
dcc054a785
git-tools: fix git-diff-show
2013-04-11 22:41:43 +02:00
Maxime Coste
3f5dc9e1cb
ctags.kak: <a-c> is now zc
2013-04-11 21:17:17 +02:00
Maxime Coste
99bb24dd09
add z prefixed 'window commands'
...
* zz or zc for centering selection on window (replaces alt-c)
* zt and zb for placing the main selection on top/bottom
2013-04-11 21:01:27 +02:00
Maxime Coste
fb87c7ac9f
add Window::display_selection_at(LineCount)
2013-04-11 21:01:00 +02:00
Maxime Coste
301921cd45
remove hooks when needed in rc files
2013-04-11 14:30:02 +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
172f46f679
idvaluemap: add a remove_all method
2013-04-11 14:27:32 +02:00
Maxime Coste
4cf7c4175a
HookManager: write to debug when a hook fails
2013-04-11 13:58:09 +02:00
Maxime Coste
35d0d5b2ea
exceptions: use const char* what() instead of String description()
2013-04-11 13:57:35 +02:00
Maxime Coste
c699172110
highlight strings after macros
2013-04-11 13:47:15 +02:00
Maxime Coste
8b829d1cdf
display character column instead of byte column in status line
2013-04-11 13:45:28 +02:00
Maxime Coste
1398641d22
Add gt, gb and gc to goto the first/last/middle displayed line
2013-04-10 19:02:28 +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
441f9a69ef
InputHandler: auto leave insert mode when editor changed
2013-04-10 14:30:32 +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
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
34b8604f90
move context implementation to context.cc
2013-04-09 19:39:03 +02:00
Maxime Coste
240e0321e8
ge goto end, last character of buffer
2013-04-09 19:32:44 +02:00
Maxime Coste
7f535988f0
gg is back to goto top
2013-04-09 19:32:26 +02:00
Maxime Coste
829876a6fa
Context: push_jump does not allow the same jump to be present multiple times
2013-04-09 14:29:28 +02:00
Maxime Coste
5b1839ab75
BufferIterator: allow operator{==,!=} for different buffers
2013-04-09 14:28:03 +02:00
Maxime Coste
61293e8d60
use gk and gj for goto first/last line instead of gt and gb
2013-04-09 14:23:26 +02:00
Maxime Coste
43b5bd5260
add ga binding to go to last buffer
2013-04-09 14:22:21 +02:00
Maxime Coste
7b94925898
force redraw window if needed in context_wrap
2013-04-09 14:21:48 +02:00
Maxime Coste
624c112d08
tweak prompt text
2013-04-06 15:43:33 +02:00
Maxime Coste
be9bfa479f
use more explicit prompts for search and pipe, use color to validate
2013-04-06 13:02:16 +02:00
Maxime Coste
1ab8120147
refactor regex based selectors, move regex construction out of them
2013-04-05 19:28:08 +02:00
Maxime Coste
c53319ce5e
refactor regex prompting commands
2013-04-05 18:29:05 +02:00
Maxime Coste
9bb9eda302
Dynamically change prompt color for regex prompt depending on regex validity
2013-04-04 19:09:34 +02:00
Maxime Coste
6e2fa38c15
InputHandler::prompt takes a color pair to use
2013-04-04 19:09:19 +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
1fd99e7e88
do not check buffer invariant in do_{erase,insert} as this cause O(n²) behaviour
2013-04-04 14:04:37 +02:00
Maxime Coste
4fbe2dc6bc
compile with -pedantic option and fix warnings
2013-04-04 14:04:37 +02:00
Maxime Coste
4aa5a9a3f6
display a message in the status line when yanking
2013-04-03 19:18:17 +02:00
Maxime Coste
c6262fc5e1
use Y for concatenated yank
2013-04-03 19:14:38 +02:00
Maxime Coste
d56f6444b5
Add alt-[kK] for keeping only selections matching/not matching a given regex
2013-04-03 19:07:43 +02:00
Maxime Coste
5bb8e656c5
Editor: fix utf8 handling in prepare_insert
2013-04-03 18:52:49 +02:00
Maxime Coste
72395840f9
Makefile: hide object files
2013-04-03 18:52:16 +02:00
Maxime Coste
0395f3b9fc
fix compilation with clang++
2013-04-03 18:51:40 +02:00
Maxime Coste
161fab13f7
complete_opt: accept an optional length in completion desciptor
2013-04-02 19:57:39 +02:00
Maxime Coste
aa44d05ede
add date information to git-blame
2013-04-02 18:57:02 +02:00
Maxime Coste
3a351aa436
Change list separators to ; and tuple separators to |
2013-04-02 18:56:09 +02:00
Maxime Coste
07f3bbe523
add alt-* for not smart set search pattern to selection
2013-04-02 18:46:33 +02:00
Maxime Coste
0550da2211
add <lt> and <gt> key name
2013-04-02 18:41:45 +02:00
Maxime Coste
b62c78f9e9
ConnectionAccepter: fix socket fd leak
2013-04-02 14:27:04 +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
7bf73b5896
OnScopeEnd: move parameter instead of copying it
2013-04-02 14:03:22 +02:00
Maxime Coste
e2d64b01d5
ClientAccepter triggers window redrawing after executing a command
2013-04-02 14:00:37 +02:00
Maxime Coste
cd16a7ff18
FlagLines triggers a window redraw when option is modified
2013-04-02 13:58:28 +02:00
Maxime Coste
e5215e7138
Window: move highlighters after options so that they can reference it
2013-04-02 13:58:04 +02:00
Maxime Coste
b9f5dbd3b5
add an OptionManagerWatcher_AutoRegister class
2013-04-02 13:57:04 +02:00
Maxime Coste
a18241a03b
Extract AutoRegister logic to a helper class
2013-04-02 13:56:30 +02:00
Maxime Coste
b266035c71
fix String::String(Codepoint, CharCount)
2013-04-02 13:42:24 +02:00
Maxime Coste
e070e738f1
Set default shell to bash, as most kak files requires it
2013-04-01 03:49:30 +02:00
Maxime Coste
75fae291e1
Fix flags width handling in FlagLine highlighter
2013-04-01 03:49:30 +02:00
Maxime Coste
f4b3510b14
add git-blame command to git-tools.kak
2013-04-01 03:49:30 +02:00
Maxime Coste
6c2430ce08
FlagLines updates the lines in the option according to buffer modifications
2013-03-31 14:53:32 +02:00
Maxime Coste
22c34b79f6
Move change listener registration to BufferChangeListener_AutoRegister
...
DynamicSelectionList now just inherit from this class, so that
the registration logic can be shared.
2013-03-31 14:53:32 +02:00
Maxime Coste
dbbe455eb1
add git-tools.kak, with experimental git diff display as line flags
2013-03-31 14:53:32 +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
8b821205da
fix BufferIterator::offset
2013-03-29 19:35:48 +01:00
Maxime Coste
585e64fd10
add swap case support with the ~ key
2013-03-29 19:35:48 +01:00
Maxime Coste
01968cb96e
String: inherit from std::string rather than using it as a backend
2013-03-29 19:35:48 +01:00
Maxime Coste
1f4072dc72
use a scoped edition in Repeated so that repeated actions have a single undo group
2013-03-29 19:35:48 +01:00
Maxime Coste
deb502cb40
kakrc: define colorscheme before sourcing user config
2013-03-29 19:35:48 +01:00
Maxime Coste
08873a779a
cpp.kak: fix alt_dirs handling with more than 2 directories
2013-03-29 19:35:47 +01:00
Maxime Coste
96b017f76e
Minor BufferCompleter refactoring
2013-03-29 19:35:47 +01:00
Maxime Coste
417682883e
use only one constructor with a default parameter for units
2013-03-27 18:42:38 +01:00
Maxime Coste
a3bc8dbc79
idvaluemap: minor style changes
2013-03-27 18:42:00 +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
a437e9488b
idvaluemap, FunctionGroup: consitfy completion methods
2013-03-27 14:09:09 +01:00
Maxime Coste
251f09ff89
Merge {Filter,Highlighter}Group in a FunctionGroup template
2013-03-27 13:45:22 +01:00
Maxime Coste
ee0e640384
kak_bufname env var use display_name
2013-03-26 19:28:44 +01:00
Maxime Coste
c6a1fed6b4
add regex_option highlighter, which takes a regex option name and highlight all its matches
2013-03-26 14:26:59 +01:00
Maxime Coste
996e5999ed
permit do declare regex option
2013-03-26 14:26:07 +01:00
Maxime Coste
4ec9c4c32a
Make TypedOption templates public
2013-03-26 13:47:14 +01:00
Maxime Coste
14933bdeaf
% register uses the buffer display name
2013-03-26 13:40:04 +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
36dc6c23a0
add default zero construction to units
2013-03-26 00:04:03 +01:00
Maxime Coste
d02133d382
extract parse_color to color.cc as str_to_color, and add color_to_str
2013-03-25 23:35:59 +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
dfa5318765
fix some style problems detected by cppcheck
2013-03-25 18:44:52 +01:00
Maxime Coste
3e9a0c4c13
{grep,make}.kak: use edit! instead of trying to delete buffer
2013-03-22 18:39:48 +01:00
Maxime Coste
a160fd6984
open_fifo delete existing buffer if needed
2013-03-22 18:39:00 +01:00
Maxime Coste
d04a6b1e18
cpp.kak: alt supports an alt_dirs options for directories to search
2013-03-22 14:30:09 +01:00
Maxime Coste
07866e6ae9
show informations on uncaught std::exceptions
2013-03-22 14:29:22 +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
9494fbbd87
kakrc: avoid bash features
2013-03-22 13:45:52 +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
38a46a6682
add WinDisplay hook
2013-03-22 13:41:48 +01:00
Maxime Coste
60599917cc
add a kak_selections env var, which contains all selections separated by a comma
2013-03-21 19:10:18 +01:00
Maxime Coste
e5d93c2194
BufferManager: replace Buffer* get_buffer with Buffer& get_buffer
2013-03-21 19:09:31 +01:00
Maxime Coste
df79b7610a
utf8 validity is not a buffer concern
2013-03-20 19:26:46 +01:00
Maxime Coste
abe37b5fdb
Add a RuntimeError hook called when a runtime_error exception is catched at client level
2013-03-20 19:11:58 +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
d99fe87b43
Editor: fix select(Selection&, SelectMode::Replace)
2013-03-20 19:11:58 +01:00
Maxime Coste
07a2c2944f
NCurses: draw a scroll bar
2013-03-20 19:11:58 +01:00
Maxime Coste
3f467ba451
BufferCompleter: preserve completions when inserting
...
try to narrow matches with entered prefix
2013-03-20 19:11:58 +01:00
Maxime Coste
a19a788b94
CommandManager: fix some crashes
2013-03-19 18:58:21 +01:00
Maxime Coste
9c78f02903
BufferCompleter: fix backward looping in completion candidates
2013-03-19 14:15:42 +01: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
f0baf35117
clang-complete: do the compilation in the buffer directory
2013-03-19 13:57:23 +01:00
Maxime Coste
ee800ad778
select_to_{,reverse}: search on other lines if needed
2013-03-18 23:47:18 +01:00
Maxime Coste
6907fcf76e
more robust implementation of expand_unprintable
2013-03-18 23:35:23 +01:00
Maxime Coste
d3f586f378
DisplayBuffer::split does not check if the split is on a character boundary
2013-03-18 23:34:40 +01:00
Maxime Coste
2de0d0fccf
add a reg command to set a register
2013-03-18 22:44:39 +01:00
Maxime Coste
5fe7315df9
add 'r' object alias for [] (range)
2013-03-18 22:31:05 +01:00
Maxime Coste
a11a162734
Buffer: optimize do_insert to minimize changes in m_lines vector
2013-03-18 19:45:17 +01:00
Maxime Coste
e6c635be34
DynamicSelectionList: optimize updating on buffer modification
...
Now that we know selections are sorted, we can get the set of selections
needing updating in log(n) time using a binary search, for modification
not changing the line count, this makes updating selections run in log(n)
instead of n.
2013-03-18 19:09:07 +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
5e88b7fe28
move BufferIterator on_{insert,erase} as DynamicSelectionList implementation detail
2013-03-15 14:22:42 +01:00
Maxime Coste
0c4addb40c
replay_macro: parse keys only once
2013-03-15 14:16:15 +01:00
Maxime Coste
84e3c99c93
Buffer::on_erase: avoid resizing lines more than necessary
2013-03-15 14:15:29 +01:00
Maxime Coste
5dc6a36bf8
Makefile: fix link with bfd linker
2013-03-15 14:03:12 +01:00
Maxime Coste
0ca23f9ebd
clang: fix auto completion when cursor is on end of line
2013-03-14 20:40:43 +01:00
Maxime Coste
17b2d8c052
NCurses: hand coded menu implementation
2013-03-14 19:19:33 +01:00
Maxime Coste
65850ff1e8
add clang.kak, providing clang based insert completion
2013-03-14 14:12:14 +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
0b45a725e4
move remoting code to remote.cc
...
ClientAccepter is now Server's implementation detail and all socket logic
are isolated in remote.cc
2013-03-14 10:23:35 +01:00
Maxime Coste
b309d1df61
move complete_filename to file.cc
2013-03-13 19:39:38 +01:00
Maxime Coste
de536b80cd
goto file uses the 'path' string-list option instead of hard coded paths
2013-03-13 18:52:55 +01:00
Maxime Coste
4069f42845
find_file: automatically add missing '/' and end of paths
2013-03-13 18:52:08 +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
0f957b3743
Editor: fix replace at end of buffer
2013-03-13 14:37:03 +01:00
Maxime Coste
c1db67e31a
Buffer: minor refactoring
2013-03-13 14:36:10 +01:00
Maxime Coste
8acb25d9a4
ctags: use - instead of _ in command name
2013-03-12 19:51:08 +01:00
Maxime Coste
09e30c40e3
BufferCompleter: watch 'completions' option, and update completions when it changes
2013-03-12 19:23:41 +01:00
Maxime Coste
2440a7e82e
NCurses: hook redraw on c-l
2013-03-12 18:57:12 +01:00
Maxime Coste
e428a9757f
Modify network protocol to allow commands through the socket
2013-03-12 18:53:18 +01:00
Maxime Coste
17b861d78e
NCurses: handle empty items in menu_show
2013-03-11 14:20:28 +01:00
Maxime Coste
ddc894ccfe
Add an experimental configurable input completion fonction
...
The completions option (a std::vector<String>) is used for
completions candidates, if it's first element matches the current
cursor position and buffer timestamp.
2013-03-11 14:20:28 +01:00
Maxime Coste
4db6e3e917
add kak_timestamp env var to access current buffer timestamp
2013-03-11 14:20:28 +01:00
Maxime Coste
8cc9a44d47
minor cleanups in complete_word
2013-03-11 14:20:28 +01:00
Maxime Coste
eab2cc240a
InputHandler: complete_word knows best when not to complete
2013-03-09 13:23:47 +01:00
Maxime Coste
89ba8535e2
InputHandler: extract word completion algorithm
2013-03-08 18:43:14 +01:00
Maxime Coste
cfafe203e2
NCurses: fix redrawing when info or menu is hidden
2013-03-08 18:42:43 +01:00
Maxime Coste
1e8a109d0d
Use some builtins colors aliases instead of hardcoded values for highlighters
2013-03-06 20:33:20 +01:00
Maxime Coste
e4240448b1
colalias: always override
2013-03-06 20:30:02 +01:00
Maxime Coste
f677d4ba32
Use a ColorPair in DisplayAtoms instead of separate fg/bg colors
2013-03-06 20:28:02 +01:00
Maxime Coste
594ee65949
do not redraw the whole screen each time
2013-03-06 19:07:10 +01:00
Maxime Coste
a10bfed9e5
ncurses: fix unicode handling in status line
2013-03-06 19:03:58 +01:00
Maxime Coste
5ff22d44be
Add utf8_iterator::advance(CharCount, utf8_iterator end)
2013-03-06 19:03:43 +01:00
Maxime Coste
4712765e8a
Add FlagLines highlighter
...
This highlighter show a given flag in front of each lines whose number
is present in a given int-list option
2013-03-06 14:27:33 +01:00
Maxime Coste
fb7234544e
HighlightersFactories takes back a Window parameter
2013-03-06 14:27:33 +01:00
Maxime Coste
558f32d2d5
throw a runtime error when a wrong type is requested for an option
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
3e7344fb14
remove commented line in ncurses.cc
2013-03-05 19:35:40 +01:00
Maxime Coste
ca1d957829
fix ignored_files default value
2013-03-05 19:35:40 +01:00
Maxime Coste
e5dc850274
log to debug when make_regex_ifp catch a regex_error
2013-03-05 19:35:39 +01:00
Maxime Coste
0c4eb7a861
simplify how string -> option conversion are written, free functions instead of template specialization
2013-03-05 19:35:39 +01:00
Maxime Coste
09cf5acb23
Add support for boolean options
2013-03-05 19:03:42 +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
a36befd653
Use colors instead of underline to highlight selections
2013-03-01 19:31:14 +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
8ef79c41bd
show_line_numbers does not need a window
2013-03-01 14:30:30 +01:00
Maxime Coste
6b812d9f6c
Window: segregate builtins highlighters from the others
2013-03-01 14:29:59 +01:00
Maxime Coste
6318f2268f
assistant: no need for raw strings
2013-03-01 14:29:28 +01:00
Maxime Coste
3a60e633a4
safe_ptr have no overhead when KAK_DEBUG is not defined
2013-02-28 18:54:15 +01:00
Maxime Coste
298926a16e
Editor::multi_select: reserve some vector space in advance
2013-02-28 18:51:58 +01:00
Maxime Coste
161e32e137
fix warning
2013-02-28 18:51:24 +01:00
Maxime Coste
849f225e70
use a 16K buffer when reading from fifo
2013-02-28 18:51:11 +01:00
Maxime Coste
26826b981d
grep: highlight columns when present
2013-02-27 23:50:57 +01:00
Maxime Coste
9f9ad58b39
utf8::dump uses a copy of the output iterator instead of a reference
2013-02-27 23:50:33 +01:00
Maxime Coste
8e07e00f18
ShellManager: remove unneeded end of lines when writing stderr
2013-02-27 21:31:48 +01:00
Maxime Coste
72531f2df0
string: remove unneeded headers
2013-02-27 21:26:12 +01:00
Maxime Coste
9ea11394bc
reorganize keymap
2013-02-27 21:21:11 +01:00
Maxime Coste
771241ad97
use 'Q' for replay macro
2013-02-27 21:13:06 +01:00
Maxime Coste
4ad8941563
Editor: fix move_selection(LineCount) when current column is after next line end
2013-02-27 21:09:48 +01:00
Maxime Coste
8606fdae5d
NCurses: go back to non ncursesw/ headers
2013-02-27 21:05:17 +01:00
Maxime Coste
43bc8314fb
ParameterParser: refactoring, simplify
2013-02-27 20:51:44 +01:00
Maxime Coste
09901d455e
Add 'gf' (goto file) functionality
2013-02-27 19:58:38 +01:00
Maxime Coste
99475f93d9
String: add rbegin/rend methods
2013-02-27 19:58:24 +01:00
Maxime Coste
f82a2e22a1
Containers utils: use Container&& in order to accept temporaries
2013-02-27 19:58:07 +01:00
Maxime Coste
2f410f62e4
Add String Range::content() const
2013-02-27 19:11:25 +01:00
Maxime Coste
9230667c11
Add " and ' support to object selection
2013-02-27 19:08:13 +01:00
Maxime Coste
be0c5ddf49
minor performance tweaks
2013-02-27 19:03:33 +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
6f48407f55
Use current locale
2013-02-27 19:01:07 +01:00
Maxime Coste
2854984c79
use std::isalnum for is_word implementation in order to support unicode
2013-02-26 18:54:11 +01:00
Maxime Coste
b68cc3cd3c
NCurses: fix unneeded last line when displaying info box
2013-02-26 18:53:29 +01:00
Maxime Coste
0f413607c2
Fix utf8 handling when moving selection up/down
2013-02-26 18:52:49 +01:00
Maxime Coste
3d19111570
Use unicode box drawing character for the assistant
2013-02-26 14:28:42 +01:00
Maxime Coste
ffc5a4a334
Add a String(Codepoint, CharCount) constructor
2013-02-26 14:28:20 +01:00
Maxime Coste
2726d11108
handle SIGFPE, SIGQUIT and SIGTERM as well as SIGSEGV
2013-02-26 14:13:37 +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
c343407465
Fix utf8 handling in Editor::insert when replacing
2013-02-26 14:06:25 +01:00
Maxime Coste
7865223587
Add utf8::character_start function
2013-02-26 14:05:51 +01:00
Maxime Coste
9b3bc8523b
Use ncursesw in order to get correct utf8 handling
2013-02-26 14:05:16 +01:00
Maxime Coste
dc7227b983
Add the most important missing feature of Kakoune
2013-02-25 19:38:20 +01:00
Maxime Coste
dc8803e41b
String: use a CharCount instead of a size_t in String(char, CharCount)
2013-02-25 19:25:32 +01:00
Maxime Coste
8f3d2ae089
main: catch all exceptions
2013-02-22 18:45:59 +01:00
Maxime Coste
77dc9955d3
Paste: use count for repetition
2013-02-22 18:45:27 +01:00
Maxime Coste
4b11f73f1e
buffer: remove too slow check from check_invariant
2013-02-22 18:38:53 +01:00
Maxime Coste
5c74f98757
Use S for regex splitting, and alt-s for line splitting
2013-02-22 18:37:34 +01:00
Maxime Coste
5f446d9aec
try to merge selections when begining incremental insertion
2013-02-21 18:44:17 +01:00
Maxime Coste
d647e817a4
grep,make: bind normal mode return to jump
2013-02-21 13:39:31 +01:00
Maxime Coste
efc0a8bc07
grep,make: support specifying client with toolsclient option
...
When toolsclient option is set, make and grep opens their buffer
in the specified client instead of the current one.
2013-02-21 13:38:12 +01:00
Maxime Coste
901d5ea1be
Add mail.kak for mail file highlighting
2013-02-21 13:36:25 +01:00
Maxime Coste
cf01f0ed7a
Avoid recursive macro calls
2013-02-21 13:35:20 +01:00
Maxime Coste
9306a89deb
Fix macro recording on the same register, replace instead of appending.
2013-02-21 13:34:34 +01:00
Maxime Coste
6573f16dd9
Buffer: commit current undo group before attempting to undo anything
2013-02-20 14:23:52 +01:00
Maxime Coste
9f4498e035
Buffer: replace {begin,end}_undo_group with a single commit_undo_group method
2013-02-20 14:20:16 +01:00
Maxime Coste
682e4faff0
select and split operations use the search pattern register
2013-02-20 14:04:46 +01:00
Maxime Coste
02b01e2f0a
ShellManager: catch exception thrown by env var functors
2013-02-19 19:06:13 +01:00
Maxime Coste
a83731c8e1
search: fix empty search string, use previous pattern
2013-02-19 19:05:13 +01:00
Maxime Coste
c451dd07c6
InputHandler: do not put empty lines in history
2013-02-19 19:04:36 +01:00
Maxime Coste
18aac3d4e8
Add '*' binding, which (smart) copy current selection to search pattern
2013-02-19 19:04:09 +01:00
Maxime Coste
a453ddaf37
Add support for Home/End key in prompts
2013-02-19 13:50:27 +01:00
Maxime Coste
b08749285e
move status line generation code to client manager
2013-02-18 19:03:39 +01:00
Maxime Coste
b43fdc7eb6
Add macro recording/replay support
2013-02-18 18:58:07 +01:00
Maxime Coste
577734dae7
expose exec_keys function in commands.hh
2013-02-18 18:57:08 +01:00
Maxime Coste
9936ace0db
input_handler: ask dimensions to ui instead of window
2013-02-18 14:13:52 +01:00
Maxime Coste
fc2dd599a3
Move last insert state from context to input handler
2013-02-18 14:07:30 +01:00
Maxime Coste
0e081a76c1
make keymap definition more readable using a select helper function
2013-02-18 14:01:24 +01:00
Maxime Coste
67971995f8
Fix class/struct mismatches
2013-02-18 14:00:43 +01:00
Maxime Coste
bd5955c737
grep: remove enventual \r
2013-02-13 14:32:30 +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
cb26948ad3
ClientManager: move the Client inner class detail in the cpp file
2013-02-07 19:25:42 +01:00
Maxime Coste
32e6184210
context_wrap: create a DynamicSelectionList only when needed
2013-02-07 19:25:07 +01:00
Maxime Coste
2f9041b842
Editor: fix warning
2013-02-07 13:37:22 +01:00
Maxime Coste
6c7d646d35
exec keys: push_jump if editor has changed
2013-02-07 13:35:21 +01:00
Maxime Coste
785abfbad5
ctags.kak: do not automatically enable info tooltips
2013-01-31 19:00:02 +01:00
Maxime Coste
1c301482d5
tweak buffer unit test
2013-01-31 18:59:23 +01:00
Maxime Coste
edef8e4e98
Remove Set and use unordered_set
2013-01-31 18:58:25 +01:00
Maxime Coste
7f02ef334f
add some tests for Key functions
2013-01-30 19:16:36 +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
45367bf447
ctags.kak: tweak auto info
2013-01-30 19:05:52 +01:00
Maxime Coste
c9b113fd5f
InputHandler: add some new hooks
2013-01-30 19:04:03 +01:00
Maxime Coste
de0f765498
Keys: add key_to_str function
2013-01-30 19:03:11 +01:00
Maxime Coste
045aa0c7ec
style fix
2013-01-30 00:27:22 +01:00
Maxime Coste
e278196e99
ctags: initial auto fonction documentation support
2013-01-30 00:24:10 +01:00
Maxime Coste
00a9cdfc90
Context: remove some unused code
2013-01-29 23:16:58 +01:00
Maxime Coste
8933109cc5
Context: fix unintialized m_input_handler
2013-01-29 19:13:39 +01:00
Maxime Coste
252f875926
fix sort_and_merge_overlapping
2013-01-29 19:05:40 +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
f8209e3b52
fix contains for empty containers
2013-01-29 18:55:32 +01:00
Maxime Coste
3171ab0c52
NCurses: fix multiline info
2013-01-29 14:24:42 +01:00
Maxime Coste
2235944e60
Add NormalIdle hook support
2013-01-29 13:58:19 +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
3d430e14c4
Buffer: small fix in apply_modification
2013-01-28 13:45:32 +01:00
Maxime Coste
54725ebcca
Buffer::do_insert: fix on_insert call when inserting at the end
2013-01-24 14:08:24 +01:00
Maxime Coste
28cb78bed1
Editor: refactor InsertMode::Replace
2013-01-23 18:58:43 +01:00
Maxime Coste
410067282a
Buffer: end is either one past last character, or one past last line
2013-01-23 18:52:42 +01:00
Maxime Coste
72cc61c987
add undo unit_test and fix Buffer
2013-01-23 14:39:33 +01:00
Maxime Coste
3404366b65
add more asserts
2013-01-23 14:39:33 +01:00
Maxime Coste
f14bc5e310
Buffer: small style fixes
2013-01-23 13:47:45 +01:00
Maxime Coste
9dbc6adcda
add a SIGSEGV handler
2013-01-23 13:46:18 +01:00
Maxime Coste
2f9e061252
assert: add some debug info in the message
2013-01-23 13:45:44 +01:00
Maxime Coste
4497767492
NCursesUI::get_key(): move getch_iterator as a local type
2013-01-22 14:29:16 +01:00
Maxime Coste
0c8832c42a
LineAndColumn::operator+= is not constexpr
2013-01-22 14:28:43 +01:00
Maxime Coste
1b53b92267
Buffer: check that newlines are at the end of lines
2013-01-22 14:28:15 +01:00
Maxime Coste
f7038980a0
Add kak_cursor_{line,column} env var
2013-01-21 13:58:54 +01:00
Maxime Coste
9002059c0d
Window: fix display position, count utf8 characters for column
2013-01-17 19:49:49 +01:00
Maxime Coste
f1b6108367
NCurses: use default background for '~'
2013-01-17 19:49:48 +01:00
Maxime Coste
9c2bbe218b
replace char: fix unicode handling
2013-01-17 19:49:48 +01:00
Maxime Coste
44ca4d23de
Fix sort_and_merge_overlapping
2013-01-17 19:49:48 +01:00
Maxime Coste
3f01f4bdf5
Add some documentation to InputHandler
2013-01-17 14:27:32 +01:00
Maxime Coste
d1f15123e4
InputHandler: minor code cleanup
2013-01-17 14:22:24 +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
Maxime Coste
c45838cc57
Move Insertion Hooks handing to the input handler
2013-01-17 13:58:57 +01:00
Maxime Coste
cedb0d18a3
exec and eval accepts a restore-selection parameter
2013-01-17 13:58:09 +01:00
Maxime Coste
621be2ceab
Hooks now takes a non-const context
2013-01-17 13:45:43 +01:00
Maxime Coste
bdc47ddef8
NCursesUI: redraw becomes a member
2013-01-15 14:16:45 +01:00
Maxime Coste
93cad94330
InputHandler: Insert mode calls 'InsertIdle' hook when idle
2013-01-15 14:15:12 +01:00
Maxime Coste
12ce590f18
Context: add a hooks method similar to the options one
2013-01-14 19:26:44 +01:00
Maxime Coste
a1998dac7a
InputHandler: use a timer for word completion instead of calling it at each insertion
2013-01-14 19:17:37 +01:00
Maxime Coste
90eeb7b8a7
EventManager: add support for timers
2013-01-14 19:07:38 +01:00
Maxime Coste
eaaf88db1d
rename StronglyTypedInteger to more accurate StronglyTypedNumber
2013-01-14 18:51:45 +01:00
Maxime Coste
3d00f398fe
NCurses: redraw after menu/info window is modified
2013-01-14 18:51:07 +01:00
Maxime Coste
310ec1f791
move input watching responsibility into UserInterface implementations
2013-01-14 18:50:17 +01:00
Maxime Coste
d2f0e2de66
RemoteClient owns the FDWatcher of it's socket
2013-01-11 18:44:02 +01:00
Maxime Coste
914ede7a82
Add and use a Set template class for recuring small sets
2013-01-11 14:28:13 +01:00
Maxime Coste
79d28e68dc
Refactor EventManager
...
Watching a file descriptor is now done using a FDWatcher object
2013-01-10 19:10:42 +01:00
Maxime Coste
bba7152063
Add backward search support (bound to alt-/)
2013-01-08 18:46:45 +01:00
Maxime Coste
f77509d498
add sh.kak for shell script highlighting
2013-01-08 14:01:22 +01:00
Maxime Coste
59941bcfa9
Make: fix userconfig target
2013-01-08 14:00:13 +01:00
Maxime Coste
3f7bf82cde
Support for selecting to surrounding object begin/end with [ and ]
2013-01-07 18:53:27 +01:00
Maxime Coste
8d4678a82e
Autoname client on creation, and access client name from shell with $kak_client
2013-01-07 13:59:09 +01:00
Maxime Coste
7acd4e3e6a
minor code cleanup
2013-01-06 21:58:02 +01:00
Maxime Coste
9efc32596b
make: use a makecmd option
2013-01-06 19:21:42 +01:00
Maxime Coste
f3640a2d03
alt-r rotates selections
2013-01-05 18:26:57 +01:00
Maxime Coste
4b649d386c
various code style fixes
2013-01-04 18:39:13 +01:00
Maxime Coste
5939eb219f
add client.kak providing 'new' command for opening a new client
...
Autodetect tmux, use tmux if we are in a tmux session, else fallback to
urxvt.
2013-01-04 18:31:37 +01:00
Maxime Coste
03d32c2e2d
tweak kakrc highlighting
2013-01-03 18:53:04 +01:00
Maxime Coste
08fd946c07
Add a nop command to avoid accidental shell output evaluation
2013-01-03 18:52:07 +01:00
Maxime Coste
f84e46f805
tweak errjump command
2013-01-03 18:47:51 +01:00
Maxime Coste
ae9aadb07d
Fix captures preservation in Editor
2013-01-03 18:47:02 +01:00
Maxime Coste
2195d59b49
refactoring selectors
2013-01-03 14:30:14 +01:00
Maxime Coste
4f6507b808
Highlight last selection differently
2013-01-03 14:01:34 +01:00
Maxime Coste
0045456f87
alt-n replace last selection with next match
2013-01-03 14:00:59 +01:00
Maxime Coste
02b9fcc3df
Editor: add a ReplaceLast select mode
2013-01-03 14:00:31 +01:00
Maxime Coste
9fb0129061
Editor: keep last selection as last when sorting
...
sort selections 'circularly', keeping the last one
at the end of the list.
2013-01-03 13:59:53 +01:00
Maxime Coste
a9d5f126a0
Editor: preserve captures accross movements
2013-01-02 13:49:02 +01:00
Maxime Coste
476363bf0d
Editor: cleanup check_invariants calls
2012-12-31 18:36:28 +01:00
Maxime Coste
074a21463b
add a current search highlighter
2012-12-31 14:37:11 +01:00
Maxime Coste
d5582b0df4
add incsearch option to choose if incremental search is enabled
2012-12-31 14:12:00 +01:00
Maxime Coste
76c3246642
Add Editor::select(const Selection&, SelectMode)
2012-12-31 14:06:20 +01:00
Maxime Coste
4e69ec078d
minor cleanup
2012-12-31 13:57:21 +01:00
Maxime Coste
18b35a3ab3
Editor: merge_overlapping -> sort_and_merge_overlapping
2012-12-31 13:56:52 +01:00
Maxime Coste
dc9635a247
Fix join on last line (it appended a trailing space)
2012-12-31 13:44:01 +01:00
Maxime Coste
fe363094cf
support count in search next, and only push jump in replace mode
2012-12-31 13:42:59 +01:00
Maxime Coste
2b2474b2d1
add a force mode to delete buffer (db!)
2012-12-28 14:07:35 +01:00
Maxime Coste
cb80ae139b
IncrementalInserter: fix append mode when on line end
2012-12-28 14:06:56 +01:00
Maxime Coste
28cf772deb
tweak window status line format
2012-12-28 13:53:00 +01:00
Maxime Coste
9531fd5915
Buffer loses the 'New' flag when written
2012-12-28 13:52:19 +01:00
Maxime Coste
d4f155cae7
new clients always takes last used buffer, support multiple file on command line
2012-12-28 13:51:14 +01:00
Maxime Coste
8f5be9bf91
BufferManager: registering buffers are front inserted
2012-12-28 13:50:02 +01:00
Maxime Coste
030df1c4be
IncrementalInserter: preserve captures
2012-12-27 19:11:42 +01:00
Maxime Coste
8bfb7da674
fix splitting with inverted selection
2012-12-27 18:56:06 +01:00
Maxime Coste
41979c91f4
Editor: when replacing, select inserted text
2012-12-27 18:54:52 +01:00
Maxime Coste
ac778c8aa2
select_matching: fix when matching is the first character
2012-12-27 13:41:45 +01:00
Maxime Coste
f3a7c76c4e
add a -n option prevent kakrc from being sourced
2012-12-19 18:57:10 +01:00
Maxime Coste
2ab9b474be
Client: catch errors when executing init commands
2012-12-19 18:56:47 +01:00
Maxime Coste
6c901e9152
Buffer: close undo group when saved
2012-12-19 18:56:20 +01:00
Maxime Coste
63d30a30d5
support -e switch for initial command to execute
2012-12-18 21:41:13 +01:00
Maxime Coste
26632726ad
Support initial command passing when a client is connecting
2012-12-18 21:20:36 +01:00
Maxime Coste
9ca69820ac
do_go: support append mode on go to top/bottom, ignore case
2012-12-18 19:12:24 +01:00
Maxime Coste
6cc4ec796e
editor: support select mode on select(BufferIterator)
2012-12-18 19:12:15 +01:00
Maxime Coste
cf7e6bdd07
join: preserve multiple selections
2012-12-18 19:00:55 +01:00
Maxime Coste
43ad920bd8
menu commands has a -select-cmds option
...
when this option is given, menu expect three argument per entry
instead of two, the last one being the command to run when the
entry is selected, but not yet validated.
2012-12-15 19:11:22 +01:00
Maxime Coste
df14427210
NCurses: info window tries to avoid the menu one
2012-12-15 19:11:04 +01:00
Maxime Coste
fd09e8a2de
NCurses: some code refactoring
2012-12-15 18:32:56 +01:00
Maxime Coste
b090465e80
Command line parsing: support empty strings
2012-12-15 17:47:50 +01:00
Maxime Coste
d208067589
InputHandler: call callback on abort and on selected element change as well
2012-12-14 19:38:11 +01:00
Maxime Coste
3184159572
info: support a -inline option
...
By default display info box above command line, full width
(like menu), in inline mode, display the info box close
to cursor, using only needed width.
2012-12-14 19:25:27 +01:00
Maxime Coste
9236c87842
UserInterface: add info box support
...
using the info command, you can display an arbitrary string
in a tooltip box.
2012-12-14 19:04:34 +01:00
Maxime Coste
8e170e4385
optimize merge_overlappings
...
assume selections are sorted, so we have a linear complexity algorithm
instead of O(n²).
2012-12-13 18:50:27 +01:00
Maxime Coste
3aee1c37fb
perf tweak in BufferIterator
2012-12-13 18:50:27 +01:00
Maxime Coste
bf07d2576e
minor refactoring in highlight_range
2012-12-13 18:50:27 +01:00
Maxime Coste
31d2cfa9a1
ctags.kak: avoid brackets in search pattern
2012-12-13 18:50:27 +01:00
Maxime Coste
1c94064713
DynamicSelectionList: derive from SelectionList
...
the previous implementation did not preserve invariant
either, so we'd better use less code.
2012-12-13 18:50:27 +01:00
Maxime Coste
57ad454b53
tweak cpp highlighting
2012-12-13 18:50:27 +01:00
Maxime Coste
c74b44f540
change replace char behaviour, now replace each selected chars
2012-12-13 18:50:27 +01:00
Maxime Coste
777a79d37c
File completion: when no files match entered text as prefix, try as regex
2012-12-13 18:50:27 +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
e36bc74f43
do_select: do not propagate errors on incremental search
2012-12-13 18:50:27 +01:00
Maxime Coste
892b65b355
overlaps takes Range parameters instead of Selection
2012-12-13 18:49:29 +01:00
Maxime Coste
48c9d89585
tweak git commit message highlighting
2012-12-13 18:49:29 +01:00
Maxime Coste
969a1213c4
Makefile: add a userconfig target
...
make userconfig takes care of creating $XDG_CONFIG_HOME/kak/autoload
and populate it with links to files in the rc directory
2012-12-13 18:49:29 +01:00
Maxime Coste
92c4a9abce
Prompt: when completion has only one candidate, next tab starts a new completion
2012-12-13 18:49:29 +01:00
Maxime Coste
bc1a90d4f5
file completion: disable ignored files when entered prefix matches.
2012-12-13 18:49:29 +01:00
Maxime Coste
b63c658da5
remote.cc: move write function as member of Message
2012-12-13 18:49:29 +01:00
Maxime Coste
db3a953961
code cleanup in remote.cc
2012-12-13 18:49:29 +01:00
Maxime Coste
9230ccc087
the shell used for command execution can be changed using the 'shell' option
2012-12-13 18:49:29 +01:00
Maxime Coste
33f87db553
minor code cleanup in do_select_object
2012-12-13 13:25:39 +01:00
Maxime Coste
8223679247
select/split: check expression is not empty
2012-12-13 13:25:21 +01:00
Maxime Coste
7cc66ee64d
push current selection on search
2012-12-13 13:24:38 +01:00
Maxime Coste
d0c800a7d7
Support nested {Filters,Highlighter}Group
2012-12-09 18:58:58 +01:00
Maxime Coste
7d6a48f43a
ncurses.cc: handle ascii del as backspace
2012-12-09 14:31:19 +01:00
Maxime Coste
afc8ad77e8
InputHandler: tweak prefix completion behaviour
2012-12-07 19:20:26 +01:00
Maxime Coste
158f5a5c84
extract ParametersParser to it's own file
2012-12-07 19:20:26 +01:00
Maxime Coste
d25bafa95d
grep.kak: configurable grep command, search selection when no params
2012-12-07 19:20:26 +01:00
Maxime Coste
c000ca2220
source user kakrc after autoloads, so that user can override options
2012-12-07 19:19:45 +01:00
Maxime Coste
ff1f9f662d
cleanup {make,grep}.kak
2012-12-07 19:19:45 +01:00
Maxime Coste
b81ea0bc92
PromptHandler now call callback when edited and aborted.
...
Used for a new feature: incremental search
2012-12-06 13:33:26 +01:00
Maxime Coste
3438ba7ec3
*scratch* buffer use undo
2012-12-05 19:22:07 +01:00
Maxime Coste
479bb9df2c
fail nicely when trying to open a directory
2012-12-05 13:59:08 +01:00
Maxime Coste
ce6e864772
'exec' and (resurected) 'eval' commands can take a '-client' parameter
2012-12-03 18:57:57 +01:00
Maxime Coste
cf39835805
add 'name' command to set current client name
2012-12-03 18:57:23 +01:00
Maxime Coste
4a3f9d6187
ClientManager: support naming clients and accessing client's context by name
2012-12-03 18:56:53 +01:00
Maxime Coste
e8df81a39d
RemoteClient: call get_key soon so that it may process a resize before size change checks are done
2012-12-03 18:51:28 +01:00
Maxime Coste
8724a12dc1
NCurses: do not resize directly in signal handler, malloc may not be working there
2012-12-03 18:50:44 +01:00
Maxime Coste
9e3c1c74c5
EventManager: fix forced event processing
...
previous implementation could drop some forced events.
2012-12-03 18:49:09 +01:00
Maxime Coste
b23af02ec4
fix quit modified file behaviour
2012-12-03 13:33:05 +01:00
Maxime Coste
b764a0a63e
Selection: refactoring, move CaptureList to Selection
2012-11-30 18:32:49 +01:00
Maxime Coste
956ac60d4a
add an ignored_files regex option whose matches are not used for completion
2012-11-29 20:09:37 +01:00
Maxime Coste
33482b0979
Add configurable prompt completion behaviour
...
If option 'complete_prefix' is non 0, then completion first
use completion candidates common prefix, then circle through
candidates.
2012-11-29 19:56:34 +01:00
Maxime Coste
7dc634444d
Fix InputMode::Prompt blocking behaviour when inserting register
2012-11-29 19:03:17 +01:00
Maxime Coste
a6f0d53dbf
Remote unused Context::change_ui
2012-11-29 19:03:17 +01:00
Maxime Coste
acbe45e294
local client forks in destructor so that the kak server detaches from terminal
2012-11-29 19:03:17 +01:00
Maxime Coste
16b8f19db3
use more portable fcntl method for FD_CLOEXEC bit, enable it on forgotten sockets
2012-11-29 18:55:08 +01:00
Maxime Coste
0955ef5eb0
add an empty buffer unit test
2012-11-28 20:10:49 +01:00
Maxime Coste
3a4859ecba
ncurses: avoid refering to dead NCursesUI in signal handler
2012-11-27 18:54:27 +01:00
Maxime Coste
4c1b48e314
InputHandler: InputModes no longer die directly on mode change, they survive until end of on_key
2012-11-27 18:52:43 +01:00
Maxime Coste
dc268758dd
fix cpp indent filter
2012-11-27 14:03:21 +01:00
Maxime Coste
6ca530b5cc
EventManager: refactor (again)
2012-11-27 13:57:03 +01:00
Maxime Coste
f1b15ef86b
fix buffer creation on empty file
2012-11-27 13:39:35 +01:00
Maxime Coste
557128b641
IncrementalInsert::move_cursors: use overloaded for LineCount/CharCount editor implementation
2012-11-26 19:38:07 +01:00
Maxime Coste
cad4d3c01e
fix InsertMode::OpenLineBelow behaviour in prepare_insert
2012-11-26 19:24:38 +01:00
Maxime Coste
cee0a2d128
Append on end of line now appends to current line
2012-11-26 19:23:50 +01:00
Maxime Coste
e77ca7a4be
minor code simplification
2012-11-26 18:50:34 +01:00
Maxime Coste
91d2cc38e5
EventManager: avoid erasing an event handler while it may be in use
2012-11-26 14:08:27 +01:00
Maxime Coste
52ee8b46ae
fix crlf file reading
2012-11-26 13:36:43 +01:00
Maxime Coste
84db1e2b8c
Editor: fix replacement beheviour just before end of line
2012-11-23 19:13:47 +01:00
Maxime Coste
dca05ecc73
small code tweak
2012-11-23 18:48:04 +01:00
Maxime Coste
9c99c238e8
rewrite file opening code using mmap, opening big files is much much faster
2012-11-23 18:43:10 +01:00
Maxime Coste
c32a7b9b74
Buffer takes a vector of lines as initial content
2012-11-23 18:42:07 +01:00
Maxime Coste
53be5c87d2
String: add non const front() and back() methods
2012-11-23 18:41:33 +01:00
Maxime Coste
6a7193cf63
filter: minor code cleanup
2012-11-23 18:35:05 +01:00
Maxime Coste
ecd556db59
NCurses: use Default bg color for status line
2012-11-23 13:46:39 +01:00
Maxime Coste
2523c4955b
buffer: increment timestamp on notify saved
2012-11-23 13:41:07 +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
73c446e379
code style cleanup in CommandManager
2012-11-22 14:28:14 +01:00
Maxime Coste
7bcd0353cb
ClientManager: store client with a unique_ptr
2012-11-22 14:17:46 +01:00
Maxime Coste
08ad8e8a40
move Window ownership to the ClientManager instead of the Buffer
2012-11-22 14:08:55 +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
e981fb7957
cpp.kak: use regex filter to handle indentation
2012-11-21 19:07:41 +01:00
Maxime Coste
ff4e907fa9
fix trailing '"' in make.kak
2012-11-21 19:01:41 +01:00
Maxime Coste
d331856fb3
refactor/cleanup NCursesUI::menu_show
2012-11-21 19:01:13 +01:00
Maxime Coste
9d04c773c1
CommandManager: diagnose unterminated strings
2012-11-21 13:56:52 +01:00
Maxime Coste
6bbbd2543a
move wrong_argument_count to commands.cc, where it is used
2012-11-21 13:44:43 +01:00
Maxime Coste
d1fade5c9e
Buffer: replace reset_undo_data with a NoUndo flag
2012-11-21 13:43:10 +01:00
Maxime Coste
ac6171686d
minor fixes to buffer constructor
2012-11-21 13:37:36 +01:00
Maxime Coste
985464bee5
Fix FIFO double deregistering issue when closing the buffer after EOF
...
When a fifo was closed, the fifo event handler would close the fd and
unregister it from the event handler, however the hook on BufClose
did that as well without checking if the fd was still refering to the
fifo.
Now we use a Buffer flag Fifo to tag the buffer as still linked to
a fifo so that the BufClose hook do not close and unregister a second
time
2012-11-20 19:48:27 +01:00
Maxime Coste
8bbfbc8c72
Buffer: replace Buffer::Type with Buffer::Flags
2012-11-20 19:47:56 +01:00
Maxime Coste
0b14f387d4
fix error handling in ncurses resize code
2012-11-20 18:55:44 +01:00
Maxime Coste
95cc08a19e
More type safety on SelectFlags
2012-11-20 18:55:17 +01:00
Maxime Coste
533079c389
Let client manager handle deleting client
2012-11-20 18:54:35 +01:00
Maxime Coste
713fa9d406
more exception safety with file descriptors
2012-11-20 18:52:36 +01:00
Maxime Coste
7c69d170df
tweak kakrc highlighting
2012-11-20 14:14:54 +01:00
Maxime Coste
4dc333c8b3
minor cleanups
2012-11-20 14:14:32 +01:00
Maxime Coste
0ca66e3bf9
Add indent/deindent binding (> and <)
2012-11-19 19:22:11 +01:00
Maxime Coste
1602fcf012
Remote: read now retry when it did not get all the expected data
2012-11-19 19:07:32 +01:00
Maxime Coste
fe98ba7494
add some debug output to RemoteUI
2012-11-19 19:06:32 +01:00
Maxime Coste
3e53ebb5d6
alt-space without numeric parameter now flips selections, inverting first and last char
2012-11-19 19:03:56 +01:00
Maxime Coste
07e5655ac1
write_debug automatically appends an eol to the message
2012-11-19 19:03:01 +01:00
Maxime Coste
c636a291bd
Add a regex filter
...
regex filter takes three arguments: <line_match> <insert_match> <replacement>
<line_match> is checked from begining of line to point of insertion
<insert_match> is checked on the inserted text (usually only one char)
<replacement> is used to replace the inserted text, it can use $1..9
for captures in line_match, and $c to specify the cursor position.
for example, ':addfilter regex .* \( ($c)' makes inserting an opening
parens insert the closing one as well, keeping the insertion cursor
in the right spot.
2012-11-19 14:19:41 +01:00
Maxime Coste
22c545884f
Selection: allow write access to first and last
2012-11-19 14:19:31 +01:00
Maxime Coste
45bd3dbe5a
Pass the selection instead of only point of insertion to filters
2012-11-19 13:40:23 +01:00
Maxime Coste
fd50046f3a
ctags.kak: center selection in window when jumping on a tag
2012-11-19 13:38:03 +01:00
Maxime Coste
6ffa74a24d
Context: set dimensions of window on change_editor
2012-11-19 13:37:38 +01:00
Maxime Coste
9c368c85d6
use SelectionsAndCaptures to store jumps
2012-11-12 20:41:03 +01:00
Maxime Coste
14f980e4e0
move overlaps function to selection.hh
2012-11-12 20:27:56 +01:00
Maxime Coste
77272db0fd
make Buffer::{add,remove}_change_listener const and the listener list mutable
2012-11-12 20:11:27 +01:00
Maxime Coste
489621cf58
update c++ highlighter
2012-11-12 20:07:47 +01:00
Maxime Coste
6ebe41b1a5
BufferIterator holds a safe_ptr to their buffer instead of a raw pointer
2012-11-12 20:07:33 +01:00
Maxime Coste
037210c70c
SafeCountable::m_count is mutable so that we can have safe_ptr<const T>
2012-11-12 20:07:05 +01:00
Maxime Coste
801f4e740c
Add jump list support to context
...
jump forward is bound to ctrl-i
jump backward is bound to ctrl-o
switch buffers or jumping somewhere in the buffer push the current
position to the jump list.
when a buffer is deleted, all entries referencing it in jump lists
are erased.
2012-11-12 19:59:25 +01:00
Maxime Coste
41b5336296
make ctags.kak tag implementation more robust
2012-11-12 19:42:26 +01:00
Maxime Coste
3f403474ac
update asciidoc highlighting
2012-11-12 19:41:39 +01:00
Maxime Coste
39932f7ea2
Fix IncrementalInserter::insert(memoryview<String>) so that inserting registers works as intended
2012-11-12 13:40:07 +01:00
Maxime Coste
2781056ce6
Add a rc/ctags.kak for a :tag implementation using exuberant ctags
2012-11-09 19:10:08 +01:00
Maxime Coste
0887e1364e
InputHandler: Handle C-c as Escape
2012-11-08 14:05:00 +01:00
Maxime Coste
68cc07022c
NCurses: catch SIGINT and send a C-c instead
2012-11-08 14:04:41 +01:00
Maxime Coste
0e5f548f76
minor tweaks in displayed texts
2012-11-08 13:38:02 +01:00
Maxime Coste
3a34fae9a7
Editor: avoid end of lines when moving selection
2012-11-08 13:37:29 +01:00
Maxime Coste
bdd0758ee2
Saner :edit and :buffer behaviour when buffer is the current one
2012-11-07 14:04:47 +01:00
Maxime Coste
0f7948848e
Fix buffer deletion from a client when another is editing it
2012-11-07 14:02:23 +01:00
Maxime Coste
d6923af3c4
server socket filename available through $kak_socket env var
2012-11-06 14:25:25 +01:00
Maxime Coste
3471d795c9
ClientManager: tweak on input event lambda
2012-11-06 13:37:18 +01:00
Maxime Coste
d347223e42
EventManager: store event handlers in an unordered_map instead of a vector
...
If an event handler add or removes an event from the manager, it may then
be moved in the vector, and if after that it access any of it's members
(through this), it results in an invalid memory access.
2012-11-06 13:34:58 +01:00
Maxime Coste
3daac4883e
Move client drawing responsiblity to the ClientManager
2012-11-05 19:58:04 +01:00
Maxime Coste
a41bb34b21
Window: maintain the timestamp of last display buffer update
2012-11-05 19:54:09 +01:00
Maxime Coste
fedabb4176
Rework Window creation, avoid using the same window in multiple clients
2012-11-05 19:15:42 +01:00
Maxime Coste
42315c4b5c
Editor: store a safe_ptr to buffer instead of reference
2012-11-04 23:39:25 +01:00
Maxime Coste
ea17525b2a
Window: sanitize position in set_position
2012-10-31 14:28:47 +01:00
Maxime Coste
c947819154
Fix buffer iterator_at_line_{begin,end}(LineCount)
2012-10-31 14:28:03 +01:00
Maxime Coste
74731b0d0f
refactor Client creation
2012-10-31 14:23:44 +01:00
Maxime Coste
6eef68124f
use custom Client::operator=(Client&&) to drop safe counts first
2012-10-30 18:13:57 +01:00
Maxime Coste
1ea4b3998a
Add a ClientManager for managing client lifetimes
2012-10-30 14:00:44 +01:00
Maxime Coste
bc7dfec44c
tweak cpp highlighting
2012-10-29 19:17:48 +01:00
Maxime Coste
945f54daea
fix crashes when cycling through menu with an active filter
2012-10-29 19:17:37 +01:00
Maxime Coste
254d43856d
NCurses: refactor status line handling, and disambiguate status line from mode line
2012-10-29 19:01:57 +01:00
Maxime Coste
6f2c69a0eb
fix adapt_for_linewise for Replace mode
2012-10-29 19:00:28 +01:00
Maxime Coste
cc876f7107
validate key in InputHandler before sending to mode, and minor refactor
2012-10-29 18:59:41 +01:00
Maxime Coste
6b664052b8
Use a Server object instead of just calling setup_server
2012-10-29 13:44:53 +01:00
Maxime Coste
ba244a70a3
NCurses: fix long lines handling
2012-10-28 11:00:23 +01:00
Maxime Coste
d9729cc29e
Handle all available input before redrawing
2012-10-28 09:26:54 +01:00
Maxime Coste
13a081ed4a
Remote: fix resize handling
2012-10-27 15:49:10 +02:00
Maxime Coste
b24a80a3ec
NCurses::draw: maintain current column without using ncurses
2012-10-27 15:48:08 +02:00
Maxime Coste
031ed91ea6
EventManager: handle forced events even when poll return -1
2012-10-27 15:15:34 +02:00
Maxime Coste
b199cfd644
NCursesUI: force input handling reexecution when resizing
2012-10-27 15:02:17 +02:00
Maxime Coste
70cdb7a811
EventManager: add force_signal method to force event execution
2012-10-27 15:01:13 +02:00
Maxime Coste
24b43f91c8
NCurses: rework terminal resize handling
2012-10-27 14:18:52 +02:00
Maxime Coste
ee882d9d02
utf8: use CharCount instead of size_t
2012-10-27 13:26:40 +02:00
Maxime Coste
61c8ef6ce4
remote: send resize message when needed
2012-10-26 16:14:51 +02:00
Maxime Coste
73aa11ac16
remote: check read/write results, detect disconnections
2012-10-26 13:45:32 +02:00
Maxime Coste
1c3f6c314f
send actual dimensions of remote client at connection
2012-10-25 12:51:01 +02:00
Maxime Coste
0735c69a92
add initial (and buggy) unix socket based client/server code
2012-10-24 21:44:19 +02:00
Maxime Coste
b9eb939e05
Add some remote client support protocol code
2012-10-23 22:55:44 +02:00
Maxime Coste
b163711963
DisplayBuffer: store lines in a vector, not a list
2012-10-23 22:55:04 +02:00
Maxime Coste
227c66cf61
use Colors and Attributes are char
2012-10-23 22:53:56 +02:00
Maxime Coste
98b6618658
merge contiguous DisplayAtoms after highlighting DisplayBuffer
2012-10-22 13:20:02 +02:00
Maxime Coste
eed8a2a57c
add basic utf8 unit test
2012-10-22 01:05:56 +02:00
Maxime Coste
49237a771b
some minor cleanups/refactorings in main
2012-10-21 13:09:01 +02:00
Maxime Coste
a0cca31dc1
make UserInterface unaware of Window, only of DisplayBuffer
2012-10-20 20:15:20 +02:00
Maxime Coste
48fe18ff0a
memoryview: include cstddef for size_t
2012-10-20 16:40:12 +02:00
Maxime Coste
28c8acf80a
assert: throw if launching xmessage fails
2012-10-19 03:53:10 +02:00
Maxime Coste
abf514f305
avoid utf8 errors with invalid keys, like ncurse KEY_RESIZE
2012-10-18 19:56:57 +02:00
Maxime Coste
132c31042e
main: prepare for multi client support
2012-10-17 17:49:34 +02:00
Maxime Coste
df400f90ab
utf8: replace InvalidBytePolicy::Throw with InvalidBytePolicy::Assert
2012-10-17 17:01:51 +02:00
Maxime Coste
c1387dc592
assert: simplify header
2012-10-17 17:01:08 +02:00
Maxime Coste
4aa3a36102
rename Client to InputHandler
2012-10-17 13:14:03 +02:00
Maxime Coste
1ab486b0d8
verious refactoring
2012-10-16 18:42:51 +02:00
Maxime Coste
f8abbfbb44
assert: use xmessage to block on assert failed
2012-10-16 16:16:32 +02:00
Maxime Coste
214baf4cdd
add a _str user defined literal to create String
2012-10-16 15:11:22 +02:00
Maxime Coste
6ff6058ceb
create_buffer_from file return nullptr on file not found instead of throwing
2012-10-16 14:59:39 +02:00
Maxime Coste
4be6882bd5
Menu: support searching through choices with /
...
when hitting / while in a menu, a regex filter can be entered so that only
entries matching it are selectable, <esc> disable filtering while a second
<esc> close the menu as usual.
2012-10-15 12:49:46 +02:00
Maxime Coste
148466c659
Extract basic line editing functionality from PromptMode to LineEditor
2012-10-14 16:24:35 +02:00
Maxime Coste
dfafcdb6e6
utf8::codepoint: configurable invalid byte policy
2012-10-13 19:05:14 +02:00
Maxime Coste
4f1ab5b749
fix Window::scroll_to_keep_cursor_visible_ifn
2012-10-11 14:23:20 +02:00
Maxime Coste
4210a17753
Client: never call substr(CharCount, String::npos);
2012-10-11 14:22:08 +02:00
Maxime Coste
c92077762c
Makefile: add -Wall to CXXFLAGS
2012-10-11 01:17:29 +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
571861bc7b
Return something in utf8::distance, thanks again gcc for letting this work
2012-10-11 00:39:17 +02:00
Maxime Coste
561cc72d6c
Add a ByteCount unit
2012-10-11 00:13:31 +02:00
Maxime Coste
2cdebe01d3
fix make tags
2012-10-10 22:44:06 +02:00
Maxime Coste
8de754e2e9
when executing keys, propagate potentially changed editor to calling context
2012-10-10 19:15:43 +02:00
Maxime Coste
dae8f65308
exec concat all its arguments instead of accepting only one
2012-10-10 19:15:09 +02:00
Maxime Coste
ffba94fcde
Actually return something in utf8::codepoint, thanks gcc for using rax
2012-10-10 19:14:18 +02:00
Maxime Coste
a04d1e3a1f
Editor merge selections when they overlap
2012-10-10 19:11:24 +02:00
Maxime Coste
5bb37ad755
Support Append mode for Editor::select and use it for 'N' key
2012-10-10 13:59:55 +02:00
Maxime Coste
4c8b4890e6
Context: explicit constructors and more comments
2012-10-10 13:59:55 +02:00
Maxime Coste
74cdeb5952
Paste use a linewise mode when pasted string ends with a \n
2012-10-10 13:59:55 +02:00
Maxime Coste
b48d639976
Editor::insert handle all InsertModes
2012-10-10 13:59:55 +02:00
Maxime Coste
d574ae864d
Editor::insert takes an InsertMode param, remove Editor::{append,replace}
2012-10-09 19:25:20 +02:00
Maxime Coste
7a8366da2b
add a unicode.hh header for Codepoint related functions, s/utf8::Codepoint/Codepoint/
2012-10-09 19:15:05 +02:00
Maxime Coste
e1d4215159
InsertMode insert the whole utf8 representation of a codepoint
2012-10-09 14:31:00 +02:00
Maxime Coste
c0db3b81be
NCursesUI::get_key returns the codepoint
2012-10-09 14:30:35 +02:00
Maxime Coste
ba50d853b3
Editor: fix move_selection(LineCount) for utf8
2012-10-09 14:29:59 +02:00
Maxime Coste
1af7465107
utf8: add dump(OutputIterator& it, Codepoint cp)
2012-10-09 14:29:37 +02:00
Maxime Coste
c7272e427d
get rid of Character
2012-10-08 19:33:53 +02:00
Maxime Coste
194bf6ac98
Buffer: add some utf8 sanity checks
2012-10-08 19:25:17 +02:00
Maxime Coste
bff015d5b9
WordCompleter: avoid word currently being edited
2012-10-08 19:14:48 +02:00
Maxime Coste
0a686573ab
utf8 awareness in selectors
2012-10-08 19:12:09 +02:00
Maxime Coste
ed592a3005
DisplayAtom: add utf8 sanity check
2012-10-08 14:28:54 +02:00
Maxime Coste
5602bc10e8
DisplayAtom: only let DisplayLine touch m_begin and m_end
2012-10-08 14:28:38 +02:00
Maxime Coste
7e046e3f0b
utf8 awareness in editor, highlighters and ncurses
2012-10-08 14:27:43 +02:00
Maxime Coste
5a267ab627
selections should always point to an utf8 character sequence start byte
2012-10-08 14:26:57 +02:00
Maxime Coste
f2e98f700e
add utf8_iterator for adapting byte iterators to iterate on unicode characters
2012-10-08 14:25:58 +02:00
Maxime Coste
2db1d02329
add utf8 helpers in utf8.hh
2012-10-08 14:25:05 +02:00
Maxime Coste
946b4650b6
fix postfix StronglyTypedInteger::operator{++,--}
2012-10-02 14:19:45 +02:00
Maxime Coste
514aeead63
do not use our broken safe bool, c++11 explicit bool conversion is better
2012-10-02 14:18:34 +02:00
Maxime Coste
9ae8f5e47b
Editor::move_selection now either takes a LineCount or a CharCount
2012-10-02 14:10:00 +02:00
Maxime Coste
669d2e456f
add postfix operator++ to BufferIterator
2012-10-02 14:09:06 +02:00
Maxime Coste
9ec10daf69
move clamp to utils.hh
2012-10-02 14:08:09 +02:00
Maxime Coste
84acf2594a
grep,make: tweak mktemp call to work on OSX
2012-10-02 10:37:08 +02:00
Maxime Coste
081f579ba1
OSX compilation fixes
2012-10-02 10:36:28 +02:00
Maxime Coste
4b0ccb0437
String and BufferIterator value_type goes back to plain char
2012-10-01 20:20:08 +02:00
Maxime Coste
f2f3421637
cpp.kak: fix string highlighter
2012-10-01 14:24:32 +02:00
Maxime Coste
bd0805cf3e
autoenable word completion while inserting
2012-10-01 14:23:04 +02:00
Maxime Coste
29b72b3e24
Add a word completing functionality to insert mode (wip)
2012-09-30 16:24:06 +02:00
Maxime Coste
430765e132
extract is_alpha to string.hh
2012-09-30 16:23:18 +02:00
Maxime Coste
801e3eaae2
Add a Window::display_position(const BufferIterator&) method
2012-09-30 16:22:03 +02:00
Maxime Coste
6cd5d80757
Add a length method to AtomContent
2012-09-30 16:21:20 +02:00
Maxime Coste
5b6cb500fc
Menus can be placed anywhere on the screen, and takes a style parameter
...
This paves the way for insert mode completion menu using the current
prompt menu system.
2012-09-30 15:18:37 +02:00
Maxime Coste
f230feec7f
Change buffer order based on the last one used
2012-09-28 14:14:49 +02:00
Maxime Coste
79d8d082bd
Store capture groups with selections in editor, and access them through dynamic registers
2012-09-26 20:43:42 +02:00
Maxime Coste
a8d2482eb6
Editor now stores selections as SelectionAndCapturesList
2012-09-26 20:33:47 +02:00
Maxime Coste
a2fd1528e6
Move last insertion from Client to Context
2012-09-26 20:07:06 +02:00
Maxime Coste
77eb86bcdb
Forbid context copy
2012-09-26 14:27:23 +02:00
Maxime Coste
efc069b531
Extract IncrementalInserter::Mode as InsertMode
...
move ClientMode classes in a namespace due to InsertMode name collisions
2012-09-26 14:22:24 +02:00
Maxime Coste
f76323f56e
Move UserInterface out of Client into Context
2012-09-26 14:13:04 +02:00
Maxime Coste
c36ee924eb
cleanup BatchUI
2012-09-25 14:23:50 +02:00
Maxime Coste
730f39aaa0
remove selection stack from editor
2012-09-24 20:47:06 +02:00
Maxime Coste
747c14c19f
Hide more Client Mode code in the cpp
2012-09-24 19:39:40 +02:00
Maxime Coste
a312ce6dc2
extract Client virtual methods to a UserInterface class
2012-09-24 19:24:27 +02:00
Maxime Coste
0380c999c3
move Client::Mode class definition in client.cc
2012-09-24 14:03:04 +02:00
Maxime Coste
b3c4912404
Use context.editor() instead of context.window() when a window is not needed
2012-09-24 13:56:39 +02:00
Maxime Coste
e86e3bda4d
select_all_matches: reject match that start at the end of originating selection
2012-09-19 14:04:09 +02:00
Maxime Coste
81eae79154
ncurses: fix displaying of lines longer than screen
2012-09-17 21:38:51 +02:00
Maxime Coste
b245b39a85
RegexColorizer: store ColorPairs by pointer so that alias changes are taken into account
2012-09-17 21:02:08 +02:00
Maxime Coste
a92a6dc7f3
ColorRegistry: permit overriding an alias
2012-09-17 21:01:11 +02:00
Maxime Coste
4d369d6290
kakrc: use color aliases for cpp and kakrc highlighting
2012-09-17 19:02:08 +02:00
Maxime Coste
5cf947f845
Add a ColorRegistry class responsible of color parsing and supporting aliases
...
colalias command permits to define names for color pairs
2012-09-17 19:01:13 +02:00
Maxime Coste
45bffd8b8a
fix parse_keys for <esc>
2012-09-17 13:46:34 +02:00
Maxime Coste
00e357ed56
PromptMode: fix completion of non-last parameters
2012-09-17 13:37:08 +02:00
Maxime Coste
ebae75e96e
fifo: buffer size is 4k instead of 512
2012-09-14 14:29:54 +02:00
Maxime Coste
f6d2533cae
rework fifo handling, use real fifos in {make,grep}.kak, update README
2012-09-12 19:54:46 +02:00
Maxime Coste
a467d73115
use parse_filename when opening files or completing filenames so that ~ and env vars are handled
2012-09-12 19:42:12 +02:00
Maxime Coste
6f6f10c83d
simplify tab completion code in Client::InsertMode
2012-09-12 19:09:27 +02:00
Maxime Coste
ec57990060
whine when a search selected nothing so that the user knows
2012-09-12 19:09:10 +02:00
Maxime Coste
cfbe32f6a2
support Tab/BackTab keys in MenuMode as well
2012-09-12 14:25:14 +02:00
Maxime Coste
7266052d46
grep command uses file completion
2012-09-12 14:22:01 +02:00
Maxime Coste
7c039585a4
add -file-completion option to def command and document in README
2012-09-12 14:21:42 +02:00
Maxime Coste
62e50c38fa
commands.cc: cleanup
2012-09-11 19:09:55 +02:00
Maxime Coste
9dfccddca8
Correctly handle arrow keys in insert mode
2012-09-11 19:09:14 +02:00
Maxime Coste
e39086cd5f
Buffer: reset undo data after executing hooks in constructor
2012-09-11 19:03:37 +02:00
Maxime Coste
a0b75817a5
do not keep undo data in the debug buffer
2012-09-11 19:03:13 +02:00
Maxime Coste
eac68f09a4
NCursesClient::show_menu: stop displaying counts in front of items
2012-09-11 14:30:32 +02:00
Maxime Coste
859e907396
fix NCursesClient::menu_select for one past last item
2012-09-11 14:28:54 +02:00
Maxime Coste
ee4c6b04a6
Support Shift-Tab in prompt mode to go back in completions
2012-09-11 14:27:21 +02:00
Maxime Coste
b5a2901f8d
add 'r' for replacing selection with next typed char
2012-09-11 14:01:41 +02:00
Maxime Coste
f8a6045307
Load config file in ${XDG_CONFIG_HOME}/kak/kakrc and ${XDG_CONFIG_HOME}/kak/autload/*
...
Do not autoload files in $kak_runtime/rc, let the user choose
restore the runtime command implemented in shell this time.
2012-09-10 20:45:34 +02:00
Maxime Coste
82a2bb37e7
Remove runtime command, use shell expansion to source files in rc dir.
...
With the help of a new kak_runtime env var.
2012-09-10 20:10:18 +02:00
Maxime Coste
f9e31856cf
Buffer: Allow inserting at the end when the inserted text ends with an end of line
...
Adapted other code in consequence and added unit tests so that this behavior
is maintained.
2012-09-10 19:26:17 +02:00
Maxime Coste
a37b14785f
use -shell-params in rc files
2012-09-09 17:14:08 +02:00
Maxime Coste
ae76b7dddc
Add support for shell script parameters
...
Now %sh{ ... } can access positional parameters through
standard shell construct, allowing simple handling of variable
parameters.
def command accepts -shell-params flag to use this facility.
2012-09-09 17:10:53 +02:00
Maxime Coste
46565723b1
Add support for page up and page down
2012-09-07 21:09:23 +02:00
Maxime Coste
499bb77491
Cleanup Key handling, use symbolic names for function keys
2012-09-07 20:22:19 +02:00
Maxime Coste
287628ec19
Editor::{select,move_cursor} takes a enum SelectMode parameter instead of a boolean
2012-09-07 14:29:29 +02:00
Maxime Coste
1e18dcba0f
fix Client::repeat_last_insert when no last insert
2012-09-07 14:28:27 +02:00
Maxime Coste
4e356a6312
kakrc.kak: fix comments highlighting
2012-09-06 14:30:09 +02:00
Maxime Coste
96beaf50dd
ShellManager: output stderr in the debug buffer
2012-09-06 14:28:07 +02:00
Maxime Coste
ddd5236b08
cpp.kak: smarter alt command
2012-09-06 13:38:51 +02:00
Maxime Coste
41b0751a5d
tweak make output highlighting
2012-09-06 13:35:36 +02:00
Maxime Coste
16e1c2daf9
simplify menu api
2012-09-05 19:02:06 +02:00
Maxime Coste
11d86ca3f3
fix Selection::merge_with
2012-09-05 14:27:48 +02:00
Maxime Coste
bf42d77469
Handle inserting in Client::InsertMode
2012-09-05 14:27:14 +02:00
Maxime Coste
d4446d1525
Client: fix history search
2012-09-05 00:52:09 +02:00
Maxime Coste
5c4df507c4
ncurses: colorize the menu
2012-09-05 00:49:59 +02:00
Maxime Coste
3f64c36654
fix NCursesClient::show_menu with big menu entries
2012-09-05 00:37:09 +02:00
Maxime Coste
bdaa083c88
Factor select to next char commands using Client::on_next_key
2012-09-05 00:30:59 +02:00
Maxime Coste
737ee8af24
use on_next_key in do_go and do_select_object
2012-09-05 00:21:42 +02:00
Maxime Coste
b23425764e
Add client::on_next_key method to run some code when the next key arrives
2012-09-05 00:21:19 +02:00
Maxime Coste
aac30a27e7
use more constexpr
2012-09-04 23:54:10 +02:00
Maxime Coste
63f467081a
Prompt: use entered text as prefix for history search
2012-09-04 13:48:04 +02:00
Maxime Coste
11d5ae2743
add override markers
2012-09-04 00:17:41 +02:00
Maxime Coste
0e6ced9176
cleanup cpp.kak
2012-09-04 00:08:01 +02:00
Maxime Coste
2e339e92bb
Allow arrow keys in prompt mode
2012-09-04 00:07:13 +02:00
Maxime Coste
d530a2d864
Support # comments in commands
2012-09-04 00:04:49 +02:00
Maxime Coste
57b89099ec
Client::MenuMode wrap through options with j/k Ctrl-n/Ctrl-p and tab
2012-09-04 00:02:50 +02:00
Maxime Coste
c4dd6b4038
Client::MenuMode map tab as SelectNext
2012-09-03 23:55:11 +02:00
Maxime Coste
69bebdb44e
fix open line above for first line and add a unit test
2012-09-03 23:46:04 +02:00
Maxime Coste
c61f9cbe6b
Add MenuCommand::SelectNone and use it when tab completions goes back to original string
2012-09-03 19:34:10 +02:00
Maxime Coste
c2a4f68899
NCurses: Fix menu display
2012-09-03 19:20:41 +02:00
Maxime Coste
b08d8719e6
move input handling, including menu and prompt, to the Client class
2012-09-03 14:22:02 +02:00
Maxime Coste
d5f5f0989d
fix control key parsing
2012-09-03 19:21:11 +02:00
Maxime Coste
96a50e9b7d
NCurses: use menu for tab completion
2012-08-31 14:14:16 +02:00
Maxime Coste
51e80558d9
Change client menu api to give more control to the caller
2012-08-30 21:53:22 +02:00
Maxime Coste
1ca502d23d
More useable menu implementation on ncurses
2012-08-30 21:14:28 +02:00
Maxime Coste
78d4675c24
git.kak: tweak highlighting
2012-08-30 18:56:05 +02:00
Maxime Coste
f1d8d0add8
escape whitespaces in filename or buffername completions
2012-08-29 21:52:17 +02:00
Maxime Coste
2825bc3d7b
Fix escaped whitespace handling in command manager
2012-08-29 21:50:48 +02:00
Maxime Coste
bbce6b22a3
remove regex.hh, define Regex directly in string.hh
2012-08-29 21:49:36 +02:00
Maxime Coste
8febec0bcf
add_hook: do not construct a regex again and again
2012-08-29 14:15:13 +02:00
Maxime Coste
8263adf8c8
make.kak: fix highlighting
2012-08-29 14:13:59 +02:00
Maxime Coste
1fc05c8bb0
make.kak: fix parameter passing
2012-08-29 14:03:55 +02:00
Maxime Coste
2b8c636377
use fifo buffers for grep and make command
2012-08-29 00:35:45 +02:00
Maxime Coste
db98bcc278
Add an -fifo option to the 'edit' command
...
In -fifo mode, the buffer's file is used as a fifo, writes are tracked
and udpated in the buffer. This should be useful for grep and make
commands.
2012-08-29 00:17:37 +02:00
Maxime Coste
00d32fd392
main: EventManager should be destroyed after the Buffers
2012-08-29 00:11:16 +02:00
Maxime Coste
2d82e2a2c6
fix ShellManager, avoid zombie childs when grand childs detaches themselves
2012-08-29 00:08:39 +02:00
Maxime Coste
ab47b72dc8
add a poll based EventManager and use it for ncurse client update
2012-08-28 22:32:15 +02:00
Maxime Coste
d5dc5dff7f
ncurses: refresh at end of draw_window
2012-08-28 22:31:06 +02:00
Maxime Coste
4cdddb7e6d
BufferManager: protect complete_buffername from regex_error
2012-08-28 21:46:49 +02:00
Maxime Coste
217b3d2bce
fix compilation on OSX
2012-07-30 14:12:49 +02:00
Maxime Coste
1833cb4dcf
use a separate context for kakrc execution
2012-08-28 14:10:44 +02:00
Maxime Coste
db1e2f2d86
fix complete_filename
2012-08-28 14:10:05 +02:00
Maxime Coste
96c6adad78
IncrementalInserter: Fix avoid_eol behavior
2012-08-27 14:26:16 +02:00
Maxime Coste
350b578eb5
grep.kak: do not quote params
2012-08-23 23:56:35 +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
c6e8080426
do_go: some cleanups
2012-08-21 20:58:10 +02:00
Maxime Coste
3f471c138a
RegexColorizer: fix last buffer line highlighting
2012-08-21 20:53:23 +02:00
Maxime Coste
0eaf39b725
Add Buffer::iterator_at_line{begin,end}(size_t line) overloads
2012-08-21 20:52:49 +02:00
Maxime Coste
05098a373a
edit command: when a line is specified ask the window to center it
2012-08-21 20:08:57 +02:00
Maxime Coste
26313a3f68
bind <a-c> to window::center_selection
2012-08-21 20:06:35 +02:00
Maxime Coste
c9a7cf50f3
add Window::center_selection method
2012-08-21 20:05:56 +02:00
Maxime Coste
45b9ac6087
fix parse_keys for <a-key>
2012-08-21 20:03:18 +02:00
Maxime Coste
1515566e4b
Allow context with client and non-window editor
2012-08-17 20:18:36 +02:00
Maxime Coste
7cc5ff7c73
fix create_buffer_from_file when file does not exists
2012-08-17 18:52:04 +02:00
Maxime Coste
8a6e8cd898
RegexColorizer: Fix range computation
2012-08-17 18:42:07 +02:00
Maxime Coste
b6460aaec7
make.kak: style fix
2012-08-17 18:41:40 +02:00
Maxime Coste
4b93a90047
grep.kak: use perl regex syntax and quote parameters
2012-08-17 12:39:57 +02:00
Maxime Coste
c1fcc593a1
Store the current client in context
2012-08-15 22:36:45 +02:00
Maxime Coste
a2aefa2998
avoid keeping end of lines selected in Editor::erase
2012-08-15 18:20:02 +02:00
Maxime Coste
416785f53c
Add BufferIterator::clamp(bool avoid_eol) method
2012-08-15 18:18:12 +02:00
Maxime Coste
390d4ccdfc
Buffer::{iterator_at,clamp} takes an optional avoid_eol parameter
...
when avoid_eol is true, clamping does avoid end-of-line if possible
2012-08-15 18:06:59 +02:00
Maxime Coste
260b30e6d9
misc cleanups
2012-08-15 17:55:58 +02:00
Maxime Coste
346108ec62
CommandManager::parse: fix invalid memory read
2012-08-15 17:34:01 +02:00
Maxime Coste
99eaa259e6
Context: do not store buffer, ask editor for it
2012-08-15 17:32:46 +02:00
Maxime Coste
9e3323bf68
RegexColorizer only cache a range instead of the whole buffer
2012-08-15 17:24:08 +02:00
Maxime Coste
6e70b805df
colorize_regex become RegexColorizer and maintain a cache of matches
2012-08-15 17:08:48 +02:00
Maxime Coste
5393e9e78b
Buffer: add a timestamp
2012-08-15 17:07:53 +02:00
Maxime Coste
14475e91cb
rc/grep.kak: style fix
2012-08-14 14:27:32 +02:00
Maxime Coste
e00c811712
complete_buffername try regex matching when prefix matching does not work
2012-08-14 14:26:36 +02:00
Maxime Coste
b630189ce5
Add a writeall (wa) command
2012-08-14 14:20:18 +02:00
Maxime Coste
4e34f777b0
Buffer: stronger invariant, a buffer is never empty and all lines finish by '\n'
2012-08-14 14:13:10 +02:00
Maxime Coste
b37f8f470a
use new reg access syntax in rc files
2012-08-11 12:14:17 +02:00
Maxime Coste
0a976cd309
CommandManager: support %reg{<reg>} and %opt{<option>} syntax
2012-08-11 12:13:48 +02:00
Maxime Coste
808e79a53e
commands: code cleanup
2012-08-11 11:48:54 +02:00
Maxime Coste
759319ca44
Buffer: move back Modification as an implementation detail
...
* Filters now only works on insertion and take directly the
iterator and content
* use Buffer::insert and Buffer::erase to modify a buffer
2012-08-10 19:12:43 +02:00
Maxime Coste
44621bff11
detect byte order mark in buffers, and write back
2012-08-10 18:48:21 +02:00
Maxime Coste
7d3675fe33
make.kak: quote echo parameter in errjump
2012-08-10 18:47:54 +02:00
Maxime Coste
20655f9290
ShellManager: fix option regex, allow caps
2012-08-10 18:47:18 +02:00
Maxime Coste
d81a100a85
support crlf line ending when reading and writing buffers
2012-08-10 14:24:13 +02:00
Maxime Coste
54b599c1a7
Buffer: fix corner case in insert
2012-08-10 14:22:57 +02:00
Maxime Coste
c7fc2a9317
Buffer: add reset_undo_data method
2012-08-10 14:21:32 +02:00
Maxime Coste
e5c46d7c45
Window,Buffer: add const overload for {option,hook}_manager
2012-08-10 14:21:01 +02:00
Maxime Coste
a30b3e1343
highlight_range: handle empty ranges
2012-08-10 14:20:15 +02:00
Maxime Coste
f59dd77f60
add rc/asciidoc.kak for asciidoc highlighting
2012-08-08 19:38:27 +02:00
Maxime Coste
1eb2b8321b
make.kak: errjump also display the error description in the status line
2012-08-08 19:37:32 +02:00
Maxime Coste
691a6328b1
exec_keys: use the context editor, no need for a new one
2012-08-08 19:37:04 +02:00
Maxime Coste
ce99856bfa
Refactor BufferManager
2012-08-08 19:36:40 +02:00
Maxime Coste
b29b75aa81
Regex Highlighter: highlight 10 lines above and below displayed range
...
and some code cleanup
2012-08-08 19:02:36 +02:00
Maxime Coste
1ede3f6b13
BufferIterator: use default operator=
2012-08-08 18:51:30 +02:00
Maxime Coste
939dc0fa8e
Makefile: use -MMD to generate deps instead of using separate steps
2012-08-08 13:39:31 +02:00
Maxime Coste
e7153aacef
rc/{grep,make}.kak: use a scratch buffer to store results
2012-08-07 23:29:12 +02:00
Maxime Coste
78b0c2f7f5
kakrc: fix string highlighting
2012-08-07 23:26:40 +02:00
Maxime Coste
25a1a9c159
Fix do_pipe
2012-08-07 23:25:54 +02:00
Maxime Coste
8e0f99a03b
write command refuse to write a scratch file when no filename is given
2012-08-07 23:20:53 +02:00
Maxime Coste
207f2f6bb9
edit commands accept a -scratch flag to edit not to be saved file
2012-08-07 23:20:11 +02:00
Maxime Coste
dd05d6c6f5
BufferIterator: fix operator+
2012-08-07 23:18:37 +02:00
Maxime Coste
b0ed0e37b7
add rc/grep.kak which provides a grep and gjump command
2012-08-07 14:29:33 +02:00
Maxime Coste
a88da08767
add rc/make.kak which provides make and errjump commands
2012-08-07 13:52:49 +02:00
Maxime Coste
6a660f7e8f
ncurses: refresh at the end of print_status so that the status is immediately visible
2012-08-07 14:21:26 +02:00
Maxime Coste
2cac18545e
define_command: remove unused param from parser definition
2012-08-07 14:26:51 +02:00
Maxime Coste
718f62b6a3
support line and column in command line parameters
2012-08-07 14:00:47 +02:00
Maxime Coste
b3c293a9da
cpp.kak: also try to detect cpp files using the file tool
2012-08-07 13:51:51 +02:00
Maxime Coste
4bfe46a882
kakrc: tweak highlighting
2012-08-07 13:51:21 +02:00
Maxime Coste
661c9db925
colorize_regex_factory: transform boost::regex_error in Kakoune::runtime_error
2012-08-07 00:32:21 +02:00
Maxime Coste
c166bc92e3
use new regex highlighter features in rc files
2012-08-07 00:28:55 +02:00
Maxime Coste
02b7786bcd
fix complete_filename
2012-08-07 00:16:51 +02:00
Maxime Coste
b69134c36f
new regex highlighter parameters syntax, support per capture highlight
2012-08-07 00:13:54 +02:00
Maxime Coste
a38a9c3bf2
Commands take a mutable context, main_context is gone !
2012-08-06 22:02:11 +02:00
Maxime Coste
a712dd5bbe
Completions functions take a Context parameter
2012-08-06 21:37:43 +02:00
Maxime Coste
39797f87dc
command_manager: cleanup command execution, lazy exec shell commands
2012-08-06 19:29:51 +02:00
Maxime Coste
4dc9973288
Registers need a context to return their values
2012-08-05 20:13:41 +02:00
Maxime Coste
18ca422306
Context: only buffer context are not allowed, an editor is always needed
2012-08-05 20:12:43 +02:00
Maxime Coste
1ce2d3e302
cleanup keymap definition
2012-08-05 19:53:39 +02:00
Maxime Coste
0164d78c10
Use a context as parameter to keymap functions
2012-08-05 19:39:37 +02:00
Maxime Coste
12e2ce0f3c
Context: store an editor instead of a window
2012-08-05 18:23:37 +02:00
Maxime Coste
2cc01d3407
move SafeCountable functionality to Editor from Window
2012-08-05 18:23:09 +02:00
Maxime Coste
d91070f5b7
Context: add a numeric_param property
2012-08-05 16:46:10 +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
23f72851e4
Buffer: fix insert at end of buffer
2012-08-02 07:04:04 +02:00
Maxime Coste
407782a742
command_manager.cc: use anonymous namespace
2012-08-02 06:41:55 +02:00
Maxime Coste
2d2ac98511
fix global.kak, eval command no longer exists
2012-08-02 06:41:08 +02:00
Maxime Coste
2071db3558
Tokens are CommandManager implementation details
...
CommandParameters go back to memoryview<String>
2012-08-01 14:27:34 +02:00
Maxime Coste
36070dd429
CommandManager: rework command parser
...
a new type of strings is supported inspired by the ruby strings.
%<delimiter>content<delimiter>, if opening delimiter is one of
([{<, then closing delimiter is the matching )]}> and balanced
delimiters in the string needs not to be escaped, else the closing
delimiter is the same as the opening one.
shell expansion is available through %sh<delimiter>command<delimiter>
syntax.
Command flags have been removed, as these strings provide proper nesting
support, so now, you can for example do:
def command %{ echo %sh{ ls } }
2012-07-31 14:22:57 +02:00
Maxime Coste
ac2676cbcf
ShellManager: catch all exception once we are in child process
2012-07-31 14:21:25 +02:00
Maxime Coste
b65f8cc887
CommandParameters is a list of Tokens instead of Strings
...
CommandManager string parsing is less ad-hoc.
2012-07-31 00:06:50 +02:00
Maxime Coste
a3cb9bfc5e
editor.cc: remove unused id_not_unique
2012-07-30 13:39:38 +02:00
Maxime Coste
6bd67c01cc
refactor insertion and insertion replay functions
2012-07-27 10:22:33 +02:00
Maxime Coste
0e9b0c8b3a
insert_char: remove 'ctrl-r %' handling, already provided by dynamic register
2012-07-25 14:29:51 +02:00
Maxime Coste
af203b2b94
diff.kak: recognize patch files
2012-07-25 14:14:25 +02:00
Maxime Coste
6fc0432e9f
add inline keyword in cpp highlighting
2012-07-20 13:36:06 +02:00
Maxime Coste
435797e34f
global: quote tag pattern
2012-07-18 19:03:20 +02:00
Maxime Coste
399b9b6235
optimize regex highlighter's regex
2012-07-18 19:02:41 +02:00
Maxime Coste
4908b2c3ef
Fix end_it computation in Buffer::insert, avoid clamping in iterator_at
2012-07-18 14:12:41 +02:00
Maxime Coste
c915e18950
Move selection to last modification position in editor::{undo,redo}
2012-07-16 21:53:00 +02:00
Maxime Coste
31c0931dff
Go back to a generic BufferChangeListener interface for selection update
2012-07-16 21:51:37 +02:00
Maxime Coste
fe988868e5
IncrementalInserter preserves selections
2012-07-16 21:21:56 +02:00
Maxime Coste
5a671db12c
Correct multi select unit test
2012-07-16 21:14:52 +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
6e072d1a61
ncurses: fix first ~ line drawing
2012-07-12 23:59:02 +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
2830825c56
BufferIterator: allow invalid iterator in operator=
2012-07-12 23:11:16 +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
06dd3f8aad
Add Editor::replace(memoryview) and bind alt-P to replace paste
2012-07-11 14:15:27 +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
d092afead9
make DisplayBuffer::atom_containing easier to understand
2012-07-03 21:12:05 +02:00
Maxime Coste
d7e1cab116
DisplayAtom: support empty replacement
2012-07-03 19:13:16 +02:00
Maxime Coste
603cfd3108
do not catch exception in commands, let them propagate
2012-06-30 00:44:14 +02:00
Maxime Coste
f11d44246c
add safe_ptr::operator=(safe_ptr&&) and safe_ptr::reset(T*)
2012-06-30 00:33:36 +02:00
Maxime Coste
dfbda951d3
support static and dynamic registers, add '%' (filename) and '.' (selection) registers
2012-06-29 18:37:17 +02:00
Maxime Coste
5b2ef1da6a
IncrementalInsertor::insert takes a memoryview<String> rather than a Register
2012-06-29 18:35:48 +02:00
Maxime Coste
7aa533c049
simplify Register interface
2012-06-29 13:25:34 +02:00
Maxime Coste
49e1d91804
Buffer: pass by value instead of by reference when object will be copied anyway
...
Let copy elision and move semantics kick in
2012-06-29 13:19:29 +02:00
Maxime Coste
36e4dacdf5
Fix BufferIterator::on_erase and tweak Buffer
2012-06-28 14:26:01 +02:00
Maxime Coste
9b6b6b6b17
Rename UI to Client
2012-06-28 14:11:43 +02:00
Maxime Coste
286462a2f6
Add Context::option_manager()
...
it returns the more specific option manager available
(window -> buffer -> global)
2012-06-28 14:01:37 +02:00
Maxime Coste
9c78453cb7
Context references buffer and window with a safe_ptr
2012-06-28 13:46:14 +02:00
Maxime Coste
4dfc910195
BufferManager use safe_ptr to reference the Buffers
2012-06-28 13:45:42 +02:00
Maxime Coste
1289268174
Add SafeCountable and safe_ptr classes
...
safe_ptr is a smart pointer which manage a safe count in pointed
objects. SafeCountable provides the interface needed for safe_ptr
and assert the safe count is zero in destructor.
This permits to have pointers that guarantees their pointed object is
alive.
2012-06-28 13:42:55 +02:00
Maxime Coste
e7e9b8a6cd
add rc/diff.kak and load in kakrc
2012-06-27 14:29:12 +02:00
Maxime Coste
70bd18e1f2
add kak_opt_.* environement variable retriever to access options from shell.
2012-06-27 14:28:43 +02:00
Maxime Coste
ecb3a737a9
Tweak String class, and cleanup usages
...
remove String::clear, add operator=(String&&) add str_to_int(const String&)
to replace atoi.
2012-06-27 14:26:29 +02:00
Maxime Coste
7fb49b183e
ShellManager environment variable use a regex instead of an exact match
...
when a kakoune releated env var used in a shell command, the ShellManager
tries to match it with given regex and the first that matches calls its
value retriever.
For this to be useful, EnvVarRetrievers now also take the variable
name in its parameters.
2012-06-25 19:40:18 +02:00
Maxime Coste
cffb895797
remove ugly id_to_str param in idvaluemap and str_to_str
2012-06-25 19:11:13 +02:00
Maxime Coste
ccec35f88c
code cleanups in buffer
2012-06-25 19:05:32 +02:00
Maxime Coste
d1c4a655b9
git.kak: use filetype option
2012-06-15 14:24:57 +02:00
Maxime Coste
11e8d07797
cleanup kakrc.kak
2012-06-14 21:52:47 +00:00
Maxime Coste
c8fdbc2a60
support buffer as a hook target
2012-06-14 20:51:01 +00:00
Maxime Coste
0e8add34ae
delete buffer deletes the current buffer when no params given
2012-06-14 18:05:42 +00:00
Maxime Coste
eb34f6db73
execute BufClose hook in Buffer destructor
2012-06-14 17:44:28 +00:00
Maxime Coste
fd8517f91e
fix some warnings detected with clang
2012-06-05 13:33:02 +00:00
Maxime Coste
5936aa6710
rework cpp.kak and kakrc.kak to use the filetype option
2012-06-14 13:21:22 +00:00
Maxime Coste
dc91f344f7
Reorder managers creation in main
2012-06-14 13:20:40 +00:00
Maxime Coste
f7ee2801e9
Windows call the WinSetOption hook when an option changes
2012-06-14 13:19:38 +00:00
Maxime Coste
a943e08dc7
Refactor OptionManager, add OptionManagerWatcher
...
- use set_option to set an option, instead of operator[] (no-const)
- keeps a list of OptionManagerWatcher to notify when an option change
it also notifies when an option changes in his parent and the option
is not overridden.
2012-06-14 13:16:44 +00:00
Maxime Coste
109c11f29c
BufferManager deletes remaining buffers in his destructor
2012-06-14 13:15:30 +00:00
Maxime Coste
cab03ef1c6
When creating an Option, OptionManager takes it's initial value from it's parent if possible
2012-06-12 18:28:25 +00:00
Maxime Coste
bc359d7c90
BufCreate hook is always called for every buffer, BufNew is called when creating a new file
2012-06-12 18:27:57 +00:00
Maxime Coste
20315eac85
replace Option::operator {String,int} with Option::as_{string,int}
2012-06-12 18:26:20 +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
5710893dd5
Cleanup utils.hh, remove auto_raii in favor of on_scope_end
2012-06-12 18:45:13 +00:00
Maxime Coste
e36b3565bf
call SetOption hook when setting an option
2012-06-12 13:10:52 +00:00
Maxime Coste
67c6b6834e
execute kakrc after creating an UI
2012-06-12 13:10:33 +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
6a416abae2
abstract ui functions in a UI base class
2012-06-05 23:15:19 +00:00
Maxime Coste
02051bb067
fix runtime directory detection on MacOS
2012-06-05 14:23:47 +00:00
Maxime Coste
61bd77d529
fix compilation on MacOS
2012-06-05 13:31:14 +00:00
Maxime Coste
546a999416
global: select the tag, fail nicely
2012-06-04 14:27:56 +00:00
Maxime Coste
419d5691a1
add a try command
...
use try <commands...> catch <failure_commands...>
2012-06-04 14:27:34 +00:00
Maxime Coste
310bc42d54
tweak cpp highlighting
2012-06-04 14:14:01 +00:00
Maxime Coste
a7c33207d6
check if no modification were made in Buffer::end_undo_group
2012-06-04 14:12:37 +00:00
Maxime Coste
589aad5f9c
sort command names completion candidates
2012-06-02 15:49:56 +00:00
Maxime Coste
f972428823
The def command do not override commands by default, use -allow-override
2012-06-02 15:49:35 +00:00
Maxime Coste
942e63d836
correctly implement std::hash<String>
2012-05-30 14:20:21 +02:00
Maxime Coste
d7c917c96e
include <unistd.h> in order to get read and write
2012-05-30 14:19:53 +02:00
Maxime Coste
6792696ba2
enable global and line numbering in kakrc
2012-05-29 11:35:30 +00:00
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
Maxime Coste
f541a639f2
support memoryview construction from iterators
2012-02-13 14:14:26 +00:00
Maxime Coste
9304e41326
support register access through ctrl-r in ncurses_prompt
2012-02-13 13:37:41 +00:00
Maxime Coste
333b470dd2
giving a count to paste selects which selections yank buffer to use
...
3p will paste using the yank buffer of the third selection instead
of each selection using it's own.
2012-02-10 14:00:21 +00:00
Maxime Coste
0352ad7983
Editor: replace all captures if one capture is present
...
before, selecting with 2 captures after selecting with 3 captures
would keep the third capture from the first selection.
2012-02-10 13:58:29 +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
333e87dedd
add a Register class, registers can now contain a list of string
...
That way, registers can be used to store per selection data
2012-02-07 23:01:02 +00:00
Maxime Coste
9b5e9ffee2
selectors now take a Selection as parameter instead of a BufferIterator
2012-02-07 14:26:51 +00:00
Maxime Coste
1e5d930f35
extract exec_keys function from exec_string
2012-02-07 13:35:41 +00:00
Maxime Coste
0483e951ad
use memoryview instead of std::vector where applicable
2012-02-03 19:14:35 +00:00
Maxime Coste
ac02ccb53d
add a memoryview class
...
memoryview is a non owning typed view over a memory range, usefull
to pass arrays as parameters without data copying.
2012-02-03 19:13:02 +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
96101b4392
Use an Editor instead of a Window as much as possible
2012-02-02 20:48:03 +00:00
Maxime Coste
69d96c90da
extract an Editor class from Window and refactor
2012-01-31 19:12:06 +00:00
Maxime Coste
d23a175533
insert include guards in C++ header files at creation
2012-01-31 14:07:41 +00:00
Maxime Coste
a783d06bf1
tweak c++ highlighting
2012-01-31 14:03:51 +00:00
Maxime Coste
3ef9895a97
Buffer: support creation of temporary windows to apply commands when no windows are in context
2012-01-31 14:03:10 +00:00
Maxime Coste
830d96f7a1
Buffer: add NewFile buffer type for buffer with an non existing yet file
2012-01-31 14:01:48 +00:00
Maxime Coste
959ec46a16
Context: add methods bool has_{buffer,window)
2012-01-31 13:38:06 +00:00
Maxime Coste
6579b43ffb
make parse_keys handle <c-*> and <a-*> keys.
2012-01-29 22:49:14 +00:00
Maxime Coste
73a8950e73
File: parse_filename function which handle ~ and environment variable in filenames
2012-01-29 22:24:43 +00:00
Maxime Coste
589b8e68bb
history support in prompt
2012-01-25 22:32:17 +00:00
Maxime Coste
14d17a4493
add a find(container, value) utility function
2012-01-25 22:31:47 +00:00
Maxime Coste
6411193f10
SelectionHighlighter: reverse color of the last char of each selection
...
the terminal cursor is now longer shown
2012-01-25 20:22:33 +00:00
Maxime Coste
0e805238b5
tweak cpp highlighting
2012-01-25 19:35:53 +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
c837336474
optimize SelectionHighlighters, stop copying Selections
2012-01-25 18:51:47 +00:00
Maxime Coste
d1c29d2b78
moving no longer clears multiple selections
2012-01-25 14:23:02 +00:00
Maxime Coste
81138b224f
fix line break support in insert_char
2012-01-24 23:19:26 +00:00
Maxime Coste
381d884c16
use a settable get_key function to be able to override key reading
2012-01-24 23:18:59 +00:00
Maxime Coste
e0b216d576
HooksManager: do not propagate hooks runtime exception
2012-01-24 23:17:26 +00:00
Maxime Coste
1fd8ec8bfd
support Ctrl-R <reg> when inserting to insert a register
2012-01-24 19:08:57 +00:00
Maxime Coste
a62d56064f
replace ncurses getch calls with a get_key method
2012-01-23 14:17:31 +00:00
Maxime Coste
950a734ce5
adapt rc files to the new hook command
2012-01-23 14:00:33 +00:00
Maxime Coste
a1ff9999f5
the hook command takes a first parameter to specify the hook owner
...
currently 'global' and 'window' are accepted owners. 'window' will
add the hook to the current context window.
2012-01-23 13:58:43 +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
73ae3d292f
implement finding kak executable path on MacOS
2012-01-20 21:12:57 +00:00
Maxime Coste
bb36271ae5
HighlighterGroup: use idvaluemap::complete_id_if in complete_group_id
2012-01-19 20:53:15 +00:00
Maxime Coste
ce6b4c2cc4
idvaluemap: complete_id_if method for conditional id completion
2012-01-19 20:52:08 +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
cffdbcb689
replace addhl -group with addgrouphl command, and add rmgrouphl
2012-01-18 00:15:10 +00:00
Maxime Coste
ae8882b0de
Context: do not permit access to window or buffer if null
2012-01-15 21:33:35 +00:00
Maxime Coste
a6930395b8
tweak kakrc files highlighting
2012-01-15 17:50:46 +00:00
Maxime Coste
c1f625054a
split kakrc with filetype specific files in rc/
...
cpp highlighting is now specified by rc/cpp.kak.
2012-01-15 17:35:25 +00:00
Maxime Coste
c62b3b251d
add a runtime command to execute files in the runtime directory
2012-01-15 17:34:05 +00:00
Maxime Coste
f99c3a1a6a
kakrc: use a hlkakrc highlighter group for kakrc highlighting regex
2012-01-15 13:48:48 +00:00
Maxime Coste
f3e8498a58
addhl supports a -group option
...
-group <group_id> can be used to add the highlighter in a
highlighter group which will be then handled as a whole.
2012-01-15 13:47:12 +00:00
Maxime Coste
98f937146a
HighlighterRegistry: add add_highlighter_to_group method
2012-01-15 13:46:45 +00:00
Maxime Coste
2cfa70a466
Window: add get_highlighter_group method
2012-01-15 13:46:12 +00:00
Maxime Coste
0c1e763d66
Highlighters: add an HighlighterGroup class
2012-01-15 13:45:18 +00:00
Maxime Coste
5092456186
Highlighters: move HighlighterParameters definition from highlighter_registry.hh to highlighter.hh
2012-01-15 13:44:16 +00:00
Maxime Coste
7599edffa9
idvaluemap: add missing includes
2012-01-15 13:40:58 +00:00
Maxime Coste
0234378bcf
kakrc: refactor using lists of commands for hooks
2012-01-15 03:04:37 +00:00
Maxime Coste
f259af9326
CommandManager: add flags support and IgnoreSemiColons flag
...
commands are now registred with flags, and the IgnoreSemiColons
flag permit to specify a command which needs all the parameters
on the line, bypassing the command sequence operator ';'.
the hook command is tagged as such.
2012-01-15 03:02:08 +00:00
Maxime Coste
be5cf92367
Completion: sort results in complete_filename
2012-01-15 02:02:18 +00:00
Maxime Coste
f673f3c334
Completion: handle hidden files in complete_filenam
2012-01-15 02:01:58 +00:00
Maxime Coste
49ea6f7103
correctly clear the window status line
2012-01-15 01:45:23 +00:00
Maxime Coste
4a5758ebb3
CommandManager: support ';' as a command separator
2012-01-15 01:37:35 +00:00
Maxime Coste
272f2d87a1
Highlighters: tweak colorize_cplusplus
2012-01-14 14:12:20 +00:00
Maxime Coste
95db828e17
CommandManager: use directly first command parameter as the command name
2012-01-14 14:02:54 +00:00
Maxime Coste
66d91b8828
support '\' as a line continuation marker when executing commands in file
2012-01-14 13:50:45 +00:00
Maxime Coste
fea81e1378
kakrc: add support for kakrc file highlighting
2012-01-14 01:04:08 +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
e02cb4e5bd
Selectors: select_next_match starts from cursor+1
...
so searching effectively starts on the character after current
selection end. Which makes repeating 'n' on a one character match
work.
2012-01-09 14:22:52 +00:00
Maxime Coste
8b1b1d9cd8
Selectors: add select_surrounding to select blocks
...
Alt-a followed by []()<>{}bB selects the block surrounding current
selection end.
Alt-i is similar but selects only the inside of the block.
2012-01-04 14:18:08 +00:00
Maxime Coste
e59bdd931e
search for kakrc next to the kak executable instead of in the current directory
2011-12-28 22:57:48 +00:00
Maxime Coste
4de41197c0
Add a | key that pipes each selection through an external filter
2011-12-28 19:04:06 +00:00
Maxime Coste
c9ac4d615d
Highlighters: tweak colorize_cplusplus
2011-12-28 18:52:35 +00:00
Maxime Coste
0e398566d2
Buffer: fix compute_lines on empty_buffer
2011-12-28 18:52:14 +00:00
Maxime Coste
aa1c4d64f9
Completions: complete_filename correctly support directories
2011-12-22 13:44:04 +00:00
Maxime Coste
6fa5d809ef
whitespace fix
2011-12-22 13:33:29 +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
c11b548662
kakrc: cleanup trailing whitespaces when quiting insert mode
2011-12-21 18:58:41 +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
913ee3f096
Use Keys instead of char for keymap
2011-12-21 14:29:28 +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
42a24895de
Add Key struct
2011-12-20 19:21:11 +00:00
Maxime Coste
91606850fd
Utils: add on_scope_end utility
...
on_scope_end permits to register a functor to be called at scope
end (either exception thrown or normal scope end). this is usefull
for cleanup code that must be run.
usage:
auto cleaner = on_scope_end([]() { cleanup(); });
2011-12-20 19:18:00 +00:00
Maxime Coste
17cab9c7c4
Filters: add cleanup_whitespace filter
...
this filter remove trailing whitespaces on the previous line
when inserting an end-of-line.
2011-12-20 14:27:01 +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
Maxime Coste
c40eb2b03a
Buffer: replace insert and erase methods with modify
...
modify directly takes a Modification as parameter
2011-12-07 14:26:40 +00:00
Maxime Coste
2edddfe009
Buffer: rename BufferModification to Modification
2011-12-06 18:58:43 +00:00
Maxime Coste
73cebb9072
kakrc: do not highlight the end-of-line in trailing whitespaces
2011-12-06 18:50:05 +00:00
Maxime Coste
b245d80c4e
Window: preserve current selection when empty multi_select
2011-12-05 19:21:16 +00:00
Maxime Coste
4ae2fcffbd
Buffer: add comment for clamp
2011-12-05 19:21:11 +00:00
Maxime Coste
711c05b81e
Window: fix trailing spaces
2011-12-05 14:29:36 +00:00
Maxime Coste
23eafd4504
Add a repeat last insert command, bound to .
2011-12-05 14:28:45 +00:00
Maxime Coste
d1cc5da8a6
Filters: add expand_tabulations to insert spaces instead of tabs
2011-12-03 20:25:05 +00:00
Maxime Coste
74a315cd0e
kakrc: add preserve_indent filter on c++ files and highlight trailing spaces
2011-12-02 19:01:08 +00:00
Maxime Coste
c761420055
fix exec_commands_in_file
2011-12-02 19:00:37 +00:00
Maxime Coste
11d606f79e
{Filter,Highlighter}Registry: more infos on factory not found
2011-12-02 19:00:01 +00:00
Maxime Coste
0b4ed2280f
Buffer: call BufCreate hook on construction
2011-12-02 18:59:18 +00:00
Maxime Coste
8e39edc567
DynamicBufferIterator: fix end of buffer corner case
2011-12-02 18:57:18 +00:00
Maxime Coste
b1daf8de16
Selectors: fix select_line on the last line
2011-12-02 18:56:18 +00:00
Maxime Coste
94d59cc4dd
Buffer: add filter support
...
filters are functions called prior to applying a modification
to a buffer. They can manipulate the modification to change
the editor behaviour.
2011-12-02 14:28:27 +00:00
Maxime Coste
8e06e168d9
HighlighterRegistry: use idvaluemap to store factories
2011-12-02 14:22:51 +00:00
Maxime Coste
4252e0d610
Window: use an idvaluemap to store highlighters
2011-12-02 14:20:11 +00:00
Maxime Coste
a5a726d291
Add idvaluemap container
...
it is a vector based map, preserving insertion order and providing
completion on ids it contains.
2011-12-02 14:18:31 +00:00
Maxime Coste
934e62b502
stop clearing selections all the time
2011-11-30 14:18:54 +00:00
Maxime Coste
d8dd782960
Highlighters: style fix
2011-11-30 14:11:53 +00:00
Maxime Coste
0b48525b35
Window: do not stay on an eol when clearing selections
2011-11-29 22:48:00 +00:00
Maxime Coste
0859b20bcf
Rename Filter to Highlighter to be more explicit
2011-11-29 22:37:20 +00:00
Maxime Coste
e89516f2a3
IncrementalInserter: refactoring
2011-11-29 21:35:50 +00:00
Maxime Coste
b24dec89a2
Buffer: add iterator_at_line_{begin,end} methods
2011-11-28 19:31:29 +00:00
Maxime Coste
51ee0b61f4
DynamicBufferIterator: use const_cast instead of having a mutable field in Buffer
2011-11-28 18:55:17 +00:00
Maxime Coste
46a01b5a0b
Debug: stop writing key codes to debug buffer and cleanups
2011-11-28 18:52:29 +00:00
Maxime Coste
dc642f8afa
Buffer: refactor to remove do_{insert,erase} methods
2011-11-27 18:41:25 +00:00
Maxime Coste
08ba791ff4
Add a kakrc file which automatically enables hlcpp on c/c++ files
2011-11-27 13:02:50 +00:00
Maxime Coste
70e0393c4d
Add a source command to execute commands from file
...
a kakrc file in current directory is sourced automatically
at start
2011-11-27 12:59:59 +00:00
Maxime Coste
de19aeb035
File: extract read_file function which returns file content in a string
2011-11-27 12:56:38 +00:00
Maxime Coste
b59a0816b9
Add wq and wq! commands
2011-11-26 19:11:24 +00:00
Maxime Coste
e36153f035
CommandManager: fix complete and style tweak
2011-11-26 19:05:49 +00:00
Maxime Coste
a00961da99
Add hook command
2011-11-26 18:41:55 +00:00
Maxime Coste
dd2896ecc8
Window: call WinCreate hook on creation
2011-11-26 18:39:59 +00:00
Maxime Coste
9c117a821c
Filters: fix colorize_regex_range when range is not visible
2011-11-26 18:34:49 +00:00
Maxime Coste
68f3d24199
HooksManager: replace HookContext with Context
2011-11-26 18:34:10 +00:00
Maxime Coste
957446dee4
Add a Context parameter to commands
2011-11-26 18:32:57 +00:00
Maxime Coste
417802cbdf
CommandManager: argument splitting supports "multi word"
...
works with " and '
2011-11-26 17:20:02 +00:00
Maxime Coste
9775958012
Add a HooksManager class
2011-11-25 14:26:29 +00:00
Maxime Coste
9a4d8d5f4d
Filters: tweak colorize_cplusplus
2011-11-24 19:13:58 +00:00
Maxime Coste
dcfb5e15f2
SelectionHighlighter: highlight end of lines in selection
2011-11-24 19:13:38 +00:00
Maxime Coste
ea2aeea3a4
Filters: generalize colorize_regex in colorize_regex_range
2011-11-24 19:11:58 +00:00
Maxime Coste
2549a63c0b
Selectors: fix corner cases on first/last buffer char
2011-11-24 18:46:35 +00:00
Maxime Coste
30b4fb6513
Buffer: fix handling of last eol
2011-11-24 14:23:41 +00:00
Maxime Coste
7b09b34cab
Selectors: fix select_whole_lines
2011-11-22 18:58:05 +00:00
Maxime Coste
d27aaab066
use alt-x instead of , to select whole lines
2011-11-22 14:31:20 +00:00
Maxime Coste
a1200aacad
Add alt-j command to join lines
2011-11-22 14:24:50 +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
a7309fbe87
IncrementalInserter: fix erase
2011-11-21 22:18:00 +00:00
Maxime Coste
7861ad9ddb
Selectors: add split_selection bound to Alt-s
2011-11-21 19:30:44 +00:00
Maxime Coste
b67c36358d
Extract RegexSelector methods as plain selectors
2011-11-21 19:08:51 +00:00
Maxime Coste
2677fa7961
Add , to fully selects lines selection is on.
2011-11-21 18:53:22 +00:00
Maxime Coste
a1a57ea137
DisplayBuffer: fix DisplayAtom::iterator_at
2011-11-16 21:03:32 +00:00
Maxime Coste
bef193ae54
RegexSelector: support captures
2011-11-16 20:05:29 +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
b1e815a66c
RegexSelector: support multi selections, bound to s key
2011-11-16 14:06:01 +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
7423677236
Filters: cleanup trailing whitespaces
...
detected with ':addfilter regex \h+\n default red' !
2011-11-15 14:28:03 +00:00
Maxime Coste
d1868e8f07
ncurses: set ESCDELAY to 25 so that esc key lag is less noticeable
2011-11-15 14:26:28 +00:00
Maxime Coste
a3b5c74512
remove unused code
2011-11-14 14:27:33 +00:00
Maxime Coste
031fa1a25c
Filters: colorize_regex supports matches spanning multiple display atoms
2011-11-14 14:23:02 +00:00
Maxime Coste
d2b9cd6e60
DisplayBuffer: split now preserve iterator parameter
...
that means that the given iterator points to the first part of the
split (instead of the second in previous implementation).
2011-11-14 14:10:11 +00:00
Maxime Coste
0dc8442ca4
Completions: add filterid completion for rmfilter
2011-11-12 14:15:35 +00:00
Maxime Coste
a8b2c4f568
Completions: add basic addfilter completion
2011-11-12 14:08:05 +00:00
Maxime Coste
f5ad32f137
Completion: decentralise, move buffer name completion to BufferManager
2011-11-12 14:06:49 +00:00
Maxime Coste
82baa55eed
Completions: change NullCompletion functor to complete_nothing function
2011-11-10 20:57:25 +00:00
Maxime Coste
56231b4239
Filters: make colorize_regex accessible through addfilter
2011-11-10 14:28:38 +00:00
Maxime Coste
f12929abad
Filters: refactoring
2011-11-09 23:56:22 +00:00
Maxime Coste
5aeee719dd
fix launching on new file
2011-11-09 14:17:46 +00:00
Maxime Coste
55c092eed9
Filters: code cleanup
2011-11-09 14:06:05 +00:00
Maxime Coste
3af1b89034
Window: support adding and removing filters with :addfilter :rmfilter
2011-11-08 14:29:52 +00:00
Maxime Coste
1f3f5ea1ba
Filters: register existing filters with the registry
2011-11-08 14:28:01 +00:00
Maxime Coste
e4ff1d8ad8
Add a filter registry class
2011-11-08 14:27:21 +00:00
Maxime Coste
0ddb6df80d
IncrementalInserter: move cursor left when finishing
2011-11-04 14:15:35 +00:00
Maxime Coste
46e727d5b6
Filters: tweak colorize_cplusplus
2011-11-04 09:10:28 +00:00
Maxime Coste
cebb7980cb
Buffer: tweak default content
2011-11-04 09:10:05 +00:00
Maxime Coste
9cf7cb682c
Buffer: fix modified handling
2011-11-03 13:44:02 +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
856a870d8b
fix not existing lines drawing
2011-11-02 14:22:20 +00:00
Maxime Coste
fbe8eed3e4
Selectors: select_line selects next line when cursor is on eol
2011-10-27 18:57:31 +00:00
Maxime Coste
0e18db5a88
lines and columns used for user interaction are 1-indexed
2011-10-27 14:27:39 +00:00
Maxime Coste
55cd4949e0
Selection: more intelligent merging
2011-10-27 14:22:17 +00:00
Maxime Coste
62482b65ec
rename buffer_iterator.inl.h to buffer_iterator.inl.hh
2011-10-27 14:13:39 +00:00
Maxime Coste
5bd61a3f38
Filters: correct select_to_previous_WORD
2011-10-27 14:09:57 +00:00
Maxime Coste
c532f031d2
Filters: tweak colorize_cpluscplus
2011-10-26 14:29:04 +00:00
Maxime Coste
b58694939c
bind alt-[lLhH] to select_to_eol(_reverse)?
2011-10-26 14:22:48 +00:00
Maxime Coste
5d5e76a3eb
change select_line binding from . to x
2011-10-26 14:18:43 +00:00
Maxime Coste
2c8f3229c0
Selectors: add selectors for WORDs
...
WORDs are the same as vim's ones, i.e. a group of contiguous non blank
characters. They are bound as alt + word selector key.
2011-10-25 18:46:14 +00:00
Maxime Coste
97a279e229
add alt-key binding support
...
bind alt-[tTfF] to backward version of [tTfF]
2011-10-25 14:28:20 +00:00
Maxime Coste
57b55a5824
DisplayBuffer: deactivate too expensive check
2011-10-24 19:27:36 +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
bace526fa3
Buffer: not copyable, add destructor
2011-10-24 14:23:13 +00:00
Maxime Coste
12d933d896
Filters: rewrote colorize_regex
2011-10-23 20:26:51 +00:00
Maxime Coste
fffa405bfd
DisplayBuffer: overload atom_containing with a version taking an iterator to search start
2011-10-23 20:26:30 +00:00
Maxime Coste
ad6ee464f4
style tweak
2011-10-19 18:54:20 +00:00
Maxime Coste
712577b88e
CommandManager: fix completion of empty tokens
2011-10-19 18:50:28 +00:00
Maxime Coste
d7f934b7ca
Buffer: iterator_at prevents getting iterators on end of line
2011-10-19 14:25:13 +00:00
Maxime Coste
7e2f7f6715
IncrementalInserter: fix OpenLineBelow
2011-10-18 14:13:19 +00:00
Maxime Coste
32e01947fa
DisplayBuffer: store atoms in a std::list instead of a vector
2011-10-18 13:59:32 +00:00
Maxime Coste
6fd7f97fa7
Window: fix status_line cursor position
2011-10-18 13:49:10 +00:00
Maxime Coste
c7876f0ba3
DisplayBuffer: remove some check_invariant, overhead is too noticeable
2011-10-18 00:56:18 +00:00
Maxime Coste
8cab34d57f
Buffer: add support for modification listeners
2011-10-18 00:55:45 +00:00
Maxime Coste
d48a2bd325
BufferIterator: move methods implementation to buffer_iterator.inl.h
2011-10-17 22:05:06 +00:00
Maxime Coste
1c6eef08f1
utils: add contains function
2011-10-17 21:05:22 +00:00
Maxime Coste
316e84f119
Filters: add a show line numbers filter
2011-10-17 19:01:36 +00:00
Maxime Coste
2badb9d708
DisplayAtom: add splittable methode
2011-10-17 19:01:04 +00:00
Maxime Coste
79ee27dae7
DisplayBuffer: deinline insert method and add atom_containing method
2011-10-17 19:00:38 +00:00
Maxime Coste
88e31d8cce
DisplayBuffer: allow empty atoms, with begin == end
2011-10-17 18:59:35 +00:00
Maxime Coste
53ce1e016a
Buffer: move struct Modification out of class, as BufferModification
2011-10-17 14:12:15 +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
187a99aba2
LineAndColumn: add comparison operators
2011-10-15 04:42:28 +00:00
Maxime Coste
26459abf8a
WindowCoord: rename to DisplayCoord and move with DisplayBuffer
2011-10-14 14:29:53 +00:00
Maxime Coste
c5be69a9a9
BufferCoord: allow explicit construction from all LineAndColumns
2011-10-14 14:27:43 +00:00
Maxime Coste
2d54a7818e
Window: privatize coordinates conversion methods
2011-10-12 18:54:48 +00:00
Maxime Coste
80e7bac622
Selectors: remove unused move_select
2011-10-12 18:54:04 +00:00
Maxime Coste
be043ffe1e
Window: move_cursor_to takes a BufferIterator parameter
2011-10-12 18:53:38 +00:00
Maxime Coste
22bd9f90d5
Filters: add an expand_tabulation filter
2011-10-12 18:52:22 +00:00
Maxime Coste
f802a9f3be
Debug: add key integral value in the debug buffer on keystroke
2011-10-10 22:47:19 +00:00
Maxime Coste
219709e472
Completions: move code from main.cc to completion.hh
2011-10-10 22:38:58 +00:00
Maxime Coste
fe0e1c79f0
Window: scroll when inserting, appending, erasing if necessary
2011-10-10 14:28:39 +00:00
Maxime Coste
7e84ca9ae9
gl and gh now go to first or last character of the line
...
append mode is supported through G key
2011-10-10 14:24:17 +00:00
Maxime Coste
003c5d4e3d
remove useless line
2011-10-08 13:23:18 +00:00
Maxime Coste
afd1ae5458
Filters: tweak colorize_cplusplus
2011-10-07 14:28:38 +00:00
Maxime Coste
868a2f8107
ncurses: fix color support
2011-10-07 14:28:13 +00:00
Maxime Coste
10106e8c8e
DisplayBuffer: do not store content in atom, begin and end are sufficient
2011-10-07 14:19:58 +00:00
Maxime Coste
a19f4f059d
Debug: add a write_debug function
...
write_debug writes in a Scratch buffer named '*debug*', so that debug
messages are accessibles from within kakoune
2011-10-07 14:16:38 +00:00
Maxime Coste
9db4aa9691
Buffer: add a type property
2011-10-07 14:15:55 +00:00
Maxime Coste
12535e1099
Window: get rid of select_mode
2011-10-07 14:03:25 +00:00
Maxime Coste
ca99a51bca
clear selections after a change
2011-10-06 21:13:33 +00:00
Maxime Coste
1e224dc586
whitespace fix
2011-10-06 21:13:16 +00:00
Maxime Coste
571e4772b4
IncrementalInserter: support OpenLineBelow and OpenLineAbove mode
2011-10-06 21:12:55 +00:00
Maxime Coste
cf9f8c93ec
Filters: tweak colorize_cplusplus
2011-10-06 21:12:16 +00:00
Maxime Coste
f9be716776
quit: do not quit if modified buffer exists, add q! command
2011-10-05 18:43:47 +00:00
Maxime Coste
cf162ae617
draw_window: add a space for eol, so that selected eol are visible
2011-10-05 14:28:20 +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
4ce349fa02
Buffer: modification tracking
2011-10-05 14:21:24 +00:00
Maxime Coste
f4743e08bd
Filters: tweaks colorize_cplusplus
2011-10-04 19:08:34 +00:00
Maxime Coste
c8cf7bbaa9
Window: add a basic status line
2011-10-04 18:49:41 +00:00
Maxime Coste
4f771b084a
escape-key force return to normal mode
2011-10-03 18:41:05 +00:00
Maxime Coste
945426f47a
File: fix write_buffer_to_file
2011-10-03 18:40:12 +00:00
Maxime Coste
6a0b570e50
Filters: add a colorize_cplusplus filter and use it by default in Window
2011-10-03 14:30:14 +00:00
Maxime Coste
d99bcd7f2e
bind T and F as select_to_reverse non-inclusive and inclusive
2011-10-03 14:29:44 +00:00
Maxime Coste
01ac17ed04
Filters: add a colorize_regex filter
2011-09-30 19:16:23 +00:00
Maxime Coste
36c3bb6ae3
ncurses: quick'n'dirty color support
2011-09-30 19:15:14 +00:00
Maxime Coste
e351acd997
Window: fix blink_void
2011-09-29 14:23:46 +00:00
Maxime Coste
834e2d2fe3
DisplayBuffer: check_invariant method to assert atoms consistency
2011-09-29 09:10:27 +00:00
Maxime Coste
e659ea2dab
DisplayBuffer: add a split method to split an atom
2011-09-29 08:55:08 +00:00
Maxime Coste
822fc0f822
Window: add a test filter to make 'void' blink
2011-09-29 08:37:27 +00:00
Maxime Coste
ba2800ddac
Window: refactor DisplayBuffer generation
2011-09-28 20:54:11 +00:00
Maxime Coste
7746c78ccc
BufferIterator: add operator>{,=}
2011-09-28 20:53:29 +00:00
Maxime Coste
a30b7c1e9f
Window: fix scrolling when select_mode == Append
2011-09-28 19:21:49 +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
610acb3c0e
Selectors: add a count argument to select_to
2011-09-27 14:27:48 +00:00
Maxime Coste
01018a5eac
Handle paste before and paster after with p and P
2011-09-27 14:15:20 +00:00
Maxime Coste
924a85d14f
erase, change: yank current selection before erasing
2011-09-26 08:59:32 +00:00
Maxime Coste
6ff06ca985
DisplayBuffer: cleanup
2011-09-25 23:51:12 +00:00
Maxime Coste
639897517a
Word selectors: better handling of line breaks
2011-09-25 23:50:13 +00:00
Maxime Coste
dc54e7f09c
% key selects whole buffer
2011-09-24 13:45:25 +00:00
Maxime Coste
0cad8ed34b
gh and gl to move to first/last character of line
2011-09-24 13:08:04 +00:00
Maxime Coste
d4933daba0
BufferIterator: fix operator=
2011-09-24 13:06:35 +00:00
Maxime Coste
53c9021857
Search: save last search to '/' register and bind n to repeat last search
2011-09-24 12:48:58 +00:00
Maxime Coste
1f0b06a855
Window: undo group cleanup and fix of append method
2011-09-24 12:39:40 +00:00
Maxime Coste
9b865cea39
Basic support for yanking and pasting
2011-09-23 14:31:57 +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
8f70192875
CommandManager: now a singleton
2011-09-23 14:29:42 +00:00
Maxime Coste
c2cbd69c1a
main: using namespace std::placeholders
2011-09-23 14:27:34 +00:00
Maxime Coste
26537d7028
Utils: Singleton template and migration of the BufferManager
...
Singletons are not autocreating, the application needs to create
exactly one instance (I want to avoid implicit initialization order
hell)
2011-09-23 14:26:53 +00:00
Maxime Coste
52ad372adb
Selectors: support inclusive mode in select_to (bound to f key)
2011-09-23 14:06:10 +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
5ca901644f
Completion: add complete_buffername completer
2011-09-22 18:55:45 +00:00
Maxime Coste
429536d0f4
BufferManager: allow iteration on Buffers with begin/end methods
2011-09-22 18:55:23 +00:00
Maxime Coste
c3faeb6c05
Selectors: add select_to which selects until a given character on current line
2011-09-22 14:35:28 +00:00
Maxime Coste
0f4f201b6d
Selectors: fix select_matching
2011-09-22 14:18:26 +00:00
Maxime Coste
03c199420e
basic g (go) command, gg/gt goes to first line, gb goes to last
2011-09-22 14:02:07 +00:00
Maxime Coste
a8cac32fe0
Selectors: more vi-like words movements
2011-09-22 14:00:31 +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
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
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
535285d9e6
Initial commit
2011-09-02 16:51:20 +00:00