aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto E. Vargas Caballero <k0ga@shike2.com>2012-09-16 10:49:12 +0200
committerRoberto E. Vargas Caballero <k0ga@shike2.com>2012-09-16 10:49:12 +0200
commitd81250e5f96e96dd430a3fc61b5b47ffc04f98d8 (patch)
treebf00fb7f81c9c78d768e11054cd988fabb3d7ab5
parentc5a9b799d44be9c0fa4264dc34d9dd61321be795 (diff)
downloadst-d81250e5f96e96dd430a3fc61b5b47ffc04f98d8.tar.gz
st-d81250e5f96e96dd430a3fc61b5b47ffc04f98d8.zip
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(-)
-rw-r--r--st.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/st.c b/st.c
index 397f6a6..12d6665 100644
--- a/st.c
+++ b/st.c
@@ -561,8 +561,11 @@ bpress(XEvent *e) {
561 if(IS_SET(MODE_MOUSE)) 561 if(IS_SET(MODE_MOUSE))
562 mousereport(e); 562 mousereport(e);
563 else if(e->xbutton.button == Button1) { 563 else if(e->xbutton.button == Button1) {
564 if(sel.bx != -1) 564 if(sel.bx != -1) {
565 sel.bx = -1;
565 tsetdirt(sel.b.y, sel.e.y); 566 tsetdirt(sel.b.y, sel.e.y);
567 draw();
568 }
566 sel.mode = 1; 569 sel.mode = 1;
567 sel.ex = sel.bx = X2COL(e->xbutton.x); 570 sel.ex = sel.bx = X2COL(e->xbutton.x);
568 sel.ey = sel.by = Y2ROW(e->xbutton.y); 571 sel.ey = sel.by = Y2ROW(e->xbutton.y);