[ci]Upgrade to check-spelling 0.0.20alpha7 (#19127)

* spelling: added

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: and

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: another

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: color

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: file

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: github

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: not

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: occurrences

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: stamp

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: suppressions

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: the

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: up to

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: whether

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: whichdoes

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* Upgrade check-spelling to v0.0.20-alpha7

Config based on:
a5001170a7

* Adding duplicate detection to patterns.txt
* Adding line_forbidden.patterns
* Adding reject.txt
* Updated excludes (and sorted)
* Switching to unified workflow

* moving `wil` to allow.txt to clarify that it's a term of art
  (https://github.com/microsoft/wil), whereas often it's a typo for `will`.

* Update src/runner/main.cpp

Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
This commit is contained in:
Josh Soref
2022-07-01 10:09:41 -04:00
committed by GitHub
parent f4dbdbdd7a
commit 3cb0638c7e
37 changed files with 190 additions and 144 deletions

15
.github/actions/spell-check/README.md vendored Normal file
View File

@@ -0,0 +1,15 @@
# check-spelling/check-spelling configuration
File | Purpose | Format | Info
-|-|-|-
[allow.txt](allow.txt) | 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)
[only.txt](only.txt) | Only check matching files (applied after excludes) | perl regular expression | [only](https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples%3A-only)
[patterns.txt](patterns.txt) | 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)
[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.

1
.github/actions/spell-check/allow.txt vendored Normal file
View File

@@ -0,0 +1 @@
wil

View File

@@ -1,13 +1,15 @@
# See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-excludes # See https://github.com/check-spelling/check-spelling/wiki/Configuration-Examples:-excludes
(?:^|/)monacoSRC/
(?:^|/)MonacoPreviewHandler/customLanguages/
(?:^|/)MonacoPreviewHandler/monaco_languages.json
(?:^|/)MonacoPreviewHandler/index.html
(?:^|/)MonacoPreviewHandler/generateLanguagesJson.html
(?:^|/)MonacoPreviewHandler/monacoSpecialLanguages.js
(?:^|/)(?i)COPYRIGHT (?:^|/)(?i)COPYRIGHT
(?:^|/)(?i)LICEN[CS]E (?:^|/)(?i)LICEN[CS]E
(?:^|/)package(?:-lock)\.json$ (?:^|/)go\.sum$
(?:^|/)MonacoPreviewHandler/customLanguages/
(?:^|/)MonacoPreviewHandler/generateLanguagesJson.html
(?:^|/)MonacoPreviewHandler/index.html
(?:^|/)MonacoPreviewHandler/monacoSpecialLanguages.js
(?:^|/)MonacoPreviewHandler/monaco_languages.json
(?:^|/)monacoSRC/
(?:^|/)package(?:-lock|)\.json$
(?:^|/)timezones\.json$
(?:^|/)vendor/ (?:^|/)vendor/
(?:^|/)WindowsSettings\.json$ (?:^|/)WindowsSettings\.json$
/package(?:-lock|)\.json$ /package(?:-lock|)\.json$
@@ -16,24 +18,44 @@
ignore$ ignore$
[/.][a-z]{2}(?:-[a-zA-Z]{2}|)\. [/.][a-z]{2}(?:-[a-zA-Z]{2}|)\.
\.ai$ \.ai$
\.avi$
\.bmp$ \.bmp$
\.bz2$
\.crt$
\.dat$ \.dat$
\.dll$ \.dll$
\.DS_Store$
\.eot$
\.filters$ \.filters$
\.gcode$ \.gcode$
\.gif$ \.gif$
\.gitattributes$
\.gitignore$ \.gitignore$
\.graffle$
\.gz$
\.icns$
\.ico$ \.ico$
\.jpg$ \.jar$
\.jpe?g$
\.key$
\.lcl$ \.lcl$
\.lock$ \.lock$
\.min\. \.map$
\.min\..
\.mod$ \.mod$
\.mp[34]$
\.ocf$
\.otf$
\.pdf$ \.pdf$
\.pem$
\.PNG$ \.PNG$
\.png$ \.png$
\.psd$
\.stl$ \.stl$
\.woff$ \.svg$
\.ttf$
\.wav$
\.woff2?$
\.zip$ \.zip$
^doc/devdocs/akaLinks\.md$ ^doc/devdocs/akaLinks\.md$
^installer/PowerToysSetup/WebView2/MicrosoftEdgeWebview2Setup.exe$ ^installer/PowerToysSetup/WebView2/MicrosoftEdgeWebview2Setup.exe$
@@ -52,6 +74,4 @@ ignore$
^\.github/ ^\.github/
^\.github/actions/spell-check/ ^\.github/actions/spell-check/
^\.gitmodules$ ^\.gitmodules$
(?:^|/)WindowsSettings\.json$
(?:^|/)timezones\.json$
^\Q.pipelines/ESRPSigning_core.json\E$ ^\Q.pipelines/ESRPSigning_core.json\E$

View File

@@ -20,6 +20,7 @@ actioned
activatable activatable
ACTIVATEAPP ACTIVATEAPP
activationaction activationaction
adamchilders
ADDUNDORECORD ADDUNDORECORD
ADifferent ADifferent
ADMINS ADMINS
@@ -94,7 +95,6 @@ ARPPRODUCTICON
ARRAYSIZE ARRAYSIZE
arsinh arsinh
artanh artanh
Artboard
Artsakh Artsakh
asdf asdf
AShortcut AShortcut
@@ -133,6 +133,7 @@ awakeness
awakeversion awakeversion
AWAYMODE AWAYMODE
AYUV AYUV
azchohfi
backend backend
backtracer backtracer
BADD BADD
@@ -190,7 +191,6 @@ Bto
buf buf
BUFSIZE BUFSIZE
bugreport bugreport
BUILDARCH
BUILDNUMBER BUILDNUMBER
buildtask buildtask
buildtransitive buildtransitive
@@ -268,7 +268,6 @@ cnt
Cocklebiddy Cocklebiddy
coclass coclass
codebase codebase
codecvt
CODENAME CODENAME
codeofconduct codeofconduct
codereview codereview
@@ -299,7 +298,6 @@ comsuppw
comsuppwd comsuppwd
comutil comutil
Concat Concat
concrt
configs configs
Configurator Configurator
CONFLICTINGMODIFIERKEY CONFLICTINGMODIFIERKEY
@@ -337,6 +335,7 @@ crlf
cron cron
Crossdevice Crossdevice
CRSEL CRSEL
crutkas
CSearch CSearch
CSettings CSettings
csharp csharp
@@ -439,11 +438,9 @@ devblogs
devdocs devdocs
devenum devenum
DEVMON DEVMON
devops
devpkey devpkey
DEVSOURCE DEVSOURCE
dhcp dhcp
diffing
difftime difftime
DIIRFLAG DIIRFLAG
dimm dimm
@@ -460,7 +457,6 @@ DLGMODALFRAME
dlib dlib
dllexport dllexport
dllhost dllhost
dllimport
dllmain dllmain
dlls dlls
DNLEN DNLEN
@@ -494,9 +490,9 @@ DWINRT
dwl dwl
dwm dwm
dwmapi dwmapi
dwmcorei
DWMCOLORIZATIONCOLORCHANGED DWMCOLORIZATIONCOLORCHANGED
DWMCOMPOSITIONCHANGED DWMCOMPOSITIONCHANGED
dwmcorei
DWMNCRENDERINGCHANGED DWMNCRENDERINGCHANGED
Dwmp Dwmp
DWMSENDICONICLIVEPREVIEWBITMAP DWMSENDICONICLIVEPREVIEWBITMAP
@@ -524,6 +520,7 @@ EFile
ekus ekus
elif elif
elseif elseif
eltociear
Emoji Emoji
emptyrecyclebin emptyrecyclebin
ENABLEDPOPUP ENABLEDPOPUP
@@ -538,7 +535,7 @@ entrypoint
ENU ENU
enum enum
EOAC EOAC
eol EOL
epicgames epicgames
Eqn Eqn
ERASEBKGND ERASEBKGND
@@ -683,6 +680,7 @@ hanselman
hardcoded hardcoded
Hardlines Hardlines
HARDWAREINPUT HARDWAREINPUT
harvastum
hashcode hashcode
Hashset Hashset
Hashtable Hashtable
@@ -743,7 +741,6 @@ homljgmgpmcbpjbnjpfijnhipfkiclkd
HOOKPROC HOOKPROC
Hostbackdropbrush Hostbackdropbrush
hostname hostname
hotfix
hotkeycontrol hotkeycontrol
hotkeys hotkeys
hotlight hotlight
@@ -867,7 +864,6 @@ IMedia
IMem IMem
IMessage IMessage
imeutil imeutil
iminstall
IMoniker IMoniker
IMouse IMouse
impl impl
@@ -985,7 +981,6 @@ IVector
IView IView
IVirtual IVirtual
IWbem IWbem
IWeb
IWIC IWIC
iwindow iwindow
IWork IWork
@@ -1079,7 +1074,6 @@ LIBID
Lifecycle Lifecycle
LIGHTORANGE LIGHTORANGE
LIGHTTURQUOISE LIGHTTURQUOISE
lightunplated
lindex lindex
linkedin linkedin
linq linq
@@ -1288,7 +1282,6 @@ msp
msrc msrc
mst mst
msvc msvc
msvcp
MTND MTND
Mul Mul
multiline multiline
@@ -1424,7 +1417,6 @@ Objbase
OBJID OBJID
objidl objidl
oblitum oblitum
octodex
odbc odbc
odbccp odbccp
Oem Oem
@@ -1459,7 +1451,6 @@ OSVERSIONINFOEX
OSVERSIONINFOEXW OSVERSIONINFOEXW
OSVERSIONINFOW OSVERSIONINFOW
osvi osvi
otating
OUTOFCONTEXT OUTOFCONTEXT
OUTOFMEMORY OUTOFMEMORY
outpin outpin
@@ -1498,7 +1489,6 @@ PCIDLIST
PCWSTR PCWSTR
pdb pdb
pdbonly pdbonly
pde
pdfpreviewhandler pdfpreviewhandler
pdo pdo
pdto pdto
@@ -1653,6 +1643,7 @@ RBUTTONDBLCLK
RBUTTONDOWN RBUTTONDOWN
RBUTTONUP RBUTTONUP
rclsid rclsid
rcmaehl
RCONTROL RCONTROL
RCtrl RCtrl
readme readme
@@ -1752,8 +1743,6 @@ RTB
RTCS RTCS
RTLREADING RTLREADING
RTSS RTSS
ruleset
RUNACTIVEXCTLS
runas runas
rundll rundll
rungameid rungameid
@@ -1816,6 +1805,7 @@ SETWORKAREA
sfgao sfgao
SFGAOF SFGAOF
SFP SFP
shandsj
sharpkeys sharpkeys
SHCNE SHCNE
SHCNF SHCNF
@@ -1864,6 +1854,7 @@ SIGABRT
sigdn sigdn
SIGNINGSCENARIO SIGNINGSCENARIO
signtool signtool
sinclairinat
SINGLEKEY SINGLEKEY
singlekeyremapcontrol singlekeyremapcontrol
singletones singletones
@@ -1877,7 +1868,6 @@ SIZENWSE
sizeof sizeof
sizeread sizeread
SIZEWE SIZEWE
sketchapp
SKIPOWNPROCESS SKIPOWNPROCESS
sku sku
SLGP SLGP
@@ -1885,6 +1875,7 @@ sln
SMALLICON SMALLICON
SMTO SMTO
snd snd
snickler
snwprintf snwprintf
softline softline
somil somil
@@ -1982,7 +1973,6 @@ subquery
substr substr
Sul Sul
Superbar Superbar
supressions
Suri Suri
sut sut
SVE SVE
@@ -2054,7 +2044,6 @@ THH
THICKFRAME THICKFRAME
THISCOMPONENT THISCOMPONENT
THotkey THotkey
thre
TILEDWINDOW TILEDWINDOW
timedate timedate
timediff timediff
@@ -2091,7 +2080,6 @@ TRK
trl trl
trunc trunc
Tshuapa Tshuapa
tspan
TStr TStr
Tuva Tuva
TValue TValue
@@ -2184,14 +2172,10 @@ uxtheme
UYVY UYVY
validmodulename validmodulename
vcamp vcamp
vccorlib
vcdl vcdl
VCINSTALLDIR VCINSTALLDIR
vcm vcm
vcomp
vcredist
VCRT VCRT
vcruntime
vcvars vcvars
VDesktop VDesktop
vdi vdi
@@ -2262,13 +2246,11 @@ wekyb
Wevtapi Wevtapi
wformat wformat
wgpocpl wgpocpl
Whichdoes
whitespaces whitespaces
WIC WIC
wifi wifi
wiki wiki
wikipedia wikipedia
wil
wildcards wildcards
winapi winapi
winappdriver winappdriver
@@ -2277,7 +2259,6 @@ Wincodecsdk
wincolor wincolor
windef windef
windir windir
Windowcontrols
WINDOWCREATED WINDOWCREATED
WINDOWEDGE WINDOWEDGE
WINDOWNAME WINDOWNAME
@@ -2285,8 +2266,6 @@ WINDOWPLACEMENT
WINDOWPOSCHANGED WINDOWPOSCHANGED
WINDOWPOSCHANGING WINDOWPOSCHANGING
Windowsapp Windowsapp
windowsappruntimeinstall
windowsappsdk
WINDOWSBUILDNUMBER WINDOWSBUILDNUMBER
Windowscodecs Windowscodecs
windowsdesktop windowsdesktop

View File

@@ -0,0 +1,32 @@
# reject `m_data` as there's a certain OS which has evil defines that break things if it's used elsewhere
# \bm_data\b
# 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. otherwise
\bother wise\b
# s.b. nonexistent
\bnon existing\b
# s.b. preexisting
[Pp]re-existing
# s.b. preemptively
[Pp]re-emptively
# Reject duplicate words
\s([A-Z]{3,}|[A-Z][a-z]{2,}|[a-z]{3,})\s\g{-1}\s

View File

@@ -43,8 +43,6 @@ Hash="[0-9A-F]{40}"
# hex digits including css/html color classes: # hex digits including css/html color classes:
(?:[\\0][xX]|\\u|[uU]\+|#x?|\%23|L")[0-9a-fA-FgGrR_]{2,}(?:[uU]?[lL]{0,2}|u\d+)\b (?:[\\0][xX]|\\u|[uU]\+|#x?|\%23|L")[0-9a-fA-FgGrR_]{2,}(?:[uU]?[lL]{0,2}|u\d+)\b
# ignore long runs of a single character:
\b([A-Za-z])\g{-1}{3,}\b
(?:L"[abAB]+", ){3}L"[abAB]+" (?:L"[abAB]+", ){3}L"[abAB]+"
"Lorem[^"]+?\." "Lorem[^"]+?\."
TestCase\("[^"]+" TestCase\("[^"]+"
@@ -105,3 +103,14 @@ http://tes/
# tar arguments # tar arguments
\b(?:\\n|)tar(?:\s+-[a-zA-Z]+|\s[a-z]+)+ \b(?:\\n|)tar(?:\s+-[a-zA-Z]+|\s[a-z]+)+
# acceptable duplicates
# /bin/ls -l output
[-bcdlpsw](?:[-r][-w][-sx]){3}\s+\d+\s+(\S+)\s+\g{-1}\s+\d+\s+
# C types
\s(long|LONG) \g{-1}\s
# javadoc / .net
(?:\@(?:groupname|param)|(?:public|private)(?:\s+static|\s+readonly)*)\s+(\w+)\s+\g{-1}\s
# ignore long runs of a single character:
\b([A-Za-z])\g{-1}{3,}\b

10
.github/actions/spell-check/reject.txt vendored Normal file
View File

@@ -0,0 +1,10 @@
^attache$
benefitting
occurences?
^dependan.*
^oer$
Sorce
^[Ss]pae.*
^untill$
^untilling$
^wether.*

View File

@@ -12,8 +12,9 @@ jobs:
permissions: permissions:
contents: read contents: read
pull-requests: read pull-requests: read
actions: read
outputs: outputs:
internal_state_directory: ${{ steps.spelling.outputs.internal_state_directory }} followup: ${{ steps.spelling.outputs.followup }}
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: "contains(github.event_name, 'pull_request') || github.event_name == 'push'" if: "contains(github.event_name, 'pull_request') || github.event_name == 'push'"
concurrency: concurrency:
@@ -21,35 +22,19 @@ jobs:
# note: If you use only_check_changed_files, you do not want cancel-in-progress # note: If you use only_check_changed_files, you do not want cancel-in-progress
cancel-in-progress: true cancel-in-progress: true
steps: steps:
- name: checkout-merge
if: "contains(github.event_name, 'pull_request')"
uses: actions/checkout@v2
with:
ref: refs/pull/${{github.event.pull_request.number}}/merge
- name: checkout
if: github.event_name == 'push'
uses: actions/checkout@v2
- name: check-spelling - name: check-spelling
id: spelling id: spelling
uses: check-spelling/check-spelling@v0.0.20-alpha3 uses: check-spelling/check-spelling@v0.0.20-alpha7
with: with:
config: .github/actions/spell-check config: .github/actions/spell-check
suppress_push_for_open_pull_request: 1 suppress_push_for_open_pull_request: 1
checkout: true
post_comment: 0 post_comment: 0
dictionary_source_prefixes: '{"cspell": "https://raw.githubusercontent.com/check-spelling/cspell-dicts/master/dictionaries/"}'
extra_dictionaries: extra_dictionaries:
cspell:filetypes/filetypes.txt cspell:filetypes/filetypes.txt
cspell:html/html.txt cspell:html/html.txt
cspell:css/css.txt cspell:css/css.txt
check_extra_dictionaries: '' check_extra_dictionaries: ''
- name: store-comment
if: failure()
uses: actions/upload-artifact@v2
with:
retention-days: 1
name: "check-spelling-comment-${{ github.run_id }}"
path: |
${{ steps.spelling.outputs.internal_state_directory }}
comment: comment:
name: Comment name: Comment
@@ -58,21 +43,16 @@ jobs:
permissions: permissions:
contents: write contents: write
pull-requests: write pull-requests: write
if: always() && needs.spelling.result == 'failure' && needs.spelling.outputs.internal_state_directory if: (success() || failure()) && needs.spelling.outputs.followup
steps: steps:
- name: checkout
uses: actions/checkout@v2
- name: set up
run: |
mkdir /tmp/data
- name: retrieve-comment
uses: actions/download-artifact@v2
with:
name: "check-spelling-comment-${{ github.run_id }}"
path: /tmp/data
- name: comment - name: comment
uses: check-spelling/check-spelling@v0.0.20-alpha3 uses: check-spelling/check-spelling@v0.0.20-alpha7
with: with:
config: .github/actions/spell-check config: .github/actions/spell-check
custom_task: comment checkout: true
internal_state_directory: /tmp/data task: ${{ needs.spelling.outputs.followup }}
extra_dictionaries:
cspell:filetypes/filetypes.txt
cspell:html/html.txt
cspell:css/css.txt
check_extra_dictionaries: ''

View File

@@ -16,7 +16,7 @@
<PropertyGroup Condition="'$(MSBuildProjectExtension)' == '.csproj'"> <PropertyGroup Condition="'$(MSBuildProjectExtension)' == '.csproj'">
<RepositoryUrl>https://github.com/microsoft/PowerToys</RepositoryUrl> <RepositoryUrl>https://github.com/microsoft/PowerToys</RepositoryUrl>
<RepositoryType>Github</RepositoryType> <RepositoryType>GitHub</RepositoryType>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(MSBuildProjectExtension)' == '.csproj'"> <PropertyGroup Condition="'$(MSBuildProjectExtension)' == '.csproj'">

View File

@@ -23,7 +23,7 @@ This file contains documentation for all the methods involved in key/shortcut re
## HandleShortcutRemapEvent ## HandleShortcutRemapEvent
[This method](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/KeyboardEventHandlers.cpp#L178-L739) is used for handling the shortcut to shortcut and shortcut to key remapping logic. The general logic is as follows: [This method](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/KeyboardEventHandlers.cpp#L178-L739) is used for handling the shortcut to shortcut and shortcut to key remapping logic. The general logic is as follows:
- Check if any shortcut remap is currently invoked. This is required to ensure that two remaps don't occur simultaneously at a time, and we send key up events for the shortcuts only if they are actually invoked and not for artificial key up events. In addition to that, while a remap is in the middle of execution, the keyboard state will not match the physical keys, so we do not want a remap <kbd>Ctrl+A</kbd> to <kbd>Ctrl+V</kbd> to also trigger the remap from <kbd>Ctrl+V</kbd> to <kbd>Alt+V</kbd> on pressing <kbd>Ctrl+A</kbd> on the keyboard. - Check if any shortcut remap is currently invoked. This is required to ensure that two remaps don't occur simultaneously at a time, and we send key up events for the shortcuts only if they are actually invoked and not for artificial key up events. In addition to that, while a remap is in the middle of execution, the keyboard state will not match the physical keys, so we do not want a remap <kbd>Ctrl+A</kbd> to <kbd>Ctrl+V</kbd> to also trigger the remap from <kbd>Ctrl+V</kbd> to <kbd>Alt+V</kbd> on pressing <kbd>Ctrl+A</kbd> on the keyboard.
- Get the remap table as per the the `activatedApp` argument (i.e. if it is empty, we get the global shortcut remap table and otherwise we get the corresponding app-specific shortcut remap table). - Get the remap table as per the `activatedApp` argument (i.e. if it is empty, we get the global shortcut remap table and otherwise we get the corresponding app-specific shortcut remap table).
- Iterate over the list of remaps in descending order of number of keys in the shortcut. This is required **for shortcut to key remaps** to ensure that if a user has both <kbd>Ctrl+A</kbd> and <kbd>Ctrl+Shift+A</kbd> remapped to some keys, and the user presses <kbd>Ctrl+Shift+A</kbd>, then we prefer the <kbd>Ctrl+Shift+A</kbd> remap. This logic would not be required if there were only shortcut to shortcut remaps, as they are invoked only on exact match. - Iterate over the list of remaps in descending order of number of keys in the shortcut. This is required **for shortcut to key remaps** to ensure that if a user has both <kbd>Ctrl+A</kbd> and <kbd>Ctrl+Shift+A</kbd> remapped to some keys, and the user presses <kbd>Ctrl+Shift+A</kbd>, then we prefer the <kbd>Ctrl+Shift+A</kbd> remap. This logic would not be required if there were only shortcut to shortcut remaps, as they are invoked only on exact match.
- If any shortcut was found to be invoked (from the first step), then we skip till we find the matching shortcut remap. If not we check if the modifiers of the original shortcut are pressed down. If they are, we check if the current key event is a key down event and it matches the action key of the original shortcut. For shortcut to shortcut and for disabling a shortcut [we have an additional step](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/KeyboardEventHandlers.cpp#L208-L212) where we check if any other key is pressed apart from the original shortcut. This is required because for these two features we allow the remaps only if those exact keys are pressed. The method used for this is described in detail [here](keyboardmanagercommon.md#IsKeyboardStateClearExceptShortcut). If a win key was pressed, we store whether it was the left or the right one, in order to determine which key to set for remaps from/to the common Win key code which we added. This is so that pressing and releasing Left Win key results in that Win key getting modified and not the Right Win key. - If any shortcut was found to be invoked (from the first step), then we skip till we find the matching shortcut remap. If not we check if the modifiers of the original shortcut are pressed down. If they are, we check if the current key event is a key down event and it matches the action key of the original shortcut. For shortcut to shortcut and for disabling a shortcut [we have an additional step](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/KeyboardEventHandlers.cpp#L208-L212) where we check if any other key is pressed apart from the original shortcut. This is required because for these two features we allow the remaps only if those exact keys are pressed. The method used for this is described in detail [here](keyboardmanagercommon.md#IsKeyboardStateClearExceptShortcut). If a win key was pressed, we store whether it was the left or the right one, in order to determine which key to set for remaps from/to the common Win key code which we added. This is so that pressing and releasing Left Win key results in that Win key getting modified and not the Right Win key.
- If the remap is to a key, we send a dummy key event followed by releasing the original shortcut's modifiers and setting the target key (or doing nothing if it is remapped to disable) and we suppress the event. - If the remap is to a key, we send a dummy key event followed by releasing the original shortcut's modifiers and setting the target key (or doing nothing if it is remapped to disable) and we suppress the event.

View File

@@ -101,7 +101,7 @@ KBM uses two sets of settings files.
- `remapShortcuts` is split into `global` and `appSpecific`, where `global` remaps would apply to all applications, whereas `appSpecific` would apply on when the `targetApp` is in focus. `targetApp` must be the process name of the app (with or without it's extension), e.g. `msedge` or `msedge.exe` for Microsoft Edge. - `remapShortcuts` is split into `global` and `appSpecific`, where `global` remaps would apply to all applications, whereas `appSpecific` would apply on when the `targetApp` is in focus. `targetApp` must be the process name of the app (with or without it's extension), e.g. `msedge` or `msedge.exe` for Microsoft Edge.
## Loading settings ## Loading settings
KBM settings are loaded only on the C++ side only at start up, in the [constructor](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/dllmain.cpp#L67-L68). The settings file may get modified from the KBM UI on applying new remappings, but the the file is not read again. The files are read from the PowerToys Settings process whenever a change is made to the file (using a FileWatcher) or whenever the KBM page is opened. The settings are updated only when the user presses the OK button from either of the Remap Keys or Remap Shortcuts windows. This is described in more detail [here](keyboardmanagerui.md#ok-and-cancel-button). KBM settings are loaded only on the C++ side only at start up, in the [constructor](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/dllmain.cpp#L67-L68). The settings file may get modified from the KBM UI on applying new remappings, but the file is not read again. The files are read from the PowerToys Settings process whenever a change is made to the file (using a FileWatcher) or whenever the KBM page is opened. The settings are updated only when the user presses the OK button from either of the Remap Keys or Remap Shortcuts windows. This is described in more detail [here](keyboardmanagerui.md#ok-and-cancel-button).
## Low level keyboard hook handler ## Low level keyboard hook handler
Since the [`hook_proc`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/dllmain.cpp#L330-L349) cannot be a member function in the class, this is declared `static` and a `static pointer` to the `KeyboardManager` project is used ([`keyboardmanager_object_ptr`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/dllmain.cpp#L54-L55)). Since the [`hook_proc`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/dllmain.cpp#L330-L349) cannot be a member function in the class, this is declared `static` and a `static pointer` to the `KeyboardManager` project is used ([`keyboardmanager_object_ptr`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/dllmain.cpp#L54-L55)).
@@ -114,10 +114,10 @@ As seen in the code for `hook_proc`, similar to other keyboard hooks in PowerToy
The [`HandleKeyboardHookEvent`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/dllmain.cpp#L384-L458) is the method which calls the corresponding remapping methods in the required order. The following checks are executed in order: The [`HandleKeyboardHookEvent`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/dllmain.cpp#L384-L458) is the method which calls the corresponding remapping methods in the required order. The following checks are executed in order:
- **`KeyboardManagerState.AreRemappingsEnabled`:** This returns false while the KBM remap tables are getting updated. If it is in this state, `HandleKeyboardHookEvent` returns `0`, i.e. the key event is not suppressed and is forwarded normally. - **`KeyboardManagerState.AreRemappingsEnabled`:** This returns false while the KBM remap tables are getting updated. If it is in this state, `HandleKeyboardHookEvent` returns `0`, i.e. the key event is not suppressed and is forwarded normally.
- **Check for `KEYBOARDMANAGER_SUPPRESS_FLAG`:** If the key event has the suppress flag, the method returns 1 to suppress the key event. - **Check for `KEYBOARDMANAGER_SUPPRESS_FLAG`:** If the key event has the suppress flag, the method returns 1 to suppress the key event.
- **[`KeyboardManagerState.DetectSingleRemapKeyUIBackend`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/dllmain.cpp#L399-L408):** This method is used for handling hook operations for the single key Type UI in the Remap keys window. If the Remap keys window is open, then `HandleKeyboardHookEvent` returns `0` and the key event is forwarded normally. If the left column Type button is clicked on the Remap keys window and and the window is in focus, then the key event is suppressed and the UI is updated with the latest key from the recent key events. This method is described in more detail [here](keyboardmanagercommon.md#DetectSingleRemapKeyUIBackend-and-DetectShortcutUIBackend). - **[`KeyboardManagerState.DetectSingleRemapKeyUIBackend`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/dllmain.cpp#L399-L408):** This method is used for handling hook operations for the single key Type UI in the Remap keys window. If the Remap keys window is open, then `HandleKeyboardHookEvent` returns `0` and the key event is forwarded normally. If the left column Type button is clicked on the Remap keys window and the window is in focus, then the key event is suppressed and the UI is updated with the latest key from the recent key events. This method is described in more detail [here](keyboardmanagercommon.md#DetectSingleRemapKeyUIBackend-and-DetectShortcutUIBackend).
- **[`KeyboardManagerState.DetectShortcutUIBackend(data, true)`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/dllmain.cpp#L410-L419):** This method is used for handling hook operations for the shortcut Type UI in the Remap keys window (when `isRemapKey` arg is `true`). If the Remap keys window is open, then `HandleKeyboardHookEvent` returns `0` and the key event is forwarded normally. If the right column Type button is clicked on the Remap keys window and and the window is in focus, then the key event is suppressed and the UI is updated with the shortcut from the recent key events. This method is described in more detail [here](keyboardmanagercommon.md#DetectSingleRemapKeyUIBackend-and-DetectShortcutUIBackend). - **[`KeyboardManagerState.DetectShortcutUIBackend(data, true)`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/dllmain.cpp#L410-L419):** This method is used for handling hook operations for the shortcut Type UI in the Remap keys window (when `isRemapKey` arg is `true`). If the Remap keys window is open, then `HandleKeyboardHookEvent` returns `0` and the key event is forwarded normally. If the right column Type button is clicked on the Remap keys window and the window is in focus, then the key event is suppressed and the UI is updated with the shortcut from the recent key events. This method is described in more detail [here](keyboardmanagercommon.md#DetectSingleRemapKeyUIBackend-and-DetectShortcutUIBackend).
- **`HandleSingleKeyRemapEvent`:** This method handles the single key remap logic. If a remapping takes place, the key event is suppressed. This method is described in more detail [here](keyboardeventhandlers.md#HandleSingleKeyRemapEvent). - **`HandleSingleKeyRemapEvent`:** This method handles the single key remap logic. If a remapping takes place, the key event is suppressed. This method is described in more detail [here](keyboardeventhandlers.md#HandleSingleKeyRemapEvent).
- **[`KeyboardManagerState.DetectShortcutUIBackend(data, false)`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/dllmain.cpp#L430-L439):** This method is used for handling hook operations for the shortcut Type UI in the Remap shortcuts window (when `isRemapKey` arg is `false`). If the Remap shortcuts window is open, then `HandleKeyboardHookEvent` returns `0` and the key event is forwarded normally. If the Type button is clicked on the Remap shortcuts window and and the window is in focus, then the key event is suppressed and the UI is updated with the shortcut from the recent key events. **Since this is executed after the single key remap method, all single key remappings are applied when the user is on the Remap shortcuts window.** - **[`KeyboardManagerState.DetectShortcutUIBackend(data, false)`](https://github.com/microsoft/PowerToys/blob/b80578b1b9a4b24c9945bddac33c771204280107/src/modules/keyboardmanager/dll/dllmain.cpp#L430-L439):** This method is used for handling hook operations for the shortcut Type UI in the Remap shortcuts window (when `isRemapKey` arg is `false`). If the Remap shortcuts window is open, then `HandleKeyboardHookEvent` returns `0` and the key event is forwarded normally. If the Type button is clicked on the Remap shortcuts window and the window is in focus, then the key event is suppressed and the UI is updated with the shortcut from the recent key events. **Since this is executed after the single key remap method, all single key remappings are applied when the user is on the Remap shortcuts window.**
- **`HandleAppSpecificShortcutRemapEvent`:** This method handles the app-specific shortcut remap logic. If a remapping takes place, the key event is suppressed. This method is described in more detail [here](keyboardeventhandlers.md#HandleAppSpecificShortcutRemapEvent). **Since this is executed after the single key remap method, single key remappings have precedence over shortcut remaps and are correspondingly reflected in shortcut remaps.** - **`HandleAppSpecificShortcutRemapEvent`:** This method handles the app-specific shortcut remap logic. If a remapping takes place, the key event is suppressed. This method is described in more detail [here](keyboardeventhandlers.md#HandleAppSpecificShortcutRemapEvent). **Since this is executed after the single key remap method, single key remappings have precedence over shortcut remaps and are correspondingly reflected in shortcut remaps.**
- **`HandleOSLevelShortcutRemapEvent`:** This method handles the global shortcut remap logic. If a remapping takes place, the key event is suppressed. This method is described in more detail [here](keyboardeventhandlers.md#HandleOSLevelShortcutRemapEvent). The app-specific remap method is executed before this because if a shortcut is remapped to different keys/shortcuts for a particular app and globally, the app-specific variant should be preferred if that app is in focus. **Since this is executed after the single key remap method, single key remappings have precedence over shortcut remaps and are correspondingly reflected in shortcut remaps.** - **`HandleOSLevelShortcutRemapEvent`:** This method handles the global shortcut remap logic. If a remapping takes place, the key event is suppressed. This method is described in more detail [here](keyboardeventhandlers.md#HandleOSLevelShortcutRemapEvent). The app-specific remap method is executed before this because if a shortcut is remapped to different keys/shortcuts for a particular app and globally, the app-specific variant should be preferred if that app is in focus. **Since this is executed after the single key remap method, single key remappings have precedence over shortcut remaps and are correspondingly reflected in shortcut remaps.**

View File

@@ -105,7 +105,7 @@ Once this second level of validation is done, we proceed with [updating the buff
Unlike the Single Key handler, there is a different set of errors that can occur here which are related to making a selection that is considered as a valid shortcut. The `isHybridControl` argument is used to distinguish between the differing behaviors for the two types of columns (shortcut only or shortcut/key column). The errors that can occur for this handler are: Unlike the Single Key handler, there is a different set of errors that can occur here which are related to making a selection that is considered as a valid shortcut. The `isHybridControl` argument is used to distinguish between the differing behaviors for the two types of columns (shortcut only or shortcut/key column). The errors that can occur for this handler are:
- Shortcut must start with modifier (selecting A on the first drop for the left column is invalid) - Shortcut must start with modifier (selecting A on the first drop for the left column is invalid)
- Shortcut can't have a repeated modifier (Ctrl+Ctrl(left)+A is not a shortcut) - Shortcut can't have a repeated modifier (Ctrl+Ctrl(left)+A is not a shortcut)
- Shortcut can only have upto 2 modifiers (Ctrl+Shift+Alt is not supported as we have enforced a 3 key constraint (**not a backend limitation, there is [an issue](https://github.com/microsoft/PowerToys/issues/3936) requesting to remove this**)) - Shortcut can only have up to 2 modifiers (Ctrl+Shift+Alt is not supported as we have enforced a 3 key constraint (**not a backend limitation, there is [an issue](https://github.com/microsoft/PowerToys/issues/3936) requesting to remove this**))
- Shortcut must contain an action key (Ctrl+A and change A to None, only for left column) - Shortcut must contain an action key (Ctrl+A and change A to None, only for left column)
- Shortcut must have at least two keys (Ctrl+A and change Ctrl to None, only for left column) - Shortcut must have at least two keys (Ctrl+A and change Ctrl to None, only for left column)
- Disable can't be a modifier or action key (Ctrl+Disable is invalid) - Disable can't be a modifier or action key (Ctrl+Disable is invalid)

View File

@@ -61,7 +61,7 @@ A full entry for the `WindowsSettings.json` looks like:
* The integer value for `IntroducedInBuild` and `DeprecatedInBuild` must be in range of `0` to `4294967295` * The integer value for `IntroducedInBuild` and `DeprecatedInBuild` must be in range of `0` to `4294967295`
* The strings for `Name`, `AltNames`, `Areas`, `Type` and `Note` must not contain whitespace(s) or special characters (#, €, $, etc.) * The strings for `Name`, `AltNames`, `Areas`, `Type` and `Note` must not contain whitespace(s) or special characters (#, €, $, etc.)
* The strings for `Name`, `AltNames`, `Areas`, `Type` and `Note` are used as ids for the resource file under `Properties\Resources.resx` * The strings for `Name`, `AltNames`, `Areas`, `Type` and `Note` are used as ids for the resource file under `Properties\Resources.resx`
* When you add new strings make sure you have add add all translations for it. * When you add new strings make sure you have added all translations for it.
## Scores ## Scores

View File

@@ -48,7 +48,7 @@ call "..\..\publish.cmd" arm64
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<!-- suppress warning 1108 regarding -sh being deprecated --> <!-- suppress warning 1108 regarding -sh being deprecated -->
<!-- -sh suppresses file file information which was causing wix build to hang in CI --> <!-- -sh suppresses file information which was causing wix build to hang in CI -->
<LinkerAdditionalOptions>-v -sh -sw1108</LinkerAdditionalOptions> <LinkerAdditionalOptions>-v -sh -sw1108</LinkerAdditionalOptions>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@@ -54,4 +54,4 @@ using System.Diagnostics.CodeAnalysis;
[assembly: SuppressMessage("Microsoft.Performance", "CA1812: Avoid uninstantiated internal classes", Scope = "module", Justification = "CA1812 will be thrown for every file in the test project. This is mentioned here: dotnet/roslyn-analyzers#1830")] [assembly: SuppressMessage("Microsoft.Performance", "CA1812: Avoid uninstantiated internal classes", Scope = "module", Justification = "CA1812 will be thrown for every file in the test project. This is mentioned here: dotnet/roslyn-analyzers#1830")]
// Code quality // Code quality
[assembly: SuppressMessage("CodeQuality", "IDE0076:Invalid global 'SuppressMessageAttribute'", Justification = "Affect predefined supressions.")] [assembly: SuppressMessage("CodeQuality", "IDE0076:Invalid global 'SuppressMessageAttribute'", Justification = "Affect predefined suppressions.")]

View File

@@ -187,7 +187,7 @@ namespace ColorPicker
public int Flags; public int Flags;
/// <summary> /// <summary>
/// The time stamp stamp for this message, equivalent to what GetMessageTime would return for this message. /// The time stamp for this message, equivalent to what GetMessageTime would return for this message.
/// </summary> /// </summary>
public int TimeStamp; public int TimeStamp;

View File

@@ -138,7 +138,7 @@ void ShortcutControl::AddNewShortcutControlRow(StackPanel& parent, std::vector<s
return; return;
} }
// rowIndex could be out of bounds if the the row got deleted after LostFocus handler was invoked. In this case it should return // rowIndex could be out of bounds if the row got deleted after LostFocus handler was invoked. In this case it should return
if (rowIndex >= keyboardRemapControlObjects.size()) if (rowIndex >= keyboardRemapControlObjects.size())
{ {
return; return;
@@ -207,7 +207,7 @@ void ShortcutControl::AddNewShortcutControlRow(StackPanel& parent, std::vector<s
UIElementCollection children = parent.Children(); UIElementCollection children = parent.Children();
bool indexFound = children.IndexOf(row, rowIndex); bool indexFound = children.IndexOf(row, rowIndex);
// IndexOf could fail if the the row got deleted and the button handler was invoked twice. In this case it should return // IndexOf could fail if the row got deleted and the button handler was invoked twice. In this case it should return
if (!indexFound) if (!indexFound)
{ {
return; return;

View File

@@ -147,7 +147,7 @@ void SingleKeyRemapControl::AddNewControlKeyRemapRow(StackPanel& parent, std::ve
UIElementCollection children = parent.Children(); UIElementCollection children = parent.Children();
bool indexFound = children.IndexOf(row, rowIndex); bool indexFound = children.IndexOf(row, rowIndex);
// IndexOf could fail if the the row got deleted and the button handler was invoked twice. In this case it should return // IndexOf could fail if the row got deleted and the button handler was invoked twice. In this case it should return
if (!indexFound) if (!indexFound)
{ {
return; return;

View File

@@ -94,7 +94,7 @@ namespace RemappingLogicTests
Assert::AreEqual(mockedInputHandler.GetVirtualKeyState(0x56), false); Assert::AreEqual(mockedInputHandler.GetVirtualKeyState(0x56), false);
} }
// Test if the the keyboard manager state's activated app is correctly set after an app specific remap takes place // Test if the keyboard manager state's activated app is correctly set after an app specific remap takes place
TEST_METHOD (AppSpecificShortcut_ShouldSetCorrectActivatedApp_WhenRemapOccurs) TEST_METHOD (AppSpecificShortcut_ShouldSetCorrectActivatedApp_WhenRemapOccurs)
{ {
// Remap Ctrl+A to Alt+V // Remap Ctrl+A to Alt+V
@@ -236,7 +236,7 @@ namespace RemappingLogicTests
Assert::AreEqual(mockedInputHandler.GetVirtualKeyState(0x56), false); Assert::AreEqual(mockedInputHandler.GetVirtualKeyState(0x56), false);
} }
// Test if the the keyboard manager state's activated app is correctly set after an app specific shortcut to key remap takes place // Test if the keyboard manager state's activated app is correctly set after an app specific shortcut to key remap takes place
TEST_METHOD (AppSpecificShortcutToSingleKey_ShouldSetCorrectActivatedApp_WhenRemapOccurs) TEST_METHOD (AppSpecificShortcutToSingleKey_ShouldSetCorrectActivatedApp_WhenRemapOccurs)
{ {
// Remap Ctrl+A to V // Remap Ctrl+A to V

View File

@@ -287,7 +287,7 @@ namespace Microsoft.Plugin.Program.UnitTests.Programs
} }
[TestMethod] [TestMethod]
public void DedupFunctionWhenCalledMustNotRemovelnkWhichdoesNotHaveExe() public void DedupFunctionWhenCalledMustNotRemovelnkWhichDoesNotHaveExe()
{ {
// Arrange // Arrange
List<Win32Program> prgms = new List<Win32Program> List<Win32Program> prgms = new List<Win32Program>

View File

@@ -27,7 +27,7 @@ namespace Microsoft.Plugin.Program.Storage
// Using OrdinalIgnoreCase since this is used internally with paths // Using OrdinalIgnoreCase since this is used internally with paths
if (string.IsNullOrEmpty(previousAppPath) || previousAppPath.Equals(currentAppPath, StringComparison.OrdinalIgnoreCase)) if (string.IsNullOrEmpty(previousAppPath) || previousAppPath.Equals(currentAppPath, StringComparison.OrdinalIgnoreCase))
{ {
// To dequeue a path only if it is the first one in the queue or if the path was the same as thre previous one (to avoid trying to create apps on duplicate events) // To dequeue a path only if it is the first one in the queue or if the path was the same as the previous one (to avoid trying to create apps on duplicate events)
previousAppPath = currentAppPath; previousAppPath = currentAppPath;
eventHandlingQueue.TryDequeue(out _); eventHandlingQueue.TryDequeue(out _);
} }

View File

@@ -124,7 +124,7 @@ namespace Microsoft.Plugin.WindowWalker.Components
/// <param name="name">New process name.</param> /// <param name="name">New process name.</param>
internal void UpdateProcessInfo(uint pid, uint tid, string name) internal void UpdateProcessInfo(uint pid, uint tid, string name)
{ {
// TODO: Add verification as to wether the process id and thread id is valid // TODO: Add verification as to whether the process id and thread id is valid
ProcessID = pid; ProcessID = pid;
ThreadID = tid; ThreadID = tid;
Name = name; Name = name;

View File

@@ -4741,7 +4741,7 @@ namespace Microsoft.PowerToys.Run.Plugin.TimeZone.Properties {
} }
/// <summary> /// <summary>
/// Looks up a localized string similar to Gets the the current time of a time zone. /// Looks up a localized string similar to Gets the current time of a time zone.
/// </summary> /// </summary>
internal static string PluginDescription { internal static string PluginDescription {
get { get {

View File

@@ -69,14 +69,14 @@ namespace Microsoft.PowerToys.Run.Plugin.WindowsSettings
public bool ShowAsFirstResult { get; set; } public bool ShowAsFirstResult { get; set; }
/// <summary> /// <summary>
/// Gets or sets the the value with the generated area path as string. /// Gets or sets the value with the generated area path as string.
/// This Property IS NOT PART OF THE DATA IN "WindowsSettings.json". /// This Property IS NOT PART OF THE DATA IN "WindowsSettings.json".
/// This property will be filled on runtime by "WindowsSettingsPathHelper". /// This property will be filled on runtime by "WindowsSettingsPathHelper".
/// </summary> /// </summary>
public string? JoinedAreaPath { get; set; } public string? JoinedAreaPath { get; set; }
/// <summary> /// <summary>
/// Gets or sets the the value with the generated full settings path (App and areas) as string. /// Gets or sets the value with the generated full settings path (App and areas) as string.
/// This Property IS NOT PART OF THE DATA IN "WindowsSettings.json". /// This Property IS NOT PART OF THE DATA IN "WindowsSettings.json".
/// This property will be filled on runtime by "WindowsSettingsPathHelper". /// This property will be filled on runtime by "WindowsSettingsPathHelper".
/// </summary> /// </summary>

View File

@@ -221,9 +221,9 @@ namespace PowerLauncher.Helper
} }
/// <summary> /// <summary>
/// Checks wether this process is running under the system user/account. /// Checks whether this process is running under the system user/account.
/// </summary> /// </summary>
/// <returns>A boolean value that indicates wether this process is running under system account (true) or not (false).</returns> /// <returns>A boolean value that indicates whether this process is running under system account (true) or not (false).</returns>
private static bool IsRunningAsSystem() private static bool IsRunningAsSystem()
{ {
using (var identity = WindowsIdentity.GetCurrent()) using (var identity = WindowsIdentity.GetCurrent())

View File

@@ -26,9 +26,9 @@ namespace PowerLauncher.Properties {
[global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("https://aka.ms/powerToys")] [global::System.Configuration.DefaultSettingValueAttribute("https://aka.ms/powerToys")]
public string GithubRepo { public string GitHubRepo {
get { get {
return ((string)(this["GithubRepo"])); return ((string)(this["GitHubRepo"]));
} }
} }
} }

View File

@@ -2,7 +2,7 @@
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Wox.Properties" GeneratedClassName="Settings"> <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="Wox.Properties" GeneratedClassName="Settings">
<Profiles /> <Profiles />
<Settings> <Settings>
<Setting Name="GithubRepo" Type="System.String" Scope="Application"> <Setting Name="GitHubRepo" Type="System.String" Scope="Application">
<Value Profile="(Default)">https://github.com/Wox-launcher/Wox</Value> <Value Profile="(Default)">https://github.com/Wox-launcher/Wox</Value>
</Setting> </Setting>
</Settings> </Settings>

View File

@@ -389,10 +389,10 @@ namespace Wox.Plugin.Common.VirtualDesktop.Helper
/// </summary> /// </summary>
/// <param name="hWindow">Handle of the window.</param> /// <param name="hWindow">Handle of the window.</param>
/// <param name="desktop">Optional the desktop id if known</param> /// <param name="desktop">Optional the desktop id if known</param>
/// <returns>A value indicating if the window is cloaked by Virtual Desktop Manager, because it is moved to an other desktop.</returns> /// <returns>A value indicating if the window is cloaked by Virtual Desktop Manager, because it is moved to another desktop.</returns>
public bool IsWindowCloakedByVirtualDesktopManager(IntPtr hWindow, Guid? desktop = null) public bool IsWindowCloakedByVirtualDesktopManager(IntPtr hWindow, Guid? desktop = null)
{ {
// If a window is hidden because it is moved to an other desktop, then DWM returns type "CloakedShell". If DWM returns an other type the window is not cloaked by shell or VirtualDesktopManager. // If a window is hidden because it is moved to another desktop, then DWM returns type "CloakedShell". If DWM returns another type the window is not cloaked by shell or VirtualDesktopManager.
_ = NativeMethods.DwmGetWindowAttribute(hWindow, (int)DwmWindowAttributes.Cloaked, out int dwmCloakedState, sizeof(uint)); _ = NativeMethods.DwmGetWindowAttribute(hWindow, (int)DwmWindowAttributes.Cloaked, out int dwmCloakedState, sizeof(uint));
return GetWindowDesktopAssignmentType(hWindow, desktop) == VirtualDesktopAssignmentType.OtherDesktop && dwmCloakedState == (int)DwmWindowCloakStates.CloakedShell; return GetWindowDesktopAssignmentType(hWindow, desktop) == VirtualDesktopAssignmentType.OtherDesktop && dwmCloakedState == (int)DwmWindowCloakStates.CloakedShell;
} }
@@ -414,7 +414,7 @@ namespace Wox.Plugin.Common.VirtualDesktop.Helper
int hr = _virtualDesktopManager.MoveWindowToDesktop(hWindow, desktopId); int hr = _virtualDesktopManager.MoveWindowToDesktop(hWindow, desktopId);
if (hr != (int)HRESULT.S_OK) if (hr != (int)HRESULT.S_OK)
{ {
Log.Exception($"VirtualDesktopHelper.MoveWindowToDesktop() failed: An exception was thrown when moving the window ({hWindow}) to an other desktop ({desktopId}).", Marshal.GetExceptionForHR(hr), typeof(VirtualDesktopHelper)); Log.Exception($"VirtualDesktopHelper.MoveWindowToDesktop() failed: An exception was thrown when moving the window ({hWindow}) to another desktop ({desktopId}).", Marshal.GetExceptionForHR(hr), typeof(VirtualDesktopHelper));
return false; return false;
} }

View File

@@ -655,13 +655,13 @@ namespace winrt::PowerRenameUI::implementation
} }
}); });
// CheckBox MatchAllOccurences // CheckBox MatchAllOccurrences
checkBox_matchAll().Checked([&](auto const&, auto const&) { checkBox_matchAll().Checked([&](auto const&, auto const&) {
ValidateFlags(MatchAllOccurences); ValidateFlags(MatchAllOccurrences);
UpdateFlag(MatchAllOccurences, UpdateFlagCommand::Set); UpdateFlag(MatchAllOccurrences, UpdateFlagCommand::Set);
}); });
checkBox_matchAll().Unchecked([&](auto const&, auto const&) { checkBox_matchAll().Unchecked([&](auto const&, auto const&) {
UpdateFlag(MatchAllOccurences, UpdateFlagCommand::Reset); UpdateFlag(MatchAllOccurrences, UpdateFlagCommand::Reset);
}); });
// ToggleButton IncludeFiles // ToggleButton IncludeFiles
@@ -884,7 +884,7 @@ namespace winrt::PowerRenameUI::implementation
{ {
checkBox_case().IsChecked(true); checkBox_case().IsChecked(true);
} }
if (flags & MatchAllOccurences) if (flags & MatchAllOccurrences)
{ {
checkBox_matchAll().IsChecked(true); checkBox_matchAll().IsChecked(true);
} }

View File

@@ -6,7 +6,7 @@
enum PowerRenameFlags enum PowerRenameFlags
{ {
CaseSensitive = 0x1, CaseSensitive = 0x1,
MatchAllOccurences = 0x2, MatchAllOccurrences = 0x2,
UseRegularExpressions = 0x4, UseRegularExpressions = 0x4,
EnumerateItems = 0x8, EnumerateItems = 0x8,
ExcludeFiles = 0x10, ExcludeFiles = 0x10,

View File

@@ -270,7 +270,7 @@ HRESULT CPowerRenameRegEx::Replace(_In_ PCWSTR source, _Outptr_ PWSTR* result)
if (_useBoostLib) if (_useBoostLib)
{ {
boost::wregex pattern(m_searchTerm, (!(m_flags & CaseSensitive)) ? boost::regex::icase | boost::regex::ECMAScript : boost::regex::ECMAScript); boost::wregex pattern(m_searchTerm, (!(m_flags & CaseSensitive)) ? boost::regex::icase | boost::regex::ECMAScript : boost::regex::ECMAScript);
if (m_flags & MatchAllOccurences) if (m_flags & MatchAllOccurrences)
{ {
res = boost::regex_replace(wstring(source), pattern, replaceTerm); res = boost::regex_replace(wstring(source), pattern, replaceTerm);
} }
@@ -282,7 +282,7 @@ HRESULT CPowerRenameRegEx::Replace(_In_ PCWSTR source, _Outptr_ PWSTR* result)
else else
{ {
std::wregex pattern(m_searchTerm, (!(m_flags & CaseSensitive)) ? regex_constants::icase | regex_constants::ECMAScript : regex_constants::ECMAScript); std::wregex pattern(m_searchTerm, (!(m_flags & CaseSensitive)) ? regex_constants::icase | regex_constants::ECMAScript : regex_constants::ECMAScript);
if (m_flags & MatchAllOccurences) if (m_flags & MatchAllOccurrences)
{ {
res = regex_replace(wstring(source), pattern, replaceTerm); res = regex_replace(wstring(source), pattern, replaceTerm);
} }
@@ -305,7 +305,7 @@ HRESULT CPowerRenameRegEx::Replace(_In_ PCWSTR source, _Outptr_ PWSTR* result)
pos += replaceTerm.length(); pos += replaceTerm.length();
} }
if (!(m_flags & MatchAllOccurences)) if (!(m_flags & MatchAllOccurrences))
{ {
break; break;
} }

View File

@@ -149,7 +149,7 @@ TEST_METHOD(VerifyReplaceAll)
{ {
CComPtr<IPowerRenameRegEx> renameRegEx; CComPtr<IPowerRenameRegEx> renameRegEx;
Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK); Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK);
DWORD flags = MatchAllOccurences; DWORD flags = MatchAllOccurrences;
Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK); Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK);
SearchReplaceExpected sreTable[] = { SearchReplaceExpected sreTable[] = {
@@ -173,7 +173,7 @@ TEST_METHOD(VerifyReplaceAllCaseInsensitive)
{ {
CComPtr<IPowerRenameRegEx> renameRegEx; CComPtr<IPowerRenameRegEx> renameRegEx;
Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK); Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK);
DWORD flags = MatchAllOccurences | CaseSensitive; DWORD flags = MatchAllOccurrences | CaseSensitive;
Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK); Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK);
SearchReplaceExpected sreTable[] = { SearchReplaceExpected sreTable[] = {
@@ -222,7 +222,7 @@ TEST_METHOD(VerifyReplaceAllUseRegEx)
{ {
CComPtr<IPowerRenameRegEx> renameRegEx; CComPtr<IPowerRenameRegEx> renameRegEx;
Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK); Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK);
DWORD flags = MatchAllOccurences | UseRegularExpressions; DWORD flags = MatchAllOccurrences | UseRegularExpressions;
Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK); Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK);
SearchReplaceExpected sreTable[] = { SearchReplaceExpected sreTable[] = {
@@ -246,7 +246,7 @@ TEST_METHOD(VerifyReplaceAllUseRegExCaseSensitive)
{ {
CComPtr<IPowerRenameRegEx> renameRegEx; CComPtr<IPowerRenameRegEx> renameRegEx;
Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK); Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK);
DWORD flags = MatchAllOccurences | UseRegularExpressions | CaseSensitive; DWORD flags = MatchAllOccurrences | UseRegularExpressions | CaseSensitive;
Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK); Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK);
SearchReplaceExpected sreTable[] = { SearchReplaceExpected sreTable[] = {
@@ -270,7 +270,7 @@ TEST_METHOD(VerifyMatchAllWildcardUseRegEx)
{ {
CComPtr<IPowerRenameRegEx> renameRegEx; CComPtr<IPowerRenameRegEx> renameRegEx;
Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK); Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK);
DWORD flags = MatchAllOccurences | UseRegularExpressions; DWORD flags = MatchAllOccurrences | UseRegularExpressions;
Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK); Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK);
// This differs from the Standard Library: .* has two matches (all and nothing). // This differs from the Standard Library: .* has two matches (all and nothing).
@@ -325,7 +325,7 @@ TEST_METHOD(VerifyReplaceFirstWildCardUseRegexMatchAllOccurrences)
{ L".*", L"Foo", L"AAAAAA", L"FooFoo" }, { L".*", L"Foo", L"AAAAAA", L"FooFoo" },
{ L".+", L"Foo", L"AAAAAA", L"Foo" }, { L".+", L"Foo", L"AAAAAA", L"Foo" },
}; };
VerifyReplaceFirstWildcard(sreTable, ARRAYSIZE(sreTable), UseRegularExpressions | MatchAllOccurences); VerifyReplaceFirstWildcard(sreTable, ARRAYSIZE(sreTable), UseRegularExpressions | MatchAllOccurrences);
} }
TEST_METHOD(VerifyReplaceFirstWildCardMatchAllOccurrences) TEST_METHOD(VerifyReplaceFirstWildCardMatchAllOccurrences)
@@ -336,7 +336,7 @@ TEST_METHOD(VerifyReplaceFirstWildCardMatchAllOccurrences)
{ L".*", L"Foo", L".*", L"Foo" }, { L".*", L"Foo", L".*", L"Foo" },
{ L".*", L"Foo", L".*Bar.*", L"FooBarFoo" }, { L".*", L"Foo", L".*Bar.*", L"FooBarFoo" },
}; };
VerifyReplaceFirstWildcard(sreTable, ARRAYSIZE(sreTable), MatchAllOccurences); VerifyReplaceFirstWildcard(sreTable, ARRAYSIZE(sreTable), MatchAllOccurrences);
} }
TEST_METHOD(VerifyReplaceFirstWildNoFlags) TEST_METHOD(VerifyReplaceFirstWildNoFlags)
@@ -355,7 +355,7 @@ TEST_METHOD(VerifyHandleCapturingGroups)
// To use a capturing group followed by numbers as replacement curly braces are needed. // To use a capturing group followed by numbers as replacement curly braces are needed.
CComPtr<IPowerRenameRegEx> renameRegEx; CComPtr<IPowerRenameRegEx> renameRegEx;
Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK); Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK);
DWORD flags = MatchAllOccurences | UseRegularExpressions | CaseSensitive; DWORD flags = MatchAllOccurrences | UseRegularExpressions | CaseSensitive;
Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK); Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK);
SearchReplaceExpected sreTable[] = { SearchReplaceExpected sreTable[] = {
@@ -423,7 +423,7 @@ TEST_METHOD(VerifyEventsFire)
Assert::IsTrue(mockEvents->QueryInterface(IID_PPV_ARGS(&regExEvents)) == S_OK); Assert::IsTrue(mockEvents->QueryInterface(IID_PPV_ARGS(&regExEvents)) == S_OK);
DWORD cookie = 0; DWORD cookie = 0;
Assert::IsTrue(renameRegEx->Advise(regExEvents, &cookie) == S_OK); Assert::IsTrue(renameRegEx->Advise(regExEvents, &cookie) == S_OK);
DWORD flags = MatchAllOccurences | UseRegularExpressions | CaseSensitive; DWORD flags = MatchAllOccurrences | UseRegularExpressions | CaseSensitive;
Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK); Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK);
Assert::IsTrue(renameRegEx->PutSearchTerm(L"FOO") == S_OK); Assert::IsTrue(renameRegEx->PutSearchTerm(L"FOO") == S_OK);
Assert::IsTrue(renameRegEx->PutReplaceTerm(L"BAR") == S_OK); Assert::IsTrue(renameRegEx->PutReplaceTerm(L"BAR") == S_OK);

View File

@@ -143,7 +143,7 @@ TEST_METHOD(VerifyReplaceAll)
{ {
CComPtr<IPowerRenameRegEx> renameRegEx; CComPtr<IPowerRenameRegEx> renameRegEx;
Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK); Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK);
DWORD flags = MatchAllOccurences; DWORD flags = MatchAllOccurrences;
Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK); Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK);
SearchReplaceExpected sreTable[] = { SearchReplaceExpected sreTable[] = {
@@ -167,7 +167,7 @@ TEST_METHOD(VerifyReplaceAllCaseInsensitive)
{ {
CComPtr<IPowerRenameRegEx> renameRegEx; CComPtr<IPowerRenameRegEx> renameRegEx;
Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK); Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK);
DWORD flags = MatchAllOccurences | CaseSensitive; DWORD flags = MatchAllOccurrences | CaseSensitive;
Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK); Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK);
SearchReplaceExpected sreTable[] = { SearchReplaceExpected sreTable[] = {
@@ -216,7 +216,7 @@ TEST_METHOD(VerifyReplaceAllUseRegEx)
{ {
CComPtr<IPowerRenameRegEx> renameRegEx; CComPtr<IPowerRenameRegEx> renameRegEx;
Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK); Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK);
DWORD flags = MatchAllOccurences | UseRegularExpressions; DWORD flags = MatchAllOccurrences | UseRegularExpressions;
Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK); Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK);
SearchReplaceExpected sreTable[] = { SearchReplaceExpected sreTable[] = {
@@ -240,7 +240,7 @@ TEST_METHOD(VerifyReplaceAllUseRegExCaseSensitive)
{ {
CComPtr<IPowerRenameRegEx> renameRegEx; CComPtr<IPowerRenameRegEx> renameRegEx;
Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK); Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK);
DWORD flags = MatchAllOccurences | UseRegularExpressions | CaseSensitive; DWORD flags = MatchAllOccurrences | UseRegularExpressions | CaseSensitive;
Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK); Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK);
SearchReplaceExpected sreTable[] = { SearchReplaceExpected sreTable[] = {
@@ -264,7 +264,7 @@ TEST_METHOD(VerifyMatchAllWildcardUseRegEx)
{ {
CComPtr<IPowerRenameRegEx> renameRegEx; CComPtr<IPowerRenameRegEx> renameRegEx;
Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK); Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK);
DWORD flags = MatchAllOccurences | UseRegularExpressions; DWORD flags = MatchAllOccurrences | UseRegularExpressions;
Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK); Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK);
SearchReplaceExpected sreTable[] = { SearchReplaceExpected sreTable[] = {
@@ -314,7 +314,7 @@ TEST_METHOD(VerifyReplaceFirstWildCardUseRegexMatchAllOccurrences)
//search, replace, test, result //search, replace, test, result
{ L".*", L"Foo", L"AAAAAA", L"Foo" }, { L".*", L"Foo", L"AAAAAA", L"Foo" },
}; };
VerifyReplaceFirstWildcard(sreTable, ARRAYSIZE(sreTable), UseRegularExpressions | MatchAllOccurences); VerifyReplaceFirstWildcard(sreTable, ARRAYSIZE(sreTable), UseRegularExpressions | MatchAllOccurrences);
} }
TEST_METHOD(VerifyReplaceFirstWildCardMatchAllOccurrences) TEST_METHOD(VerifyReplaceFirstWildCardMatchAllOccurrences)
@@ -325,7 +325,7 @@ TEST_METHOD(VerifyReplaceFirstWildCardMatchAllOccurrences)
{ L".*", L"Foo", L".*", L"Foo" }, { L".*", L"Foo", L".*", L"Foo" },
{ L".*", L"Foo", L".*Bar.*", L"FooBarFoo" }, { L".*", L"Foo", L".*Bar.*", L"FooBarFoo" },
}; };
VerifyReplaceFirstWildcard(sreTable, ARRAYSIZE(sreTable), MatchAllOccurences); VerifyReplaceFirstWildcard(sreTable, ARRAYSIZE(sreTable), MatchAllOccurrences);
} }
TEST_METHOD(VerifyReplaceFirstWildNoFlags) TEST_METHOD(VerifyReplaceFirstWildNoFlags)
@@ -342,7 +342,7 @@ TEST_METHOD(VerifyHandleCapturingGroups)
{ {
CComPtr<IPowerRenameRegEx> renameRegEx; CComPtr<IPowerRenameRegEx> renameRegEx;
Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK); Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK);
DWORD flags = MatchAllOccurences | UseRegularExpressions | CaseSensitive; DWORD flags = MatchAllOccurrences | UseRegularExpressions | CaseSensitive;
Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK); Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK);
SearchReplaceExpected sreTable[] = { SearchReplaceExpected sreTable[] = {
@@ -373,7 +373,7 @@ TEST_METHOD (VerifyFileAttributesNoPadding)
{ {
CComPtr<IPowerRenameRegEx> renameRegEx; CComPtr<IPowerRenameRegEx> renameRegEx;
Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK); Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK);
DWORD flags = MatchAllOccurences | UseRegularExpressions ; DWORD flags = MatchAllOccurrences | UseRegularExpressions ;
SYSTEMTIME fileTime = SYSTEMTIME{ 2020, 7, 3, 22, 15, 6, 42, 453 }; SYSTEMTIME fileTime = SYSTEMTIME{ 2020, 7, 3, 22, 15, 6, 42, 453 };
Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK); Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK);
@@ -398,7 +398,7 @@ TEST_METHOD (VerifyFileAttributesPadding)
{ {
CComPtr<IPowerRenameRegEx> renameRegEx; CComPtr<IPowerRenameRegEx> renameRegEx;
Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK); Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK);
DWORD flags = MatchAllOccurences | UseRegularExpressions; DWORD flags = MatchAllOccurrences | UseRegularExpressions;
Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK); Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK);
SYSTEMTIME fileTime = SYSTEMTIME{ 2020, 7, 3, 22, 15, 6, 42, 453 }; SYSTEMTIME fileTime = SYSTEMTIME{ 2020, 7, 3, 22, 15, 6, 42, 453 };
SearchReplaceExpected sreTable[] = { SearchReplaceExpected sreTable[] = {
@@ -422,7 +422,7 @@ TEST_METHOD (VerifyFileAttributesMonthandDayNames)
{ {
CComPtr<IPowerRenameRegEx> renameRegEx; CComPtr<IPowerRenameRegEx> renameRegEx;
Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK); Assert::IsTrue(CPowerRenameRegEx::s_CreateInstance(&renameRegEx) == S_OK);
DWORD flags = MatchAllOccurences | UseRegularExpressions; DWORD flags = MatchAllOccurrences | UseRegularExpressions;
Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK); Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK);
std::locale::global(std::locale("")); std::locale::global(std::locale(""));
@@ -499,7 +499,7 @@ TEST_METHOD(VerifyEventsFire)
Assert::IsTrue(mockEvents->QueryInterface(IID_PPV_ARGS(&regExEvents)) == S_OK); Assert::IsTrue(mockEvents->QueryInterface(IID_PPV_ARGS(&regExEvents)) == S_OK);
DWORD cookie = 0; DWORD cookie = 0;
Assert::IsTrue(renameRegEx->Advise(regExEvents, &cookie) == S_OK); Assert::IsTrue(renameRegEx->Advise(regExEvents, &cookie) == S_OK);
DWORD flags = MatchAllOccurences | UseRegularExpressions | CaseSensitive; DWORD flags = MatchAllOccurrences | UseRegularExpressions | CaseSensitive;
Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK); Assert::IsTrue(renameRegEx->PutFlags(flags) == S_OK);
Assert::IsTrue(renameRegEx->PutSearchTerm(L"FOO") == S_OK); Assert::IsTrue(renameRegEx->PutSearchTerm(L"FOO") == S_OK);
Assert::IsTrue(renameRegEx->PutReplaceTerm(L"BAR") == S_OK); Assert::IsTrue(renameRegEx->PutReplaceTerm(L"BAR") == S_OK);

View File

@@ -123,7 +123,7 @@ namespace Common
// Call garbage collection at the time of unloading of Preview. // Call garbage collection at the time of unloading of Preview.
// Which is preventing prevhost.exe to exit at the time of closing File explorer. // Which is preventing prevhost.exe to exit at the time of closing File explorer.
// Preview Handlers run in a separate process from PowerToys. This will not affect the performance of other modules. // Preview Handlers run in a separate process from PowerToys. This will not affect the performance of other modules.
// Mitigate the following Github issue: https://github.com/microsoft/PowerToys/issues/1468 // Mitigate the following GitHub issue: https://github.com/microsoft/PowerToys/issues/1468
GC.Collect(); GC.Collect();
} }

View File

@@ -112,7 +112,7 @@ int runner(bool isProcessElevated, bool openSettings, std::string settingsWindow
#if _DEBUG && _WIN64 #if _DEBUG && _WIN64
//Global error handlers to diagnose errors. //Global error handlers to diagnose errors.
//We prefer this not not show any longer until there's a bug to diagnose. //We prefer this not to show any longer until there's a bug to diagnose.
//init_global_error_handlers(); //init_global_error_handlers();
#endif #endif
Trace::RegisterProvider(); Trace::RegisterProvider();

View File

@@ -9,7 +9,7 @@ namespace Microsoft.PowerToys.Settings.UI.Library.Enumerations
// Activation shortcut opens editor // Activation shortcut opens editor
OpenEditor, OpenEditor,
// Activation shortcut opens color picker and after picking a color color is copied into clipboard and opens editor // Activation shortcut opens color picker and after picking a color is copied into clipboard and opens editor
OpenColorPickerAndThenEditor, OpenColorPickerAndThenEditor,
// Activation shortcut opens color picker only and picking color copies color into clipboard // Activation shortcut opens color picker only and picking color copies color into clipboard

View File

@@ -54,8 +54,8 @@ using System.Diagnostics.CodeAnalysis;
// FxCop warning suppression for uninstantiated TestFixture classes // FxCop warning suppression for uninstantiated TestFixture classes
[assembly: SuppressMessage("Microsoft.Performance", "CA1812: Avoid uninstantiated internal classes", Scope = "module", Justification = "CA1812 will be thrown for every file in the test project. This is mentioned here: dotnet/roslyn-analyzers#1830")] [assembly: SuppressMessage("Microsoft.Performance", "CA1812: Avoid uninstantiated internal classes", Scope = "module", Justification = "CA1812 will be thrown for every file in the test project. This is mentioned here: dotnet/roslyn-analyzers#1830")]
// WindowsAppSDK files supressions // WindowsAppSDK files suppressions
[assembly: SuppressMessage("CodeQuality", "IDE0076:Invalid global 'SuppressMessageAttribute'", Justification = "Affect predefined supressions.")] [assembly: SuppressMessage("CodeQuality", "IDE0076:Invalid global 'SuppressMessageAttribute'", Justification = "Affect predefined suppressions.")]
[assembly: SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1649:File name should match first type name", Justification = "Not part of the project. WindowsAppSDK file.", Scope = "type", Target = "~T:Microsoft.Windows.ApplicationModel.DynamicDependency.BootstrapCS.AutoInitialize")] [assembly: SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1649:File name should match first type name", Justification = "Not part of the project. WindowsAppSDK file.", Scope = "type", Target = "~T:Microsoft.Windows.ApplicationModel.DynamicDependency.BootstrapCS.AutoInitialize")]
[assembly: SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:File may only contain a single type", Justification = "Not part of the project. WindowsAppSDK file.", Scope = "type", Target = "~T:Microsoft.WindowsAppSDK.Runtime.Version")] [assembly: SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:File may only contain a single type", Justification = "Not part of the project. WindowsAppSDK file.", Scope = "type", Target = "~T:Microsoft.WindowsAppSDK.Runtime.Version")]
[assembly: SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:File may only contain a single type", Justification = "Not part of the project. WindowsAppSDK file.", Scope = "type", Target = "~T:Microsoft.WindowsAppSDK.Runtime.Identity")] [assembly: SuppressMessage("StyleCop.CSharp.MaintainabilityRules", "SA1402:File may only contain a single type", Justification = "Not part of the project. WindowsAppSDK file.", Scope = "type", Target = "~T:Microsoft.WindowsAppSDK.Runtime.Identity")]