Skip to content

Commit af07f38

Browse files
Fail gracefully on empty output from hdevtools.
In insert_type() : Exit with an error message if hdevtools doesn't recognize any type information at a given location.
1 parent 5e531bd commit af07f38

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

autoload/hdevtools.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,10 @@ function! hdevtools#insert_type()
588588
endif
589589

590590
let l:pos_lines = split(l:output_for_pos, '\n')
591+
if len(l:pos_lines) == 0
592+
call hdevtools#print_error('hdevtools#insert_type: No Type Information. hdevtools answered: ' . l:output_for_pos)
593+
return
594+
endif
591595
let l:pos_last_line = l:pos_lines[-1]
592596
let l:pos_last_line_parsed = matchlist(l:pos_last_line, '\(\d\+\) \(\d\+\) \(\d\+\) \(\d\+\) "\([^"]\+\)"')
593597
if len(l:pos_last_line_parsed) == 0

0 commit comments

Comments
 (0)