From 614c72180dc0424528bec91286b8520d0daf18c2 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Sat, 21 Jan 2023 00:48:56 -0700 Subject: fix(run_nvim.py): fix bug where --float would crash with no file arguments --- run_vim.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/run_vim.py b/run_vim.py index 93f15e5..e7afd60 100755 --- a/run_vim.py +++ b/run_vim.py @@ -43,6 +43,8 @@ nvim = neovim.attach('socket', path=nvim_socket) existing_buffers = get_listed_buffers(nvim) if '--float' in sys.argv: + + float_title = filenames[0] if len(filenames) > 0 else "" nvim.command( 'call nvim_open_win(0, 1, {' + "'relative': 'editor'," + @@ -53,7 +55,7 @@ if '--float' in sys.argv: "'anchor': 'NW'," + "'style': 'minimal'," + "'border': 'single'," + - "'title': [['" + filenames[0] + "', 'Statement']]" + + "'title': [['" + float_title + "', 'Statement']]" + "})"); nvim.command("set winhighlight=Normal:Normal") else: -- cgit