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

Sweep: popup result window appear at strange position in nvim 0.10 #160

Closed

Conversation

sweep-ai[bot]
Copy link
Contributor

@sweep-ai sweep-ai bot commented May 20, 2024

Description

This pull request addresses an issue where the popup result window would appear at an unexpected position in Neovim version 0.10. The changes made ensure that the popup now consistently appears at the center of the editor, with its size being configurable through the global configuration.

Summary

  • Removed the `popup_position` configuration option from `default_config` in `lua/hurl/init.lua`, as it is no longer needed.
  • Updated the layout configuration in `lua/hurl/popup.lua` to position the popup at the center of the editor, while still allowing the size to be defined in the global configuration.
  • Adjusted the layout structure in `lua/hurl/popup.lua` for clarity and efficiency, ensuring the popup's size is correctly applied.
  • Files affected:
    • `lua/hurl/init.lua`
    • `lua/hurl/popup.lua`

Fixes #159.


💡 To get Sweep to edit this pull request, you can:

  • Comment below, and Sweep can edit the entire PR
  • Comment on a file, Sweep will only modify the commented file
  • Edit the original issue to get Sweep to recreate the PR from scratch

This is an automated message generated by Sweep AI.

Copy link
Contributor Author

sweep-ai bot commented May 20, 2024

Rollback Files For Sweep

  • Rollback changes to lua/hurl/init.lua
  • Rollback changes to lua/hurl/popup.lua

This is an automated message generated by Sweep AI.

Copy link

codesandbox bot commented May 20, 2024

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

Copy link

changeset-bot bot commented May 20, 2024

⚠️ No Changeset found

Latest commit: ec4a3cc

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@sweep-ai sweep-ai bot added the sweep label May 20, 2024
Copy link
Contributor Author

sweep-ai bot commented May 20, 2024

Sweep: PR Review

lua/hurl/init.lua

The popup_position configuration option was removed from the default_config table, eliminating the ability to set the position of popups.

Sweep Found These Issues

  • The removal of the popup_position configuration option may cause existing configurations that rely on this option to break, leading to unexpected popup positions.
  • split_position = 'right',
    split_size = '50%',
    -- Default popup options
    popup_size = {

    View Diff


lua/hurl/popup.lua

The changes restructure the Layout initialization to center the layout and specify the size separately.

Potential Issues

Sweep isn't 100% sure if the following are issues or not but they may be worth taking a look at.

  • The change to the layout initialization may cause an error if the Layout function does not support the new structure of arguments.
  • local layout = Layout(
    'center',
    Layout.Box({
    Layout.Box(popups.top, { size = {
    height = '20%',
    } }),
    Layout.Box(popups.bottom, { grow = 1 }),
    }, { dir = 'col' }),
    {
    size = _HURL_GLOBAL_CONFIG.popup_size,
    }

    View Diff


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.

popup result window appear at strange position in nvim 0.10
1 participant