Commit Graph
5 Commits
Author SHA1 Message Date
Nicolas GBandGitHub 10c611eaab feat: add close_on_edit config for log buffer (#48)
- Add close_on_edit option to close log buffer after editing a change (default: false)
- Rename handle_log_enter to handle_log_edit with close_on_exit parameter
- Update log keymaps to pass close_on_edit config to handlers
- Update config types and defaults in init.lua
2025-11-26 15:48:56 +01:00
NicolasGB 7329e89a85 feat(terminal): add configurable cursor render delay for terminal buffers
Add cursor position restoration with configurable timing to handle terminal
     buffer rendering asynchronously. This fixes cursor column being reset to 0
     when refreshing jj log commands.

     Changes:
     - Add `terminal.cursor_render_delay` configuration option (default: 10ms)
     - Add buffer.get_cursor() and buffer.set_cursor() helpers in core/buffer
       * buffer.set_cursor() uses defer_fn with configurable delay for terminal buffers
       * Automatic position validation with clamping to buffer bounds
       * Line number clamped to [1, line_count]
       * Column clamped to [0, line_length] based on actual line content
       * Validation happens inside deferred callback to check against final rendered content
     - Extract clamp_cursor_position() helper to eliminate code duplication
     - Refactor terminal module to use new buffer cursor helpers
     - Store and restore cursor position when cycling through log commands
     - Update README with terminal configuration section and example usage

     The delay is necessary because nvim_open_term() + nvim_chan_send() have
     asynchronous rendering in the terminal emulator layer. Setting the cursor
     before rendering completes results in the column being reset to 0. Users
     experiencing issues can increase the delay value if needed.
2025-11-25 09:10:12 +01:00
NicolasGB c5a51a1beb refactor: Make the floating buffer configurable keymaps too 2025-11-23 16:34:42 +01:00
NicolasGB 050608c2cc refactor: remove hardcoded closing keymaps on the terminal buffer 2025-11-23 16:34:42 +01:00
NicolasGB a96a5c7849 refactor: split cmd.lua into multiple files when commands have enough business inside them 2025-11-23 16:34:42 +01:00