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

Make :OpenGitHubIssue and :OpenGitHubPullReq look under the cursor #20

Merged
merged 3 commits into from
May 26, 2017

Conversation

rhysd
Copy link
Contributor

@rhysd rhysd commented May 26, 2017

カーソル下が #数字 だった場合,その issue(または pull request)番号のページを開くようにしました.コード内に修正した該当 issue 番号が書いてあることが結構あって,そこを直接開きたいことが結構あったので実装しました.番号からだけでは issue か pull request か判断できないのですが,GitHub 側で適宜リダイレクトされると思うので良いかなと思っています.

一応手元では動作確認済みです with 8.0-329 on macOS 10.12

@rhysd rhysd force-pushed the issue-number-under-cursor branch 2 times, most recently from 321bd9c to dbb115b Compare May 26, 2017 09:55
@@ -180,13 +180,23 @@ function! s:cmd_open_url(args, type)
" Both '#1' and '1' are supported.
let number = matchstr(get(a:args, 0, ''), '^#\?\zs\d\+\ze$')

" If the issue number is omitted, the index of argument of repository will
" become 0 (a:args[0]), otherwise 1 (a:args[1])
let repos_arg_index = number == '' ? 0 : 1
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

すみません、==# にしておいて下さい

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

了解です

return ''
endif

" Emit first '#'
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

emit はなんか違うような。
get rid of とか prune ですかね?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

すみません Omit でした…!

@rhysd
Copy link
Contributor Author

rhysd commented May 26, 2017

Fixed.

@tyru tyru merged commit e73fa93 into tyru:master May 26, 2017
@tyru
Copy link
Owner

tyru commented May 26, 2017

ヤッター!🎉

言い忘れましたが、かなり便利みの高い PR でした!
ありがとうございます!

rhysd added a commit to rhysd/open-browser-github.vim that referenced this pull request May 28, 2017
tyru added a commit that referenced this pull request Jun 1, 2017
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