Skip to content

Commit 0d22f4a

Browse files
fix: remove stylua edits
1 parent 042d6d2 commit 0d22f4a

File tree

2 files changed

+21
-20
lines changed

2 files changed

+21
-20
lines changed

lua/rest-nvim/init.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ local function load_external_payload(fileimport_string)
8383
end
8484
end
8585

86+
8687
-- @param headers table HTTP headers
8788
-- @param payload table of the form { external = bool, filename_tpl= path, body_tpl = string }
8889
-- with body_tpl an array of lines
@@ -100,7 +101,7 @@ local function splice_body(headers, payload)
100101
else
101102
lines = payload.body_tpl
102103
end
103-
local content_type = headers[utils.key(headers, "content-type")] or ""
104+
local content_type = headers[utils.key(headers,"content-type")] or ""
104105
local has_json = content_type:find("application/[^ ]*json")
105106

106107
local body = ""
@@ -152,8 +153,7 @@ rest.run_request = function(req, opts)
152153
local spliced_body = nil
153154
if not req.body.inline and req.body.filename_tpl then
154155
curl_raw_args = vim.tbl_extend("force", curl_raw_args, {
155-
"--data-binary", "@" .. load_external_payload(req.body.filename_tpl),
156-
})
156+
'--data-binary', '@'..load_external_payload(req.body.filename_tpl)})
157157
else
158158
spliced_body = splice_body(result.headers, result.body)
159159
end

lua/rest-nvim/request/init.lua

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ local function get_importfile_name(bufnr, start_line, stop_line)
2121
local fileimport_inlined
2222
fileimport_line = vim.api.nvim_buf_get_lines(bufnr, import_line - 1, import_line, false)
2323
-- check second char against '@' (meaning "dont inline")
24-
fileimport_inlined = string.sub(fileimport_line[1], 2, 2) ~= "@"
24+
fileimport_inlined = string.sub(fileimport_line[1], 2, 2) ~= '@'
2525
fileimport_string = string.gsub(fileimport_line[1], "<@?", "", 1):gsub("^%s+", ""):gsub("%s+$", "")
2626
return fileimport_inlined, fileimport_string
27+
2728
end
2829
return nil
2930
end
@@ -41,7 +42,7 @@ local function get_body(bufnr, start_line, stop_line)
4142
local inline, importfile = get_importfile_name(bufnr, start_line, stop_line)
4243
local lines -- an array of strings
4344
if importfile ~= nil then
44-
return { external = true, inline = inline, filename_tpl = importfile }
45+
return { external = true; inline = inline; filename_tpl = importfile }
4546
else
4647
lines = vim.api.nvim_buf_get_lines(bufnr, start_line, stop_line, false)
4748
end
@@ -62,7 +63,7 @@ local function get_body(bufnr, start_line, stop_line)
6263
end
6364
end
6465

65-
return { external = false, inline = false, body_tpl = lines2 }
66+
return { external = false; inline = false; body_tpl = lines2 }
6667
end
6768

6869
local function get_response_script(bufnr, start_line, stop_line)
@@ -284,9 +285,9 @@ M.buf_get_request = function(bufnr, curpos)
284285

285286
local curl_args, body_start = get_curl_args(bufnr, headers_end, end_line)
286287

287-
local host = headers[utils.key(headers, "host")] or ""
288+
local host = headers[utils.key(headers,"host")] or ""
288289
parsed_url.url = host:gsub("%s+", "") .. parsed_url.url
289-
headers[utils.key(headers, "host")] = nil
290+
headers[utils.key(headers,"host")] = nil
290291

291292
local body = get_body(bufnr, body_start, end_line)
292293

@@ -301,17 +302,17 @@ M.buf_get_request = function(bufnr, curpos)
301302
end
302303

303304
local req = {
304-
method = parsed_url.method,
305-
url = parsed_url.url,
306-
http_version = parsed_url.http_version,
307-
headers = headers,
308-
raw = curl_args,
309-
body = body,
310-
bufnr = bufnr,
311-
start_line = start_line,
312-
end_line = end_line,
313-
script_str = script_str,
314-
}
305+
method = parsed_url.method,
306+
url = parsed_url.url,
307+
http_version = parsed_url.http_version,
308+
headers = headers,
309+
raw = curl_args,
310+
body = body,
311+
bufnr = bufnr,
312+
start_line = start_line,
313+
end_line = end_line,
314+
script_str = script_str,
315+
}
315316

316317
return true, req
317318
end
@@ -392,7 +393,7 @@ M.highlight = function(bufnr, start_line, end_line)
392393
higroup,
393394
{ start_line - 1, 0 },
394395
{ end_line - 1, end_column },
395-
{ regtype = "c", inclusive = false }
396+
{ regtype = "c"; inclusive = false }
396397
)
397398

398399
vim.defer_fn(function()

0 commit comments

Comments
 (0)