terminal/src/cascadia/UnitTests_TerminalCore
Dustin L. Howett (MSFT) 499f24a29e
Rework and simplify selection in TermControl (#5096)
This commit rewrites selection handling at the TermControl layer.
Previously, we were keeping track of a number of redundant variables
that were easy to get out of sync.

The new selection model is as follows:

* A single left click will always begin a _pending_ selection operation
* A single left click will always clear a selection (#4477)
* A double left click will always begin a word selection
* A triple left click will always begin a line selection
* A selection will only truly start when the cursor moves a quarter of
  the smallest dimension of a cell (usually its width) in any direction
  _This eliminates the selection of a single cell on one click._
  (#4282, #5082)
* We now keep track of whether the selection has been "copied", or
  "updated" since it was last copied. If an endpoint moves, it is
  updated. For copy-on-select, it is only copied if it's updated.
  (#4740)

Because of this, we can stop tracking the position of the focus-raising
click, and whether it was part of click-drag operation. All clicks can
_become_ part of a click-drag operation if the user drags.

We can also eliminate the special handling of single cell selection at
the TerminalCore layer: since TermControl determines when to begin a
selection, TerminalCore no longer needs to know whether copy on select
is enabled _or_ whether the user has started and then backtracked over a
single cell. This is now implicit in TermControl.

Fixes #5082; Fixes #4477
2020-03-25 21:09:49 +00:00
..
ConptyRoundtripTests.cpp ci: run spell check in CI, fix remaining issues (#4799) 2020-03-25 11:02:53 -07:00
InputTest.cpp Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
MockTermSettings.h Remove unneeded c_str() conversions (#4358) 2020-01-27 10:23:13 -08:00
precomp.cpp Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
precomp.h Create tests that roundtrip output through a conpty to a Terminal (#4213) 2020-01-17 16:40:12 +00:00
ScreenSizeLimitsTest.cpp Clamp the terminal buffer to SHRT_MAX on resize (#4964) 2020-03-18 22:22:26 +00:00
SelectionTest.cpp Rework and simplify selection in TermControl (#5096) 2020-03-25 21:09:49 +00:00
TerminalApiTest.cpp Add support for setting the cursor visibility in Terminal (#4902) 2020-03-13 17:39:42 +00:00
TerminalBufferTests.cpp Make Conpty emit wrapped lines as actually wrapped lines (#4415) 2020-02-27 16:40:11 +00:00
TestUtils.h Make Conpty emit wrapped lines as actually wrapped lines (#4415) 2020-02-27 16:40:11 +00:00
UnitTests.vcxproj Add just the test infrastructure bits from #4354 (#4382) 2020-01-29 16:33:06 +00:00