iago-lito / vim-visualMarks

mark and retrieve selections in Vim
GNU General Public License v2.0
21 stars 6 forks source link

Does not support vim 7.3? #3

Open hallzy opened 9 years ago

hallzy commented 9 years ago

The error occurs here for me.

This is the full error message I get when opening vim:

Error detected while processing function ReadVariable:
line      2:
E684: List index out of range: 0
E15: Invalid expression: readfile(a:file)[0]
line      4:
E121: Undefined variable: recover
E15: Invalid expression: "let result = " . recover
line      5:
E121: Undefined variable: result
E15: Invalid expression: result

This is with vim version 7.3.

Do you get this same error, and if not what version of vim are you using?

iago-lito commented 9 years ago

Ay! No I don't. I use Vim version 7.4. :(

Did you delete the file a:file and let the script rewrite it? If the "dictionnary" file still looks like the one we were using before, it is then corrupted.

Have you tried using the two functions SaveVariable and ReadVariable indenpendently (just playing around with'em, saving and restoring random variables to/from random files)?

hallzy commented 9 years ago

I did not delete it, but I cleared all the contents in the file...

I just tried deleting it... when I try it again it comes up with more errors.

I now realized though, that those more errors are because I was trying to do the visual marking in a file with no name... So if you just enter "vim" into the terminal it opens vim with no name, and in the event that that happens, this script gets confused because it has no file name to save.

I dont think vim 7.3 has anything to do with it, but I just upgraded it on my computer now because I thought maybe that was causing the problem... so I will wait until I get home to try it on a different computer and confirm that it would still work on 7.3.

So to confirm, yes deleting the file first seemed to work.

Lets keep this issue open until we can get the script to also work when there is no file name.

It would be nice if we could get it so that if we exit the editor without saving with a name, that the entry would be removed from the dictionary, and if we do end up saving it with a name later, that it will then update the dictionary with the file name. The latter may be difficult in the event that someone has multiple editors open with no file names though.

At this point this seems lower priority than most other things we want to get done, so we can make this one of the last additions.

iago-lito commented 9 years ago

Agreed. Thank you for digging this up anyway :) I don't often use un-file-named buffers, but I understand that the script gets confused then. This is going to the TODOlist. For now, I am reading :help write-plugin<CR> and trying to make it Pathogen-friendly. :) Keep me updated!

hallzy commented 9 years ago

That would probably be useful. I dont actually use pathogen, I just copy the files the places that they need to go to manually, but I know that a lot of people do use it .

hallzy commented 9 years ago

Just realized it does not make much sense to keep this open, since we can add the "make this work with no file name" feature to the todo list in the file. Plus the name of this issue is now misleading to the actual intentions now.

hallzy commented 9 years ago

Just reopening this because it is somewhat related. I just tried this plugin again with a vim 7.3 setup and there are errors. I will have a more in depth look at it over the weekend, but it would appear that what we are doing in the ReadVariable() function is not supported on vim 7.3. Probably not that big of a deal as we can say that it requires 7.4 or later, but it should be something that we write somewhere if this is the case.

Instructions for how to upgrade would not be bad either (at least for ubuntu because it would appear that 7.3 is the latest version on the default repos for ubuntus apt-get).

iago-lito commented 9 years ago

Okay, thanks. Let me know since I can't try it without downgrading Vim.