summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2019-08-05Fix bug in WrapHighlighter::do_compute_display_setupMaxime Coste
Additional lines were not pulled correctly when a line was removed due to its wrapping hiding the cursor. Fixes #2999
2019-07-25src: De-indent docstrings passed to command/option/mapping definitionsFrank LENORMAND
This commit implements formatting behaviour when the first character of a docstring is a newline. In that case, the exact indentation level of the next line will be removed from that line and all subsequent non-empty lines. An error will be returned if a subsequent non-empty line does not have the same indentation level. The docstrings are always trimmed (surrounding whitespaces) whether the first character is a newline or not, as was the case prior to this commit. Example: the following declaration ``` define-command test -docstring %{ test: do something Nothing really. More indented lines. } nop ``` would be rendered as ``` test: do something Nothing really. More indented lines. ``` Related to #2405
2019-07-22Ensure current context switches away from buffer on delete-bufferMaxime Coste
Fixes #3025
2019-07-21save command history in execute-keys by defaultMaxime Coste
This should make #3014 unnecessary
2019-07-21Slight code cleanup in prompt history handlingMaxime Coste
2019-07-21Merge branch 'master' of http://github.com/jo-he/kakouneMaxime Coste
2019-07-21More functional style for '*' codeMaxime Coste
2019-07-21Merge remote-tracking branch 'lenormf/fix-2994'Maxime Coste
2019-07-09Filter non-extra_word_chars completion candidates using CodepointsMaxime Coste
Fixes #3010
2019-07-09Use -O0 for debug buildsMaxime Coste
-Og is not nice enough to work with in gdb, control jumps around in too unpredictible ways due to inlining.
2019-07-07allow for mapping the Insert keyJoachim Henke
2019-07-07Merge remote-tracking branch 'lenormf/fix-history-size'Maxime Coste
2019-07-07Merge branch 'master' of http://github.com/jo-he/kakouneMaxime Coste
2019-07-06fix a few typosJoachim Henke
2019-07-06Fix build on FreeBSDTobias Kortkamp
file.cc:390:21: error: use of undeclared identifier 'rename'; did you mean 'devname'? if (replace and rename(temp_filename, zfilename) != 0) ^~~~~~ devname /usr/include/stdlib.h:277:7: note: 'devname' declared here char *devname(__dev_t, __mode_t); ^ file.cc:390:28: error: cannot initialize a parameter of type '__dev_t' (aka 'unsigned long') with an lvalue of type 'char [1024]' if (replace and rename(temp_filename, zfilename) != 0) ^~~~~~~~~~~~~ /usr/include/stdlib.h:277:22: note: passing argument to parameter here char *devname(__dev_t, __mode_t); ^ 2 errors generated. --- highlighters.cc:1110:13: error: use of undeclared identifier 'snprintf'; did you mean 'vswprintf'? snprintf(buffer, 16, format, std::abs(line_to_format)); ^~~~~~~~ vswprintf /usr/include/wchar.h:139:5: note: 'vswprintf' declared here int vswprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict, ^ highlighters.cc:1110:22: error: cannot initialize a parameter of type 'wchar_t *' with an lvalue of type 'char [16]' snprintf(buffer, 16, format, std::abs(line_to_format)); ^~~~~~ /usr/include/wchar.h:139:35: note: passing argument to parameter here int vswprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict, ^ 2 errors generated. --- json_ui.cc:60:13: error: use of undeclared identifier 'sprintf'; did you mean 'swprintf'? sprintf(buf, "\\u%04x", *next); ^~~~~~~ swprintf /usr/include/wchar.h:133:5: note: 'swprintf' declared here int swprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict, ^ json_ui.cc:60:21: error: cannot initialize a parameter of type 'wchar_t *' with an lvalue of type 'char [7]' sprintf(buf, "\\u%04x", *next); ^~~ /usr/include/wchar.h:133:34: note: passing argument to parameter here int swprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict, ^ json_ui.cc:74:9: error: use of undeclared identifier 'sprintf' sprintf(buffer, R"("#%02x%02x%02x")", color.r, color.g, color.b); ^ 3 errors generated. --- regex_impl.cc:1039:9: error: use of undeclared identifier 'sprintf'; did you mean 'swprintf'? sprintf(buf, " %03d ", count++); ^~~~~~~ swprintf /usr/include/wchar.h:133:5: note: 'swprintf' declared here int swprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict, ^ regex_impl.cc:1039:17: error: cannot initialize a parameter of type 'wchar_t *' with an lvalue of type 'char [20]' sprintf(buf, " %03d ", count++); ^~~ /usr/include/wchar.h:133:34: note: passing argument to parameter here int swprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict, ^ regex_impl.cc:1197:17: error: use of undeclared identifier 'puts' { if (dump) puts(dump_regex(*this).c_str()); } ^ regex_impl.cc:1208:18: note: in instantiation of member function 'Kakoune::(anonymous namespace)::TestVM<Kakoune::RegexMode::Forward>::TestVM' requested here TestVM<> vm{R"(a*b)"}; ^ regex_impl.cc:1197:17: error: use of undeclared identifier 'puts' { if (dump) puts(dump_regex(*this).c_str()); } ^ regex_impl.cc:1283:56: note: in instantiation of member function 'Kakoune::(anonymous namespace)::TestVM<5>::TestVM' requested here TestVM<RegexMode::Forward | RegexMode::Search> vm{R"(f.*a(.*o))"}; ^ regex_impl.cc:1197:17: error: use of undeclared identifier 'puts' { if (dump) puts(dump_regex(*this).c_str()); } ^ regex_impl.cc:1423:57: note: in instantiation of member function 'Kakoune::(anonymous namespace)::TestVM<6>::TestVM' requested here TestVM<RegexMode::Backward | RegexMode::Search> vm{R"(fo{1,})"}; ^ 5 errors generated. --- remote.cc:829:9: error: use of undeclared identifier 'rename'; did you mean 'devname'? if (rename(old_socket_file.c_str(), new_socket_file.c_str()) != 0) ^~~~~~ devname /usr/include/stdlib.h:277:7: note: 'devname' declared here char *devname(__dev_t, __mode_t); ^ remote.cc:829:16: error: cannot initialize a parameter of type '__dev_t' (aka 'unsigned long') with an rvalue of type 'const char *' if (rename(old_socket_file.c_str(), new_socket_file.c_str()) != 0) ^~~~~~~~~~~~~~~~~~~~~~~ /usr/include/stdlib.h:277:22: note: passing argument to parameter here char *devname(__dev_t, __mode_t); ^ 2 errors generated. --- string_utils.cc:126:20: error: use of undeclared identifier 'sprintf'; did you mean 'swprintf'? res.m_length = sprintf(res.m_data, "%i", val); ^~~~~~~ swprintf /usr/include/wchar.h:133:5: note: 'swprintf' declared here int swprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict, ^ string_utils.cc:126:28: error: cannot initialize a parameter of type 'wchar_t *' with an lvalue of type 'char [15]' res.m_length = sprintf(res.m_data, "%i", val); ^~~~~~~~~~ /usr/include/wchar.h:133:34: note: passing argument to parameter here int swprintf(wchar_t * __restrict, size_t n, const wchar_t * __restrict, ^ string_utils.cc:133:20: error: use of undeclared identifier 'sprintf'; did you mean 'swprintf'? res.m_length = sprintf(res.m_data, "%u", val); ^~~~~~~ swprintf [...]
2019-07-02src: Cap the maximum size of history registersFrank LENORMAND
History registers (for prompt commands, pipe primitive commands etc) are populated interactively by the users, and currently have no size limit. This commits silently drops the oldest entries in the storage space to allow at most 100 entries, to prevent long-running editing sessions from hogging memory for data most likely never used.
2019-07-01src: Use all selections to generate a pattern upon hitting `*`Frank LENORMAND
This commit makes the `*` and <a-*> primitives compose a search pattern comprised of all the current selections, as opposed to only the main one. All selections are OR'd into the default search register, which makes it convenient to search for several identifiers already selected. To retain the old behaviour, the following mappings can be used: ``` map global normal * ': exec -draft -save-regs "" %{<space>*}<ret>' map global normal <a-*> ': exec -draft -save-regs "" %{<space><a-*>}<ret>' ``` Fixes #2994
2019-07-01Kakoune v2019.07.01Maxime Coste
2019-06-29Merge remote-tracking branch 'lenormf/fix-2907-2'Maxime Coste
2019-06-29Merge remote-tracking branch 'codesoap/rename_moduleload'Maxime Coste
2019-06-27Fix quoting of tuple optionsMaxime Coste
Fixes #2990
2019-06-25Rename ModuleLoad hook to ModuleLoadedcodesoap
This clarifies, that the hook is run *after* the module is loaded.
2019-06-24src: Enforce case sensitivity when parsing function keysFrank LENORMAND
The `parse_keys()` function is case insensitive when parsing function keys, while the `key_to_str()` function always returns a capitalized key description. When users hook on the lowercase name of a function key, e.g. `NormalKey <f10>`, and later hit that same key in normal mode, the `key_to_str()` will convert it to the uppercase description ("<F10>"). This results into a hook with a lowercase regex predicate being unsuccessfully matched against an uppercase key description by the hook manager, which works on a case sensitive basis. One solution could be to uppercase all function key descriptions passed as hook filter upon declaration, but detecting that is not trivial as the filter can contain more than just the simple <f\d+> data, e.g. --- hook global InsertKey '<(?<name>\w+)>' %{…} --- Another simpler solution that this commit implements is to allow only <F\d+> descriptions in `parse_keys()`, and hope users will know not to use the lowercase notation when declaring hooks. Fixes #2907
2019-06-24Unify register saving/restoring to a VectorMaxime Coste
The previous "optimized" history register logic was unfortunately not restoring correctly as the order of entries in the history register could have been mutated.
2019-06-23Fix silly typoMaxime Coste
2019-06-23Put -Og flag in CXXFLAGS, not CPPFLAGSMaxime Coste
2019-06-23Merge remote-tracking branch 'eraserhd/debug-optimizations'Maxime Coste
2019-06-23Tweak history restoring behaviourMaxime Coste
2019-06-23Use register to store prompt historyMaxime Coste
2019-06-23Add support for `echo -quoting (raw|kakoune|shell)` switchMaxime Coste
2019-06-23Make quoting opt-in by using $kak_quoted_...Maxime Coste
2019-06-19Refactor option_to_string quoting support, introduce Quoting::RawMaxime Coste
2019-06-18Move dropped free windoes to the window trashMaxime Coste
2019-06-16Do not add window pointing to deleted buffers in the free window listMaxime Coste
Fixes #2975
2019-06-15Merge remote-tracking branch 'lenormf/fix-2966'Maxime Coste
2019-06-15Merge remote-tracking branch 'eraserhd/fifo-fixes'Maxime Coste
2019-06-14src: Make sure the iterator is inbound before decrementing itFrank LENORMAND
Fixes #2966
2019-06-11Fix emission of BufReadFifo eventsJason Felice
The hook parameter should not be adjusted for the prevention of scrolling. Also, ensure that the last BufReadFifo is triggered if we encounter an error or EOF after appending some data to the buffer. Closes #2946
2019-06-11Refuse to overwrite an existing session socketMaxime Coste
2019-06-10Add a gather overload that infer element typeMaxime Coste
2019-06-04Merge remote-tracking branch 'eraserhd/minor-remote-fixes'Maxime Coste
2019-05-29Refactor message writingJason Felice
2019-05-29Do not merge selections on backspace in insert modeMaxime Coste
Fixes #2861
2019-05-29Null terminate gdb auto-load scriptMaxime Coste
Fixes #2929
2019-05-29Fix BufferedWriter triggering std::terminate on exception when writingMaxime Coste
Fixes #2932
2019-05-29Fix trailing slash removal code with root directoryMaxime Coste
2019-05-28Fix the man path for OpenBSDcodesoap
2019-05-28Avoid using gzips '-k' for compatibilitycodesoap
OpenBSD's gzip doesn't have '-k', but file redirection should work everywhere.
2019-05-23Do not try to send remaining data on a closed socketMaxime Coste
Fixes #2906
2019-05-21Add -Og for debug buildsJason Felice
On my system, some optimizations are on by default (NixOS), resulting in variables being optimized out on debug builds. It *seems to be* something about a "_FORTIFY_SOURCE" feature? In any case, `-Og` is documented as "Optimize debugging experience".