-
-
Notifications
You must be signed in to change notification settings - Fork 51
Improve "reveal" related features #170
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
Conversation
|
If I have 2 files in a directory and open them in splits. If I keep toggling |
|
@nickjj Thanks. I've fixed the behavior so please try latest again 👍 |
|
Confirmed fixed. Also vs master (not fixed), the 2nd split file never gets selected while toggle revealing, so whatever you did seems to be for the better. Unrelated but relevant issue: If you |
I don't get your situation. Are you using "hijack netrw" so that If you desire, you can write some Vim script to check if you are on split windows style but I think you don't need it while the usage of split windows style is completely different from project drawer style and " The script below may not work in the future while it relys on non documented behavior
function! s:smart_fern() abort
let bufname = bufname('%')
if bufname =~# '^fern://` && bufname !~# '^fern://drawer'
" On split windows style
execute "normal! \<C-^>"
else
" Others
Fern . -drawer -reveal=% -toggle -width=35 -wait
execute "normal! \<C-w>="
endif
endfunction
nnoremap <silent> <Leader>f :<C-u>call <SID>smart_fern()<CR>P.S. You should use nnoremap <silent> <Leader>f :<C-u>Fern . -drawer -reveal=% -toggle -width=35 -wait<CR><C-w>= |
Is there some combo of flags I can use to avoid writing using the custom Vim script that may not work in the future? One that says "open fern in project drawer if there's no fern, but if fern is open already in split mode, close that one first". And yes, I am using the hjack code from the wiki. |
|
Unfortunately no while
Is not clear enough. There are too many situations to care. For example, what you expect for "closing" when there are two windows and one is the fern. Close the window itself or replace it to a new buffer or replace it with a previous buffer or? What do you expect if there are two tab pages and only one window in the current tab page? Like this. So the usage of a split window is completely different. |
Add
FernRevealbuffer local commandFix #114
Users can reveal a path on the current fern viewer with
FernReveal {reveal} [-wait]command.Use
FernDocommand to executeFernRevealfrom different buffer.-revealoption ofFerncommand always reveal the nodeFix #146