From 51cb76e2279ed48359701616efe1d12ed7f542ee Mon Sep 17 00:00:00 2001 From: adamnew123456 Date: Mon, 23 Feb 2026 22:09:46 -0500 Subject: [PATCH] Enable nvim_ghost_use_script on Windows There's no obvious reason to disable this, and it helps when debugging since you can use a local binary.py instead of the compiled version from GitHub. --- autoload/nvim_ghost/helper.vim | 14 ++++++-------- plugin/nvim_ghost.vim | 7 ------- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/autoload/nvim_ghost/helper.vim b/autoload/nvim_ghost/helper.vim index ecf46f9..7fcd1c2 100644 --- a/autoload/nvim_ghost/helper.vim +++ b/autoload/nvim_ghost/helper.vim @@ -80,18 +80,16 @@ function! s:send_GET_request(url) abort "{{{1 endfunction function! nvim_ghost#helper#start_server() abort " {{{1 - if has('win32') + if g:nvim_ghost_use_script + call jobstart( + \[g:nvim_ghost_python_executable, g:nvim_ghost_script_path], + \s:joblog_arguments_nokill + \) + elseif has('win32') call jobstart(['cscript.exe', \g:nvim_ghost_scripts_dir . 'start_server.vbs']) else - if g:nvim_ghost_use_script - call jobstart( - \[g:nvim_ghost_python_executable, g:nvim_ghost_script_path], - \s:joblog_arguments_nokill - \) - else call jobstart([g:nvim_ghost_binary_path], s:joblog_arguments_nokill) - endif endif endfunction diff --git a/plugin/nvim_ghost.vim b/plugin/nvim_ghost.vim index dd88f9c..94bfe2d 100644 --- a/plugin/nvim_ghost.vim +++ b/plugin/nvim_ghost.vim @@ -33,13 +33,6 @@ let $GHOSTTEXT_SERVER_PORT = g:nvim_ghost_server_port " Abort if script_mode is enabled but infeasible if g:nvim_ghost_use_script - if has('win32') - echohl WarningMsg - echom 'Sorry, g:nvim_ghost_use_script is currently not available on - \ Windows. Please remove it from your init.vim to use nvim-ghost.' - echohl None - finish - endif if !exists('g:nvim_ghost_python_executable') echohl WarningMsg echom 'Please set g:nvim_ghost_python_executable