Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

バッファ切り替えから戻った際にftがリセットされたままになる #7

Open
kawaz opened this issue May 25, 2016 · 4 comments

Comments

@kawaz
Copy link
Contributor

kawaz commented May 25, 2016

filetype が base_filetype から切り替わっている状態で、バッファ切り替えを行うと再表示された時に base_filetype にリセットされたままになってしまう。

既存の動作

ng

  • base_filetype が toml で、hook_add 内は vim です。
  • hook_add の中に移動した後バッファを切り替えて戻ってくると vim になっていて欲しいのにtomlに戻ってしまっています。
  • 改めて一旦tomlエリアまでカーソル移動してから入り直すとvimになります(これは当然ですが)。

期待する動作

ok

  • とりあえずで BufWinEnter 時にカーソル位置の filetype を再チェックして設定してみたら期待通りになってくれました。
@kawaz
Copy link
Contributor Author

kawaz commented May 25, 2016

ただ、修正してはみたものの『そもそも何故 BufWinLeave 時に filetype をリセットしているのか』の意図を全く理解しないまま修正しているので、わざわざ入れている処理を打ち消すようなのを追加してしまって良いのかどうか、その点の判断は出来ていません。

@osyo-manga
Copy link
Owner

ありがとうございます。

『そもそも何故 BufWinLeave 時に filetype をリセットしているのか』

これは確か
別のバッファを移動する→precious を無効にする→元のバッファに戻った際に filetype がそのまま
と、いうのを防ぐような感じです(うろ覚え

@kawaz
Copy link
Contributor Author

kawaz commented May 25, 2016

マージありがとうございます!
なるほど確かに元のバッファの預かり知らぬところで無効化されたら困りそうですもんね。

@osyo-manga
Copy link
Owner

まあだいたいそんな感じで特に深い理由はなかったかとー。
ありがとうございましたー。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants