mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Terminal emulator: fix elinks 'q' crash (#8749)
This fixes a crash in terminal emulator on exit of elinks. see: https://github.com/koreader/koreader/pull/8636#issuecomment-1024956177
This commit is contained in:
@@ -124,6 +124,7 @@ function TermInputText:saveBuffer(buffer)
|
||||
{
|
||||
self.charlist,
|
||||
self.charpos,
|
||||
self.store_pos_dec,
|
||||
self.store_pos_sco,
|
||||
self.store_position,
|
||||
self.scroll_region_bottom,
|
||||
@@ -147,6 +148,7 @@ function TermInputText:restoreBuffer(buffer)
|
||||
if type(former_buffer[1]) == "table" then
|
||||
self.charlist,
|
||||
self.charpos,
|
||||
self.store_pos_dec,
|
||||
self.store_pos_sco,
|
||||
self.store_position,
|
||||
self.scroll_region_bottom,
|
||||
@@ -546,7 +548,7 @@ function TermInputText:addChars(chars, skip_callback, skip_table_concat)
|
||||
if self.charlist[self.charpos] == "\n" then
|
||||
self.charpos = self.charpos - 1
|
||||
end
|
||||
while self.charpos >=1 and self.charlist[self.charpos] ~= "\n" do
|
||||
while self.charpos >= 1 and self.charlist[self.charpos] ~= "\n" do
|
||||
self.charpos = self.charpos - 1
|
||||
end
|
||||
self.charpos = self.charpos + 1
|
||||
@@ -813,7 +815,7 @@ function TermInputText:goToStartOfLine(skip_callback)
|
||||
if self.charlist[self.charpos] == "\n" then
|
||||
self.charpos = self.charpos - 1
|
||||
end
|
||||
while self.charpos >=1 and self.charlist[self.charpos] ~= "\n" do
|
||||
while self.charpos >= 1 and self.charlist[self.charpos] ~= "\n" do
|
||||
self.charpos = self.charpos - 1
|
||||
end
|
||||
self.charpos = self.charpos + 1
|
||||
|
||||
Reference in New Issue
Block a user