persisted.nvim/lua/persisted
Christopher Speck 97bc6260fb
fix: properly resolve directories (#105)
* fix: properly resolve directories

The `vim.loop.fs_realpath()` function can be used to properly resolve
both the `.` shortcut as well as relative paths. This corrects scenarios
when opening nvim to a subdirectory of the working directory. With this
change doing so will properly resolve the session file to the directory
that was specified on the command line.

```console
$ pwd
/Users/username/.config

$ ls
fish    iterm2    nvim

$ nvim nvim
```

This will result in using the path `/Users/username/.config/nvim` for
the session. The behavior will be the same as running plain `nvim` from
within the `/Users/username/.config/nvim` directory itself.

This change also quotes the path passed to `git` to properly handle
paths containing spaces.

This change also corrects some typos in the readme.

* fix: isdirectory is not necessary

The fs_realpath function will return nil if the path doesn't exist.

* fix: typos in comments

* fix: isdirectory is still necessary

Oops, the isdirectory check is necessary to confirm it's a directory and
not a file.
2023-12-22 15:53:31 +00:00
..
config.lua refactor!: do not append `main` to non-git repo sessions 2023-12-20 12:47:51 +00:00
deprecate.lua refactor: remove deprecations 2023-03-09 09:41:22 +00:00
init.lua fix: properly resolve directories (#105) 2023-12-22 15:53:31 +00:00
utils.lua feat: make more data available when firing events 2023-12-21 16:52:30 +00:00