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

popup result window appear at strange position in nvim 0.10 #159

Closed wenjinnn closed 2 months ago

wenjinnn commented 2 months ago

Details

Hi there, first of all thanks for build this amazing plugin. This issue is only shows with nvim 0.10, which I upgraded recently. Maybe this is relate on nui.nvim? The screenshot after running HurlRunnerAt: image

sweep-ai[bot] commented 2 months ago

🚀 Here's the PR! #160

💎 Sweep Pro: You have unlimited Sweep issues

Actions

Relevant files (click to expand). Mentioned files will always appear here. https://github.com/jellydn/hurl.nvim/blob/fccd096f555864d3de1f103622c7020224ba6246/lua/hurl/popup.lua#L1-L167 https://github.com/jellydn/hurl.nvim/blob/fccd096f555864d3de1f103622c7020224ba6246/lua/hurl/init.lua#L1-L45 https://github.com/jellydn/hurl.nvim/blob/fccd096f555864d3de1f103622c7020224ba6246/lua/hurl/utils.lua#L1-L192 https://github.com/jellydn/hurl.nvim/blob/fccd096f555864d3de1f103622c7020224ba6246/lua/hurl/main.lua#L1-L551

Step 2: ⌨️ Coding

lua/hurl/popup.lua

Update the `layout` configuration to be compatible with Neovim 0.10.
--- 
+++ 
@@ -1,13 +1,12 @@
 local layout = Layout(
-  {
-    relative = 'editor',
-    position = _HURL_GLOBAL_CONFIG.popup_position,
-    size = _HURL_GLOBAL_CONFIG.popup_size,
-  },
+  'center',
   Layout.Box({
     Layout.Box(popups.top, { size = {
       height = '20%',
     } }),
     Layout.Box(popups.bottom, { grow = 1 }),
-  }, { dir = 'col' })
+  }, { dir = 'col' }),
+  {
+    size = _HURL_GLOBAL_CONFIG.popup_size,
+  }
 )

lua/hurl/init.lua

Update the default `popup_size` configuration to use a table with `width` and `height` properties.
--- 
+++ 
@@ -3,11 +3,10 @@
   mode = 'split',
   show_notification = false,
   auto_close = true,
-  -- Default split options  
+  -- Default split options
   split_position = 'right',
   split_size = '50%',
   -- Default popup options
-  popup_position = '50%',
   popup_size = {
     width = 80,
     height = 40,

Step 3: 🔄️ Validating

Your changes have been successfully made to the branch sweep/popup_result_window_appear_at_strange_po. I have validated these changes using a syntax checker and a linter.


[!TIP] To recreate the pull request, edit the issue title or description.

This is an automated message generated by Sweep AI.

jellydn commented 2 months ago

Hi @wenjinnn I tried to reproduce but I can't reproduce the issue. I guess something with nui.nvim library and somehow they've fixed the issue.