Implement comprehensive interactive staging functionality that allows
users
to stage and unstage individual lines, similar to `git add -p` but with
a
visual interface.
New features:
- Split view mode showing unstaged changes (left) and staged changes
(right)
- Line-by-line staging: press Space on any diff line to stage/unstage it
- Tab switching between unstaged and staged panes
- Apply staged changes with 'a' key (runs `git apply --cached`)
- Visual indicators for staged vs unstaged content with proper syntax
highlighting
- Interactive unstaging: switch to staged pane and press Space to
unstage lines
- Automatic refresh of git status after staging/unstaging operations
- Proper git integration reading from both working directory and staging
area
Technical implementation:
- Added `load_file_with_staging_info()` to load unstaged changes
(staging vs working)
- Added `rebuild_staged_view_from_git()` to load staged changes (HEAD vs
staging)
- Added `stage_hunk_by_line()` for individual line staging
- Added `unstage_line_from_git()` for removing lines from staging area
- Added `apply_staged_changes()` to apply staged content to git
- Enhanced file content window with split view rendering
- Added proper cursor management for both unstaged and staged panes
This transforms the diff viewer into a full-featured interactive staging
tool,
allowing developers to create atomic commits with only specific lines
rather
than entire files.
Keybindings:
- Enter: Switch to split staging view
- Tab: Switch between unstaged/staged panes
- Space: Stage/unstage current line
- 'a': Apply staged changes to git
- 'c': Commit staged changes
- 'r': Reset staged changes
- Fix directory path completion to avoid duplicate folder names in
suggestions
- Add scrolling support for suggestion menus with more than 10 items
- Display scroll indicators showing count of items above/below visible
window
- Implement dynamic menu filtering that updates in real-time as user
types
- Add right arrow key to accept inline suggestions without opening
menu
- Add Shift+Tab for backward navigation through suggestions
- Remove "." and ".." entries from all tab completion suggestions
- Fix menu clearing bug that left stale entries on screen
- Improve suggestion display with proper spacing and visual separation
Fixed issue where subdirectory paths (e.g. "cd shelltest/ha") would not
show low opacity
text for completions even though Tab accepts them. Modified
display_inline_suggestion
to properly handle filename parts within subdirectory paths, ensuring
the completion
text is correctly displayed for nested paths.
the suggestion that is currently "hovered" over in the suggestion list
will be appended inline to the prompt. also hitting tab when only one
match is found will now accept that suggestion instead of opening the
menu
added gg o flag to open the current repo in github if it is a git repo
the suggestions were not working after porting to linux. remade the
system but with a better ui (feels so freeing not working on windows
anymore) now its similar to the zsh autocomplete plugin. start typing
and a suggestion will pop up, hit enter to start cycling suggestions in
the new ui and hit enter on the wanted suggestion