Skip to content

Add visual whitespace indicators to diff and staging views#5553

Open
themactep wants to merge 1 commit intojesseduffield:masterfrom
themactep:feature/show-whitespace
Open

Add visual whitespace indicators to diff and staging views#5553
themactep wants to merge 1 commit intojesseduffield:masterfrom
themactep:feature/show-whitespace

Conversation

@themactep
Copy link
Copy Markdown

Toggle with <c-v> to render spaces as middle dots (·) and tabs as right arrows (→ followed by dashes to fill the tab stop) in diffs, staging, patch building, and merge conflict views.

Config

  • gui.showWhitespace (default false) — enable permanently
  • keybinding.universal.toggleShowWhitespace (default <c-v>)

Implementation

  • pkg/utils/show_whitespace.go — ANSI-aware whitespace character replacement
  • pkg/gui/view_helpers.go — string-based view filtering
  • pkg/gui/tasks_adapter.go — PTY/streaming writer filter
  • pkg/gui/controllers/toggle_show_whitespace_action.go — toggle action
  • pkg/gui/context/patch_explorer_context.go — patch explorer
  • pkg/gui/context/merge_conflicts_context.go — merge conflicts
  • pkg/gui/controllers/helpers/staging_helper.go — staging views
  • pkg/gui/controllers/helpers/patch_building_helper.go — patch building
  • pkg/gui/controllers/local_commits_controller.go — custom patch panel
  • vendor/github.com/jesseduffield/gocui/view.go — lineWrap recognizes · as break point
  • pkg/utils/lines.go — WrapViewLinesToWidth recognizes · as break point

Markers render with ANSI faint (\x1b[2m) for subtle appearance.

Toggle with `<c-v>` to render spaces as middle dots (·) and tabs as
right arrows (→) in diffs, staging, patch building, and merge conflict
views. Configurable via `gui.showWhitespace`.
@themactep
Copy link
Copy Markdown
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant