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

Strange errors on :Linediff #2

Closed
vladimiroff opened this issue Nov 2, 2011 · 5 comments
Closed

Strange errors on :Linediff #2

vladimiroff opened this issue Nov 2, 2011 · 5 comments

Comments

@vladimiroff
Copy link

This happens on every second :Linediff, right before vimdiff opening.

"/tmp/vVwhNek/20" [New File]                                                                                                                                                                               
Error detected while processing function <SNR>20_Linediff..<SNR>20_PerformDiff..linediff#differ#CreateDiffBuffer..linediff#differ#SetupDiffBuffer:                                                         
line    7:                                                                                                                                                                                                 
"/tmp/vVwhNek/21" [New File]                                                                                                                                                                               
E492: Not an editor command: %04v][%p%%]\ [%L\ lines]                                                                                                                                                      
Press ENTER or type command to continue                          

This %04v][%p%%]\ [%L\ lines] is part of the statusline definition in my vimrc file.

@AndrewRadev
Copy link
Owner

Should be alright in the latest master. The problem was in the \| you had in your statusline. This was being executed like this:

exe "setlocal statusline=" . escape(statusline, ' ')

The fix was adding the pipe in the escape list.

I think there was a reasonable way to do let &statusline = "..." in vim and have it active only in the current buffer, but I can't really remember how. This would also solve the problem, and wouldn't need escaping.

@arecarn
Copy link

arecarn commented Feb 20, 2014

would setlocal be what you are looking for?

@xaizek
Copy link
Contributor

xaizek commented Feb 20, 2014

@arecarn, 'setlocal' can't handle expressions. I think @AndrewRadev couldn't remember this syntax:

:let &l:{option-name} = {expr1}

From :help :let-&:

Like above, but only set the local value of an option (if there is one).  Works like :setlocal.

@AndrewRadev
Copy link
Owner

Yes, that was the syntax I was looking for :). Thanks, @xaizek, @arecarn, I've pushed a commit that uses &l:statusline instead.

@arecarn
Copy link

arecarn commented Feb 21, 2014

Cool! I'm error free now.

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

4 participants