vim-jp / issues

有志で既知のバグや要望を検討・管理し、オフィシャルへの還元をしていきます。
https://vim-jp.org/
341 stars 11 forks source link

Batch mode で ":sign place" すると SEGV #1035

Open ichizok opened 7 years ago

ichizok commented 7 years ago

質問・報告の内容

https://github.com/thinca/vim-themis/pull/46

test.vim:

fu! Test()
  sign define TestSign texthl=SignColumn text=|
  execute 'sign place 1 line=1 name=TestSign buffer='.bufnr('%')
endfu
au VimEnter * call Test()

vim -Nu NONE -e -s -S test.vim

sign 以下のコールスタックは以下のようになり、win_line 内で ScreenLines[off] を触ろうとして SEGV します。(batch mode の時 ScreenLines == NULL)

ex_sign
  update_debug_sign
    win_update
      win_line
ichizok commented 7 years ago

sign は batch mode では必要ないのではと思うのですが、どうでしょうか。

修正案:

batch mode では ex_sign は何もしない https://github.com/vim/vim/compare/master...ichizok:fix/sign-in-batch.diff

ex コマンド定義に batch mode での実行を抑止するフラグを追加する https://github.com/vim/vim/compare/master...ichizok:fix/cmd-in-batch.diff