8000 `data_dir` saves the absolute path · Issue #83 · hadronized/mind.nvim · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Mar 22, 2023. It is now read-only.
This repository was archived by the owner on Mar 22, 2023. It is now read-only.
data_dir saves the absolute path #83
Open
@gcstr

Description

@gcstr

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

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

      0