aboutsummaryrefslogtreecommitdiff
path: root/lua/simple-denote/search.lua
diff options
context:
space:
mode:
authorDefaultGen <gravel.justness270@slmail.me>2024-06-09 15:33:37 -0400
committerDefaultGen <gravel.justness270@slmail.me>2024-06-09 15:33:37 -0400
commit4396249bfd7b299b17d4c3e056803483fdcc039d (patch)
tree9cadabe787a415cd3d417bf463093398a24c7daf /lua/simple-denote/search.lua
parent38738a6527d2d571d149bda36e74bdb9e2f0743c (diff)
downloadsimple-denote.nvim-4396249bfd7b299b17d4c3e056803483fdcc039d.tar.gz
Removed cursed search function
Diffstat (limited to 'lua/simple-denote/search.lua')
-rw-r--r--lua/simple-denote/search.lua40
1 files changed, 0 insertions, 40 deletions
diff --git a/lua/simple-denote/search.lua b/lua/simple-denote/search.lua
deleted file mode 100644
index eab25dd..0000000
--- a/lua/simple-denote/search.lua
+++ /dev/null
@@ -1,40 +0,0 @@
-local M = {}
-
-function M.search(options)
- local width = vim.o.columns - 8
- local height = vim.o.lines - 8
-
- vim.api.nvim_open_win(
- vim.api.nvim_create_buf(false, true),
- true,
- {
- relative = 'editor',
- style = 'minimal',
- border = 'rounded',
- noautocmd = true,
- width = width,
- height = height,
- col = math.min((vim.o.columns - width) / 2),
- row = math.min((vim.o.lines - height) / 2 - 1),
- }
- )
- local file = vim.fn.tempname()
- -- This feels like the wrong way to call a script from a relative path
- local lua_file_path = debug.getinfo(1, "S").source:sub(2)
- local lua_file_dir = vim.fn.fnamemodify(lua_file_path, ":h")
- local script_path = lua_file_dir .. "/scripts/search.sh"
- if not script_path then
- error("Script not found")
- end
- vim.api.nvim_command('startinsert')
- vim.fn.termopen(script_path .. " " .. options.dir .. " > " .. file, {
- on_exit = function(jobid, data, event)
- vim.api.nvim_command('bdelete!')
- local f = io.open(file, 'r')
- local stdout = f:read('*all')
- f:close()
- os.remove(file)
- vim.api.nvim_command('edit ' .. stdout)
- end})
-end
-return M