rest-nvim / rest.nvim

A fast Neovim http client written in Lua
GNU General Public License v3.0
1.61k stars 142 forks source link

Fix finding the start and end of the current query. #239

Closed PhilRunninger closed 1 year ago

PhilRunninger commented 1 year ago

Fixes #173.

This isn't a treesitter solution, but it's at least a quick and easy, if only temporary, patch.

  1. start_request was searching forward from the cursor position. Adding 'b' to the search flags fixed that.
  2. Both start_request and end_request depended on the user having set 'nowrapscan' to prevent wrapping around the end of the file. Such wrapping could result in finding the wrong query. Adding 'W' to the search flags fixed that, and removed the need for the stopline parameter.
  3. Refactored the way last_line is used in end_request.