From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.96.157.163 with SMTP id wn3csp227832qdb; Tue, 15 Apr 2014 12:11:29 -0700 (PDT) X-Received: by 10.182.75.225 with SMTP id f1mr2932857obw.66.1397589089650; Tue, 15 Apr 2014 12:11:29 -0700 (PDT) Return-Path: Received: from rubyforge.org ([50.56.192.79]) by mx.google.com with ESMTP id vj5si17129089obb.192.2014.04.15.12.11.29 for ; Tue, 15 Apr 2014 12:11:29 -0700 (PDT) Received-SPF: pass (google.com: domain of sup-talk-bounces@rubyforge.org designates 50.56.192.79 as permitted sender) client-ip=50.56.192.79; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-talk-bounces@rubyforge.org designates 50.56.192.79 as permitted sender) smtp.mail=sup-talk-bounces@rubyforge.org Received: from localhost.localdomain (localhost [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 31EB62E1E4; Tue, 15 Apr 2014 19:11:30 +0000 (UTC) Received: from mail-ob0-f175.google.com (mail-ob0-f175.google.com [209.85.214.175]) by rubyforge.org (Postfix) with ESMTP id 8D1882E11F for ; Tue, 15 Apr 2014 19:10:28 +0000 (UTC) Received: by mail-ob0-f175.google.com with SMTP id vb8so4826187obc.20 for ; Tue, 15 Apr 2014 12:10:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:from:to:subject:in-reply-to :references:date:message-id:user-agent:content-transfer-encoding; bh=BX7JH0VLUuhAKp69REjWM3+GoK2pVupImUAP1/ZlDn8=; b=JKk0eKmiCwYDrQuAWhxADFm4dZsv1Pm9pIW+/8cN+5p/Mx2e7VubLjB578iyUJcf+/ IvG9yDfoKDpyYsgfjeQtNnxzjwzO+loiP7fHt8w7+vsyuVYJgMJGaDLHY1RCsMWjaSGs wgWMVX/rD0D9HM53BSVzoGDovY6koT4444A0w+k31Y4lUxAkry3qgzFixHIizXSgdwz1 Z5ARa6swFoAlyvLgQPjgg5Z+myrqlFTwba9m8wkjl8hlYV884HxR0rkdIAVXoc6ODjnc w3Y3zZ0LEXkaopC5aetN8cDRGWb4X1njNflDVrz2/2DBoaQGOCKkFH6kbd3tLRKcYAfu 8yiw== X-Gm-Message-State: ALoCoQleOCv6gyC7X2LCTfCjqojrZw+pbXrWgeDU2WtZdogTkYUB6rb1AZPVqkF9AGqDM7K2qcsb X-Received: by 10.60.62.178 with SMTP id z18mr2842959oer.61.1397589027098; Tue, 15 Apr 2014 12:10:27 -0700 (PDT) Received: from localhost (216-177-191-101.block0.gvtc.com. [216.177.191.101]) by mx.google.com with ESMTPSA id d9sm88988059oen.3.2014.04.15.12.10.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Apr 2014 12:10:26 -0700 (PDT) From: Micah Duke To: sup-talk In-reply-to: <1397545869-sup-4820@kpad> References: <1397511511-sup-2550@ArchNemesis> <1397545869-sup-4820@kpad> Date: Tue, 15 Apr 2014 14:10:24 -0500 Message-Id: <1397588679-sup-4084@ArchNemesis> User-Agent: Sup/git Subject: Re: [sup-talk] Get text at current line in ThredViewMode X-BeenThere: sup-talk@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: User & developer discussion of Sup List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: sup-talk-bounces@rubyforge.org Errors-To: sup-talk-bounces@rubyforge.org Thanks Matthieu! Ultimately that is what I was trying to do-open URI under cursor line. I arrived at a similar solution. I will repost mine here, in case anyone else finds it helpful. class Redwood::ThreadViewMode def open_link_at_cursor BufferManager.flash "Extracting URL...#{'(turn text wrap off for better results)' if @wrap}" line_text = get_textline_at_cursor url = line_text.slice(URI::regexp) spawn "chromium","--new-window", url,[:in, :out, :err] => "/dev/null" unless !url BufferManager.flash "No URL found at cursor line" if !url end def get_textline_at_cursor self[curpos].last.last.to_s end end -Micah Excerpts from Matthieu Rakotojaona's message of 2014-04-15 13:38:15 -0500: > Hello, > > Take a look at this PR: > > https://github.com/sup-heliotrope/sup/pull/241 > > In this PR I take the text on the current line, try to extract an URI > out of it and open it with the system's xdg-open. The line you're > interested in is thread_view_mobe.rb:718. Basically a view is a list of > tuples: [color, data]. color denotes how to paint the data. The one > you're interested in is certainly :text_color. > > This PR really old, and I should work on it, but I got distracted ... > _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk