@@ -15,36 +15,6 @@ function! Tab_to_spaces(text)
1515 return substitute (a: text , " " , Get_indent_string (), " g" )
1616endfunction
1717
18- " Check if line is commented out
19- function ! Is_comment (line )
20- return (match (a: line , " ^[ \t ]*--.*" ) >= 0 )
21- endfunction
22-
23- " Remove commented out lines
24- function ! Remove_line_comments (lines )
25- let l: i = 0
26- let l: len = len (a: lines )
27- let l: ret = []
28- while l: i < l: len
29- if ! Is_comment (a: lines [l: i ])
30- call add (l: ret , a: lines [l: i ])
31- endif
32- let l: i += 1
33- endwhile
34- return l: ret
35- endfunction
36-
37- " remove block comments
38- function ! Remove_block_comments (text)
39- return substitute (a: text , " {-.*-}" , " " , " g" )
40- endfunction
41-
42- " remove line comments
43- " todo: fix this! it only removes one occurence whilst it should remove all.
44- " function! Remove_line_comments(text)
45- " return substitute(a:text, "^[ \t]*--[^\n]*\n", "", "g")
46- " endfunction
47-
4818" Wrap in :{ :} if there's more than one line
4919function ! Wrap_if_multi (lines )
5020 if len (a: lines ) > 1
@@ -66,9 +36,7 @@ endfunction
6636
6737" vim slime handler
6838function ! _EscapeText_tidal (text)
69- " let l:text = Remove_block_comments(a:text)
70- let l: lines = Lines (Tab_to_spaces (l: text ))
71- " let l:lines = Remove_line_comments(l:lines)
39+ let l: lines = Lines (Tab_to_spaces (a: text ))
7240 let l: lines = Wrap_if_multi (l: lines )
7341 return Unlines (l: lines )
7442endfunction
0 commit comments