Skip to content

Commit

Permalink
Solution for issues 105
Browse files Browse the repository at this point in the history
  • Loading branch information
CesarGuzmanLopez authored Jan 23, 2023
1 parent 98740c7 commit b018c73
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions lua/true-zen/ataraxis.lua
Original file line number Diff line number Diff line change
Expand Up @@ -234,23 +234,24 @@ end

function M.off()
data.do_callback("ataraxis", "close", "pre")

local cursor_pos
if api.nvim_win_is_valid(win.main) then
if pcall(function() api.nvim_win_is_valid(win.main) end) and api.nvim_win_is_valid(win.main) then
if win.main ~= api.nvim_get_current_win() then
fn.win_gotoid(win.main)
end
cursor_pos = fn.getpos(".")
else
data.do_callback("ataraxis", "close", "pos")
return 1 -- already off
end

cmd("only")

if fn.filereadable(fn.expand("%:p")) == 1 then
cmd("q")
pcall(function () pcall(cmd("q")) end)
end

require("true-zen.minimalist").off()

for k, v in pairs(original_opts) do
for k, v in pairs(original_opts) do
if k ~= "highlights" then
o[k] = v
end
Expand Down

0 comments on commit b018c73

Please sign in to comment.