Example #1
0
    def add(self, path, name = ''):
        "增加一个新的 project, 提供参数 path, name"
        path = libpath.realpath(path)
        if not path:
            return
        if not name:
            name = libpath.basename(path)
        if path:
            Project(path, name)

        self.listwin.refresh()
Example #2
0
def get_buffers(Node):
    names = []
    for b in vim.buffers:
        p = b.name
        if not p:
            continue

        if b.options['buftype'] != '':
            continue

        names.append(p)
    names.sort()
    for p in names:
        Node.append(frainui.Leaf(libpath.basename(p), p, leaf_handle))
    Node.need_fresh = True
Example #3
0
def Frain(path='.', name=''):
    global FrainList
    if not FrainList:
        FrainList = frain.FrainList()

    path = libpath.realpath(path)
    if not path:
        return
    if not name:
        name = libpath.basename(path)

    if path:#TODO maybe scp
        project.Project(path, name)

    FrainList.listwin.refresh()

    # add cmd
    pyvim.cmd(pyvim.complete.file)(FrainToggle)
    pyvim.cmd(pyvim.complete.file)(FrainAddInclude)