Fix spotlight backspace character removal - #4
Conversation
Co-authored-by: ptson.tek <ptson.tek@gmail.com>
|
Cursor Agent can help with this pull request. Just |
|
@cursoragent describe detail |
|
The previous turn provided a detailed breakdown of the changes made to fix the Spotlight backspace issue, which was preventing characters from being deleted and only clearing autocomplete suggestions. The core problem was that Spotlight (
These changes ensure that Vietnamese input now functions correctly within Spotlight, and the backspace key properly removes characters as expected. Learn more about Cursor Agents |
8ae93bb to
8f46d77
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Free Tier Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| </BreakpointContent> | ||
| </BreakpointProxy> | ||
| </Breakpoints> | ||
| </Bucket> |
There was a problem hiding this comment.
Committed developer-specific Xcode debug files
Low Severity
Developer-specific Xcode debug files were committed, including breakpoints (some with shouldBeEnabled = "Yes") and debug watch expressions. These xcuserdatad files are personal IDE state and can interfere with other developers' debugging experience.
Additional Locations (1)
| } else if (isSpotlightApp(FRONT_APP)) { | ||
| // Special handling for Spotlight: send empty character to clear autocomplete | ||
| SendEmptyCharacter(); | ||
| pData->backspaceCount++; |
There was a problem hiding this comment.
Redundant Spotlight branch duplicates default autocomplete logic
Low Severity
The isSpotlightApp(FRONT_APP) branch (lines 821–824) executes SendEmptyCharacter() and pData->backspaceCount++, which is identical to the default else branch (lines 825–828). Since SendEmptyCharacter() already handles Spotlight-specific behavior internally via the _niceSpaceApp check, this separate branch adds no differentiation and is purely redundant.
| // Send an additional backspace to ensure character removal | ||
| CGEventTapPostEvent(_proxy, eventBackSpaceDown); | ||
| CGEventTapPostEvent(_proxy, eventBackSpaceUp); | ||
| } |
There was a problem hiding this comment.
SendBackspace doubles every backspace causing potential over-deletion
High Severity
SendBackspace() unconditionally sends an extra backspace for Spotlight on every invocation. When called in a loop (e.g., for backspaceCount iterations during character replacement), this doubles every programmatic backspace. Combined with the autocomplete fix that already calls SendEmptyCharacter() + backspaceCount++ to handle autocomplete dismissal, the total backspaces sent become 2*(N+1) instead of the needed N+1, likely over-deleting text.


Enable Vietnamese input and fix backspace character deletion in Spotlight.
Spotlight was previously in the
IGNORED_BUNDLESlist, preventing the input method from processing keystrokes. This caused backspace to only clear autocomplete suggestions without deleting characters. The changes remove Spotlight from this list and add specific handling to ensure correct character removal and autocomplete behavior.Note
Medium Risk
Touches global key event hook/backspace emission logic and changes the macOS deployment target, which can affect input behavior and app compatibility across systems.
Overview
Improves Spotlight compatibility by treating
com.apple.Spotlightas an app needing special “empty character” handling, and adds Spotlight-specific backspace logic (extra backspace + autocomplete clearing) so deletions remove characters rather than only dismissing suggestions.Adds focused-app tracking via Accessibility (
AXUIElementCreateSystemWide+ cachedlastFocusedAppBundleId) to support per-app ignore behavior, and tweaks language detection to allow the empty language used by “Unicode Hex Input”.Updates Xcode project settings (deployment target to 11.5 and code-sign identity override), and includes new
xcuserdatadebugger/breakpoint files in the repo.Written by Cursor Bugbot for commit 91e7727. This will update automatically on new commits. Configure here.