From fb574eabbd0489edc7f8ff0827e6e4955d5b3f3f Mon Sep 17 00:00:00 2001 From: takase1121 <20792268+takase1121@users.noreply.github.com> Date: Wed, 1 Sep 2021 14:36:00 +0800 Subject: [PATCH] fix splitting tabs without dragging --- data/core/rootview.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/core/rootview.lua b/data/core/rootview.lua index 573bcc64..03affc35 100644 --- a/data/core/rootview.lua +++ b/data/core/rootview.lua @@ -804,8 +804,8 @@ function RootView:on_mouse_released(button, x, y) self.dragged_divider = nil end if self.dragged_node then - local _, _, _, h = Node.get_tab_rect(self.dragged_node[1], self.dragged_node[2]) - if x < 0 or x > self.size.x or y < 0 or y > h then + local ox, oy = self:get_content_offset() + if x < ox or x > self.size.x or y < oy or y > self.size.y then local tab = self.dragged_node[1].views[self.dragged_node[2]] if tab:is(DocView) then local filename = tab.doc.abs_filename or tab.doc.filename or "unsaved"