summaryrefslogtreecommitdiff
path: root/run_vim.py
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-01-21 00:48:56 -0700
committerJosh Rahm <joshuarahm@gmail.com>2023-01-21 00:50:22 -0700
commit614c72180dc0424528bec91286b8520d0daf18c2 (patch)
tree2fb3dc1758097b086e0b91cf623b843ec2e33c71 /run_vim.py
parent79fbfe964e3770ffec7c60bd2a6ed326e92504b5 (diff)
downloadconfig.vim-614c72180dc0424528bec91286b8520d0daf18c2.tar.gz
config.vim-614c72180dc0424528bec91286b8520d0daf18c2.tar.bz2
config.vim-614c72180dc0424528bec91286b8520d0daf18c2.zip
fix(run_nvim.py): fix bug where --float would crash with no file arguments
Diffstat (limited to 'run_vim.py')
-rwxr-xr-xrun_vim.py4
1 files changed, 3 insertions, 1 deletions
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: