Closed humky closed 2 years ago
Try changing minlatency and maxlatency to default values in config.h.
I am not able to reproduce the issue.
Morever scroll/reflow only comes into play when resizing the st window.
latency didn't help, set to 30, 80, cursor is very leggy, bug persists.
Can you send a video or something?
Default latency is 8, 33 by the way.
Tried with freshly compiled nano 5.8 https://fastupload.co/1111217
Tried without .bashrc, same.
One thing is for sure that it is not being caused by scrolling/reflow part. Scrolling/reflow doesn't happen on alt-screen. Also I am not being able to reproduce the issue (but I have nano 5.9). I wouldn't be able to help you with the issue for a week or so. I have my exams from tomorrow.
If you can, you can try to find changes I have made in CSI code handlings related to cursor movement (see commit 4e9d5c5eb22754e9df6553d39dec4fe27b8727ca). I think some bug there might be causing the issue.
Sorry my knowledge of C is very superficial, I can't help with source that much. It shouldn't matter though, If you can't reproduce it, it has to be something else, we have the same source code, computers supposed to be deterministic? Then it's some other code which is different on our machines.
The bug is happening in the build on this repository only, right?
The bug is happening in the build on this repository only, right?
yes, my own build, and default st is fine.
Are you sure you are on the latest commit?
git log -i commit ade8fcdfeae20d865490f9a0af30659fd438f50f (HEAD -> main, origin/main, origin/HEAD)
I just git clone it, I didn't touch the head or anything
I will relook into this after a week.
Ok. I will poke some more, maybe I'll find something.
--
Works fine in tmux
92c5965daf4e951a6fc1ff86d35a32650d0e5425 introduces it
Using old
void
tputtab(int n)
{
uint x = term.c.x;
if (n > 0) {
while (x < term.col && n--)
for (++x; x < term.col && !term.tabs[x]; ++x)
/* nothing */ ;
} else if (n < 0) {
while (x > 0 && n++)
for (--x; x > 0 && !term.tabs[x]; --x)
/* nothing */ ;
}
term.c.x = LIMIT(x, 0, term.col-1);
}
void
tcontrolcode(uchar ascii)
{
switch (ascii) {
case '\t': /* HT */
tputtab(1);
fixes it.
That's my limit in understanding. good luck on the exams
Are you completely sure that replacing twritetab() with tputtab(1) fixes the issue? I am unable to understand how the tabbing thing could lead to washing out of characters on moving the cursor.
Yes, you still have this function defined, just replacing twritetab() with tputtab(1) solves missing characters. If you have any ideas how to debug I can try that.
Undo all changes, in twritetab function, replace GLYPH_TAB and GLYPH_TDUMMY with GLYPH_SET. See if the issue occurs. Also did you observe the behaviour in any program other than nano?
What do you mean undo all changes? It was written from scratch and at the same commit it became buggy. Changing GLYPH_TAB and GLYPH_TDUMMY with GLYPH_SET didn't help. No, only in nano.
Tried most recent, and at the point of first introduction, with GLYPH_SET, still bugy.
I meant the changes you might have made.
Work on the latest state/commit. Comment out "if selected" and "selclear" lines from the twritetab function. See if the issue persists.
Same.
Try this
void
twritetab(void)
{
int x = term.c.x, y = term.c.y;
/* selected() takes relative coordinates */
// if (selected(x + term.scr, y + term.scr))
// selclear();
// term.line[y][x].u = ' ';
// term.line[y][x].state = GLYPH_TAB;
while (++x < term.col && !term.tabs[x]) {
// term.line[y][x].u = ' ';
// term.line[y][x].state = GLYPH_TDUMMY;
}
term.c.x = MIN(x, term.col-1);
}
It still bugs out, but I think it somehow different to the previous time. Letters are shifting or something, not just disappearing, and it happens less frequently.
I tried in a new document, even without tabs still the same.
Wait this is impossible. The change must be equivalent to replacing twritetab with tputtab(1). Anyhow replace
term.c.x = MIN(x, term.col-1);
with
term.c.x = LIMIT(x, 0, term.col-1);
in the function.
If that also doesn't work, try
void
twritetab(void)
{
uint x = term.c.x;
if (x < term.col)
for (++x; x < term.col && !term.tabs[x]; ++x)
term.c.x = LIMIT(x, 0, term.col-1);
}
void
twritetab(void)
{
int x = term.c.x, y = term.c.y;
/* selected() takes relative coordinates */
// if (selected(x + term.scr, y + term.scr))
// selclear();
// term.line[y][x].u = ' ';
// term.line[y][x].state = GLYPH_TAB;
while (++x < term.col && !term.tabs[x]) {
// term.line[y][x].u = ' ';
// term.line[y][x].state = GLYPH_TDUMMY;
}
term.c.x = LIMIT(x, 0, term.col-1);
}
Works, I had issues with copying it from github, it produces additional //
Now uncomment first two commented lines. What happens then?
void
twritetab(void)
{
int x = term.c.x, y = term.c.y;
/* selected() takes relative coordinates */
if (selected(x + term.scr, y + term.scr))
selclear();
// term.line[y][x].u = ' ';
// term.line[y][x].state = GLYPH_TAB;
while (++x < term.col && !term.tabs[x]) {
// term.line[y][x].u = ' ';
// term.line[y][x].state = GLYPH_TDUMMY;
}
term.c.x = LIMIT(x, 0, term.col-1);
}
This one is working
Now uncomment GLYPH_* lines. Also revert last line to what it used to be (term.c.x = MIN(..)).
Without term.line[y][x].u = ' ';?
yes
Still working.
What it does?
Now uncomment first of the left ones (not in the loop).
Bugs out
Still working.
What it does?
These are "hacks" for implementing copying of tab characters in the terminal.
Bugs out
What do you mean? Uncommenting all lines also doesn't cause any issue?
uncomenting
term.line[y][x].u = ' ';
outside of while starts bugging again.
second one remains commented
Okay, are you using tab keys for movement by any chance?
I use arrows which are
KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
in qmk firmware.
I also have this stty werase '^H'
in .bashrc, to have Ctrl-Backspace delete whole word.
My .inputrc doesn't have anything unusual.
Can you try lxterminal and see if you face the same issue in nano? It also has the capability of copying tab characters.
lxterminal 0.4.0 works fine.
It could be a bug in nano. Pressing movement keys should not lead to sending tab characters in my limited knowledge.
lxterminal 0.4.0 works fine.
hmm.
Why can't you reproduce?
I have no idea.
What version of nano are you using? What distro?
I have some visual glitches in nano (5.9) when navigating the cursor along the lines (horizontally) by holding left or right arrow. Some letters disappear. I believe the issue is in the scroll patch because I have my own heavily patched version of st and it doesn't have this bug. The bug appears in your build, or in my build after your scroll/reflow integration. vim doesn't have this bug. I use bspwm if it has any importance.