artempyanykh/marksman

Fail to create file or go to definition on a wiki link when its aboslute path contains an accented character

EdualcLaiv opened this issue · 4 comments

Context

  • OS: Windows 11
  • Editor: Helix
  • Marksman Version: 2023-11-29 release
  • wiki.style = "file-stem"

I didn't try with a different OS or editor.

How to reproduce

Problem 1

  • When editing a file, trying to perform a code action to create a file crashes Helix if its wiki link contains an accented character.
    • For example on [[foobàr]] or [[tést]]

Problem 2

  • Manualy create a file in your project folder. Its absolute path must contain an accented character (either its name or one of its parent folders).
    • For example, let's create a activité.md file.
  • From Helix, create a wiki link to this file, like [[activité]]
    • Note : auto-completion does work despite the accent in the file's name/path.
  • Try to go to definiton (g and then d on Helix)

image
image

Note: go to definition from a wiki link to a heading containing an accented character, like [[test#activité]] works fine.

my .marksman.toml file

[core]
markdown.file_extensions = ["md", "markdown"]
text_sync = "full"
incremental_references = false
paranoid = false

[code_action]
toc.enable = true
create_missing_file.enable = true

[completion]
wiki.style = "file-stem"

Thanks for reporting this @EdualcLaiv! Looks like the issue was due to wrong encoding of accented characters. #281 should address the issue. I didn't test on Windows but MacOS + helix now works.

The fix will go into the next release.

I can confirm the fix works on my config. :)