mrjones2014 / smart-splits.nvim

🧠 Smart, seamless, directional navigation and resizing of Neovim + terminal multiplexer splits. Supports tmux, Wezterm, and Kitty. Think about splits in terms of "up/down/left/right".
MIT License
996 stars 43 forks source link

[Bug]: Can't exit resize mode second time if <Esc> is mapped #232

Open bingo084 opened 3 months ago

bingo084 commented 3 months ago

Similar Issues

Neovim Version

NVIM v0.10.1
Build type: Release
LuaJIT 2.1.1723675123
Run "nvim -V1 -v" for more info

Multiplexer Integration

Kitty

Multiplexer Version

kitty 0.36.0 created by Kovid Goyal

Steps to Reproduce

  1. Enter resize mode
  2. Press <Esc> to exit resize mode
  3. Enter resize mode again
  4. Press <Esc> to exit resize mode again, failed

Expected Behavior

Exit resize mode normally.

Actual Behavior

Stuck in resize mode, unable to exit.

Minimal Configuration to Reproduce

local root = vim.fn.fnamemodify('./.repro', ':p')

-- set stdpaths to use .repro
for _, name in ipairs({ 'config', 'data', 'state', 'cache' }) do
  vim.env[('XDG_%s_HOME'):format(name:upper())] = root .. '/' .. name
end

-- bootstrap lazy
local lazypath = root .. '/plugins/lazy.nvim'
if not vim.loop.fs_stat(lazypath) then
  vim.fn.system({
    'git',
    'clone',
    '--filter=blob:none',
    '--single-branch',
    'https://github.com/folke/lazy.nvim.git',
    lazypath,
  })
end
vim.opt.runtimepath:prepend(lazypath)

-- install plugins
local plugins = {
  -- do not remove the colorscheme! it makes testing nicer
  'folke/tokyonight.nvim',
  'mrjones2014/smart-splits.nvim',
  -- add any other pugins here
}

require('lazy').setup(plugins, {
  root = root .. '/plugins',
})

require('smart-splits').setup({
  -- add any options here
})

vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<cr>')
vim.keymap.set('n', '<A-r>', require('smart-splits').start_resize_mode)

-- add anything else here
vim.opt.termguicolors = true
-- do not remove the colorscheme! it makes testing nicer
vim.cmd([[colorscheme tokyonight]])

Additional Details and/or Screenshots

No response

leg7 commented 1 week ago

I have the same problem