Commit Graph
15 Commits
Author SHA1 Message Date
NicolasGB 149ae9ebc7 fix(commit): Migrate from simulated commit to jj's native command.
- This required some improvements on the editor buffer logic,
      introduced a `on_write` (previously on_done but it wasn't the
      right meaning) hook and an `on_unload` to allow for both
      describe and commit correct workflows.
    - Introduced an utils function to extract the description text and
      clean it post buffer write
2026-02-07 17:32:57 +01:00
Nicolas GBandGitHub 335663c3ee Feat: Rewrite diff module to allow for external dependencies as jj.nvim's diff tool (#74)
- Refactor diff into modular architecture (native, diffview, codediff)
- Add the possibility for users to define their own diff backend
- Support external diff tools like diffview.nvim codediff.nvim
- Enable visual mode selection to diff two changes in log buffer
- Add summary tooltip integration with terminal
- Update documentation with new diff workflows
2026-01-25 09:39:31 -08:00
Nicolas GBandGitHub 8ed2aa52aa feat(log): Add summary view (#70)
Display a summary of changed files for any revision in the log buffer
using a floating tooltip. From the tooltip, users can diff or edit
specific files directly.

- Add summary tooltip triggered by <S-k> in log buffer
- Integrate tooltip as stateful component of terminal
- Make summary keymaps configurable
- Add documentation and demo gif
2026-01-25 09:25:06 -08:00
NicolasGB 9d9e2379fd feat(log): Implement squash and quick squash from the log buffer.
- Squash: behaves like rebase, the user can select 1 or more
      revisions to squash and then a destination
    - Quick squash: `-r {rev} -u --ignore-immutable` flag from jj allowing
      for quick visuall squashes
2026-01-08 18:29:04 +01:00
Marco S HymanandGitHub ca75a50858 feat: Terminal buffer keymap help (#64)
This sets up a base where the keymap g? shows a help buffer displaying the normal mode keymaps available.
2026-01-05 09:49:45 +01:00
Nicolas GBandGitHub 12e91e547d feat: Rebase on log buffer (#62)
Now it is possible to rebase interactively from the log buffer with visual feedback. You can rebase one or many visually selected changes.

Supported target modes are: `-o` / `-A` / `-B`.

Limitation:
	- As of now you cannot rebase a whole branch (-b) from the log view.

Bonus from this pr:
	- Now keymaps support different modes
2026-01-02 18:41:59 +01:00
NicolasGB 43b5a81771 fix: prevent invalid buffer access in terminal on_exit callbacks
When closing a terminal buffer (floating or regular), a race condition
could occur where the BufWipeout/BufDelete autocmd clears the buffer
reference, but the job's on_exit handler later tries to operate on it
via vim.schedule. This caused 'Invalid buffer' errors.

Add validity checks in both floating and regular buffer on_exit
handlers to safely handle the case where the buffer has already been
cleaned up.
2025-12-11 17:01:46 +11: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 0cd1f554a6 fix: Correctly parse complex subcommands and push a table to terminal.run() when it's possible instead of making a concat 2025-11-23 18:07:30 +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 b34e08d815 fix: describe command reopening log buffer without flicker
- Close terminal buffer before opening describe editor
  - Capture log state before closing to detect if we should reopen
  - Add on_unload callback to editor to handle log reopening
  - Suppress redraws during buffer transitions with lazyredraw
  - Remove duplicate hardcoded status keymaps from terminal.lua (were referencing undefined functions)
  - Fix resolve_keymaps_from_specs to validate handlers exist before creating keymaps
2025-11-23 16:34:42 +01:00
NicolasGB f06b23326e refactor: Restructure keymaps and event handlers into centralized config-driven system
- Add M.setup() to cmd module for configuration
    - Move describe editor config to M.config.describe.editor with nested structure
    - Add keymaps config with separate log, status, and close sections
    - Implement resolve_keymaps_from_specs() helper to build keymap lists from config
    - Extract editor.open_editor() keymaps parameter support
    - Move status/log event handlers from terminal.lua to cmd.lua
    - Convert log/status buffer keymaps to config-driven approach with handler specs
2025-11-23 16:34:42 +01:00
NicolasGB f0cfb459bd refactor: create a new buffer module to centralize buffer operation logic 2025-11-23 16:34:42 +01:00
NicolasGB e545d02ceb refactor: restructure the whole plugin following a better separation of concers 2025-11-23 16:34:42 +01:00