fix history bug, add jale.nim for version info
This commit is contained in:
parent
add1dd8c31
commit
d4d2f52ec1
|
@ -0,0 +1 @@
|
||||||
|
const jaleVersion = "0.1"
|
|
@ -10,6 +10,7 @@ proc plugHistory*(ed: LineEditor): History =
|
||||||
# after reading finished, it adds to history
|
# after reading finished, it adds to history
|
||||||
# before reading, it adds the temporary input to the history
|
# before reading, it adds the temporary input to the history
|
||||||
let hist = newHistory()
|
let hist = newHistory()
|
||||||
|
|
||||||
ed.bindEvent(jeFinish):
|
ed.bindEvent(jeFinish):
|
||||||
hist.clean()
|
hist.clean()
|
||||||
hist.newEntry(ed.content)
|
hist.newEntry(ed.content)
|
||||||
|
|
|
@ -68,7 +68,10 @@ proc clean*(h: History) =
|
||||||
h.lowestTouchedIndex = h.elements.len()
|
h.lowestTouchedIndex = h.elements.len()
|
||||||
|
|
||||||
proc newEntry*(h: History, ml: Multiline, temp: bool = false) =
|
proc newEntry*(h: History, ml: Multiline, temp: bool = false) =
|
||||||
h.elements.add(HistoryElement(original: ml, current: ml.copy(), temp: temp))
|
if not temp:
|
||||||
|
h.elements.add(HistoryElement(original: ml, current: ml.copy(), temp: temp))
|
||||||
|
else:
|
||||||
|
h.elements.add(HistoryElement(original: ml, current: ml, temp: temp))
|
||||||
|
|
||||||
proc save*(h: History, path: string) =
|
proc save*(h: History, path: string) =
|
||||||
# discards currents and temps, only saves originals
|
# discards currents and temps, only saves originals
|
||||||
|
|
Loading…
Reference in New Issue