Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when saving markdown file #15

Closed
zarry opened this issue Aug 7, 2015 · 14 comments
Closed

Error when saving markdown file #15

zarry opened this issue Aug 7, 2015 · 14 comments

Comments

@zarry
Copy link

zarry commented Aug 7, 2015

The error I receive when saving a markdown file is below. I installed via vundle. My .vimrc

Config specific to plugin

let vim_markdown_preview_browser='Google Chrome'
let vim_markdown_preview_temp_file=1
let vim_markdown_preview_toggle=2
let vim_markdown_preview_github=1

I am also using grip

% pip list | grep grip
grip (3.3.0)
Error detected while processing function Vim_Markdown_Preview_Local:
line   17:
E121: Undefined variable: b:vim_markdown_preview_github
E15: Invalid expression: b:vim_markdown_preview_github == 1
line   41:
E121: Undefined variable: b:vim_markdown_preview_temp_file
E15: Invalid expression: b:vim_markdown_preview_temp_file == 1 

Any help would be great!

@JamshedVesuna
Copy link
Owner

I'm having some trouble reproducing this. Can you pull the latest commits and see if the error persists?

To get more context:

  1. What operating system are you using?
  2. What version of vim are you on?
  3. What happens if you remove all the buffer specific parts of the variables in question? For example, remove the b: before the variables in your error.

Thanks!

@JamshedVesuna
Copy link
Owner

Hey @zarry are you using any of the provided vim-markdown-preview options? If so, let me know.

@jmgregory
Copy link

I found this problem went away when I surrounded the equals signs with space characters

@perrygeo
Copy link

I can reproduce this error on OS X Yosemite, vim 7.4, installed in bundle for pathogen. This error occurs out of the box for me.

@karismatic-megafauna
Copy link

@perrygeo having the same issue out of the box

Error detected while processing function Vim_Markdown_Preview:
line   17:
E121: Undefined variable: b:vim_markdown_preview_github
E15: Invalid expression: b:vim_markdown_preview_github == 1
line   40:
E121: Undefined variable: b:vim_markdown_preview_temp_file
E15: Invalid expression: b:vim_markdown_preview_temp_file == 1

@JamshedVesuna
Copy link
Owner

@zarry @perrygeo @michaelghinrichs Can you pull again? I changed the way variables were checked and moved everything to a global scope in 1cb7414

Let me know if this error persists.

@perrygeo
Copy link

The error goes away for me. But it doesn't function properly - Ctrl-P opens a browser window at file:///tmp/vim-markdown-preview.html but the file is blank

@JamshedVesuna
Copy link
Owner

@perrygeo Are you using any flags (possibly let vim_markdown_preview_temp_file=1?) If so, check to see if the file /tmp/vim-markdown-preview.html actually exists. It could be that the file is being deleted before your browser opens it.

@perrygeo
Copy link

I haven't messed with any variables, just installed to ~/.vim/bundle, open md file, Ctrl-P. The file is created and still exists but is empty

$ ls -alth /tmp/vim-markdown-preview.html
-rw-r--r--  1 mperry  wheel     0B Nov 11 15:01 /tmp/vim-markdown-preview.html

@JamshedVesuna
Copy link
Owner

@perrygeo to check, do you have either markdown or grip installed as per the requirements?

What happens if you manually do markdown file.md > /tmp/vim-markdown-preview.html?

@perrygeo
Copy link

Yes, I have grip installed globally. In fact that's what I've been using to render markdown in lieu of a working vim plugin.

$ grip
 * Running on http://localhost:6419/ (Press CTRL+C to quit)

@JamshedVesuna
Copy link
Owner

In order to use grip (and Github flavored markdown), put github flag in your vimrc:

let vim_markdown_preview_github=1

Apologies if this was unclear from the README. Does this work?

@perrygeo
Copy link

@JamshedVesuna Yes! That was it. Can you specify that in Requirements (Options should be optional). In chosing markdown vs grip as your rendering engine, it's not clear that the later choice requires additional action.

@JamshedVesuna
Copy link
Owner

Added quick documentation in b51ecf2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants