Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 398968c

Browse files
committed
Improve split (#69)
1 parent 842aaea commit 398968c

2 files changed

Lines changed: 3 additions & 8 deletions

File tree

autoload/ghcmod.vim

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,9 @@ function! ghcmod#split(line, col, path, module) "{{{
4747
if len(l:parsed) < 5
4848
return
4949
endif
50-
let l:decls = l:parsed[5]
51-
normal dd
52-
for l:line in split(l:decls, '\n')
53-
call append(line(".")-1, l:line)
54-
endfor
50+
return split(l:parsed[5], '\n')
5551
endfunction "}}}
5652

57-
5853
function! ghcmod#type(line, col, path, module) "{{{
5954
let l:cmd = ghcmod#build_command(['type', a:path, a:module, a:line, a:col])
6055
let l:output = ghcmod#system(l:cmd)
@@ -308,7 +303,6 @@ function! ghcmod#system(...) "{{{
308303
lcd `=ghcmod#basedir()`
309304
let l:ret = call('vimproc#system', a:000)
310305
lcd -
311-
echomsg len(l:ret)
312306
return l:ret
313307
endfunction "}}}
314308

autoload/ghcmod/command.vim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,9 @@ function! ghcmod#command#split_function_case(force) "{{{
6464

6565
let l:module = ghcmod#detect_module()
6666
let l:decls = ghcmod#split(line('.'), col('.'), l:path, l:module)
67-
echo l:decls
6867

68+
call append(line('.'), l:decls)
69+
delete _
6970
endfunction "}}}
7071

7172
function! ghcmod#command#type_insert(force) "{{{

0 commit comments

Comments
 (0)