Semicolons inside strings are interpreted as comments
Closed this issue · 4 comments
dsmoss commented
I just tried the following:
In my buffer I have
(defn test [] "some; string"
"another ; string"
nil)
I place my cursor over 'defn' and type 'cqq' to have the function evaluated, what I get in the command window is:
@(defn test [] "some "another nil)
Best wishes,
Dave.
guns commented
Hi @dsmoss,
Unfortunately, the problem here is in fireplace.vim. The cqq command calls editop, which is defined like this:
function! s:editop(type) abort
call feedkeys(&cedit . "\<Home>", 'n')
let input = s:input(substitute(substitute(s:opfunc(a:type), "\s*;[^\n]*", '', 'g'), '\n\+\s*', ' ', 'g'))
if input !=# ''
call fireplace#echo_session_eval(input)
endif
endfunctionThe problem is that a simple text substitution is done without using information from the syntax engine. It is easy to fix, and I'm sure @tpope would appreciate a bug report.
Thank you!
tpope commented
I wouldn't call it an easy fix, but sure, open a bug.
guns commented
Hi, I'm going to close this issue. Please re-open if you think this is in error. Good luck!
dsmoss commented