Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions lua/toggleterm/terminal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -233,14 +233,20 @@ function Terminal:__add()
return self
end

function Terminal:is_float() return self.direction == "float" and ui.is_float(self.window) end
function Terminal:is_float()
return self.direction == "float"
and (not self.window or ui.is_float(self.window))
end

function Terminal:is_split()
return (self.direction == "vertical" or self.direction == "horizontal")
and not ui.is_float(self.window)
and not (self.window and ui.is_float(self.window))
end

function Terminal:is_tab() return self.direction == "tab" and not ui.is_float(self.window) end
function Terminal:is_tab()
return self.direction == "tab"
and not (self.window and ui.is_float(self.window))
end

function Terminal:resize(size)
if self:is_split() then ui.resize_split(self, size) end
Expand Down