summaryrefslogtreecommitdiff
path: root/src/client.hh
AgeCommit message (Collapse)Author
2025-07-08Replace std::unique_ptr with a custom implementationMaxime Coste
<memory> is a costly header we can avoid by just implementing UniquePtr ourselves, which is a pretty straightforward in modern C++, this saves around 10% of the compilation time here.
2024-12-09Print elapsed time when blocked on opening file for writingJohannes Altmanninger
Extract the logic for "waiting for shell to finish" and reuse it for potentially blocking calls to open() that use the O_WRONLY flags.
2024-08-15Remove unused ConstexprVector and rename constexpr_utils.hh to array.hhMaxime Coste
2024-08-12Move most info/status clear logic to clientMaxime Coste
This makes it possible to remove the pending clears whenever an info/status line is explicitely added, removing a class of race conditions introduced by the previous implementation.
2024-08-08Delay NormalMode clearing of status line and info box to next idleMaxime Coste
A common pattern is for info/echo messages to be generated by idle hooks but the clearing of previous info/echo was done immediately on normal mode events. This led to flickering of the info box especially when a hook was repeatidly generating the same info (like moving a cursor in the same word where the hook reacts to the word under the cursor).
2023-08-27Remove Window::force_redraw()Maxime Coste
This was mostly redundant with Client::force_redraw.
2022-09-02Allow to undo and redo selection changesJohannes Altmanninger
From the issue: > It often happens to me that I carefully craft a selection with multiple > cursors, ready to make changes elegantly, only to completely mess it > up by pressing a wrong key (by merging the cursors for example). Being > able to undo the last selection change (even if only until the previous > buffer change) would make this much less painful. Fix this by recording selection changes and allowing simple linear undo/redo of selection changes. The preliminary key bindings are <c-h> and <c-k>. Here are some other vacant normal mode keys I considered X Y <backspace> <minus> # ^ = <plus> ' unfortunately none of them is super convenient to type. Maybe we can kick out some other normal mode command? --- This feature has some overlap with the jump list (<c-o>/<c-i>) and with undo (u) but each of the three features have their moment. Currently there's no special integration with either peer feature; the three histories are completely independent. In future we might want to synchronize them so we can implement Sublime Text's "Soft undo" feature. Note that it is possible to restore selections that predate a buffer modification. Depending on the buffer modification, the selections might look different of course. (When trying to apply an old buffer's selection to the new buffer, Kakoune computes a diff of the buffers and updates the selection accordingly. This works quite well for many practical examples.) This makes us record the full history of all selections for each client. This seems wasteful, we could set a limit. I don't expect excessive memory usage in practice (we also keep the full history of buffer changes) but I could be wrong. Closes #898
2019-11-22Add support for markup in info boxesMaxime Coste
Fixes #2552
2019-11-09Add static or const where usefulJason Felice
2019-10-17Remove explicit sizes from make_array callsMaxime Coste
2019-07-22Ensure current context switches away from buffer on delete-bufferMaxime Coste
Fixes #3025
2018-05-17Small code cleanupsMaxime Coste
2018-05-09Mark Client, Window, Buffer and OptionManager as finalMaxime Coste
Avoids warning about non virtual destructor calls on them, as they have a vtable due to OptionManagerWatcher.
2018-04-29Rework the way UI can trigger a client quittingMaxime Coste
Add a UserInterface::is_ok method and return false on SIGHUP/stdin closing/socket dropping This should be cleaner and more robust than the previous SIGHUP handling code. Fixes #1594
2018-04-01Restore previous status line after notifying wait for shellMaxime Coste
Fixes prompt getting erased by the wait for shell message, and having to manually trigger a redraw to see it again.
2018-03-30Support full redraws during shell execution and handle resize thereMaxime Coste
Fixes #1973
2018-01-21Do not block when waiting for next event if we have pending inputMaxime Coste
Handle next event should never block if we have already accumulated input that we want to process. As we can accumulate new input in lots of places (everytime we run a shell process for example, we might end up reading input keys. That can be triggered during the mode line generation which takes place during display of the window) Fixes #1804
2017-11-12Move Array and ConstexprVector to a constexpr_utils.hh headerMaxime Coste
2017-08-28Expose client pid as $kak_client_pidMaxime Coste
As requested in #1414
2017-08-23Support specifying an exit status on `quit` commandsMaxime Coste
The current client exit status can be specified as an optional parameter, is nothing is given the exit status will be 0. Fixes #1230
2017-08-18Respecify EnumDescs array sizes manually to workaround clang-3.6 bugMaxime Coste
2017-08-12Remove size redundancy in enum_desc function declarationMaxime Coste
The need to have the array size in the return type was redundant with the actual list of elements.
2017-06-16Hide info/menu when they are anchored to an invisible buffer coordMaxime Coste
Fixes #1444
2017-05-22Remove virtual destructor from OptionManagerWatcherMaxime Coste
We should never destruct anything through an OptionManagerWatcher pointer, so having all those destructor virtual makes no sense.
2017-03-15Migrate to a more value based meta programming modelMaxime Coste
Introduce Meta::Type<T> to store a type as value, and pass it around, migrate enum_desc and option_type_name to this.
2017-01-29Fix some uninitialized valuesMaxime Coste
2017-01-08Apply clang-tidy modernize to the codebaseMaxime Coste
2017-01-04Add `Modal` InfoStyle used for bufer reload info boxMaxime Coste
Modal info style wont be replaced by other info boxes. NCursesUI will center that info box. Fixes #1060
2016-11-30Ensure all available input is handled before going back to main loopMaxime Coste
We were not handling keys that could have been generated while handling other keys (like during a shell evaluation).
2016-11-29Simplify greatly UI input handlingMaxime Coste
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-29Clean up includes of user_interface.hhMaxime Coste
2016-10-29Display a status line message when Kakoune is waiting on a shell to completeMaxime Coste
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-01Support codepoints of variable widthMaxime Coste
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-03-30Replace menu and info when they actually movedMaxime Coste
Previous logic worked only when the buffer moved in the window, but not if some highlighter (like line numbering or flag lines) moved the text around.
2016-03-07Rework client redrawing, delay menu/info methods until next refreshMaxime Coste
That avoid sending lots of spurious info_hide/menu_hide, just set a flag and wait until the client is asked to redraw.
2016-03-07Handle <c-l> redrawing on the server sideMaxime Coste
That way we can force a redraw at any moment, including during batch execution.
2016-03-06Only call UserInterface::refresh when the UI has been modifiedMaxime Coste
2016-02-27Remove direct access to ui, go through clientMaxime Coste
Client can now update menu/info positions when the window move around.
2015-11-20Move enum option handling in enum.hh and refactor enum optionsMaxime Coste
2015-11-07Store the last used buffer in clientsMaxime Coste
Fixes #474
2015-09-16Store key hash in IdMapMaxime Coste
2015-08-23Remove Client::window() method, use a force_redraw() oneMaxime Coste
We cannot assume Client::m_window is always non-null, as when changing current buffer its temporarily null, at the point where WinCreate hook might get called. Fixes #382
2015-03-10Refactor String, use a common StringOps interface, hide std::stringMaxime Coste
2015-02-12Cleanup and refactor externally modified buffer reloadingMaxime Coste
* Correctly hide the reload dialog in every client. * Correctly handle buffer being deleted.
2015-01-14Even more memory trackingMaxime Coste
2015-01-12Yet more trackingMaxime Coste
2014-12-20Small code tweakMaxime Coste
2014-11-29Rework client pending key handling, fix insert/normal timersMaxime Coste
2014-11-25Separate events between normal and urgent onesMaxime Coste
Run urgent ones while executing %sh blocks. Fixes #236
2014-11-12Cleanup includesMaxime Coste