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

fix(layout_strategies): odd flex layout default behavior #3148

Merged
merged 1 commit into from
Jun 15, 2024
Merged

fix(layout_strategies): odd flex layout default behavior #3148

merged 1 commit into from
Jun 15, 2024

Conversation

ronandalton
Copy link
Contributor

Description

This PR fixes an issue with the flex layout by changing the default values for flip_columns and flip_lines to match the preview_cutoff values for the horizontal and vertical layouts. This should improve the user experience for users who have their default layout set to 'flex'. See the issue description linked below for more information.

Fixes #3138

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

The change implemented in this PR was tested using the following two tests:

  • Test A: Set default layout_strategy to 'flex' with no additional configuration. Run :Telescope live_grep and resize window. Observe that layout changes to vertical when width < 120 given height >= 40.
  • Test B: Set default layout_strategy to 'flex' and layout_config.horizontal.preview_cutoff and layout_config.vertical.preview_cutoff to custom values. Run :Telescope live_grep and resize window. Observe that layout changes to vertical when the window size matches the preview_cutoff values set.

Configuration:

  • Neovim version (nvim --version): NVIM v0.10.0
  • Operating system and version: Linux 6.8.1

Checklist:

  • My code follows the style guidelines of this project (stylua)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (lua annotations)

@Conni2461
Copy link
Member

yep that is actually a problem, good catch and thanks for the fix :)

@Conni2461 Conni2461 merged commit 19584e6 into nvim-telescope:master Jun 15, 2024
12 checks passed
@ronandalton ronandalton deleted the fix-flex-layout-defaults branch June 16, 2024 02:36
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.

Odd default behavior with flex layout when resizing horizontally
2 participants