Kaynağa Gözat

buffer history now: can't go out of bounds, can go to an empty line once you go past the most recent

master
XeonSquared 4 yıl önce
ebeveyn
işleme
3f82d96b8e
1 değiştirilmiş dosya ile 5 ekleme ve 0 silme
  1. +5
    -0
      module/buffer.lua

+ 5
- 0
module/buffer.lua Dosyayı Görüntüle

@@ -294,9 +294,14 @@ function buffer:read(...)
elseif char == "B" then -- down
hIndex = hIndex - 1
io.write("\27[u"..(" "):rep(buffer:len()+1))
if hIndex == 0 then
hIndex = hIndex - 1
buffer = ""
end
buffer = self.history[1+#self.history-hIndex] or buffer
pos = 1
end
hIndex = math.max(math.min(hIndex,#self.history),0)
end
elseif char == "\8" then
if #buffer > 0 and pos <= #buffer then


Yükleniyor…
İptal
Kaydet