Comments (14)
@machakann dein.vim 使ってますか?であればおそらく dein 側の問題です。
http://lingr.com/room/vim/archives/2016/03/22#message-23152069
from caw.vim.
dein 側の問題であることを確認したら閉じます。
from caw.vim.
dein.vim は使っていません、neobundle.vim を使っています。こちらも同様でしょうか?
from caw.vim.
neobundle ユーザからの報告は初めてですが、おそらく同じ問題が起きます。
https://github.com/Shougo/neobundle.vim/blob/d4e76e8230f73949534920c52b4b9d85763ba11f/autoload/neobundle/config.vim#L731-L732
from caw.vim.
ありがとうございます。該当行が :set filetype=xxx
相当になって同様のオートコマンドイベントが登録されているということでしょうか。たしかに、それかもしれません。
閉じるタイミングはお任せします。
from caw.vim.
すいません、ヘルプの件は関係ないことに気が付きました。どうもマークダウンを編集中に再現します。オートコマンドも関係ないですね。
起きる場合は b:undo_ftplugin
の内容が
setlocal commentstring< matchpairs< omn..< comments< formatoptions< | unlet! b:match_ignorecase b:match_skip b:match_wo..:browsefilter | unlet b:caw_wrap_oneline_comment|setl cms< com< fo< flp< | unlet b:caw_wrap_oneline_comment
のように unlet b:caw_wrap_oneline_comment
が重複していました。ファイルタイププラグインが再読み込みされるのはあり得ることのように思えるので、:help write-filetype-plugin
にあるように重複を防止するのはいかがでしょうか?
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
b:did_ftplugin
ではなく独自の名前にする必要はあるかもしれませんが。何か勘違いがあるかもしれませんので、その場合は教えてください。
from caw.vim.
再現方法が分かりました。プラグインマネージャの問題でもないように思います。
- 適当なマークダウンファイル
foo.md
を作る (touch foo.md
) vim -u NONE -N
:filetype plugin on
:set rtp+=/path/to/caw.vim,/path/to/caw.vim/after
:edit foo.md
:edit
6 でバッファを開きなおすとタイトルのエラーが出ます。
5 を :15verbose edit foo.md
に置き換えて出力を眺めていたところ、マークダウンのファイルタイププラグインが html のファイルタイププラグインを読み込むために問題が起こっていることに気が付きました。このために after/html/caw.vim
と after/markdown/caw.vim
が読み込まれています。
after/markdown/caw.vim
が後に読み込まれるので単純に b:did_ftplugin
のような仕組みでも問題が出るようです。すいません、上で適当なことを言いました。
let b:caw_wrap_oneline_comment = ['something', 'something']
の後に finish
するか、b:undo_ftplugin
に重複が出ないような仕組みが必要そうです。
from caw.vim.
ありがとうございます。Lingr でも同様の指摘を受けました。
caw.vim 側で修正します。
from caw.vim.
@machakann #47 でPRを出しました。fix/dup-entries-undo_ftplugin
ブランチに切り替えて試して頂けますか?
from caw.vim.
fix/dup-entries-undo_ftplugin
ブランチでエラーが出なくなるのを確認しました。
ただ、これだと after/html/caw.vim
が b:caw_wrap_oneline_comment
を先に設定して after/markdown/caw.vim
が読み込まれるのをブロックするので、マークダウンの場合はいいですが他の場合で問題が出そうな気がします。 b:caw_wrap_oneline_comment
などはあとに読み込まれるものに上書かれたほうが良いのではないでしょうか?
from caw.vim.
なるほど。ありがとうございます。修正します。
from caw.vim.
@machakann 修正しました。
from caw.vim.
master にもマージしてあります。
from caw.vim.
ありがとうございました!
from caw.vim.
Related Issues (20)
- JSON "comments"
- Toggle does not work when using nvim-tree-sitter
- Comments in vue file inconsistent after first template element HOT 1
- Can't comment blank line with default configuration g:caw_hatpos_skip_blank_line = 0
- Doesn't comment current line when lazy loading it and set remembering last cursor location
- how can i use it? HOT 1
- toggle caw error HOT 2
- Join undo history when inserting comment
- Join repeat history when inserting comment
- weird case with context filetype
- fileType=dosbatchの時、トグルとコメント解除が動作しない
- "Press Enter or type command to continue" prompt at uncomment multi lines
- Use `#` instead of `"` in Vim9 script HOT 2
- Incorrect comments for 'typesriptreact'
- uncomment work unexpectly when single line has multi warp comment
- E117: Unknown function: caw#keymapping_stub
- [feature] b:caw_dollarpos_sp_left HOT 1
- caw.vim can't works well with treesitter HOT 1
- Error on uncomment HOT 1
- caw.vim can't works well in markdown file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from caw.vim.