]> git.mdlowis.com Git - projs/tide.git/commitdiff
Fixed cursor column tracking for keyboard shortcuts and context selection
authorMichael D. Lowis <mike.lowis@gentex.com>
Fri, 19 May 2017 13:06:44 +0000 (09:06 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Fri, 19 May 2017 13:06:44 +0000 (09:06 -0400)
TODO.md
TODO.sync-conflict-20170503-192815.md [deleted file]
lib/view.c

diff --git a/TODO.md b/TODO.md
index a098bd2315f68d537d41efe1b4d61a8f004bede5..492a17f58a51bd847795e47f8f11d2ce7e8bc96d 100644 (file)
--- a/TODO.md
+++ b/TODO.md
@@ -2,6 +2,7 @@
 
 Up Next:
 
+* refactor selection handling to buf.c to prepare fo rmultiple selections.
 * refactor x11.c and win.c
 * Make Fn keys execute nth command in the tags buffers
 * Run commands in the background and don't block the main thread.
diff --git a/TODO.sync-conflict-20170503-192815.md b/TODO.sync-conflict-20170503-192815.md
deleted file mode 100644 (file)
index b5753e1..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-# Issue List
-
-Up Next:
-
-* refactor x11.c and win.c
-* Make Fn keys execute nth command in the tags buffers
-* Run commands in the background and don't block the main thread.
-* check for file changes on save
-* check for file changes when window regains focus
-* 100% coverage with unit and unit-integration tests
-* right click to fetch file or line
-* Status line should omit characters from beginning of path to make file path fit
-
-Straight-up Bugs:
-
-* double free error on picking a tag with nothing in the buffer
-* fix crash on saving read-only file
-* fix crash on save to file that can't be created
-* tab inserts dont coalesce like one would expect
-
-The Future:
-
-* shortcut to repeat previous operation
-* add command line flags to toggle options (Tabs, Indent, etc..)
-* add command env vars to set options (Tabs, Indent, etc..)
-* implement command diffing logic to optimize the undo/redo log
-
-# Auxillary Programs
-
-* Visual diff tool
-* Win-like terminal emulator
-* File browser
-* Acme-like window manager
index 996c965f0dec369c3159bf93c4fb1c369870bdf1..4e06d561588f8210202fab344cfe4ee5d7728024 100644 (file)
@@ -290,6 +290,7 @@ void view_selext(View* view, size_t row, size_t col) {
     size_t off = getoffset(view, row, col);
     if (off != SIZE_MAX) {
         view->selection.end = off;
+        view->selection.col = buf_getcol(&(view->buffer), view->selection.end);
         view_scrollto(view, view->selection.end);
     }
 }
@@ -341,6 +342,7 @@ void view_select(View* view, size_t row, size_t col) {
     Sel sel = view->selection;
     selcontext(view, &sel);
     sel.end = buf_byrune(&(view->buffer), sel.end, RIGHT);
+    sel.col = buf_getcol(&(view->buffer), sel.end);
     view->selection = sel;
 }
 
@@ -522,6 +524,7 @@ void view_selctx(View* view) {
         selcontext(view, &(view->selection));
         view->selection.end = buf_byrune(
             &(view->buffer), view->selection.end, RIGHT);
+        view->selection.col = buf_getcol(&(view->buffer), view->selection.end);
     }
 }