@@ -11,7 +11,7 @@ local function get_importfile_name(bufnr, start_line, stop_line)
11
11
local oldpos = vim .fn .getcurpos ()
12
12
utils .move_cursor (bufnr , start_line )
13
13
14
- local import_line = vim .fn .search (" ^<" , " n " , stop_line )
14
+ local import_line = vim .fn .search (" ^<" , " cn " , stop_line )
15
15
-- restore old cursor position
16
16
utils .move_cursor (bufnr , oldpos [2 ])
17
17
43
43
-- @param stop_line Line where body stops
44
44
-- @param has_json True if content-type is set to json
45
45
local function get_body (bufnr , start_line , stop_line , has_json )
46
- if start_line >= stop_line then
47
- return
48
- end
49
-
50
46
-- first check if the body should be imported from an external file
51
47
local importfile = get_importfile_name (bufnr , start_line , stop_line )
52
48
local lines
@@ -56,7 +52,7 @@ local function get_body(bufnr, start_line, stop_line, has_json)
56
52
end
57
53
lines = utils .read_file (importfile )
58
54
else
59
- lines = vim .api .nvim_buf_get_lines (bufnr , start_line , stop_line , false )
55
+ lines = vim .api .nvim_buf_get_lines (bufnr , start_line - 1 , stop_line , false )
60
56
end
61
57
62
58
local body = " "
0 commit comments