From 58fd1b219ca3361539d9c02d32c8c143d1ef610a Mon Sep 17 00:00:00 2001 From: Pankaj Bhojwani Date: Thu, 29 Jul 2021 10:27:02 -0700 Subject: [PATCH 01/13] highlight cursor --- .../TerminalApp/AppActionHandlers.cpp | 10 ++ src/cascadia/TerminalControl/TermControl.cpp | 24 ++++ src/cascadia/TerminalControl/TermControl.h | 2 + src/cascadia/TerminalControl/TermControl.idl | 2 + src/cascadia/TerminalControl/TermControl.xaml | 1 + src/cascadia/TerminalControl/XamlLights.cpp | 87 ++++++------- src/cascadia/TerminalControl/XamlLights.h | 114 ++++++++++++++---- src/cascadia/TerminalControl/XamlLights.idl | 17 ++- .../TerminalSettingsModel/ActionAndArgs.cpp | 2 + .../AllShortcutActions.h | 3 +- .../Resources/en-US/Resources.resw | 3 + 11 files changed, 190 insertions(+), 75 deletions(-) diff --git a/src/cascadia/TerminalApp/AppActionHandlers.cpp b/src/cascadia/TerminalApp/AppActionHandlers.cpp index 5b045ec98f0..cce49a5ad3a 100644 --- a/src/cascadia/TerminalApp/AppActionHandlers.cpp +++ b/src/cascadia/TerminalApp/AppActionHandlers.cpp @@ -851,4 +851,14 @@ namespace winrt::TerminalApp::implementation } } } + + void TerminalPage::_HandleHighlightCursor(const IInspectable& /*sender*/, + const ActionEventArgs& args) + { + if (const auto termControl{ _GetActiveControl() }) + { + termControl.HighlightCursor(); + args.Handled(true); + } + } } diff --git a/src/cascadia/TerminalControl/TermControl.cpp b/src/cascadia/TerminalControl/TermControl.cpp index 435dbc178ea..0ede13d87b8 100644 --- a/src/cascadia/TerminalControl/TermControl.cpp +++ b/src/cascadia/TerminalControl/TermControl.cpp @@ -2366,6 +2366,30 @@ namespace winrt::Microsoft::Terminal::Control::implementation return _core.TaskbarProgress(); } + void TermControl::HighlightCursor() + { + if (CursorLight::GetIsTarget(RootGrid())) + { + CursorLight::SetIsTarget(RootGrid(), false); + } + else + { + const auto charSizeInPixels = CharacterDimensions(); + const auto htInDips = charSizeInPixels.Height / SwapChainPanel().CompositionScaleY(); + const auto wtInDips = charSizeInPixels.Width / SwapChainPanel().CompositionScaleX(); + + const til::size marginsInDips{ til::math::rounding, GetPadding().Left, GetPadding().Top }; + const til::size fontSize{ til::math::rounding, _core.FontSize() }; + const til::point cursorPos = _core.CursorPosition(); + const til::point cursorPosInPixels{ cursorPos * fontSize }; + const til::point cursorPosInDIPs{ cursorPosInPixels / SwapChainPanel().CompositionScaleX() }; + const til::point cursorLocationInDIPs{ cursorPosInDIPs + marginsInDips }; + CursorLight().ChangeLocation(gsl::narrow_cast(cursorLocationInDIPs.x()) + wtInDips / 2, + gsl::narrow_cast(cursorLocationInDIPs.y()) + htInDips / 2); + CursorLight::SetIsTarget(RootGrid(), true); + } + } + void TermControl::BellLightOn() { // Initialize the animation if it does not exist diff --git a/src/cascadia/TerminalControl/TermControl.h b/src/cascadia/TerminalControl/TermControl.h index a074e020eff..357a814b16b 100644 --- a/src/cascadia/TerminalControl/TermControl.h +++ b/src/cascadia/TerminalControl/TermControl.h @@ -100,6 +100,8 @@ namespace winrt::Microsoft::Terminal::Control::implementation void BellLightOn(); + void HighlightCursor(); + bool ReadOnly() const noexcept; void ToggleReadOnly(); diff --git a/src/cascadia/TerminalControl/TermControl.idl b/src/cascadia/TerminalControl/TermControl.idl index 1a043e95b5e..95e75670e5e 100644 --- a/src/cascadia/TerminalControl/TermControl.idl +++ b/src/cascadia/TerminalControl/TermControl.idl @@ -65,6 +65,8 @@ namespace Microsoft.Terminal.Control void BellLightOn(); + void HighlightCursor(); + Boolean ReadOnly { get; }; void ToggleReadOnly(); } diff --git a/src/cascadia/TerminalControl/TermControl.xaml b/src/cascadia/TerminalControl/TermControl.xaml index 94aa92c5fa0..547765c324b 100644 --- a/src/cascadia/TerminalControl/TermControl.xaml +++ b/src/cascadia/TerminalControl/TermControl.xaml @@ -35,6 +35,7 @@ + diff --git a/src/cascadia/TerminalControl/XamlLights.cpp b/src/cascadia/TerminalControl/XamlLights.cpp index 2bf8b1e831d..9aebcc4e8b8 100644 --- a/src/cascadia/TerminalControl/XamlLights.cpp +++ b/src/cascadia/TerminalControl/XamlLights.cpp @@ -5,6 +5,7 @@ #include "TermControl.h" #include "XamlLights.h" #include "VisualBellLight.g.cpp" +#include "CursorLight.g.cpp" using namespace winrt::Windows::UI::Xaml; using namespace winrt::Windows::UI::Xaml::Media; @@ -12,11 +13,7 @@ using namespace winrt::Windows::UI::Xaml::Media; namespace winrt::Microsoft::Terminal::Control::implementation { DependencyProperty VisualBellLight::_IsTargetProperty{ nullptr }; - - VisualBellLight::VisualBellLight() - { - _InitializeProperties(); - } + DependencyProperty CursorLight::_IsTargetProperty{ nullptr }; void VisualBellLight::_InitializeProperties() { @@ -49,59 +46,55 @@ namespace winrt::Microsoft::Terminal::Control::implementation } } - // Method Description: - // - This function is called when there are no more target UIElements on the screen - // - Disposes of composition resources when no longer in use - // Arguments: - // - oldElement: unused - void VisualBellLight::OnDisconnected(UIElement const& /* oldElement */) + void CursorLight::_InitializeProperties() { - if (CompositionLight()) + // Initialize any dependency properties here. + // This performs a lazy load on these properties, instead of + // initializing them when the DLL loads. + if (!_IsTargetProperty) { - CompositionLight(nullptr); + _IsTargetProperty = + DependencyProperty::RegisterAttached( + L"IsTarget", + winrt::xaml_typename(), + winrt::xaml_typename(), + PropertyMetadata{ winrt::box_value(false), PropertyChangedCallback{ &CursorLight::OnIsTargetChanged } }); } } - winrt::hstring VisualBellLight::GetId() - { - return VisualBellLight::GetIdStatic(); - } - - void VisualBellLight::OnIsTargetChanged(DependencyObject const& d, DependencyPropertyChangedEventArgs const& e) + void CursorLight::ChangeLocation(float xCoord, float yCoord) { - const auto uielem{ d.try_as() }; - const auto brush{ d.try_as() }; - - if (!uielem && !brush) + if (CompositionLight()) { - // terminate early - return; + const auto ay = CompositionLight().as(); + ay.Offset({ xCoord, yCoord, 100 }); } - - const auto isAdding = winrt::unbox_value(e.NewValue()); - const auto id = GetIdStatic(); - - if (isAdding) + else { - if (uielem) - { - XamlLight::AddTargetElement(id, uielem); - } - else - { - XamlLight::AddTargetBrush(id, brush); - } + auto spotLight{ Window::Current().Compositor().CreateSpotLight() }; + spotLight.InnerConeColor(Windows::UI::Colors::White()); + spotLight.InnerConeAngleInDegrees(10); + spotLight.OuterConeAngleInDegrees(10); + spotLight.Offset({ xCoord, yCoord, 100 }); + CompositionLight(spotLight); } - else + } + + // Method Description: + // - This function is called when the first target UIElement is shown on the screen, + // this enables delaying composition object creation until it's actually necessary. + // Arguments: + // - newElement: unused + void CursorLight::OnConnected(UIElement const& /* newElement */) + { + if (!CompositionLight()) { - if (uielem) - { - XamlLight::RemoveTargetElement(id, uielem); - } - else - { - XamlLight::RemoveTargetBrush(id, brush); - } + auto spotLight{ Window::Current().Compositor().CreateSpotLight() }; + spotLight.InnerConeColor(Windows::UI::Colors::White()); + spotLight.OuterConeColor(Windows::UI::Colors::White()); + spotLight.InnerConeAngleInDegrees(10); + spotLight.OuterConeAngleInDegrees(25); + CompositionLight(spotLight); } } } diff --git a/src/cascadia/TerminalControl/XamlLights.h b/src/cascadia/TerminalControl/XamlLights.h index c0542f71685..d706f3e4843 100644 --- a/src/cascadia/TerminalControl/XamlLights.h +++ b/src/cascadia/TerminalControl/XamlLights.h @@ -5,37 +5,104 @@ #include "cppwinrt_utils.h" #include "VisualBellLight.g.h" +#include "CursorLight.g.h" + +#define CREATE_XAML_LIGHT(name) \ +public: \ + name() \ + { \ + _InitializeProperties(); \ + } \ + \ + winrt::hstring GetId() \ + { \ + return name::GetIdStatic(); \ + } \ + \ + static Windows::UI::Xaml::DependencyProperty IsTargetProperty() \ + { \ + return _IsTargetProperty; \ + } \ + \ + static bool GetIsTarget(Windows::UI::Xaml::DependencyObject const& target) \ + { \ + return winrt::unbox_value(target.GetValue(_IsTargetProperty)); \ + } \ + \ + static void SetIsTarget(Windows::UI::Xaml::DependencyObject const& target, bool value) \ + { \ + target.SetValue(_IsTargetProperty, winrt::box_value(value)); \ + } \ + \ + void OnDisconnected(Windows::UI::Xaml::UIElement const& /*oldElement*/) \ + { \ + if (CompositionLight()) \ + { \ + CompositionLight(nullptr); \ + } \ + } \ + \ + static void OnIsTargetChanged(Windows::UI::Xaml::DependencyObject const& d, Windows::UI::Xaml::DependencyPropertyChangedEventArgs const& e) \ + { \ + const auto uielem{ d.try_as() }; \ + const auto brush{ d.try_as() }; \ + \ + if (!uielem && !brush) \ + { \ + /* terminate early*/ \ + return; \ + } \ + \ + const auto isAdding = winrt::unbox_value(e.NewValue()); \ + const auto id = GetIdStatic(); \ + \ + if (isAdding) \ + { \ + if (uielem) \ + { \ + Windows::UI::Xaml::Media::XamlLight::AddTargetElement(id, uielem); \ + } \ + else \ + { \ + Windows::UI::Xaml::Media::XamlLight::AddTargetBrush(id, brush); \ + } \ + } \ + else \ + { \ + if (uielem) \ + { \ + Windows::UI::Xaml::Media::XamlLight::RemoveTargetElement(id, uielem); \ + } \ + else \ + { \ + Windows::UI::Xaml::Media::XamlLight::RemoveTargetBrush(id, brush); \ + } \ + } \ + } \ + \ + inline static winrt::hstring GetIdStatic() \ + { \ + /* This specifies the unique name of the light. In most cases you should use the type's full name. */ \ + return winrt::xaml_typename().Name; \ + } namespace winrt::Microsoft::Terminal::Control::implementation { struct VisualBellLight : VisualBellLightT { - VisualBellLight(); - - winrt::hstring GetId(); - - static Windows::UI::Xaml::DependencyProperty IsTargetProperty() { return _IsTargetProperty; } - - static bool GetIsTarget(Windows::UI::Xaml::DependencyObject const& target) - { - return winrt::unbox_value(target.GetValue(_IsTargetProperty)); - } - - static void SetIsTarget(Windows::UI::Xaml::DependencyObject const& target, bool value) - { - target.SetValue(_IsTargetProperty, winrt::box_value(value)); - } - + CREATE_XAML_LIGHT(VisualBellLight); void OnConnected(Windows::UI::Xaml::UIElement const& newElement); - void OnDisconnected(Windows::UI::Xaml::UIElement const& oldElement); - static void OnIsTargetChanged(Windows::UI::Xaml::DependencyObject const& d, Windows::UI::Xaml::DependencyPropertyChangedEventArgs const& e); + private: + static void _InitializeProperties(); + static Windows::UI::Xaml::DependencyProperty _IsTargetProperty; + }; - inline static winrt::hstring GetIdStatic() - { - // This specifies the unique name of the light. In most cases you should use the type's full name. - return winrt::xaml_typename().Name; - } + struct CursorLight : CursorLightT + { + CREATE_XAML_LIGHT(CursorLight); + void ChangeLocation(float xCoord, float yCoord); + void OnConnected(Windows::UI::Xaml::UIElement const& newElement); private: static void _InitializeProperties(); @@ -46,4 +113,5 @@ namespace winrt::Microsoft::Terminal::Control::implementation namespace winrt::Microsoft::Terminal::Control::factory_implementation { BASIC_FACTORY(VisualBellLight); + BASIC_FACTORY(CursorLight); } diff --git a/src/cascadia/TerminalControl/XamlLights.idl b/src/cascadia/TerminalControl/XamlLights.idl index 78a536c4a8a..776aa7a7a26 100644 --- a/src/cascadia/TerminalControl/XamlLights.idl +++ b/src/cascadia/TerminalControl/XamlLights.idl @@ -1,13 +1,22 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. +#define XAML_LIGHT(Name) \ + Name(); \ + static Windows.UI.Xaml.DependencyProperty IsTargetProperty { get; }; \ + static Boolean GetIsTarget(Windows.UI.Xaml.DependencyObject target); \ + static void SetIsTarget(Windows.UI.Xaml.DependencyObject target, Boolean value) + namespace Microsoft.Terminal.Control { [default_interface] runtimeclass VisualBellLight : Windows.UI.Xaml.Media.XamlLight { - VisualBellLight(); - static Windows.UI.Xaml.DependencyProperty IsTargetProperty { get; }; - static Boolean GetIsTarget(Windows.UI.Xaml.DependencyObject target); - static void SetIsTarget(Windows.UI.Xaml.DependencyObject target, Boolean value); + XAML_LIGHT(VisualBellLight); + } + + [default_interface] runtimeclass CursorLight : Windows.UI.Xaml.Media.XamlLight + { + XAML_LIGHT(CursorLight); + void ChangeLocation(Single xCoord, Single yCoord); } } diff --git a/src/cascadia/TerminalSettingsModel/ActionAndArgs.cpp b/src/cascadia/TerminalSettingsModel/ActionAndArgs.cpp index f6c397605ac..92e905faced 100644 --- a/src/cascadia/TerminalSettingsModel/ActionAndArgs.cpp +++ b/src/cascadia/TerminalSettingsModel/ActionAndArgs.cpp @@ -63,6 +63,7 @@ static constexpr std::string_view OpenWindowRenamerKey{ "openWindowRenamer" }; static constexpr std::string_view GlobalSummonKey{ "globalSummon" }; static constexpr std::string_view QuakeModeKey{ "quakeMode" }; static constexpr std::string_view FocusPaneKey{ "focusPane" }; +static constexpr std::string_view HighlightCursorKey{ "highlightCursor" }; static constexpr std::string_view ActionKey{ "action" }; @@ -362,6 +363,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation { ShortcutAction::GlobalSummon, L"" }, // Intentionally omitted, must be generated by GenerateName { ShortcutAction::QuakeMode, RS_(L"QuakeModeCommandKey") }, { ShortcutAction::FocusPane, L"" }, // Intentionally omitted, must be generated by GenerateName + { ShortcutAction::HighlightCursor, RS_(L"HighlightCursorCommandKey") }, }; }(); diff --git a/src/cascadia/TerminalSettingsModel/AllShortcutActions.h b/src/cascadia/TerminalSettingsModel/AllShortcutActions.h index ca795bf6cda..2cbaef05b35 100644 --- a/src/cascadia/TerminalSettingsModel/AllShortcutActions.h +++ b/src/cascadia/TerminalSettingsModel/AllShortcutActions.h @@ -76,7 +76,8 @@ ON_ALL_ACTIONS(OpenWindowRenamer) \ ON_ALL_ACTIONS(GlobalSummon) \ ON_ALL_ACTIONS(QuakeMode) \ - ON_ALL_ACTIONS(FocusPane) + ON_ALL_ACTIONS(FocusPane) \ + ON_ALL_ACTIONS(HighlightCursor) #define ALL_SHORTCUT_ACTIONS_WITH_ARGS \ ON_ALL_ACTIONS_WITH_ARGS(AdjustFontSize) \ diff --git a/src/cascadia/TerminalSettingsModel/Resources/en-US/Resources.resw b/src/cascadia/TerminalSettingsModel/Resources/en-US/Resources.resw index 99af72c2365..74b00135618 100644 --- a/src/cascadia/TerminalSettingsModel/Resources/en-US/Resources.resw +++ b/src/cascadia/TerminalSettingsModel/Resources/en-US/Resources.resw @@ -178,6 +178,9 @@ Close window + + Highlight cursor + Command Prompt This is the name of "Command Prompt", as localized in Windows. The localization here should match the one in the Windows product for "Command Prompt" From e7d8fdb1543ea759d81a6d7f6c64f7328aad5817 Mon Sep 17 00:00:00 2001 From: Pankaj Bhojwani Date: Thu, 29 Jul 2021 10:51:13 -0700 Subject: [PATCH 02/13] safer access light --- src/cascadia/TerminalControl/XamlLights.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/cascadia/TerminalControl/XamlLights.cpp b/src/cascadia/TerminalControl/XamlLights.cpp index 9aebcc4e8b8..9ab49eb2be5 100644 --- a/src/cascadia/TerminalControl/XamlLights.cpp +++ b/src/cascadia/TerminalControl/XamlLights.cpp @@ -64,10 +64,12 @@ namespace winrt::Microsoft::Terminal::Control::implementation void CursorLight::ChangeLocation(float xCoord, float yCoord) { - if (CompositionLight()) + if (const auto light = CompositionLight()) { - const auto ay = CompositionLight().as(); - ay.Offset({ xCoord, yCoord, 100 }); + if (const auto cursorLight = light.try_as()) + { + cursorLight.Offset({ xCoord, yCoord, 100 }); + } } else { From 59cf2a6d4a21759fb1c5b88526a4b4f61eca0f8e Mon Sep 17 00:00:00 2001 From: Pankaj Bhojwani Date: Thu, 29 Jul 2021 10:57:19 -0700 Subject: [PATCH 03/13] minor --- src/cascadia/TerminalControl/XamlLights.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/cascadia/TerminalControl/XamlLights.cpp b/src/cascadia/TerminalControl/XamlLights.cpp index 9ab49eb2be5..83315e92a92 100644 --- a/src/cascadia/TerminalControl/XamlLights.cpp +++ b/src/cascadia/TerminalControl/XamlLights.cpp @@ -76,7 +76,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation auto spotLight{ Window::Current().Compositor().CreateSpotLight() }; spotLight.InnerConeColor(Windows::UI::Colors::White()); spotLight.InnerConeAngleInDegrees(10); - spotLight.OuterConeAngleInDegrees(10); + spotLight.OuterConeAngleInDegrees(25); spotLight.Offset({ xCoord, yCoord, 100 }); CompositionLight(spotLight); } @@ -93,7 +93,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation { auto spotLight{ Window::Current().Compositor().CreateSpotLight() }; spotLight.InnerConeColor(Windows::UI::Colors::White()); - spotLight.OuterConeColor(Windows::UI::Colors::White()); spotLight.InnerConeAngleInDegrees(10); spotLight.OuterConeAngleInDegrees(25); CompositionLight(spotLight); From 2af96f18af7c56ec72cc3dcc77fbc38b9dec7b33 Mon Sep 17 00:00:00 2001 From: Pankaj Bhojwani Date: Tue, 3 Aug 2021 11:57:15 -0700 Subject: [PATCH 04/13] accidental removal --- .../AllShortcutActions.h | 109 +++++++++--------- 1 file changed, 55 insertions(+), 54 deletions(-) diff --git a/src/cascadia/TerminalSettingsModel/AllShortcutActions.h b/src/cascadia/TerminalSettingsModel/AllShortcutActions.h index 2cbaef05b35..f163f9e2f87 100644 --- a/src/cascadia/TerminalSettingsModel/AllShortcutActions.h +++ b/src/cascadia/TerminalSettingsModel/AllShortcutActions.h @@ -23,60 +23,61 @@ // each action. This is _NOT_ something that should be used when any individual // case should be customized. -#define ALL_SHORTCUT_ACTIONS \ - ON_ALL_ACTIONS(CopyText) \ - ON_ALL_ACTIONS(PasteText) \ - ON_ALL_ACTIONS(OpenNewTabDropdown) \ - ON_ALL_ACTIONS(DuplicateTab) \ - ON_ALL_ACTIONS(NewTab) \ - ON_ALL_ACTIONS(CloseWindow) \ - ON_ALL_ACTIONS(CloseTab) \ - ON_ALL_ACTIONS(ClosePane) \ - ON_ALL_ACTIONS(NextTab) \ - ON_ALL_ACTIONS(PrevTab) \ - ON_ALL_ACTIONS(SendInput) \ - ON_ALL_ACTIONS(SplitPane) \ - ON_ALL_ACTIONS(TogglePaneZoom) \ - ON_ALL_ACTIONS(SwitchToTab) \ - ON_ALL_ACTIONS(AdjustFontSize) \ - ON_ALL_ACTIONS(ResetFontSize) \ - ON_ALL_ACTIONS(ScrollUp) \ - ON_ALL_ACTIONS(ScrollDown) \ - ON_ALL_ACTIONS(ScrollUpPage) \ - ON_ALL_ACTIONS(ScrollDownPage) \ - ON_ALL_ACTIONS(ScrollToTop) \ - ON_ALL_ACTIONS(ScrollToBottom) \ - ON_ALL_ACTIONS(ResizePane) \ - ON_ALL_ACTIONS(MoveFocus) \ - ON_ALL_ACTIONS(MovePane) \ - ON_ALL_ACTIONS(Find) \ - ON_ALL_ACTIONS(ToggleShaderEffects) \ - ON_ALL_ACTIONS(ToggleFocusMode) \ - ON_ALL_ACTIONS(ToggleFullscreen) \ - ON_ALL_ACTIONS(ToggleAlwaysOnTop) \ - ON_ALL_ACTIONS(OpenSettings) \ - ON_ALL_ACTIONS(SetColorScheme) \ - ON_ALL_ACTIONS(SetTabColor) \ - ON_ALL_ACTIONS(OpenTabColorPicker) \ - ON_ALL_ACTIONS(RenameTab) \ - ON_ALL_ACTIONS(OpenTabRenamer) \ - ON_ALL_ACTIONS(ExecuteCommandline) \ - ON_ALL_ACTIONS(ToggleCommandPalette) \ - ON_ALL_ACTIONS(CloseOtherTabs) \ - ON_ALL_ACTIONS(CloseTabsAfter) \ - ON_ALL_ACTIONS(TabSearch) \ - ON_ALL_ACTIONS(MoveTab) \ - ON_ALL_ACTIONS(BreakIntoDebugger) \ - ON_ALL_ACTIONS(TogglePaneReadOnly) \ - ON_ALL_ACTIONS(FindMatch) \ - ON_ALL_ACTIONS(NewWindow) \ - ON_ALL_ACTIONS(IdentifyWindow) \ - ON_ALL_ACTIONS(IdentifyWindows) \ - ON_ALL_ACTIONS(RenameWindow) \ - ON_ALL_ACTIONS(OpenWindowRenamer) \ - ON_ALL_ACTIONS(GlobalSummon) \ - ON_ALL_ACTIONS(QuakeMode) \ - ON_ALL_ACTIONS(FocusPane) \ +#define ALL_SHORTCUT_ACTIONS \ + ON_ALL_ACTIONS(CopyText) \ + ON_ALL_ACTIONS(PasteText) \ + ON_ALL_ACTIONS(OpenNewTabDropdown) \ + ON_ALL_ACTIONS(DuplicateTab) \ + ON_ALL_ACTIONS(NewTab) \ + ON_ALL_ACTIONS(CloseWindow) \ + ON_ALL_ACTIONS(CloseTab) \ + ON_ALL_ACTIONS(ClosePane) \ + ON_ALL_ACTIONS(NextTab) \ + ON_ALL_ACTIONS(PrevTab) \ + ON_ALL_ACTIONS(SendInput) \ + ON_ALL_ACTIONS(SplitPane) \ + ON_ALL_ACTIONS(TogglePaneZoom) \ + ON_ALL_ACTIONS(ToggleSplitOrientation) \ + ON_ALL_ACTIONS(SwitchToTab) \ + ON_ALL_ACTIONS(AdjustFontSize) \ + ON_ALL_ACTIONS(ResetFontSize) \ + ON_ALL_ACTIONS(ScrollUp) \ + ON_ALL_ACTIONS(ScrollDown) \ + ON_ALL_ACTIONS(ScrollUpPage) \ + ON_ALL_ACTIONS(ScrollDownPage) \ + ON_ALL_ACTIONS(ScrollToTop) \ + ON_ALL_ACTIONS(ScrollToBottom) \ + ON_ALL_ACTIONS(ResizePane) \ + ON_ALL_ACTIONS(MoveFocus) \ + ON_ALL_ACTIONS(MovePane) \ + ON_ALL_ACTIONS(Find) \ + ON_ALL_ACTIONS(ToggleShaderEffects) \ + ON_ALL_ACTIONS(ToggleFocusMode) \ + ON_ALL_ACTIONS(ToggleFullscreen) \ + ON_ALL_ACTIONS(ToggleAlwaysOnTop) \ + ON_ALL_ACTIONS(OpenSettings) \ + ON_ALL_ACTIONS(SetColorScheme) \ + ON_ALL_ACTIONS(SetTabColor) \ + ON_ALL_ACTIONS(OpenTabColorPicker) \ + ON_ALL_ACTIONS(RenameTab) \ + ON_ALL_ACTIONS(OpenTabRenamer) \ + ON_ALL_ACTIONS(ExecuteCommandline) \ + ON_ALL_ACTIONS(ToggleCommandPalette) \ + ON_ALL_ACTIONS(CloseOtherTabs) \ + ON_ALL_ACTIONS(CloseTabsAfter) \ + ON_ALL_ACTIONS(TabSearch) \ + ON_ALL_ACTIONS(MoveTab) \ + ON_ALL_ACTIONS(BreakIntoDebugger) \ + ON_ALL_ACTIONS(TogglePaneReadOnly) \ + ON_ALL_ACTIONS(FindMatch) \ + ON_ALL_ACTIONS(NewWindow) \ + ON_ALL_ACTIONS(IdentifyWindow) \ + ON_ALL_ACTIONS(IdentifyWindows) \ + ON_ALL_ACTIONS(RenameWindow) \ + ON_ALL_ACTIONS(OpenWindowRenamer) \ + ON_ALL_ACTIONS(GlobalSummon) \ + ON_ALL_ACTIONS(QuakeMode) \ + ON_ALL_ACTIONS(FocusPane) \ ON_ALL_ACTIONS(HighlightCursor) #define ALL_SHORTCUT_ACTIONS_WITH_ARGS \ From cf6e1b4800ddfceb6a95167c591cd0d414d47c0c Mon Sep 17 00:00:00 2001 From: Pankaj Bhojwani Date: Tue, 3 Aug 2021 11:58:28 -0700 Subject: [PATCH 05/13] Reduce diff --- src/cascadia/TerminalSettingsModel/AllShortcutActions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cascadia/TerminalSettingsModel/AllShortcutActions.h b/src/cascadia/TerminalSettingsModel/AllShortcutActions.h index f163f9e2f87..0ad908669eb 100644 --- a/src/cascadia/TerminalSettingsModel/AllShortcutActions.h +++ b/src/cascadia/TerminalSettingsModel/AllShortcutActions.h @@ -36,8 +36,8 @@ ON_ALL_ACTIONS(PrevTab) \ ON_ALL_ACTIONS(SendInput) \ ON_ALL_ACTIONS(SplitPane) \ - ON_ALL_ACTIONS(TogglePaneZoom) \ ON_ALL_ACTIONS(ToggleSplitOrientation) \ + ON_ALL_ACTIONS(TogglePaneZoom) \ ON_ALL_ACTIONS(SwitchToTab) \ ON_ALL_ACTIONS(AdjustFontSize) \ ON_ALL_ACTIONS(ResetFontSize) \ From 02dad2a3480728397e3fcefb46f611f39a1d6c7b Mon Sep 17 00:00:00 2001 From: Pankaj Bhojwani Date: Wed, 4 Aug 2021 13:45:40 -0700 Subject: [PATCH 06/13] incomplete cursor offscreen --- src/cascadia/TerminalControl/ControlCore.cpp | 12 ++++++++++++ src/cascadia/TerminalControl/ControlCore.h | 1 + src/cascadia/TerminalControl/ControlCore.idl | 1 + src/cascadia/TerminalControl/TermControl.cpp | 2 +- src/cascadia/TerminalCore/Terminal.cpp | 13 +++++++++++++ src/cascadia/TerminalCore/Terminal.hpp | 1 + 6 files changed, 29 insertions(+), 1 deletion(-) diff --git a/src/cascadia/TerminalControl/ControlCore.cpp b/src/cascadia/TerminalControl/ControlCore.cpp index bf106322ae9..c7d1432fb17 100644 --- a/src/cascadia/TerminalControl/ControlCore.cpp +++ b/src/cascadia/TerminalControl/ControlCore.cpp @@ -1297,6 +1297,18 @@ namespace winrt::Microsoft::Terminal::Control::implementation return _terminal != nullptr && _terminal->IsTrackingMouseInput(); } + bool ControlCore::IsCursorOffScreen() const + { + // If we haven't been initialized yet, then just return true + if (!_initializedTerminal) + { + return true; + } + + auto lock = _terminal->LockForReading(); + return _terminal->IsCursorOffScreen(); + } + til::point ControlCore::CursorPosition() const { // If we haven't been initialized yet, then fake it. diff --git a/src/cascadia/TerminalControl/ControlCore.h b/src/cascadia/TerminalControl/ControlCore.h index 855aa66d398..cae128104cb 100644 --- a/src/cascadia/TerminalControl/ControlCore.h +++ b/src/cascadia/TerminalControl/ControlCore.h @@ -120,6 +120,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation void CursorOn(const bool isCursorOn); bool IsVtMouseModeEnabled() const; + bool IsCursorOffScreen() const; til::point CursorPosition() const; bool HasSelection() const; diff --git a/src/cascadia/TerminalControl/ControlCore.idl b/src/cascadia/TerminalControl/ControlCore.idl index fa4746ca404..60276a39710 100644 --- a/src/cascadia/TerminalControl/ControlCore.idl +++ b/src/cascadia/TerminalControl/ControlCore.idl @@ -80,6 +80,7 @@ namespace Microsoft.Terminal.Control Boolean IsInReadOnlyMode { get; }; Boolean CursorOn; void EnablePainting(); + Boolean IsCursorOffScreen(); event FontSizeChangedEventArgs FontSizeChanged; diff --git a/src/cascadia/TerminalControl/TermControl.cpp b/src/cascadia/TerminalControl/TermControl.cpp index 597fe8c40ee..3a6ece837f2 100644 --- a/src/cascadia/TerminalControl/TermControl.cpp +++ b/src/cascadia/TerminalControl/TermControl.cpp @@ -2392,13 +2392,13 @@ namespace winrt::Microsoft::Terminal::Control::implementation const auto charSizeInPixels = CharacterDimensions(); const auto htInDips = charSizeInPixels.Height / SwapChainPanel().CompositionScaleY(); const auto wtInDips = charSizeInPixels.Width / SwapChainPanel().CompositionScaleX(); - const til::size marginsInDips{ til::math::rounding, GetPadding().Left, GetPadding().Top }; const til::size fontSize{ til::math::rounding, _core.FontSize() }; const til::point cursorPos = _core.CursorPosition(); const til::point cursorPosInPixels{ cursorPos * fontSize }; const til::point cursorPosInDIPs{ cursorPosInPixels / SwapChainPanel().CompositionScaleX() }; const til::point cursorLocationInDIPs{ cursorPosInDIPs + marginsInDips }; + const auto ay = _core.IsCursorOffScreen(); CursorLight().ChangeLocation(gsl::narrow_cast(cursorLocationInDIPs.x()) + wtInDips / 2, gsl::narrow_cast(cursorLocationInDIPs.y()) + htInDips / 2); CursorLight::SetIsTarget(RootGrid(), true); diff --git a/src/cascadia/TerminalCore/Terminal.cpp b/src/cascadia/TerminalCore/Terminal.cpp index 68e8424ed53..ce7b4948577 100644 --- a/src/cascadia/TerminalCore/Terminal.cpp +++ b/src/cascadia/TerminalCore/Terminal.cpp @@ -1208,6 +1208,19 @@ bool Terminal::IsCursorBlinkingAllowed() const noexcept return cursor.IsBlinkingAllowed(); } +bool Terminal::IsCursorOffScreen() noexcept +{ + const auto absoluteCursorPos = _buffer->GetCursor().GetPosition(); + const auto viewport = _GetMutableViewport(); + const auto ht = viewport.Height(); + const auto wt = viewport.Width(); + const auto orHt = viewport.Origin().Y; + const auto orWt = viewport.Origin().X; + const auto scrollOffset = GetScrollOffset(); + const auto bufHt = GetBufferHeight(); + return absoluteCursorPos.Y > viewport.Height() + viewport.Origin().Y - 1 || absoluteCursorPos.X > viewport.Width() + viewport.Origin().X - 1; +} + // Method Description: // - Update our internal knowledge about where regex patterns are on the screen // - This is called by TerminalControl (through a throttled function) when the visible diff --git a/src/cascadia/TerminalCore/Terminal.hpp b/src/cascadia/TerminalCore/Terminal.hpp index aeabebc3be3..95ec5f1dcf1 100644 --- a/src/cascadia/TerminalCore/Terminal.hpp +++ b/src/cascadia/TerminalCore/Terminal.hpp @@ -213,6 +213,7 @@ class Microsoft::Terminal::Core::Terminal final : void SetCursorOn(const bool isOn); bool IsCursorBlinkingAllowed() const noexcept; + bool IsCursorOffScreen() noexcept; void UpdatePatternsUnderLock() noexcept; void ClearPatternTree() noexcept; From b0e9bf33f2de251f9aac61fc491d2bd58eaa4353 Mon Sep 17 00:00:00 2001 From: Pankaj Bhojwani Date: Mon, 9 Aug 2021 11:08:02 -0700 Subject: [PATCH 07/13] check if cursor off screen --- src/cascadia/TerminalControl/TermControl.cpp | 3 +-- src/cascadia/TerminalCore/Terminal.cpp | 10 +++------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/cascadia/TerminalControl/TermControl.cpp b/src/cascadia/TerminalControl/TermControl.cpp index 3a6ece837f2..24c5a6b5917 100644 --- a/src/cascadia/TerminalControl/TermControl.cpp +++ b/src/cascadia/TerminalControl/TermControl.cpp @@ -2387,7 +2387,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation { CursorLight::SetIsTarget(RootGrid(), false); } - else + else if (!_core.IsCursorOffScreen()) { const auto charSizeInPixels = CharacterDimensions(); const auto htInDips = charSizeInPixels.Height / SwapChainPanel().CompositionScaleY(); @@ -2398,7 +2398,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation const til::point cursorPosInPixels{ cursorPos * fontSize }; const til::point cursorPosInDIPs{ cursorPosInPixels / SwapChainPanel().CompositionScaleX() }; const til::point cursorLocationInDIPs{ cursorPosInDIPs + marginsInDips }; - const auto ay = _core.IsCursorOffScreen(); CursorLight().ChangeLocation(gsl::narrow_cast(cursorLocationInDIPs.x()) + wtInDips / 2, gsl::narrow_cast(cursorLocationInDIPs.y()) + htInDips / 2); CursorLight::SetIsTarget(RootGrid(), true); diff --git a/src/cascadia/TerminalCore/Terminal.cpp b/src/cascadia/TerminalCore/Terminal.cpp index ce7b4948577..85febeab889 100644 --- a/src/cascadia/TerminalCore/Terminal.cpp +++ b/src/cascadia/TerminalCore/Terminal.cpp @@ -1210,15 +1210,11 @@ bool Terminal::IsCursorBlinkingAllowed() const noexcept bool Terminal::IsCursorOffScreen() noexcept { - const auto absoluteCursorPos = _buffer->GetCursor().GetPosition(); + const auto absoluteCursorPosY = _buffer->GetCursor().GetPosition().Y; const auto viewport = _GetMutableViewport(); - const auto ht = viewport.Height(); - const auto wt = viewport.Width(); - const auto orHt = viewport.Origin().Y; - const auto orWt = viewport.Origin().X; + const auto viewHeight = viewport.Height(); const auto scrollOffset = GetScrollOffset(); - const auto bufHt = GetBufferHeight(); - return absoluteCursorPos.Y > viewport.Height() + viewport.Origin().Y - 1 || absoluteCursorPos.X > viewport.Width() + viewport.Origin().X - 1; + return absoluteCursorPosY < scrollOffset || absoluteCursorPosY >= (scrollOffset + viewHeight); } // Method Description: From 0be9b2afecb34ff47cf784151c74b9360e84f80f Mon Sep 17 00:00:00 2001 From: Pankaj Bhojwani Date: Mon, 9 Aug 2021 11:24:00 -0700 Subject: [PATCH 08/13] comments --- src/cascadia/TerminalControl/TermControl.cpp | 5 +++++ src/cascadia/TerminalControl/XamlLights.cpp | 22 ++++++++++++++------ src/cascadia/TerminalControl/XamlLights.h | 2 ++ src/cascadia/TerminalCore/Terminal.cpp | 8 ++++--- 4 files changed, 28 insertions(+), 9 deletions(-) diff --git a/src/cascadia/TerminalControl/TermControl.cpp b/src/cascadia/TerminalControl/TermControl.cpp index 24c5a6b5917..6b2d37dbc8c 100644 --- a/src/cascadia/TerminalControl/TermControl.cpp +++ b/src/cascadia/TerminalControl/TermControl.cpp @@ -2381,6 +2381,9 @@ namespace winrt::Microsoft::Terminal::Control::implementation return _core.TaskbarProgress(); } + // Method Description: + // - Toggles the spotlight on the cursor + // - If the cursor is currently off the screen, does nothing void TermControl::HighlightCursor() { if (CursorLight::GetIsTarget(RootGrid())) @@ -2389,6 +2392,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation } else if (!_core.IsCursorOffScreen()) { + // Compute the location of where to place the light const auto charSizeInPixels = CharacterDimensions(); const auto htInDips = charSizeInPixels.Height / SwapChainPanel().CompositionScaleY(); const auto wtInDips = charSizeInPixels.Width / SwapChainPanel().CompositionScaleX(); @@ -2398,6 +2402,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation const til::point cursorPosInPixels{ cursorPos * fontSize }; const til::point cursorPosInDIPs{ cursorPosInPixels / SwapChainPanel().CompositionScaleX() }; const til::point cursorLocationInDIPs{ cursorPosInDIPs + marginsInDips }; + CursorLight().ChangeLocation(gsl::narrow_cast(cursorLocationInDIPs.x()) + wtInDips / 2, gsl::narrow_cast(cursorLocationInDIPs.y()) + htInDips / 2); CursorLight::SetIsTarget(RootGrid(), true); diff --git a/src/cascadia/TerminalControl/XamlLights.cpp b/src/cascadia/TerminalControl/XamlLights.cpp index 83315e92a92..e1f3a44ecc1 100644 --- a/src/cascadia/TerminalControl/XamlLights.cpp +++ b/src/cascadia/TerminalControl/XamlLights.cpp @@ -73,12 +73,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation } else { - auto spotLight{ Window::Current().Compositor().CreateSpotLight() }; - spotLight.InnerConeColor(Windows::UI::Colors::White()); - spotLight.InnerConeAngleInDegrees(10); - spotLight.OuterConeAngleInDegrees(25); - spotLight.Offset({ xCoord, yCoord, 100 }); - CompositionLight(spotLight); + _InitializeHelper(xCoord, yCoord); } } @@ -88,6 +83,20 @@ namespace winrt::Microsoft::Terminal::Control::implementation // Arguments: // - newElement: unused void CursorLight::OnConnected(UIElement const& /* newElement */) + { + if (!CompositionLight()) + { + _InitializeHelper(0, 0); + } + } + + // Method Description: + // - Helper to initialize the propoerties of the spotlight such as the location and + // the angles of the inner and outer cones + // Arguments: + // - xCoord: the x-coordinate of where to put the light + // - yCoord: the y-coordinate of where to put the light + void CursorLight::_InitializeHelper(float xCoord, float yCoord) { if (!CompositionLight()) { @@ -95,6 +104,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation spotLight.InnerConeColor(Windows::UI::Colors::White()); spotLight.InnerConeAngleInDegrees(10); spotLight.OuterConeAngleInDegrees(25); + spotLight.Offset({ xCoord, yCoord, 100 }); CompositionLight(spotLight); } } diff --git a/src/cascadia/TerminalControl/XamlLights.h b/src/cascadia/TerminalControl/XamlLights.h index d706f3e4843..18ee01d2943 100644 --- a/src/cascadia/TerminalControl/XamlLights.h +++ b/src/cascadia/TerminalControl/XamlLights.h @@ -107,6 +107,8 @@ namespace winrt::Microsoft::Terminal::Control::implementation private: static void _InitializeProperties(); static Windows::UI::Xaml::DependencyProperty _IsTargetProperty; + + void _InitializeHelper(float xCoord, float yCoord); }; } diff --git a/src/cascadia/TerminalCore/Terminal.cpp b/src/cascadia/TerminalCore/Terminal.cpp index 85febeab889..e70cc46fac2 100644 --- a/src/cascadia/TerminalCore/Terminal.cpp +++ b/src/cascadia/TerminalCore/Terminal.cpp @@ -1208,13 +1208,15 @@ bool Terminal::IsCursorBlinkingAllowed() const noexcept return cursor.IsBlinkingAllowed(); } +// Method Description: +// - Computes whether the cursor is currently off the screen +// Return value: +// - True if the cursor if off the screen, false otherwise bool Terminal::IsCursorOffScreen() noexcept { const auto absoluteCursorPosY = _buffer->GetCursor().GetPosition().Y; - const auto viewport = _GetMutableViewport(); - const auto viewHeight = viewport.Height(); const auto scrollOffset = GetScrollOffset(); - return absoluteCursorPosY < scrollOffset || absoluteCursorPosY >= (scrollOffset + viewHeight); + return absoluteCursorPosY < scrollOffset || absoluteCursorPosY >= (scrollOffset + _GetMutableViewport().Height()); } // Method Description: From ce8288f1b1341a06c0f64cb5c85b47e08cdcaa99 Mon Sep 17 00:00:00 2001 From: Pankaj Bhojwani Date: Mon, 9 Aug 2021 11:52:39 -0700 Subject: [PATCH 09/13] Schema --- doc/cascadia/profiles.schema.json | 13 +++++++++++++ src/cascadia/TerminalControl/XamlLights.cpp | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/doc/cascadia/profiles.schema.json b/doc/cascadia/profiles.schema.json index 2b078d00d5e..5c3963610dd 100644 --- a/doc/cascadia/profiles.schema.json +++ b/doc/cascadia/profiles.schema.json @@ -235,6 +235,7 @@ "findMatch", "focusPane", "globalSummon", + "highlightCursor", "identifyWindow", "identifyWindows", "moveFocus", @@ -959,6 +960,17 @@ } ] }, + "HighlightCursorAction": { + "description": "The action to shine a spotlight on the current cursor location. If the cursor is off the screen, this action does nothing.", + "allOf": [ + { "$ref": "#/definitions/ShortcutAction" }, + { + "properties": { + "action": { "type": "string", "pattern": "highlightCursor" } + } + } + ] + }, "Keybinding": { "additionalProperties": false, "properties": { @@ -994,6 +1006,7 @@ { "$ref": "#/definitions/FocusPaneAction" }, { "$ref": "#/definitions/GlobalSummonAction" }, { "$ref": "#/definitions/QuakeModeAction" }, + { "$ref": "#/definitions/HighlightCursorAction" }, { "type": "null" } ] }, diff --git a/src/cascadia/TerminalControl/XamlLights.cpp b/src/cascadia/TerminalControl/XamlLights.cpp index e1f3a44ecc1..4807ef74b6e 100644 --- a/src/cascadia/TerminalControl/XamlLights.cpp +++ b/src/cascadia/TerminalControl/XamlLights.cpp @@ -91,7 +91,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation } // Method Description: - // - Helper to initialize the propoerties of the spotlight such as the location and + // - Helper to initialize the properties of the spotlight such as the location and // the angles of the inner and outer cones // Arguments: // - xCoord: the x-coordinate of where to put the light From 08e012aa6c537a3b5e255e2f3babb2e9a6e6d562 Mon Sep 17 00:00:00 2001 From: Pankaj Bhojwani Date: Tue, 10 Aug 2021 13:02:18 -0700 Subject: [PATCH 10/13] initialize to macro --- src/cascadia/TerminalControl/XamlLights.cpp | 32 ---- src/cascadia/TerminalControl/XamlLights.h | 180 ++++++++++---------- 2 files changed, 94 insertions(+), 118 deletions(-) diff --git a/src/cascadia/TerminalControl/XamlLights.cpp b/src/cascadia/TerminalControl/XamlLights.cpp index 4807ef74b6e..bc8db8728d9 100644 --- a/src/cascadia/TerminalControl/XamlLights.cpp +++ b/src/cascadia/TerminalControl/XamlLights.cpp @@ -15,22 +15,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation DependencyProperty VisualBellLight::_IsTargetProperty{ nullptr }; DependencyProperty CursorLight::_IsTargetProperty{ nullptr }; - void VisualBellLight::_InitializeProperties() - { - // Initialize any dependency properties here. - // This performs a lazy load on these properties, instead of - // initializing them when the DLL loads. - if (!_IsTargetProperty) - { - _IsTargetProperty = - DependencyProperty::RegisterAttached( - L"IsTarget", - winrt::xaml_typename(), - winrt::xaml_typename(), - PropertyMetadata{ winrt::box_value(false), PropertyChangedCallback{ &VisualBellLight::OnIsTargetChanged } }); - } - } - // Method Description: // - This function is called when the first target UIElement is shown on the screen, // this enables delaying composition object creation until it's actually necessary. @@ -46,22 +30,6 @@ namespace winrt::Microsoft::Terminal::Control::implementation } } - void CursorLight::_InitializeProperties() - { - // Initialize any dependency properties here. - // This performs a lazy load on these properties, instead of - // initializing them when the DLL loads. - if (!_IsTargetProperty) - { - _IsTargetProperty = - DependencyProperty::RegisterAttached( - L"IsTarget", - winrt::xaml_typename(), - winrt::xaml_typename(), - PropertyMetadata{ winrt::box_value(false), PropertyChangedCallback{ &CursorLight::OnIsTargetChanged } }); - } - } - void CursorLight::ChangeLocation(float xCoord, float yCoord) { if (const auto light = CompositionLight()) diff --git a/src/cascadia/TerminalControl/XamlLights.h b/src/cascadia/TerminalControl/XamlLights.h index 18ee01d2943..04233ef7a9f 100644 --- a/src/cascadia/TerminalControl/XamlLights.h +++ b/src/cascadia/TerminalControl/XamlLights.h @@ -7,107 +7,115 @@ #include "VisualBellLight.g.h" #include "CursorLight.g.h" -#define CREATE_XAML_LIGHT(name) \ -public: \ - name() \ - { \ - _InitializeProperties(); \ - } \ - \ - winrt::hstring GetId() \ - { \ - return name::GetIdStatic(); \ - } \ - \ - static Windows::UI::Xaml::DependencyProperty IsTargetProperty() \ - { \ - return _IsTargetProperty; \ - } \ - \ - static bool GetIsTarget(Windows::UI::Xaml::DependencyObject const& target) \ - { \ - return winrt::unbox_value(target.GetValue(_IsTargetProperty)); \ - } \ - \ - static void SetIsTarget(Windows::UI::Xaml::DependencyObject const& target, bool value) \ - { \ - target.SetValue(_IsTargetProperty, winrt::box_value(value)); \ - } \ - \ - void OnDisconnected(Windows::UI::Xaml::UIElement const& /*oldElement*/) \ - { \ - if (CompositionLight()) \ - { \ - CompositionLight(nullptr); \ - } \ - } \ - \ - static void OnIsTargetChanged(Windows::UI::Xaml::DependencyObject const& d, Windows::UI::Xaml::DependencyPropertyChangedEventArgs const& e) \ - { \ - const auto uielem{ d.try_as() }; \ - const auto brush{ d.try_as() }; \ - \ - if (!uielem && !brush) \ - { \ - /* terminate early*/ \ - return; \ - } \ - \ - const auto isAdding = winrt::unbox_value(e.NewValue()); \ - const auto id = GetIdStatic(); \ - \ - if (isAdding) \ - { \ - if (uielem) \ - { \ - Windows::UI::Xaml::Media::XamlLight::AddTargetElement(id, uielem); \ - } \ - else \ - { \ - Windows::UI::Xaml::Media::XamlLight::AddTargetBrush(id, brush); \ - } \ - } \ - else \ - { \ - if (uielem) \ - { \ - Windows::UI::Xaml::Media::XamlLight::RemoveTargetElement(id, uielem); \ - } \ - else \ - { \ - Windows::UI::Xaml::Media::XamlLight::RemoveTargetBrush(id, brush); \ - } \ - } \ - } \ - \ - inline static winrt::hstring GetIdStatic() \ - { \ - /* This specifies the unique name of the light. In most cases you should use the type's full name. */ \ - return winrt::xaml_typename().Name; \ +#define CREATE_XAML_LIGHT(name) \ +public: \ + name() \ + { \ + _InitializeProperties(); \ + } \ + \ + winrt::hstring GetId() \ + { \ + return name::GetIdStatic(); \ + } \ + \ + static Windows::UI::Xaml::DependencyProperty IsTargetProperty() \ + { \ + return _IsTargetProperty; \ + } \ + \ + static bool GetIsTarget(Windows::UI::Xaml::DependencyObject const& target) \ + { \ + return winrt::unbox_value(target.GetValue(_IsTargetProperty)); \ + } \ + \ + static void SetIsTarget(Windows::UI::Xaml::DependencyObject const& target, bool value) \ + { \ + target.SetValue(_IsTargetProperty, winrt::box_value(value)); \ + } \ + \ + void OnDisconnected(Windows::UI::Xaml::UIElement const& /*oldElement*/) \ + { \ + if (CompositionLight()) \ + { \ + CompositionLight(nullptr); \ + } \ + } \ + \ + static void OnIsTargetChanged(Windows::UI::Xaml::DependencyObject const& d, Windows::UI::Xaml::DependencyPropertyChangedEventArgs const& e) \ + { \ + const auto uielem{ d.try_as() }; \ + const auto brush{ d.try_as() }; \ + \ + if (!uielem && !brush) \ + { \ + /* terminate early*/ \ + return; \ + } \ + \ + const auto isAdding = winrt::unbox_value(e.NewValue()); \ + const auto id = GetIdStatic(); \ + \ + if (isAdding) \ + { \ + if (uielem) \ + { \ + Windows::UI::Xaml::Media::XamlLight::AddTargetElement(id, uielem); \ + } \ + else \ + { \ + Windows::UI::Xaml::Media::XamlLight::AddTargetBrush(id, brush); \ + } \ + } \ + else \ + { \ + if (uielem) \ + { \ + Windows::UI::Xaml::Media::XamlLight::RemoveTargetElement(id, uielem); \ + } \ + else \ + { \ + Windows::UI::Xaml::Media::XamlLight::RemoveTargetBrush(id, brush); \ + } \ + } \ + } \ + \ + inline static winrt::hstring GetIdStatic() \ + { \ + /* This specifies the unique name of the light. In most cases you should use the type's full name. */ \ + return winrt::xaml_typename().Name; \ + } \ + \ +private: \ + static Windows::UI::Xaml::DependencyProperty _IsTargetProperty; \ + static void _InitializeProperties() \ + { \ + if (!_IsTargetProperty) \ + { \ + _IsTargetProperty = \ + Windows::UI::Xaml::DependencyProperty::RegisterAttached( \ + L"IsTarget", \ + winrt::xaml_typename(), \ + winrt::xaml_typename(), \ + Windows::UI::Xaml::PropertyMetadata{ winrt::box_value(false), Windows::UI::Xaml::PropertyChangedCallback{ &name::OnIsTargetChanged } }); \ + } \ } namespace winrt::Microsoft::Terminal::Control::implementation { struct VisualBellLight : VisualBellLightT { - CREATE_XAML_LIGHT(VisualBellLight); void OnConnected(Windows::UI::Xaml::UIElement const& newElement); - - private: - static void _InitializeProperties(); - static Windows::UI::Xaml::DependencyProperty _IsTargetProperty; + CREATE_XAML_LIGHT(VisualBellLight); }; struct CursorLight : CursorLightT { - CREATE_XAML_LIGHT(CursorLight); void ChangeLocation(float xCoord, float yCoord); void OnConnected(Windows::UI::Xaml::UIElement const& newElement); + CREATE_XAML_LIGHT(CursorLight); private: - static void _InitializeProperties(); - static Windows::UI::Xaml::DependencyProperty _IsTargetProperty; - void _InitializeHelper(float xCoord, float yCoord); }; } From bd876fda85cec6a60d4402bcc95fa091304a1574 Mon Sep 17 00:00:00 2001 From: Pankaj Bhojwani Date: Tue, 17 Aug 2021 14:22:44 -0700 Subject: [PATCH 11/13] move cursor with output/scroll --- src/cascadia/TerminalControl/ControlCore.cpp | 4 +++ src/cascadia/TerminalControl/ControlCore.h | 2 ++ src/cascadia/TerminalControl/ControlCore.idl | 2 ++ src/cascadia/TerminalControl/TermControl.cpp | 34 +++++++++++++++++++- src/cascadia/TerminalControl/TermControl.h | 3 ++ src/cascadia/TerminalCore/Terminal.cpp | 7 +++- src/cascadia/TerminalCore/Terminal.hpp | 4 +++ 7 files changed, 54 insertions(+), 2 deletions(-) diff --git a/src/cascadia/TerminalControl/ControlCore.cpp b/src/cascadia/TerminalControl/ControlCore.cpp index 42a9808f458..e557cc2243f 100644 --- a/src/cascadia/TerminalControl/ControlCore.cpp +++ b/src/cascadia/TerminalControl/ControlCore.cpp @@ -1506,4 +1506,8 @@ namespace winrt::Microsoft::Terminal::Control::implementation _updatePatternLocations->Run(); } + void ControlCore::TrackCursorMovement(bool track) noexcept + { + _terminal->TrackCursorMovement(track); + } } diff --git a/src/cascadia/TerminalControl/ControlCore.h b/src/cascadia/TerminalControl/ControlCore.h index 14bef9ff26b..a1aab5e082a 100644 --- a/src/cascadia/TerminalControl/ControlCore.h +++ b/src/cascadia/TerminalControl/ControlCore.h @@ -70,6 +70,8 @@ namespace winrt::Microsoft::Terminal::Control::implementation void AdjustOpacity(const double adjustment); void ResumeRendering(); + void TrackCursorMovement(bool track) noexcept; + void UpdatePatternLocations(); void SetHoveredCell(Core::Point terminalPosition); void ClearHoveredCell(); diff --git a/src/cascadia/TerminalControl/ControlCore.idl b/src/cascadia/TerminalControl/ControlCore.idl index 60276a39710..8167be49bca 100644 --- a/src/cascadia/TerminalControl/ControlCore.idl +++ b/src/cascadia/TerminalControl/ControlCore.idl @@ -69,6 +69,8 @@ namespace Microsoft.Terminal.Control void SetBackgroundOpacity(Double opacity); Microsoft.Terminal.Core.Color BackgroundColor { get; }; + void TrackCursorMovement(Boolean track); + Boolean HasSelection { get; }; IVector SelectedText(Boolean trimTrailingWhitespace); diff --git a/src/cascadia/TerminalControl/TermControl.cpp b/src/cascadia/TerminalControl/TermControl.cpp index 408a1478c63..1abea8853aa 100644 --- a/src/cascadia/TerminalControl/TermControl.cpp +++ b/src/cascadia/TerminalControl/TermControl.cpp @@ -118,6 +118,16 @@ namespace winrt::Microsoft::Terminal::Control::implementation } }); + _moveCursorLight = std::make_shared( + dispatcher, + ScrollBarUpdateInterval, + [weakThis = get_weak()]() { + if (auto control{ weakThis.get() }; !control->_IsClosing()) + { + control->_MoveCursorLight(); + } + }); + _updateScrollBar = std::make_shared>( dispatcher, ScrollBarUpdateInterval, @@ -1638,6 +1648,10 @@ namespace winrt::Microsoft::Terminal::Control::implementation update.newValue = args.ViewTop(); _updateScrollBar->Run(update); + if (CursorLight::GetIsTarget(RootGrid())) + { + _moveCursorLight->Run(); + } } // Method Description: @@ -1658,6 +1672,10 @@ namespace winrt::Microsoft::Terminal::Control::implementation if (auto control{ weakThis.get() }; !control->_IsClosing()) { control->TSFInputControl().TryRedrawCanvas(); + if (CursorLight::GetIsTarget(RootGrid())) + { + _MoveCursorLight(); + } } } @@ -2371,8 +2389,22 @@ namespace winrt::Microsoft::Terminal::Control::implementation if (CursorLight::GetIsTarget(RootGrid())) { CursorLight::SetIsTarget(RootGrid(), false); + _core.TrackCursorMovement(false); + } + else + { + _MoveCursorLight(); + _core.TrackCursorMovement(true); } - else if (!_core.IsCursorOffScreen()) + } + + void TermControl::_MoveCursorLight() + { + if (_core.IsCursorOffScreen()) + { + CursorLight::SetIsTarget(RootGrid(), false); + } + else { // Compute the location of where to place the light const auto charSizeInPixels = CharacterDimensions(); diff --git a/src/cascadia/TerminalControl/TermControl.h b/src/cascadia/TerminalControl/TermControl.h index d24e5c30d3c..b021f2498f7 100644 --- a/src/cascadia/TerminalControl/TermControl.h +++ b/src/cascadia/TerminalControl/TermControl.h @@ -156,6 +156,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation bool _initializedTerminal{ false }; std::shared_ptr _playWarningBell; + std::shared_ptr _moveCursorLight; struct ScrollBarUpdate { @@ -259,6 +260,8 @@ namespace winrt::Microsoft::Terminal::Control::implementation void _Search(const winrt::hstring& text, const bool goForward, const bool caseSensitive); void _CloseSearchBoxControl(const winrt::Windows::Foundation::IInspectable& sender, Windows::UI::Xaml::RoutedEventArgs const& args); + void _MoveCursorLight(); + // TSFInputControl Handlers void _CompositionCompleted(winrt::hstring text); void _CurrentCursorPositionHandler(const IInspectable& sender, const CursorPositionEventArgs& eventArgs); diff --git a/src/cascadia/TerminalCore/Terminal.cpp b/src/cascadia/TerminalCore/Terminal.cpp index f18fbfc7586..239d017ba0f 100644 --- a/src/cascadia/TerminalCore/Terminal.cpp +++ b/src/cascadia/TerminalCore/Terminal.cpp @@ -1053,12 +1053,17 @@ void Terminal::_AdjustCursorPosition(const COORD proposedPosition) // Firing the CursorPositionChanged event is very expensive so we try not to do that when // the cursor does not need to be redrawn. - if (!cursor.IsDeferDrawing()) + if (!cursor.IsDeferDrawing() || _trackingCursorMovement) { _NotifyTerminalCursorPositionChanged(); } } +void Terminal::TrackCursorMovement(bool track) noexcept +{ + _trackingCursorMovement = track; +} + void Terminal::UserScrollViewport(const int viewTop) { // we're going to modify state here that the renderer could be reading. diff --git a/src/cascadia/TerminalCore/Terminal.hpp b/src/cascadia/TerminalCore/Terminal.hpp index e78ebcd419e..a3aadd68bc2 100644 --- a/src/cascadia/TerminalCore/Terminal.hpp +++ b/src/cascadia/TerminalCore/Terminal.hpp @@ -218,6 +218,8 @@ class Microsoft::Terminal::Core::Terminal final : void UpdatePatternsUnderLock() noexcept; void ClearPatternTree() noexcept; + void TrackCursorMovement(bool track) noexcept; + const std::optional GetTabColor() const noexcept; til::color GetDefaultBackground() const noexcept; @@ -290,6 +292,8 @@ class Microsoft::Terminal::Core::Terminal final : size_t _hyperlinkPatternId; + bool _trackingCursorMovement{ false }; + std::wstring _workingDirectory; // This default fake font value is only used to check if the font is a raster font. From 8c293d8f60a5927e3eab5d1bbc4b06f8f5976b3f Mon Sep 17 00:00:00 2001 From: Pankaj Bhojwani Date: Tue, 17 Aug 2021 15:01:58 -0700 Subject: [PATCH 12/13] some comments, change name --- src/cascadia/TerminalControl/TermControl.cpp | 20 ++++++++++++++------ src/cascadia/TerminalControl/TermControl.h | 2 +- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/cascadia/TerminalControl/TermControl.cpp b/src/cascadia/TerminalControl/TermControl.cpp index 1abea8853aa..f7e5a91df76 100644 --- a/src/cascadia/TerminalControl/TermControl.cpp +++ b/src/cascadia/TerminalControl/TermControl.cpp @@ -124,7 +124,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation [weakThis = get_weak()]() { if (auto control{ weakThis.get() }; !control->_IsClosing()) { - control->_MoveCursorLight(); + control->_MoveCursorLightHelper(); } }); @@ -1674,7 +1674,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation control->TSFInputControl().TryRedrawCanvas(); if (CursorLight::GetIsTarget(RootGrid())) { - _MoveCursorLight(); + _MoveCursorLightHelper(); } } } @@ -2391,18 +2391,25 @@ namespace winrt::Microsoft::Terminal::Control::implementation CursorLight::SetIsTarget(RootGrid(), false); _core.TrackCursorMovement(false); } - else + else if (_MoveCursorLightHelper()) { - _MoveCursorLight(); + CursorLight::SetIsTarget(RootGrid(), true); _core.TrackCursorMovement(true); } } - void TermControl::_MoveCursorLight() + // Method Description: + // - Computes the cursor position and moves the cursor light to it + // Return Value: + // - True if the cursor light was moved, false otherwise (this will + // happen if the cursor is off-screen) + bool TermControl::_MoveCursorLightHelper() { if (_core.IsCursorOffScreen()) { + // If the cursor is off screen, just switch off the light instead of moving it CursorLight::SetIsTarget(RootGrid(), false); + return false; } else { @@ -2419,7 +2426,8 @@ namespace winrt::Microsoft::Terminal::Control::implementation CursorLight().ChangeLocation(gsl::narrow_cast(cursorLocationInDIPs.x()) + wtInDips / 2, gsl::narrow_cast(cursorLocationInDIPs.y()) + htInDips / 2); - CursorLight::SetIsTarget(RootGrid(), true); + + return true; } } diff --git a/src/cascadia/TerminalControl/TermControl.h b/src/cascadia/TerminalControl/TermControl.h index b021f2498f7..4fbddc06d7c 100644 --- a/src/cascadia/TerminalControl/TermControl.h +++ b/src/cascadia/TerminalControl/TermControl.h @@ -260,7 +260,7 @@ namespace winrt::Microsoft::Terminal::Control::implementation void _Search(const winrt::hstring& text, const bool goForward, const bool caseSensitive); void _CloseSearchBoxControl(const winrt::Windows::Foundation::IInspectable& sender, Windows::UI::Xaml::RoutedEventArgs const& args); - void _MoveCursorLight(); + bool _MoveCursorLightHelper(); // TSFInputControl Handlers void _CompositionCompleted(winrt::hstring text); From 8cd8e56434a3a0b8d8c3f1e57895ab37ceaca3b2 Mon Sep 17 00:00:00 2001 From: "Dustin L. Howett" Date: Thu, 2 Sep 2021 13:08:23 -0700 Subject: [PATCH 13/13] Migrate spelling-0.0.21 changes from main --- .github/actions/spelling/README.md | 15 + .github/actions/spelling/advice.md | 34 +- .github/actions/spelling/allow/allow.txt | 42 +- .github/actions/spelling/allow/apis.txt | 60 +- .github/actions/spelling/allow/math.txt | 8 + .github/actions/spelling/allow/microsoft.txt | 12 + .github/actions/spelling/allow/names.txt | 12 + .github/actions/spelling/candidate.patterns | 523 ++++++++++ .github/actions/spelling/excludes.txt | 48 +- .github/actions/spelling/expect/alphabet.txt | 8 - .github/actions/spelling/expect/expect.txt | 918 ++++-------------- .github/actions/spelling/expect/web.txt | 11 - .../actions/spelling/line_forbidden.patterns | 62 ++ .../actions/spelling/patterns/patterns.txt | 86 +- .github/actions/spelling/reject.txt | 28 +- .github/workflows/spelling2.yml | 132 ++- 16 files changed, 1181 insertions(+), 818 deletions(-) create mode 100644 .github/actions/spelling/README.md create mode 100644 .github/actions/spelling/candidate.patterns create mode 100644 .github/actions/spelling/line_forbidden.patterns diff --git a/.github/actions/spelling/README.md b/.github/actions/spelling/README.md new file mode 100644 index 00000000000..4c40f7f02ac --- /dev/null +++ b/.github/actions/spelling/README.md @@ -0,0 +1,15 @@ +# check-spelling/check-spelling configuration + +File | Purpose | Format | Info +-|-|-|- +[allow/*.txt](allow/) | Add words to the dictionary | one word per line (only letters and `'`s allowed) | [allow](https://github.com/check-spelling/check-spelling/wiki/Configuration#allow) +[reject.txt](reject.txt) | Remove words from the dictionary (after allow) | grep pattern matching whole dictionary words | [reject](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-reject) +[excludes.txt](excludes.txt) | Files to ignore entirely | perl regular expression | [excludes](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-excludes) +[patterns/*.txt](patterns/) | Patterns to ignore from checked lines | perl regular expression (order matters, first match wins) | [patterns](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-patterns) +[candidate.patterns](candidate.patterns) | Patterns that might be worth adding to [patterns.txt](patterns.txt) | perl regular expression with optional comment block introductions (all matches will be suggested) | [candidates](https://github.com/check-spelling/check-spelling/wiki/Feature:-Suggest-patterns) +[line_forbidden.patterns](line_forbidden.patterns) | Patterns to flag in checked lines | perl regular expression (order matters, first match wins) | [patterns](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-patterns) +[expect/*.txt](expect.txt) | Expected words that aren't in the dictionary | one word per line (sorted, alphabetically) | [expect](https://github.com/check-spelling/check-spelling/wiki/Configuration#expect) +[advice.md](advice.md) | Supplement for GitHub comment when unrecognized words are found | GitHub Markdown | [advice](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-advice) + +Note: you can replace any of these files with a directory by the same name (minus the suffix) +and then include multiple files inside that directory (with that suffix) to merge multiple files together. diff --git a/.github/actions/spelling/advice.md b/.github/actions/spelling/advice.md index 885b1a6978d..d82df49ee22 100644 --- a/.github/actions/spelling/advice.md +++ b/.github/actions/spelling/advice.md @@ -1,4 +1,4 @@ - +
:pencil2: Contributor please read this @@ -6,7 +6,7 @@ By default the command suggestion will generate a file named based on your commit. That's generally ok as long as you add the file to your commit. Someone can reorganize it later. -:warning: The command is written for posix shells. You can copy the contents of each `perl` command excluding the outer `'` marks and dropping any `'"`/`"'` quotation mark pairs into a file and then run `perl file.pl` from the root of the repository to run the code. Alternatively, you can manually insert the items... +:warning: The command is written for posix shells. If it doesn't work for you, you can manually _add_ (one word per line) / _remove_ items to `expect.txt` and the `excludes.txt` files. If the listed items are: @@ -20,31 +20,29 @@ See the `README.md` in each directory for more information. :microscope: You can test your commits **without** *appending* to a PR by creating a new branch with that extra change and pushing it to your fork. The [check-spelling](https://github.com/marketplace/actions/check-spelling) action will run in response to your **push** -- it doesn't require an open pull request. By using such a branch, you can limit the number of typos your peers see you make. :wink: -
:clamp: If you see a bunch of garbage -If it relates to a ... -
well-formed pattern +
If the flagged items are :exploding_head: false positives -See if there's a [pattern](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns) that would match it. +If items relate to a ... +* binary file (or some other file you wouldn't want to check at all). -If not, try writing one and adding it to a `patterns/{file}.txt`. + Please add a file path to the `excludes.txt` file matching the containing file. -Patterns are Perl 5 Regular Expressions - you can [test]( -https://www.regexplanet.com/advanced/perl/) yours before committing to verify it will match your lines. + File paths are Perl 5 Regular Expressions - you can [test]( +https://www.regexplanet.com/advanced/perl/) yours before committing to verify it will match your files. -Note that patterns can't match multiline strings. -
-
binary-ish string + `^` refers to the file's path from the root of the repository, so `^README\.md$` would exclude [README.md]( +../tree/HEAD/README.md) (on whichever branch you're using). -Please add a file path to the `excludes.txt` file instead of just accepting the garbage. +* well-formed pattern. -File paths are Perl 5 Regular Expressions - you can [test]( -https://www.regexplanet.com/advanced/perl/) yours before committing to verify it will match your files. + If you can write a [pattern](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns) that would match it, + try adding it to the `patterns.txt` file. -`^` refers to the file's path from the root of the repository, so `^README\.md$` would exclude [README.md]( -../tree/HEAD/README.md) (on whichever branch you're using). -
+ Patterns are Perl 5 Regular Expressions - you can [test]( +https://www.regexplanet.com/advanced/perl/) yours before committing to verify it will match your lines. + Note that patterns can't match multiline strings.
diff --git a/.github/actions/spelling/allow/allow.txt b/.github/actions/spelling/allow/allow.txt index eb9b2e27771..eaa0a471190 100644 --- a/.github/actions/spelling/allow/allow.txt +++ b/.github/actions/spelling/allow/allow.txt @@ -1,47 +1,75 @@ +admins +allcolors +Apc apc +breadcrumb +breadcrumbs +bsd calt ccmp -cybersecurity -Apc +changelog clickable clig +CMMI copyable +cybersecurity dalet -dcs Dcs +dcs dialytika dje downside downsides dze dzhe +EDDB +EDDC Enum'd Fitt formattings +FTCS ftp fvar +gantt +gcc geeksforgeeks ghe +github gje +godbolt hostname hostnames +https hyperlink hyperlinking hyperlinks +iconify img +inlined It'd kje +libfuzzer +libuv liga lje +Llast +llvm +Lmid locl +lol lorem +Lorigin maxed +minimalistic mkmk +mnt mru nje +noreply ogonek ok'd overlined +pipeline postmodern ptys qof @@ -56,17 +84,25 @@ runtimes shcha slnt Sos +ssh +timeline +timelines timestamped TLDR tokenizes tonos +toolset tshe +ubuntu uiatextrange UIs und unregister versioned +vsdevcmd We'd wildcards +XBox +YBox yeru zhe diff --git a/.github/actions/spelling/allow/apis.txt b/.github/actions/spelling/allow/apis.txt index 64d16180143..e0cc7550095 100644 --- a/.github/actions/spelling/allow/apis.txt +++ b/.github/actions/spelling/allow/apis.txt @@ -1,30 +1,44 @@ ACCEPTFILES ACCESSDENIED +acl +aclapi alignas alignof APPLYTOSUBMENUS +appxrecipe bitfield bitfields BUILDBRANCH BUILDMSG BUILDNUMBER +BYCOMMAND BYPOSITION charconv CLASSNOTAVAILABLE +CLOSEAPP cmdletbinding COLORPROPERTY colspan COMDLG +commandlinetoargv comparand cstdint CXICON CYICON +Dacl dataobject dcomp DERR dlldata +DNE DONTADDTORECENT +DWMSBT +DWMWA +DWMWA DWORDLONG +endfor +ENDSESSION +enumset environstrings EXPCMDFLAGS EXPCMDSTATE @@ -37,12 +51,16 @@ fullkbd futex GETDESKWALLPAPER GETHIGHCONTRAST +GETMOUSEHOVERTIME Hashtable HIGHCONTRASTON HIGHCONTRASTW hotkeys href hrgn +HTCLOSE +hwinsta +HWINSTA IActivation IApp IAppearance @@ -59,18 +77,22 @@ IDirect IExplorer IFACEMETHOD IFile +IGraphics IInheritable IMap +IMonarch IObject iosfwd IPackage IPeasant +ISetup isspace IStorage istream IStringable ITab ITaskbar +itow IUri IVirtual KEYSELECT @@ -79,17 +101,27 @@ llabs llu localtime lround +Lsa +lsass LSHIFT +LTGRAY +MAINWINDOW +memchr +memicmp MENUCOMMAND MENUDATA MENUINFO -memicmp -mptt +MENUITEMINFOW +mmeapi +MOUSELEAVE mov +mptt msappx MULTIPLEUSE NCHITTEST NCLBUTTONDBLCLK +NCMOUSELEAVE +NCMOUSEMOVE NCRBUTTONDBLCLK NIF NIN @@ -107,26 +139,36 @@ oaidl ocidl ODR offsetof +ofstream +onefuzz osver OSVERSIONINFOEXW otms OUTLINETEXTMETRICW overridable +PACL PAGESCROLL +PATINVERT +PEXPLICIT PICKFOLDERS pmr +ptstr +QUERYENDSESSION rcx REGCLS RETURNCMD rfind +ROOTOWNER roundf RSHIFT +SACL schandle semver serializer SETVERSION SHELLEXECUTEINFOW shobjidl +SHOWHIDE SHOWMINIMIZED SHOWTIP SINGLEUSE @@ -147,23 +189,37 @@ Stubless Subheader Subpage syscall +SYSTEMBACKDROP +TABROW TASKBARCREATED TBPF THEMECHANGED tlg +TME tmp +tmpdir tolower toupper +TRACKMOUSEEVENT TTask TVal UChar +UFIELD +ULARGE +UOI UPDATEINIFILE userenv +USEROBJECTFLAGS +Viewbox +virtualalloc wcsstr wcstoui winmain +winsta +winstamin wmemcmp wpc +WSF wsregex wwinmain xchg diff --git a/.github/actions/spelling/allow/math.txt b/.github/actions/spelling/allow/math.txt index 1482aedaba0..bf8960f0089 100644 --- a/.github/actions/spelling/allow/math.txt +++ b/.github/actions/spelling/allow/math.txt @@ -1,3 +1,11 @@ +atan +CPrime +HBar +HPrime isnan +LPrime +LStep powf +RSub sqrtf +ULP diff --git a/.github/actions/spelling/allow/microsoft.txt b/.github/actions/spelling/allow/microsoft.txt index 87d7a3d8c52..1f4a28664f2 100644 --- a/.github/actions/spelling/allow/microsoft.txt +++ b/.github/actions/spelling/allow/microsoft.txt @@ -1,5 +1,6 @@ ACLs ADMINS +advapi altform altforms appendwttlogging @@ -15,8 +16,10 @@ CPLs cpptools cppvsdbg CPRs +cryptbase DACL DACLs +defaultlib diffs disposables dotnetfeed @@ -24,7 +27,11 @@ DTDs DWINRT enablewttlogging Intelli +IVisual +libucrt +libucrtd LKG +LOCKFILE Lxss mfcribbon microsoft @@ -32,8 +39,10 @@ microsoftonline MSAA msixbundle MSVC +MSVCP muxc netcore +Onefuzz osgvsowi PFILETIME pgc @@ -44,6 +53,7 @@ powershell propkey pscustomobject QWORD +regedit robocopy SACLs sdkddkver @@ -57,6 +67,8 @@ systemroot taskkill tasklist tdbuildteamid +ucrt +ucrtd unvirtualized VCRT vcruntime diff --git a/.github/actions/spelling/allow/names.txt b/.github/actions/spelling/allow/names.txt index 27ba53635ef..1c6ef9a373c 100644 --- a/.github/actions/spelling/allow/names.txt +++ b/.github/actions/spelling/allow/names.txt @@ -1,14 +1,18 @@ Anup austdi +arkthur Ballmer bhoj Bhojwani +Bluloco carlos dhowett Diviness dsafa duhowett +DXP ekg +eryksun ethanschoonover Firefox Gatta @@ -20,6 +24,7 @@ Hernan Howett Illhardt iquilezles +italo jantari jerrysh Kaiyu @@ -33,7 +38,9 @@ leonmsft Lepilleur lhecker lukesampson +Macbook Manandhar +masserano mbadolato Mehrain menger @@ -53,6 +60,7 @@ oldnewthing opengl osgwiki pabhojwa +panos paulcam pauldotknopf PGP @@ -61,12 +69,16 @@ Rincewind rprichard Schoonover shadertoy +Shomnipotence +simioni Somuah sonph sonpham stakx +talo thereses Walisch +WDX Wellons Wirt Wojciech diff --git a/.github/actions/spelling/candidate.patterns b/.github/actions/spelling/candidate.patterns new file mode 100644 index 00000000000..4b40e728ee3 --- /dev/null +++ b/.github/actions/spelling/candidate.patterns @@ -0,0 +1,523 @@ +# marker to ignore all code on line +^.*/\* #no-spell-check-line \*/.*$ +# marker for ignoring a comment to the end of the line +// #no-spell-check.*$ + +# patch hunk comments +^\@\@ -\d+(?:,\d+|) \+\d+(?:,\d+|) \@\@ .* +# git index header +index [0-9a-z]{7,40}\.\.[0-9a-z]{7,40} + +# cid urls +(['"])cid:.*?\g{-1} + +# data url in parens +\(data:[^)]*?(?:[A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,})[^)]*\) +# data url in quotes +([`'"])data:.*?(?:[A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,}).*\g{-1} +# data url +data:[-a-zA-Z=;:/0-9+]*,\S* + +# mailto urls +mailto:[-a-zA-Z=;:/?%&0-9+@.]{3,} + +# magnet urls +magnet:[?=:\w]+ + +# magnet urls +"magnet:[^"]+" + +# obs: +"obs:[^"]*" + +# The `\b` here means a break, it's the fancy way to handle urls, but it makes things harder to read +# In this examples content, I'm using a number of different ways to match things to show various approaches +# asciinema +\basciinema\.org/a/[0-9a-zA-Z]+ + +# apple +\bdeveloper\.apple\.com/[-\w?=/]+ +# Apple music +\bembed\.music\.apple\.com/fr/playlist/usr-share/[-\w.]+ + +# appveyor api +\bci\.appveyor\.com/api/projects/status/[0-9a-z]+ +# appveyor project +\bci\.appveyor\.com/project/(?:[^/\s"]*/){2}builds?/\d+/job/[0-9a-z]+ + +# Amazon + +# Amazon +\bamazon\.com/[-\w]+/(?:dp/[0-9A-Z]+|) +# AWS S3 +\b\w*\.s3[^.]*\.amazonaws\.com/[-\w/&#%_?:=]* +# AWS execute-api +\b[0-9a-z]{10}\.execute-api\.[-0-9a-z]+\.amazonaws\.com\b +# AWS ELB +\b\w+\.[-0-9a-z]+\.elb\.amazonaws\.com\b +# AWS SNS +\bsns\.[-0-9a-z]+.amazonaws\.com/[-\w/&#%_?:=]* +# AWS VPC +vpc-\w+ + +# While you could try to match `http://` and `https://` by using `s?` in `https?://`, sometimes there +# YouTube url +\b(?:(?:www\.|)youtube\.com|youtu.be)/(?:channel/|embed/|user/|playlist\?list=|watch\?v=|v/|)[-a-zA-Z0-9?&=_%]* +# YouTube music +\bmusic\.youtube\.com/youtubei/v1/browse(?:[?&]\w+=[-a-zA-Z0-9?&=_]*) +# YouTube tag +<\s*youtube\s+id=['"][-a-zA-Z0-9?_]*['"] +# YouTube image +\bimg\.youtube\.com/vi/[-a-zA-Z0-9?&=_]* +# Google Accounts +\baccounts.google.com/[-_/?=.:;+%&0-9a-zA-Z]* +# Google Analytics +\bgoogle-analytics\.com/collect.[-0-9a-zA-Z?%=&_.~]* +# Google APIs +\bgoogleapis\.(?:com|dev)/[a-z]+/(?:v\d+/|)[a-z]+/[-@:./?=\w+|&]+ +# Google Storage +\b[-a-zA-Z0-9.]*\bstorage\d*\.googleapis\.com(?:/\S*|) +# Google Calendar +\bcalendar\.google\.com/calendar(?:/u/\d+|)/embed\?src=[@./?=\w&%]+ +\w+\@group\.calendar\.google\.com\b +# Google DataStudio +\bdatastudio\.google\.com/(?:(?:c/|)u/\d+/|)(?:embed/|)(?:open|reporting|datasources|s)/[-0-9a-zA-Z]+(?:/page/[-0-9a-zA-Z]+|) +# The leading `/` here is as opposed to the `\b` above +# ... a short way to match `https://` or `http://` since most urls have one of those prefixes +# Google Docs +/docs\.google\.com/[a-z]+/(?:ccc\?key=\w+|(?:u/\d+|d/(?:e/|)[0-9a-zA-Z_-]+/)?(?:edit\?[-\w=#.]*|/\?[\w=&]*|)) +# Google Drive +\bdrive\.google\.com/(?:file/d/|open)[-0-9a-zA-Z_?=]* +# Google Groups +\bgroups\.google\.com/(?:(?:forum/#!|d/)(?:msg|topics?|searchin)|a)/[^/\s"]+/[-a-zA-Z0-9$]+(?:/[-a-zA-Z0-9]+)* +# Google Maps +\bmaps\.google\.com/maps\?[\w&;=]* +# Google themes +themes\.googleusercontent\.com/static/fonts/[^/\s"]+/v\d+/[^.]+. +# Google CDN +\bclients2\.google(?:usercontent|)\.com[-0-9a-zA-Z/.]* +# Goo.gl +/goo\.gl/[a-zA-Z0-9]+ +# Google Chrome Store +\bchrome\.google\.com/webstore/detail/[-\w]*(?:/\w*|) +# Google Books +\bgoogle\.(?:\w{2,4})/books(?:/\w+)*\?[-\w\d=&#.]* +# Google Fonts +\bfonts\.(?:googleapis|gstatic)\.com/[-/?=:;+&0-9a-zA-Z]* +# Google Forms +\bforms\.gle/\w+ +# Google Scholar +\bscholar\.google\.com/citations\?user=[A-Za-z0-9_]+ +# Google Colab Research Drive +\bcolab\.research\.google\.com/drive/[-0-9a-zA-Z_?=]* + +# GitHub SHAs (api) +\bapi.github\.com/repos(?:/[^/\s"]+){3}/[0-9a-f]+\b +# GitHub SHAs (markdown) +(?:\[`?[0-9a-f]+`?\]\(https:/|)/(?:www\.|)github\.com(?:/[^/\s"]+){2,}(?:/[^/\s")]+)(?:[0-9a-f]+(?:[-0-9a-zA-Z/#.]*|)\b|) +# GitHub SHAs +\bgithub\.com(?:/[^/\s"]+){2}[@#][0-9a-f]+\b +# GitHub wiki +\bgithub\.com/(?:[^/]+/){2}wiki/(?:(?:[^/]+/|)_history|[^/]+(?:/_compare|)/[0-9a-f.]{40,})\b +# githubusercontent +/[-a-z0-9]+\.githubusercontent\.com/[-a-zA-Z0-9?&=_\/.]* +# githubassets +\bgithubassets.com/[0-9a-f]+(?:[-/\w.]+) +# gist github +\bgist\.github\.com/[^/\s"]+/[0-9a-f]+ +# git.io +\bgit\.io/[0-9a-zA-Z]+ +# GitHub JSON +"node_id": "[-a-zA-Z=;:/0-9+]*" +# Contributor +\[[^\]]+\]\(https://github\.com/[^/\s"]+\) +# GHSA +GHSA(?:-[0-9a-z]{4}){3} + +# GitLab commit +\bgitlab\.[^/\s"]*/\S+/\S+/commit/[0-9a-f]{7,16}#[0-9a-f]{40}\b +# GitLab merge requests +\bgitlab\.[^/\s"]*/\S+/\S+/-/merge_requests/\d+/diffs#[0-9a-f]{40}\b +# GitLab uploads +\bgitlab\.[^/\s"]*/uploads/[-a-zA-Z=;:/0-9+]* +# GitLab commits +\bgitlab\.[^/\s"]*/(?:[^/\s"]+/){2}commits?/[0-9a-f]+\b + +# binanace +accounts.binance.com/[a-z/]*oauth/authorize\?[-0-9a-zA-Z&%]* + +# bitbucket diff +\bapi\.bitbucket\.org/\d+\.\d+/repositories/(?:[^/\s"]+/){2}diff(?:stat|)(?:/[^/\s"]+){2}:[0-9a-f]+ +# bitbucket repositories commits +\bapi\.bitbucket\.org/\d+\.\d+/repositories/(?:[^/\s"]+/){2}commits?/[0-9a-f]+ +# bitbucket commits +\bbitbucket\.org/(?:[^/\s"]+/){2}commits?/[0-9a-f]+ + +# bit.ly +\bbit\.ly/\w+ + +# bitrise +\bapp\.bitrise\.io/app/[0-9a-f]*/[\w.?=&]* + +# bootstrapcdn.com +\bbootstrapcdn\.com/[-./\w]+ + +# cdn.cloudflare.com +\bcdnjs\.cloudflare\.com/[./\w]+ + +# circleci +\bcircleci\.com/gh(?:/[^/\s"]+){1,5}.[a-z]+\?[-0-9a-zA-Z=&]+ + +# gitter +\bgitter\.im(?:/[^/\s"]+){2}\?at=[0-9a-f]+ + +# gravatar +\bgravatar\.com/avatar/[0-9a-f]+ + +# ibm +[a-z.]*ibm\.com/[-_#=:%!?~.\\/\d\w]* + +# imgur +\bimgur\.com/[^.]+ + +# Internet Archive +\barchive\.org/web/\d+/(?:[-\w.?,'/\\+&%$#_:]*) + +# discord +/discord(?:app\.com|\.gg)/(?:invite/)?[a-zA-Z0-9]{7,} + +# Disqus +\bdisqus\.com/[-\w/%.()!?&=_]* + +# medium link +\blink\.medium\.com/[a-zA-Z0-9]+ +# medium +\bmedium\.com/\@?[^/\s"]+/[-\w]+ + +# microsoft +\b(?:https?://|)(?:(?:download\.visualstudio|docs|msdn2?|research)\.microsoft|blogs\.msdn)\.com/[-_a-zA-Z0-9()=./%]* +# powerbi +\bapp\.powerbi\.com/reportEmbed/[^"' ]* +# vs devops +\bvisualstudio.com(?::443|)/[-\w/?=%&.]* +# microsoft store +\bmicrosoft\.com/store/apps/\w+ + +# mvnrepository.com +\bmvnrepository\.com/[-0-9a-z./]+ + +# now.sh +/[0-9a-z-.]+\.now\.sh\b + +# oracle +\bdocs\.oracle\.com/[-0-9a-zA-Z./_?#&=]* + +# chromatic.com +/\S+.chromatic.com\S*[")] + +# codacy +\bapi\.codacy\.com/project/badge/Grade/[0-9a-f]+ + +# compai +\bcompai\.pub/v1/png/[0-9a-f]+ + +# mailgun api +\.api\.mailgun\.net/v3/domains/[0-9a-z]+\.mailgun.org/messages/[0-9a-zA-Z=@]* +# mailgun +\b[0-9a-z]+.mailgun.org + +# /message-id/ +/message-id/[-\w@./%]+ + +# Reddit +\breddit\.com/r/[/\w_]* + +# requestb.in +\brequestb\.in/[0-9a-z]+ + +# sched +\b[a-z0-9]+\.sched\.com\b + +# Slack url +slack://[a-zA-Z0-9?&=]+ +# Slack +\bslack\.com/[-0-9a-zA-Z/_~?&=.]* +# Slack edge +\bslack-edge\.com/[-a-zA-Z0-9?&=%./]+ +# Slack images +\bslack-imgs\.com/[-a-zA-Z0-9?&=%.]+ + +# shields.io +\bshields\.io/[-\w/%?=&.:+;,]* + +# stackexchange -- https://stackexchange.com/feeds/sites +\b(?:askubuntu|serverfault|stack(?:exchange|overflow)|superuser).com/(?:questions/\w+/[-\w]+|a/) + +# Sentry +[0-9a-f]{32}\@o\d+\.ingest\.sentry\.io\b + +# Twitter markdown +\[\@[^[/\]:]*?\]\(https://twitter.com/[^/\s"')]*(?:/status/\d+(?:\?[-_0-9a-zA-Z&=]*|)|)\) +# Twitter hashtag +\btwitter\.com/hashtag/[\w?_=&]* +# Twitter status +\btwitter\.com/[^/\s"')]*(?:/status/\d+(?:\?[-_0-9a-zA-Z&=]*|)|) +# Twitter profile images +\btwimg\.com/profile_images/[_\w./]* +# Twitter media +\btwimg\.com/media/[-_\w./?=]* +# Twitter link shortened +\bt\.co/\w+ + +# facebook +\bfburl\.com/[0-9a-z_]+ +# facebook CDN +\bfbcdn\.net/[\w/.,]* +# facebook watch +\bfb\.watch/[0-9A-Za-z]+ + +# dropbox +\bdropbox\.com/sh?/[^/\s"]+/[-0-9A-Za-z_.%?=&;]+ + +# ipfs protocol +ipfs://[0-9a-z]* +# ipfs url +/ipfs/[0-9a-z]* + +# w3 +\bw3\.org/[-0-9a-zA-Z/#.]+ + +# loom +\bloom\.com/embed/[0-9a-f]+ + +# regex101 +\bregex101\.com/r/[^/\s"]+/\d+ + +# figma +\bfigma\.com/file(?:/[0-9a-zA-Z]+/)+ + +# freecodecamp.org +\bfreecodecamp\.org/[-\w/.]+ + +# image.tmdb.org +\bimage\.tmdb\.org/[/\w.]+ + +# mermaid +\bmermaid\.ink/img/[-\w]+|\bmermaid-js\.github\.io/mermaid-live-editor/#/edit/[-\w]+ + +# Wikipedia +\ben\.wikipedia\.org/wiki/[-\w%.#]+ + +# gitweb +[^"\s]+/gitweb/\S+;h=[0-9a-f]+ + +# HyperKitty lists +/archives/list/[^@/]+\@[^/\s"]*/message/[^/\s"]*/ + +# lists +/thread\.html/[^"\s]+ + +# list-management +\blist-manage\.com/subscribe(?:[?&](?:u|id)=[0-9a-f]+)+ + +# kubectl.kubernetes.io/last-applied-configuration +"kubectl.kubernetes.io/last-applied-configuration": ".*" + +# pgp +\bgnupg\.net/pks/lookup[?&=0-9a-zA-Z]* + +# Spotify +\bopen\.spotify\.com/embed/playlist/\w+ + +# Mastodon +\bmastodon\.[-a-z.]*/(?:media/|\@)[?&=0-9a-zA-Z_]* + +# scastie +\bscastie\.scala-lang\.org/[^/]+/\w+ + +# images.unsplash.com +\bimages\.unsplash\.com/(?:(?:flagged|reserve)/|)[-\w./%?=%&.;]+ + +# pastebin +\bpastebin\.com/[\w/]+ + +# heroku +\b\w+\.heroku\.com/source/archive/\w+ + +# quip +\b\w+\.quip\.com/\w+(?:(?:#|/issues/)\w+)? + +# badgen.net +\bbadgen\.net/badge/[^")\]'\s]+ + +# statuspage.io +\w+\.statuspage\.io\b + +# media.giphy.com +\bmedia\.giphy\.com/media/[^/]+/[\w.?&=]+ + +# tinyurl +\btinyurl\.com/\w+ + +# getopts +\bgetopts\s+(?:"[^"]+"|'[^']+') + +# ANSI color codes +(?:\\(?:u00|x)1b|\x1b)\[\d+(?:;\d+|)m + +# URL escaped characters +\%[0-9A-F][A-F] +# IPv6 +\b(?:[0-9a-fA-F]{0,4}:){3,7}[0-9a-fA-F]{0,4}\b +# c99 hex digits (not the full format, just one I've seen) +0x[0-9a-fA-F](?:\.[0-9a-fA-F]*|)[pP] +# Punycode +\bxn--[-0-9a-z]+ +# sha +sha\d+:[0-9]*[a-f]{3,}[0-9a-f]* +# sha-... -- uses a fancy capture +(['"]|")[0-9a-f]{40,}\g{-1} +# hex runs +\b[0-9a-fA-F]{16,}\b +# hex in url queries +=[0-9a-fA-F]*?(?:[A-F]{3,}|[a-f]{3,})[0-9a-fA-F]*?& +# ssh +(?:ssh-\S+|-nistp256) [-a-zA-Z=;:/0-9+]{12,} + +# PGP +\b(?:[0-9A-F]{4} ){9}[0-9A-F]{4}\b +# GPG keys +\b(?:[0-9A-F]{4} ){5}(?: [0-9A-F]{4}){5}\b +# Well known gpg keys +.well-known/openpgpkey/[\w./]+ + +# uuid: +\b[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}\b +# hex digits including css/html color classes: +(?:[\\0][xX]|\\u|[uU]\+|#x?|\%23)[0-9_a-fA-FgGrR]*?[a-fA-FgGrR]{2,}[0-9_a-fA-FgGrR]*(?:[uUlL]{0,3}|u\d+)\b +# integrity +integrity="sha\d+-[-a-zA-Z=;:/0-9+]{40,}" + +# https://www.gnu.org/software/groff/manual/groff.html +# man troff content +\\f[BCIPR] +# ' +\\\(aq + +# .desktop mime types +^MimeTypes?=.*$ +# .desktop localized entries +^[A-Z][a-z]+\[[a-z]+\]=.*$ +# Localized .desktop content +Name\[[^\]]+\]=.* + +# IServiceProvider +\bI(?=(?:[A-Z][a-z]{2,})+\b) + +# crypt +"\$2[ayb]\$.{56}" + +# scrypt / argon +\$(?:scrypt|argon\d+[di]*)\$\S+ + +# Input to GitHub JSON +content: "[-a-zA-Z=;:/0-9+]*=" + +# Python stringprefix / binaryprefix +# Note that there's a high false positive rate, remove the `?=` and search for the regex to see if the matches seem like reasonable strings +(?v# +(?:(?<=[A-Z]{2})V|(?<=[a-z]{2}|[A-Z]{2})v)\d+(?:\b|(?=[a-zA-Z_])) +# Compiler flags (Scala) +(?:^|[\t ,>"'`=(])-J-[DPWXY](?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,}) +# Compiler flags +#(?:^|[\t ,"'`=(])-[DPWXYLlf](?=[A-Z]{2,}|[A-Z][a-z]|[a-z]{2,}) + +# Compiler flags (linker) +,-B +# curl arguments +\b(?:\\n|)curl(?:\s+-[a-zA-Z]{1,2}\b)*(?:\s+-[a-zA-Z]{3,})(?:\s+-[a-zA-Z]+)* +# set arguments +\bset(?:\s+-[abefimouxE]{1,2})*\s+-[abefimouxE]{3,}(?:\s+-[abefimouxE]+)* +# tar arguments +\b(?:\\n|)g?tar(?:\.exe|)(?:(?:\s+--[-a-zA-Z]+|\s+-[a-zA-Z]+|\s[ABGJMOPRSUWZacdfh-pr-xz]+\b)(?:=[^ ]*|))+ +# tput arguments -- https://man7.org/linux/man-pages/man5/terminfo.5.html -- technically they can be more than 5 chars long... +\btput\s+(?:(?:-[SV]|-T\s*\w+)\s+)*\w{3,5}\b +# macOS temp folders +/var/folders/\w\w/[+\w]+/(?:T|-Caches-)/ diff --git a/.github/actions/spelling/excludes.txt b/.github/actions/spelling/excludes.txt index 81bfde27718..bc509a5669e 100644 --- a/.github/actions/spelling/excludes.txt +++ b/.github/actions/spelling/excludes.txt @@ -1,28 +1,39 @@ +# See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-excludes (?:(?i)\.png$) +(?:^|/)(?i)COPYRIGHT +(?:^|/)(?i)LICEN[CS]E +(?:^|/)3rdparty/ (?:^|/)dirs$ (?:^|/)go\.mod$ (?:^|/)go\.sum$ -(?:^|/)package-lock\.json$ +(?:^|/)package(?:-lock|)\.json$ (?:^|/)sources(?:|\.dep)$ -SUMS$ +(?:^|/)vendor/ +\.a$ \.ai$ +\.avi$ \.bmp$ +\.bz2$ \.cer$ \.class$ \.crl$ \.crt$ \.csr$ \.dll$ +\.docx?$ +\.drawio$ \.DS_Store$ \.eot$ \.eps$ \.exe$ \.gif$ +\.gitattributes$ \.graffle$ \.gz$ \.icns$ \.ico$ \.jar$ +\.jks$ \.jpeg$ \.jpg$ \.key$ @@ -30,28 +41,53 @@ SUMS$ \.lock$ \.map$ \.min\.. +\.mod$ \.mp3$ \.mp4$ +\.o$ +\.ocf$ \.otf$ \.pbxproj$ \.pdf$ \.pem$ +\.png$ \.psd$ +\.pyc$ \.runsettings$ +\.s$ \.sig$ \.so$ \.svg$ \.svgz$ +\.svgz?$ \.tar$ \.tgz$ +\.tiff?$ \.ttf$ \.vsdx$ +\.wav$ +\.webm$ +\.webp$ \.woff +\.woff2?$ \.xcf$ \.xls +\.xlsx?$ \.xpm$ \.yml$ \.zip$ +^\.github/actions/spelling/ +^\.github/fabricbot.json$ +^\.gitignore$ +^\Q.git-blame-ignore-revs\E$ +^\Q.github/workflows/spelling.yml\E$ +^\Qdoc/reference/windows-terminal-logo.ans\E$ +^\Qsamples/ConPTY/EchoCon/EchoCon/EchoCon.vcxproj.filters\E$ +^\Qsrc/host/exe/Host.EXE.vcxproj.filters\E$ +^\Qsrc/host/ft_host/chafa.txt\E$ +^\Qsrc/tools/closetest/CloseTest.vcxproj.filters\E$ +^\XamlStyler.json$ +^build/config/ ^consolegit2gitfilters\.json$ ^dep/ ^doc/reference/master-sequence-list.csv$ @@ -61,12 +97,14 @@ SUMS$ ^src/host/runft\.bat$ ^src/host/runut\.bat$ ^src/interactivity/onecore/BgfxEngine\. +^src/renderer/atlas/ ^src/renderer/wddmcon/WddmConRenderer\. ^src/terminal/adapter/ut_adapter/run\.bat$ ^src/terminal/parser/delfuzzpayload\.bat$ ^src/terminal/parser/ft_fuzzer/run\.bat$ ^src/terminal/parser/ft_fuzzer/VTCommandFuzzer\.cpp$ ^src/terminal/parser/ft_fuzzwrapper/run\.bat$ +^src/terminal/parser/ut_parser/Base64Test.cpp$ ^src/terminal/parser/ut_parser/run\.bat$ ^src/tools/integrity/packageuwp/ConsoleUWP\.appxSources$ ^src/tools/lnkd/lnkd\.bat$ @@ -74,6 +112,6 @@ SUMS$ ^src/tools/texttests/fira\.txt$ ^src/tools/U8U16Test/(?:fr|ru|zh)\.txt$ ^src/types/ut_types/UtilsTests.cpp$ -^\.github/actions/spelling/ -^\.gitignore$ -^\XamlStyler.json$ +^tools/ReleaseEngineering/ServicingPipeline.ps1$ +ignore$ +SUMS$ diff --git a/.github/actions/spelling/expect/alphabet.txt b/.github/actions/spelling/expect/alphabet.txt index 47663b0d075..23933713a40 100644 --- a/.github/actions/spelling/expect/alphabet.txt +++ b/.github/actions/spelling/expect/alphabet.txt @@ -5,26 +5,19 @@ AAAAAABBBBBBCCC AAAAABBBBBBCCC abcd abcd -abcde -abcdef -ABCDEFG -ABCDEFGH ABCDEFGHIJ abcdefghijk ABCDEFGHIJKLMNO abcdefghijklmnop ABCDEFGHIJKLMNOPQRST -abcdefghijklmnopqrstuvwxyz ABCG ABE abf BBBBB BBBBBBBB -BBBBBBBBBBBBBBDDDD BBBBBCCC BBBBCCCCC BBGGRR -CCE EFG EFGh QQQQQQQQQQABCDEFGHIJ @@ -33,7 +26,6 @@ QQQQQQQQQQABCDEFGHIJKLMNOPQRSTQQQQQQQQQQ QQQQQQQQQQABCDEFGHIJPQRSTQQQQQQQQQQ qrstuvwxyz qwerty -QWERTYUIOP qwertyuiopasdfg YYYYYYYDDDDDDDDDDD ZAAZZ diff --git a/.github/actions/spelling/expect/expect.txt b/.github/actions/spelling/expect/expect.txt index 8ed94f9d496..8f8f4828d0a 100644 --- a/.github/actions/spelling/expect/expect.txt +++ b/.github/actions/spelling/expect/expect.txt @@ -1,21 +1,19 @@ +aabbcc ABANDONFONT +abbcc +ABCDEFGHIJKLMNOPQRSTUVWXY abgr abi +ABORTIFHUNG ACCESSTOKEN -acec -acf acidev ACIOSS ACover actctx ACTCTXW activatable -ACTIVEBORDER -ACTIVECAPTION -adaa ADDALIAS ADDREF -addressof ADDSTRING ADDTOOL AEnd @@ -27,50 +25,39 @@ ahz AImpl AInplace ALIGNRIGHT -alloc allocing +allocs alpc ALTERNATENAME ALTF ALTNUMPAD ALWAYSTIP amd -ansicode ansicpg ANSISYS ANSISYSRC ANSISYSSC -antialias antialiasing ANull anycpu -AOn APARTMENTTHREADED APCs -api APIENTRY -apimswincoresynchl apiset APPBARDATA -appconsult -APPICON +appcontainer appium -applet appletname +applets applicationmodel APPLMODAL appmodel -apps APPWINDOW APrep apsect APSTUDIO archeologists -architected argb -argc -args -argv ARRAYSIZE ARROWKEYS asan @@ -80,22 +67,15 @@ ASDF asdfghjkl ASetting ASingle -asm -asmv asmx -aspx -astextplain -AStomps ASYNCWINDOWPOS atch ATest -attr ATTRCOLOR aumid Authenticode AUTOBUDDY AUTOCHECKBOX -autogenerated autohide AUTOHSCROLL automagically @@ -104,37 +84,30 @@ AUTORADIOBUTTON autoscrolling Autowrap AVerify -AVI AVX awch -azuredevopspodcast azzle -backend backgrounded Backgrounder backgrounding -backport +backported backstory barbaz Batang -baz Bazz BBDM bbwe bcount -bcrypt bcx bcz BEFOREPARENT beginthread -bgcolor bgfx bgidx Bgk BGR -BGRA +bgra BHID -biblioscape bigobj binplace binplaced @@ -143,15 +116,12 @@ bitcrazed bitflag bitmask BITOPERATION -bitsavers -bitset +bitsets BKCOLOR BKGND Bksp -blog Blt BLUESCROLL -bmp BODGY BOLDFONT BOOLIFY @@ -161,49 +131,40 @@ Borland BOTTOMLEFT BOTTOMRIGHT boutput +boxheader BPBF bpp BPPF branchconfig brandings -BRK Browsable -bsearch Bspace bstr BTNFACE -buf bufferout buffersize buflen -bugfix buildtransitive BUILDURI burriter BValue -byref -bytearray bytebuffer cac cacafire -callee capslock CARETBLINKINGENABLED CARRIAGERETURN cascadia -cassert castsi catid cazamor CBash -cbegin cbiex CBN CBoolean cbt cbuffer CCCBB -ccf cch CCHAR cci @@ -214,17 +175,11 @@ CComp CConsole CConversion CCRT -cctype -CDATA cdd -cdecl CDeclaration CEdit CELLSIZE -cend -cerr cfae -Cfg cfie cfiex cfte @@ -232,48 +187,33 @@ CFuzz cgscrn chafa changelist +chaof charinfo -charlespetzold -charset CHARSETINFO -chcp -checkbox -checkboxes chh -Childitem chk -chrono CHT Cic -cjk -ckuehl -cla +CLA Clcompile CLE cleartype CLICKACTIVE clickdown -climits clipbrd CLIPCHILDREN CLIPSIBLINGS -cliutils -clocale closetest cloudconsole cls CLSCTX -clsid +clsids CLUSTERMAP -cmath cmatrix cmder CMDEXT -Cmdlet -cmdline cmh CMOUSEBUTTONS -cmp cmpeq cmt cmw @@ -281,54 +221,45 @@ cmyk CNL cnt CNTRL -codebase Codeflow codepage codepath -codepoint -codeproject -coffgroup -coffgrp +codepoints coinit COLLECTIONURI colorizing -colororacle -colorref -colorscheme +COLORMATRIX +COLORREFs +colorschemes colorspaces colorspec colortable colortbl +colortest colortool COLR combaseapi -combobox comctl COMDAT commandline commctrl commdlg COMMITID -compat componentization conapi conareainfo conattrs conbufferout -concat concfg conclnt conddkrefs condrv conechokey conemu -config configurability conhost -conhostv conime conimeinfo -conint conintegrity conintegrityuwp coninteractivitybase @@ -354,105 +285,76 @@ consolehost CONSOLEIME consoleinternal Consoleroot -Consolescreen CONSOLESETFOREGROUND consoletaeftemplates -CONSOLEV +consoleuwp Consolewait CONSOLEWINDOWOWNER consrv -constexpr constexprable constness contentfiles conterm -CONTEXTMENU contsf contypes convarea conwinuserrefs -coord coordnew COPYCOLOR CORESYSTEM cotaskmem countof -cout CPG cpinfo CPINFOEX CPLINFO cplusplus -cpp CPPCORECHECK cppcorecheckrules -cppm cpprest cpprestsdk cppwinrt CProc cpx -crbegin CREATESCREENBUFFER CREATESTRUCT CREATESTRUCTW -creativecommons cred -cref -crend +crisman CRLFs crloew Crt CRTLIBS csbi csbiex -csharp CSHORT -CSIDL Cspace -csproj -Csr csrmsg CSRSS csrutil -css -cstdarg -cstddef -cstdio -cstdlib -cstr -cstring cstyle -csv CSwitch CTerminal CText -ctime ctl ctlseqs -Ctlv -ctor CTRLEVENT +CTRLFREQUENCY CTRLKEYSHORTCUTS -Ctx +CTRLVOLUME Ctxt -ctype CUF cupxy -curated CURRENTFONT currentmode CURRENTPAGE CURSORCOLOR CURSORSIZE CURSORTYPE +CUsers CUU Cwa cwch -cwchar -cwctype -cwd -cxcy CXFRAME CXFULLSCREEN CXHSCROLL @@ -462,10 +364,8 @@ CXSIZE CXSMICON CXVIRTUALSCREEN CXVSCROLL -cxx CYFRAME CYFULLSCREEN -cygwin CYHSCROLL CYMIN CYPADDEDBORDER @@ -476,9 +376,6 @@ CYVIRTUALSCREEN CYVSCROLL dai DATABLOCK -DATAVIEW -DATAW -datetime DBatch dbcs DBCSCHAR @@ -491,12 +388,10 @@ DBGOUTPUT dbh dblclk DBlob -dbproj -DBUILD DColor DCOLORVALUE dcommon -DCompile +dcompile dcompiler DComposition dde @@ -505,38 +400,44 @@ DDevice DEADCHAR dealloc Debian -debolden debugtype +DECAC DECALN DECANM +DECARM DECAUPSS DECAWM +DECBKM +DECCARA DECCKM DECCOLM +DECCRA +DECCTR DECDHL decdld -DECDLD DECDWL DECEKBD +DECERA +DECFRA DECID DECKPAM DECKPM DECKPNM DECLRMM -decls -declspec -decltype -declval DECNKM DECNRCM DECOM -deconstructed DECPCTERM +DECPS +DECRARA DECRC DECREQTPARM DECRLM DECRQM -DECRST +DECRQSS +DECRQTSR +decrst +DECSACE DECSASD DECSC DECSCA @@ -545,18 +446,17 @@ DECSCPP DECSCUSR DECSED DECSEL +DECSERA DECSET DECSLPP DECSLRM DECSMKR DECSR -decstandar DECSTBM DECSTR DECSWL DECTCEM -Dedupe -deduplicated +DECXCPR DEFAPP DEFAULTBACKGROUND DEFAULTFOREGROUND @@ -572,39 +472,23 @@ defing DEFPUSHBUTTON defterm DELAYLOAD -deletable DELETEONRELEASE -delims Delt demoable depersist deprioritized -deps -deque -deref -deserialization -deserialize -deserialized -deserializer -deserializing +deserializers desktopwindowxamlsource -dest DESTINATIONNAME -devblogs devicecode -devicefamily -devops Dext DFactory DFF -DFMT dhandler dialogbox -diffing -DINLINE directio DIRECTX -Dirs +DISABLEDELAYEDEXPANSION DISABLENOSCROLL DISPLAYATTRIBUTE DISPLAYATTRIBUTEPROPERTY @@ -612,183 +496,146 @@ DISPLAYCHANGE distro dlg DLGC -dll -dllexport DLLGETVERSIONPROC -dllimport dllinit dllmain DLLVERSIONINFO DLOAD DLOOK dmp -DOCTYPE -docx DONTCARE doskey dotnet -doubleclick -downlevel -dpg -dpi +DPG DPIAPI DPICHANGE DPICHANGED +DPIs dpix dpiy +dpnx DRAWFRAME DRAWITEM DRAWITEMSTRUCT drcs -dropdown -DROPDOWNLIST DROPFILES drv +DSBCAPS +DSBLOCK +DSBPLAY +DSBUFFERDESC +DSBVOLUME dsm -dst +dsound +DSSCL DSwap DTest -dtor DTTERM DUMMYUNIONNAME -DUNICODE -DUNIT dup'ed dvi dwl DWLP dwm dwmapi -dword +DWORDs dwrite -dwriteglyphrundescriptionclustermap dxgi dxgidwm +dxguid dxinterop +dxsm dxttbmp -eachother -eae -eaf +Dyreen EASTEUROPE ECH echokey ecount ECpp +ect Edgium EDITKEYS EDITTEXT EDITUPDATE edputil -edu Efast EHsc +EINS EJO ELEMENTNOTAVAILABLE elems -elif -elseif emacs -emplate EMPTYBOX enabledelayedexpansion -endian -endif -endl -endlocal endptr endregion -ENQ -enqueuing -entrypoint +ENTIREBUFFER +entrypoints ENU -enum ENUMLOGFONT ENUMLOGFONTEX enumranges -envvar -eol +eplace EPres +EQU ERASEBKGND -errno -errorlevel -ETB etcoreapp ETW -ETX EUDC EVENTID eventing everytime evflags evt -ewdelete -exe execd -executables executionengine exemain EXETYPE +exeuwp exewin exitwin expectedinput -expr EXPUNGECOMMANDHISTORY EXSTYLE EXTENDEDEDITKEY EXTKEY EXTTEXTOUT -fabricbot facename FACENODE FACESIZE -failfast FAILIFTHERE -fallthrough -FARPROC fastlink -fcb fcharset -fclose -fcntl -fdc -FDD -fdopen fdw fesb FFDE FFrom +fgbg FGCOLOR -fgetc -fgetwc FGHIJ fgidx +FGs FILEDESCRIPTION -fileno -filepath FILESUBTYPE FILESYSPATH -filesystem -FILETYPE fileurl FILEW FILLATTR FILLCONSOLEOUTPUT FILTERONPASTE -finalizer FINDCASE FINDDLG FINDDOWN -FINDSTR FINDSTRINGEXACT FINDUP FIter FIXEDCONVERTED +FIXEDFILEINFO Flg flyout fmodern fmtarg fmtid -FNV FOLDERID FONTCHANGE fontdlg @@ -797,8 +644,7 @@ FONTENUMPROC FONTFACE FONTFAMILY FONTHEIGHT -FONTINFO -fontlist +fontinfo FONTOK FONTSIZE FONTSTRING @@ -808,28 +654,20 @@ FONTWEIGHT FONTWIDTH FONTWINDOW fooo -forceinline FORCEOFFFEEDBACK FORCEONFEEDBACK -FORCEV -foreach -fprintf framebuffer FRAMECHANGED fre -freopen -frontend +frontends fsanitize Fscreen FSCTL FSINFOCLASS -fsproj -fstream fte Ftm -fullscreen +Fullscreens fullwidth -func FUNCTIONCALL fuzzer fuzzmain @@ -841,11 +679,10 @@ fwlink GAUSSIAN gci gcx -gcy gdi gdip gdirenderer -GENPROFILE +Geddy geopol GETALIAS GETALIASES @@ -855,7 +692,6 @@ GETALIASEXESLENGTH GETAUTOHIDEBAREX GETCARETWIDTH getch -getchar GETCLIENTAREAANIMATION GETCOMMANDHISTORY GETCOMMANDHISTORYLENGTH @@ -880,7 +716,6 @@ GETKEYBOARDLAYOUTNAME GETKEYSTATE GETLARGESTWINDOWSIZE GETLBTEXT -getline GETMINMAXINFO GETMOUSEINFO GETMOUSEVANISH @@ -890,8 +725,6 @@ GETOBJECT GETPOS GETSELECTIONINFO getset -GETSTATE -GETTEXT GETTEXTLEN GETTITLE GETWAITTOKILLSERVICETIMEOUT @@ -899,39 +732,33 @@ GETWAITTOKILLTIMEOUT GETWHEELSCROLLCHARACTERS GETWHEELSCROLLCHARS GETWHEELSCROLLLINES -getwriter GFEh Gfun gfx +GGI GHIJK GHIJKL GHIJKLM gitfilters -github -gitlab +gitmodules gle -globals +GLOBALFOCUS GLYPHENTRY -gmail GMEM GNUC Goldmine gonce -Google goutput -GPUs -grayscale GREENSCROLL Grehan -grep Greyscale gridline groupbox gset gsl GTP +GTR guc -gui guidatom GValue GWL @@ -939,11 +766,8 @@ GWLP gwsz HABCDEF Hackathon -halfwidth HALTCOND HANGEUL -hardcoded -hardcodes hashalg HASSTRINGS hbitmap @@ -958,20 +782,16 @@ hdr HDROP hdrstop HEIGHTSCROLL -hfile hfont hfontresource hglobal hhh -HHmm hhook hhx HIBYTE -HICON +hicon HIDEWINDOW -HIGHLIGHTTEXT hinst -HINSTANCE Hirots HISTORYBUFS HISTORYNODUP @@ -984,41 +804,31 @@ hkl HKLM hlocal hlsl -HMENU hmod hmodule hmon -HMONITOR -horiz HORZ hostable hostlib -Hostx HPA -HPAINTBUFFER HPCON hpj -hpp HPR -HPROPSHEETPAGE HProvider HREDRAW hresult -HRSRC +hrottled hscroll hsl hstr hstring -hsv HTBOTTOMLEFT HTBOTTOMRIGHT HTCAPTION HTCLIENT HTLEFT -htm HTMAXBUTTON HTMINBUTTON -html HTMLTo HTRIGHT HTTOP @@ -1029,36 +839,17 @@ HVP hwheel hwnd HWNDPARENT -hxx -IAccessibility -IAction -IApi -IApplication -IBase -ICache -icacls iccex -icch -IChar -ico -IComponent +icket ICONERROR Iconified ICONINFORMATION IConsole ICONSTOP -IControl ICONWARNING -ICore -IData IDCANCEL IDD -IDesktop -IDevice -IDictionary IDISHWND -IDispatch -IDisposable idl idllib IDOK @@ -1066,35 +857,18 @@ IDR idth idx IDXGI -IDynamic IEnd IEnum -IEnumerable -ies -ietf IFACEMETHODIMP -ifdef ification -ifndef -IFont -ifstream IGNOREEND -IHigh +IGNORELANGUAGE IHosted iid -IInitialize -IInput -IInspectable -IInteract -IInteractivity IIo -IList -imagemagick -Imatch ime Imm -IMouse -impl +IMPEXP inbox inclusivity INCONTEXT @@ -1102,105 +876,59 @@ INFOEX inheritcursor inheritdoc inheritfrom -ini INITCOMMONCONTROLSEX INITDIALOG initguid INITMENU inkscape -inl INLINEPREFIX inlines -INotify -inout -inplace inproc Inputkeyinfo INPUTPROCESSORPROFILE inputrc Inputreadhandledata INSERTMODE -installationpath -intellisense INTERACTIVITYBASE INTERCEPTCOPYPASTE INTERNALNAME -interop -interoperability inthread -intptr -intrin intsafe INVALIDARG INVALIDATERECT -inwap -IObservable ioctl -iomanip -iostream -iot ipch -ipconfig -IPersist ipp IProperty IPSINK ipsp -IRaw -IRead -IReference -IRender -IRenderer -IScheme -ISelection IShell -issuecomment -IState -IStoryboard -isupper ISwap -iswdigit -iswspace -ISystem iterm itermcolors ITerminal -IText itf Ith itoa IUI -IUia IUnknown ivalid -IValue -IVector -IWait -iwch -IWeb -IWin -IWindow -IXaml +IWIC IXMP -ixx +IXP jconcpp JOBOBJECT JOBOBJECTINFOCLASS jpe -jpeg -jpg JPN -json -jsonc jsoncpp +Jsons jsprovider jumplist KAttrs kawa -kayla Kazu kazum -kbd kcub kcud kcuf @@ -1208,13 +936,11 @@ kcuu kernelbase kernelbasestaging KEYBDINPUT -keybinding keychord keydown keyevent KEYFIRST KEYLAST -keymap Keymapping keyscan keystate @@ -1227,26 +953,26 @@ KLF KLMNO KLMNOPQRST KLMNOPQRSTQQQQQ +KOK +KPRIORITY KVM langid LANGUAGELIST lasterror lastexitcode LAYOUTRTL +lbl LBN -LBound LBUTTON LBUTTONDBLCLK LBUTTONDOWN LBUTTONUP lcb +lci LCONTROL LCTRL lcx LEFTALIGN -LEFTSHIFT -len -lhs libpopcnt libsancov libtickit @@ -1256,17 +982,11 @@ LINESELECTION LINEWRAP LINKERRCAP LINKERROR -linkid -linkpath linputfile -Linq -linux -listbox listproperties listptr listptrsize lld -LLVM llx LMENU LMNOP @@ -1278,39 +998,28 @@ LOADONCALL loadu LOBYTE localappdata -localhost locsrc -locstudio Loewen LOGFONT LOGFONTA LOGFONTW logissue -lowercased loword lparam -lparen -LPBYTE LPCCH lpch -LPCHARSETINFO -LPCOLORREF LPCPLINFO LPCREATESTRUCT lpcs -LPCSTR LPCTSTR -LPCWSTR lpdata LPDBLIST lpdis LPDRAWITEMSTRUCT lpdw -LPDWORD lpelfe lpfn LPFNADDPROPSHEETPAGE -LPINT lpl LPMEASUREITEMSTRUCT LPMINMAXINFO @@ -1320,43 +1029,38 @@ LPNEWCPLINFOA LPNEWCPLINFOW LPNMHDR lpntme -LPPOINT LPPROC LPPROPSHEETPAGE LPPSHNOTIFY lprc -LPRECT lpstr lpsz LPTSTR LPTTFONTLIST lpv -LPVOID LPW LPWCH +lpwfx LPWINDOWPOS lpwpos lpwstr LRESULT -lru lsb lsconfig -lsproj lss lstatus lstrcmp lstrcmpi LTEXT LTLTLTLTL -ltype LUID +luma lval LVB LVERTICAL LWA LWIN lwkmvj -mailto majorly makeappx MAKEINTRESOURCE @@ -1365,15 +1069,13 @@ MAKELANGID MAKELONG MAKELPARAM MAKELRESULT -malloc -manpage MAPBITMAP MAPVIRTUALKEY MAPVK MAXDIMENSTRING maxing -MAXLENGTH MAXSHORT +maxval maxversiontested MAXWORD maybenull @@ -1387,107 +1089,75 @@ MDs MEASUREITEM megamix memallocator -memcmp -memcpy -memmove -memset MENUCHAR MENUCONTROL MENUDROPALIGNMENT -MENUITEM MENUITEMINFO MENUSELECT -Mersenne messageext -metadata metaproj midl mii MIIM milli -mimetype mincore mindbogglingly -mingw minimizeall minkernel MINMAXINFO minwin minwindef Mip -mkdir MMBB mmcc MMCPL -MMdd mmsystem MNC MNOPQ MNOPQR MODALFRAME -modelproj MODERNCORE MONITORINFO MONITORINFOEXW MONITORINFOF -monospaced -monostate MOUSEACTIVATE MOUSEFIRST MOUSEHWHEEL MOUSEMOVE -mousewheel movemask MOVESTART msb -msbuild -mscorlib msctf msctls msdata -msdn msft MSGCMDLINEF MSGF MSGFILTER MSGFLG MSGMARKMODE -MSGS MSGSCROLLMODE MSGSELECTMODE msiexec MSIL msix msrc -msvcrt MSVCRTD -MSVS msys -msysgit MTSM -mui -Mul -multiline munged munges murmurhash -mutex -mutexes muxes myapplet mydir -myignite MYMAX Mypair Myval NAMELENGTH nameof -namespace -namespaced namestream -nano natvis -nbsp NCCALCSIZE NCCREATE NCLBUTTONDOWN @@ -1499,16 +1169,12 @@ NCRBUTTONDOWN NCRBUTTONUP NCXBUTTONDOWN NCXBUTTONUP -NDEBUG -ned NEL -NEQ netcoreapp netstandard NEWCPLINFO NEWCPLINFOA NEWCPLINFOW -newcursor Newdelete NEWINQUIRE NEWINQURE @@ -1518,22 +1184,16 @@ NEWTEXTMETRICEX Newtonsoft NEXTLINE nfe -nlength -Nls NLSMODE nnn NOACTIVATE NOAPPLYNOW NOCLIP -NOCOLOR NOCOMM NOCONTEXTHELP NOCOPYBITS -nodiscard NODUP -noexcept -NOHELP -noinline +noexcepts NOINTEGRALHEIGHT NOINTERFACE NOLINKINFO @@ -1549,13 +1209,13 @@ NONINFRINGEMENT NONPREROTATED nonspace NOOWNERZORDER +Nop NOPAINT NOPQRST noprofile NOREDRAW NOREMOVE NOREPOSITION -noreturn NORMALDISPLAY NOSCRATCH NOSEARCH @@ -1564,22 +1224,17 @@ NOSENDCHANGING NOSIZE NOSNAPSHOT NOTHOUSANDS -nothrow NOTICKS +NOTIMEOUTIFNOTHUNG NOTIMPL -notin -NOTNULL NOTOPMOST NOTRACK NOTSUPPORTED nouicompat nounihan NOUPDATE -NOWAIT NOYIELD NOZORDER -NPM -npos nrcs NSTATUS ntapi @@ -1591,6 +1246,7 @@ ntdll ntifs ntlpcapi ntm +nto ntrtl ntstatus ntsubauth @@ -1601,30 +1257,25 @@ ntuser NTVDM ntverp NTWIN -nuget +nugetversions nullability nullness nullonfailure -nullopt -nullptr +nullopts NULs numlock numpad NUMSCROLL nupkg -nuspec NVIDIA -NVR OACR -oauth objbase -ocf ocolor odl -oem oemcp OEMFONT OEMFORMAT +OEMs offboarded OLEAUT OLECHAR @@ -1637,6 +1288,7 @@ onecoreuapuuid onecoreuuid ONECOREWINDOWS onehalf +oneseq ONLCR openbash opencode @@ -1646,9 +1298,7 @@ openconsoleproxy OPENIF OPENLINK openps -opensource openvt -openxmlformats ORIGINALFILENAME osc OSCBG @@ -1659,22 +1309,17 @@ OSCSCB OSCSCC OSCWT OSDEPENDSROOT -osfhandle OSG OSGENG osign oss -ostream -ostringstream +otepad ouicompat OUnter outdir -outfile -Outof OUTOFCONTEXT -OUTOFMEMORY -outout Outptr +outstr OVERLAPPEDWINDOW OWNDC OWNERDRAWFIXED @@ -1688,23 +1333,20 @@ PAINTPARAMS PAINTSTRUCT PALPC pankaj -params parentable parms passthrough PATCOPY pathcch PATTERNID -PBOOL -PBYTE pcat pcb pcch PCCHAR PCCONSOLE PCD +pcg pch -PCHAR PCIDLIST PCIS PCLIENT @@ -1726,18 +1368,13 @@ PCWCH PCWCHAR PCWSTR pda -pdb -pdbonly +Pdbs pdbstr -pdf -pdp pdtobj pdw -PDWORD pdx peb PEMAGIC -PENDTASKMSG pfa PFACENODE pfed @@ -1750,17 +1387,14 @@ PFONTENUMDATA PFS pgd pgdn -pgorepro -pgort -PGU +PGONu pguid pgup -PHANDLE phhook phwnd -pid pidl PIDLIST +pids pii pinvoke pipename @@ -1769,14 +1403,12 @@ pixelheight PIXELSLIST PJOBOBJECT pkey -placeholders platforming playsound -plist +ploc +ploca +plocm PLOGICAL -plugin -PMv -png pnm PNMLINK pntm @@ -1785,24 +1417,20 @@ POBJECT Podcast POINTSLIST POLYTEXTW -popd -POPF poppack -popup POPUPATTR +popups PORFLG positionals -posix POSTCHARBREAKS POSX POSXSCROLL POSYSCROLL -ppci +PPEB ppf ppguid ppidl pplx -PPORT PPROC PPROCESS ppropvar @@ -1813,19 +1441,12 @@ ppsz ppv ppwch PQRST -pragma prc prealigned -prebuilt -precendence -precomp prect prefast -prefilled prefs preinstalled -PRELOAD -PREMULTIPLIED prepopulated presorted PREVENTPINNING @@ -1834,14 +1455,11 @@ PREVIEWWINDOW PREVLINE prg pri -printf prioritization processenv processhost PROCESSINFOCLASS procs -Progman -proj PROPERTYID PROPERTYKEY PROPERTYVAL @@ -1855,7 +1473,6 @@ propvar propvariant propvarutil psa -psd PSECURITY pseudocode pseudoconsole @@ -1863,13 +1480,10 @@ pseudoterminal psh pshn PSHNOTIFY -PSHORT pshpack PSINGLE psl psldl -psm -PSMALL PSNRET PSobject psp @@ -1878,45 +1492,36 @@ psr PSTR psz ptch -ptr -ptrdiff +ptrs ptsz PTYIn PUCHAR -PULONG PUNICODE -pushd -putchar -putwchar -PVOID pwch -PWCHAR PWDDMCONSOLECONTEXT -PWORD pws -pwsh pwstr pwsz pythonw +Qaabbcc qos QRSTU -qsort -queryable +QUERYOPEN QUESTIONMARK quickedit +QUZ QWER +Qxxxxxxxxxxxxxxx qzmp RAII RALT rasterbar rasterfont rasterization -rawinput RAWPATH raytracers razzlerc rbar -rbegin RBUTTON RBUTTONDBLCLK RBUTTONDOWN @@ -1932,43 +1537,28 @@ RCOCW RCONTROL RCOW rcv -rdbuf -RDONLY -rdpartysource readback READCONSOLE READCONSOLEOUTPUT READCONSOLEOUTPUTSTRING -Readline -readme READMODE -readonly -READWRITE -realloc +reallocs reamapping rects redef redefinable Redir -redirector redist -redistributable REDSCROLL -refactor -refactoring REFCLSID -refcount -referencesource REFGUID REFIID REFPROPERTYKEY -regex REGISTEROS REGISTERVDM regkey REGSTR reingest -Relayout RELBINPATH remoting renamer @@ -1979,23 +1569,20 @@ reparenting replatformed Replymessage repositorypath +Requiresx rescap Resequence RESETCONTENT resheader -resizable resmimetype -restrictedcapabilities resw resx -retval rfa -rfc +rfid rftp -rgb -rgba RGBCOLOR rgbi +rgbs rgci rgfae rgfte @@ -2008,48 +1595,45 @@ rgs rgui rgw rgwch -rhs RIGHTALIGN RIGHTBUTTON riid Rike RIPMSG RIS -RMENU roadmap robomac -roundtrip -rparen +rosetta +roundtrips RRF RRRGGGBB rsas rtcore RTEXT -rtf RTFTo -Rtl RTLREADING +Rtn RTTI ruleset runas -runasradio RUNDLL runformat runft RUNFULLSCREEN +runfuzz runsettings -runtests +runtest runtimeclass runuia runut runxamlformat -rvalue RVERTICAL +rvpa RWIN rxvt safearray -SAFECAST safemath +sapi sba SBCS SBCSDBCS @@ -2060,18 +1644,15 @@ scancode scanline schemename SCL -scm SCRBUF SCRBUFSIZE screenbuffer SCREENBUFFERINFO screeninfo -screenshot +screenshots scriptload -Scrollable scrollback -scrollbar -Scroller +scrollbars SCROLLFORWARD SCROLLINFO scrolllock @@ -2081,18 +1662,14 @@ SCROLLSCREENBUFFER scursor sddl sdeleted -sdk SDKDDK -searchbox securityappcontainer segfault SELCHANGE SELECTALL -selectany SELECTEDFONT SELECTSTRING Selfhosters -SERIALIZERS SERVERDLL SETACTIVE SETBUDDYINT @@ -2103,7 +1680,6 @@ SETCURSOR SETCURSORINFO SETCURSORPOSITION SETDISPLAYMODE -setfill SETFOCUS SETFONT SETFOREGROUND @@ -2114,28 +1690,24 @@ setintegritylevel SETITEMDATA SETITEMHEIGHT SETKEYSHORTCUTS -setlocal -setlocale SETMENUCLOSE -setmode SETNUMBEROFCOMMANDS SETOS SETPALETTE -SETPOS SETRANGE SETSCREENBUFFERSIZE SETSEL SETTEXTATTRIBUTE SETTINGCHANGE -SETTITLE -setw Setwindow SETWINDOWINFO +SFGAO +SFGAOF sfi SFINAE +SFolder SFUI sgr -SHANDLE SHCo shcore shellapi @@ -2143,7 +1715,6 @@ shellex shellscalingapi SHFILEINFO SHGFI -SHGFP SHIFTJIS Shl shlguid @@ -2151,13 +1722,13 @@ shlobj shlwapi SHORTPATH SHOWCURSOR +SHOWDEFAULT SHOWMAXIMIZED SHOWMINNOACTIVE +SHOWNA SHOWNOACTIVATE SHOWNORMAL SHOWWINDOW -SHRT -sid sidebyside SIF SIGDN @@ -2166,7 +1737,6 @@ SINGLETHREADED siup sixel SIZEBOX -sizeof SIZESCROLL SKIPFONT SKIPOWNPROCESS @@ -2187,29 +1757,19 @@ Solutiondir somefile SOURCEBRANCH sourced -SOURCESDIRECTORY -SPACEBAR spammy spand -sprintf -sqlproj -srand -src SRCCODEPAGE SRCCOPY SRCINVERT srcsrv SRCSRVTRG srctool -sre srect srv srvinit srvpipe -ssh -sstream -stackoverflow -standalone +ssa STARTF STARTUPINFO STARTUPINFOEX @@ -2221,57 +1781,37 @@ STARTWPARMSW Statusline stdafx STDAPI -stdcall +stdc stdcpp -stderr -stdexcept -stdin -stdio STDMETHODCALLTYPE STDMETHODIMP -stdout -stgm +STGM stl -stoi -stol -stoul stoutapot Stri -strikethrough -stringstream +Stringable STRINGTABLE -strlen strrev strsafe -strtok -structs +STUBHEAD STUVWX -STX stylecop SUA subcompartment -subfolder +subfolders subkey SUBLANG -sublicensable -submenu subresource -subspan -substr subsystemconsole subsystemwindows suiteless -svg swapchain swapchainpanel swappable SWMR SWP -swprintf SYMED -symlink SYNCPAINT -sys syscalls SYSCHAR SYSCOMMAND @@ -2291,8 +1831,6 @@ TARG targetentrypoint TARGETLIBS TARGETNAME -targetnametoken -targetsize targetver taskbar tbar @@ -2307,23 +1845,20 @@ TCI tcome tcommandline tcommands +Tdd TDelegated TDP TEAMPROJECT tearoff Teb -techcommunity -technet tellp -telnet -telnetd -templated teraflop terminalcore +terminalinput +terminalrenderdata TERMINALSCROLLING terminfo TEs -testapp testbuildplatform testcon testd @@ -2332,7 +1867,6 @@ testenv testlab testlist testmd -testmddefinition testmode testname testnameprefix @@ -2347,7 +1881,6 @@ texel TExpected textattribute TEXTATTRIBUTEID -textbox textboxes textbuffer TEXTINCLUDE @@ -2355,100 +1888,82 @@ textinfo TEXTMETRIC TEXTMETRICW textmode +texttests TFCAT tfoo TFunction tga -threadpool THUMBPOSITION THUMBTRACK TIcon -tif tilunittests -Timeline titlebar TITLEISLINKNAME TJson TLambda +TLDP TLEN Tlgdata TMAE TMPF TMult tmultiple -tmux -todo +TODOs tofrom tokenhelpers -tokenized -tokenizing toolbars TOOLINFO -Toolset -tooltip +TOOLWINDOW TOPDOWNDIB TOPLEFT -toplevel TOPRIGHT TOpt tosign touchpad -towlower -towupper Tpp Tpqrst tprivapi tracelog tracelogging traceloggingprovider +traceviewpp trackbar TRACKCOMPOSITION trackpad -transcoder transitioning Trd TREX triaged triaging TRIANGLESTRIP +Tribool TRIMZEROHEADINGS -truetype trx tsattrs tsf +tsgr TStr TSTRFORMAT TSub TTBITMAP -ttf TTFONT TTFONTLIST tthe tthis TTM TTo -TVPP +tvpp Txtev typechecked -typechecking -typedef -typeid -typeinfo typelib -typename -typeof typeparam TYUI UAC uap uapadmin UAX -ubuntu ucd -ucdxml uch -UCHAR -ucs udk UDM uer @@ -2457,41 +1972,30 @@ uia UIACCESS uiacore uiautomationcore -Uid uielem UIELEMENTENABLEDONLY -uint -uintptr +UINTs ulcch -ulong +umul +umulh Unadvise unattend -uncomment UNCPRIORITY -undef -Unescape unexpand -Unfocus unhighlighting unhosted -unicode -UNICODESTRING UNICODETEXT UNICRT -uninit uninitialize -uninstall +Unintense Uniscribe -unittest unittesting -universaltest +unittests unk unknwn unmark UNORM unparseable -unpause -Unregister unregistering untests untextured @@ -2500,12 +2004,6 @@ UPDATEDISPLAY UPDOWN UPKEY UPSS -upvote -uri -url -urlencoded -Urxvt -USASCII usebackq USECALLBACK USECOLOR @@ -2519,43 +2017,29 @@ USEPOSITION userbase USERDATA userdpiapi -username Userp userprivapi -userprofile USERSRV USESHOWWINDOW USESIZE USESTDHANDLES -ushort +usp USRDLL -utf -utils utr -uuid -uuidof -uuidv UVWX UVWXY -UWA +uwa uwp uxtheme -vals Vanara vararg -vbproj vclib -Vcount vcpkg vcprintf -vcproj -vcvarsall vcxitems -vcxproj vec vectorized VERCTRL -versioning VERTBAR VFT vga @@ -2564,30 +2048,28 @@ viewkind viewports Virt VIRTTERM -Virtualizing vkey VKKEYSCAN VMs VPA -VPATH VPR VProc VRaw VREDRAW vsc +vsconfig vscprintf VSCROLL +vsdevshell vsinfo -vsnprintf vso vspath -vsprintf VSTAMP vstest VSTS VSTT -vstudio vswhere +vtapi vtapp VTE VTID @@ -2604,59 +2086,43 @@ vttest VWX waaay waitable -waivable WANSUNG WANTARROWS WANTTAB wapproj -wav +WAVEFORMATEX wbuilder wch -wchar +wchars WCIA WCIW -WClass -wcout -wcschr -wcscmp -wcscpy WCSHELPER wcsicmp -wcslen wcsnicmp -wcsrchr wcsrev -wcstod -wcstoul wddm wddmcon -wddmconrenderer WDDMCONSOLECONTEXT wdm webpage -website -websocket +websites +websockets wekyb -WEOF wex wextest wextestclass -wfdopen WFill wfopen -wfstream WHelper -whitelisting +wic WIDTHSCROLL Widthx -wiki -wikia -wikipedia wil WImpl WINAPI winbase winbasep +wincodec wincon winconp winconpty @@ -2666,14 +2132,12 @@ wincontypes WINCORE windbg WINDEF -WINDIR windll WINDOWALPHA Windowbuffer windowdpiapi WINDOWEDGE windowext -WINDOWFRAME windowime WINDOWINFO windowio @@ -2687,12 +2151,12 @@ windowrect windowsapp windowsinternalstring WINDOWSIZE +windowsshell +windowsterminal windowsx -WINDOWTEXT windowtheme WINDOWTITLE winevent -winfx wingdi winget WINIDE @@ -2712,10 +2176,8 @@ winuser winuserp WINVER wistd -wixproj -wline -wlinestream wmain +wmemory WMSZ wnd WNDALLOC @@ -2728,9 +2190,6 @@ WNull wnwb workarea workaround -workflow -workitem -wostream WOutside WOWARM WOWx @@ -2740,29 +2199,24 @@ wpf WPR WPrep WPresent -wprintf wprp wprpi wregex -WResult writeback writechar WRITECONSOLE WRITECONSOLEINPUT WRITECONSOLEOUTPUT WRITECONSOLEOUTPUTSTRING +wrkstr wrl wrp WRunoff WScript wsl WSLENV -wsmatch -WSpace -wss wstr -wstring -wstringstream +wstrings wsz wtd WTest @@ -2777,13 +2231,14 @@ wtypes Wubi WUX WVerify -wwaproj WWith wxh +wyhash +wymix +wyr xact -xaml Xamlmeta -xargs +xamls xaz xbf xbutton @@ -2801,48 +2256,41 @@ xes xff XFile XFORM -xIcon +xin +xinchaof +xinxinchaof XManifest XMath XMFLOAT -xml -xmlns -xor xorg -XPosition XResource -xsd xsi -xsize xstyler XSubstantial xtended -xterm XTest XTPOPSGR XTPUSHSGR xtr +XTWINOPS xunit xutr -xvalue XVIRTUALSCREEN XWalk -Xzn +xwwyzz +xxyyzz yact -YAML YCast YCENTER YCount YDPI -yIcon -yml YOffset -YPosition -YSize YSubstantial YVIRTUALSCREEN YWalk +Zabcdefghijklmnopqrstuvwxyz ZCmd ZCtrl -zsh zxcvbnm +ZYXWVU +ZYXWVUTd diff --git a/.github/actions/spelling/expect/web.txt b/.github/actions/spelling/expect/web.txt index 3072b0075b4..52c1cfd1f0f 100644 --- a/.github/actions/spelling/expect/web.txt +++ b/.github/actions/spelling/expect/web.txt @@ -1,17 +1,6 @@ -http -www -ecma -rapidtables WCAG -freedesktop -ycombinator -robertelder -kovidgoyal -leonerd -fixterms winui appshellintegration mdtauk -cppreference gfycat Guake diff --git a/.github/actions/spelling/line_forbidden.patterns b/.github/actions/spelling/line_forbidden.patterns new file mode 100644 index 00000000000..31ad2ddcd26 --- /dev/null +++ b/.github/actions/spelling/line_forbidden.patterns @@ -0,0 +1,62 @@ +# reject `m_data` as there's a certain OS which has evil defines that break things if it's used elsewhere +# \bm_data\b + +# If you have a framework that uses `it()` for testing and `fit()` for debugging a specific test, +# you might not want to check in code where you were debugging w/ `fit()`, in which case, you might want +# to use this: +#\bfit\( + +# s.b. GitHub +\bGithub\b + +# s.b. GitLab +\bGitlab\b + +# s.b. JavaScript +\bJavascript\b + +# s.b. Microsoft +\bMicroSoft\b + +# s.b. another +\ban[- ]other\b + +# s.b. greater than +\bgreater then\b + +# s.b. into +#\sin to\s + +# s.b. opt-in +\sopt in\s + +# s.b. less than +\bless then\b + +# s.b. otherwise +\bother[- ]wise\b + +# s.b. nonexistent +\bnon existing\b +\b[Nn]o[nt][- ]existent\b + +# s.b. preexisting +[Pp]re[- ]existing + +# s.b. preempt +[Pp]re[- ]empt\b + +# s.b. preemptively +[Pp]re[- ]emptively + +# s.b. reentrancy +[Rr]e[- ]entrancy + +# s.b. reentrant +[Rr]e[- ]entrant + +# s.b. workaround(s) +#\bwork[- ]arounds?\b + +# Reject duplicate words +\s([A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,})\s\g{-1}\s diff --git a/.github/actions/spelling/patterns/patterns.txt b/.github/actions/spelling/patterns/patterns.txt index 882243396d6..a0e1931f36f 100644 --- a/.github/actions/spelling/patterns/patterns.txt +++ b/.github/actions/spelling/patterns/patterns.txt @@ -1,11 +1,6 @@ -https://(?:(?:[-a-zA-Z0-9?&=]*\.|)microsoft\.com)/[-a-zA-Z0-9?&=_#\/.]* -https://aka\.ms/[-a-zA-Z0-9?&=\/_]* -https://www\.itscj\.ipsj\.or\.jp/iso-ir/[-0-9]+\.pdf -https://www\.vt100\.net/docs/[-a-zA-Z0-9#_\/.]* -https://www.w3.org/[-a-zA-Z0-9?&=\/_#]* -https://(?:(?:www\.|)youtube\.com|youtu.be)/[-a-zA-Z0-9?&=]* -https://(?:[a-z-]+\.|)github(?:usercontent|)\.com/[-a-zA-Z0-9?%&=_\/.]* -https://www.xfree86.org/[-a-zA-Z0-9?&=\/_#]* +# See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-patterns + +https?://\S+ [Pp]ublicKeyToken="?[0-9a-fA-F]{16}"? (?:[{"]|UniqueIdentifier>)[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}(?:[}"]|v# +(?:(?<=[A-Z]{2})V|(?<=[a-z]{2}|[A-Z]{2})v)\d+(?:\b|(?=[a-zA-Z_])) + +# hit-count: 20 file-count: 9 +# hex runs +\b[0-9a-fA-F]{16,}\b + +# hit-count: 10 file-count: 7 +# uuid: +\b[0-9a-fA-F]{8}-(?:[0-9a-fA-F]{4}-){3}[0-9a-fA-F]{12}\b + +# hit-count: 4 file-count: 4 +# mailto urls +mailto:[-a-zA-Z=;:/?%&0-9+@.]{3,} + +# hit-count: 4 file-count: 1 +# ANSI color codes +(?:\\(?:u00|x)1b|\x1b)\[\d+(?:;\d+|)m + +# hit-count: 2 file-count: 1 +# latex +\\(?:n(?:ew|ormal|osub)|r(?:enew)|t(?:able(?:of|)|he|itle))(?=[a-z]+) + +# hit-count: 1 file-count: 1 +# hex digits including css/html color classes: +(?:[\\0][xX]|\\u|[uU]\+|#x?|\%23)[0-9_a-fA-FgGrR]*?[a-fA-FgGrR]{2,}[0-9_a-fA-FgGrR]*(?:[uUlL]{0,3}|u\d+)\b + +# hit-count: 1 file-count: 1 +# Non-English +[a-zA-Z]*[ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź][a-zA-Z]{3}[a-zA-ZÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýÿĀāŁłŃńŅņŒœŚśŠšŜŝŸŽžź]* + +# hit-count: 1 file-count: 1 +# French +# This corpus only had capital letters, but you probably want lowercase ones as well. +\b[LN]'+[a-z]{2,}\b + +# acceptable duplicates +# ls directory listings +[-bcdlpsw](?:[-r][-w][-sx]){3}\s+\d+\s+(\S+)\s+\g{-1}\s+\d+\s+ +# C/idl types + English ... +\s(Guid|long|LONG|that) \g{-1}\s + +# javadoc / .net +(?:[\\@](?:groupname|param)|(?:public|private)(?:\s+static|\s+readonly)*)\s+(\w+)\s+\g{-1}\s + +# Commit message -- Signed-off-by and friends +^\s*(?:(?:Based-on-patch|Co-authored|Helped|Mentored|Reported|Reviewed|Signed-off)-by|Thanks-to): (?:[^<]*<[^>]*>|[^<]*)\s*$ + +# Autogenerated revert commit message +^This reverts commit [0-9a-f]{40}\.$ + +# vtmode +--vtmode\s+(\w+)\s+\g{-1}\s + +# ignore long runs of a single character: +\b([A-Za-z])\g{-1}{3,}\b diff --git a/.github/actions/spelling/reject.txt b/.github/actions/spelling/reject.txt index e2763f35a82..301719de47e 100644 --- a/.github/actions/spelling/reject.txt +++ b/.github/actions/spelling/reject.txt @@ -1,22 +1,12 @@ ^attache$ ^attacher$ ^attachers$ -^spae$ -^spaebook$ -^spaecraft$ -^spaed$ -^spaedom$ -^spaeing$ -^spaeings$ -^spae-man$ -^spaeman$ -^spaer$ -^Spaerobee$ -^spaes$ -^spaewife$ -^spaewoman$ -^spaework$ -^spaewright$ -^wether$ -^wethers$ -^wetherteg$ +benefitting +occurences? +^dependan.* +^oer$ +Sorce +^[Ss]pae.* +^untill$ +^untilling$ +^wether.* diff --git a/.github/workflows/spelling2.yml b/.github/workflows/spelling2.yml index a44931267ee..446b24343ed 100644 --- a/.github/workflows/spelling2.yml +++ b/.github/workflows/spelling2.yml @@ -1,20 +1,134 @@ # spelling.yml is blocked per https://github.com/check-spelling/check-spelling/security/advisories/GHSA-g86g-chm8-7r2p name: Spell checking + +# Comment management is handled through a secondary job, for details see: +# https://github.com/check-spelling/check-spelling/wiki/Feature%3A-Restricted-Permissions +# +# `jobs.comment-push` runs when a push is made to a repository and the `jobs.spelling` job needs to make a comment +# (in odd cases, it might actually run just to collapse a commment, but that's fairly rare) +# it needs `contents: write` in order to add a comment. +# +# `jobs.comment-pr` runs when a pull_request is made to a repository and the `jobs.spelling` job needs to make a comment +# or collapse a comment (in the case where it had previously made a comment and now no longer needs to show a comment) +# it needs `pull-requests: write` in order to manipulate those comments. + +# Updating pull request branches is managed via comment handling. +# For details, see: https://github.com/check-spelling/check-spelling/wiki/Feature:-Update-expect-list +# +# These elements work together to make it happen: +# +# `on.issue_comment` +# This event listens to comments by users asking to update the metadata. +# +# `jobs.update` +# This job runs in response to an issue_comment and will push a new commit +# to update the spelling metadata. +# +# `with.experimental_apply_changes_via_bot` +# Tells the action to support and generate messages that enable it +# to make a commit to update the spelling metadata. +# +# `with.ssh_key` +# In order to trigger workflows when the commit is made, you can provide a +# secret (typically, a write-enabled github deploy key). +# +# For background, see: https://github.com/check-spelling/check-spelling/wiki/Feature:-Update-with-deploy-key + on: - pull_request_target: push: + branches: + - "**" + tags-ignore: + - "**" + pull_request_target: + branches: + - "**" + tags-ignore: + - "**" + types: + - 'opened' + - 'reopened' + - 'synchronize' + issue_comment: + types: + - 'created' jobs: spelling: name: Spell checking + permissions: + contents: read + pull-requests: read + actions: read + outputs: + followup: ${{ steps.spelling.outputs.followup }} + runs-on: ubuntu-latest + if: "contains(github.event_name, 'pull_request') || github.event_name == 'push'" + concurrency: + group: spelling-${{ github.event.pull_request.number || github.ref }} + # note: If you use only_check_changed_files, you do not want cancel-in-progress + cancel-in-progress: true + steps: + - name: check-spelling + id: spelling + uses: check-spelling/check-spelling@v0.0.21 + with: + suppress_push_for_open_pull_request: 1 + checkout: true + check_file_names: 1 + spell_check_this: check-spelling/spell-check-this@prerelease + post_comment: 0 + use_magic_file: 1 + extra_dictionary_limit: 10 + extra_dictionaries: + cspell:software-terms/src/software-terms.txt + cspell:python/src/python/python-lib.txt + cspell:node/node.txt + cspell:cpp/src/stdlib-c.txt + cspell:cpp/src/stdlib-cpp.txt + cspell:fullstack/fullstack.txt + cspell:filetypes/filetypes.txt + cspell:html/html.txt + cspell:cpp/src/compiler-msvc.txt + cspell:python/src/common/extra.txt + cspell:powershell/powershell.txt + cspell:aws/aws.txt + cspell:cpp/src/lang-keywords.txt + cspell:npm/npm.txt + cspell:dotnet/dotnet.txt + cspell:python/src/python/python.txt + cspell:css/css.txt + cspell:cpp/src/stdlib-cmath.txt + check_extra_dictionaries: '' + + comment-push: + name: Report (Push) + # If your workflow isn't running on push, you can remove this job + runs-on: ubuntu-latest + needs: spelling + permissions: + contents: write + if: (success() || failure()) && needs.spelling.outputs.followup && github.event_name == 'push' + steps: + - name: comment + uses: check-spelling/check-spelling@v0.0.21 + with: + checkout: true + spell_check_this: check-spelling/spell-check-this@prerelease + task: ${{ needs.spelling.outputs.followup }} + + comment-pr: + name: Report (PR) + # If you workflow isn't running on pull_request*, you can remove this job runs-on: ubuntu-latest + needs: spelling + permissions: + pull-requests: write + if: (success() || failure()) && needs.spelling.outputs.followup && contains(github.event_name, 'pull_request') steps: - - name: checkout-merge - if: "contains(github.event_name, 'pull_request')" - uses: actions/checkout@v2 + - name: comment + uses: check-spelling/check-spelling@v0.0.21 with: - ref: refs/pull/${{github.event.pull_request.number}}/merge - - name: checkout - if: "!contains(github.event_name, 'pull_request')" - uses: actions/checkout@v2 - - uses: check-spelling/check-spelling@v0.0.19 + checkout: true + spell_check_this: check-spelling/spell-check-this@prerelease + task: ${{ needs.spelling.outputs.followup }}