feat: add context lines for preview mode with intelligent truncation

- Add --context-lines (-c) flag to control preview context display
- Add context_lines option to .shush.toml configuration
- Implement lazy-git style preview with context lines around changes
- Add intelligent truncation with "..." markers for distant changes
- Improve context line colors from dark gray to light for better visibility on dark terminals
- Support both regular and git-aware preview modes
- Default to 3 context lines, configurable via flag or config file
- Use -c 0 to show only changed lines (original behavior)
This commit is contained in:
carraes
2025-07-07 14:36:58 -03:00
parent 9109964235
commit d2dc3d8c36
4 changed files with 168 additions and 29 deletions
+1
View File
@@ -11,6 +11,7 @@ type CLI struct {
Backup bool `help:"Create backup files before modification"`
Verbose bool `help:"Show detailed output"`
PreserveLines bool `help:"Remove comments but preserve empty lines"`
ContextLines int `short:"c" help:"Number of context lines to show in preview mode (default: from config)" default:"-1"`
LLM bool `help:"Show LLM-friendly usage guide"`
ChangesOnly bool `help:"Remove comments only from git changes (staged + unstaged + untracked)"`
Staged bool `help:"Remove comments only from staged git changes"`