Ejemplo n.º 1
0
 def _hide_buffer(self, name, delete=True):
     buffer = lisp.get_buffer(name)
     if buffer is not None:
         window = lisp.get_buffer_window(buffer)
         if window is not None:
             lisp.bury_buffer(buffer)
             if delete:
                 lisp.delete_window(window)
             else:
                 if lisp.buffer_name(lisp.current_buffer()) == name:
                     lisp.switch_to_buffer(None)
Ejemplo n.º 2
0
def complete_py():
    thing, start = thing_at_point()
    lisp.message(thing)
    text, matches = ip.complete(thing)
    lisp.switch_to_buffer("*pytexipy*")
    lisp.kill_buffer(lisp.get_buffer("*pytexipy*"))
    lisp.switch_to_buffer_other_window("*pytexipy*")
    lisp.insert(thing)
    for item in matches:
        lisp.insert(item)
        lisp.insert("\n")
Ejemplo n.º 3
0
def pick_method():
    '''
    pick the whole line from the list of function calls (completions)
    '''
    print "in pick method"
    thing, start = thing_at_point(RIGHT2, LEFT2)
    prev_buffer = os.environ['BUFFER']
    print "-"+prev_buffer+"-"
    lisp.kill_buffer(lisp.get_buffer("*PyJde*"))
    lisp.switch_to_buffer(prev_buffer)
    lisp.insert(thing)
    pos = lisp.point()
    print "pos="+(str(pos-1))
    lisp.goto_char(pos-1)
    lisp.delete_other_windows()
Ejemplo n.º 4
0
def pick_import():
    '''
    pick the whole line from the list of imports
    '''
    print "in pick import"
    thing, start = thing_at_point_regex("\n", "\n")
    prev_buffer = os.environ['BUFFER']
    print "-"+prev_buffer+"-"
    lisp.kill_buffer(lisp.get_buffer("*PyJde*"))
    lisp.switch_to_buffer(prev_buffer)

    remember_where = lisp.point()
    content = lisp.buffer_substring(1, lisp.point())    
    insert_where = re.search("package\s.*;", content).span()[1]
    lisp.goto_char(insert_where + 1)
    lisp.insert("\n\nimport " + thing + ";")
    lisp.message(thing + " is imported")
    lisp.goto_char(remember_where)

    lisp.delete_other_windows()