Browse Source

Fix selection bug

After the commit named "Remove timeout in the main loop", selection is not
working in the proper way. After selecting something, press mouse button in
a line outside of selection causes an incorrect highlight. This patch fix
the problem forcing a draw after the press event, but this is only a fast
hack. Real solution means rewriting selection code.
---
 st.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
master
Roberto E. Vargas Caballero 12 years ago
parent
commit
d81250e5f9
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      st.c

+ 4
- 1
st.c View File

@ -561,8 +561,11 @@ bpress(XEvent *e) {
if(IS_SET(MODE_MOUSE)) if(IS_SET(MODE_MOUSE))
mousereport(e); mousereport(e);
else if(e->xbutton.button == Button1) { else if(e->xbutton.button == Button1) {
if(sel.bx != -1)
if(sel.bx != -1) {
sel.bx = -1;
tsetdirt(sel.b.y, sel.e.y); tsetdirt(sel.b.y, sel.e.y);
draw();
}
sel.mode = 1; sel.mode = 1;
sel.ex = sel.bx = X2COL(e->xbutton.x); sel.ex = sel.bx = X2COL(e->xbutton.x);
sel.ey = sel.by = Y2ROW(e->xbutton.y); sel.ey = sel.by = Y2ROW(e->xbutton.y);


Loading…
Cancel
Save