telescope.nvim icon indicating copy to clipboard operation
telescope.nvim copied to clipboard

Do not affect repeat (dot command) while typing in prompt

Open greenhat opened this issue 4 years ago • 9 comments

Description

Repeat (dot command) is overwritten with what is typed in telescope prompt

Expected Behavior Repeat (dot command) should not be changed by typing in telescope prompt

Actual Behavior After typing in telescope prompt and using repeat(dot command) after telescope is closed it inserts what typed in the telescope prompt.

Details

Steps to reproduce:

  1. Open any file and make a change with ciw command;
  2. Open Telescope's git_files, type "asdf", exit Telescope;
  3. Call repeat(dot command) and see that "asdf" is inserted;

greenhat avatar Aug 04 '21 15:08 greenhat

I've briefly (maybe not exhaustively enough?) looked into this and as I understand it this would currently require sizable workarounds/hacks I think are outside the scope of telescope as this refers more to (Neo)vim working as intended.

For instance, see this SO post or vim-repeat.

Therefore, I'd say this is more of an upstream issue rather than a telescope bug. Thoughts?

fdschmidt93 avatar Aug 05 '21 06:08 fdschmidt93

Thanks for checking this out! And thanks for the Telescope! It's awesome!

I've briefly (maybe not exhaustively enough?) looked into this and as I understand it this would currently require sizable workarounds/hacks I think are outside the scope of telescope as this refers more to (Neo)vim working as intended.

I understand that Telescope is using a nvim buffer for its floating window (prompt, etc.). From nvim's view, it's just another buffer and all user editing commands issued there are processed as if they were issued in a regular buffer. I was wondering if there is any way of letting nvim know that user text input in the Telescope prompt should be treated differently, i.e. "ignored" from the perspective of nvim's command history, etc. I believe a user does not want Telescope to "pollute" their command history when they switch to another file/buffer to repeat their last editing command. If this requires sizable hacks, then we should look for another way of course.

For instance, see this SO post or vim-repeat.

I see that manipulating a command history is a complex issue that should be avoided. But I rather see a solution for this issue to be "don't touch command history while in Telescope" rather than trying to amend it. Or do you mean vim-repeat could help here somehow?

greenhat avatar Aug 05 '21 11:08 greenhat

No, it was more a reference of how these sorts of things are done which is quite similar to the SO post as I understand the vimscript.

But I rather see a solution for this issue to be "don't touch command history while in Telescope" rather than trying to amend it.

The references were intended to showcase to what lengths you'd have to go to to make this work in the current (Neo-)vim state of things.

I was wondering if there is any way of letting nvim know that user text input in the Telescope prompt should be treated differently, i.e. "ignored" from the perspective of nvim's command history, etc.

In brief, I don't think there is.

fdschmidt93 avatar Aug 06 '21 12:08 fdschmidt93

Got it. Thank you!

greenhat avatar Aug 06 '21 16:08 greenhat

Is there another related ticket that's still open? I am interested in following this issue.

thetic avatar Mar 20 '22 22:03 thetic

3 years gone! Do we have a better solution for this issue now? It is experience-breaking to intervene users' edit history.

Thanks!

tamlok avatar Feb 01 '24 16:02 tamlok

3 years gone!

feel free to contribute.

I agree that this is an issue and should be addressed at some point, so ill reopen, but comments like yours @tamlok are disrespectful, its still a free software, no one charges you and no one forces you (i hope) to use this software.

Conni2461 avatar Feb 01 '24 16:02 Conni2461

3 years gone!

feel free to contribute.

I agree that this is an issue and should be addressed at some point, so ill reopen, but comments like yours @tamlok are disrespectful, its still a free software, no one charges you and no one forces you (i hope) to use this software.

I don't think my comment is disrespectful. Just curious what is current status of this issue. I said Thanks at the end to express my gratitude to the project. I never say that I have been charged or forced to use Telescope. "3 years gone!" is just like "Time flies" something and it is not a PUSH or blaming.

Anyway, you are the boss here! So I will pay attention to my activities at this project in the future! Enjoy! Feel free to close this issue and sorry for the comment.

tamlok avatar Feb 02 '24 14:02 tamlok

please do not close this issue

thetic avatar Feb 02 '24 19:02 thetic