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

Wrong request section #464

Open
2 tasks done
eeeXun opened this issue Sep 17, 2024 · 2 comments
Open
2 tasks done

Wrong request section #464

eeeXun opened this issue Sep 17, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@eeeXun
Copy link

eeeXun commented Sep 17, 2024

Prerequisites

  • I am using the latest stable release of Neovim
  • I am using the latest version of the plugin

Neovim Version

v0.10.1

Operating system/version

Linux

Actual behavior

If run rest.nvim with horizontal split, :hor Rest open. And you set splitkeep to screen or topline, which will change the cursor position when necessary.

If your cursor changed, the request section may be wrong.

e.g. Suppose my cursor is on the line http://test2.com. And I set splitkeep to topline. After running :hor Rest open, the rest_nvim_result shows that I requested http://test1.com.

GET http://test1.com



























###
GET http://test2.com

Expected behavior

Maybe we should request http://test1.com first and then open/split the rest_nvim_result panel.

Steps to reproduce

Set splitkeep to screen or topline, which will change your cursor position when horizontal split. Then run :hor Rest open

Other information

No response

Repro (lazy.nvim)

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()
vim.opt.splitkeep="topline"

require("lazy.minit").repro({
    spec = {
        "rest-nvim/rest.nvim",
        {
            "nvim-treesitter/nvim-treesitter",
            build = ":TSUpdate",
            main = "nvim-treesitter.configs",
            opts = {
                ensure_installed = { "http" },
                sync_install = false,
                highlight = { enable = true },
                indent = { enable = true },
            },
        },
    },
})
@eeeXun eeeXun added the bug Something isn't working label Sep 17, 2024
@eeeXun eeeXun changed the title Wrong request setion Wrong request section Sep 17, 2024
@boltlessengineer
Copy link
Contributor

Thank you for your report.

I won’t change the behavior of :Rest open because it doesn’t run any requests, but I can change :Rest run to report the request first and then open the UI.
Will this satisfy your need?

@eeeXun
Copy link
Author

eeeXun commented Sep 17, 2024

I won’t change the behavior of :Rest open because it doesn’t run any requests,

Oh sorry. I messed up the open and run command. All my description about :hor Rest open should be substituted with :hor Rest run

but I can change :Rest run to report the request first and then open the UI.
Will this satisfy your need?

Yes, I think that should fix this problem

@boltlessengineer boltlessengineer self-assigned this Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants