Skip to content

deft--org-complete is generating broken links #117

@gabrielhidasy

Description

@gabrielhidasy

The current implementation for deft--org-complete selects 'file' from (deft-find-all-files-no-prefix) and concats "deft:" and with (substring file 1)`, but file is already the file name, so it is removing the first character and making an invalid link.

(defun deft--org-complete ()
  (let ((file (completing-read "file" (deft-find-all-files-no-prefix))))
    (concat "deft:" (substring file 1))))

This can be fixed by removing (substring file 1), and for a bit more clarity replacing "file" with "file: " looks a bit better

(defun deft--org-complete ()
  (let ((file (completing-read "file: " (deft-find-all-files-no-prefix))))
    (concat "deft:" file)))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions