directory name is disordered when move the directory
See original GitHub issueProblems summary
When move directory and Defx buffer is updated, “/” remains and directory name become disodered if previous directory name is longer than next one.
Environment Information
-
plugin version(SHA1): up-to-date (i’m not sure SHA1)
-
OS: WSL 20.04 LTS
-
neovim/Vim version: NVIM v0.5.0-dev+1053-g459a6c845
-
:checkhealth
or:CheckHealth
result(neovim only):
health#defx#check
========================================================================
## defx.nvim
- OK: has("python3") was successful
- OK: Python 3.6.1+ was successful
Provide a minimal init.vim/vimrc
[[plugins]]
repo = 'Shougo/defx.nvim'
hook_add = '''
call defx#custom#option('_', {
\ 'winwidth': 40,
\ 'split': 'vertical',
\ 'direction': 'topleft',
\ 'show_ignored_files': 1,
\ 'buffer_name': 'exproler',
\ 'toggle': 1,
\ 'resume': 1,
\ 'columns': 'indent:icons:filename:mark',
\ })
nnoremap <silent>fs :<C-u>Defx -auto-cd -vertical-preview -floating-preview<CR>
autocmd FileType defx call s:defx_my_settings()
function! s:defx_my_settings() abort
" Define mappings
nnoremap <silent><buffer><expr> <CR>
\ defx#is_directory() ?
\ defx#do_action('open') :
\ defx#do_action('multi', ['drop', 'quit'])
nnoremap <silent><buffer><expr> h
\ defx#do_action('cd', ['..'])
nnoremap <silent><buffer><expr> j
\ line('.') == line('$') ? 'gg' : 'j'
nnoremap <silent><buffer><expr> k
\ line('.') == 1 ? 'G' : 'k'
nnoremap <silent><buffer><expr> l
\ defx#do_action('open')
endfunction
'''
The reproduce ways from neovim
Let’s use files in this repository for example.
- Clone this repository in local environment.
- Move to the directory and launch neovim. And open Defx buffer. (‘fs’ in my env)
- Move to .git directory by defx#do_action(‘open’). (‘i’ in my env)
- I can see the style is disordered. “/” remains and the position that directory name starts is inconsistent.
Screen shot
initial state
when move to .git directory
what I tried
I tried to use defx-action-multi to hook defx#redraw() function. However, problem was not solved.
nnoremap <silent><buffer><expr> h defx#do_action('multi', ['cd', '..', 'redraw'])
And I also tried to use autocmd to hook “User DefxDirChanged” event and <C-l> redraw command. But this trial end up to fail with my tiny vimscript power…
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
“The Directory Name is Invalid” Error and How To Fix It
Common Causes of “The Directory Name Is Invalid” Error ; Improper device removal ; Malware attack ; Incorrect permissions ; Bad sectors ...
Read more >Fix 'The Directory Name is Invalid' Error in Windows 10
Summary: This blog explains the causes of the 'The Directory Name is Invalid' error in Windows 10 and methods to fix it.
Read more >"The directory name is invalid" error message when you start ...
The command prompt program or Notepad logs an error that states that the %HOMEDRIVE%%HOMEPATH% path is not valid for the session. This scenario...
Read more >Fixing Your Disorganized REAPER Projects - YouTube
Following up on the Essential File Management video which covers preventing issues, this video will cover how to get your existing project ...
Read more >How to sort files in some directory by the names on Linux
I use opendir() and readdir() to display the file names in a directory. But they are disordered. How can I sort them? The...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I could reproduce the same problem in WSL’s default console. However, when this problem occurs, the whole Neovim’s drawing system is broken. If @yut19 has the same problem, this is not defx’s problem, but WSL console’s one. It seems that WSL’s default console is incompatible with Vim. I recommend using windows terminal.
@Shougo @matsui54 I’m sorry for my inadequate report and thank you for your quick response. I understand the cause of problem. I’ll use Windows Terminal instead.