Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Strange errors on :Linediff #2

Closed
Vladimiroff opened this Issue · 5 comments

4 participants

Kiril Vladimiroff Andrew Radev Ryan Carney xaizek
Kiril Vladimiroff

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.

Andrew Radev
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.

Ryan Carney

would setlocal be what you are looking for?

xaizek

@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.
Andrew Radev
Owner

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

Ryan Carney

Cool! I'm error free now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.