Commit Graph

22 Commits

Author SHA1 Message Date
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
51b9765959 removing unwanted commment 2025-06-12 15:12:40 +02:00
6dc3826c32 this is a commit 2025-06-11 21:41:42 +02:00
4b48526c25 line highlighter jumps over empty lines 2025-06-11 06:50:35 +02:00
ef961e5bf7 this is a commit 2025-06-11 06:39:09 +02:00
f6fa3ee51e this is a test commit
halla
2025-06-08 09:08:35 +02:00
257a2f0dc8 going back
heloo
2025-06-08 09:06:46 +02:00
719f3e18d5 ƒthis is a nice commit 2025-06-07 14:58:09 +02:00
cc43c993b7 test commit
this is a test
2025-06-07 14:44:10 +02:00
ba0f4b405c this is a test 2025-06-06 20:28:56 +02:00
53034418a1 just clearing the git files 2025-06-06 20:14:07 +02:00
1ad31206b3 this is a test 2025-06-06 16:13:26 +02:00
00eb2aff0e adding a bunch of changes to gg dd command 2025-06-06 12:22:19 +02:00
a1a7ec38ac this is a test commit 2025-06-06 10:46:12 +02:00
2e6f7da67c added stats command
stats is a command that will show you which command you have used the
most, and predicts your next command based on freciency
2025-05-31 14:05:45 +02:00
723939da1b Fix tab completion directory suggestions and add scrolling menu
- 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
2025-05-23 23:25:00 +02:00
32911c92ca just testing 2025-05-23 12:35:13 +02:00
e0e191ffd8 added news support
after the migration to linux the news didnt work. this is now working,
and im using this commit as a check to see if it is working
2025-05-03 23:25:16 +02:00
40ea8a1cb8 Fix subdirectory path completion suggestions display
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.
2025-05-01 00:07:44 +02:00
f0bd91a691 new git features and touched up suggestions
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
2025-04-30 23:27:07 +02:00
e0a386effa making suggestion system work in linux
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
2025-04-28 17:36:06 +02:00
08fb0af502 first commit 2025-04-28 12:35:52 +02:00