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

add g:gist_update_on_write and its help #112

Merged
merged 2 commits into from Jan 7, 2013
Merged

add g:gist_update_on_write and its help #112

merged 2 commits into from Jan 7, 2013

Conversation

tyru
Copy link
Contributor

@tyru tyru commented Jan 6, 2013

変数g:gist_update_on_writeとそのhelpを追加しました。
1の時は:w:w!両方で更新します。
2の時は:w!`でのみ更新します。
デフォルト値は1(これまでと同じ挙動)です。

@mattn
Copy link
Owner

mattn commented Jan 7, 2013

2の時に :w すると空振りするって事でしょうか?

@tyru
Copy link
Contributor Author

tyru commented Jan 7, 2013

すみません、言うの忘れてました。

2の時に :w すると空振りするって事でしょうか?

はい、意図的に空振りするようにしています。
その方がポストしてないことがわかっていいかなと自分は思いました。
(一度:else:setlocal nomodifiedするようにしてみたんですが、
ポストしてるんだかしてないんだか分からなくてちょっと混乱しました)

@mattn
Copy link
Owner

mattn commented Jan 7, 2013

逆に一時的に nomodifiable にしてエラーを起こさせるというのではダメですか?

@tyru
Copy link
Contributor Author

tyru commented Jan 7, 2013

あ、それがよさそうです。
ちょっとやってみます。

@mattn
Copy link
Owner

mattn commented Jan 7, 2013

というか、2の時にbangじゃなかったらthrow EXXX で良いかも

@tyru
Copy link
Contributor Author

tyru commented Jan 7, 2013

こんな感じでどうでしょうか。
throwだとロケールにあったエラーメッセージにできないので、:setlocal nomodifiableする方法でやってみました。

mattn added a commit that referenced this pull request Jan 7, 2013
add g:gist_update_on_write and its help
@mattn mattn merged commit 2196bfb into mattn:master Jan 7, 2013
@mattn
Copy link
Owner

mattn commented Jan 7, 2013

あざます。

@tyru
Copy link
Contributor Author

tyru commented Jan 7, 2013

こちらこそありがとうございます!

@tyru tyru deleted the update-on-write branch January 7, 2013 12:11
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

Successfully merging this pull request may close these issues.

None yet

2 participants