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
831 stars 33 forks source link

[Bug]: mapping of <esc> key not restored for all windows #216

Open beatmax opened 1 month ago

beatmax commented 1 month ago

Similar Issues

Neovim Version

v0.10.0

Multiplexer Integration

I don't use one

Multiplexer Version

No response

Steps to Reproduce

  1. Open some file with nvim
  2. Open the quickfix window: :copen
  3. Resize it with resize mode: :lua require('smart-splits').start_resize_mode()
  4. Move back to the editor window: <C-w>k -- or close the quickfix window: :cclose
  5. Search some text, it will be highlighted
  6. Press <esc>

Expected Behavior

The mapping set in init.lua is restored for the main editor window -> highlighting of searched text is cleared.

Actual Behavior

The mapping is not restored for this window. If you move back to the quickfix window, it works there, so it was restored for that window.

Minimal Configuration to Reproduce

local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then
  vim.fn.system({
    "git",
    "clone",
    "--filter=blob:none",
    "https://github.com/folke/lazy.nvim.git",
    "--branch=stable", -- latest stable release
    lazypath,
  })
end
vim.opt.rtp:prepend(lazypath)

local plugins = {
  'folke/tokyonight.nvim',
  'mrjones2014/smart-splits.nvim',
}
require("lazy").setup(plugins, {})

vim.keymap.set('n', '<Esc>', ':noh<cr>', { noremap = true })

vim.opt.termguicolors = true
vim.cmd([[colorscheme tokyonight]])

Additional Details and/or Screenshots

No response