Giter Club home page Giter Club logo

Comments (14)

tyru avatar tyru commented on June 16, 2024

@machakann dein.vim 使ってますか?であればおそらく dein 側の問題です。
http://lingr.com/room/vim/archives/2016/03/22#message-23152069

from caw.vim.

tyru avatar tyru commented on June 16, 2024

dein 側の問題であることを確認したら閉じます。

from caw.vim.

machakann avatar machakann commented on June 16, 2024

dein.vim は使っていません、neobundle.vim を使っています。こちらも同様でしょうか?

from caw.vim.

tyru avatar tyru commented on June 16, 2024

neobundle ユーザからの報告は初めてですが、おそらく同じ問題が起きます。
https://github.com/Shougo/neobundle.vim/blob/d4e76e8230f73949534920c52b4b9d85763ba11f/autoload/neobundle/config.vim#L731-L732

from caw.vim.

machakann avatar machakann commented on June 16, 2024

ありがとうございます。該当行が :set filetype=xxx 相当になって同様のオートコマンドイベントが登録されているということでしょうか。たしかに、それかもしれません。

閉じるタイミングはお任せします。

from caw.vim.

machakann avatar machakann commented on June 16, 2024

すいません、ヘルプの件は関係ないことに気が付きました。どうもマークダウンを編集中に再現します。オートコマンドも関係ないですね。

起きる場合は 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.

machakann avatar machakann commented on June 16, 2024

再現方法が分かりました。プラグインマネージャの問題でもないように思います。

  1. 適当なマークダウンファイル foo.md を作る (touch foo.md)
  2. vim -u NONE -N
  3. :filetype plugin on
  4. :set rtp+=/path/to/caw.vim,/path/to/caw.vim/after
  5. :edit foo.md
  6. :edit

6 でバッファを開きなおすとタイトルのエラーが出ます。

5 を :15verbose edit foo.md に置き換えて出力を眺めていたところ、マークダウンのファイルタイププラグインが html のファイルタイププラグインを読み込むために問題が起こっていることに気が付きました。このために after/html/caw.vimafter/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.

tyru avatar tyru commented on June 16, 2024

ありがとうございます。Lingr でも同様の指摘を受けました
caw.vim 側で修正します。

from caw.vim.

tyru avatar tyru commented on June 16, 2024

@machakann #47 でPRを出しました。fix/dup-entries-undo_ftpluginブランチに切り替えて試して頂けますか?

from caw.vim.

machakann avatar machakann commented on June 16, 2024

fix/dup-entries-undo_ftplugin ブランチでエラーが出なくなるのを確認しました。

ただ、これだと after/html/caw.vimb:caw_wrap_oneline_comment を先に設定して after/markdown/caw.vim が読み込まれるのをブロックするので、マークダウンの場合はいいですが他の場合で問題が出そうな気がします。 b:caw_wrap_oneline_comment などはあとに読み込まれるものに上書かれたほうが良いのではないでしょうか?

from caw.vim.

tyru avatar tyru commented on June 16, 2024

なるほど。ありがとうございます。修正します。

from caw.vim.

tyru avatar tyru commented on June 16, 2024

@machakann 修正しました。

from caw.vim.

tyru avatar tyru commented on June 16, 2024

master にもマージしてあります。

from caw.vim.

machakann avatar machakann commented on June 16, 2024

ありがとうございました!

from caw.vim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.