Skip to content

Conversation

@Shtucer
Copy link

@Shtucer Shtucer commented Dec 1, 2012

Python support, some quick-fixes.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Э, зачем все это пееписывать на питон?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А затем, что у меня Vim собран с питоном, но без перла. Да и с перлом в Винде тяжко, а работать на ней иногда приходится.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Возвращаясь к разговору о переписанных на питон функциях. Переписал src_files и header_files на VimL. В принципе избавился от внешних зависимостей. Получилось вот что.

function s:cmake_project_find_files()
    let currentdir = getcwd() . '/' . g:cmake_project_build_dir
    let dependencies = globpath(currentdir, "**/DependInfo.cmake")
    let internals = globpath(currentdir, "**/depend.internal")
    let result = []
    for depend in split(dependencies)
        if filereadable(depend)
            for line in readfile(depend)
               let filename = matchlist(line, '\(^\s\+"\)\([[:graph:]]\+[.c|.cpp|.cc]\)"')
                if len(filename) > 1 && strlen(filename[2])
                   call add(result, filename[2])
                endif
            endfor
        endif
    endfor

    for internal in split(internals)
        if filereadable(internal)
            for line in readfile(internal)
                let filename = matchlist(line, '\(^\s\+\)\([[:graph:]]\+[.h|.hh|.hpp]\)')
                if len(filename) >1 && strlen(filename[2]) && match(getcwd(), filename[2]) != -1
                    call add(result, filename[2])
                endif
            endfor
        endif
    endfor
    return result
endfunction

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ужас какой 👍

Думаю алгоритм поиска файлов переписать. То что сейчас ui файлы и cmake, CMakeLists.txt файлы не добавляет в проект

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А можешь тогда питоно код убрать с проекта чтобы я смержнул?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants