InstantRst icon indicating copy to clipboard operation
InstantRst copied to clipboard

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

Open maaroen opened this issue 7 years ago • 11 comments

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:

  • Error occured while processing function startdaemon
  • Opening file Appdata\Local\xxxxx.tmp has failed
  • Error occured while processing function refreshview
  • Opening file xxxxx.tmp has failed

Could you help me to make this work?

maaroen avatar Feb 15 '18 16:02 maaroen

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

gu-fan avatar Feb 17 '18 10:02 gu-fan

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

maaroen avatar Feb 18 '18 14:02 maaroen

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

maaroen avatar Feb 19 '18 09:02 maaroen

...

gu-fan avatar Feb 19 '18 14:02 gu-fan

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

maaroen avatar Feb 19 '18 20:02 maaroen

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

gu-fan avatar Feb 20 '18 00:02 gu-fan

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.

maaroen avatar Feb 20 '18 08:02 maaroen

well...

gu-fan avatar Feb 25 '18 07:02 gu-fan

Were you able to find a reason for this ?

maaroen avatar Mar 01 '18 10:03 maaroen

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

gu-fan avatar Mar 02 '18 08:03 gu-fan

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.

unicell avatar Mar 12 '20 21:03 unicell