terminal/src/host/ut_host
Carlos Zamora 0e672fac08
Move rect expansion to textbuffer; refactor selection code (#4560)
- When performing chunk selection, the expansion now occurs at the time
  of the selection, not the rendering of the selection
- `GetSelectionRects()` was moved to the `TextBuffer` and is now shared
  between ConHost and Windows Terminal
- Some of the selection variables were renamed for clarity
- Selection COORDs are now in the Text Buffer coordinate space
- Fixes an issue with Shift+Click after performing a Multi-Click
  Selection

## References
This also contributes to...
- #4509: UIA Box Selection
- #2447: UIA Signaling for Selection
- #1354: UIA support for Wide Glyphs

Now that the expansion occurs at before render-time, the selection
anchors are an accurate representation of what is selected. We just need
to move `GetText` to the `TextBuffer`. Then we can have those three
issues just rely on code from the text buffer. This also means ConHost
gets some of this stuff for free 😀

### TextBuffer
- `GetTextRects` is the abstracted form of `GetSelectionRects`
- `_ExpandTextRow` is still needed to handle wide glyphs properly

### Terminal
- Rename...
    - `_boxSelection` --> `_blockSelection` for consistency with ConHost
    - `_selectionAnchor` --> `_selectionStart` for consistency with UIA
    - `_endSelectionPosition` --> `_selectionEnd` for consistency with
      UIA
- Selection anchors are in Text Buffer coordinates now
- Really rely on `SetSelectionEnd` to accomplish appropriate chunk
  selection and shift+click actions

## Validation Steps Performed
- Shift+Click
- Multi-Click --> Shift+Click
- Chunk Selection at...
    - top of buffer
    - bottom of buffer
    - random region in scrollback

Closes #4465
Closes #4547
2020-02-27 16:42:26 -08:00
..
AliasTests.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
ApiRoutinesTests.cpp Remove unwanted DECSTBM clipping (#2764) 2019-09-23 16:16:54 -07:00
AttrRowTests.cpp Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
CharRowBaseTests.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
ClipboardTests.cpp Always use a VK in MapVirtualKeyW(..., MAPVK_VK_TO_VSC) (#3199) 2019-10-17 14:58:41 -07:00
CodepointWidthDetectorTests.cpp Replace CodepointWidthDetector's runtime table with a static one (#2368) 2019-08-16 10:54:17 -07:00
CommandLineTests.cpp Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
CommandListPopupTests.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
CommandNumberPopupTests.cpp Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
ConptyOutputTests.cpp Move tests to invoke te.exe directly instead of using VSTest runner (#4490) 2020-02-10 19:14:06 +00:00
ConsoleArgumentsTests.cpp Fix the conhost command line not being properly escaped (#1815) 2019-07-11 19:38:56 -07:00
CopyFromCharPopupTests.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
CopyToCharPopupTests.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
DbcsTests.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
DefaultResource.rc Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
HistoryTests.cpp Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
Host.UnitTests.vcxproj Create tests that roundtrip output through a conpty to a Terminal (#4213) 2020-01-17 16:40:12 +00:00
Host.UnitTests.vcxproj.filters Prevent cleanup of object given to handle that failed access check (#3414) 2019-11-05 14:22:55 -08:00
InitTests.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
InputBufferTests.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
ObjectTests.cpp Prevent cleanup of object given to handle that failed access check (#3414) 2019-11-05 14:22:55 -08:00
OutputCellIteratorTests.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
PopupTestHelper.hpp Replace macros with constexpr part 2 (#3416) 2019-11-04 07:37:47 -06:00
product.pbxproj Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
ReadWaitTests.cpp Removed using namespace directive from header files (#955) 2019-05-30 11:14:21 -07:00
RendererTests.cpp Initial release of the Windows Terminal source code 2019-05-02 15:29:04 -07:00
ScreenBufferTests.cpp Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
SearchTests.cpp Migrate Search module as a shared component for Terminal Search (#3279) 2019-11-14 14:36:41 -08:00
SelectionTests.cpp Move rect expansion to textbuffer; refactor selection code (#4560) 2020-02-27 16:42:26 -08:00
sources Create tests that roundtrip output through a conpty to a Terminal (#4213) 2020-01-17 16:40:12 +00:00
testmd.definition Integrate inbox changes up to 68d3b53286dd 2019-12-02 17:24:26 -08:00
TextBufferIteratorTests.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
TextBufferTests.cpp Move rect expansion to textbuffer; refactor selection code (#4560) 2020-02-27 16:42:26 -08:00
TitleTests.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
Utf8ToWideCharParserTests.cpp Compensate for non-minimal UTF-8 encodings (#3380) 2019-10-31 10:50:34 -07:00
Utf16ParserTests.cpp add clang-format conf to the project, format the c++ code (#1141) 2019-06-11 13:27:09 -07:00
UtilsTests.cpp Fix a bunch of spelling errors across the project (#4295) 2020-02-10 20:40:01 +00:00
ViewportTests.cpp Make the RIS command clear the display and scrollback correctly (#2367) 2019-08-27 18:45:38 -07:00
VtIoTests.cpp Move tests to invoke te.exe directly instead of using VSTest runner (#4490) 2020-02-10 19:14:06 +00:00
VtRendererTests.cpp Make Conpty emit wrapped lines as actually wrapped lines (#4415) 2020-02-27 16:40:11 +00:00