mirror of https://github.com/liamg/aminal.git
wrapping problems
This commit is contained in:
parent
13246ca931
commit
df5aa7fbe7
|
@ -573,6 +573,12 @@ func (buffer *Buffer) Write(runes ...rune) {
|
||||||
line := buffer.getCurrentLine()
|
line := buffer.getCurrentLine()
|
||||||
|
|
||||||
if buffer.replaceMode {
|
if buffer.replaceMode {
|
||||||
|
|
||||||
|
if buffer.CursorColumn() >= buffer.Width() {
|
||||||
|
// @todo replace rune at position 0 on next line down
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
for int(buffer.CursorColumn()) >= len(line.cells) {
|
for int(buffer.CursorColumn()) >= len(line.cells) {
|
||||||
line.cells = append(line.cells, NewBackgroundCell(buffer.cursorAttr.BgColour))
|
line.cells = append(line.cells, NewBackgroundCell(buffer.cursorAttr.BgColour))
|
||||||
}
|
}
|
||||||
|
@ -589,7 +595,6 @@ func (buffer *Buffer) Write(runes ...rune) {
|
||||||
buffer.NewLine()
|
buffer.NewLine()
|
||||||
|
|
||||||
newLine := buffer.getCurrentLine()
|
newLine := buffer.getCurrentLine()
|
||||||
newLine.setWrapped(true)
|
|
||||||
if len(newLine.cells) == 0 {
|
if len(newLine.cells) == 0 {
|
||||||
newLine.cells = []Cell{{}}
|
newLine.cells = []Cell{{}}
|
||||||
}
|
}
|
||||||
|
@ -598,8 +603,8 @@ func (buffer *Buffer) Write(runes ...rune) {
|
||||||
cell.attr = buffer.cursorAttr
|
cell.attr = buffer.cursorAttr
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
buffer.cursorX = buffer.Width() - 1
|
// no more room on line and wrapping is disabled
|
||||||
inc = false
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// @todo if next line is wrapped then prepend to it and shuffle characters along line, wrapping to next if necessary
|
// @todo if next line is wrapped then prepend to it and shuffle characters along line, wrapping to next if necessary
|
||||||
|
@ -650,6 +655,7 @@ func (buffer *Buffer) Backspace() {
|
||||||
|
|
||||||
func (buffer *Buffer) CarriageReturn() {
|
func (buffer *Buffer) CarriageReturn() {
|
||||||
defer buffer.emitDisplayChange()
|
defer buffer.emitDisplayChange()
|
||||||
|
|
||||||
for {
|
for {
|
||||||
line := buffer.getCurrentLine()
|
line := buffer.getCurrentLine()
|
||||||
if line == nil {
|
if line == nil {
|
||||||
|
@ -661,6 +667,7 @@ func (buffer *Buffer) CarriageReturn() {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
buffer.cursorX = 0
|
buffer.cursorX = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue