Commit Graph

2816 Commits

Author SHA1 Message Date
Maxime Coste
5aba5d38f2 Add missing include 2015-05-29 13:46:49 +01:00
Maxime Coste
be9da616df Return a String in Backtrace::desc 2015-05-29 13:35:54 +01:00
Maxime Coste
3c86484c4e Extract xmessage/MessageBox support in a notify_fatal_error function 2015-05-29 13:35:09 +01:00
Maxime Coste
336df38237 Go back to ignoring SIGPIPE
We do not want to exit when a shell command closes stdin while we
are piping data to it.
2015-05-28 13:57:22 +01:00
Maxime Coste
98637c5219 Do not throw exceptions when handling a fatal signal 2015-05-28 13:44:59 +01:00
Maxime Coste
d9aee67c8b Tweak Makefile, enable -rdynamic so that backtraces symbols are found 2015-05-27 18:45:52 +01:00
Maxime Coste
faf55c6540 Only try to run xmessage on Linux 2015-05-27 18:45:48 +01:00
Maxime Coste
2e43a4d696 Use common signal handler for SIGPIPE 2015-05-27 13:57:41 +01:00
Maxime Coste
e18c57cfd3 Include backtrace in debug info in on_assert_failed 2015-05-27 13:56:27 +01:00
Maxime Coste
7245d2abe9 Extract Backtrace out of SafePtr as a general utility 2015-05-27 13:48:45 +01:00
Maxime Coste
1e04343178 Workaround incomplete c++11 stdlib in gcc 4.8 2015-05-26 19:05:11 +01:00
Maxime Coste
993e842fdf Retreat ! go back to C++11 only code
This reverts commit b42de85031.
2015-05-26 18:42:09 +01:00
Maxime Coste
499bde10bd Small style tweaks 2015-05-26 18:40:39 +01:00
Maxime Coste
3bdc30e381 Try matching functions one by one when completing
Instead of running them all then deciding which to use.
2015-05-26 18:38:48 +01:00
Maxime Coste
3ca69c3852 Try gnu++1y 2015-05-25 20:32:39 +01:00
Maxime Coste
d83836d026 Use gnu++14 only for Cygwin, as not recognized on OSX 2015-05-25 19:35:32 +01:00
Maxime Coste
9c57f5409a Use gnu++14, as some posix functions disappear in c++14 mode 2015-05-25 14:01:59 +01:00
Maxime Coste
7b7427e1a6 Add missing 'override' specifiers 2015-05-25 13:54:18 +01:00
Maxime Coste
b42de85031 Migrate code to c++14 2015-05-25 13:51:17 +01:00
Maxime Coste
41319d2708 Small refactor in unit tests 2015-05-24 22:34:05 +01:00
Maxime Coste
dd25dcc361 Move unit test functions in next to the code they are testing 2015-05-22 13:58:56 +01:00
Maxime Coste
c38a7f3ca4 Merge branch 'diff' 2015-05-21 22:58:50 +01:00
Maxime Coste
325cc2d894 Ignore SIGPIPE 2015-05-20 22:53:14 +01:00
Maxime Coste
43f7657151 Remove clamping in compute_modified_range
It can result in a non ordered range list.
2015-05-20 13:34:16 +01:00
Maxime Coste
9f46d75b27 Add headers guard to diff.hh along with a comment about the algorithm 2015-05-19 19:46:24 +01:00
Maxime Coste
38bbecef62 Fix bug in diff implementations (missing snake after d=1 change) and refactor 2015-05-18 22:59:59 +01:00
Maxime Coste
bb7800b1a6 Preserve window position in regex_prompt
Fixes #271
2015-05-18 13:56:58 +01:00
Maxime Coste
0a6ad4dcf4 Only initialize element 1 in mirrored arrays. 2015-05-17 20:13:11 +01:00
Maxime Coste
cf7b64ba67 Preserve selections across reloads 2015-05-16 11:42:58 +01:00
Maxime Coste
73ddf18dc3 Another bug fix in diff implementation 2015-05-15 13:55:39 +01:00
Maxime Coste
802d6e106c Keep hash stored in StringData 2015-05-14 19:13:52 +01:00
Maxime Coste
e9af3a4217 always_inline a few methods 2015-05-14 19:05:41 +01:00
Maxime Coste
8ba6804480 Do not use diff when reloading a no undo buffer 2015-05-14 14:05:02 +01:00
Maxime Coste
cc97d4ba41 Fix bugs in diff implementation 2015-05-14 13:57:03 +01:00
Maxime Coste
f224d11ccd Small cleanup in selections.cc 2015-05-13 23:22:48 +01:00
Maxime Coste
11528e45e9 Use friend functions rather than methods for StronglyTypedNumber binary ops 2015-05-13 23:22:48 +01:00
Maxime Coste
15b26fd06c Use diff when reloading buffer 2015-05-13 23:22:42 +01:00
Maxime Coste
7a8c2d7f56 Fix diff implementation and change the Diff struct format 2015-05-13 23:22:29 +01:00
Maxime Coste
49def73e4e Add initial diff implementation based Eugene W. Myers' algorithm 2015-05-12 23:41:35 +01:00
Maxime Coste
30bec11010 Fix bug in ncurses mouse handling 2015-05-11 19:11:02 +01:00
Maxime Coste
e21d9feb05 Style tweak 2015-05-09 19:20:11 +01:00
Maxime Coste
c94b30903d Fix dangling info window pointer in ncurses ui 2015-05-07 00:34:30 +01:00
Maxime Coste
559bcdde50 Formatting fix 2015-05-06 23:05:44 +01:00
Maxime Coste
9f1b129053 Fix bug in fifo creation where BufOpenFifo hook was using a dead string 2015-05-05 20:23:15 +01:00
Maxime Coste
0ee95d02c4 line highlighter highlights up to window's end 2015-05-05 20:21:17 +01:00
Maxime Coste
1a1db1cb3a {line,column}_option highlighters use an expanded string instead of an option name
That allows access to non option values, such as cursor_column or cursor_line with
:addhl line '%val{cursor_line}' default,rgb:404040

Fixes #38
2015-05-04 17:12:51 +01:00
Maxime Coste
cfdf03ab31 Make expand function (that expand %...{} tokens) public 2015-05-04 17:08:57 +01:00
Maxime Coste
7f0588c02c Dont use a regex to match face spec for regex highlighter 2015-05-03 18:22:49 +01:00
Maxime Coste
78eb437b90 Formatting fix 2015-05-02 18:48:20 +01:00
Maxime Coste
d7159a9af0 Add str_to_int_ifp that returns an Optional<int> instead of throwing 2015-05-01 18:47:22 +01:00
Maxime Coste
d3607bc773 Rename eval(_token)? to expand(_token)? and use a const Context 2015-04-30 19:18:20 +01:00
Maxime Coste
4e89cbfe83 Add a column_option highlighter that highlight a column given in an option 2015-04-30 19:18:20 +01:00
Maxime Coste
202d4766c2 Do not display info box when there is not enough room on screen for it
Fixes #159
2015-04-30 13:45:05 +01:00
Maxime Coste
6974cfbf64 Use char32_t for Codepoint 2015-04-29 13:51:15 +01:00
Maxime Coste
d169558e09 When file to open is a fifo, do not read from it (use -fifo for that)
Fixes #267
2015-04-29 13:46:04 +01:00
Maxime Coste
1337763cb5 Fix formatting 2015-04-29 13:45:53 +01:00
Maxime Coste
e4880ad91a Use unicode elipsis to mark trimmed mode line 2015-04-28 21:03:37 +01:00
Maxime Coste
5bff742e0a Replace some String temporaries with StringViews 2015-04-27 16:46:57 +01:00
Maxime Coste
720c54c759 Move option_not_found exception to the cpp file 2015-04-26 20:40:32 +01:00
Maxime Coste
bbefde9379 Move Colors enum class as NamedColor enum inside Color struct 2015-04-25 10:47:39 +01:00
Maxime Coste
dc46eda279 Set default MatchingChar face to bold instead of underline 2015-04-24 20:34:38 +01:00
Maxime Coste
075c5013a1 Move Register to register_manager.hh 2015-04-23 21:51:48 +01:00
Maxime Coste
4e1ed13f25 Use a struct for RangeAndMatches 2015-04-23 21:44:20 +01:00
Maxime Coste
045272ab8a Use a struct for BufferRange rather than std::pair 2015-04-23 21:38:45 +01:00
Maxime Coste
840e58e0b1 NCurses: When mode line is too long, trim it rather hiding it 2015-04-23 21:11:50 +01:00
Maxime Coste
e0f7a6f0be Remove simple_factory for highlighters 2015-04-23 20:27:52 +01:00
Maxime Coste
d6b69cb6f7 Fix :open bug that could set a deleted buffer as the last used one 2015-04-23 20:15:17 +01:00
Maxime Coste
80fb8aa60d Use puts instead of printf in ncurses_ui 2015-04-22 22:03:01 +01:00
Maxime Coste
f6c7948c12 Add format_to allowing formating to an existing buffer 2015-04-22 13:19:46 +01:00
Maxime Coste
8ff63198bc Comment out update_erase function (keeped for reference)
Fixes #254
2015-04-21 13:51:01 +01:00
Maxime Coste
7824a76e1a Disable history in :exec and :eval 2015-04-21 13:45:10 +01:00
Maxime Coste
4bb1e0a878 Support -buffer * to iterate over all buffers in :eval or :exec 2015-04-21 13:40:14 +01:00
Maxime Coste
1d40827da3 Small style tweak 2015-04-21 13:33:35 +01:00
Maxime Coste
6e5e831ce6 Merge remote-tracking branch 'ekie/next_buffer' 2015-04-21 13:28:09 +01:00
Maxime Coste
d2e8bd2431 Fix select_number crashing on empty buffers 2015-04-20 13:55:42 +01:00
Maxime Coste
ddd70fd09a Make empty context construction more explicit 2015-04-19 18:47:52 +01:00
Maxime Coste
f714766854 Fix search highlighter wrong code 2015-04-19 15:19:39 +01:00
Maxime Coste
1dfa2d7fe4 Avoid unneeded update of selections when we are going to overwrite them 2015-04-19 15:12:16 +01:00
Maxime Coste
9f65a4e6dd Remove Context::set_selections, use Context::selections() = ... 2015-04-19 15:00:37 +01:00
Maxime Coste
b570c68c75 Run BufOpenFifo hook when opening a fifo in a (new or already existing) buffer 2015-04-19 14:48:39 +01:00
Maxime Coste
95a14c5049 UndoGroupOptimizer disappeared long time ago 2015-04-18 14:17:17 +01:00
Maxime Coste
d2b6d696a2 Small layout change 2015-04-17 16:47:31 +01:00
Maxime Coste
3982131753 Fix StronglyTypedNumbers::abs 2015-04-17 01:01:58 +01:00
Maxime Coste
b584fd3bfc Fix UnorderedSet allocator 2015-04-16 23:46:26 +01:00
Maxime Coste
2902fce437 Use an UnorderedSet for string registry 2015-04-16 12:38:59 +01:00
Maxime Coste
491ffc4ffd Improve ui_options docstring 2015-04-16 11:35:52 +01:00
Maxime Coste
ea67724ff5 Optional: put the bool m_valid after the content to improve packing 2015-04-15 11:43:39 +01:00
Eike Plack
2cf45ddb21 Refactor nextbuffer_cmd 2015-04-15 02:43:16 +02:00
Eike Plack
0f9b210e3f Fix set_last_used_buffer 2015-04-15 02:36:47 +02:00
Maxime Coste
bf02838816 Remove is_blank, which is identical to is_horizontal_blank 2015-04-15 00:34:00 +01:00
Maxime Coste
eb9c95298e Add support for string <-> selection list serialization 2015-04-13 15:21:26 +01:00
Maxime Coste
731c27c094 Add a 'abs' friend function to StronglyTypedNumber 2015-04-13 15:20:47 +01:00
Maxime Coste
f93081471a Refactor nextbuffer command to be more idiomatic 2015-04-13 11:34:21 +01:00
Maxime Coste
43c03ea412 Merge remote-tracking branch 'jjthrash/next-prev-buffer' 2015-04-13 11:26:31 +01:00
Maxime Coste
be5ed0e036 Small alignement change 2015-04-12 23:48:11 +01:00
Maxime Coste
f644a51f24 Use char for KeyMapMode enum 2015-04-11 17:22:37 +01:00
Maxime Coste
cfd071b2ad small code formatting fix 2015-04-09 16:28:13 +01:00
Jimmy Thrasher
ba59033935 Add nextbuffer command
Wraps around at the end. If only 1 buffer loaded, does nothing.
2015-04-09 10:14:32 -04:00
Maxime Coste
da09da29c4 Regex comparison operator are const 2015-04-08 23:16:27 +01:00
Maxime Coste
b5ab318a2d Always optimize StringView::strlen (recursive due to constexpr) 2015-04-07 23:21:14 +01:00
Maxime Coste
87b385b956 Use default values for ncurses options when not specified 2015-04-06 20:05:49 +01:00
Maxime Coste
b7144fff6c Make ncurses wheel scroll button configurable 2015-04-06 18:43:27 +01:00
Maxime Coste
dde16b00a9 Add onkey command for executing commands after reading a key
This completes the various user interaction primitives, on_next_key
was the last not to be available through a command.
2015-04-04 13:10:39 +01:00
Maxime Coste
04a922fe1a Avoid zstr in write_debug when no *debug* buffer can be created 2015-04-03 13:14:59 +01:00
Maxime Coste
7176685690 Avoid zstr call in ncurses addutf8str 2015-04-03 13:10:46 +01:00
Maxime Coste
762f60f9fd Rewrite rgb color parsing 2015-04-02 21:27:58 +01:00
Maxime Coste
64e0b6e3f8 Replace a snprintf with format in backup file name generation 2015-04-02 13:58:06 +01:00
Maxime Coste
9edeb08e3a Avoid zero terminated string based console printing 2015-04-01 13:44:04 +01:00
Maxime Coste
4c49583fed small code tweak in format 2015-03-31 13:55:57 +01:00
Maxime Coste
e875828aa9 Use format for {Win,Buf}SetOption hooks description 2015-03-31 13:55:40 +01:00
Maxime Coste
758bfe7284 number to string conversion avoids memory allocations 2015-03-31 13:53:40 +01:00
Maxime Coste
519254dfdc More useage of the format function 2015-03-30 23:56:33 +01:00
Maxime Coste
335c73a09b Use custom implementation rather the sscanf in str_to_int 2015-03-30 23:37:55 +01:00
Maxime Coste
6e1a388544 Replace various adhoc operator+ based formatting with format func 2015-03-30 23:06:02 +01:00
Maxime Coste
13a5af70ae Add a format function for printf like formatting 2015-03-30 23:05:24 +01:00
Maxime Coste
8761fc34f4 Always go through StringView to compare strings
That avoids creating temporary String needlessly
2015-03-30 19:59:08 +01:00
Maxime Coste
8439059758 Fix wrong implicit conversions from int/Codepoint to StringView 2015-03-30 13:33:46 +01:00
Maxime Coste
adaf6ecc40 Move skip_while helpers to selectors.hh 2015-03-29 20:03:09 +01:00
Maxime Coste
56b5300b9d Handle mouse events in key_to_str 2015-03-28 18:18:52 +00:00
Maxime Coste
d1b81c8f8a minor cleanup 2015-03-27 13:47:02 +00:00
Maxime Coste
195b813b73 Add support for Home/End keys in normal and insert mode
Fixes #260
2015-03-27 13:33:14 +00:00
Maxime Coste
0fbbd64681 small formatting tweak 2015-03-27 13:20:37 +00:00
Maxime Coste
727580a238 Make utf8_iterator a proper stl useable iterator 2015-03-27 13:19:30 +00:00
Maxime Coste
c2150dd163 Rework show_matching highlighter implementation 2015-03-27 13:18:06 +00:00
Maxime Coste
94bd32572d Move some only used once inline functions directly in their caller
No need to have that in a header, and not really selectors anyway
2015-03-26 13:34:21 +00:00
Maxime Coste
757366472b Add <alt-:> for ensuring selections are forward (cursor >= anchor)
Not very useful interactively, but that feature can make macros much
more robust.
2015-03-26 13:34:21 +00:00
Maxime Coste
e0757e7ba9 Flip the cat assistant 2015-03-25 13:53:13 +00:00
Maxime Coste
16037744b7 Add exception type name when failing with an uncaught exception 2015-03-25 13:42:36 +00:00
Maxime Coste
bc67a6547d Remove unneeded c_str() call 2015-03-25 13:42:36 +00:00
Maxime Coste
48007d5de2 Only do tty validation when using a NCursesUI 2015-03-24 19:38:03 +00:00
Maxime Coste
7eaa6976b9 Use a dummy UI when running tests, so that we do not need a tty 2015-03-24 13:14:02 +00:00
Maxime Coste
4188335b51 Fix segfault in highlighting 2015-03-23 19:21:35 +00:00
Maxime Coste
323b0359c7 Add support for mouse wheel 2015-03-22 12:17:01 +00:00
Maxime Coste
5eaf472fc0 Experimental support for mouse 2015-03-22 11:41:20 +00:00
Maxime Coste
def33de9bc Check modifiers before inserting codepoints in the line editor 2015-03-22 11:41:19 +00:00
Maxime Coste
7a7f86a205 Impreove Window::buffer_coord behaviour with invalid coords 2015-03-22 11:41:19 +00:00
Maxime Coste
dbbbc3aa80 constexprify Face 2015-03-21 16:32:22 +00:00
Maxime Coste
74ecf4976e Fix Color constructor not constexpr 2015-03-21 16:32:07 +00:00
Maxime Coste
bbfcfe4242 constexprify Color (in)equality operator 2015-03-20 19:03:41 +00:00
Maxime Coste
5cf7d650c8 Small code tweak 2015-03-19 23:33:44 +00:00
Maxime Coste
f5da1671fd Refactor number_line higlighter, use a switch to higlhight the cursor line 2015-03-19 00:31:11 +00:00
Maxime Coste
006f8ca588 Merge remote-tracking branch 'ekie/relative_line_numbers' 2015-03-19 00:03:59 +00:00
Maxime Coste
3e28539b81 Add a display coord to buffer coord method to Window 2015-03-18 23:40:26 +00:00
Eike Plack
5627d33ac3 Add support for relative line numbers 2015-03-18 22:07:57 +01:00
Maxime Coste
d3738b858b Remove unneeded include 2015-03-17 20:06:35 +00:00
Maxime Coste
4770d3d86c Change flags operator& to return a value convertible both to flags and bool 2015-03-16 18:57:18 +00:00
Maxime Coste
3921b234e7 Store fake keystrokes when selecting an insert completion candidate
Instead of storing the real 'select next completion' keystroke,
generate fake backspace/delete/char keystrokes so that replay
of the insert will insert the exact same text.

Fixes #135
2015-03-15 18:44:11 +00:00
Maxime Coste
b5854ece43 Change ParameterParser switch interface, use an Optional<StringView>
Merge has_option and option_value into a single method get_switch.
2015-03-14 19:16:46 +00:00
Maxime Coste
65fd0df041 More code style cleanup 2015-03-14 17:30:44 +00:00
Maxime Coste
8a211fc87a Tweak command docstrins 2015-03-14 12:17:43 +00:00
Maxime Coste
82833608c9 Allocate some data in advance in string algorithm 2015-03-14 11:46:53 +00:00
Maxime Coste
9657ef88b7 Small refactoring in client_manager.cc 2015-03-14 11:27:01 +00:00
Maxime Coste
adcb72e987 Minor code cleanup 2015-03-14 11:11:01 +00:00
Maxime Coste
2be6cc918b Avoid stdout/stderr as variable names 2015-03-14 01:53:17 +00:00
Maxime Coste
09e2a0b6ac Do not change the insert completion menu when a candidate is selected 2015-03-13 13:52:23 +00:00
Maxime Coste
6b3201f0f1 Change ShellManager to return both stdout and the return value in a pair 2015-03-13 13:39:18 +00:00
Maxime Coste
dbe27d3df2 Code style change in shell_manager.cc 2015-03-13 13:25:20 +00:00
Maxime Coste
2747c4dd3e exception::what returns a StringView rather than a const char* 2015-03-13 13:15:51 +00:00
Maxime Coste
52cd08915d Keep the dir trailing slash in split_path 2015-03-13 13:09:54 +00:00
Maxime Coste
762643d320 Use correct %zu format string rather than cast 2015-03-12 20:43:21 +00:00
Maxime Coste
1a7d50b347 Minor cleanup 2015-03-12 20:40:00 +00:00
Maxime Coste
b4f6b50dbb Make split_path public 2015-03-12 20:39:34 +00:00
Maxime Coste
2f20399d03 Improve 'def' command completion behaviour and clean it up a little 2015-03-12 19:45:05 +00:00
Maxime Coste
d9cd5fef8f Avoid calling real_path when not needed in BufferManager::get_buffer_ifp 2015-03-12 19:40:10 +00:00
Maxime Coste
c57e76ee41 Cleanup parameter parser code 2015-03-12 13:58:31 +00:00
Maxime Coste
f2b8b1ae2b Fix compilation on clang 2015-03-12 13:04:53 +00:00
Maxime Coste
348e23dd8a Remove unused StaticString 2015-03-12 09:52:33 +00:00
Maxime Coste
4843643514 Always inline OnScopeEnd constructor and destructor 2015-03-11 20:52:39 +00:00
Maxime Coste
ecabfc67b7 fix warning on 32 bit compilation 2015-03-11 20:52:17 +00:00
Maxime Coste
c81a5d03c5 String tweaks 2015-03-11 19:41:44 +00:00
Maxime Coste
a0e8e4265a coords/units hashing refactoring 2015-03-11 13:59:25 +00:00
Maxime Coste
023c8afb73 Fix unneeded string copy 2015-03-11 13:58:42 +00:00
Maxime Coste
3c1a325b6f Refactor String, use a common StringOps interface, hide std::string 2015-03-10 19:50:22 +00:00
Maxime Coste
a0cf75ec39 Tweak WordDB implementation 2015-03-10 13:50:25 +00:00
Maxime Coste
ea526c2137 Small refactoring 2015-03-10 13:34:46 +00:00
Maxime Coste
ea42d9dd4a Remove is_in_range utility function 2015-03-09 22:37:42 +00:00
Maxime Coste
7af8937bac Extract remaining lambdas commands so that the cmds array can be compile time initialized 2015-03-09 14:01:17 +00:00
Maxime Coste
d1f17228dd Use a static array to store the keymap 2015-03-09 13:55:55 +00:00
Maxime Coste
1cec8df45e ArrayView content is not const anymore
As in upcoming std c++ array_view, ArrayView<T> points to mutable
data, use ArrayView<const T> or alias ConstArrayView<T> for const
data.
2015-03-09 13:54:09 +00:00
Maxime Coste
44f81d0b8b constexprify ArrayView 2015-03-09 13:21:43 +00:00
Maxime Coste
0bbaef6e48 Use a sorted array for keymap rather than an unordered map
with ~100 entry, a binary search finds in < 7 step, unordered map
is overkill.
2015-03-08 11:40:50 +00:00
Maxime Coste
3ece7bcf75 Orderable Keys 2015-03-07 15:29:21 +00:00
Maxime Coste
4be6090107 Fix additional eol inserted when replace piping at end of buffer 2015-03-06 13:57:21 +00:00
Maxime Coste
2d93933d81 Rework keymap to use function pointer rather than std::function 2015-03-05 19:57:46 +00:00
Maxime Coste
99996902de Use a IdMap for storing hooks
The number of hook names is small (<20), using an UnorderedMap
is overkill, and prevents using StringView for key searching.
2015-03-05 14:59:27 +00:00
Maxime Coste
d1f3c1832c Small code tweak 2015-03-05 13:52:54 +00:00
Maxime Coste
bc7c3987e1 Convert CodepointPair to struct MatchingPair 2015-03-04 20:47:14 +00:00
Maxime Coste
c0e4268e17 Reactivate direct file change check on entering normal mode 2015-03-04 20:46:26 +00:00
Maxime Coste
4e02e822fd Merge remote-tracking branch 'ekie/fix_debug_cmd' 2015-03-04 09:37:06 +00:00
Maxime Coste
604e95f771 Tweak StringData::create implementation 2015-03-02 23:55:41 +00:00
Eike Plack
2354655df2 Fix documentation for debug_cmd 2015-03-02 16:38:05 +01:00
Maxime Coste
0eca3b5526 Use StringDataPtr alias for RefPtr<StringData> 2015-03-01 12:06:19 +00:00
Maxime Coste
98972c18b7 rename StringStorage to StringData 2015-03-01 12:03:08 +00:00
Maxime Coste
092dcd174f Add StaticStringStorage for storing string literals 2015-02-28 17:09:29 +00:00
Maxime Coste
f88e873f55 Add IndexSequence and make_index_sequence utilities 2015-02-28 17:08:19 +00:00
Maxime Coste
31267675b9 Small cleanup in containers utils 2015-02-27 19:32:27 +00:00
Maxime Coste
b480d6b419 Tweak BufferIterator::{+=,-=} implementation 2015-02-26 21:58:56 +00:00
Maxime Coste
00bde4ef48 Respect columns when copying selection, not just bytes 2015-02-25 13:41:00 +00:00
Maxime Coste
46f37a6050 Always inline RefPtr::{acquire,release,moved} 2015-02-24 13:43:37 +00:00
Maxime Coste
0a6901899d Use RefPtr as SafePtr backend 2015-02-23 20:39:56 +00:00
Maxime Coste
8df77121d7 Rename safe_ptr and ref_ptr to SafePtr and RefPtr 2015-02-19 13:58:25 +00:00
Maxime Coste
6c65c5e080 Add docstrings to highlighters, displayed by addhl help 2015-02-19 13:54:03 +00:00
Maxime Coste
fd3365deb1 Remove unused RegionMatch::timestamp 2015-02-17 13:56:26 +00:00
Maxime Coste
59177c12f9 Replace vector of vector in RegexHighlighter with a single vector. 2015-02-17 13:50:31 +00:00
Maxime Coste
2f890f12c6 Fix RegexHighlighter cache invalidation when changing the regex 2015-02-16 22:43:14 +00:00
Maxime Coste
e5121fe40a Wrap debug loop in ifdef KAK_DEBUG 2015-02-16 22:27:40 +00:00
Maxime Coste
8f6dab08d6 Try to limit the quantity of buffer reparsed by RegexHighlighter 2015-02-16 19:13:55 +00:00
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