Compare commits

..

3 Commits

Author SHA1 Message Date
Gordon Lam
5c677c3046 Merge branch 'main' into copilot/fix-36216 2026-01-31 08:01:19 -08:00
copilot-swe-agent[bot]
02ea538eb3 Fix New+ context menu not showing folders with only numbers
Co-authored-by: yeelam-gordon <73506701+yeelam-gordon@users.noreply.github.com>
2025-08-29 07:08:17 +00:00
copilot-swe-agent[bot]
2481374209 Initial plan 2025-08-29 07:01:14 +00:00
2 changed files with 13 additions and 3 deletions

View File

@@ -60,8 +60,18 @@ std::wstring template_item::get_target_filename(const bool include_starting_digi
std::wstring template_item::remove_starting_digits_from_filename(std::wstring filename) const
{
filename.erase(0, std::min(filename.find_first_not_of(L"0123456789"), filename.size()));
filename.erase(0, std::min(filename.find_first_not_of(L" ."), filename.size()));
// Find first non-digit character
size_t first_non_digit = filename.find_first_not_of(L"0123456789");
// If the string consists only of digits, don't remove anything
if (first_non_digit == std::wstring::npos)
{
return filename;
}
// Otherwise, remove starting digits as before
filename.erase(0, std::min(first_non_digit, filename.size()));
filename.erase(0, min(filename.find_first_not_of(L" ."), filename.size()));
return filename;
}

View File

@@ -147,7 +147,7 @@ namespace CentralizedKeyboardHook
.win = (GetAsyncKeyState(VK_LWIN) & 0x8000) || (GetAsyncKeyState(VK_RWIN) & 0x8000),
.ctrl = static_cast<bool>(GetAsyncKeyState(VK_CONTROL) & 0x8000),
.shift = static_cast<bool>(GetAsyncKeyState(VK_SHIFT) & 0x8000),
.alt = (GetAsyncKeyState(VK_MENU) & 0x8000) || (GetAsyncKeyState(VK_LMENU) & 0x8000) || (GetAsyncKeyState(VK_RMENU) & 0x8000),
.alt = static_cast<bool>(GetAsyncKeyState(VK_MENU) & 0x8000),
.key = static_cast<unsigned char>(keyPressInfo.vkCode)
};