gennaro-tedesco / nvim-possession

📌 the no-nonsense session manager
MIT License
215 stars 7 forks source link

fix(prompt): disable cwd prefix #30

Closed MariaSolOs closed 11 months ago

MariaSolOs commented 11 months ago

This setting is needed in order for the sessions: prompt to be displayed, else the current working directory will override the custom prompt.

gennaro-tedesco commented 11 months ago

Good morning and thank you for your contribution!

Yes, this is correct, wouldn't however the show_cwd_header=false already take priority and disable the cwd prompt nevertheless? Or are you referring to this recent issue (to rephrase, do you see your cwd being displayed instead of sessions: at the moment, because I do not but I may be on different fzf commits)?

MariaSolOs commented 11 months ago

@gennaro-tedesco Hmm that's strange. As you guessed, I'm seeing the CWD prompt instead of the one set by the session picker. My fzf-lua configuration for the files pickers is:

files = {
  git_icons = false,
  winopts = { preview = { hidden = 'hidden' } },
}

And so it seems that the default value of cwd_prompt is being applied. I guess I could modify my global configuration to disable the setting, but given that this picker clearly has a custom prompt, I find it more appropriate to set cwd_prompt in the picker's options.

And I'm using the very latest commit of fzf-lua: https://github.com/ibhagwan/fzf-lua/commit/a2043e414ee549967415f345059edcb804332ab3

gennaro-tedesco commented 11 months ago

I just realised that, in my own fzf option, I set cwd_prompt = false myself - which is probably why I "accidentally" see all good: by using your settings I do see the cwd instead of the session prompt. Thank you for pointing it out!

I will do some more option testing and then merge (it is still early morning here so I need a few hours to be fully functioning): will notify when released so that you can check that all is good by pulling the latest commits (both for this plugin and for fzf-lua).

MariaSolOs commented 11 months ago

@gennaro-tedesco sounds good! :)

gennaro-tedesco commented 11 months ago

Merged and released in v0.0.12: all works well from my side, normally updating your plugin via your plugin manager should do now.

MariaSolOs commented 11 months ago

@gennaro-tedesco it's working now, thank you! However, are you open to making the prompt configurable? I would like the prompt to simply be Sessions:, but with the current settings that's not possible...

gennaro-tedesco commented 11 months ago

Yes, obviously we can make the prompt fully configurable: may I ask what part specifically you'd like to configure (and also, can I get a screenshot of what you are currently seeing)? Generally speaking any fzf option can be passed and should work just fine (the prompt is however hardcoded here).

MariaSolOs commented 11 months ago

@gennaro-tedesco I would like to just change the hard-coded prompt by Sessions: and nothing else. I was able to remove the icon by setting sessions.sessions_icon = '', but as you point out the rest of the prefix is not configurable.

gennaro-tedesco commented 11 months ago

I will add an option to make it configurable and open a PR soon, so that you can review: stay tuned :)!