Closed lingnand closed 10 years ago
Agreed.
Thing is, we hadn't thought of this use case at all. I think <localleader>br
was supposed to be used after <localleader>gr
, I don't remember thinking of the case you propose. I believe the workaround you found works only by accident, and it shows a problem in the pandoc_misc#Pandoc_Back_From_Ref()
function (https://github.com/vim-pandoc/vim-pandoc/blob/master/autoload/pandoc_misc.vim#L100). I'll look into it, but be aware vim-pandoc itself has been deprecated in favor of vim-pantondoc, which implements this functionality differently (but it still has this issue).
I've already looked into the code and it appears that \nr is not very resistant to factors such as the indent of the document, thus leaving a space at the beginning. However I didn't try to fix it in the end because a SnipMate snippet in this case should do better.Something like thissnippet [:/ [${1:link}][${2:}]${0} [$2]: http://${3:url} "${4:title}" Regards,Lingnan From: Felipe MoralesSent: Thursday, 22 May 2014 21:14To: vim-pandoc/vim-pandocReply To: vim-pandoc/vim-pandocCc: Lingnan DaiSubject: Re: [vim-pandoc]
Thing is, we hadn't thought of this use case at all. I think
—Reply to this email directly or view it on GitHub.
I fixed this issue in vim-pantondoc, and I'm currently trying to fix it in vim-pandoc. Problem is, I can't reproduce it. Can you provide a sample text where this issue happens?
Basically the p
pastes the string after the cursor and not on the cursor and that's where the problem comes from. This should do it
map <buffer><silent> <Localleader>nr ya[o<CR><ESC>0P$a:
Thanks, I incorporated that change. Does that fix this issue, or there is still stuff pending?
I tried creating a reference using
<localleader>nr
, typed something and tried going back using<localleader>br
and it's not working.Interestingly, I noticed that the reference created by
<localleader>nr
has a space at the beginning of the line. So I go ahead and deleted that space and it started working.The problem is that, these sorts of things really shouldn't happen