Skip to content

Commit

Permalink
resolve headless neovim failing: move nvim_list_uis to run on demand
Browse files Browse the repository at this point in the history
  • Loading branch information
pfeiferj committed Mar 13, 2023
1 parent e22d346 commit 3a34efe
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lua/hurl/hurl.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
local M = {}
local gheight = vim.api.nvim_list_uis()[1].height
local gwidth = vim.api.nvim_list_uis()[1].width

function M.hurl()
local gheight = vim.api.nvim_list_uis()[1].height
local gwidth = vim.api.nvim_list_uis()[1].width
local file = vim.fn.expand("%")
local buf = vim.api.nvim_create_buf(false, true)
local width = gwidth - 10
Expand All @@ -25,6 +25,8 @@ function M.hurl()
end

function M.hurl_no_color()
local gheight = vim.api.nvim_list_uis()[1].height
local gwidth = vim.api.nvim_list_uis()[1].width
local h = io.popen("hurl " .. vim.fn.expand("%") .. " 2>&1")
if h then
h:flush()
Expand Down

0 comments on commit 3a34efe

Please sign in to comment.