bling / fzf.el

A front-end for fzf
GNU General Public License v3.0
369 stars 50 forks source link

Resolve symlinks in the base vcs command #117

Closed rails-to-cosmos closed 1 month ago

rails-to-cosmos commented 1 year ago

Modified the code to determine the true root directory. By using file-truename on default-directory, we resolve any symlinks, ensuring we get the actual physical location even if we're currently within a symlinked directory.

Example Scenario:

  1. Dotfiles are version-controlled in the '~/sync' directory.
  2. A symlink '~/.emacs.d' is created from '~/sync/.../emacs-configuration'.
  3. If the default-directory is set under '~/.emacs.d', the original function fails to find the project root, as it doesn't resolve the symlink and searches within the symbolic link's hierarchy.

This patch fixes this behavior by ensuring we search the actual physical location by resolving any symlinks with file-truename.

pierre-rouleau commented 12 months ago

Hi @rails-to-cosmos , in your submitted code, should you not use a let* form instead of a let form? The let* form allows each VALUEFORM to refer to the symbols bound by the previous ones, but not the let form.

rails-to-cosmos commented 12 months ago

Hey @pierre-rouleau, thank you! Sure, let* should work properly now.

pierre-rouleau commented 1 month ago

@bling You can bring this in.