diff --git a/README.md b/README.md index 9ff9349..39dfbae 100644 --- a/README.md +++ b/README.md @@ -53,18 +53,18 @@ Ensure you have your latest graphics card drivers installed before use. | Feature | Done | Notes | |-----------------------------|------|-------| -| Pty allocation | ✔ | Needs work for OSX + Windows +| Pty allocation | ✔ | | OpenGL rendering | ✔ | | 8-bit (256) colour | ✔ | | 24-bit (true) colour | ✔ | -| Resizing/content reordering | ⏳ | -| ANSI escape codes | ⏳ | Most of these are handled now +| Resizing/content reordering | ✔ | +| ANSI escape codes | ✔ | | UTF-8 input | ✔ | | UTF-8 output | ✔ | Works as long as the font in use supports the relevant characters. | Copy/paste | | Paste working, no mouse interaction for copy | Customisable colour schemes | ✔ | Complete, but the config file has no entry for this yet -| Config file | ⏳ | Minimal options atm -| Scrolling | ⏳ | Infinite buffer implemented, need GUI scrollbar & render updates +| Config file | ✔ | Minimal options atm +| Scrolling | ✔ | | Mouse interaction | | | Sweet render effects | | diff --git a/buffer/buffer.go b/buffer/buffer.go index bbf580f..ca29113 100644 --- a/buffer/buffer.go +++ b/buffer/buffer.go @@ -671,22 +671,20 @@ func (buffer *Buffer) ResizeView(width uint16, height uint16) { } } - // @todo handle vertical resize? - - if buffer.Height() < int(buffer.viewHeight) { - // we might need to move back up if the buffer is now smaller - if int(buffer.cursorY) < buffer.Height()-1 { - buffer.cursorY = uint16(buffer.Height() - 1) - } else { - buffer.cursorY = uint16(buffer.Height() - 1) - } - } else { - buffer.cursorY = buffer.viewHeight - 1 - } + fromBottom := buffer.viewHeight - buffer.cursorY buffer.viewWidth = width buffer.viewHeight = height + if buffer.cursorY >= buffer.viewHeight-1 { + buffer.cursorY = buffer.viewHeight - 1 + } else { + buffer.cursorY = buffer.viewHeight - fromBottom + if int(buffer.cursorY) >= buffer.Height() { + buffer.cursorY = uint16(buffer.Height() - 1) + } + } + // position cursorX line = buffer.getCurrentLine() buffer.cursorX = uint16((len(line.cells) - cXFromEndOfLine) - 1)