artempyanykh / marksman

Write Markdown with code assist and intelligence in the comfort of your favourite editor.
MIT License
1.98k stars 35 forks source link

Wiki link to local file without a heading should not be dectected as "anbiguous" and error out. #319

Open unifreak opened 3 months ago

unifreak commented 3 months ago

(Firstly, thanks for this amazing software!)

Problem:

I'm using Emacs with Eglot. Say I have a file another-note.md, and when referencing it as [[another-note]], marksman will detect it as "ambiguous", when doing goto-definition on it, Emacs will open up a xref buffer showing a list of available headings for jump, instead of just open up that file.

This conflict with marksmans documentation here:

  • Wiki-links:
    Link to [[another-note]].
    Link to [[another-notes#heading]].
    Internal link to [[#a-heading]].

I also tried [[another-note.md]], [[another-note#]] , [[./another-note.md]], all are treated as "ambiguous".

The related issues might be: #177 #310 .

artempyanykh commented 3 months ago

@unifreak does you file have several level-1 headings, e.g.:?

# Heading 1
blabla

# Heading 2
blabla

Level 1 heading is considered a title and is expected to be unique in a document.

unifreak commented 3 months ago

@artempyanykh You're right, I do have multiple level-one headings in other-note, didn't realize this is a markdown syntax issue. But can we have this: for [[another-note]], just open that file at beginning? I don't want the headings nested too much.

Anyway, now I know it's not an issue of marksman, I can just adjust my note's structure. Thanks!