-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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 EOL commands #12702
Comments
@ArkadiuszMichalski |
Oups! I have to admit that "Remove Unnecessary Blank and EOL" is not well named. This command trim leading & tail then replace EOL with space:
Before changing its behaviour, I think it's worth to change the command name. What's your suggestion? |
It is difficult. |
OK, it's better to ask about it before making any changes.
Edit: btw,
notepad-plus-plus/PowerEditor/src/NppCommands.cpp Lines 1794 to 1805 in 3f0f6a2
but it doesn't operate on the entire document (without selection) and expand selection. |
I made some initial changes for the tests #12711. Is |
For above case: |
Would be nice to have selection support for these two commands:
EOL to Space
andRemove Unnecessary Blank and EOL
. Same as we have for trim operations #12655.@donho I have a few questions before starting this. In
EOL
case it's a bit simpler, because here it's only important to selectEOL
, so what we select will be taken into account. So forEOL to Space
:Will replace EOL in 1 line.
Will replace EOL in 1 and 2 line.
Will replace EOL in 1 line.
In this case it doesn't make sense to extend the selection to the whole data? For example:
![image](https://user-images.githubusercontent.com/2730894/209537144-5c9d031b-189a-48fe-92cb-e9365c3d355d.png)
Expanding will not affect the process because the selected EOL will not change. Well, but I'm not sure to not expand anyway, because the Trim operations make expanding and this one
EOL to Space
should not do it? AlsoRemove Unnecessary Blank and EOL
firstly rundoTrim()
so expanding will be done here anyway.These two commands should be considered in the context of whole lines or just according to the exactly selection made? A similar question will appear later for the last 3 commands
Tab to Space
,Space to Tab (all/leading)
.I have one more question about this command
![image](https://user-images.githubusercontent.com/2730894/209538580-c2d73df0-1192-459e-9615-889094df1709.png)
![image](https://user-images.githubusercontent.com/2730894/209538128-1652e8e6-dad2-48a3-b924-14f7cb87ffac.png)
Remove Unnecessary Blank and EOL
. Actually for such example:we get this:
We get last 3 space because last 3 EOL was change to it. But this spaces are also not unnecessary, as command name suggest? Should not be removed?
One more example:
![image](https://user-images.githubusercontent.com/2730894/209540901-90e8b602-48d6-4f82-b415-dec8919ab3a3.png)
After all once space left. If we assume that for
Remove Unnecessary Blank and EOL
, actions for EOL always mean replacing them with a space, this might be correct.The text was updated successfully, but these errors were encountered: