qvacua / vimr

VimR — Neovim GUI for macOS in Swift
https://twitter.com/VimRefined
MIT License
6.66k stars 218 forks source link

Command+s save crash #1054

Closed 280838224 closed 5 months ago

280838224 commented 5 months ago

Hello developer, I have configured PHP syntax checking in init.vim, but this will cause vimr to crash when command+s is saved. Can this solve the problem?

let g:PHP_SYNTAX_CHECK_BIN = '/usr/local/opt/php@7.4/bin/php'

autocmd BufWritePost *.php call PHPSyntaxCheck()

if !exists('g:PHP_SYNTAX_CHECK_BIN')
    let g:PHP_SYNTAX_CHECK_BIN = 'php'
endif

function! PHPSyntaxCheck()
    try
        let result = system(g:PHP_SYNTAX_CHECK_BIN.' -l -n '.expand('%'))
        if (stridx(result, 'No syntax errors detected') == -1)
            echohl WarningMsg | echo result | echohl None
        endif
    catch /E\:\ .*/
        echohl ErrorMsg | echo "执行PHP语法检查时出错: " . v:exception | echohl None
    endtry
endfunction
280838224 commented 5 months ago

After verification, it seems that it is not an issue with this configuration, but rather a crash caused by other unused plugins