Page 1 of 1

File compare, extending text selection with mouse has error

Posted: 2018-06-09, 12:05 UTC
by rif
Windows applications allow you to select a block of text (or file listing etc.) then extend the selection by moving the mouse and press shift + mouse click.

In TC that works correctly in file list panels and in text viewer. It does not work correctly in file compare when selecting block to copy.

Steps to reproduce:

1. Make a text file ~80 lines long, save it as test1.txt.

2. Copy test1.txt and name it test2.txt.

3. Edit text2.txt and remove ~50 lines in the middle.

4. Do a file compare (Alt-F + Y) of test1.txt and test2.txt. The extra lines of test1.txt are displayed in red.

5. Select 10 of the red lines. Works OK.

6. Move mouse cursor 5 lines further down.

7. Press shift and mouse-click.

Result: TC forgets the first 9 selected lines and marks lines 10 to 15 in red. Like it was a new selection.

Expected behavior: Lines 1 to 15 should be marked red i.e. extending selection.

Error seen in 9.20b6 but also in 9.12. Tested in 64 bit and 32 bit version. Tested on Win 7 / 64 bit.

Please fix this to use the expected Windows behavior.

Posted: 2018-06-09, 12:44 UTC
by Horst.Epp
Confirmed

Posted: 2018-06-11, 14:06 UTC
by ghisler(Author)
The compare tool works as you suggest while in edit mode. In read only mode, it always selects from the cursor position to the Shift+Click position. It may be risky to change that now because it could lead to a ton of new bugs.

Posted: 2018-06-12, 01:56 UTC
by rif
ghisler(Author) wrote:The compare tool works as you suggest while in edit mode. In read only mode, it always selects from the cursor position to the Shift+Click position. It may be risky to change that now because it could lead to a ton of new bugs.
OK, I understand it will not be corrected for the soon coming 9.20.

Will it then be corrected for future 9.21 release?

Posted: 2018-06-12, 14:15 UTC
by ghisler(Author)
Yes, if possible.

Re: File compare, extending text selection with mouse has error

Posted: 2018-07-25, 13:37 UTC
by ghisler(Author)
Sorry, this hasn't made it into 9.21 yet. It's far too complex, there are many instances where we can miss the position change of the cursor.

Re: File compare, extending text selection with mouse has error

Posted: 2018-07-28, 19:57 UTC
by browny
5. Select 10 of the red lines. Works OK.

6. Move mouse cursor 5 lines further down.

7. Press shift and mouse-click.
If you clicked the first line and Shift-clicked on the 10th line, the cursor position moves to the 10th line.
When you shift-clicked on line 15, it should select lines 10-15, not 1-15.
That is how Shift+click usually was expected to work in Windows.
To extend selection, standard Windows Ctrl+Shift+click should be tried.
No changes in the code were required, probably.

Re: File compare, extending text selection with mouse has error

Posted: 2018-07-29, 06:52 UTC
by ghisler(Author)
As I wrote, it's far too complex to fix, I expect several months of testing until all cases of cursor movement are correctly handled. Therefore I prefer to keep it as it is - different from Windows behaviour, but at least consistent.

Re: File compare, extending text selection with mouse has error

Posted: 2018-08-04, 07:16 UTC
by rif
@browny
browny wrote: 2018-07-28, 19:57 UTC If you clicked the first line and Shift-clicked on the 10th line, the cursor position moves to the 10th line.
When you shift-clicked on line 15, it should select lines 10-15, not 1-15.
No, shift + mouse-click extends a selection in Windows. The same way as I described the expected behavior.

You can try in Windows File Explorer, in a text in Notepad or any other Windows app. They use shift + mouse click for extending the current selection.

If you answer to my post, please make the quote so it includes user name or use @username to make clear who you answer. Sadly this forum software does not have tree structure view.

Re: File compare, extending text selection with mouse has error

Posted: 2018-08-04, 08:03 UTC
by rif
ghisler(Author) wrote: 2018-07-29, 06:52 UTC As I wrote, it's far too complex to fix, I expect several months of testing until all cases of cursor movement are correctly handled. Therefore I prefer to keep it as it is - different from Windows behaviour, but at least consistent.
With TC, when you select files in the file panels it does work the same way as normal Windows app, i.e. shift + mouse-click extends the current selection. So for consistency shift + mouse-click should also extend a text selection in file compare. When you have to make a selection longer than a screen length it is very helpful if it can be done in several steps using extend selection.

I hope you will reconsider and correct the extend text selection for file compare in version 9.22.

Just a side note, I have a registered version of TC for more than 14 years.

Re: File compare, extending text selection with mouse has error

Posted: 2018-08-05, 07:13 UTC
by ghisler(Author)
Yes, I plan to change it - but there are so many ways to change the state of the editor like typing cursor keys with or without shift, mouse clicking, undo, pasting etc. which would all have an effect on the "select from" position that I just can't add this over night. It will take several weeks to months until it will work properly.

Re: File compare, extending text selection with mouse has error

Posted: 2018-08-05, 15:52 UTC
by rif
ghisler(Author) wrote: 2018-08-05, 07:13 UTC Yes, I plan to change it
Thanks, looking forward to see it when it later will be ready.

Re: File compare, extending text selection with mouse has error

Posted: 2018-08-05, 19:50 UTC
by petermad
2ghisler(Author)
there are so many ways to change the state of the editor
But it is the behaviour in the non-edit (read-only) mode that needs to be changed - isn't that far les complex?

Re: File compare, extending text selection with mouse has error

Posted: 2018-08-06, 06:53 UTC
by ghisler(Author)
Yes, it's almost as complex.

Re: File compare, extending text selection with mouse has error

Posted: 2018-08-09, 20:30 UTC
by browny
rif wrote: 2018-08-04, 07:16 UTC You can try in Windows File Explorer, in a text in Notepad or any other Windows app. They use shift + mouse click for extending the current selection.
Yes.
Though you still could use Ctrl+Shift+click to extend selection in compare tool.