function search_forward(self) -- really, really simple approach: read a string and go for it termout("/") local needle = "" while 1 do local char = termin() if char == "\10" then break end -- Return key, icrnl makes it newline character if char == "\8" then needle = string.sub(needle, 1, #needle - 1) termout("\8 \8") else needle = needle..char termout(char) end end local newpos = string.find(self.data, needle, self.pos + 1) if newpos == nil then newpos = string.find(self.data, needle) end if newpos == nil then newpos = self.pos end self.pos = newpos end