Skip to content
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

[pull] main from microsoft:main #201

Merged
merged 11 commits into from
Jul 15, 2024
Merged
19 changes: 7 additions & 12 deletions doc/COOKED_READ_DATA.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@

All of the following ✅ marks must be fulfilled during manual testing:
* ASCII input
* Chinese input (中文維基百科) ❔
* Resizing the window properly wraps/unwraps wide glyphs ❌
Broken due to `TextBuffer::Reflow` bugs
* Surrogate pair input (🙂) ❔
* Resizing the window properly wraps/unwraps surrogate pairs ❌
Broken due to `TextBuffer::Reflow` bugs
* Chinese input (中文維基百科) ✅
* Surrogate pair input (🙂) ✅
* In cmd.exe
* Create 2 file: "a😊b.txt" and "a😟b.txt"
* Press tab: Autocomplete to "a😊b.txt" ✅
Expand Down Expand Up @@ -62,21 +58,20 @@ All of the following ✅ marks must be fulfilled during manual testing:
* F6 inserts Ctrl+Z ✅
* F7 without modifiers starts "command list" prompt ✅
* Escape dismisses prompt ✅
* Minimum size of 40x10 characters ✅
* Width expands to fit the widest history command ✅
* Entries wider than the window width are truncated ✅
* Height expands up to 20 rows with longer histories ✅
* F9 starts "command number" prompt ✅
* Left/Right paste replace the buffer with the given command ✅
* Left/Right replace the buffer with the given command ✅
* And put cursor at the end of the buffer ✅
* Up/Down navigate selection through history ✅
* Stops at start/end with <10 entries ✅
* Stops at start/end with >20 entries ✅
* Wide text rendering during pagination with >20 entries
* Scrolls through the entries if there are too many
* Shift+Up/Down moves history items around ✅
* Home navigates to first entry ✅
* End navigates to last entry ✅
* PageUp navigates by 20 items at a time or to first ✅
* PageDown navigates by 20 items at a time or to last ✅
* PageUp navigates by $height items at a time or to first ✅
* PageDown navigates by $height items at a time or to last ✅
* Alt+F7 clears command history ✅
* F8 cycles through commands that start with the same text as
the current buffer up until the current cursor position ✅
Expand Down
7 changes: 4 additions & 3 deletions src/buffer/out/Row.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -985,14 +985,15 @@ uint16_t ROW::size() const noexcept
til::CoordType ROW::GetLastNonSpaceColumn() const noexcept
{
const auto text = GetText();
const auto beg = text.begin();
const auto end = text.end();
const auto beg = text.data();
const auto end = beg + text.size();
#pragma warning(suppress : 26429) // Symbol 'it' is never tested for nullness, it can be marked as not_null (f.23).
auto it = end;

for (; it != beg; --it)
{
// it[-1] is safe as `it` is always greater than `beg` (loop invariant).
if (til::at(it, -1) != L' ')
if (it[-1] != L' ')
{
break;
}
Expand Down
13 changes: 0 additions & 13 deletions src/buffer/out/cursor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ Cursor::Cursor(const ULONG ulSize, TextBuffer& parentBuffer) noexcept :
_fBlinkingAllowed(true),
_fDelay(false),
_fIsConversionArea(false),
_fIsPopupShown(false),
_fDelayedEolWrap(false),
_fDeferCursorRedraw(false),
_fHaveDeferredCursorRedraw(false),
Expand Down Expand Up @@ -66,11 +65,6 @@ bool Cursor::IsConversionArea() const noexcept
return _fIsConversionArea;
}

bool Cursor::IsPopupShown() const noexcept
{
return _fIsPopupShown;
}

bool Cursor::GetDelay() const noexcept
{
return _fDelay;
Expand Down Expand Up @@ -126,13 +120,6 @@ void Cursor::SetIsConversionArea(const bool fIsConversionArea) noexcept
_RedrawCursorAlways();
}

void Cursor::SetIsPopupShown(const bool fIsPopupShown) noexcept
{
// Functionally the same as "Hide cursor"
_fIsPopupShown = fIsPopupShown;
_RedrawCursorAlways();
}

void Cursor::SetDelay(const bool fDelay) noexcept
{
_fDelay = fDelay;
Expand Down
3 changes: 0 additions & 3 deletions src/buffer/out/cursor.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class Cursor final
bool IsBlinkingAllowed() const noexcept;
bool IsDouble() const noexcept;
bool IsConversionArea() const noexcept;
bool IsPopupShown() const noexcept;
bool GetDelay() const noexcept;
ULONG GetSize() const noexcept;
til::point GetPosition() const noexcept;
Expand All @@ -61,7 +60,6 @@ class Cursor final
void SetBlinkingAllowed(const bool fIsOn) noexcept;
void SetIsDouble(const bool fIsDouble) noexcept;
void SetIsConversionArea(const bool fIsConversionArea) noexcept;
void SetIsPopupShown(const bool fIsPopupShown) noexcept;
void SetDelay(const bool fDelay) noexcept;
void SetSize(const ULONG ulSize) noexcept;
void SetStyle(const ULONG ulSize, const CursorType type) noexcept;
Expand Down Expand Up @@ -99,7 +97,6 @@ class Cursor final
bool _fBlinkingAllowed; //Whether or not the cursor is allowed to blink at all. only set through VT (^[[?12h/l)
bool _fDelay; // don't blink scursor on next timer message
bool _fIsConversionArea; // is attached to a conversion area so it doesn't actually need to display the cursor.
bool _fIsPopupShown; // if a popup is being shown, turn off, stop blinking.

bool _fDelayedEolWrap; // don't wrap at EOL till the next char comes in.
til::point _coordDelayedAt; // coordinate the EOL wrap was delayed at.
Expand Down
3 changes: 1 addition & 2 deletions src/buffer/out/lib/bufferout.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
<ItemGroup>
<ClInclude Include="..\cursor.h" />
<ClInclude Include="..\DbcsAttribute.hpp" />
<ClInclude Include="..\ICharRow.hpp" />
<ClInclude Include="..\ImageSlice.hpp" />
<ClInclude Include="..\LineRendition.hpp" />
<ClInclude Include="..\OutputCell.hpp" />
Expand All @@ -52,4 +51,4 @@
<!-- Careful reordering these. Some default props (contained in these files) are order sensitive. -->
<Import Project="$(SolutionDir)src\common.build.post.props" />
<Import Project="$(SolutionDir)src\common.nugetversions.targets" />
</Project>
</Project>
3 changes: 2 additions & 1 deletion src/buffer/out/textBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,6 @@ size_t TextBuffer::FitTextIntoColumns(const std::wstring_view& chars, til::Coord
while (dist < len)
{
cwd.GraphemeNext(state, chars);
dist += state.len;
col += state.width;

// If we ran out of columns, we need to always return `columnLimit` and not `cols`,
Expand All @@ -457,6 +456,8 @@ size_t TextBuffer::FitTextIntoColumns(const std::wstring_view& chars, til::Coord
columns = columnLimit;
return dist;
}

dist += state.len;
}

// But if we simply ran out of text we just need to return the actual number of columns.
Expand Down
3 changes: 3 additions & 0 deletions src/cascadia/TerminalApp/ActionPreviewHandlers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ namespace winrt::TerminalApp::implementation
case ShortcutAction::SendInput:
_PreviewSendInput(args.Args().try_as<SendInputArgs>());
break;
default:
_EndPreview();
return;
}

// GH#9818 Other ideas for actions that could be preview-able:
Expand Down
2 changes: 1 addition & 1 deletion src/cascadia/TerminalApp/AppCommandlineArgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ void AppCommandlineArgs::_buildFocusPaneParser()

void AppCommandlineArgs::_buildSaveSnippetParser()
{
_saveCommand = _app.add_subcommand("x-save-snippet", RS_A(L"SaveSnippetDesc"));
_saveCommand = _app.add_subcommand("x-save", RS_A(L"SaveSnippetDesc"));

auto setupSubcommand = [this](auto* subcommand) {
subcommand->add_option("--name,-n", _saveInputName, RS_A(L"SaveSnippetArgDesc"));
Expand Down
21 changes: 21 additions & 0 deletions src/cascadia/TerminalApp/BasicPaneEvents.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

#pragma once

namespace winrt::TerminalApp::implementation
{
struct BasicPaneEvents
{
til::typed_event<> ConnectionStateChanged;
til::typed_event<IPaneContent> CloseRequested;
til::typed_event<IPaneContent, winrt::TerminalApp::BellEventArgs> BellRequested;
til::typed_event<IPaneContent> TitleChanged;
til::typed_event<IPaneContent> TabColorChanged;
til::typed_event<IPaneContent> TaskbarProgressChanged;
til::typed_event<IPaneContent> ReadOnlyChanged;
til::typed_event<IPaneContent> FocusRequested;

til::typed_event<winrt::Windows::Foundation::IInspectable, Microsoft::Terminal::Settings::Model::Command> DispatchCommandRequested;
};
}
20 changes: 20 additions & 0 deletions src/cascadia/TerminalApp/Resources/de-DE/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,20 @@
<value>Schnipsel</value>
<comment>Header for a page that includes small "snippets" of text for the user to enter</comment>
</data>
<data name="SnippetsFilterBox.PlaceholderText" xml:space="preserve">
<value>Codeausschnitte filtern...</value>
<comment>Placeholder text for a text box to filter snippets (on the same page as the 'SnippetPaneTitle')</comment>
</data>
<data name="SnippetPlayButton.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
<value>Geben Sie diesen Befehl ein.</value>
</data>
<data name="SnippetPlayButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Geben Sie diesen Befehl ein.</value>
</data>
<data name="SnippetsPaneNoneFoundHeader.Text" xml:space="preserve">
<value>In Ihren Einstellungen wurden keine Codeausschnitte gefunden.</value>
<comment>Text shown to user when no snippets are found in their settings</comment>
</data>
<data name="SnippetsPaneNoneFoundDetails.Text" xml:space="preserve">
<value>Fügen Sie einige Aktionen "Eingabe senden" in Ihren Einstellungen hinzu, damit sie hier angezeigt werden.</value>
<comment>Additional information presented to the user to let them know they can add a "Send input" action in their setting to populate the snippets pane</comment>
Expand All @@ -916,4 +930,10 @@
<data name="ActionSaveFailedToast.Title" xml:space="preserve">
<value>Fehler beim Speichern der Aktion</value>
</data>
<data name="CloseSnippetsPaneButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Bereich schließen</value>
</data>
<data name="CloseSnippetsPaneButton.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
<value>Bereich schließen</value>
</data>
</root>
20 changes: 20 additions & 0 deletions src/cascadia/TerminalApp/Resources/es-ES/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,20 @@
<value>Fragmentos</value>
<comment>Header for a page that includes small "snippets" of text for the user to enter</comment>
</data>
<data name="SnippetsFilterBox.PlaceholderText" xml:space="preserve">
<value>Filtrar fragmentos de código...</value>
<comment>Placeholder text for a text box to filter snippets (on the same page as the 'SnippetPaneTitle')</comment>
</data>
<data name="SnippetPlayButton.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
<value>Escribir este comando</value>
</data>
<data name="SnippetPlayButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Escribir este comando</value>
</data>
<data name="SnippetsPaneNoneFoundHeader.Text" xml:space="preserve">
<value>No se encontraron fragmentos de código en la configuración.</value>
<comment>Text shown to user when no snippets are found in their settings</comment>
</data>
<data name="SnippetsPaneNoneFoundDetails.Text" xml:space="preserve">
<value>Agrega algunas acciones de "Enviar entrada" en la configuración para que se muestren aquí.</value>
<comment>Additional information presented to the user to let them know they can add a "Send input" action in their setting to populate the snippets pane</comment>
Expand All @@ -913,4 +927,10 @@
<data name="ActionSaveFailedToast.Title" xml:space="preserve">
<value>Error al guardar la acción</value>
</data>
<data name="CloseSnippetsPaneButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Cerrar panel</value>
</data>
<data name="CloseSnippetsPaneButton.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
<value>Cerrar panel</value>
</data>
</root>
20 changes: 20 additions & 0 deletions src/cascadia/TerminalApp/Resources/fr-FR/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,20 @@
<value>Extraits</value>
<comment>Header for a page that includes small "snippets" of text for the user to enter</comment>
</data>
<data name="SnippetsFilterBox.PlaceholderText" xml:space="preserve">
<value>Filtrer les extraits de code...</value>
<comment>Placeholder text for a text box to filter snippets (on the same page as the 'SnippetPaneTitle')</comment>
</data>
<data name="SnippetPlayButton.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
<value>Entrer cette commande</value>
</data>
<data name="SnippetPlayButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Entrer cette commande</value>
</data>
<data name="SnippetsPaneNoneFoundHeader.Text" xml:space="preserve">
<value>Aucun extrait n'a été trouvé dans vos paramètres.</value>
<comment>Text shown to user when no snippets are found in their settings</comment>
</data>
<data name="SnippetsPaneNoneFoundDetails.Text" xml:space="preserve">
<value>Ajoutez des actions « Envoyer une entrée » dans vos paramètres pour les afficher ici.</value>
<comment>Additional information presented to the user to let them know they can add a "Send input" action in their setting to populate the snippets pane</comment>
Expand All @@ -913,4 +927,10 @@
<data name="ActionSaveFailedToast.Title" xml:space="preserve">
<value>Échec de l’enregistrement de l’action</value>
</data>
<data name="CloseSnippetsPaneButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Fermer le volet</value>
</data>
<data name="CloseSnippetsPaneButton.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
<value>Fermer le volet</value>
</data>
</root>
20 changes: 20 additions & 0 deletions src/cascadia/TerminalApp/Resources/it-IT/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,20 @@
<value>Frammenti</value>
<comment>Header for a page that includes small "snippets" of text for the user to enter</comment>
</data>
<data name="SnippetsFilterBox.PlaceholderText" xml:space="preserve">
<value>Filtra frammenti...</value>
<comment>Placeholder text for a text box to filter snippets (on the same page as the 'SnippetPaneTitle')</comment>
</data>
<data name="SnippetPlayButton.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
<value>Immettere questo comando</value>
</data>
<data name="SnippetPlayButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Immettere questo comando</value>
</data>
<data name="SnippetsPaneNoneFoundHeader.Text" xml:space="preserve">
<value>Non sono stati trovati frammenti nelle impostazioni.</value>
<comment>Text shown to user when no snippets are found in their settings</comment>
</data>
<data name="SnippetsPaneNoneFoundDetails.Text" xml:space="preserve">
<value>Aggiungi alcune azioni "Invia input" nelle impostazioni per visualizzarle qui.</value>
<comment>Additional information presented to the user to let them know they can add a "Send input" action in their setting to populate the snippets pane</comment>
Expand All @@ -913,4 +927,10 @@
<data name="ActionSaveFailedToast.Title" xml:space="preserve">
<value>Salvataggio dell'azione non riuscito</value>
</data>
<data name="CloseSnippetsPaneButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>Chiudi il riquadro</value>
</data>
<data name="CloseSnippetsPaneButton.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
<value>Chiudi il riquadro</value>
</data>
</root>
6 changes: 6 additions & 0 deletions src/cascadia/TerminalApp/Resources/ja-JP/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -928,4 +928,10 @@
<data name="ActionSaveFailedToast.Title" xml:space="preserve">
<value>操作の保存に失敗しました</value>
</data>
<data name="CloseSnippetsPaneButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>ウィンドウを閉じる</value>
</data>
<data name="CloseSnippetsPaneButton.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
<value>ウィンドウを閉じる</value>
</data>
</root>
20 changes: 20 additions & 0 deletions src/cascadia/TerminalApp/Resources/ko-KR/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,20 @@
<value>짧은 요약</value>
<comment>Header for a page that includes small "snippets" of text for the user to enter</comment>
</data>
<data name="SnippetsFilterBox.PlaceholderText" xml:space="preserve">
<value>코드 조각 필터링...</value>
<comment>Placeholder text for a text box to filter snippets (on the same page as the 'SnippetPaneTitle')</comment>
</data>
<data name="SnippetPlayButton.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
<value>이 명령 입력</value>
</data>
<data name="SnippetPlayButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>이 명령 입력</value>
</data>
<data name="SnippetsPaneNoneFoundHeader.Text" xml:space="preserve">
<value>설정에서 코드 조각을 찾을 수 없습니다.</value>
<comment>Text shown to user when no snippets are found in their settings</comment>
</data>
<data name="SnippetsPaneNoneFoundDetails.Text" xml:space="preserve">
<value>설정에 "입력 보내기" 작업을 추가하여 여기에 표시합니다.</value>
<comment>Additional information presented to the user to let them know they can add a "Send input" action in their setting to populate the snippets pane</comment>
Expand All @@ -913,4 +927,10 @@
<data name="ActionSaveFailedToast.Title" xml:space="preserve">
<value>작업을 저장하지 못함</value>
</data>
<data name="CloseSnippetsPaneButton.[using:Windows.UI.Xaml.Automation]AutomationProperties.Name" xml:space="preserve">
<value>창 닫기</value>
</data>
<data name="CloseSnippetsPaneButton.[using:Windows.UI.Xaml.Controls]ToolTipService.ToolTip" xml:space="preserve">
<value>창 닫기</value>
</data>
</root>
Loading
Loading