marcusDenslow f59381f929 feat: Add interactive line-by-line staging to ncurses diff viewer
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
2025-06-13 16:33:45 +02:00
2025-04-28 12:35:52 +02:00
2025-05-01 00:17:58 +02:00
2025-05-31 15:02:18 +02:00
2025-06-08 23:08:56 +02:00
2025-04-28 12:35:52 +02:00
2025-06-08 23:13:36 +02:00
2025-06-08 02:03:44 +02:00
2025-04-28 12:35:52 +02:00
2025-06-08 01:50:07 +02:00
2025-06-06 10:46:12 +02:00
2025-05-31 15:02:18 +02:00
2025-04-28 12:35:52 +02:00
2025-06-08 23:37:23 +02:00
2025-06-08 21:48:55 +02:00
2025-04-28 12:35:52 +02:00
2025-04-30 22:14:31 +02:00
2025-04-28 12:35:52 +02:00
2025-05-31 15:02:18 +02:00
2025-06-11 19:31:05 +02:00
2025-06-11 19:31:05 +02:00
2025-05-03 15:50:41 +02:00
2025-05-03 15:50:41 +02:00
2025-05-31 15:02:18 +02:00
2025-06-06 15:36:10 +02:00
2025-06-06 10:46:12 +02:00
2025-04-28 12:35:52 +02:00
2025-05-31 14:05:45 +02:00
2025-05-31 14:05:45 +02:00
2025-05-31 14:05:45 +02:00
2025-04-28 12:35:52 +02:00
2025-05-31 15:02:18 +02:00
2025-04-28 12:35:52 +02:00
2025-04-28 12:35:52 +02:00
2025-04-28 12:35:52 +02:00
2025-05-31 15:02:18 +02:00
2025-04-28 12:35:52 +02:00
2025-05-01 13:12:55 +02:00
2025-04-28 12:35:52 +02:00
2025-05-01 12:37:56 +02:00
2025-04-28 12:35:52 +02:00
2025-04-28 12:35:52 +02:00
2025-05-31 15:02:18 +02:00
2025-05-31 15:02:18 +02:00
2025-05-03 23:25:16 +02:00
2025-05-31 15:02:18 +02:00
2025-04-28 12:35:52 +02:00
2025-04-28 12:35:52 +02:00
2025-05-31 15:02:18 +02:00
2025-04-28 12:35:52 +02:00
2025-04-28 12:35:52 +02:00
2025-05-31 15:02:18 +02:00
2025-06-13 16:29:00 +02:00
2025-04-28 12:35:52 +02:00
Description
No description provided
10 MiB
Languages
C 99.8%
Makefile 0.2%