Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Shougo
    @Shougo
    You can test the faster version of defx.
    Shougo
    @Shougo
    This is already merged
    Willian Ver Valem Paiva
    @WillianPaiva
    hello im using spacevim and with defx it loads and starts but when i try to use it is like no keybind is recognized i cant navigate
    Shougo
    @Shougo
    Yes. This is the feature.
    Please read the documentation.
    Willian Ver Valem Paiva
    @WillianPaiva
    and how do i use it ?
    Shougo
    @Shougo
    SpaceVim may define key mappings though.
    Willian Ver Valem Paiva
    @WillianPaiva
    i really believe you are not getting me, i use it with the same config on the server and it works fine but on my personal pc it doesnt recognice any keybind is just like a normal buffer
    Shougo
    @Shougo
    Hm. It may be SpaceVim problem.
    I cannot support SpaceVim config unfortunately
    Willian Ver Valem Paiva
    @WillianPaiva
    maybe i just installed it by hand and dont get why on my personal computer it doesnt work
    Shougo
    @Shougo
    I don't know...
    We have not ESP skills
    I don't work for you without minimal vimrc
    Like this
    Willian Ver Valem Paiva
    @WillianPaiva
    thanks anyway i will look around
    Shougo
    @Shougo
    Vim8 testers are needed
    Shougo
    @Shougo
    I have removed the old syntax implementation
    Jan Buchar
    @Teyras
    Hello, is there any way to bind a key to move the cursor to the parent directory of the file under the cursor? I didn't find anything related to moving the cursor in the actions section.
    Shougo
    @Shougo
        nnoremap <silent><buffer><expr> P defx#do_action('search',
        \ fnamemodify(defx#get_candidate().action__path, ':h'))
    Jan Buchar
    @Teyras
    @Shougo awesome, thanks!
    Jan Buchar
    @Teyras
    One more question - on some of the screenshots in the readme, there is a cursor line in the file tree (the file under the cursor has a different background). How can I configure that? The normal set cursorline does not work in defx.
    Shougo
    @Shougo
    setlocal cursorline in defx buffer.
    Jan Buchar
    @Teyras
    @Shougo this is so cool! Thanks!
    半纸青笺
    @Vanppo_twitter
    hi, guys. how can i explore the folder of the current file with tree view?
    Shougo
    @Shougo
    Q: I want to explore the folder where the current file is.
    
    A: >
        Defx `expand('%:p:h')` -search=`expand('%:p')`
    半纸青笺
    @Vanppo_twitter
    @Shougo Thanks for your reply. I have noticed this Q&A, it directly open the folder of current file, but I want it expands to current file from pwd.
    image.png
    Shougo
    @Shougo
    If so, you should use search option.
    Please read the documentation
    半纸青笺
    @Vanppo_twitter
    Did not understand what Search for {path} meaning. Thanks for your answer and hard work!
    R. E. Solritter
    @resolritter

    Hi @Shougo thanks for the plugin. I have been having a problem difficult to reproduce and would like to hear your ideas about what could be causing it. I took a look at the source code for defx but it's still unclear to me.

    I have a custom function which changes the view through defx#call_action('open_directory', path) or
    defx#call_action('cd', path). The problem is that sometimes, after a short delay, the view navigates back to where I was before.

    If I were to guess, there could be some "race condition" like this

    1. I am in /. Defx runs a background function (let's call it Job 1).
    2. I call defx#call_action('cd', '/foo') and change my current directory to /foo.
    3. Job 1 finishes, which makes the view update to where I was before. Now I am back at /.

    Do you think something like that could happen?

    R. E. Solritter
    @resolritter

    One thing I have noticed is that view.py redraw() does not check if the current directory is the same as it was when the request started, so it could finish updating late, after I have already changed the directory.

    However, I am not sure if it's possible to have a race condition like that. Also I don't know if redraw is the problematic function.

    Your thoughts on this would be very helpful! Then I could take a look at the code again by myself.

    Shougo
    @Shougo
    Really?
    It should not. Because defx#call_action() is not async.
    defx#call_async_action() is async and it can reproduce.
    I have a custom function which changes the view through
    Please upload the custom function.
    Shougo
    @Shougo
    I think it is your configuration problem. I cannot reproduce it.
    We have not ESP skills.
    Shougo
    @Shougo
    If you call defx#call_action() in autocmd, it may breaks.
    You should create the minimal vimrc and check it
    R. E. Solritter
    @resolritter

    defx#call_async_action() is async and it can reproduce.

    that's what I was thinking as well.

    I saw that there's async check_redraw on FocusGained and CursorHold: https://github.com/Shougo/defx.nvim/blob/09c8f1bff43b0cc607f7aeab872f04fcf26b150b/rplugin/python3/defx/view.py#L499

    I'll experiment with turning those off in my configuration to see if the problem goes away for a while.

    As a potential fix, I think it makes sense to save the directory at the start of check_redraw and compare if it's still the same before applying the results. I'll experiment for a while before trying that. Thanks for the review!
    R. E. Solritter
    @resolritter
    Now I'm thinking it's easier to just compare changedtick before applying instead of having to save the directory
    Shougo
    @Shougo
    OK. I have fixed it.