Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
05a3f7a8f4 | ||
|
|
12b8f5090c | ||
|
|
19d574edcf | ||
|
|
3840744819 | ||
|
|
94e8ba4304 | ||
|
|
edb1440be0 |
No files matched your search
+1
-1
@@ -1,5 +1,5 @@
|
||||
cmake_minimum_required(VERSION 3.24)
|
||||
project(KSwitcher VERSION 0.6.108 LANGUAGES CXX RC)
|
||||
project(KSwitcher VERSION 0.6.110 LANGUAGES CXX RC)
|
||||
if(NOT WIN32)
|
||||
message(FATAL_ERROR "KSwitcher uses native Windows APIs")
|
||||
endif()
|
||||
|
||||
+5
-6
@@ -127,7 +127,9 @@ Warning і початковий фокус на No.
|
||||
за тими ж правилами вставлення й лапок. Рядок `..` пропускається.
|
||||
- Локальні й LAN-каталоги скануються у фоновому потоці. Під час переходу
|
||||
активна панель показує «Loading folder…» і зберігає попередній список до
|
||||
завершення сканування. Якщо надійшов новіший запит, результат попереднього
|
||||
завершення сканування. Після переходу оновлюються шлях і список цієї панелі
|
||||
та командний рядок. Сусідня панель не перемальовується через цей перехід.
|
||||
Якщо надійшов новіший запит, результат попереднього
|
||||
сканування пропускається. Після підтвердження UAC очікування списку
|
||||
від підвищеного процесу теж відбувається у фоні.
|
||||
- Ctrl+R перечитує поточну папку активної панелі. Позиція курсора й позначки
|
||||
@@ -186,7 +188,8 @@ Warning і початковий фокус на No.
|
||||
- Глобальне скорочення повертає до відкритого вікна Files у поточній сесії Windows або запускає Files, якщо такого вікна немає. Пункт **Files** у треї відкриває нове вікно.
|
||||
|
||||
- Ctrl+Shift+0–9 відкриває діалог Title і Path із поточною папкою. OK додає запис без дублювання, Escape скасовує. Title необов’язковий, порожнє значення показує шлях. Записи LAN зберігають ID ПК, а редагування Path залишає запис на тому самому ПК.
|
||||
- Ctrl+0–9 одразу відкриває єдину папку. Для кількох папок відкривається компактний попап Far з одним заголовком Folder shortcuts у подвійній рамці та коротким рядом клавіш у нижній рамці. Ширина залежить від найдовшого запису й обмежується розміром вікна, а висота — кількістю видимих рядків. Нижня рамка показує Ins Del F4 Ctrl+Up Ctrl+Down. Insert додає поточну папку через Title і Path, Delete відв’язує, F4 редагує, Ctrl+Up і Ctrl+Down змінюють і зберігають порядок. Enter відкриває папку. Escape або клік у Files поза попапом закриває його й повертає фокус до панелі. Commands → Folder shortcuts дає вибрати зайняту цифру й відкрити той самий попап навіть для єдиного запису. Brief і Wide доступні в меню Left/Right та Options.
|
||||
- Ctrl+0–9 відкриває лише папки, призначені натиснутій цифрі. Єдина папка відкривається одразу. Для кількох папок відкривається компактний попап Far з одним заголовком Folder shortcuts у подвійній рамці та коротким рядом клавіш у нижній рамці. Ширина залежить від найдовшого запису й обмежується розміром вікна, а висота — кількістю видимих рядків. Нижня рамка показує Ins Del F4 Ctrl+Up Ctrl+Down. Insert додає поточну папку через Title і Path, Delete відв’язує, F4 редагує, Ctrl+Up і Ctrl+Down змінюють і зберігають порядок. Enter відкриває папку. Escape або клік у Files поза попапом закриває його й повертає фокус до панелі. Commands → Folder shortcuts дає вибрати зайняту цифру й відкрити той самий попап навіть для єдиного запису.
|
||||
- Ctrl+F1 вмикає Brief, Ctrl+F2 вмикає Wide для активної панелі. Ctrl+F3–F12 зарезервовані для інших режимів панелей. Brief і Wide також доступні в меню Left/Right та Options.
|
||||
|
||||
## Налаштування Files
|
||||
|
||||
@@ -314,10 +317,6 @@ Warning і початковий фокус на No.
|
||||
у відкритих локальних папках. Фокус залишається там, де був, а курсор
|
||||
лишається на поточному елементі, якщо той ще існує.
|
||||
|
||||
- Ctrl+8 відкриває список усіх ярликів папок. Кожен рядок показує групу
|
||||
й назву або шлях. Enter відкриває папку в активній панелі, F4 редагує
|
||||
ярлик, а Delete прибирає його зі списку.
|
||||
|
||||
- У Change drive повідомлення No paired computers з’являється після
|
||||
успішної відповіді з порожнім списком. Збої локального запиту до
|
||||
KSwitcher відображаються окремо.
|
||||
|
||||
@@ -873,7 +873,8 @@ after Space, not immediately after a punctuation key. Save Settings to apply cha
|
||||
only to words with a rank at or below that number (for example, 10000). All dictionary words still
|
||||
protect already valid input, and ambiguous alternatives remain unchanged regardless of this limit.
|
||||
**My dictionary** provides separate English, Ukrainian and Russian fields for correct words missing
|
||||
from the bundled dictionaries. Enter words separated by commas or new lines, then click OK and Save
|
||||
from the bundled dictionaries. A hyphen is allowed between letters, as in `test-mt` or `dev-mt`.
|
||||
Enter words separated by commas or new lines, then click OK and Save
|
||||
in Settings. Case and duplicates are normalized automatically; no file editing or ranks are needed.
|
||||
The v0.6.23 bundled Ukrainian dictionary includes `поточні`. The updater preserves existing dictionary files;
|
||||
if upgrading from an older dictionary, add this word in My dictionary → Ukrainian and click OK → Save.
|
||||
@@ -897,8 +898,10 @@ language in the configured dictionary order (the UI uses English, Ukrainian, Rus
|
||||
Different valid spellings remain ambiguous and are left unchanged.
|
||||
**Minimum word length** defaults to 3 and can be set from 1 to 32 letters. Surrounding punctuation
|
||||
does not count toward this minimum; the maximum word length is 32 letters.
|
||||
Known words, ambiguous alternatives, ALL CAPS, mixed-case identifiers, numbers, URLs and email
|
||||
addresses are left unchanged. Short trailing punctuation is retained when the editor selects it
|
||||
Known words, ambiguous alternatives, mixed-case identifiers, numbers, URLs and email addresses
|
||||
are left unchanged. Fully uppercase words can be corrected when the target is in **My dictionary**.
|
||||
For example, add `qa` under English and set the minimum word length to 2 or lower to correct
|
||||
`ЙФ` to `QA` after Space. Short trailing punctuation is retained when the editor selects it
|
||||
together with the word. Actual selected text is verified before replacement. Layout switching follows
|
||||
the existing switch-layout setting. The configured Undo shortcut restores the original and suppresses
|
||||
that word for the rest of the session (until restart).
|
||||
|
||||
@@ -1,5 +1,29 @@
|
||||
# Latest Windows release
|
||||
|
||||
## v0.6.110 — 2026-11-17
|
||||
|
||||
Entering a folder or returning to its parent in KSwitcher Files refreshes the affected panel and the command line without repainting the other panel.
|
||||
|
||||
Auto-correction can preserve all uppercase letters when correcting to a word in **My dictionary**. With `qa` in the English personal dictionary and **Minimum word length** set to 2 or lower, typing `ЙФ` and pressing Space yields `QA`.
|
||||
|
||||
**Українською.**
|
||||
|
||||
Під час входу в папку або повернення до батьківської папки KSwitcher Files оновлює потрібну панель і командний рядок. Сусідня панель більше не перемальовується через цей перехід.
|
||||
|
||||
Автокорекція зберігає верхній регістр для слів з **My dictionary**. Якщо в особистому словнику English є `qa`, а **Minimum word length** дорівнює 2 або менше, після пробілу `ЙФ` виправиться на `QA`.
|
||||
|
||||
## v0.6.109 — 2026-11-17
|
||||
|
||||
**Ctrl+0–9** in KSwitcher Files opens the assigned folder or shows only the folders assigned to that digit. **Ctrl+F1** selects Brief and **Ctrl+F2** selects Wide in the active panel. **Ctrl+F3–F12** are reserved for other panel modes. If command history used a Ctrl+function shortcut, set a new binding under **Options → Command line → Command history**.
|
||||
|
||||
**My dictionary** accepts hyphens between letters, for example `test-mt` and `dev-mt`. Enter the correct spelling in the dictionary for its language, then click **OK → Save**. Update all PCs that share settings before syncing hyphenated entries.
|
||||
|
||||
**Українською.**
|
||||
|
||||
У KSwitcher Files **Ctrl+0–9** відкриває призначену папку або показує лише папки, призначені натиснутій цифрі. **Ctrl+F1** вмикає Brief, а **Ctrl+F2** вмикає Wide в активній панелі. **Ctrl+F3–F12** зарезервовані для інших режимів панелей. Якщо історія команд використовувала Ctrl із функціональною клавішею, задайте нову комбінацію в **Options → Command line → Command history**.
|
||||
|
||||
**My dictionary** приймає дефіси між літерами, наприклад `test-mt` і `dev-mt`. Введіть правильне написання у словник відповідної мови й натисніть **OK → Save**. Перед синхронізацією слів із дефісами оновіть усі ПК, які обмінюються налаштуваннями.
|
||||
|
||||
## v0.6.108 — 2026-11-17
|
||||
|
||||
KSwitcher Files adds **Wake** beside the offline status of a paired PC in **Change drive** (Alt+F1 or Alt+F2). Click **Wake** or focus it with the arrow keys and press **Enter**. The status bar reports whether KSwitcher sent the Wake-on-LAN packet.
|
||||
|
||||
@@ -1 +1 @@
|
||||
57cb29bf72f335c7b3dff5c40a1b992b46c770f3106b6033f7b02819c665a139 KSwitcher-win-x64.zip
|
||||
6b25873e86443d57a6bc669170c64d30c79d1a41849739b685b8d0f94f2f4576 KSwitcher-win-x64.zip
|
||||
+66
-66
@@ -1,166 +1,166 @@
|
||||
{
|
||||
"version": "0.6.110",
|
||||
"files": [
|
||||
{
|
||||
"size": 2479104,
|
||||
"path": "KSwitcher.exe",
|
||||
"sha256": "eb8c6aacf2fb626b135d89b4b416dbed4e12519f9d5cca4fa3fe27bfdac524f5"
|
||||
"sha256": "eab543bf53474e7cd0523a96441b0054dbfad8e4b3119f73b552d311233b30da",
|
||||
"size": 2373632
|
||||
},
|
||||
{
|
||||
"size": 2457600,
|
||||
"path": "KSwitcher.Config.exe",
|
||||
"sha256": "542c14cc509bf5e6f9e85e4c53d7b7624289a7f53015d5d7b2213b551e987575"
|
||||
"sha256": "85da336ddec715bfe1660e36969729c83a20f39d5e0cddb4b5091a2c6fa9ce64",
|
||||
"size": 2370560
|
||||
},
|
||||
{
|
||||
"size": 3060224,
|
||||
"path": "KSwitcher.Screenshot.exe",
|
||||
"sha256": "077a3a83da0fd0055f55b7df49b6c7fdf9e9ceb6eaaf7c3b20a98fb81b9a3a43"
|
||||
"sha256": "8e4a38e2b058e6442a8fc40ade9434e771389fceadc3a32bb4ef5287d84fd6f0",
|
||||
"size": 3350016
|
||||
},
|
||||
{
|
||||
"size": 4208128,
|
||||
"path": "KSwitcher.Files.exe",
|
||||
"sha256": "41a77a9b94005373ee02ed83143d7f4927926fa6a57a379988d482de39825519"
|
||||
"sha256": "3640e0612d8a54d523b63e2a9f8a6281047679ead9b47058a8d6274cf04b175a",
|
||||
"size": 4208128
|
||||
},
|
||||
{
|
||||
"size": 194912,
|
||||
"path": "WebView2Loader.dll",
|
||||
"sha256": "d3fce90bdeecb08596e377dea6a316354dd8949e32ff09b89d51be00c14e21b6"
|
||||
"sha256": "d3fce90bdeecb08596e377dea6a316354dd8949e32ff09b89d51be00c14e21b6",
|
||||
"size": 194912
|
||||
},
|
||||
{
|
||||
"size": 1103,
|
||||
"path": "terminal/addon-fit-LICENSE.txt",
|
||||
"sha256": "e256f01188af527e4d06d21d06fbf785ae9c50d4b328bf03cbe0ba7f0aa4228f"
|
||||
"sha256": "e256f01188af527e4d06d21d06fbf785ae9c50d4b328bf03cbe0ba7f0aa4228f",
|
||||
"size": 1103
|
||||
},
|
||||
{
|
||||
"size": 1521,
|
||||
"path": "terminal/addon-fit.js",
|
||||
"sha256": "ba3ea256ce0620a0992a197d6c9baea64823fc93d8da07a9e366ca9943c18527"
|
||||
"sha256": "ba3ea256ce0620a0992a197d6c9baea64823fc93d8da07a9e366ca9943c18527",
|
||||
"size": 1521
|
||||
},
|
||||
{
|
||||
"size": 527,
|
||||
"path": "terminal/index.html",
|
||||
"sha256": "084d97a727b778fb10d31adcd557ee7840a38377ed60e0ef0f3ece93b349b1ef"
|
||||
"sha256": "084d97a727b778fb10d31adcd557ee7840a38377ed60e0ef0f3ece93b349b1ef",
|
||||
"size": 527
|
||||
},
|
||||
{
|
||||
"size": 1073,
|
||||
"path": "terminal/markdown-it-LICENSE.txt",
|
||||
"sha256": "792c48c5a849a15fdf9e37e8bcf9e6d1dd13b32b46c642a748a0a46a9919d473"
|
||||
"sha256": "792c48c5a849a15fdf9e37e8bcf9e6d1dd13b32b46c642a748a0a46a9919d473",
|
||||
"size": 1073
|
||||
},
|
||||
{
|
||||
"size": 100786,
|
||||
"path": "terminal/markdown-it.js",
|
||||
"sha256": "391f2aa638e75e6c7859d0a5c5650ef0956722a45998f17e05b83bc655778e1e"
|
||||
"sha256": "391f2aa638e75e6c7859d0a5c5650ef0956722a45998f17e05b83bc655778e1e",
|
||||
"size": 100786
|
||||
},
|
||||
{
|
||||
"size": 3530,
|
||||
"path": "terminal/markdown.html",
|
||||
"sha256": "e5381c35fb254b558c8b869746e2e575c8ed53600611ac90597ed2dd80fa321c"
|
||||
"sha256": "e5381c35fb254b558c8b869746e2e575c8ed53600611ac90597ed2dd80fa321c",
|
||||
"size": 3530
|
||||
},
|
||||
{
|
||||
"size": 14987,
|
||||
"path": "terminal/markdown.js",
|
||||
"sha256": "5d1e824df1c3570877e985de0cfaae3f2984ceef7fe23bf4c5ade3c890a93223"
|
||||
"sha256": "5d1e824df1c3570877e985de0cfaae3f2984ceef7fe23bf4c5ade3c890a93223",
|
||||
"size": 14987
|
||||
},
|
||||
{
|
||||
"size": 1089,
|
||||
"path": "terminal/mermaid-LICENSE.txt",
|
||||
"sha256": "ec9fb67dcb25eccc416ed56e1aab819222c805a2a4bfe4cb19e7556bf2ffde80"
|
||||
"sha256": "ec9fb67dcb25eccc416ed56e1aab819222c805a2a4bfe4cb19e7556bf2ffde80",
|
||||
"size": 1089
|
||||
},
|
||||
{
|
||||
"size": 5537838,
|
||||
"path": "terminal/mermaid.js",
|
||||
"sha256": "336df803d87a38b70a01e736e666c8f7601d2ce42f5e47c8fafe5d721074b9a3"
|
||||
"sha256": "336df803d87a38b70a01e736e666c8f7601d2ce42f5e47c8fafe5d721074b9a3",
|
||||
"size": 5537838
|
||||
},
|
||||
{
|
||||
"size": 5033,
|
||||
"path": "terminal/terminal.js",
|
||||
"sha256": "0557d251962301940785690a3fc49475dd166bb7d0bd0417dc3279d1f1b3a98a"
|
||||
"sha256": "0557d251962301940785690a3fc49475dd166bb7d0bd0417dc3279d1f1b3a98a",
|
||||
"size": 5033
|
||||
},
|
||||
{
|
||||
"size": 1261,
|
||||
"path": "terminal/xterm-LICENSE.txt",
|
||||
"sha256": "b569f629d00f2626a8100df2a1798210535621e42164dfd426a6fe5aac7b0ccd"
|
||||
"sha256": "b569f629d00f2626a8100df2a1798210535621e42164dfd426a6fe5aac7b0ccd",
|
||||
"size": 1261
|
||||
},
|
||||
{
|
||||
"size": 7112,
|
||||
"path": "terminal/xterm.css",
|
||||
"sha256": "854a7c0fb70e8b1a083c16797ab827299fb18744f5ad34f227b48337e33293c6"
|
||||
"sha256": "854a7c0fb70e8b1a083c16797ab827299fb18744f5ad34f227b48337e33293c6",
|
||||
"size": 7112
|
||||
},
|
||||
{
|
||||
"size": 488663,
|
||||
"path": "terminal/xterm.js",
|
||||
"sha256": "14903579ff54664cd72f8e8699e6961a6272c21863ec1c3b118cdc8af5d4a972"
|
||||
"sha256": "14903579ff54664cd72f8e8699e6961a6272c21863ec1c3b118cdc8af5d4a972",
|
||||
"size": 488663
|
||||
},
|
||||
{
|
||||
"size": 4401,
|
||||
"path": "LICENSE",
|
||||
"sha256": "d3c81140cce01c26bf6cbf52aa40e0825e1fa35b9a91d1387170a65d2597082c"
|
||||
"sha256": "d3c81140cce01c26bf6cbf52aa40e0825e1fa35b9a91d1387170a65d2597082c",
|
||||
"size": 4401
|
||||
},
|
||||
{
|
||||
"size": 1096,
|
||||
"path": "json-LICENSE.txt",
|
||||
"sha256": "61e08da79c44061654015ce6b0c4061c23ee1dd18237fbf09e9bfda3c0ea2831"
|
||||
"sha256": "61e08da79c44061654015ce6b0c4061c23ee1dd18237fbf09e9bfda3c0ea2831",
|
||||
"size": 1096
|
||||
},
|
||||
{
|
||||
"size": 883,
|
||||
"path": "files-text-license.txt",
|
||||
"sha256": "185c5a37521316e940ead89cbf0b1ba5862d810c7c966e6c6a14a4a515b23625"
|
||||
"sha256": "185c5a37521316e940ead89cbf0b1ba5862d810c7c966e6c6a14a4a515b23625",
|
||||
"size": 883
|
||||
},
|
||||
{
|
||||
"size": 94908,
|
||||
"path": "README.md",
|
||||
"sha256": "12d8b55a2d2f26060b2a614bd52e6e0ffe4a8f140e62cc454a47fc8f246cb81f"
|
||||
"sha256": "eb9cc6aa8f764cb0e1bdf2aa073e4e3d2623a7afc51ed9c6a0aba4046fc7f74c",
|
||||
"size": 95168
|
||||
},
|
||||
{
|
||||
"size": 11577,
|
||||
"path": "LAN-PREVIEW.md",
|
||||
"sha256": "1233d6a0ed76564dd034f178a9f65db076244a819137f74dc9f2c27df9d3c930"
|
||||
"sha256": "1233d6a0ed76564dd034f178a9f65db076244a819137f74dc9f2c27df9d3c930",
|
||||
"size": 11577
|
||||
},
|
||||
{
|
||||
"size": 732485,
|
||||
"path": "dictionaries/en.txt",
|
||||
"sha256": "d0c022b27b9fbc2ff7b6b8bec723cc1adc4eef517202f9ff77eed5d8bea3acb9"
|
||||
"sha256": "d0c022b27b9fbc2ff7b6b8bec723cc1adc4eef517202f9ff77eed5d8bea3acb9",
|
||||
"size": 732485
|
||||
},
|
||||
{
|
||||
"size": 20566,
|
||||
"path": "dictionaries/LICENSE-CC-BY-SA-4.0.txt",
|
||||
"sha256": "0bdfb0201d1803634f268cdff0993b8349d2c70e956a06dbb667c8dd65254ec5"
|
||||
"sha256": "0bdfb0201d1803634f268cdff0993b8349d2c70e956a06dbb667c8dd65254ec5",
|
||||
"size": 20566
|
||||
},
|
||||
{
|
||||
"size": 2265,
|
||||
"path": "dictionaries/README.md",
|
||||
"sha256": "3017bf44d3be9d9dfab21bd6778aa52b7947e61acf9ce2bc86b41d6e949ac311"
|
||||
"sha256": "3017bf44d3be9d9dfab21bd6778aa52b7947e61acf9ce2bc86b41d6e949ac311",
|
||||
"size": 2265
|
||||
},
|
||||
{
|
||||
"size": 1109134,
|
||||
"path": "dictionaries/ru.txt",
|
||||
"sha256": "80e6b6a27815973535f7facb636c597eb845dfee45cfabfc4e9b3341b9332849"
|
||||
"sha256": "80e6b6a27815973535f7facb636c597eb845dfee45cfabfc4e9b3341b9332849",
|
||||
"size": 1109134
|
||||
},
|
||||
{
|
||||
"size": 1280,
|
||||
"path": "dictionaries/sources.json",
|
||||
"sha256": "98e5b3fe7304e37705c9e5ff48b0b399ccb16e806736d21f09921b99e5f2a408"
|
||||
"sha256": "98e5b3fe7304e37705c9e5ff48b0b399ccb16e806736d21f09921b99e5f2a408",
|
||||
"size": 1280
|
||||
},
|
||||
{
|
||||
"size": 940799,
|
||||
"path": "dictionaries/uk.txt",
|
||||
"sha256": "d30e990d6ec2983c04f3644a3c61c6c668e8c542323f5931916fdd55b916eebf"
|
||||
"sha256": "d30e990d6ec2983c04f3644a3c61c6c668e8c542323f5931916fdd55b916eebf",
|
||||
"size": 940799
|
||||
},
|
||||
{
|
||||
"size": 993,
|
||||
"path": "tools/README.txt",
|
||||
"sha256": "a34b5161a8315af037e1ec71d816bfc688f7c364141d4ee2347cf0515ef0c82a"
|
||||
"sha256": "a34b5161a8315af037e1ec71d816bfc688f7c364141d4ee2347cf0515ef0c82a",
|
||||
"size": 993
|
||||
},
|
||||
{
|
||||
"size": 133120,
|
||||
"path": "tools/StayHere.exe",
|
||||
"sha256": "6945ac336307301285ade8d98939e3bb974d1e20b3414101a8e1e50ce31ababb"
|
||||
"sha256": "6ef5cf64708d62b7fc63c3c793cc99188a513433ff4774cae01dc014f6664376",
|
||||
"size": 134656
|
||||
},
|
||||
{
|
||||
"size": 2796,
|
||||
"path": "tools/StayHere-README.md",
|
||||
"sha256": "ba214e2aca7405e698b3ab21ceb1f41ce088edd996b3e30e4a9d58ff496f9413"
|
||||
"sha256": "ba214e2aca7405e698b3ab21ceb1f41ce088edd996b3e30e4a9d58ff496f9413",
|
||||
"size": 2796
|
||||
}
|
||||
],
|
||||
"schema": 1,
|
||||
"version": "0.6.108"
|
||||
"schema": 1
|
||||
}
|
||||
+3
-3
@@ -9,8 +9,8 @@ IDC_SCREENSHOT_PENCIL CURSOR "icons/lucide/pencil.cur"
|
||||
1 RT_MANIFEST "app.manifest"
|
||||
201 RCDATA "update.ps1"
|
||||
1 VERSIONINFO
|
||||
FILEVERSION 0,6,108,0
|
||||
PRODUCTVERSION 0,6,108,0
|
||||
FILEVERSION 0,6,110,0
|
||||
PRODUCTVERSION 0,6,110,0
|
||||
FILEOS VOS_NT_WINDOWS32
|
||||
FILETYPE VFT_APP
|
||||
BEGIN
|
||||
@@ -20,7 +20,7 @@ BEGIN
|
||||
BEGIN
|
||||
VALUE "FileDescription", "KSwitcher — native keyboard and clipboard utility"
|
||||
VALUE "ProductName", "KSwitcher"
|
||||
VALUE "FileVersion", "0.6.108"
|
||||
VALUE "FileVersion", "0.6.110"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
|
||||
+11
-4
@@ -34,13 +34,14 @@ std::wstring layoutLanguage(const Layout &layout)
|
||||
return {};
|
||||
}
|
||||
}
|
||||
bool safeAutoWord(const std::wstring &word, int minimumLength)
|
||||
bool safeAutoWord(const std::wstring &word, int minimumLength, bool allowUppercase)
|
||||
{
|
||||
if (minimumLength < 1 || minimumLength > 32 || word.size() < (size_t)minimumLength || word.size() > 32 ||
|
||||
!std::all_of(word.begin(), word.end(), letter))
|
||||
return false;
|
||||
auto small = lower(word);
|
||||
return word == small || (word.substr(1) == small.substr(1) && word != upper(word));
|
||||
const bool allUppercase = word == upper(word);
|
||||
return word == small || (allUppercase ? allowUppercase : word.substr(1) == small.substr(1));
|
||||
}
|
||||
namespace {
|
||||
constexpr size_t DictionaryBlockWords = 32;
|
||||
@@ -289,9 +290,15 @@ std::optional<AutoSuggestion> AutoCorrector::suggest(const std::wstring &typed,
|
||||
if (dictionary == dictionaries.end())
|
||||
continue;
|
||||
auto converted = convert(word, layouts[source], layouts[i], true);
|
||||
if (converted == word || !safeAutoWord(converted, settings.autoMinLength))
|
||||
if (converted == word)
|
||||
continue;
|
||||
int rank = personal(dictionary->first, converted) ? 1 : dictionary->second->rank(converted);
|
||||
const bool knownPersonal = personal(dictionary->first, converted);
|
||||
auto letters = converted;
|
||||
if (knownPersonal)
|
||||
std::erase(letters, L'-');
|
||||
if (!safeAutoWord(letters, settings.autoMinLength, knownPersonal))
|
||||
continue;
|
||||
int rank = knownPersonal ? 1 : dictionary->second->rank(converted);
|
||||
if (!rank)
|
||||
continue;
|
||||
if (matchedText && *matchedText != converted)
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ struct AutoSuggestion
|
||||
std::wstring text;
|
||||
};
|
||||
std::wstring layoutLanguage(const Layout &);
|
||||
bool safeAutoWord(const std::wstring &, int minimumLength = 3);
|
||||
bool safeAutoWord(const std::wstring &, int minimumLength = 3, bool allowUppercase = false);
|
||||
bool autoClosingSelection(const std::wstring &, const Settings & = {});
|
||||
int matchAutoInput(const Run &, const std::wstring &, const std::vector<Layout> &, const Layout &,
|
||||
const Settings & = {});
|
||||
|
||||
+12
-2
@@ -3,6 +3,7 @@
|
||||
#include <cwctype>
|
||||
#include <map>
|
||||
#include <stdexcept>
|
||||
#include <string_view>
|
||||
|
||||
namespace ks
|
||||
{
|
||||
@@ -21,20 +22,29 @@ int snippetAppPriority(const Snippet &snippet, const std::wstring &process)
|
||||
for (const auto &app : snippet.apps) if (snippetAppName(app) == name && !name.empty()) return 2;
|
||||
return 0;
|
||||
}
|
||||
bool validAutoCorrection(const std::wstring &text, const std::wstring &alphabet)
|
||||
static bool validSeparatedWord(const std::wstring &text, const std::wstring &alphabet,
|
||||
std::wstring_view separators)
|
||||
{
|
||||
if (text.empty() || text.size() > 32) return false;
|
||||
auto isLetter = [&](wchar_t c) { return alphabet.find(c) != alphabet.npos; };
|
||||
for (size_t i = 0; i < text.size(); ++i)
|
||||
{
|
||||
if (isLetter(text[i])) continue;
|
||||
if (text[i] != L' ' && text[i] != L'\'' && text[i] != L'\u2019' && text[i] != L'\u02bc')
|
||||
if (separators.find(text[i]) == separators.npos)
|
||||
return false;
|
||||
if (i == 0 || i + 1 == text.size() || !isLetter(text[i - 1]) || !isLetter(text[i + 1]))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
bool validAutoCorrection(const std::wstring &text, const std::wstring &alphabet)
|
||||
{
|
||||
return validSeparatedWord(text, alphabet, L" '\u2019\u02bc");
|
||||
}
|
||||
bool validPersonalWord(const std::wstring &text, const std::wstring &alphabet)
|
||||
{
|
||||
return validSeparatedWord(lower(text), alphabet, L"-");
|
||||
}
|
||||
bool validAutoReplacementSource(const std::wstring &text, const std::wstring &alphabet)
|
||||
{
|
||||
return text.find(L' ') == text.npos && text.find_first_of(alphabet) != text.npos &&
|
||||
|
||||
@@ -22,6 +22,7 @@ struct Layout
|
||||
bool letter(wchar_t ch);
|
||||
bool validAutoCorrection(const std::wstring &text, const std::wstring &alphabet);
|
||||
bool validAutoReplacementSource(const std::wstring &text, const std::wstring &alphabet);
|
||||
bool validPersonalWord(const std::wstring &text, const std::wstring &alphabet);
|
||||
std::wstring lower(std::wstring text);
|
||||
std::wstring upper(std::wstring text);
|
||||
std::wstring convert(const std::wstring &, const Layout &, const Layout &, bool force = false);
|
||||
|
||||
@@ -12,7 +12,7 @@ bool validHistoryKeys(const std::array<WORD,2> &keys)
|
||||
const bool function=key>=VK_F1 && key<=VK_F12;
|
||||
if(!letter && !function) return false;
|
||||
if(modifiers==HOTKEYF_CONTROL)
|
||||
return (letter && key!='C' && key!='F' && key!='R' && key!='V' && key!='X' && key!='A' && key!='Z' && key!='Y') || function;
|
||||
return letter && key!='C' && key!='F' && key!='R' && key!='V' && key!='X' && key!='A' && key!='Z' && key!='Y';
|
||||
if(modifiers==HOTKEYF_ALT) return function && key!=VK_F1 && key!=VK_F2 && key!=VK_F4 && key!=VK_F10;
|
||||
return false;
|
||||
});
|
||||
|
||||
@@ -187,8 +187,6 @@ struct FolderShortcutView
|
||||
std::vector<int> digits;
|
||||
int rowHeight{};
|
||||
Panel *panel{};
|
||||
bool all{};
|
||||
std::vector<std::pair<int,size_t>> entries;
|
||||
};
|
||||
|
||||
std::wstring shortcutLabel(const FolderShortcut &entry)
|
||||
@@ -201,7 +199,6 @@ void layoutQuickFolders(HWND dialog,FolderShortcutView &view,int selection)
|
||||
const auto list=GetDlgItem(dialog,shortcutList);
|
||||
SendMessageW(list,LB_RESETCONTENT,0,0);
|
||||
view.digits.clear();
|
||||
view.entries.clear();
|
||||
const auto owner=GetWindow(dialog,GW_OWNER);
|
||||
const auto dc=GetDC(dialog);
|
||||
const auto font=SelectObject(dc,mono);
|
||||
@@ -219,23 +216,14 @@ void layoutQuickFolders(HWND dialog,FolderShortcutView &view,int selection)
|
||||
GetTextExtentPoint32W(dc,label.data(),static_cast<int>(label.size()),&size);
|
||||
return static_cast<int>(size.cx);
|
||||
};
|
||||
int width=std::max(measure(L"Folder shortcuts"),measure(view.all?L"Del F4":view.digit<0?L"Enter Esc":quickFolderHints))+3*cellWidth;
|
||||
int width=std::max(measure(L"Folder shortcuts"),measure(view.digit<0?L"Enter Esc":quickFolderHints))+3*cellWidth;
|
||||
const int textInset=dialogRowTextInset(cellWidth);
|
||||
const auto add=[&](const std::wstring &label)
|
||||
{
|
||||
width=std::max(width,measure(label)+2*textInset);
|
||||
SendMessageW(list,LB_ADDSTRING,0,reinterpret_cast<LPARAM>(label.c_str()));
|
||||
};
|
||||
if(view.all)
|
||||
{
|
||||
for(int digit=0;digit<static_cast<int>(folderShortcuts.size());++digit)
|
||||
for(size_t index=0;index<folderShortcuts[digit].size();++index)
|
||||
{
|
||||
view.entries.emplace_back(digit,index);
|
||||
add(std::to_wstring(digit)+L" "+shortcutLabel(folderShortcuts[digit][index]));
|
||||
}
|
||||
}
|
||||
else if(view.digit<0)
|
||||
if(view.digit<0)
|
||||
{
|
||||
for(int digit=0;digit<10;++digit)
|
||||
if(!folderShortcuts[digit].empty())
|
||||
@@ -322,7 +310,7 @@ INT_PTR CALLBACK quickFolderDialog(HWND dialog,UINT message,WPARAM wp,LPARAM lp)
|
||||
const auto bounds=paintDialogFrame(dc,client,dialogFrameMetrics(GetDpiForWindow(dialog)),teal,frame);
|
||||
DeleteObject(frame);
|
||||
paintDialogFrameCaptions(dc,client,bounds,L"Folder shortcuts",teal,colors[Text],mono,
|
||||
view->all?L"Del F4":view->digit<0?L"Enter Esc":quickFolderHints);
|
||||
view->digit<0?L"Enter Esc":quickFolderHints);
|
||||
EndPaint(dialog,&ps);
|
||||
return TRUE;
|
||||
}
|
||||
@@ -349,7 +337,7 @@ INT_PTR CALLBACK quickFolderDialog(HWND dialog,UINT message,WPARAM wp,LPARAM lp)
|
||||
if(action!=quickRemove && action!=quickEdit && action!=quickInsert && action!=quickMoveUp &&
|
||||
action!=quickMoveDown && action!=IDOK && !(action==shortcutList && HIWORD(wp)==LBN_DBLCLK)) return FALSE;
|
||||
const auto row=SendDlgItemMessageW(dialog,shortcutList,LB_GETCURSEL,0,0);
|
||||
if(!view->all && view->digit<0)
|
||||
if(view->digit<0)
|
||||
{
|
||||
if((action==IDOK || action==shortcutList) && row>=0 && static_cast<size_t>(row)<view->digits.size())
|
||||
{
|
||||
@@ -358,16 +346,8 @@ INT_PTR CALLBACK quickFolderDialog(HWND dialog,UINT message,WPARAM wp,LPARAM lp)
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
int digit=view->digit;
|
||||
size_t index=static_cast<size_t>(row);
|
||||
if(view->all)
|
||||
{
|
||||
if(index>=view->entries.size() || action==quickInsert ||
|
||||
action==quickMoveUp || action==quickMoveDown) return TRUE;
|
||||
const auto &entry=view->entries[index];
|
||||
digit=entry.first;
|
||||
index=entry.second;
|
||||
}
|
||||
const auto digit=view->digit;
|
||||
const auto index=static_cast<size_t>(row);
|
||||
const auto &group=folderShortcuts[digit];
|
||||
if(action==quickInsert)
|
||||
{
|
||||
@@ -414,7 +394,7 @@ INT_PTR CALLBACK quickFolderDialog(HWND dialog,UINT message,WPARAM wp,LPARAM lp)
|
||||
}
|
||||
folderShortcuts=std::move(updated);
|
||||
notifyFilesPreferences(GetAncestor(dialog,GA_ROOTOWNER));
|
||||
if(view->all?view->entries.size()==1:folderShortcuts[digit].empty()) FilesModalDialog::finish(dialog,IDCANCEL);
|
||||
if(folderShortcuts[digit].empty()) FilesModalDialog::finish(dialog,IDCANCEL);
|
||||
else layoutQuickFolders(dialog,*view,static_cast<int>(row));
|
||||
return TRUE;
|
||||
}
|
||||
@@ -424,7 +404,7 @@ INT_PTR CALLBACK quickFolderDialog(HWND dialog,UINT message,WPARAM wp,LPARAM lp)
|
||||
}
|
||||
|
||||
|
||||
void showFolderShortcuts(Panel &panel,int digit,bool all)
|
||||
void showFolderShortcuts(Panel &panel,int digit)
|
||||
{
|
||||
if(digit>=0)
|
||||
{
|
||||
@@ -447,7 +427,6 @@ void showFolderShortcuts(Panel &panel,int digit,bool all)
|
||||
}
|
||||
FolderShortcutView view{digit};
|
||||
view.panel=&panel;
|
||||
view.all=all;
|
||||
const auto result=FilesModalDialog::run(GetModuleHandleW(nullptr),MAKEINTRESOURCEW(109),GetParent(panel.list),
|
||||
quickFolderDialog,reinterpret_cast<LPARAM>(&view));
|
||||
SetFocus(panel.list);
|
||||
|
||||
+10
-10
@@ -492,7 +492,7 @@ INT_PTR showFilesNotice(HWND owner,const wchar_t *text,const wchar_t *title,File
|
||||
void openMenu(HWND window, int index);
|
||||
void showFileDetails(const Panel &panel);
|
||||
void editOptions(HWND owner);
|
||||
void showFolderShortcuts(Panel &panel,int digit,bool all=false);
|
||||
void showFolderShortcuts(Panel &panel,int digit);
|
||||
void layout(HWND window,bool activeOnly=false);
|
||||
void clearTerminalSelection();
|
||||
|
||||
@@ -1864,8 +1864,9 @@ bool applyDirectoryScan(Panel &panel,Panel::ScanRequest request,Panel::ScanResul
|
||||
for (const auto &file : files) add(file, file.filename().wstring(), false);
|
||||
const auto label=(panel.peer?panel.peer->name+L" · ":std::wstring{})+directory.native();
|
||||
SetWindowTextW(panel.path,label.c_str());
|
||||
InvalidateRect(panel.path,nullptr,FALSE);
|
||||
if(&panel==&panels[active] && !sameDirectory)
|
||||
layout(GetParent(panel.list));
|
||||
layout(GetParent(panel.list),true);
|
||||
auto selected=std::find(panel.rows.begin(),panel.rows.end(),previousSelection);
|
||||
if(selected==panel.rows.end() && !panel.rows.empty())
|
||||
selected=panel.rows.begin()+std::clamp<LRESULT>(previousRow,0,panel.rows.size()-1);
|
||||
@@ -5256,8 +5257,8 @@ void openMenu(HWND window, int index)
|
||||
if(index==0 || index==4)
|
||||
{
|
||||
const bool wide=panels[index==4].wide;
|
||||
rows={wide?L" Brief":L"✓ Brief",
|
||||
wide?L"✓ Wide":L" Wide",
|
||||
rows={wide?L" Brief\tCtrl+F1":L"✓ Brief\tCtrl+F1",
|
||||
wide?L"✓ Wide\tCtrl+F2":L" Wide\tCtrl+F2",
|
||||
index==0?L" Change drive\tAlt+F1":L" Change drive\tAlt+F2"};
|
||||
}
|
||||
else if(index==1) rows={L"Copy\tF5",L"Move\tF6",L"Make folder\tF7",L"Exit\tF10"};
|
||||
@@ -6277,8 +6278,7 @@ int WINAPI wWinMain(HINSTANCE instance, HINSTANCE, PWSTR, int show)
|
||||
if(message.message==WM_KEYDOWN && mainInput && !terminalVisible &&
|
||||
(GetKeyState(VK_CONTROL)&0x8000) && !(GetKeyState(VK_MENU)&0x8000) &&
|
||||
!(GetKeyState(VK_LWIN)&0x8000) && !(GetKeyState(VK_RWIN)&0x8000) &&
|
||||
message.wParam>='0' && message.wParam<='9' && !copyInProgress &&
|
||||
(message.wParam!='8' || (GetKeyState(VK_SHIFT)&0x8000)))
|
||||
message.wParam>='0' && message.wParam<='9' && !copyInProgress)
|
||||
{
|
||||
if(!(message.lParam & (1LL<<30)))
|
||||
{
|
||||
@@ -6292,17 +6292,17 @@ int WINAPI wWinMain(HINSTANCE instance, HINSTANCE, PWSTR, int show)
|
||||
continue;
|
||||
}
|
||||
const bool filesMessage=message.hwnd==window || IsChild(window,message.hwnd);
|
||||
if(filesMessage && !terminalVisible && !copyInProgress && !commandHistoryWindow &&
|
||||
message.message==WM_KEYDOWN && message.wParam=='8' &&
|
||||
if(mainInput && !terminalVisible && !copyInProgress &&
|
||||
message.message==WM_KEYDOWN && message.wParam>=VK_F1 && message.wParam<=VK_F12 &&
|
||||
(GetKeyState(VK_CONTROL)&0x8000) && !(GetKeyState(VK_MENU)&0x8000) &&
|
||||
!(GetKeyState(VK_SHIFT)&0x8000) && !(GetKeyState(VK_LWIN)&0x8000) &&
|
||||
!(GetKeyState(VK_RWIN)&0x8000))
|
||||
{
|
||||
if(!(message.lParam & (1LL<<30)))
|
||||
if(!(message.lParam & (1LL<<30)) && (message.wParam==VK_F1 || message.wParam==VK_F2))
|
||||
{
|
||||
hidePicker();
|
||||
showMenu(false);
|
||||
showFolderShortcuts(panels[active],-1,true);
|
||||
setMode(active,message.wParam==VK_F2);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
+3
-2
@@ -269,8 +269,9 @@ void validateSettings(const Settings &s)
|
||||
if (alphabet.empty() || words.size() > 10000)
|
||||
throw std::runtime_error("Invalid personal dictionary language or too many words");
|
||||
for (const auto &word : words)
|
||||
if (word.empty() || word.size() > 32 || lower(word).find_first_not_of(alphabet) != word.npos)
|
||||
throw std::runtime_error("Personal words must contain 1-32 letters of their selected language");
|
||||
if (!validPersonalWord(word, alphabet))
|
||||
throw std::runtime_error("Personal words must be 1-32 characters, with letters of the selected language. "
|
||||
"A hyphen (-) is allowed between letters.");
|
||||
}
|
||||
if (s.maxItems < 10 || s.maxItems > 10000 || s.maxMiB < 1 || s.maxMiB > 2048 || s.maxImageMiB < 1 ||
|
||||
s.maxImageMiB > 64)
|
||||
|
||||
+1
-1
@@ -1705,7 +1705,7 @@ void showAutoOptions(HWND parent, SettingsView *v)
|
||||
label(w, L"Never correct these words (comma-separated)", 18, 184, 525);
|
||||
edit(w, 405, 18, 212, 524, 52, ES_MULTILINE | WS_VSCROLL | ES_AUTOVSCROLL);
|
||||
value(w, 405, commaList(v->draft.autoNever));
|
||||
label(w, L"My dictionary: correct words, separated by commas or new lines", 18, 276, 525);
|
||||
label(w, L"My dictionary: separate words by commas or new lines. Internal hyphens allowed.", 18, 276, 525);
|
||||
for (auto [id, language] : {std::pair{411, L"en"}, {412, L"uk"}, {413, L"ru"}})
|
||||
{
|
||||
int x = 18 + (id - 411) * 178;
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
#include "platform.h"
|
||||
namespace ks
|
||||
{
|
||||
inline constexpr wchar_t AppVersion[] = L"0.6.108";
|
||||
inline constexpr wchar_t AppVersion[] = L"0.6.110";
|
||||
inline constexpr UINT UpdateMessage = WM_APP + 7;
|
||||
inline constexpr UINT UpdateCheckIntervalMs = 6 * 60 * 60 * 1000;
|
||||
inline constexpr UINT UpdateNotificationRetryMs = 5 * 60 * 1000;
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
param(
|
||||
[string]$Executable = "$PSScriptRoot/../build/files-cmake/KSwitcher.Files.exe",
|
||||
[string]$Screenshot
|
||||
)
|
||||
$ErrorActionPreference = 'Stop'
|
||||
Add-Type @'
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Runtime.InteropServices;
|
||||
public static class FilesShortcutWindow {
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct Rect { public int Left, Top, Right, Bottom; }
|
||||
[DllImport("user32.dll")] public static extern IntPtr GetForegroundWindow();
|
||||
[DllImport("user32.dll")] static extern bool SetForegroundWindow(IntPtr window);
|
||||
[DllImport("user32.dll")] static extern void keybd_event(byte key, byte scan, uint flags, UIntPtr extra);
|
||||
[DllImport("user32.dll")] public static extern IntPtr GetWindow(IntPtr window, uint command);
|
||||
[DllImport("user32.dll")] public static extern IntPtr GetDlgItem(IntPtr window, int id);
|
||||
[DllImport("user32.dll")] public static extern bool IsWindowVisible(IntPtr window);
|
||||
[DllImport("user32.dll")] public static extern bool GetWindowRect(IntPtr window, out Rect rect);
|
||||
[DllImport("user32.dll", CharSet=CharSet.Unicode)]
|
||||
public static extern IntPtr SendMessage(IntPtr window, uint msg, IntPtr w, StringBuilder text);
|
||||
public static bool Activate(IntPtr window) {
|
||||
if (GetForegroundWindow() == window) return true;
|
||||
keybd_event(0x12, 0, 0, UIntPtr.Zero);
|
||||
keybd_event(0x12, 0, 2, UIntPtr.Zero);
|
||||
SetForegroundWindow(window);
|
||||
return GetForegroundWindow() == window;
|
||||
}
|
||||
}
|
||||
'@
|
||||
function Wait-Until([scriptblock]$Condition) {
|
||||
for ($attempt = 0; $attempt -lt 100; $attempt++) {
|
||||
if (& $Condition) { return }
|
||||
Start-Sleep -Milliseconds 50
|
||||
}
|
||||
throw "Timed out waiting for: $Condition"
|
||||
}
|
||||
function Read-Text($Control, $Message = 13, $Parameter = 2048) {
|
||||
$buffer = [Text.StringBuilder]::new(2048)
|
||||
[void][FilesShortcutWindow]::SendMessage($Control, $Message, [IntPtr]$Parameter, $buffer)
|
||||
$buffer.ToString()
|
||||
}
|
||||
function Read-ShortcutDialog {
|
||||
$foreground = [FilesShortcutWindow]::GetForegroundWindow()
|
||||
if ([FilesShortcutWindow]::GetWindow($foreground, 4) -eq $window -and
|
||||
[FilesShortcutWindow]::GetDlgItem($foreground, 310) -ne [IntPtr]::Zero) { return $foreground }
|
||||
return [IntPtr]::Zero
|
||||
}
|
||||
|
||||
$exe = (Resolve-Path $Executable).Path
|
||||
$key = [Microsoft.Win32.Registry]::CurrentUser.CreateSubKey('Software\KSwitcher\Files')
|
||||
$saved = @{}
|
||||
$names = 'FolderShortcuts', 'LeftWide', 'RightWide', 'LeftPath', 'RightPath', 'LeftCursor', 'RightCursor', 'WindowPlacement'
|
||||
foreach ($name in $names) {
|
||||
if ($name -in $key.GetValueNames()) { $saved[$name] = @($key.GetValue($name), $key.GetValueKind($name)) }
|
||||
}
|
||||
$folder = [IO.Directory]::CreateTempSubdirectory('ks-files-shortcuts-').FullName
|
||||
try {
|
||||
$groups = [object[]]::new(10)
|
||||
for ($digit = 0; $digit -lt 10; $digit++) { $groups[$digit] = @() }
|
||||
foreach ($entry in @(@(3, 'Three'), @(4, 'Four'), @(8, 'Eight A'), @(8, 'Eight B'))) {
|
||||
$path = [IO.Directory]::CreateDirectory((Join-Path $folder $entry[1])).FullName
|
||||
$groups[$entry[0]] += @{ path = $path; peer = ''; name = ''; title = $entry[1] }
|
||||
}
|
||||
$key.SetValue('FolderShortcuts', [Text.Encoding]::UTF8.GetBytes((ConvertTo-Json -InputObject $groups -Depth 4)), 'Binary')
|
||||
foreach ($name in 'LeftWide', 'RightWide') { $key.SetValue($name, 1, 'DWord') }
|
||||
foreach ($name in 'LeftPath', 'RightPath') { $key.SetValue($name, $folder, 'String') }
|
||||
$key.DeleteValue('WindowPlacement', $false)
|
||||
|
||||
$process = Start-Process -FilePath $exe -PassThru
|
||||
$keyboard = New-Object -ComObject WScript.Shell
|
||||
Wait-Until { $process.Refresh(); $process.MainWindowHandle -ne [IntPtr]::Zero }
|
||||
$window = $process.MainWindowHandle
|
||||
Wait-Until { [FilesShortcutWindow]::Activate($window) }
|
||||
$heading = [FilesShortcutWindow]::GetDlgItem($window, 140)
|
||||
$rightHeading = [FilesShortcutWindow]::GetDlgItem($window, 141)
|
||||
$leftPath = [FilesShortcutWindow]::GetDlgItem($window, 142)
|
||||
Wait-Until { (Read-Text $leftPath) -eq $folder }
|
||||
|
||||
$keyboard.SendKeys('^8')
|
||||
Wait-Until { (Read-ShortcutDialog) -ne [IntPtr]::Zero }
|
||||
$dialog = Read-ShortcutDialog
|
||||
$list = [FilesShortcutWindow]::GetDlgItem($dialog, 310)
|
||||
$count = [FilesShortcutWindow]::SendMessage($list, 395, [IntPtr]::Zero, $null).ToInt32()
|
||||
$rows = for ($row = 0; $row -lt $count; $row++) { Read-Text $list 393 $row }
|
||||
if (($rows -join '|') -cne 'Eight A|Eight B') {
|
||||
throw "Ctrl+8 should display only its two assigned folders. Actual rows: $($rows -join ' | ')"
|
||||
}
|
||||
if ($Screenshot) {
|
||||
Add-Type -AssemblyName System.Drawing
|
||||
$bounds = [FilesShortcutWindow+Rect]::new()
|
||||
if (![FilesShortcutWindow]::GetWindowRect($dialog, [ref]$bounds)) { throw 'Cannot locate the rendered popup.' }
|
||||
$bitmap = [Drawing.Bitmap]::new(($bounds.Right - $bounds.Left), ($bounds.Bottom - $bounds.Top))
|
||||
try {
|
||||
$graphics = [Drawing.Graphics]::FromImage($bitmap)
|
||||
try { $graphics.CopyFromScreen($bounds.Left, $bounds.Top, 0, 0, $bitmap.Size) }
|
||||
finally { $graphics.Dispose() }
|
||||
$bitmap.Save($Screenshot, [Drawing.Imaging.ImageFormat]::Png)
|
||||
} finally { $bitmap.Dispose() }
|
||||
}
|
||||
$keyboard.SendKeys('{ESC}')
|
||||
Wait-Until { [FilesShortcutWindow]::GetForegroundWindow() -eq $window }
|
||||
$keyboard.SendKeys('^4')
|
||||
Wait-Until { (Read-Text $leftPath) -eq (Join-Path $folder 'Four') }
|
||||
if (![FilesShortcutWindow]::IsWindowVisible($heading)) { throw 'Ctrl+4 changed panel mode.' }
|
||||
$keyboard.SendKeys('^{F1}')
|
||||
Wait-Until { ![FilesShortcutWindow]::IsWindowVisible($heading) }
|
||||
if (![FilesShortcutWindow]::IsWindowVisible($rightHeading)) { throw 'Ctrl+F1 changed the inactive panel.' }
|
||||
$keyboard.SendKeys('^{F2}')
|
||||
Wait-Until { [FilesShortcutWindow]::IsWindowVisible($heading) }
|
||||
Write-Output 'Verified Ctrl+8 popup rows, Ctrl+4 navigation and Ctrl+F1/F2 panel modes.'
|
||||
} finally {
|
||||
if ($process -and !$process.HasExited) {
|
||||
$keyboard.SendKeys('{ESC}')
|
||||
if (!$process.CloseMainWindow() -or !$process.WaitForExit(2500)) { $process.Kill(); $process.WaitForExit() }
|
||||
}
|
||||
foreach ($name in $names) {
|
||||
if ($saved.ContainsKey($name)) { $key.SetValue($name, $saved[$name][0], $saved[$name][1]) }
|
||||
else { $key.DeleteValue($name, $false) }
|
||||
}
|
||||
$key.Dispose()
|
||||
[IO.Directory]::Delete($folder, $true)
|
||||
}
|
||||
@@ -262,6 +262,33 @@ try {
|
||||
$main = Wait-Until { Find-Window 'KSwitcher.Files' $process.Id }
|
||||
$leftPanel=[SearchArrowTest]::GetDlgItem($main,102)
|
||||
$rightPanel=[SearchArrowTest]::GetDlgItem($main,103)
|
||||
# Initial directory scans repaint both panels when their results arrive.
|
||||
[void](Wait-Until {
|
||||
[SearchArrowTest]::SendText($leftPanel,0x1A2,-1,'A.txt').ToInt64() -ge 0 -and
|
||||
[SearchArrowTest]::SendText($rightPanel,0x1A2,-1,'A.txt').ToInt64() -ge 0
|
||||
})
|
||||
if (!$KeyboardCursorOnly) {
|
||||
$leftPath = [SearchArrowTest]::GetDlgItem($main,142)
|
||||
foreach ($step in @(@{ Row='[Right fixture]'; Path=$rightFixture }, @{ Row='..'; Path=$scratch })) {
|
||||
Select-Row $leftPanel $step.Row
|
||||
Start-Sleep -Milliseconds 150
|
||||
$lineCount = @(Get-Content -LiteralPath $paintTrace).Count
|
||||
Post $leftPanel 0x100 13
|
||||
[void](Wait-Until {
|
||||
$path = [Text.StringBuilder]::new(1024)
|
||||
[void][SearchArrowTest]::GetText($leftPath,0xD,$path.Capacity,$path)
|
||||
$path.ToString() -eq $step.Path
|
||||
})
|
||||
[void](Wait-Until {
|
||||
$highlight = Read-PanelHighlights $paintTrace $lineCount
|
||||
@($highlight.Keys -like '0/*').Count -gt 0
|
||||
})
|
||||
Start-Sleep -Milliseconds 150
|
||||
$draws = (Read-PanelHighlights $paintTrace $lineCount).Keys
|
||||
if ($draws -like '1/*') { throw "Opening $($step.Row) repainted rows in the other panel." }
|
||||
}
|
||||
Write-Output 'Verified folder navigation repaints only the panel that changes directories.'
|
||||
}
|
||||
$clicks=if(!$KeyboardCursorOnly){
|
||||
@(@{Panel=$leftPanel; Index=0},@{Panel=$rightPanel; Index=1},@{Panel=$rightPanel; Index=1})
|
||||
}
|
||||
@@ -319,22 +346,7 @@ try {
|
||||
Post $commandMenu 0x100 27
|
||||
[void](Wait-Until { ![SearchArrowTest]::IsWindowVisible($commandMenu) })
|
||||
Write-Output 'Verified Commands grouping, arrow navigation, and inert separators.'
|
||||
$panel = Wait-Until { $handle = [SearchArrowTest]::GetDlgItem($main,102); if ($handle -ne [IntPtr]::Zero) { $handle } }
|
||||
$pathControl = [SearchArrowTest]::GetDlgItem($main,142)
|
||||
$pathText = [Text.StringBuilder]::new(1024)
|
||||
[void][SearchArrowTest]::GetText($pathControl,0xD,$pathText.Capacity,$pathText)
|
||||
$path=$pathText.ToString()
|
||||
if ([IO.Path]::GetPathRoot($path) -ne [IO.Path]::GetPathRoot($scratch)) {
|
||||
throw 'Select a local left-panel folder on the test executable drive before running this interactive test.'
|
||||
}
|
||||
foreach ($component in $path.Substring(3).Split('\',[System.StringSplitOptions]::RemoveEmptyEntries)) {
|
||||
Select-Row $panel '..'
|
||||
[void][SearchArrowTest]::Send($panel,0x100,13,0)
|
||||
}
|
||||
foreach ($component in $scratch.Substring(3).Split('\')) {
|
||||
Select-Row $panel "[$component]"
|
||||
[void][SearchArrowTest]::Send($panel,0x100,13,0)
|
||||
}
|
||||
$panel = $leftPanel
|
||||
$fixtureRow=[SearchArrowTest]::SendText($panel,0x1A2,-1,([IO.Path]::GetFileName($fixture))).ToInt32()
|
||||
Click-PanelRow $panel $fixtureRow
|
||||
[void](Wait-Until { [SearchArrowTest]::Send($panel,0x188,0,0).ToInt32() -eq $fixtureRow })
|
||||
@@ -421,10 +433,10 @@ try {
|
||||
if (!(Test-Path -LiteralPath (Join-Path $scratch $newFolder) -PathType Container)) {
|
||||
throw 'F7 did not create the folder in the active panel.'
|
||||
}
|
||||
$newRow=[SearchArrowTest]::SendText($panel,0x1A2,-1,"[$newFolder]")
|
||||
if ($newRow.ToInt64() -lt 0 -or [SearchArrowTest]::Send($panel,0x188,0,0) -ne $newRow) {
|
||||
throw 'F7 did not select the new folder.'
|
||||
}
|
||||
[void](Wait-Until {
|
||||
$newRow=[SearchArrowTest]::SendText($panel,0x1A2,-1,"[$newFolder]")
|
||||
$newRow.ToInt64() -ge 0 -and [SearchArrowTest]::Send($panel,0x188,0,0) -eq $newRow
|
||||
})
|
||||
Post $main 0x111 115
|
||||
$makeDialog=Wait-Until { Find-Window '#32770' $process.Id 361 }
|
||||
$nameField=[SearchArrowTest]::GetDlgItem($makeDialog,361)
|
||||
@@ -526,6 +538,10 @@ try {
|
||||
!(Test-Path -LiteralPath (Join-Path $linkPath 'link-target.txt') -PathType Leaf)) {
|
||||
throw "F7 did not create a $expected pointing to Alpha."
|
||||
}
|
||||
[void](Wait-Until {
|
||||
$linkRow = [SearchArrowTest]::SendText($panel,0x1A2,-1,"[$linkName]")
|
||||
$linkRow.ToInt64() -ge 0 -and [SearchArrowTest]::Send($panel,0x188,0,0) -eq $linkRow
|
||||
})
|
||||
}
|
||||
Write-Output 'Verified F7 history, quoted batch names, and directory link handling.'
|
||||
Select-Row $panel ([IO.Path]::GetFileName($fixture))
|
||||
@@ -649,6 +665,7 @@ try {
|
||||
} finally { $bitmap.Dispose() }
|
||||
}
|
||||
|
||||
Select-Row $panel ([IO.Path]::GetFileName($fixture))
|
||||
Post $panel 0x100 0x73
|
||||
$editor=Wait-Until { Find-Window 'KSwitcher.Files.Text' $process.Id }
|
||||
$firstControl=[SearchArrowTest]::FindWindowEx($editor,0,'Scintilla',[System.Management.Automation.Language.NullString]::Value)
|
||||
@@ -684,8 +701,8 @@ try {
|
||||
if ([SearchArrowTest]::GetWindow($otherEditor,4) -ne [IntPtr]::Zero) { throw 'The second editor is owned.' }
|
||||
$editorIdentity=[SearchArrowTest]::TaskbarIdentity($editor)
|
||||
$otherIdentity=[SearchArrowTest]::TaskbarIdentity($otherEditor)
|
||||
if (!$editorIdentity -or !$otherIdentity -or $editorIdentity -eq $otherIdentity) {
|
||||
throw 'Editor windows do not have distinct Windows taskbar identities.'
|
||||
if ($editorIdentity -cne 'HrynCo.KSwitcher.Files.Editor' -or $otherIdentity -cne $editorIdentity) {
|
||||
throw 'Both editor windows must use the Editor group on the Windows taskbar.'
|
||||
}
|
||||
Post $otherEditor 0x10 0
|
||||
[void](Wait-Until { ![SearchArrowTest]::IsWindow($otherEditor) })
|
||||
|
||||
+26
-1
@@ -399,6 +399,25 @@ int main(int argc, char **argv)
|
||||
require(!supplemental.suggest(L"релызик ", 1, layouts, options),
|
||||
"never-correct list takes precedence over personal word");
|
||||
options.autoNever.clear();
|
||||
options.autoWords[L"en"] = {L"test-mt", L"dev-mt"};
|
||||
auto hyphenated = supplemental.suggest(L"Еуые-ье ", 1, layouts, options);
|
||||
require(hyphenated && hyphenated->text == L"Test-mt " && hyphenated->target == 0,
|
||||
"hyphenated personal word corrects from the wrong layout");
|
||||
options.autoMinLength = 2;
|
||||
require(!supplemental.suggest(L"ЙФ ", 2, layouts, options),
|
||||
"uppercase layout correction requires a personal dictionary entry");
|
||||
options.autoWords[L"en"].push_back(L"qa");
|
||||
auto acronym = supplemental.suggest(L"(ЙФ)! ", 2, layouts, options);
|
||||
require(acronym && acronym->text == L"(QA)! " && acronym->target == 0,
|
||||
"uppercase personal acronym corrects without changing case or punctuation");
|
||||
require(!supplemental.suggest(L"йФ ", 2, layouts, options),
|
||||
"mixed-case personal words remain protected");
|
||||
auto uppercaseHyphenated = supplemental.suggest(L"ЕУЫЕ-ЬЕ ", 1, layouts, options);
|
||||
require(uppercaseHyphenated && uppercaseHyphenated->text == L"TEST-MT ",
|
||||
"uppercase hyphenated personal words correct without changing case");
|
||||
options.autoMinLength = 3;
|
||||
require(!supplemental.suggest(L"ЙФ ", 2, layouts, options),
|
||||
"uppercase personal words respect minimum length");
|
||||
options.autoWords[L"uk"].push_back(L"робить");
|
||||
auto commaWord = supplemental.suggest(L"hj,bnm ", 0, layouts, options);
|
||||
require(commaWord && commaWord->text == L"робить " && commaWord->target == 2,
|
||||
@@ -739,7 +758,7 @@ int main(int argc, char **argv)
|
||||
settings.autoPrefixChars = L"(#";
|
||||
settings.autoSuffixChars = L");%";
|
||||
settings.autoNever = {L"myWord"};
|
||||
settings.autoWords = {{L"uk", {L"релізик"}}, {L"en", {L"kswitcher"}}};
|
||||
settings.autoWords = {{L"uk", {L"релізик"}}, {L"en", {L"kswitcher", L"test-mt", L"dev-mt"}}};
|
||||
settings.autoExcluded = {L"Code.exe"};
|
||||
settings.cycle = {L"en", L"uk"};
|
||||
settings.snippets = {{L";address", L"Line 1\r\n{cursor}Line 2"}};
|
||||
@@ -765,6 +784,12 @@ int main(int argc, char **argv)
|
||||
auto invalidWords = settings;
|
||||
invalidWords.autoWords[L"uk"] = {L"hello"};
|
||||
rejects([&] { ks::validateSettings(invalidWords); }, "personal dictionary rejects wrong language letters");
|
||||
for (const auto *word : {L"-test", L"test-", L"test--mt", L"test-і"})
|
||||
{
|
||||
invalidWords = settings;
|
||||
invalidWords.autoWords[L"en"] = {word};
|
||||
rejects([&] { ks::validateSettings(invalidWords); }, "personal dictionary rejects malformed hyphenated words");
|
||||
}
|
||||
require(ks::encodeSettings(ks::decodeSettings(ks::encodeSettings(settings), {})) == ks::encodeSettings(settings),
|
||||
"configurator snapshot survives serialization without changing the concurrency token");
|
||||
rejects([&] { ks::decodeSettings(ks::Bytes{'{', '}'}, {}); },
|
||||
|
||||
Reference in new issue
Block a user