Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

last entry skipped if not called from empty buffer for non-file lists #44

Open
Grueslayer opened this issue Aug 15, 2018 · 0 comments
Open

Comments

@Grueslayer
Copy link

The plugin found at https://github.com/gikmx/vim-ctrlposession lists all sessions. The content of the entries are names of directories.

If you've read a file (current buffer is a file) the last entry is removed by the list and you can not choose that session to load.

The function pymatcher#ShouldHideCurrentFile will return true, cause ctrlp is giving you the actual file (from the current buffer). This leads to the "remove" call in PyMatch. But the file isn't in the list (because the list is not a file list, its a session list), so your index() call returns -1, and so the remove deletes the last entry in the list.

This can be a fix:

        if pymatcher#ShouldHideCurrentFile(a:ispath, a:crfile)
            let i = index(arr, a:crfile)
            if i >= 0
                call remove(arr, i)
            endif
        endif           
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

No branches or pull requests

1 participant