File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -283,6 +283,12 @@ export class CaptureChoiceEngine extends QuickAddChoiceEngine {
283283 | { kind : "tag" ; tag : string }
284284 | { kind : "folder" ; folder : string }
285285 | { kind : "file" ; path : string } {
286+ // Resolution order:
287+ // 1) empty => vault picker
288+ // 2) #tag => tag picker
289+ // 3) trailing "/" => folder picker (explicit)
290+ // 4) ".md" => file
291+ // 5) ambiguous => folder if it exists and no same-name file exists; else file
286292 const normalizedCaptureTo = this . stripLeadingSlash (
287293 formattedCaptureTo . trim ( ) ,
288294 ) ;
@@ -309,10 +315,8 @@ export class CaptureChoiceEngine extends QuickAddChoiceEngine {
309315 return { kind : "file" , path : normalizedCaptureTo } ;
310316 }
311317
312- const fileCandidatePath = this . normalizeMarkdownFilePath (
313- "" ,
314- folderPath ,
315- ) ;
318+ // Guard against ambiguity where a folder and file share the same name.
319+ const fileCandidatePath = this . normalizeMarkdownFilePath ( "" , folderPath ) ;
316320 const fileCandidate = this . app . vault . getAbstractFileByPath (
317321 fileCandidatePath ,
318322 ) ;
You can’t perform that action at this time.
0 commit comments