Fix scrolling issue in TUI.
This commit is contained in:
2
.idea/codeStyles/codeStyleConfig.xml
generated
2
.idea/codeStyles/codeStyleConfig.xml
generated
@@ -1,5 +1,5 @@
|
|||||||
<component name="ProjectCodeStyleConfiguration">
|
<component name="ProjectCodeStyleConfiguration">
|
||||||
<state>
|
<state>
|
||||||
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
|
<option name="PREFERRED_PROJECT_CODE_STYLE" value="sccl" />
|
||||||
</state>
|
</state>
|
||||||
</component>
|
</component>
|
||||||
@@ -83,8 +83,12 @@ ensure_cursor_visible(const Editor &ed, Buffer &buf)
|
|||||||
rowoffs = cury - content_rows + 1;
|
rowoffs = cury - content_rows + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clamp vertical offset to available content
|
// Clamp vertical offset to available content. Use the materialized rows cache
|
||||||
const auto total_rows = buf.Nrows();
|
// because some legacy editing commands still modify Buffer::Rows() directly.
|
||||||
|
// TerminalRenderer also renders from Buffer::Rows(), so keeping viewport math
|
||||||
|
// consistent with that avoids desync where the cursor goes off-screen when
|
||||||
|
// inserting newlines at EOF.
|
||||||
|
const auto total_rows = buf.Rows().size();
|
||||||
if (content_rows < total_rows) {
|
if (content_rows < total_rows) {
|
||||||
std::size_t max_rowoffs = total_rows - content_rows;
|
std::size_t max_rowoffs = total_rows - content_rows;
|
||||||
if (rowoffs > max_rowoffs)
|
if (rowoffs > max_rowoffs)
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ make clean
|
|||||||
rm -fr kge.app* kge-qt.app*
|
rm -fr kge.app* kge-qt.app*
|
||||||
make
|
make
|
||||||
mv kge.app kge-qt.app
|
mv kge.app kge-qt.app
|
||||||
macdeployqt -always-overwrite kge-qt.app
|
macdeployqt kge-qt.app -always-overwrite
|
||||||
zip -r kge-qt.app.zip kge-qt.app
|
zip -r kge-qt.app.zip kge-qt.app
|
||||||
sha256sum kge-qt.app.zip
|
sha256sum kge-qt.app.zip
|
||||||
open .
|
open .
|
||||||
|
|||||||
Reference in New Issue
Block a user