Fixed autoreload plugin truncating last character of files with no newline at end
This commit is contained in:
parent
764b43494e
commit
1e9c3bef1f
|
@ -18,7 +18,7 @@ local function reload_doc(doc)
|
|||
|
||||
local sel = { doc:get_selection() }
|
||||
doc:remove(1, 1, math.huge, math.huge)
|
||||
doc:insert(1, 1, text:sub(1, -2))
|
||||
doc:insert(1, 1, text:gsub("\n$", ""))
|
||||
doc:set_selection(table.unpack(sel))
|
||||
|
||||
update_time(doc)
|
||||
|
|
Loading…
Reference in a new issue