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
977 stars 43 forks source link

Provide an option to disable print() in resize-mode.lua? #19

Closed Frederick888 closed 2 years ago

Frederick888 commented 2 years ago

Without any special overriding of vim.notify(), [1][2] just appear to be two duplicate lines when cmdheight > 1.

I wonder if it's ok to remove the print() calls? Or if this was intentional, can we have an option to suppress it? Thank you.

[1] https://github.com/mrjones2014/smart-splits.nvim/blob/884172034a55ef4ee4fdddc0a1cbb09c767ac032/lua/smart-splits/resize-mode.lua#L26-L27 [2] https://github.com/mrjones2014/smart-splits.nvim/blob/884172034a55ef4ee4fdddc0a1cbb09c767ac032/lua/smart-splits/resize-mode.lua#L43-L44

mrjones2014 commented 2 years ago

require('smart-splits').setup({ resize_mode_silent = true })

Frederick888 commented 2 years ago

@mrjones2014 That triggers an early return and then nothing gets printed to the command area. I still want the message, but just one line instead of two duplicate lines... 😅

mrjones2014 commented 2 years ago

I guess I'm confused 😅

You want a vim.notify or a print but not both? Is that what you're saying?

Frederick888 commented 2 years ago

@mrjones2014 Yes. Currently they look like this in my Neovim (cmdheight = 2):

image

And if I set cmdheight to 1:

image

mrjones2014 commented 2 years ago

Oh, it should only print once. It's only printing once for me, regardless of cmdheight.

How are you triggering it? Can you share your config?

Frederick888 commented 2 years ago

Minimal vimrc:

set runtimepath^=~/.vim runtimepath+=~/.vim/after
let &packpath = &runtimepath

call plug#begin('~/.vim/plugged')
Plug 'mrjones2014/smart-splits.nvim'
call plug#end()

set nocompatible
set updatetime=300
set cmdheight=2

I started persistent mode by directly :SmartResizeMode.

Neovim version:

NVIM v0.7.0
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by builduser

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info
mrjones2014 commented 2 years ago

Ah, I think I just didn't realize because I'm using a notifications plugin for Neovim. Without one, vim.notify and print both go to the command area.

I'll remove the print and leave just the vim.notify.