Skip to content

fix: editor command splitting and merge conflict detection#2

Open
sulthonzh wants to merge 1 commit into
mainfrom
fix/editor-merge-detection
Open

fix: editor command splitting and merge conflict detection#2
sulthonzh wants to merge 1 commit into
mainfrom
fix/editor-merge-detection

Conversation

@sulthonzh

Copy link
Copy Markdown
Owner

Fixes

1. Editor command with arguments breaks spawn

openInEditor() passed the entire EDITOR string as a single command to spawn(). Commands like code --wait or subl -w --new-window would fail because spawn('code --wait', [file]) tries to execute a binary literally named "code --wait".

Fix: Split the editor string on whitespace, use first token as command and rest as initial args.

2. isMergeInProgress misses most conflict states

Only checked for index code 'U', but git uses many two-letter codes for unmerged entries: AA (both added), DD (both deleted), AU, DU, UD, UA.

Fix: Check for any index code containing U, A, or D (the unmerged indicators).

- Fix editor spawn to handle commands with args (e.g. 'code --wait')
  Previously passed entire string as command, breaking multi-word editors
- Fix isMergeInProgress to detect all unmerged status codes
  Only checked 'U' index, missing AA, DD, AU, DU, UD, UA states
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant