Skip to content

Conversation

@clifinger
Copy link

Problem

git_log_file and git_log_line require a valid file buffer to work properly. Without this check, they fail with cryptic git errors when called from non-file buffers (dashboard, terminal, etc).

Solution

Add file validation to the example keybindings to:

  • Check if current buffer has a valid file path
  • Show a user-friendly warning if not in a file buffer
  • Prevent confusing git command errors

Testing

Tested in various buffer types (file, dashboard, terminal) - now shows clear warning message instead of git errors.

git_log_file and git_log_line require a valid file buffer to work.
Without this check, they fail with cryptic git errors when called
from non-file buffers (e.g., dashboard, terminal, etc).

This commit adds file validation to the example keybindings to:
- Check if current buffer has a valid file path
- Show a user-friendly warning if not
- Prevent confusing git command errors
@github-actions github-actions bot added docs size/m Medium PR (<50 lines changed) labels Dec 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs size/m Medium PR (<50 lines changed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant