Skip to content
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.

data_dir saves the absolute path #83

Open
gcstr opened this issue Dec 29, 2022 · 0 comments
Open

data_dir saves the absolute path #83

gcstr opened this issue Dec 29, 2022 · 0 comments

Comments

@gcstr
Copy link

gcstr commented Dec 29, 2022

I sync some folders between machines and I'd like to be able to do that with mind files as well.
The issue is that mind expands the persistence location to an absolute path in the json file.

My config has

  require('mind').setup({
    persistence = {
      state_path = vim.fn.expand('~') .. "/Sync/mind.json",
      data_dir = vim.fn.expand('~') .. "/Sync/mind",
    },
  })

resulting to

{
	"tree": {
		"is_expanded": true,
		"children": [{
			"is_expanded": true,
			"children": [{
				"is_expanded": true,
				"children": [{
					"is_expanded": true,
					"data": "\/home\/gcstr\/Sync\/mind\/20221226232901-notes.md",
					"contents": [{
						"text": "Notes"
					}]
				}],
...

This renders my mind files unusable on Mac.

Maybe we could move the expansion to the line when the arg is read:
https://github.com/phaazon/mind.nvim/blob/42726da19eac75ac373aca4424dcc5536a14a54b/lua/mind/init.lua#L91

Instead of writing the expanded path here:

https://github.com/phaazon/mind.nvim/blob/a8de4150143cba275bccdd6a184ebb5650a5f377/lua/mind/state.lua#L12

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant