Example #1
0
 def run(self, edit):
     curNode = db.Get().AtInView(self.view)
     if (curNode and type(curNode) != node.OrgRootNode
             and curNode._index > 1):
         sp = self.view.text_point(curNode.start_row, 0)
         ep = self.view.text_point(curNode.local_end_row, 0)
         r = self.view.line(ep)
         reg = sublime.Region(sp, r.end() + 1)
         nodetext = self.view.substr(reg)
         sublime.set_clipboard(nodetext)
         nvi.TestAndSetClip(self.view, nodetext)
Example #2
0
 def run(self, edit):
     if (self.view.match_selector(self.view.sel()[0].begin(),
                                  "orgmode.link")):
         pt = self.view.sel()[0].end()
         links = self.view.find_by_selector("orgmode.link")
         hrefs = self.view.find_by_selector("orgmode.link.href")
         reg = None
         for link in links:
             line = self.view.line(link.begin())
             if (line.contains(pt)):
                 for href in hrefs:
                     if (line.contains(href.begin())):
                         reg = href
                         break
                 break
         if (reg):
             nodetext = self.view.substr(reg)
             sublime.set_clipboard(nodetext)
             nvi.TestAndSetClip(self.view, nodetext)
 def run(self, edit):
     link = CreateLink(self.view)
     sublime.set_clipboard(link)
     nvi.TestAndSetClip(self.view, link)