Changeset 1454

Show
Ignore:
Timestamp:
07/03/08 18:42:01 (5 months ago)
Author:
rob
Message:

Fixed #18: Completed basic ctags support
* modified showLine to display the line at the top of the screen

Location:
trunk/peppy
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/peppy/fundamental.py

    r1452 r1454  
    595595            line = int(url.fragment) 
    596596            line -= self.classprefs.line_number_offset 
    597             self.GotoLine(line) 
    598             self.EnsureVisible(line) 
     597            self.showLine(line) 
    599598 
    600599    ##### Comment handling 
  • trunk/peppy/plugins/cursor_movement.py

    r1384 r1454  
    126126        # stc counts lines from zero, but displayed starting at 1. 
    127127        #dprint("goto line = %d" % line) 
    128         mode.EnsureVisible(line - 1) 
    129         mode.GotoLine(line - 1) 
     128        mode.showLine(line - 1) 
    130129 
    131130 
  • trunk/peppy/plugins/project.py

    r1453 r1454  
    8383                    file = match.group(2) 
    8484                    addr = match.group(3) 
    85                     fields = match.group(4).split('\t') 
     85                    fields = match.group(4) 
    8686                    self.dprint("tag=%s file=%s addr=%s field=%s" % (tag, file, addr, str(fields))) 
    8787                    if tag not in self.tags: 
     
    175175            self.tags = self.mode.project_info.getTag(lookup) 
    176176            if self.tags: 
    177                 links = [t[0] for t in self.tags] 
     177                links = [] 
     178                for t in self.tags: 
     179                    info = '' 
     180                    fields = t[2].split('\t') 
     181                    for field in fields: 
     182                        if ':' in field: 
     183                            info += field + " " 
     184                    if info: 
     185                        info += "in " 
     186                    info += t[0] 
     187                    links.append(info) 
    178188                return links 
    179189        return [_('No suggestions')] 
     
    188198        except: 
    189199            pass 
    190         self.frame.findTabOrOpen(file) 
     200        url = self.mode.project_info.project_top_dir.resolve2(file) 
     201        self.frame.findTabOrOpen(url) 
    191202 
    192203 
     
    348359    default_menu = ("Project", -990) 
    349360 
     361    def isEnabled(self): 
     362        return bool(self.mode.project_info) 
     363     
    350364    def action(self, index=-1, multiplier=1): 
    351365        if self.mode.project_info: 
  • trunk/peppy/stcbase.py

    r1424 r1454  
    573573        # expand folding if any 
    574574        self.EnsureVisible(line) 
     575         
     576        # Make line appear at the top of the screen.  ScrollToLine doesn't seem 
     577        # to work when applied right after a GotoLine, but moving to the end 
     578        # of the document and then back does seem to put the line at the top 
     579        # of the screen 
     580        self.GotoLine(self.GetLineCount()) 
    575581        self.GotoLine(line) 
    576         self.ScrollToLine(line + self.LinesOnScreen() - 3) 
    577         self.GotoLine(line) 
     582#        dprint("After first GotoLine(%d): FirstVisibleLine = %d" % (line, self.GetFirstVisibleLine())) 
     583#        self.ScrollToLine(line + self.LinesOnScreen() - 3) 
     584#        dprint("After first ScrollToLine(%d): FirstVisibleLine = %d" % (line + self.LinesOnScreen() - 3, self.GetFirstVisibleLine())) 
     585#        self.GotoLine(line) 
     586#        dprint("After second GotoLine(%d): FirstVisibleLine = %d" % (line, self.GetFirstVisibleLine())) 
    578587        self.ScrollToColumn(0) 
    579588