Properly starts sessions loaded from another directory using Telescope.
Crucially, this version compares the working directory of the session, not
the working directory at the time of the session load, to the lists
of allowed and ignored directories.
Co-authored-by: Oli <olimorris@users.noreply.github.com>
* fix: TestFollowCwd
* fix: follow_cwd not actually working
cause: `follow_cwd and nil or session` always use `session` because the
`true and nil` expression is evaluated to false
* feat: add icons and colors to telescope picker
* feat: add configuration options for telescope icons
* fix: remove highlight group for telescope normal selection
* 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.