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

Add support selection to TAB and Space conversion commands #12720

Closed
ArkadiuszMichalski opened this issue Dec 28, 2022 · 14 comments
Closed

Add support selection to TAB and Space conversion commands #12720

ArkadiuszMichalski opened this issue Dec 28, 2022 · 14 comments

Comments

@ArkadiuszMichalski
Copy link
Contributor

Would be nice to have selection support for these three commands: TAB to Space, Space to TAB (All) and Space to TAB (Leading). Same as we have for trim operations #12655 and maybe two others #12711.

image

@donho Here also is question how treat selection:

  • exactly as it is
  • or expand to full lines

If expand then for all three or only for some, like Space to TAB (Leading)?

Maybe in this submenu Blank Operations all commands should be treat in entire lines context, so partially selected line should be expand to full lines. It would be more consistent. Is there any command here for which a partially selected line would be better (more expected)?

@ArkadiuszMichalski
Copy link
Contributor Author

@donho

Any advice on this? Only here the selection support is still missing. I would correct these commands too.

@Yaron10
Copy link

Yaron10 commented Dec 30, 2022

@ArkadiuszMichalski,

In Tab to Space and Space to Tab (All) even column-selection can be useful in real-life. :)

In the following case the user might want to replace the selected spaces only.
תמונה

@donho
Copy link
Member

donho commented Dec 30, 2022

@ArkadiuszMichalski

Any advice on this? Only here the selection support is still missing. I would correct these commands too.

I would say that let's keep it as it is if there's no feature request.

@alankilborn
Copy link
Contributor

In the following case the user might want to replace the selected spaces only.

No user I've ever met would want to do that. :-)

@donho
Copy link
Member

donho commented Dec 30, 2022

I set suspended so far so if there's need we will unsuspended, ans see if we will do it.

@ArkadiuszMichalski
Copy link
Contributor Author

ArkadiuszMichalski commented Dec 30, 2022

@donho
I want this, especially Space to TAB (Leading). Even Notepad++ codebase often has a tab/space mix (where tabs are preferred ). Thanks to the selection support it easier to clean up a certain piece of code that we are working on.

I think that expand partially selection to full lines (same as Trim) makes the most sense here. I remind that the number of spaces per one tab depends on the settings, so operating on partial spaces in a line seems less useful.

Edit: some workaround is copy fragment to new document, invoke command, and replace the original fragment with this result. Well, that takes a bit of time.

@Yaron10
Copy link

Yaron10 commented Dec 30, 2022

@alankilborn,

No user I've ever met would want to do that.

I don't understand it.

If you have a 1000-lines file containing somewhere the following text:
תמונה

You might want want to replace the column-selected spaces only. Not in the entire file nor in those 4 lines.
Unlike Trim where we must either ignore column-selection or expand it to the entire lines.

@alankilborn
Copy link
Contributor

No user I've ever met would want to do that.

I don't understand it.

Well, you went and changed the example...

@Yaron10
Copy link

Yaron10 commented Dec 31, 2022

@alankilborn,

It was an "in-principle" example. :)

Happy New Year!
To you and all.

@donho
Copy link
Member

donho commented Dec 31, 2022

@ArkadiuszMichalski
Have you a list of commands you want to enhanced with the selection?

@donho
Copy link
Member

donho commented Dec 31, 2022

Happy New Year! To you and all.

Thank you @Yaron10
I don't celebrate new year, since there's no one for me.
But I wish you happy holiday :)

@Yaron10
Copy link

Yaron10 commented Dec 31, 2022

@donho,

Thank you!
I wish you many happy years. Whenever they start and end. :)

@ArkadiuszMichalski
Copy link
Contributor Author

@donho

Have you a list of commands you want to enhanced with the selection?

No, I'm focusing on Lines Operations and Blank Operations at the moment because selection for them seems to be the most useful.

These three commands: TAB to Space, Space to TAB (All) and Space to TAB (Leading) are covered by one function wsTabConvert so selection support just needs to be added in one place.

@donho donho removed the suspended label Jan 1, 2023
@donho donho closed this as completed in 1652236 Jan 14, 2023
@alankilborn
Copy link
Contributor

@annwitbrock

First, 8.4.9 works fine for Python with either Replace by space or not. Second, your comment really doesn't belong here. If you really feel 8.4.9 isn't working, maybe try asking the Community; see HERE.

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

Successfully merging a pull request may close this issue.

4 participants