guns/vim-clojure-static

Semicolons inside strings are interpreted as comments

Closed this issue · 4 comments

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
endfunction

The 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!

I wouldn't call it an easy fix, but sure, open a bug.

guns commented

@dsmoss

Hi, I'm going to close this issue. Please re-open if you think this is in error. Good luck!

I have forwarded the issue to tpope/vim-fireplace#89.

Best wishes,

Dave.