From 8334f6042a965247604dc80eb184f9b0f2bf89d6 Mon Sep 17 00:00:00 2001 From: newbieQQ Date: Thu, 11 Jun 2026 16:46:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20swap=20terminal=20split=20direction=20?= =?UTF-8?q?=E2=80=94=20wide=E2=86=92right,=20tall=E2=86=92bottom?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/keymap.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lua/keymap.lua b/lua/keymap.lua index 9fb0071..0cfca1a 100644 --- a/lua/keymap.lua +++ b/lua/keymap.lua @@ -38,15 +38,15 @@ G.map({ { 'n', '', ':vertical resize +5' }, }) --- 终端 / Reasonix:根据窗口宽高自适应分屏方向(横屏→下方,竖屏→右侧) +-- 终端 / Reasonix:横屏→右侧,竖屏→下方 do local function split_term(ui, cmd) - local wide = ui.width > ui.height + local tall = ui.height > ui.width local term = require('toggleterm.terminal').Terminal:new({ - direction = wide and 'horizontal' or 'vertical', + -- 横屏→右侧(垂直分屏);竖屏→下方(水平分屏) + direction = tall and 'horizontal' or 'vertical', cmd = cmd, - -- 横屏→高度 10 行;竖屏→宽度 ≈ nvimtree(30 列) - size = wide and 10 or math.floor(ui.width * 0.3), + size = tall and 10 or math.floor(ui.width * 0.3), }) term:toggle() end