jellydn / hurl.nvim

Hurl.nvim is a Neovim plugin designed to run HTTP requests directly from `.hurl` files. Elevate your API development workflow by executing and viewing responses without leaving your editor.
https://gyazo.com/19492e8b5366cec3f22d5fd97a63f37a
MIT License
129 stars 14 forks source link

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

Closed sweep-ai[bot] closed 2 months ago

sweep-ai[bot] commented 2 months ago

Description

<p>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.</p>
<h1>Summary</h1>
<ul>
    <li>Removed the `popup_position` configuration option from `default_config` in `lua/hurl/init.lua`, as it is no longer needed.</li>
    <li>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.</li>
    <li>Adjusted the layout structure in `lua/hurl/popup.lua` for clarity and efficiency, ensuring the popup's size is correctly applied.</li>
    <li>Files affected:
        <ul>
            <li>`lua/hurl/init.lua`</li>
            <li>`lua/hurl/popup.lua`</li>
        </ul>
    </li>
</ul>

Fixes #159.


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

This is an automated message generated by Sweep AI.

sweep-ai[bot] commented 2 months ago

Rollback Files For Sweep

This is an automated message generated by Sweep AI.

codesandbox[bot] commented 2 months ago

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders
Open Preview

changeset-bot[bot] commented 2 months ago

⚠️ No Changeset found

Latest commit: ec4a3ccd13b1ab0c3c392d4bb7eb9a027b5e90ae

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[bot] commented 2 months ago

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.
  • https://github.com/jellydn/hurl.nvim/blob/ec4a3ccd13b1ab0c3c392d4bb7eb9a027b5e90ae/lua%2Fhurl%2Finit.lua#L9-L12 [View Diff](https://github.com/jellydn/hurl.nvim/pull/160/files#diff-091155499657d102a008776df5ce1fa19013cc6d20fc27f4cb876c5929a476bfR9-R12)

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.
  • https://github.com/jellydn/hurl.nvim/blob/ec4a3ccd13b1ab0c3c392d4bb7eb9a027b5e90ae/lua%2Fhurl%2Fpopup.lua#L20-L30 [View Diff](https://github.com/jellydn/hurl.nvim/pull/160/files#diff-8f27c3f2cca529ab40bc647326bda672682fa823f6e46613e949127457cf32b5R20-R30)