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

Files opening in floaterm instead of main window #35

Closed
sergiza opened this issue Aug 23, 2022 · 15 comments
Closed

Files opening in floaterm instead of main window #35

sergiza opened this issue Aug 23, 2022 · 15 comments

Comments

@sergiza
Copy link

sergiza commented Aug 23, 2022

I'm using rifle as my file opener, i'm guessing that's what's caussing the issue.
This is in my lfrc
cmd open $set -f; rifle -p 0 $fx
set ifs "\n"

Screenshot_20220823_163242

@ptzz
Copy link
Owner

ptzz commented Aug 24, 2022

Does it work with an empty lfrc?

I tried with your lfrc and it works for me. Are you sure you're executing the open command (i.e. not edit) from lf?

@sergiza
Copy link
Author

sergiza commented Aug 24, 2022

Works as intended with an empty lfrc, and works as intended with everything else except those two lines (rifle).
And yea, i've tried open, edit, open with. None works.

@ptzz
Copy link
Owner

ptzz commented Aug 24, 2022

Ok, I don't know what's wrong. For me, when running lf with -last-dir-path and -selection-path arguments (i.e. as a file selector), the selected/opened file is just written to the specified path and any action associated with open in lfrc is ignored.

Does it work if you use e.g. cat instead of rifle? Maybe try remove the set ifs part as well.

@sergiza
Copy link
Author

sergiza commented Aug 24, 2022

set ifs "\n" has nothing to do with it from what i've tested now. It's all in the cmd open $set -f; rifle -p 0 $fx line. I don't know what you mean by using cat instead of rifle, if you give me a line of what you mean i'll test it.
I also noticed that when I "solve" the problem, it opens in a new terminal instead of opening in my current terminal. So maybe it's just hopeless.

@sergiza
Copy link
Author

sergiza commented Aug 24, 2022

Peek_2022-08-24

@ptzz
Copy link
Owner

ptzz commented Aug 24, 2022

Try with only this in the lfrc and check if it still misbehaves:

cmd open ${{
    cat $f
}}

I also noticed that when I "solve" the problem, it opens in a new terminal instead of opening in my current terminal. So maybe it's just hopeless.

You mean with an empty lfrc, the file gets opened in a new vim session in another terminal..?

@sergiza
Copy link
Author

sergiza commented Aug 24, 2022

You mean with an empty lfrc, the file gets opened in a new vim session in another terminal..?

Exactly this, I recorded a gif but it doesn't look clear enough, let me try again.

@ptzz
Copy link
Owner

ptzz commented Aug 24, 2022

I see now..

@sergiza
Copy link
Author

sergiza commented Aug 24, 2022

2terminals

@sergiza
Copy link
Author

sergiza commented Aug 24, 2022

Try with only this in the lfrc and check if it still misbehaves:

cmd open ${{
    cat $f
}}

Looks like it does the command inside of floaterm too.

cat

@ptzz
Copy link
Owner

ptzz commented Aug 24, 2022

That's super weird, it should do nothing except return to originating vim session with the selected file opened. No clue what's going on. I'm on a Mac with lf --version 27, NVIM v0.7.2.

How do you start Lf, just :Lf command?

@sergiza
Copy link
Author

sergiza commented Aug 24, 2022

I'm using the default map map <leader>f :Lf<CR>.
The only thing I changed is

if exists('g:lf_command_override')
  let s:lf_command = g:lf_command_override
else
  let s:lf_command = '~/.config/lf/lf'
endif

My lf is an appimage, so I needed to change that. Latest version lf r27 and nvim v0.7.2 too. Also I'm on Kubuntu 22.04.1 LTS.

@ptzz
Copy link
Owner

ptzz commented Aug 24, 2022

Could you try this branch https://github.com/ptzz/lf.vim/tree/fix-custom-lf-path? It seems the introduction of floaterm broke custom path to lf.

@sergiza
Copy link
Author

sergiza commented Aug 24, 2022

Could you try this branch https://github.com/ptzz/lf.vim/tree/fix-custom-lf-path? It seems the introduction of floaterm broke custom path to lf.

It fixed it! For now, it seems like everything works as intended.
Thank you for taking the time to help.

@ptzz ptzz closed this as completed in e77c40a Aug 24, 2022
@ptzz
Copy link
Owner

ptzz commented Aug 24, 2022

👍

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

2 participants