cdelledonne / vim-cmake

Vim/Neovim plugin for working with CMake projects
MIT License
259 stars 21 forks source link

Everytime CMakeToggle is triggered, origin buffer lose syntax highlight #86

Closed gzqx closed 11 months ago

gzqx commented 11 months ago

Bug description

~~After triggering :CMakeGenerate first time in every session, all text in origin buffer become white and have no highlight. (If I reopen the file in the same buffer or run syntax on, do some editing and re-run :CMakeGenerate, this does not happen)~~

After testing, this behavior is actually triggered by everytime :CMakeToggle is triggered. It seems that on first :CMakeGenerate or everytime :CMakeRun is ran in text buffer :CMakeToggle is called. (Sorry I didn't have the time to dig into the code to check if it is true)

Expected behavior

Hightlight does not disappear from the first time.

Behavior with minimal .vimrc

Same behavior with a minimal .vimrc as following:

set nocompatible
let &runtimepath  = '~/.vim/bundle/vim-cmake,' . &runtimepath
filetype plugin indent on
syntax enable

Other info

gzqx commented 11 months ago

Same also happens when running :CMakeRun for the first time.

cdelledonne commented 11 months ago

Hi, thanks a lot for reporting this.

I can indeed reproduce your issue. I believe PR #87 fixes it. Could you please try checking out branch 86-cmake-open-clears-syntax-hl and let me know if that indeed solves your problem?

gzqx commented 11 months ago

Hi, thank your for the so timely fix! I have verified that the 86-*** branch fixes this issue.