From fed85aa9c948dbff083e30212f8b568f03daa58f Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Thu, 29 Feb 2024 17:21:05 +0000 Subject: [PATCH] feat: Updated lua/hurl/main.lua --- lua/hurl/main.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lua/hurl/main.lua b/lua/hurl/main.lua index e5aa5f2..4a98f97 100644 --- a/lua/hurl/main.lua +++ b/lua/hurl/main.lua @@ -353,7 +353,11 @@ function M.setup() ) run_at_lines(result.start_line, result.end_line, opts.fargs) else - utils.log_info('hurl: not HTTP method found in the current line' .. result.start_line) + if result.start_line then + utils.log_info('hurl: not HTTP method found in the current line ' .. result.start_line) + else + utils.log_info('hurl: no HTTP method found in the current line') + end utils.notify('hurl: no HTTP method found in the current line', vim.log.levels.INFO) end end, { nargs = '*', range = true }) @@ -416,7 +420,11 @@ function M.setup() vim.cmd('copen') end) else - utils.log_info('hurl: not HTTP method found in the current line' .. result.start_line) + if result.start_line then + utils.log_info('hurl: not HTTP method found in the current line ' .. result.start_line) + else + utils.log_info('hurl: no HTTP method found in the current line') + end utils.notify('hurl: no HTTP method found in the current line', vim.log.levels.INFO) end end, { nargs = '*', range = true })