Skip to content

Instantly share code, notes, and snippets.

@zwpp
Created May 11, 2016 19:48
Show Gist options
  • Save zwpp/aa8005158d08fa0c38bd01a1b49946ba to your computer and use it in GitHub Desktop.
Save zwpp/aa8005158d08fa0c38bd01a1b49946ba to your computer and use it in GitHub Desktop.
# -*- coding: utf-8 -*-
Plugin.create(:anti_url) do
command(:anti_url_command,
name: 'URL化を回避する',
condition: lambda{ |opt| true },
visible: true,
role: :postbox) do |opt|
# postboxからメッセジ拾う
message = Plugin[:gtk].widgetof(opt.widget).widget_post.buffer.text
# dotをそれっぽい文字に変える
str = message.tr(".", "\u{2024}")
# postbox書き込み
Plugin[:gtk].widgetof(opt.widget).widget_post.buffer.text = str
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment