示例#1
0
 def find_file(self, filename, readonly=False, other=False):
     if other:
         lisp.find_file_other_window(filename)
     elif readonly:
         lisp.find_file_read_only(filename)
     else:
         lisp.find_file(filename)
示例#2
0
 def find_file(self, filename, readonly=False, other=False):
     if other:
         lisp.find_file_other_window(filename)
     elif readonly:
         lisp.find_file_read_only(filename)
     else:
         lisp.find_file(filename)
示例#3
0
def show_version(num):
    print "Getting this version ago:" + str(num)
    curr_dir = os.getcwd()
    dot_git_dir = find_dot_git()
    os.chdir(dot_git_dir)

    fname = lisp.buffer_file_name()
    fdir = os.path.dirname(fname)

    # subtract the .git location from the beginning part of the
    # full path because git show does not like it
    suitable_file_for_git_show = re.sub(dot_git_dir, "", fname)

    # also get rid of the first /
    dot_git_dir = dot_git_dir.replace("\\", "/")
    print dot_git_dir
    print "suitable_file_for_git_show", suitable_file_for_git_show
    suitable_file_for_git_show = suitable_file_for_git_show.replace(dot_git_dir, "")
    print "suitable_file_for_git_show", suitable_file_for_git_show
    tmp = "/tmp"
    if "TEMP" in os.environ:
        tmp = os.environ["TEMP"]
    os.chdir(dot_git_dir)
    cmd = "git show %s~%d:%s > %s/githist-%d.dat" % (branch(), num, suitable_file_for_git_show[1:], tmp, num)
    res = run_command(cmd)
    # lisp.switch_to_buffer_other_window(cmd)
    lisp.find_file_other_window("%s/githist-%d.dat" % (tmp, num))
    os.chdir(curr_dir)
示例#4
0
def show_version(num):
    print "Getting this version ago:" + str(num)
    curr_dir = os.getcwd()
    dot_git_dir = find_dot_git()
    os.chdir(dot_git_dir)

    fname = lisp.buffer_file_name()
    fdir = os.path.dirname(fname)

    # subtract the .git location from the beginning part of the
    # full path because git show does not like it
    suitable_file_for_git_show = re.sub(dot_git_dir, "", fname)

    # also get rid of the first /
    dot_git_dir = dot_git_dir.replace("\\", "/")
    print dot_git_dir
    print "suitable_file_for_git_show", suitable_file_for_git_show
    suitable_file_for_git_show = suitable_file_for_git_show.replace(
        dot_git_dir, "")
    print "suitable_file_for_git_show", suitable_file_for_git_show
    tmp = '/tmp'
    if 'TEMP' in os.environ: tmp = os.environ['TEMP']
    os.chdir(dot_git_dir)
    cmd = "git show %s~%d:%s > %s/githist-%d.dat" % (
        branch(), num, suitable_file_for_git_show[1:], tmp, num)
    res = run_command(cmd)
    #lisp.switch_to_buffer_other_window(cmd)
    lisp.find_file_other_window("%s/githist-%d.dat" % (tmp, num))
    os.chdir(curr_dir)
示例#5
0
def show_version(num):
    print "Getting this version ago:" + str(num)
    curr_dir = os.getcwd()
    dot_git_dir = find_dot_git()    
    os.chdir(dot_git_dir)
    
    fname=lisp.buffer_file_name()
    
    # subtract the .git location from the beginning part of the 
    # full path because git show does not like it
    suitable_dir_for_git_show = re.sub(dot_git_dir, "", fname)

    # also get rid of the first / 
    suitable_dir_for_git_show = re.sub("^/", "", suitable_dir_for_git_show)

    os.chdir(os.path.dirname(suitable_dir_for_git_show))
    cmd = "git show %s~%d:%s > %s/githist-%d.dat" % (branch(),
                                                     num,
                                                     os.path.basename(suitable_dir_for_git_show),
                                                     os.environ['TEMP'],
                                                     num)
    res = run_command(cmd)
    #lisp.switch_to_buffer_other_window(cmd)
    lisp.find_file_other_window("%s/githist-%d.dat" % (os.environ['TEMP'],num))
    os.chdir(curr_dir)
示例#6
0
 def occurrences_goto_occurrence(self):
     self._check_project()
     start = lisp.line_beginning_position()
     end = lisp.line_end_position()
     line = lisp.buffer_substring_no_properties(start, end)
     tokens = line.split()
     if tokens:
         resource = self.project.get_resource(tokens[0])
         offset = int(tokens[2])
         lisp.find_file_other_window(resource.real_path)
         lisp.goto_char(offset + 1)
         lisp.switch_to_buffer_other_window('*rope-occurrences*')
示例#7
0
    def find_definition(self):
        lisp.save_some_buffers()
        filename = lisp.buffer_file_name()
        line,col = _getCoords()
        defns = brmctx.findDefinitionByCoordinates(filename,line,col)

        try:
            firstdefn = defns.next()
            lisp.find_file_other_window(firstdefn.filename)
            lisp.goto_line(firstdefn.lineno)
            lisp.forward_char(firstdefn.colno)
        except StopIteration:
            pass
        else:
            numRefs = 1
            for defn in defns:
                if numRefs == 1:
                    _switchToConsole()
                    _insertRefLineIntoConsole(firstdefn)
                _insertRefLineIntoConsole(defn)
                numRefs += 1
示例#8
0
    def find_definition(self):
        lisp.save_some_buffers()
        filename = lisp.buffer_file_name()
        line, col = _getCoords()
        defns = brmctx.findDefinitionByCoordinates(filename, line, col)

        try:
            firstdefn = defns.next()
            lisp.find_file_other_window(firstdefn.filename)
            lisp.goto_line(firstdefn.lineno)
            lisp.forward_char(firstdefn.colno)
        except StopIteration:
            pass
        else:
            numRefs = 1
            for defn in defns:
                if numRefs == 1:
                    _switchToConsole()
                    _insertRefLineIntoConsole(firstdefn)
                _insertRefLineIntoConsole(defn)
                numRefs += 1
示例#9
0
 def find_file_other_window(self, prefix):
     file = self._base_find_file(prefix)
     if file is not None:
         lisp.find_file_other_window(file.real_path)