display_relative_filename causes files to be stored relative?! #30

Closed
blueyed opened this Issue Jan 11, 2013 · 3 comments

Comments

Projects
None yet
2 participants
Contributor

blueyed commented Jan 11, 2013

It seems like display_relative_filename also causes the filename to be stored relative?!

At least I just tried to open a file, and got this error:

TMRU: File not readable: ../../[...]/.lvimrc

FWIW, I am using g:tlib#input#format_filename='l' (default), since it seemed to work (despite the doc saying that "r" is required for displaying the relative filename).

Owner

tomtom commented Jan 11, 2013

It seems like |display_relative_filename| also causes the filename to
be stored relative?!

No it's only displayed as relative filename. You can check by :exec 'e'
g:tmru_file

At least I just tried to open a file, and got this error:

|TMRU: File not readable: ../../[...]/.lvimrc|
|Does the file exist? Is the filename correct? I'd rather assume that
tlib's tlib#file#Relative() function doesn't work properly. If you find
a problem in that function, please also tell me if you use the current
version on github.|

Contributor

blueyed commented Jan 14, 2013

I am using the latest version of tlib/tmru and could reproduce it as follows:

* edit .lvimrc in /foo/bar/baz (which is a symlink)
* use TMRU to open that file from another directory (the path to it is displayed relative (../../...))
* use TMRU again to open the file again (this time there is no relative path, since the file is being edited already)
* TMRU fails:
  TMRU: File not readable: /path/to/pwd/.lvimrc
    TMRU: original filename: .lvimrc

Your guess about tlib#file#Relative() being buggy is probably right then.
Let me know if I can provide more information.

Owner

tomtom commented Jan 14, 2013

Well, it seems that I used the wrong base directory. tmru currently uses the buffer's dir, which is ok if autochdir is set.

@tomtom tomtom closed this in 60e08b9 Jan 14, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment