[READ-ONLY] Mirror of https://github.com/probablykasper/remind-me-again. Toggleable cron reminders app for Mac, Linux and Windows
linux macos notifications reminder tauri windows
0

Configure Feed

Select the types of activity you want to include in your feed.

Fix cron segment highlighting

It didn't completely highlight multi-character segments

Kasper (Dec 9, 2022, 2:26 AM +0100) 49adbcef e3a26847

+11 -5
+1
CHANGELOG.md
··· 2 2 3 3 ## Next 4 4 - Add `Escape` shortcut for closing the window 5 + - Fix cron segment highlighting 5 6 6 7 ## 1.0.2 - 2022 Nov 4 7 8 - Fix tray icon button (and maybe Linux)
+10 -5
src/lib/Edit.svelte
··· 18 18 return 19 19 } 20 20 const segmentMatches = [...group.cron.matchAll(/\S+/g)] 21 + const start = cronInput.selectionStart 22 + const end = cronInput.selectionEnd 23 + if (start === null || end === null) { 24 + return 25 + } 26 + 21 27 let i = 0 22 28 for (const segmentMatch of segmentMatches) { 23 - const segment = segmentMatch.index 24 - const start = cronInput.selectionStart 25 - const end = cronInput.selectionEnd 26 - if (segment === undefined || start === null || end === null) { 29 + const segmentStart = segmentMatch.index 30 + if (segmentStart === undefined) { 27 31 continue 28 32 } 29 - if (segment >= start - 1 && segment <= end) { 33 + const segmentEnd = segmentStart + segmentMatch[0].length 34 + if (start <= segmentEnd && end >= segmentStart) { 30 35 selectedSegments.push(i) 31 36 } 32 37 i++