Commits

Meikel Brandmeyer committed 50cbc91

Add Literalize and Quote helper

  • Participants
  • Parent commits 440d210

Comments (0)

Files changed (1)

File vim/src/main/vim/autoload/vimclojure/util.vim

 	return vimclojure#util#WithSavedOption('shellslash', closure)
 endfunction
 
+function! vimclojure#util#Quote(code)
+	return escape(a:code, '\"')
+endfunction
+
+function! vimclojure#util#Literalize(code)
+	if type(a:code) == type([])
+		let code = join(a:code, "\n")
+	else
+		let code = a:code
+	endif
+
+	return '"'. vimclojure#util#Quote(code) .'"'
+endfunction
+
 " Epilog
 let &cpo = s:save_cpo