From 3c8e0feb68e3cbfaa13dc6f85657d7e91fe0b3af Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Fri, 18 Nov 2016 16:28:56 -0500 Subject: [PATCH] added bugs to the bug list, delete some commented code, and added some sketch code for scrolling during selection --- TODO.md | 4 ++-- xedit.c | 53 ++--------------------------------------------------- 2 files changed, 4 insertions(+), 53 deletions(-) diff --git a/TODO.md b/TODO.md index 1f9d2cb..e10e96e 100644 --- a/TODO.md +++ b/TODO.md @@ -1,9 +1,9 @@ # Implementation Tweaks and Bug Fixes - +* off by one error on scrolling wrapped lines +* delete at end of file hits assert * block selection should handle brace-balancing * Selecting big words should not wrap newlines * Right click should fetch file if it exists, search otherwise - * urls should open in web * directories in browse? # Internals and Miscellaneous diff --git a/xedit.c b/xedit.c index 3a2ade2..3fec61d 100644 --- a/xedit.c +++ b/xedit.c @@ -218,7 +218,9 @@ static void mouse_handler(MouseAct act, MouseBtn btn, int x, int y) { MouseBtns[MOUSE_BTN_LEFT].pressed = false; MouseBtns[MOUSE_BTN_LEFT].count = 0; } else if (MouseBtns[MOUSE_BTN_LEFT].region < id) { + //view_scroll(getview(MouseBtns[MOUSE_BTN_LEFT].region), +1); } else if (MouseBtns[MOUSE_BTN_LEFT].region > id) { + //view_scroll(getview(MouseBtns[MOUSE_BTN_LEFT].region), -1); } else { view_selext(getview(id), row, col); } @@ -417,15 +419,8 @@ int main(int argc, char** argv) { } #if 0 - /* Mouse Actions *****************************************************************************/ -void move_cursor(int x, int y) { - if (y == 0) return; - //SelBeg = SelEnd = screen_getoff(&Buffer, SelEnd, y-1, x); - TargetCol = buf_getcol(&Buffer, SelEnd); -} - void bigword(int x, int y) { size_t mbeg = SelEnd, mend = SelEnd; for (; !risblank(buf_get(&Buffer, mbeg-1)); mbeg--); @@ -470,50 +465,6 @@ void search(int x, int y) { //move_pointer(c, r); } -void scrollup(int x, int y) { - SelBeg = SelEnd = buf_byline(&Buffer, SelEnd, -ScrollLines); -} - -void scrolldn(int x, int y) { - SelBeg = SelEnd = buf_byline(&Buffer, SelEnd, ScrollLines); -} -/* Mouse Input Handler - *****************************************************************************/ -static void mouse_handler(MouseAct act, MouseBtn btn, int x, int y) { - //size_t row = y / Fonts.base.height; - //size_t col = x / Fonts.base.width; - //size_t twsz = (TagWinExpanded ? ((ScrRows - 1) / 4) : 1); - - ////if (row == 0) { - //// puts("status"); - ////} else if (row >= 1 && row <= twsz) { - //// puts("tagwin"); - ////} else { - //// puts("editwin"); - ////} - - //if (act == MOUSE_ACT_DOWN) { - // //if (mevnt->button >= 5) return; - // ///* update the number of clicks */ - // //uint32_t now = getmillis(); - // //uint32_t elapsed = now - Buttons[mevnt->button].time; - // //if (elapsed <= 250) - // // Buttons[mevnt->button].count++; - // //else - // // Buttons[mevnt->button].count = 1; - // //Buttons[mevnt->button].time = now; - // ///* execute the click action */ - // //uint32_t nclicks = Buttons[mevnt->button].count; - // //nclicks = (nclicks > 3 ? 1 : nclicks); - // //Actions[mevnt->button][nclicks-1](mevnt); - //} else if (act == MOUSE_ACT_MOVE) { - // puts("move"); - // //if (mevnt->y == 0 || mevnt->button != MOUSE_LEFT) return; - // //SelEnd = screen_getoff(&Buffer, SelEnd, mevnt->y-1, mevnt->x); - // //TargetCol = buf_getcol(&Buffer, SelEnd); - //} -} - void move_pointer(size_t x, size_t y) { x = (x * Fonts.base.width) + (Fonts.base.width / 2); y = ((y+1) * Fonts.base.height) + (Fonts.base.height / 2); -- 2.52.0