Skip to content

Instantly share code, notes, and snippets.

@cobodo
Created November 6, 2018 05:39
Show Gist options
  • Save cobodo/b621cd4bda8dc42c64a2fd50a2dfacb9 to your computer and use it in GitHub Desktop.
Save cobodo/b621cd4bda8dc42c64a2fd50a2dfacb9 to your computer and use it in GitHub Desktop.
tl_slugに含まれるメッセージのうちdescriptionにfooを含むものを探してその位置までスクロールするmikutterコンソールスニペット
tl_slug = :extract_1234567890
keyword = 'foo'
inner_tl = Plugin[:gtk].widgetof(Plugin::GUI::Timeline.cuscaded[tl_slug])
target_path = nil
inner_tl.model.each do |model, path, iter|
desc = iter[Gtk::TimeLine::InnerTL::MESSAGE].description
if desc.scan(keyword).size > 0
target_path = path
break
end
end
inner_tl.scroll_to_cell(target_path, nil, false, 0.0, 0.0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment