gu-fan / InstantRst

instant rst preview in browser
106 stars 16 forks source link

Running :InstantRst gives the error that it can't open a .tmp file #20

Open maaroen opened 6 years ago

maaroen commented 6 years ago

When I run the :InstantRst command from a RST file I get the following error messages: image

Sorry for it being in dutch, but it means:

Could you help me to make this work?

gu-fan commented 6 years ago

I need to make a tmp file in your tmp directory, can you open that directory?

maaroen commented 6 years ago

Yea the directory is available but It still gives the same error message.

maaroen commented 6 years ago

It looks like it tries to open the tempfile with the wrong name. Because I see a tempfile being created, but in the error messages it says it looks for a different file.

For example: This file gets created: VI0001.tmp And the error says the following: Could not open file VI201250.tmp

gu-fan commented 6 years ago

...

maaroen commented 6 years ago

Do you have any idea why this is happening? I would like to use this plugin because it looks awesome if it works.

gu-fan commented 6 years ago

https://github.com/gu-fan/InstantRst/blob/96f37682deadd093953a1d424000434461042756/after/ftplugin/rst/instantRst.vim#L123

you can check with :echo tempname() if it return a right filename

maaroen commented 6 years ago

Yea it does: image

I've even put echos in the instantRst.vim file to see what the filename is that it wants to process, and it is the same filename as that is made on disk, but when it executes the command. It still gives a different name.

gu-fan commented 6 years ago

well...

maaroen commented 6 years ago

Were you able to find a reason for this ?

gu-fan commented 6 years ago

https://github.com/gu-fan/InstantRst/blob/96f37682deadd093953a1d424000434461042756/after/ftplugin/rst/instantRst.vim#L126

No, you can try yourself, check if it's the right name when writing file

add echo b:ir_tmpfile before that line

unicell commented 4 years ago

Run into the same, and https://github.com/gu-fan/InstantRst/pull/22 fixes it.

Besides, since instant-rst is in Python3, had to use pip3 install https://github.com/Rykka/instant-rst.py/archive/master.zip as I have both pip (python2) and pip3 (python3) in my system.