Commit Graph

3403 Commits

Author SHA1 Message Date
Maxime Coste
95c1528342 Fix crash when a client sends a packet advertising a wrong size
If the given size is less than the header size, the message is
clearly invalid, disconnect the client in that case.
2016-12-01 19:45:23 +00:00
Maxime Coste
7defdd3039 Make FDWatcher support Read, Write and Except events, instead of just Read 2016-12-01 19:44:07 +00:00
Maxime Coste
99a3388e41 Hide the waiting for shell message once the shell returns 2016-11-30 13:46:20 +00:00
Maxime Coste
61b3dfd184 Use a Timer for Shell waiting notification
Without a timer we were relying on other event sources to wake us
up to display the information, which was usually a NormalIdle or
a filesystem check timer.
2016-11-30 09:55:05 +00:00
Maxime Coste
540e504e68 Ensure all available input is handled before going back to main loop
We were not handling keys that could have been generated while handling
other keys (like during a shell evaluation).
2016-11-30 09:47:38 +00:00
Maxime Coste
3a81260917 Simplify greatly UI input handling
This round trip through an input callback expected to call
is_key_available and get_key was overcomplicated, just send the
keys as they arrive, the client is already buffering due to urgent
event mode.
2016-11-29 21:59:36 +00:00
Maxime Coste
2fd1414b05 Clean up includes of user_interface.hh 2016-11-29 19:53:11 +00:00
Maxime Coste
0dff8a7d3f Small remote code cleanup 2016-11-29 19:52:57 +00:00
Maxime Coste
db86c6cbc9 Small cleanup in BufferManager code 2016-11-29 19:12:10 +00:00
Maxime Coste
12856066b1 Cleanup include dependencies a bit 2016-11-28 23:58:08 +00:00
Maxime Coste
da6d7f4530 Always consider end of selection is not and eol for keep
Fixes #921
2016-11-28 21:07:24 +00:00
Maxime Coste
719eb16a5e Fix matching flags not being forwarded to regex_search
Still does not fully fix #921
2016-11-28 20:02:40 +00:00
Maxime Coste
2f3a7112ea Add more memory domains to certain data 2016-11-28 13:59:55 +00:00
Maxime Coste
54d540021c Add support for mouse in insert mode
Fixes #940
2016-11-28 13:15:12 +00:00
Maxime Coste
a4738ace5f :prompt and :onkey (renamed :on-key) now use values instead of registers
:prompt provides the entered text in the `text` value, :on-key provides
the entered key in the `key` value.

Closes #938
2016-11-27 20:57:04 +00:00
Maxime Coste
b337f99ca7 Add a 'keys' debug flag, showing the keystrokes comming to clients 2016-11-26 13:29:17 +00:00
Maxime Coste
e340e0ed39 Forward client name to contexts created for write-all
Fixes #937
2016-11-24 13:35:42 +00:00
Maxime Coste
8f2c6eb586 Fix write_all_buffers when BufWrite... hooks create/delete buffers
The buffer list can be mutated during iteration, so it is no safe
to directly iterate on the BufferManager, we need to first create
our own copy of the buffer list.

Fixes #935
2016-11-23 23:51:16 +00:00
Maxime Coste
b884b499dd Rework ensure_all_buffers_are_saved to remove an unneeded Vector 2016-11-23 23:39:42 +00:00
Maxime Coste
1ccccbce04 Fix horrible leak in String::Data::operator=(String::Data&&)
And that, my friends, is why we recommend using standard containers
instead of rolling your own.
2016-11-23 01:09:09 +00:00
Maxime Coste
03dcfb2574 Small code tweak 2016-11-23 00:22:37 +00:00
Maxime Coste
ca0606017f Small code refactoring 2016-11-22 23:51:09 +00:00
Maxime Coste
3f3ed0b333 Fix literal type that must be 64 bits 2016-11-22 22:20:30 +00:00
Maxime Coste
d15cc02c01 Remove some unneeded headers from ncurses_ui.cc 2016-11-22 09:49:55 +00:00
Maxime Coste
0b806cd4f1 Add missing hooks to completion list and validate hook name in hook cmd 2016-11-21 09:51:47 +00:00
Maxime Coste
be03fdce2a Support completing hook names
Fixes #879
2016-11-20 11:17:13 +00:00
Maxime Coste
cd8d51af34 Fix PerArgumentCommandCompleter when completing the non first arg
The actualy query passed was always the first argument.
2016-11-20 11:16:34 +00:00
Maxime Coste
47a82b9855 Make ArrayView::subrange size arguement optional 2016-11-20 11:15:15 +00:00
Maxime Coste
67eb19c6d2 Only rely on ignored_files option to remove hidden files, no built in logic
Fixes #929
2016-11-18 09:38:48 +00:00
Maxime Coste
4a2fea8c9e Continue command renaming to improve consistency 2016-11-15 13:49:06 +00:00
Maxime Coste
6d79ade019 Tweak RankedMatch behaviour and fix bug in its comparison function
casting TestableFlag<T> to UnderlyingType<T> was going through bool
conversion... Not sure how things worked earlier.
2016-11-14 19:39:35 +00:00
Maxime Coste
b3ba769220 Propagate the hooks disabled state through prompt, menu, and command execution
Maintain it as well during buffer creation even if the hooks are not executed
in client context.

Fixes #818
2016-11-14 19:39:35 +00:00
Maxime Coste
c2989704d5 More correct handling of SIGHUP while suspended
Fixes #833
2016-11-14 00:49:34 +00:00
Maxime Coste
5249df78d4 Do not include aliases in command completion candidates anymore
Fuzzy matching makes it redundant.
Closes #817
2016-11-14 00:29:43 +00:00
Maxime Coste
dcd733e5fa Do a first phase of command renaming 2016-11-14 00:27:14 +00:00
Maxime Coste
9d9beb7e3a Pass regex flags on keep matching/not matching
Related to #921
2016-11-12 18:03:54 +00:00
Maxime Coste
8490caa0d7 Add support for <a-Z> appending current selections to the given register 2016-11-09 13:57:05 +00:00
Maxime Coste
9153663dfa Add -save-regs defaults in the context wrap docstring 2016-11-08 09:49:48 +00:00
Maxime Coste
6889494869 Emit an OSC 104 on quit to reset color palette on supporting terminals
xterm and vte based terminals support it, unfortunately rxvt-unicode
does not yet.

Fixes #914
2016-11-05 11:43:25 +00:00
Maxime Coste
8e5f491d3f Support deleting a buffer even if another client is in insert mode on it 2016-11-05 11:29:47 +00:00
Maxime Coste
bc2d79d302 Run WinDisplay hook on creation of clients
Fixes #913
2016-11-03 19:09:52 +00:00
Maxime Coste
6347787cf2 Propagate NormalParams to user mappings
Closes #896
2016-11-02 23:12:57 +00:00
Maxime Coste
4d222bbb33 Add experimental static linking support to the makefile 2016-11-02 22:28:05 +00:00
Nikolaus Wittenstein
e7970232d3 Fix typo in write_cmd's desc
Should be possessive "its".
2016-10-31 12:42:10 -04:00
Maxime Coste
650a989c1e Add to_string(long long int) overload to fix OSX compilation 2016-10-31 10:19:06 +00:00
Maxime Coste
a7cac87753 Display a status line message when Kakoune is waiting on a shell to complete
If a shell commands takes more than 1s to execute, a message will appear
on the status line notifying the user, along with the time Kakoune has
been waiting for.
2016-10-29 11:25:58 +01:00
Maxime Coste
965cd8e0c3 Fix align support with aligntab = true 2016-10-28 09:50:25 +01:00
Maxime Coste
7c6c6871ce BufferRange option syntax support <line>.<column>+<len> and is inclusive
Fixes #864
2016-10-26 22:58:12 +01:00
Maxime Coste
dc18963875 Make o/O open multiple lines when a count is given
Fixes #873
2016-10-24 20:45:12 +01:00
Maxime Coste
7a04efb6d9 Force wrapping when searching from buffer end
Fixes #868
2016-10-23 21:03:15 +01:00
Maxime Coste
2809ce00de Set main selection index to the current sel when piping different selections
Fixes #884
2016-10-23 19:54:40 +01:00
Maxime Coste
d2aa292c17 Change handling of OpenLineAbove to fix first line edge cases
Fixes #877
2016-10-23 19:48:16 +01:00
Maxime Coste
28db6f04f1 Re-enable undo support on fifo buffers when the fifo closes
Fixes #881
2016-10-23 18:22:42 +01:00
Maxime Coste
e318190a59 Small formatting tweak 2016-10-17 18:37:05 +01:00
Maxime Coste
e8dcdb6072 Support Ctrl + mouse dragging to add a new selection
Fixes #838
2016-10-13 22:59:02 +01:00
Maxime Coste
cc2affea11 Always allow to delete a buffer, just recreate a scratch buffer if needed
Fixes #850
2016-10-13 21:37:44 +01:00
Maxime Coste
6bfc68d4f3 Rename DisplayAtom::Types to avoid conflicts with struct BufferRange 2016-10-13 19:55:15 +01:00
Maxime Coste
1f3e424047 Do not expand filenames when doing insert filename completion
Fixes #855
2016-10-13 19:46:09 +01:00
Maxime Coste
e384e7263c Use CPPFLAGS instead of CXXFLAGS for the _XOPEN_SOURCE define 2016-10-13 00:19:27 +01:00
Frank LENORMAND
f7e2bfd76f Document the optional parameter of the cd command 2016-10-11 10:39:20 +03:00
Maxime Coste
5440d31f99 Only create a default *scratch* when we dont have any non debug buffers
Fixes #852
Closes #856
2016-10-11 00:45:05 +01:00
Maxime Coste
780a4605fa More transform(...) filter cleanup using mem_fn when possible 2016-10-11 00:32:40 +01:00
Maxime Coste
8b6eba8208 Add support for repeating the last object/char find command
This is a potential solution for #794.
2016-10-11 00:20:36 +01:00
Maxime Coste
f6cdc2eee5 Use std::begin/std::end in containers.hh instead of the method version 2016-10-11 00:17:00 +01:00
Maxime Coste
025b91baca Convert some uses of lambda to more concise std::mem_fn 2016-10-10 23:44:18 +01:00
Maxime Coste
bc9d1b4dac Small formatting fixup 2016-10-10 23:20:05 +01:00
Maxime Coste
0d2bb4756b Fix register alternate name doc and dash -> hash for '#' 2016-10-10 23:19:57 +01:00
Maxime Coste
10681f4809 Merge remote-tracking branch 'Delapouite/typo' 2016-10-09 23:30:00 +01:00
Maxime Coste
314108e539 Document register alternate names and add some missing ones
Fixes #853
2016-10-09 23:27:52 +01:00
Maxime Coste
f904402486 Handle all available keys when a RemoteClient input is available
We were just treating the next key. Which led to <esc> byte
remaining after suspend, that led that <esc> being interpretted
as <alt> when the following key got available.

Fixes #739
2016-10-06 23:47:44 +01:00
Maxime Coste
006be63a32 Ensure local client is destroyed before we fork the server to background
The recent change that introduced defered client deletion made the local
client destruction happens too late, putting the terminal in a bad state
when we resumed the process as client only.
2016-10-06 23:35:32 +01:00
Maxime Coste
5dd47e9c33 Preserve shell context through eval command
Fixes #835
2016-10-06 23:22:39 +01:00
Delapouite
acafe5f0b9 Fix typo horzontally → horizontally 2016-10-06 16:13:40 +02:00
Maxime Coste
9078039326 Fix select_to_previous_word with spaces at buffer start
Fixes #844
2016-10-05 23:42:36 +01:00
Maxime Coste
8579e299da Fix custom text object 2016-10-05 09:36:39 +01:00
Maxime Coste
f81b8c137b Replace non ascii chars with ? in xterm title, and limit to 511 chars
Closes #839
2016-10-04 20:13:15 +01:00
Maxime Coste
d2a324d3c4 Treat '\n' as 1 column wide
Fixes #842
2016-10-04 19:37:43 +01:00
Maxime Coste
40fb56c87a Small code cleanup 2016-10-04 19:37:17 +01:00
Maxime Coste
620fc28ea6 Add "(extend)" to search prompts when we are extending the selection
Fixes #832
2016-10-04 13:18:03 +01:00
Maxime Coste
9e12ac327b Refactor hook disabling in normal mode
Normal mode takes care of keeping hooks disabled until nested modes
finishes.

Requiered form #818, not sufficient yet.
2016-10-03 20:02:37 +01:00
Maxime Coste
a51d5a1046 Do not select the next word for inner word. 2016-10-03 20:01:37 +01:00
Maxime Coste
c7356c8e9c Close write buffer file descriptor before getting the new fs timestamp 2016-10-03 20:00:36 +01:00
Maxime Coste
d50087eabe Change BufWritePre/BufWritePost logic
Run them in client context if possible, and give them the target
filename instead of the buffer name.

Fixes #823
2016-10-01 23:51:53 +01:00
Maxime Coste
4b6d4ec8eb Small refactoring in highlighters.cc 2016-10-01 14:12:21 +01:00
Maxime Coste
8cc30a8ca0 Enable _XOPEN_SOURCE=700 on cygwin to get the wcwidth function 2016-10-01 13:46:55 +01:00
Maxime Coste
249ec4835e Rename get_width to codepoint_width 2016-10-01 13:45:00 +01:00
Maxime Coste
28cfd0bb61 Fix get_column function and add some unit tests for fullwidth text 2016-10-01 13:45:00 +01:00
Maxime Coste
35559b65dd Support codepoints of variable width
Add a ColumnCount type and use it in place of CharCount whenever
more appropriate, take column size of codepoints into account for
vertical movements and docstring wrapping.

Fixes #811
2016-10-01 13:45:00 +01:00
Maxime Coste
dc735450a8 Tweak ranked match comparison, give contiguous matches an edge 2016-09-30 22:13:01 +01:00
Maxime Coste
e701254b02 Fix String::Data::reserve on big endian platforms, and document String::Data
reserve was not ensuring the capacity would be pair, which is needed
on big endian machines, as we use its least significant bit to flag
short string optimizations. On little endian the bit we use is the
8th most significant (the least significant bit of the last byte),
so we were not hitting any problems.

Fixes #828
2016-09-28 19:06:25 +01:00
Maxime Coste
1b9eb2c6ba Validate option names to be in [a-zA-Z0-9_]
Closes #824
2016-09-27 09:54:55 +01:00
Maxime Coste
e3c4bddd3b Make hook disabling work for all hooks, not only user hooks
Fixes #823
2016-09-26 23:43:05 +01:00
Maxime Coste
696db111e2 Selecting 'around' word when on spaces after word now selects next word 2016-09-26 23:33:28 +01:00
Maxime Coste
fcb37cc754 Pass count to all object selectors 2016-09-26 23:32:07 +01:00
Maxime Coste
1e0ec182c1 Assert substr from parameter is within the string
Should catch #756 earlier if it happens again.
2016-09-26 23:24:09 +01:00
Maxime Coste
a0c20a924a OptionDescs are const in OptionRegistry 2016-09-26 22:59:02 +01:00
Maxime Coste
5e3effc1f0 Merge remote-tracking branch 'lenormf/fix-src-makefile' 2016-09-26 22:04:34 +01:00
Maxime Coste
b5450aa375 Tweak RankedMatch logic, prioritize matches that are in a single word 2016-09-26 21:54:39 +01:00
Frank LENORMAND
b9d21a9e9e Add some standard GNU targets to the Makefile
Closes #813
2016-09-25 09:40:24 +03:00
Maxime Coste
532e3758fe Add InsertCompletionShow/InsertCompletionHide hooks 2016-09-21 13:43:06 +01:00