-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Add an efficient text stream write function #14821
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
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
a6c5e7a
Add an efficient text stream write function
lhecker f8e6884
Address feedback, Simplify code
lhecker 3d04d37
Make spell-check happy
lhecker 99f19a9
Fix AuditMode failures
lhecker 173e916
Add CopyRangeFrom to later implement TextBuffer::Reflow
lhecker 5040328
Remove debug helpers
lhecker 17e3ca5
Fix AuditMode failures
lhecker f9fbb8a
Fix compilation
lhecker d1163b5
Simplify member naming scheme, Improve performance
lhecker 94fbb52
Fix cursor movement and attribute writing
lhecker 3c5c3d4
Merge remote-tracking branch 'origin/main' into dev/lhecker/8000-stre…
lhecker 934a06d
Fix unit tests
lhecker a99b9d6
Fix unit tests
lhecker 99e669a
Address feedback by j4james, Potentially fix exact line wrapping
lhecker db89261
Revert exact wrap, Remove unused code, Improve tests
lhecker e77f2be
Make the spelling-bot happy
lhecker 0ca2286
Make the spelling-bot happpier?
lhecker 4b070fd
Address feedback
lhecker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ BBBBBBBB | |
BBBBBCCC | ||
BBBBCCCCC | ||
BBGGRR | ||
efg | ||
EFG | ||
EFGh | ||
QQQQQQQQQQABCDEFGHIJ | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2272,8 +2272,6 @@ xunit | |
xutr | ||
XVIRTUALSCREEN | ||
XWalk | ||
xwwyzz | ||
xxyyzz | ||
yact | ||
YCast | ||
YCENTER | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,7 @@ | ||
/*++ | ||
Copyright (c) Microsoft Corporation | ||
Licensed under the MIT license. | ||
|
||
Module Name: | ||
- precomp.h | ||
|
||
Abstract: | ||
- Contains external headers to include in the precompile phase of console build process. | ||
- Avoid including internal project headers. Instead include them only in the classes that need them (helps with test project building). | ||
--*/ | ||
|
||
// stdafx.h : include file for standard system include files, | ||
// or project specific include files that are used frequently, but | ||
// are changed infrequently | ||
// | ||
|
||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT license. | ||
#pragma once | ||
|
||
// clang-format off | ||
|
||
// This includes support libraries from the CRT, STL, WIL, and GSL | ||
#include "LibraryIncludes.h" | ||
|
||
#pragma warning(push) | ||
#ifndef WIN32_LEAN_AND_MEAN | ||
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers | ||
#define NOMCX | ||
#define NOHELP | ||
#define NOCOMM | ||
#endif | ||
|
||
// Windows Header Files: | ||
#include <windows.h> | ||
#include <intsafe.h> | ||
|
||
// private dependencies | ||
#include "../inc/unicode.hpp" | ||
#pragma warning(pop) | ||
#include <LibraryIncludes.h> | ||
|
||
// clang-format on | ||
#include <unicode.hpp> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
kinda weird that this is a static on textbuffer when it just does a
til::utf16_pop
, but presumably this does more in the future?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the future I'll replace this function with some ICU code that actually advances the string by an entire grapheme cluster. So, if you have something like å ("a˚") it'll advance by 2 code points and not just 1 like it does now.
It's possible to just put the ICU code into
til
and use it throughout the code directly, just like we do it right now with the UTF-16 helpers. But from now on, I'd like to avoid doing that, even if it means writing suchstatic
methods, because I'd like to keep everything string handling related as close and tight as possible in the future. I thinkOutputCellIterator
had the same intention originally and was well meant, but it suffers from being a leaky abstraction. Lots of code is now built around an implicit assumption thatOutputCellIterator
will always advance by exactly 1 or 2 columns. Using thetil
UTF-16 helpers directly elsewhere in our code would have a similar effect in my opinion, because it would equally leak (and potentially incorrectly leak) any assumptions about howTextBuffer
handles incoming text under normal circumstances.