Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
S
scripts
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Security & Compliance
Security & Compliance
Dependency List
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
weechat
scripts
Commits
3034042d
Commit
3034042d
authored
Apr 25, 2017
by
Nils Görs
Committed by
Sébastien Helleu
Apr 25, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
url_hinter.rb 0.3: add option "launcher"
parent
1d595b9b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
ruby/url_hinter.rb
ruby/url_hinter.rb
+12
-3
No files found.
ruby/url_hinter.rb
View file @
3034042d
...
...
@@ -27,6 +27,7 @@
# see also
# https://github.com/tkengo/weechat-url-hinter/blob/master/README.md
#
# v0.3 : add option "launcher"
require
'singleton'
...
...
@@ -34,7 +35,7 @@ require 'singleton'
# Register url-hinter plugin to weechat and do initialization.
#
def
weechat_init
Weechat
.
register
(
'url_hinter'
,
'Kengo Tateish'
,
'0.
2
'
,
'GPL3'
,
'Open an url in the weechat buffer to type a hint'
,
''
,
''
)
Weechat
.
register
(
'url_hinter'
,
'Kengo Tateish'
,
'0.
3
'
,
'GPL3'
,
'Open an url in the weechat buffer to type a hint'
,
''
,
''
)
Weechat
.
hook_command
(
'url_hinter'
,
'Search url strings, and highlight them, and if you type a hint key, open the url related to hint key.'
,
...
...
@@ -45,6 +46,11 @@ def weechat_init
'launch_url_hinter'
,
''
);
option
=
'launcher'
if
Weechat
.
config_is_set_plugin
(
option
)
==
0
Weechat
.
config_set_plugin
(
option
,
'open'
)
end
Weechat
.
config_get_plugin
(
option
)
Weechat
::
WEECHAT_RC_OK
end
...
...
@@ -129,7 +135,9 @@ end
# open specified url
#
def
open_url
(
url
)
Weechat
.
hook_process
(
"open
#{
url
}
"
,
10000
,
''
,
''
)
launcher
=
Weechat
.
config_get_plugin
(
'launcher'
)
Weechat
.
hook_process
(
"
#{
launcher
}
#{
url
}
"
,
10000
,
''
,
''
)
end
#----------------------------
...
...
@@ -173,7 +181,8 @@ class Hint
end
def
open_all_reserved_url
Weechat
.
hook_process
(
"open
#{
@open_target_urls
.
join
(
' '
)
}
"
,
10000
,
''
,
''
)
if
@open_target_urls
.
any?
launcher
=
Weechat
.
config_get_plugin
(
'launcher'
)
Weechat
.
hook_process
(
"
#{
launcher
}
#{
@open_target_urls
.
join
(
' '
)
}
"
,
10000
,
''
,
''
)
if
@open_target_urls
.
any?
end
def
has_key?
(
key
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment