Commit graph

3 commits

Author SHA1 Message Date
3c3b27a2cb perf: cache repo root and harden async paths
Problem: get_repo_root() shells out on every call, causing 4-6
redundant subprocesses per gdiff_file() invocation.
highlight_vim_syntax() leaks a scratch buffer if nvim_buf_call errors.
lib.ensure() silently drops callbacks during download, permanently
missing intra-line highlights. The debounce timer callback can operate
on an invalid buffer.

Solution: Cache get_repo_root() results by parent directory. Wrap
nvim_buf_call and nvim_buf_delete in pcall so the scratch buffer is
always cleaned up. Queue pending callbacks in lib.ensure() so all
callers receive the handle once the download completes. Guard the
debounce timer callback with nvim_buf_is_valid.
2026-02-09 12:36:51 -05:00
85080514b6 feat(git): add index and working tree content retrieval
Adds functions for accessing git index content and working tree files:
- get_index_content() retrieves file from staging area via :0:path
- get_working_content() reads file directly from disk
- file_exists_in_index() checks if file is staged
- file_exists_at_revision() checks if file exists at given revision
2026-02-04 22:23:09 -05:00
045a9044b5 feat: add :Gdiff, :Gvdiff, :Ghdiff commands for unified diff view
Compares current buffer against any git revision (default HEAD), opens result
with full diffs.nvim syntax highlighting. Follows fugitive convention:
:Gdiff/:Gvdiff open vertical split, :Ghdiff opens horizontal split.
2026-02-04 19:52:17 -05:00