fix: agree st-autocomplete with st-scrollback-ringbuffer

This commit is contained in:
2025-09-14 19:17:31 +02:00
parent 4cbd7c3898
commit b68ac2c752

6
st.c
View File

@@ -2956,8 +2956,8 @@ void autocomplete (const Arg *arg) {
size_t x = 0;
for (; x < term.col; x++)
utf8encode(term.line[y][x].u, stbufline + x);
if (term.line[y][x - 1].mode & ATTR_WRAP) {
utf8encode(TLINE(y)[x].u, stbufline + x);
if (TLINE(y)[x - 1].mode & ATTR_WRAP) {
x--;
if (y <= term.c.y) cy--;
cxp++;
@@ -3058,7 +3058,7 @@ acmpl_begin:
int wl = 0;
int tl = line;
for (int l = 0; l < tl; l++)
if (term.line[l][term.col - 1].mode & ATTR_WRAP) {
if (TLINE(l)[term.col - 1].mode & ATTR_WRAP) {
wl++;
tl++;
}