-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from mistweaverco/feat/external-processing-of-…
…request Feature: Add metatags and add ability to process responses externally
- Loading branch information
Showing
8 changed files
with
90 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
stds.nvim = { | ||
read_globals = { "jit" }, | ||
} | ||
|
||
std = "lua51+nvim" | ||
|
||
read_globals = { | ||
"vim", | ||
} | ||
|
||
globals = { | ||
"vim.g", | ||
"vim.b", | ||
"vim.w", | ||
"vim.o", | ||
"vim.bo", | ||
"vim.wo", | ||
"vim.go", | ||
"vim.env", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
local FS = require("kulala.utils.fs") | ||
|
||
local M = {} | ||
|
||
M.env_stdin_cmd = function(cmdstring, contents) | ||
local cmd = {} | ||
local splitted = vim.split(cmdstring, " ") | ||
local env_name = splitted[1] | ||
local cmd_exists = FS.command_exists(splitted[2]) | ||
if not cmd_exists then | ||
vim.notify("env_stdin_cmd --> Command not found: " .. cmd[2] .. ".", vim.log.levels.ERROR) | ||
return | ||
end | ||
table.remove(splitted, 1) | ||
for _, token in ipairs(splitted) do | ||
table.insert(cmd, token) | ||
end | ||
local res = vim.system(cmd, { stdin = contents, text = true }):wait().stdout | ||
if res == nil then | ||
vim.notify("env_stdin_cmd --> Command failed: " .. cmd[2] .. ".", vim.log.levels.ERROR) | ||
return | ||
else | ||
vim.env[env_name] = res | ||
end | ||
end | ||
|
||
M.stdin_cmd = function(cmdstring, contents) | ||
local cmd = {} | ||
for token in string.gmatch(cmdstring, "[^%s]+") do | ||
table.insert(cmd, token) | ||
end | ||
local cmd_exists = FS.command_exists(cmd[1]) | ||
if not cmd_exists then | ||
vim.notify("stdin_cmd --> Command not found: " .. cmd[1] .. ". Returning plain contents..", vim.log.levels.ERROR) | ||
return contents | ||
end | ||
local res = vim.system(cmd, { stdin = contents, text = true }):wait().stdout | ||
return res | ||
end | ||
|
||
return M |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "kulala.nvim", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"scripts": { | ||
"docs": "docsify serve docs" | ||
}, | ||
|