Maxime Coste
ce950ec9f7
Fix RegexHighlighter in a few corner cases
2015-02-16 13:25:17 +00:00
Maxime Coste
53f1c35013
Fix caching of regex highlighter matches
...
The previous method was constantly invalidating cache when used in
conjunction with region highlighters.
2015-02-15 19:42:48 +00:00
Maxime Coste
8e6cfd3f09
Indent fix
2015-02-14 23:28:09 +00:00
Maxime Coste
8c843f5bea
Add <a-h>, <a-l>, <a-x> and <a-d> bindings to line editor
...
<a-h> : move cursor left
<a-l> : move cursor right
<a-x> : delete char before cursor
<a-d> : delete char under cursor
2015-02-13 19:13:44 +00:00
Maxime Coste
224f73d72a
Cleanup and refactor externally modified buffer reloading
...
* Correctly hide the reload dialog in every client.
* Correctly handle buffer being deleted.
2015-02-12 19:18:03 +00:00
Maxime Coste
6658d15741
Allow <ret> and <esc> to reload/keep an externally modified file
...
Fixes #113
2015-02-11 13:56:45 +00:00
Maxime Coste
790e671f6c
Replace some <cstring> function usage with c++ algorithms
2015-02-10 23:09:30 +00:00
Maxime Coste
8714c41403
Do not hash rgb values for non rgb colors
2015-02-10 22:53:37 +00:00
Maxime Coste
56dd5f9540
Fix selecting of insert text in SelectionList::insert
2015-02-09 21:09:17 +00:00
Maxime Coste
ec1d5509bb
Refactor ncurses assistant option handling
...
The option is now ncurses_assistant, defaults to clippy, none
and off a recognized to disable assistant.
2015-02-09 13:33:54 +00:00
Maxime Coste
accc510d15
Merge remote-tracking branch 'robinmoussu/cat_assistant'
2015-02-09 13:26:33 +00:00
Maxime Coste
a94c554a7b
Add optional helper for commands, to get parameter dependent help
...
Use for the set command to document options.
2015-02-08 19:04:20 +00:00
robin moussu
0a5a37c1f2
add `assistant=cat|trombon' option
...
Move ascii art of assistant of top of file.
`assistant' has been renamed to `s_assistant' because it become a static
variable. It was because it `assistant()' was used in `set_ui_options' and
`make_info_box()'
2015-02-08 11:53:41 +01:00
robin moussu
239bb2dd33
Add a cat assistant!
2015-02-08 11:53:41 +01:00
Maxime Coste
0a2f2c2247
Use parameter pack to that the default hash_value is the worst match
2015-02-07 20:15:22 +00:00
Maxime Coste
5b6b04ef9c
Merge remote-tracking branch 'jjthrash/not-warnings'
2015-02-06 23:22:17 +00:00
Maxime Coste
f7b8215a68
Add a from C array constructor to ArrayView
2015-02-06 23:22:01 +00:00
Maxime Coste
bf088a864c
Avoid selecting buffer end when copying selection to next line
2015-02-06 22:04:42 +00:00
Jimmy Thrasher
240a004354
Fix compile warnings on OSX that could actually be errors
...
c++ -std=gnu++11 -g -Wall -Wno-reorder -Wno-sign-compare -pedantic -DKAK_DEBUG -MD -MP -MF .buffer.d -c -o .buffer.o buffer.cc
buffer.cc:35:20: warning: logical not is only applied to the left hand side of this comparison
[-Wlogical-not-parentheses]
kak_assert(not line->length == 0 and line->data()[line->length-1] == '\n');
^ ~~
./assert.hh:17:18: note: expanded from macro 'kak_assert'
if (not (condition)) \
^
buffer.cc:35:20: note: add parentheses after the '!' to evaluate the comparison first
./assert.hh:17:18: note: expanded from macro 'kak_assert'
if (not (condition)) \
^
buffer.cc:35:20: note: add parentheses around left hand side expression to silence this warning
./assert.hh:17:18: note: expanded from macro 'kak_assert'
if (not (condition)) \
^
buffer.cc:177:20: warning: logical not is only applied to the left hand side of this comparison
[-Wlogical-not-parentheses]
kak_assert(not line->length == 0 and line->data()[line->length-1] == '\n');
^ ~~
./assert.hh:17:18: note: expanded from macro 'kak_assert'
if (not (condition)) \
^
buffer.cc:177:20: note: add parentheses after the '!' to evaluate the comparison first
./assert.hh:17:18: note: expanded from macro 'kak_assert'
if (not (condition)) \
^
buffer.cc:177:20: note: add parentheses around left hand side expression to silence this warning
./assert.hh:17:18: note: expanded from macro 'kak_assert'
if (not (condition)) \
^
2 warnings generated.
2015-02-06 09:12:05 -05:00
Maxime Coste
eb5f458138
Extract directory/filename splitting in a function
2015-02-06 13:47:19 +00:00
Maxime Coste
622919bafd
Add C and alt-C for 'copy selection to next/previous line'
2015-02-05 21:25:04 +00:00
Maxime Coste
5339f94eb8
Fix missing modes in :map completion and docstring
2015-02-05 13:56:16 +00:00
Maxime Coste
d59b36b816
Fix incorrect Buffer::Change generated in Buffer::reload
2015-02-04 21:42:42 +00:00
Maxime Coste
87125e2707
Fix too strict assert and unneeded (lets hope) check
2015-02-03 23:39:04 +00:00
Maxime Coste
2a28260f87
Extend line numbering max width to 15 char
2015-02-03 13:44:42 +00:00
Maxime Coste
18eec7e511
Regex selectors more tolerant to matches not ending on char boundaries
2015-02-02 22:54:05 +00:00
Maxime Coste
340fc63f84
Improve code compatibility
2015-02-02 18:46:55 +00:00
Maxime Coste
b4442055e8
Fix recursive regions matching when a recursive matches just before an end
...
%sh{ $test {} $test } was incorrrectly closing the %sh block at the first {
because it was immediatly followed by a }.
2015-02-02 13:48:27 +00:00
Maxime Coste
c004187f32
Fix buffer reloading
2015-02-02 13:24:40 +00:00
Maxime Coste
09fc14be4b
Small refactor in highlighters.cc
2015-02-01 23:30:58 +00:00
Maxime Coste
4d6b8a70e1
Fix highlighter update with new LineModification behaviour
2015-02-01 23:19:07 +00:00
Maxime Coste
d3bccfeb94
Fixes in line_modification change, along with style tweak
2015-02-01 22:33:59 +00:00
Maxime Coste
0b4ecef2d2
Rewrite line modifications, hopefully with easier to comprehend code
2015-01-31 23:50:24 +00:00
Maxime Coste
804a050c39
Tweak Buffer::Change layout
2015-01-29 22:44:07 +00:00
Maxime Coste
ffff4711c5
Add history memory domain
2015-01-28 22:33:29 +00:00
Maxime Coste
bb74770a24
Add C-f and C-b binding for page up/page down
...
Fixes #173
2015-01-27 23:33:22 +00:00
Maxime Coste
cc699faa54
Store direct ref_ptr<StringStorage> for WordDB lines
...
Storing a SharedString is a waste, we want the whole line.
2015-01-27 13:12:52 +00:00
Maxime Coste
fb98ff652d
Keep all completion matches when selecting a candidate
2015-01-27 13:12:52 +00:00
Maxime Coste
2c425bb436
Always inline StringStorage methods
2015-01-26 19:41:26 +00:00
Maxime Coste
b697bf1795
Release display buffers when a window is added to free list
2015-01-26 19:41:10 +00:00
Maxime Coste
92cb3a035f
Try to improve ga behaviour
2015-01-26 19:40:48 +00:00
Maxime Coste
42966317b8
Tweak SharedString
2015-01-25 22:36:05 +00:00
Maxime Coste
79954e89ab
Fix GCC 4.8 compilation
2015-01-24 14:36:03 +00:00
Maxime Coste
f4e96e7f2e
Fix bug when deleting end of buffer text using multiple selections
2015-01-23 19:12:15 +00:00
Maxime Coste
cb197f57ba
Avoid temporary strings on buffer load/reload
...
Pass directly a Vector<ref_ptr<StringStorage>> to the buffer
2015-01-22 13:39:29 +00:00
Maxime Coste
2516c16bb9
Fix error message in tuple option parsing
2015-01-22 13:10:21 +00:00
Maxime Coste
0ff415597e
Add Display memory domain
2015-01-21 13:35:46 +00:00
Maxime Coste
b2d5b9ca5f
Try to fix travis compilation errors
2015-01-21 13:35:23 +00:00
Maxime Coste
5383cece3e
Fix write_debug with no debug buffer and multiple lines
2015-01-20 19:57:17 +00:00
Maxime Coste
b1281d225d
rename SharedString::Storage to StringStorage and use directly in Buffer
2015-01-19 19:31:56 +00:00
Maxime Coste
3697548e35
Use a single allocation for SharedString::Storage
2015-01-19 13:25:04 +00:00
Maxime Coste
39689f0a18
Add helper for overloading operator new/delete
2015-01-18 18:49:32 +00:00
Maxime Coste
9b057896d4
Replace std::shared_ptr with homemade, intrusive, ref_ptr
...
That saves a lot of memory as sizeof(SharedString) is now one
pointer less.
2015-01-18 18:23:58 +00:00
Maxime Coste
ef26b77aa7
buffer updates are in BufferMeta memory domain
2015-01-18 11:22:28 +00:00
Maxime Coste
7cdeb3d7f7
simplify echo code, avoid trailing spaces
2015-01-17 22:55:48 +00:00
Maxime Coste
32319aca45
Add support for per type default memory domain
2015-01-16 13:58:21 +00:00
Maxime Coste
4fd92127c3
Add a no copy shared string constructor, used for map lookup, and intern words
2015-01-15 19:58:08 +00:00
Maxime Coste
bb915f0bc5
Fix filename completion
2015-01-15 19:26:38 +00:00
Maxime Coste
8eef019cf8
Do not store lines to word in word db, just keep the old lines alive
2015-01-15 19:26:38 +00:00
Maxime Coste
76d806e98d
Replace InternedStrings with SharedString, shared_ptr based
2015-01-15 19:26:38 +00:00
Maxime Coste
2a878d51fd
Even more memory tracking
2015-01-14 19:16:32 +00:00
Maxime Coste
442304bc1c
Add missing cast to void* in placement new
2015-01-14 00:01:20 +00:00
Maxime Coste
2415d3f63c
Add missing <new> include
2015-01-13 23:54:58 +00:00
Maxime Coste
1e3e0b01af
Fix compatibility with gcc 4.8
2015-01-13 22:56:51 +00:00
Maxime Coste
118a6e1a7c
Use uint32_t for interned strings slots
2015-01-13 13:58:11 +00:00
Maxime Coste
61619a4d4d
Style tweak in WordDB
2015-01-13 13:57:44 +00:00
Maxime Coste
0412487b0c
-rdynamic does not work on gcc 4.9 under cygwin
2015-01-13 13:50:16 +00:00
Maxime Coste
beb3390334
Add interned string stats in debug command
2015-01-13 13:48:16 +00:00
Maxime Coste
b9c4fc2d8c
Add size_t and float to_string overload, and _sv UDL
2015-01-13 13:47:46 +00:00
Maxime Coste
f440c31370
Add missing cstddef include for ptrdiff_t
2015-01-12 20:03:52 +00:00
Maxime Coste
c8d651a517
Protect use of mallinfo in #ifdef __GLIBC__ blocks
2015-01-12 19:55:58 +00:00
Maxime Coste
e8b8070536
refactor slighly memory domain handling
2015-01-12 19:48:51 +00:00
Maxime Coste
19797ae8d6
Fix flag line highlighting
2015-01-12 19:35:31 +00:00
Maxime Coste
da562e03a0
replace all std::vector with Vector
2015-01-12 13:58:41 +00:00
Maxime Coste
83d0813b0f
Yet more tracking
2015-01-12 13:45:44 +00:00
Maxime Coste
f1f10639a5
Compute tracked memory total as well
2015-01-12 13:32:30 +00:00
Maxime Coste
0bdf1778cb
Some more memory tracking
2015-01-12 13:32:14 +00:00
Maxime Coste
dedb16bc73
Track some more memory
2015-01-11 19:28:03 +00:00
Maxime Coste
9adb97ea28
Track buffer lines memory
2015-01-10 12:56:09 +00:00
Maxime Coste
9f9156a752
Track String memory allocations
2015-01-09 13:57:21 +00:00
Maxime Coste
e5b36f548b
Add missing include
2015-01-08 19:31:28 +00:00
Maxime Coste
9b30e7469a
Add initial memory domain allocation tracking support
2015-01-07 19:29:31 +00:00
Maxime Coste
de12fe1cc6
Add completion for debug command
2015-01-06 19:06:53 +00:00
Maxime Coste
295a97f2a6
Rename memoryview to ArrayView
2015-01-06 13:43:37 +00:00
Maxime Coste
8e92e0eebc
Go back to previous buffer name completion implementation
2015-01-05 19:33:33 +00:00
Maxime Coste
c279da14e3
Refactor write_debug to avoid empty first line in *debug* buffer
2015-01-05 09:38:51 +00:00
Maxime Coste
ca9baecd4c
Another stule tweak
2015-01-04 22:34:36 +00:00
Maxime Coste
23f30f6709
Small style tweak
2015-01-03 17:35:53 +00:00
Maxime Coste
019a91505f
Remove unneeded static String
2015-01-02 11:55:15 +00:00
Maxime Coste
15542c3357
minor style tweak
2015-01-01 12:09:30 +00:00
Maxime Coste
c698032ace
Style tweak
2014-12-31 13:09:35 +00:00
Maxime Coste
0493cf6d62
Use a struct rather than a std::pair for InternedString DataAndRefCount
2014-12-30 11:56:01 +00:00
Maxime Coste
d4a929b42e
Use a struct KeyAndName rather than a std::pair
2014-12-29 17:18:42 +00:00
Maxime Coste
955d1dea66
Small formatting fixes
2014-12-29 12:19:16 +00:00
Maxime Coste
8cc96ec36b
Add a join function for joining strings using a specific char
2014-12-28 11:16:51 +00:00
Maxime Coste
71bfe5498d
Refactor color functions
2014-12-27 12:09:28 +00:00
Maxime Coste
248c1bda02
Style tweak
2014-12-26 10:53:30 +00:00
Maxime Coste
33bde3e067
Minor code tweak in optional.hh
2014-12-25 10:59:06 +00:00
Maxime Coste
2e1c6eaff7
sort includes
2014-12-24 13:03:17 +00:00
Maxime Coste
2852e0fbe5
Remove trailing blank lines
2014-12-23 23:00:20 +00:00
Maxime Coste
b0fef1a962
Rename id_map to IdMap
2014-12-23 22:51:00 +00:00
Maxime Coste
fb611e2f62
Use an id_map directly for HighlighterRegistry rather than the FunctionRegistry class
2014-12-23 22:15:53 +00:00
Maxime Coste
c17fa7be14
Tweak id_map implementation
2014-12-23 22:15:25 +00:00
Maxime Coste
79de7ee717
Code refactoring in WordDB
2014-12-23 19:32:42 +00:00
Maxime Coste
ed54e102ee
Extract complete_buffer_name as a free function in commands.cc
2014-12-23 17:42:17 +00:00
Maxime Coste
ae602106e0
Remove prefix_complete, superseeded by complete
2014-12-23 17:39:12 +00:00
Maxime Coste
b6ff15aa75
Unify completion from container content logic
2014-12-23 13:54:09 +00:00
Maxime Coste
064fb81b8d
Move containers utils to containers.hh and add filtered/transformed utils
2014-12-23 13:40:26 +00:00
Maxime Coste
bf980eba04
Merge branch 'list_buffers'
2014-12-23 13:20:29 +00:00
Eike Plack
9f81093411
Expose buffer list to shell over $kak_buflist
2014-12-23 02:49:53 +01:00
Maxime Coste
ff1f4dcb5c
Minor cleanup
2014-12-22 20:08:53 +00:00
Maxime Coste
e911c86306
Remove useless code
2014-12-22 20:08:30 +00:00
Maxime Coste
7a7ad57871
Support absolute paths when completing commands
2014-12-21 17:08:33 +00:00
Maxime Coste
5b94b73152
Small code tweak
2014-12-20 18:40:17 +00:00
Maxime Coste
116ea7364a
Restore some special behaviours, I missed them in interactive mode.
2014-12-19 13:58:33 +00:00
Maxime Coste
c454cf1379
Avoid eol after undo/redo
2014-12-18 23:17:38 +00:00
Maxime Coste
eee2cb3a6e
Revert "Add support for BufInsert/BufErase hooks"
...
This is potentially quite slow, and not used, reintroduce
later if we have a use case for it.
This reverts commit 5f3a477277
.
2014-12-18 23:13:45 +00:00
Maxime Coste
1c8ee78d1a
Do not register timers for transient input handlers
2014-12-18 23:12:58 +00:00
Maxime Coste
4827ae0a53
Do not wait for the first event before drawing clients
2014-12-18 19:01:18 +00:00
Maxime Coste
5f3a477277
Add support for BufInsert/BufErase hooks
2014-12-17 13:56:45 +00:00
Maxime Coste
3b9f40fd58
Fix split selecting the buffer end
...
Fixes #241
2014-12-17 13:21:20 +00:00
Maxime Coste
e0c452adb6
Tweak keymap_manager style, fix missing move
2014-12-17 13:20:48 +00:00
Maxime Coste
ebecd60eb8
Rework hashing, use a more extensible framework similar to n3876 proposal
...
std::hash specialization is a pain to work with, stop using that, and
just specialize a 'size_t hash_value(const T&)' free function.
2014-12-16 18:57:19 +00:00
Maxime Coste
72bdb8faa9
Always use plain ncurses.h
2014-12-14 23:42:00 +00:00
Maxime Coste
fc4d77964e
Remove special case when appending at eol
2014-12-13 13:10:40 +00:00
Maxime Coste
a0b35bf590
Add support for user mappings, bound to comma
...
:map have a 'user' mode that is accessible through the comma key.
the mapping will get executed in normal mode.
2014-12-12 13:57:02 +00:00
Maxime Coste
801bd5245d
Avoid very long timeouts in event manager
2014-12-12 13:55:32 +00:00
Maxime Coste
9c1ca303ff
Change a-| to ignore output, and add ! and a-! for insert/append cmd output
2014-12-11 23:21:11 +00:00
Maxime Coste
c68c9abcac
Display the register we yanked to
2014-12-11 19:36:41 +00:00
Maxime Coste
2c4ed3a78c
Do not avoid eol on escape
2014-12-11 19:36:20 +00:00
Maxime Coste
7a10029c4f
Use algorithms in id_map rather than raw loops
2014-12-11 13:55:04 +00:00
Maxime Coste
35e7a67c6a
Do not sort results of WordDB, simplify code
2014-12-11 13:14:57 +00:00
Maxime Coste
f32ab5793e
Remove unneeded includes
2014-12-11 13:10:41 +00:00
Maxime Coste
e0cc59914e
Fix OSX compilation
2014-12-10 20:54:47 +00:00
Maxime Coste
319cfcda34
Get rid of uses of unordered_set, vector is just simpler and faster...
2014-12-09 21:59:47 +00:00
Maxime Coste
0a57fa0766
Rename ncurses.{cc,hh} to ncurses_ui.{cc,hh}
2014-12-09 13:57:21 +00:00
Maxime Coste
2f2752cd1d
Force inline StringView::{begin,end}
2014-12-09 13:56:05 +00:00
Maxime Coste
87d312b6d4
More string cleanups
2014-12-08 13:59:29 +00:00
Maxime Coste
9f4af93780
cleanup in string.hh
2014-12-08 13:46:07 +00:00
Maxime Coste
1a17d9c73f
const String& to StringView
2014-12-07 21:01:42 +00:00
Maxime Coste
d57be83522
Disable history writing when running hooks
2014-12-05 14:01:07 +00:00
Maxime Coste
1c5975835e
Consolidate constext disablable feature in a 'Disableable' helper
2014-12-05 13:47:09 +00:00
Maxime Coste
423030c9bd
Refactor (again) event handling, use proper infinite timeout
2014-12-04 20:01:34 +00:00
Maxime Coste
176358f6b7
Fix logic error in shell manager
2014-12-04 13:58:02 +00:00
Maxime Coste
a51dd737ea
Limit event handler timeout to 2 seconds
2014-12-03 19:55:53 +00:00
Maxime Coste
d437ae0ecf
Microsecond is 10^(-6)s, not 10^(-9)s
2014-12-03 18:57:33 +00:00
Maxime Coste
995c7b4634
Fix timeval field types
2014-12-03 14:02:46 +00:00
Maxime Coste
24519e645e
Revert "Handle SIGCHLD signals when piping"
...
This reverts commit 8208e75294
.
2014-12-03 13:57:04 +00:00
Maxime Coste
0517a19e6d
Use a select based event handling and fix deadlock
2014-12-03 13:56:02 +00:00
Maxime Coste
def4221ac7
Pass a BufferRange to highlighters, fix subregions
...
Regions highlighter can now correctly be applied to only subrange
of the buffer, fixing some corner cases in recursive regions.
2014-12-02 19:56:17 +00:00
Maxime Coste
8208e75294
Handle SIGCHLD signals when piping
2014-12-02 18:59:39 +00:00
Maxime Coste
4fbaee61c5
Change default PrimarySelection face to be white on blue
2014-12-01 13:06:26 +00:00
Maxime Coste
a3b3001d8f
Rework client pending key handling, fix insert/normal timers
2014-11-29 20:14:52 +00:00
Maxime Coste
77e2e8a31e
Support selecting yank/paste register with "
2014-11-28 13:58:36 +00:00
Maxime Coste
75fe9a76db
Fix compilation
2014-11-28 13:47:42 +00:00
Maxime Coste
7c87abe856
Process ctrl-c when not in urgent event mode as well
2014-11-28 13:30:58 +00:00
Maxime Coste
da9f688f37
Fix indent/deindent when multiple selections are on same line
2014-11-28 13:22:54 +00:00
Maxime Coste
6902301674
Fix bug in :debug command
2014-11-28 13:18:08 +00:00
Maxime Coste
4c7f6985f1
Add an 'options' debug command
2014-11-26 13:27:26 +00:00
Maxime Coste
49931fbf05
Separate events between normal and urgent ones
...
Run urgent ones while executing %sh blocks.
Fixes #236
2014-11-25 13:52:06 +00:00
Maxime Coste
0272da65c0
Style tweak
2014-11-24 13:49:41 +00:00
Maxime Coste
35b89d5b87
Display selection count in insert mode line
2014-11-24 13:26:42 +00:00
Maxime Coste
dfed7ed211
const String& to StringView
2014-11-23 19:49:59 +00:00
Maxime Coste
88def85d77
Do not merge overlapping selections in InputMode::Replace
...
Fixes #237
2014-11-22 21:20:29 +00:00
Maxime Coste
f56b6ed75b
Do not record keys that were not user generated
2014-11-21 19:00:34 +00:00
Maxime Coste
e8c8833211
Do not reset edition level to 0 on buffer change
...
Keep it as is, commit undo in current buffer, and we will commit it in
the new buffer when edition level gets back to 0.
2014-11-21 18:56:39 +00:00
Maxime Coste
5497064f9c
Fix missing include in assert.cc
2014-11-20 19:32:58 +00:00
Maxime Coste
bfbee3c71e
Fix info box placement when too wide
2014-11-20 18:45:27 +00:00
Maxime Coste
b5ccc8bc73
Improve line wrapping behaviour
2014-11-20 18:45:10 +00:00
Maxime Coste
04ecb2cc5a
Wrap info boxes text in ncurses display even in Inline menu style
2014-11-20 13:56:37 +00:00
Maxime Coste
a444cd1d60
Improve wrap_lines behaviour, split on punctiation as well
2014-11-20 13:55:07 +00:00
Maxime Coste
314d662c5f
Change wrap_lines to return StringViews, move it to string.cc
2014-11-20 13:15:11 +00:00
Maxime Coste
eb57d0a1d9
Refresh stdscr at startup to avoid flickering
2014-11-18 00:01:29 +00:00
Maxime Coste
6663d50d95
Tweak option completion behaviour
2014-11-17 20:15:54 +00:00
Maxime Coste
0c3acb74c2
Remove unneeded string copies
2014-11-17 19:38:30 +00:00
Maxime Coste
7619fcb198
option completion are valid until a modification is made before it
2014-11-17 13:53:59 +00:00
Maxime Coste
1bd2260fa5
Import std::begin/std::end so that container utils work correctly with non std containers
2014-11-17 13:51:21 +00:00
Maxime Coste
b43f0fb853
Yet more StringView params, less const String&
2014-11-16 20:55:36 +00:00
Maxime Coste
ece03c3599
More const String& to StringView
2014-11-15 18:45:56 +00:00
Maxime Coste
27b1e8944f
const String& to StringView
2014-11-14 22:40:51 +00:00
Maxime Coste
7064679c2a
small fix
2014-11-13 22:17:10 +00:00
Maxime Coste
3a817e2f96
Cleanup includes
2014-11-12 21:27:07 +00:00
Maxime Coste
58c1721564
Use general flags utility for Face Attribute
2014-11-12 20:31:56 +00:00
Maxime Coste
3f733569ed
Fix case where a context ends up locked in no-hooks mode
2014-11-12 20:31:12 +00:00
Maxime Coste
fab9c92006
change filter mode to make backup of files to .kak-bak and edit in place
...
Add a -q option to filter mode to be quiet about errors while applying
keys.
2014-11-11 23:40:07 +00:00
Maxime Coste
f6e9018bf0
Reduce idle timeout to 50 milliseconds
2014-11-11 23:32:52 +00:00
Maxime Coste
7bb7c1b922
Hide info box when closing insert completion menu
2014-11-11 23:31:06 +00:00
Maxime Coste
e8b0a98a78
Remove %rec{...} strings, now "..." strings expand their content
2014-11-11 13:53:57 +00:00
Maxime Coste
414cfabb8c
fix clang compilation
2014-11-11 13:47:51 +00:00
Maxime Coste
b2407d9dfa
Add ui_options option for UserInterface configuration
...
ui_options is a std::unordered_map<String, String> that gets
forwarded to the user interface. Add support ncurses_status_on_top.
2014-11-10 23:29:16 +00:00
Maxime Coste
d803333e73
Add support for unordered_map options
2014-11-10 23:24:02 +00:00
Maxime Coste
4235ab5249
Display status line on top in ncurses
2014-11-10 13:46:08 +00:00
Maxime Coste
7d4c9c2ccf
Support hinting if an inline info should be above or below the anchor
...
Used by ctags function info, we always want it *above* the opening
parenthesis so that it does not hide multi line parameter lists.
2014-11-10 13:37:17 +00:00
Maxime Coste
40d649f836
refactor parse_keys
2014-11-09 13:02:01 +00:00
Maxime Coste
766df0490c
small code simplification
2014-11-09 11:42:06 +00:00
Maxime Coste
88aa707b9c
For {Menu,Info}Style::Prompt, choose the anchor directly in ncurses code
2014-11-08 19:08:23 +00:00
Maxime Coste
e1fc2677e3
Add a MenuDoc style for info box, that will place it next to the menu
2014-11-08 18:01:55 +00:00
Maxime Coste
484fffc288
Initial support for insert completion docstring
2014-11-07 13:54:43 +00:00
Maxime Coste
fc66c7f92f
small style fix
2014-11-07 13:51:07 +00:00
Maxime Coste
5ef4dd84b9
Small refactoring in remote.cc
2014-11-06 13:54:18 +00:00
Maxime Coste
80b50cd737
Simplify RemoteClient creation code
2014-11-05 13:57:12 +00:00
Maxime Coste
a3b29b1f11
Fix potential alignment bug
2014-11-05 13:50:06 +00:00
Maxime Coste
4c3056a05e
Fix bug in insert completer deregistering
...
The context options might change, as the context might have a different
window/buffer from the one at creation. So we need to store the correct
option manager rather than ask the context for it.
2014-11-04 23:51:41 +00:00
Maxime Coste
c8ea2e78f9
Reuse existing buffer when creating a fifo one
...
That way, client having this buffer already visible wont switch to
another one due to previous buffer getting deleted
2014-11-04 23:51:22 +00:00
Maxime Coste
71197c4641
Tweak flags implementation
2014-11-04 22:23:27 +00:00
Maxime Coste
4d89a297c5
Change Value to be non copyable
2014-11-04 22:23:27 +00:00
Maxime Coste
f5be7c7ba5
minor code cleanup
2014-11-04 13:40:35 +00:00
Maxime Coste
60c1bb1315
Use unescape rather than a regex in command manager parsing
2014-11-04 13:35:54 +00:00
Maxime Coste
97df59ddb7
Support single char StringView
...
remove single char escape function overload, add unescape function
2014-11-04 13:32:18 +00:00
Maxime Coste
b167c11671
Use StringViews for some helper functions in selectors.cc
2014-11-04 13:14:48 +00:00
Maxime Coste
4051534b83
Open fifo buffers in non block mode
2014-11-03 13:55:07 +00:00
Maxime Coste
abfc016321
Remove AutoRegister util template
2014-11-02 16:04:24 +00:00
Maxime Coste
b494b873b1
Fix buffer being considered modified after reloading
2014-11-01 19:35:27 +00:00
Maxime Coste
c04dfc7bb7
move more parameters from const String& to StringView
2014-11-01 19:31:13 +00:00
Maxime Coste
9a2822e329
Change :info -anchor option, take directly a buffer coordinate
...
Fix ctags funcinfo feature using that
2014-10-31 21:49:36 +00:00
Maxime Coste
e38ba6ce3d
Add scope class and encapsulate Options, Keymaps, Aliases and Hooks in it
2014-10-30 14:04:57 +00:00
Maxime Coste
8649371ff2
Add kak binary location to PATH env var automatically
...
That way the kak binary can be guaranteed to be available even
if not in user PATH.
2014-10-30 14:02:13 +00:00
Maxime Coste
185b980718
Add scoped aliases
...
aliases are now stored in window, buffer, or globally.
2014-10-30 14:02:13 +00:00
Maxime Coste
502de87697
Actually release interned string data when refcount drops to 0
2014-10-29 13:54:35 +00:00
Maxime Coste
d29419bcd6
Fix invalid memory access when applying modifications on an empty buffer
...
That can happen when undoing/redoing accross a buffer reload
boundary.
2014-10-28 21:55:08 +00:00
Maxime Coste
62f56378c9
Add some asserts in StringRegistry methods
2014-10-28 21:54:25 +00:00
Maxime Coste
2944dbc332
Style fixes
2014-10-28 20:01:55 +00:00
Maxime Coste
d3091cb553
Add noexcept spec to move constructor and move assign
2014-10-28 20:01:27 +00:00
Maxime Coste
00aede6e57
mark InternedString move constructor noexcept
2014-10-28 19:44:00 +00:00
Maxime Coste
fa886ffaac
Refactor word_db, use an unordered map
2014-10-28 19:23:02 +00:00
Maxime Coste
c2c980c484
Fix unneeded WordDB copy in complete_word
2014-10-28 19:18:33 +00:00
Maxime Coste
efa276b13b
Tweak Value constructor, no need for the const ref one
2014-10-28 19:17:54 +00:00
Maxime Coste
5078b9077d
Fix interned string hashing, we need to hash content
2014-10-28 19:16:35 +00:00
Maxime Coste
54fd0aab22
Fix filter mode
2014-10-27 17:54:20 +00:00
Maxime Coste
372ba2936f
Small formatting fix
2014-10-27 13:22:42 +00:00
Maxime Coste
992c74a06d
small formatting tweak
2014-10-26 20:21:01 +00:00
Maxime Coste
2213f98176
Add virtual destructor to Highlighter
2014-10-25 10:40:26 +01:00
Maxime Coste
54f4b8fc2d
Do not lose history when reloading a buffer
...
Fixes #157
2014-10-23 21:04:58 +01:00
Maxime Coste
3e797a3d15
centralize bit operation support for enum used as flags
2014-10-23 19:02:39 +01:00
Maxime Coste
5eb8989192
Fix slow InternedString copy constructor
2014-10-23 13:53:04 +01:00
Maxime Coste
67a5493fa2
minor code tweaks
2014-10-23 13:37:47 +01:00
Maxime Coste
38df876586
Reread file timestamp at the moment the user choose to keep
...
The previous behaviour ended up asking twice for reloading if the
buffer was modified again after Kakoune had detected the first
change.
2014-10-22 19:24:26 +01:00
Maxime Coste
7f23d4b756
Close fd before notifiying buffer of modification when writing to file
2014-10-22 19:23:54 +01:00
Maxime Coste
b2e90fe21e
Refactor highlighters, use an interface with virtual methods
2014-10-22 13:54:03 +01:00
Maxime Coste
fc4142178f
Port more code to StringView instead of const String&
2014-10-20 19:18:38 +01:00
Maxime Coste
69113e2711
Add a split function that does not take an escape and returns StringViews
...
When an escape character is not present, split can just return sub
strings of the parameter, so we can avoid duplicating the original
string data.
2014-10-19 16:27:36 +01:00
Maxime Coste
2e0b4d02b7
Small tweak
2014-10-16 19:43:09 +01:00
Maxime Coste
9c2f9d5547
Make it more explicit that Key modifiers is a bit field
2014-10-15 19:13:51 +01:00
Maxime Coste
1128d941ff
Do not write pid and session name in debug buffer on startup
2014-10-14 13:42:47 +01:00
Maxime Coste
e362eb4f3b
Add a disabled wrapper for using std regex instead of boost
2014-10-14 13:40:13 +01:00
Maxime Coste
eb0d03f437
Use Pass as default policy for invalid utf8 avoid asserting on that
2014-10-13 21:07:23 +01:00
Maxime Coste
894dd2e055
Add missing includes
2014-10-13 19:28:02 +01:00
Maxime Coste
2adaa7bdfa
Do not assert on SIGTERM and backup modified buffers on signal induced termination
2014-10-13 13:38:28 +01:00
Maxime Coste
fa85f0fc32
Refactor regex uses, do not reference boost except in regex.hh
2014-10-13 13:14:23 +01:00
Maxime Coste
b6f2b872b0
Preserve selection orientation when replacing
...
Fixes #31
2014-10-12 18:58:10 +01:00
Maxime Coste
cbf4d3db3f
Add a test make target
2014-10-11 19:50:30 +01:00
Maxime Coste
6a48b5eabc
Merge branch 'master' of github.com:mawww/kakoune
2014-10-11 15:54:06 +01:00
Maxime Coste
729e55573f
Support changing buffer when an edition is in progress
2014-10-10 14:00:24 +01:00
Maxime Coste
c94b343c65
Start regex search from selection min/max depending on search direction
2014-10-09 18:55:58 +01:00
Roberto Zanotto
daeb8a1c8d
empty DESTDIR
2014-10-08 21:23:20 +02:00
Maxime Coste
8a7e16cec3
Switch some const String& parameters to StringView
2014-10-07 21:11:55 +01:00
Maxime Coste
a627eab57c
Small refactor
2014-10-07 19:46:12 +01:00
Maxime Coste
b097bbbf52
WordDB: Use interned strings pointing directly into the buffer line data
2014-10-07 09:16:19 +01:00
Maxime Coste
008ba2cbab
Use ',' instead of '|' as tuple option fields separators
2014-10-06 19:32:25 +01:00
Maxime Coste
17d591b61c
scrolloff is now a line,column pair
...
Fixes #152
2014-10-06 19:21:32 +01:00
Maxime Coste
844c8f1ec4
InternedStrings know their slots
2014-10-05 10:20:50 +01:00
Maxime Coste
d4a84125ef
Use InternedStrings for buffer contents
2014-10-03 13:39:13 +01:00
Maxime Coste
fc53a80395
Small refactor
2014-10-01 23:41:06 +01:00
Maxime Coste
3ea690a92e
Fix finding next match when the cursor is in the middle of the only match
2014-10-01 13:54:33 +01:00
Maxime Coste
d55d041c6a
Add support for interned strings
...
Use interned strings for Modification contents and word database.
Interned strings are guaranteed not to move in memory and are
reference counted.
2014-10-01 00:20:12 +01:00
Maxime Coste
d9e462851c
Pass -rdynamic only to the linker
2014-09-28 23:59:04 +01:00
Maxime Coste
507cdd7272
Start with the whole buffer selected in filter mode
2014-09-28 23:58:34 +01:00
Maxime Coste
092ac8e9ab
Remove unused function
2014-09-26 00:41:50 +01:00
Maxime Coste
9beba90060
Finding next matches start from seleciton min/max instead of cursor
...
uses min for backward serching, max for forward searching.
2014-09-26 00:27:23 +01:00
Maxime Coste
a404886fe2
line joining will only join selected lines if selection span multiples ones
...
Fixes #133
2014-09-25 19:26:27 +01:00
Maxime Coste
ecf8047bcc
Fix reverse search when extending
2014-09-25 13:29:53 +01:00
Maxime Coste
4c4d3cdd38
Add support for mapping keys in goto/view commands
2014-09-23 13:45:18 +01:00
Maxime Coste
9625ea64ff
Add inner versions of to object begin/end selection
2014-09-23 13:37:56 +01:00
Maxime Coste
e440adbcf4
add a 'buffers' debug command to get info on alive buffers
2014-09-22 19:19:34 +01:00
Maxime Coste
0ac65e1610
Use std:move for selection parameters
2014-09-22 13:55:39 +01:00
Maxime Coste
6bcc038329
tweak helper functions in buffer_utils.hh
2014-09-22 13:45:07 +01:00
Maxime Coste
217ba625ad
Use raw terminal, and handle signals manually
...
C-c now sends SIGINT to the process group of Kakoune server
when used in normal mode.
Fixes #30
2014-09-20 19:35:37 +01:00
Maxime Coste
2aaae7473c
preserve selection direction in split lines
2014-09-19 13:45:24 +01:00
Maxime Coste
f738316689
small refactor in highlighters
2014-09-19 13:45:11 +01:00
Maxime Coste
af1134bd75
Fix confusion between -n and -d switches in main
2014-09-18 18:43:42 +01:00
Maxime Coste
ff25948a6f
Fix compilation on recent cygwin
2014-09-18 18:43:12 +01:00
Maxime Coste
90df4320b7
Add a small validation assert to catch a rare bug
2014-09-18 10:47:59 +01:00
Maxime Coste
dd2bdea8dd
Keep selection direction on split/select/search
2014-09-18 00:34:23 +01:00
Maxime Coste
be85eb5d0b
Makefile: Include system header in generated dependencies
2014-09-15 18:59:49 +01:00
Maxime Coste
827a77539a
Add some color to mode specific mode line info
2014-09-10 19:06:53 +01:00
Maxime Coste
c18e2ac90e
Target end of line on line selectors
2014-09-09 23:41:32 +01:00
Maxime Coste
5092494427
Add support for target column preservation
...
Fixes #64
2014-09-09 19:42:57 +01:00
Maxime Coste
6dc223ed6a
Fix spaces_to_tabs when tabs follow spaces
2014-08-28 23:19:18 +01:00
Maxime Coste
114d33c7f8
Limit the iteration count when reading from a fifo
2014-08-26 22:11:23 +01:00
Maxime Coste
c90bdb9862
Fix handling of -- in parameter parser
2014-08-26 22:10:54 +01:00
Maxime Coste
8fc230e40d
Add a 'disabled_hooks' regex option
...
Hooks whose group matches this regex wont get executed.
2014-08-21 14:37:59 +01:00
Maxime Coste
50e1e5fadd
Add support for 'c-o' in prompt and insert to hide the completion menu
...
Fixes #229
2014-08-19 23:32:19 +01:00
Maxime Coste
d78a586126
Do not allow using color names as face names
2014-08-19 23:16:21 +01:00
Maxime Coste
d78e331304
Allow faces to reference faces
...
Fixes #102
2014-08-19 23:10:56 +01:00
Maxime Coste
bea53d09b2
Remove option checkers, handle that through the type system
...
Use a specific type for InsertCompleterDesc with checks in
the option_{from,to}_string functions
2014-08-19 18:56:11 +01:00
Maxime Coste
a36aed94f1
Add support for operator== to Optional
2014-08-19 18:55:36 +01:00
Maxime Coste
2e2812b10f
Do not escape completions in completer functions let the client decide
...
Fixes #231
2014-08-18 23:31:02 +01:00
Maxime Coste
e6b9a1d982
Get forced file descriptors after calling poll
...
That way, we do not wait for the next poll to finish before servicing
forced fd triggered by a signal that interupted the poll call.
2014-08-17 15:58:42 +01:00
Maxime Coste
6ba3017a8e
Always inline a few more methods
2014-08-17 15:36:12 +01:00
Maxime Coste
5c3f01fea2
Add exception reporting in filter mode
2014-08-17 15:19:04 +01:00
Maxime Coste
8d4531d419
Add support for reading from stdin/writing to stdout in filter mode
...
Note that kakoune still needs to read the whole buffer first, only
once stdin is closed can it execute the keys.
2014-08-15 13:21:54 +01:00
Maxime Coste
eff32aa1a1
Refactor, remove kakoune function and move it inside main.
2014-08-14 23:57:13 +01:00
Maxime Coste
ceb10665d1
Add support for running kakoune as a filter, using -f 'keys'
...
It will cycle on every given files, apply the keys and write to
<filename>.kak-out. Only normal/insert mode is available, kakrc
are not read.
2014-08-14 23:51:24 +01:00
Maxime Coste
0588780866
Refactor main loops, use separate functions for each running mode
...
Server, Client, and Pipe are handle through separate functions,
with the kakoune function handling parameter parsing.
2014-08-14 20:37:36 +01:00
Maxime Coste
aaa6d3ab39
memoryview: add support for reverse iteration
2014-08-14 20:35:03 +01:00
Maxime Coste
fbbe741c07
Add support for <c-w> <c-b> and <c-e> for word moves in the line editor
...
This might go away later if we find a better way of handling line
edition, but seems like a good compromise for now.
Fixes #168
2014-08-14 00:31:39 +01:00
Maxime Coste
518b995720
NCurses: properly handle ctrl+alt
2014-08-14 00:30:32 +01:00
Maxime Coste
2204b7cf06
Defer deletion of buffers to after the event loop
...
We can have SelectionList in flights on the buffer, so mark
it for deletion by moving it in a buffer trash, and effectively
delete it later, at a point where there should not be any further
access to it.
2014-08-12 19:24:09 +01:00
Maxime Coste
e2b3dd0ca4
Tweak client redraw logic, avoid highlight if only status line changed
2014-08-12 19:19:46 +01:00
Maxime Coste
d356ae2419
Make safe_ptr able to track callstacks
...
The code stays disabled, as the performance penalty is quite
high, but can be enabled to help debugging safe pointers.
2014-08-12 19:18:10 +01:00
Maxime Coste
1b54b65bb5
Add an operator[](CharCount) to String and StringView
2014-08-11 19:40:35 +01:00
Maxime Coste
43f44bbab3
Fix buffer modification check
...
It used to grab the next key, because the normal mode reactivation
when executing the on_next_key would trigger a timestamp check again.
2014-08-07 21:51:36 +01:00
Maxime Coste
c4f0c4dee6
Change escaping method for command completion
2014-08-03 10:03:14 +01:00
Maxime Coste
8ee2aa9ba7
Use more StringView in string helper functions
2014-08-03 10:02:17 +01:00
Maxime Coste
de402c4703
Fix buffer name completion when basename only
2014-08-03 10:00:34 +01:00
Maxime Coste
aac02410b1
Buffer completion match directory names as well for subsequence match
2014-07-31 22:43:36 +01:00
Maxime Coste
beb6065a71
Add a -existing switch to edit command
...
with this switch, fail if the file is not found rather than creating
a new one. Use that in grep and make jump commands.
2014-07-31 22:10:01 +01:00
Maxime Coste
5fc063c520
Insert word completion: Use subsequence matching if prefix failed
2014-07-30 19:58:34 +01:00
Maxime Coste
4c31449a65
Add access to specific env vars in %val{...} evaluation
2014-07-30 19:17:04 +01:00
Maxime Coste
31f9d87798
Only change search register when prompt are validated
...
Fixes #160
2014-07-30 19:15:16 +01:00
Maxime Coste
9fe4724743
Stop macro recording on esc in normal mode
...
Fixes #221
2014-07-30 01:09:04 +01:00
Maxime Coste
06fc329739
Rewrite real_path, try to find an existing directory in the given path
...
Never throw, return the given filename in the worst case.
2014-07-30 00:03:01 +01:00
Maxime Coste
8ed16bb2e9
In non interactive interactive mode, disable user key mappings
...
exec and eval now accepts a -with-maps to use them. But by default
they are disabled, so that all the indent scripts work even if you
remap basic keys.
Fixes #217
2014-07-27 20:18:09 +01:00
Maxime Coste
7c10660f9a
Fix resize handling in ncurses UI
2014-07-26 22:38:10 +01:00
Maxime Coste
8d6e8bc06f
Display a [no-hooks] tag in the mode line when hooks are disabled
2014-07-25 23:47:47 +01:00
Maxime Coste
6813440212
Fix Selection::insert when replacing with empty string at the end of the buffer
2014-07-25 23:47:11 +01:00
Maxime Coste
731277a425
Disable hooks on a per context basis, and propagate that to Insert mode
...
using \ before entering insert mode will disable hooks during the whole
insert session rather than only the entering phase. That gives a nice
way of pasting text into kakoune.
2014-07-24 19:18:39 +01:00
Maxime Coste
826bf22eef
fix align with multiple columns
2014-07-22 00:41:10 +01:00
Maxime Coste
bc48d9260d
Fix Menu use of j/k keys when editing filter
2014-07-22 18:39:04 +01:00
Maxime Coste
3c021672d2
Add completion support for rmhooks
2014-07-21 21:14:32 +01:00
Maxime Coste
50abc18c8e
Add some more force inlines to some buffer methods
2014-07-19 00:18:16 +01:00
Maxime Coste
f4e3df817f
Clear status line on normal mode command
2014-07-17 19:37:30 +01:00
Maxime Coste
880a8becb6
Fix ncurses flickering of the menu and info box
2014-07-16 23:11:18 +01:00
Maxime Coste
032b621150
Use strongly typed enum for Face Attribute, add Dim
2014-07-15 20:11:47 +01:00
Maxime Coste
e6699c66ed
Fix comment parsing error in CommandManager
2014-07-15 13:15:21 +01:00
Maxime Coste
ac5cbba0ae
Remove region highlighter, rename multi_regions to regions, cleanup
2014-07-14 21:42:19 +01:00
Maxime Coste
ec37adc523
Fix bug in nested highlighting
2014-07-14 21:41:29 +01:00
Maxime Coste
d5d76721b0
Avoid infinite loop in MultiRegionHighlighter when regexes generate empty matches
2014-07-14 20:46:46 +01:00
Alex Leferry 2
12cdfb316a
underline (MatchingChar|Search) faces
2014-07-14 20:23:56 +01:00
Maxime Coste
b96f653b6c
Fix numbering with '#' register
2014-07-14 19:00:54 +01:00
Maxime Coste
cbfceba149
Do not resolve faces in highlighter factories, defer to actual highlighting
2014-07-13 16:52:51 +01:00
Maxime Coste
d78ece490f
Rename RegexColorizer to RegexHighlighter
2014-07-12 13:57:16 +01:00
Maxime Coste
72ccb9bce6
Refactor RegexColorizers face handling
2014-07-12 11:19:35 +01:00
Maxime Coste
d0d4108085
Rename :colalias to :face and update documentation
2014-07-12 10:55:50 +01:00
Maxime Coste
608e188960
Support attributes in face specifications
2014-07-11 00:44:59 +01:00
Maxime Coste
a32b49acd1
Rename ColorPair to Face and ColorRegistry to FaceRegistry
...
Face also stores the attributes
2014-07-11 00:27:43 +01:00
Maxime Coste
42611aef1e
Fix select_number
2014-07-10 19:22:14 +01:00
Maxime Coste
b6979e2d2c
Add docstring for normal mode commands and display them if autoinfo >= 2
2014-07-10 19:22:14 +01:00
Maxime Coste
4c3bd68876
Change autoinfo option to be an integer, allowing different levels
2014-07-10 19:22:14 +01:00
Maxime Coste
81d3eadd09
:edit! without argument reload current buffer
2014-07-10 19:22:14 +01:00