Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reader: Apply fish_color_selection fg color and options in vi visual mode #9717

Merged

Conversation

ericvw
Copy link
Contributor

@ericvw ericvw commented Apr 7, 2023

Description

Vi visual mode selection highlighting behaves unexpectedly when the selection
foreground and background in the highlight spec don't match. The following
unexpected behaviors are:

  • The foreground color is not being applied when defined by the
    fish_color_selection variable.
  • set_color options (e.g., --bold) would not be applied under the cursor
    when selection begins in the middle of the command line or when the cursor
    moves forward after visually selecting text backward.

With this change, visual selection respects the foreground color and any
set_color options are applied consistently regardless of where visual
selection begins and the position of the cursor during selection.

TODOs:

  • Changes to fish usage are reflected in user documentation/manpages.
  • Tests have been added for regressions fixed
  • User-visible changes noted in CHANGELOG.rst

…mode

Vi visual mode selection highlighting behaves unexpectedly when the selection
foreground and background in the highlight spec don't match. The following
unexpected behaviors are:

*  The foreground color is not being applied when defined by the
   `fish_color_selection` variable.
* `set_color` options (e.g., `--bold`) would not be applied under the cursor
  when selection begins in the middle of the command line or when the cursor
  moves forward after visually selecting text backward.

With this change, visual selection respects the foreground color and any
`set_color` options are applied consistently regardless of where visual
selection begins and the position of the cursor during selection.
@ridiculousfish
Copy link
Member

Thank you! Very well found for a first contribution.

@ridiculousfish ridiculousfish merged commit 4ed53d4 into fish-shell:master Apr 9, 2023
6 of 7 checks passed
@ridiculousfish ridiculousfish added this to the fish 3.7.0 milestone Apr 9, 2023
ridiculousfish added a commit that referenced this pull request Apr 9, 2023
@ericvw ericvw deleted the fish_color_selection-respect-fg branch April 9, 2023 03:32
@mqudsi mqudsi modified the milestones: fish 3.7.0, fish 3.6.2 Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants