From 8b3fe947a67679f36053b94aa70409089af795ac Mon Sep 17 00:00:00 2001 From: Anatolii Hrynchuk Date: Sat, 21 Nov 2026 23:56:17 +0200 Subject: [PATCH] Release KSwitcher v0.6.127 (#73) Confirm a single snippet suggestion with Enter before the focused application receives the key. --- CMakeLists.txt | 2 +- README.md | 9 +++++---- Release/README.md | 10 +++++++++- Release/SHA256SUMS.txt | 2 +- Release/release-files.json | 18 +++++++++--------- resources/app.rc | 6 +++--- src/app.cpp | 3 ++- src/update.h | 2 +- tests/integration.cpp | 21 ++++++++++++++++++++- 9 files changed, 51 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b10506..69b406c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.24) -project(KSwitcher VERSION 0.6.126 LANGUAGES CXX RC) +project(KSwitcher VERSION 0.6.127 LANGUAGES CXX RC) if(NOT WIN32) message(FATAL_ERROR "KSwitcher uses native Windows APIs") endif() diff --git a/README.md b/README.md index 86ff664..daa9b46 100644 --- a/README.md +++ b/README.md @@ -461,10 +461,11 @@ Recognition uses Chrome accessibility: the address bar and active document must ### Snippet autocomplete — v0.6.69 -Starting with v0.6.71, **Enter** accepts a suggestion after you navigate -the list with **↑ / ↓**. Without arrow navigation, **Enter** goes to the -editor. З v0.6.71 **Enter** після вибору стрілками вставляє сніпет. Без -переміщення списком **Enter** надходить до редактора. +**Enter** accepts a single visible suggestion directly. When several suggestions +are visible, navigate the list with **↑ / ↓** to select one for **Enter**. + +**Українською.** **Enter** одразу підтверджує єдину видиму підказку. Якщо +підказок кілька, виберіть потрібну стрілками **↑ / ↓**, а тоді натисніть **Enter**. Starting with v0.6.70, suggestions open at the text caret. If the editor provides no caret position, you can still type the complete trigger to diff --git a/Release/README.md b/Release/README.md index 01f8a1d..b58064f 100644 --- a/Release/README.md +++ b/Release/README.md @@ -1,6 +1,14 @@ # Latest Windows release -## v0.6.126 — 2026-11-21 +## v0.6.127 — 2026-11-21 + +When the snippet popup shows one match, pressing Enter expands it immediately and consumes the key. With several matches, use the arrow keys and then press Enter to confirm. + +**Українською.** + +Якщо у списку підказок є один збіг, Enter одразу розгортає сніпет. KSwitcher перехоплює це натискання. Якщо збігів кілька, виберіть потрібний стрілками й підтвердьте через Enter. + +## v0.6.126 — 2026-11-21 (withdrawn / відкликано) Snippet macros send the configured keys at the position where they appear. `$skill{pause:500}{enter} Draft text` types the name, waits 500 milliseconds, presses Enter once, then types the remaining text. The focused application handles each key. diff --git a/Release/SHA256SUMS.txt b/Release/SHA256SUMS.txt index 6b53f89..e36b700 100644 --- a/Release/SHA256SUMS.txt +++ b/Release/SHA256SUMS.txt @@ -1 +1 @@ -6d948270b424483b3923e3f15b6e97f0aa6de8ab9038f91a8b8d92af3b45e4fc KSwitcher-win-x64.zip +da1e6b22619b9a9c32ec5b2d131055a96d2b60c185936ec65cdb160eae839979 KSwitcher-win-x64.zip diff --git a/Release/release-files.json b/Release/release-files.json index ac76355..b776a61 100644 --- a/Release/release-files.json +++ b/Release/release-files.json @@ -1,25 +1,24 @@ { - "version": "0.6.126", "files": [ { "path": "KSwitcher.exe", "size": 2491904, - "sha256": "03834ebd6f64d04e483d07b4cabff23a8a6d7a0fcb4b20a29dddb7f382951afb" + "sha256": "cc43f9fc566047f29cded8d1fff3f044150e3657add7b355ff97510a9672b879" }, { "path": "KSwitcher.Config.exe", "size": 2462720, - "sha256": "255762c1fa98b8e01de66794c5870c939e7beaa9115e0ff3d32a89a254be68b0" + "sha256": "10240cdf03cbf9f197b783a18df79c6ef3975d7f193137a3f7f0290d74f79b67" }, { "path": "KSwitcher.Screenshot.exe", "size": 3063808, - "sha256": "e2254ce28a2e943530c0307be84706639d1bb3eb097479c2beae6c4f37724555" + "sha256": "b2ad1f46b1562add9be160c83dd959a497ed75fcc3a59aecb3278edccb98cfdd" }, { "path": "KSwitcher.Files.exe", "size": 4377088, - "sha256": "6e28d6bc10b10f16a71fef06730c5c0d25f2e66ada1d8c77b131f0451321520b" + "sha256": "5e56dc39311287534486d85f67bd2cc48e41b0e9da717ddbcfd3228ad28e9719" }, { "path": "WebView2Loader.dll", @@ -108,8 +107,8 @@ }, { "path": "README.md", - "size": 98985, - "sha256": "755b91fa671fbaee2d4336e22538997dd3ba6fddd9df01471ba6b74f38edfa83" + "size": 99061, + "sha256": "bb045f8b3a47734b21c5aad830ec43bbc13f209ccd29d923de812fe0b5086d56" }, { "path": "LAN-PREVIEW.md", @@ -154,7 +153,7 @@ { "path": "tools/StayHere.exe", "size": 133120, - "sha256": "50ff530d296956cc31f2310bcc4215ea47f7ffb2cf7d7ab07e24bf56fdc6d60c" + "sha256": "65f2b3787eabd5412bfd96df78ff3500e18ba634655082bf817194a85d592c1d" }, { "path": "tools/StayHere-README.md", @@ -162,5 +161,6 @@ "sha256": "ba214e2aca7405e698b3ab21ceb1f41ce088edd996b3e30e4a9d58ff496f9413" } ], - "schema": 1 + "schema": 1, + "version": "0.6.127" } diff --git a/resources/app.rc b/resources/app.rc index fcaca14..8432796 100644 --- a/resources/app.rc +++ b/resources/app.rc @@ -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,126,0 - PRODUCTVERSION 0,6,126,0 + FILEVERSION 0,6,127,0 + PRODUCTVERSION 0,6,127,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.126" + VALUE "FileVersion", "0.6.127" END END BLOCK "VarFileInfo" diff --git a/src/app.cpp b/src/app.cpp index 5fb3e81..55a5a60 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -1571,7 +1571,8 @@ void App::selectSnippet(size_t row) } bool App::handleSnippetKey(DWORD vk, UINT mods) { - const bool accept = vk == VK_TAB || (vk == VK_RETURN && snippetNavigated); + const bool accept = vk == VK_TAB || + (vk == VK_RETURN && (snippetNavigated || snippetMatches.size() == 1)); if (mods || (!accept && vk != VK_UP && vk != VK_DOWN && vk != VK_ESCAPE) || !snippetPopup || !IsWindowVisible(snippetPopup) || !snippetPopupCurrent()) return false; diff --git a/src/update.h b/src/update.h index 6555e97..5790f6b 100644 --- a/src/update.h +++ b/src/update.h @@ -2,7 +2,7 @@ #include "platform.h" namespace ks { -inline constexpr wchar_t AppVersion[] = L"0.6.126"; +inline constexpr wchar_t AppVersion[] = L"0.6.127"; inline constexpr UINT UpdateMessage = WM_APP + 7; inline constexpr UINT UpdateCheckIntervalMs = 6 * 60 * 60 * 1000; inline constexpr UINT UpdateNotificationRetryMs = 5 * 60 * 1000; diff --git a/tests/integration.cpp b/tests/integration.cpp index ba5b232..eb7fe70 100644 --- a/tests/integration.cpp +++ b/tests/integration.cpp @@ -14,6 +14,7 @@ struct InputRegressionAccess { return app.snippetPopup && IsWindowVisible(app.snippetPopup); } + static size_t suggestionCount(const App &app) { return app.snippetMatches.size(); } static bool suggestionsNearCaret(const App &app) { GUITHREADINFO info{sizeof(info)}; @@ -740,10 +741,28 @@ LRESULT CALLBACK procedure(HWND w, UINT msg, WPARAM wp, LPARAM lp) case 73: require(enterPresses == 1 && text() == L"prefix ;qz\r\n" && !ks::InputRegressionAccess::suggestionsVisible(*app), - "Enter without arrow navigation reaches the editor"); + "Enter reaches the editor while multiple suggestions await navigation"); + prepare(L"prefix ", false); + typeKeys({VK_OEM_1, 'Q', 'Z', VK_OEM_MINUS, 'S'}); + stage = 75; + break; + case 75: + require(ks::InputRegressionAccess::suggestionsVisible(*app) && + ks::InputRegressionAccess::suggestionCount(*app) == 1, + "a filtered prefix leaves one visible suggestion"); + enterPresses = 0; + typeKeys({VK_RETURN}); + break; + case 76: + require(text() == L"prefix second" && enterPresses == 0 && + !ks::InputRegressionAccess::suggestionsVisible(*app), + "Enter accepts the only suggestion without arrows or forwarding the key"); + require(ks::readClipboard(app->window).text() == sentinel, + "accepting a single suggestion restores the clipboard"); app->resetInput(); SetFocus(host); typeKeys({VK_OEM_1}); + stage = 74; break; case 74: if (ks::InputRegressionAccess::findingSuggestionCaret(*app))