[xml][force compile] Fix trim operations for selection#12655
[xml][force compile] Fix trim operations for selection#12655ArkadiuszMichalski wants to merge 2 commits intonotepad-plus-plus:masterfrom
Conversation
|
I don't think 12648 is the correct issue for this PR? |
|
There is a discussion with descriptions of this problem for trim operations , but I will move it to a new issue later. |
Hmm. Without an issue, I don't know what it is that I'm checking... |
|
Sorry for the confusion. Description is here #12658. |
|
As a user, I would not use "trim" operations on partially-selected lines -- I would select full lines with the mouse using line number margin click+drag. Or, if I did partially select some group of lines, I would expect "trim" to operate on the full lines touched by selection. I don't really want to get into the possibly endless debate about how such a thing should work (on partially selected lines), so perhaps @Yaron10 is a better and more thorough tester of this? |
|
Right, I was just trying to make the point that I am not the best person to give you the testing on this. |
👍
I think that removing the selection in the following case is wrong. Leading/Trailing blanks and non-Leading/Trailing blanks are two different "entities". Selecting a non-Leading/Trailing tab
Line 4 should not be included. |
|
It's about "Trim Trailling" or "Trim Leading" operation so it's rather ones of Line Operations. Sorry, for bf34ef0 I have checked only with selection full lines. |
Sure, but if I select a fragment (part of a line), then from my perspective this fragment can be treat as independent line (things outside the selection don't bother me). From your graphic, it's as if I just copied this selection into a new document and performed these operations without selection or select all (Ctrl+A). Back to the topic. Auto-expand selection is not that simple, because then appear other borderline cases. 1 2 What in this situation, line 2 should be selected? We start selection before 3 We start selection before 4 Here I assume that the whole line 4 should be selected (because the first character What should be done with the last I've already seen what problems can arise if we try implement auto-expand selection in: #12580. That's why I came to the conclusion that it's best if the commands operate on the selection exactly made by us. Then we always have the possibility to select exactly what we need. With auto-expand selection we are forced into default behavior, which may not always meet our expectations. @donho |
|
@ArkadiuszMichalski |
ff462bd to
be826cb
Compare
|
Can you check the last commit is it better? Now it follows what commands "Move up/down current line" do. 4 We never expand selection to contain the last |
|
@ArkadiuszMichalski
|
Yes, but that is due to the limitation of
I know, even mention something like that here: Now after committing, I will try to adjust these other methods so that they also work on the selection. |
What you do for this situation is, for the first change, note how the document length changes, and adjust the location of the intended second change by this amount. And so on for all the subsequent changes needed. |
|
As I mentioned, it's tolerable for me. So let's take the simplest solution (the current one). |
Right, we can combine in this direction. But I would still expect that |




















… line
Fix #12658, #12602.
@alankilborn Can you check if it's consistent now?