diff options
| author | ruki <[email protected]> | 2018-01-02 00:27:55 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2018-01-01 20:47:32 +0800 |
| commit | 1bf42f883ad6c68ebc48c2b574233fb0fb27aecf (patch) | |
| tree | e1662089df98640e2b3c9c9f37e6d316ba5e735e | |
| parent | ff8b64effa9882573426f4d81f4b492d1328fba3 (diff) | |
fix cursor bug
| -rw-r--r-- | xmake/core/ui/program.lua | 5 | ||||
| -rw-r--r-- | xmake/core/ui/view.lua | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/xmake/core/ui/program.lua b/xmake/core/ui/program.lua index d8a5664a4..765d95732 100644 --- a/xmake/core/ui/program.lua +++ b/xmake/core/ui/program.lua @@ -380,7 +380,7 @@ function program:_refresh_cursor() end -- get the cursor position - local cursor = focused_view and focused_view:cursor() or point{0, 0} + local cursor = focused_view and focused_view:cursor()() or point{0, 0} if cursor_state ~= 0 then local v = focused_view while v:parent() do @@ -405,6 +405,9 @@ function program:_refresh_cursor() -- get main window local main_window = curses.main_window() + -- trace + log:print("cursor(%s): %s, %d", focused_view, cursor, cursor_state) + -- move cursor position if cursor_state ~= 0 then main_window:move(cursor.y, cursor.x) diff --git a/xmake/core/ui/view.lua b/xmake/core/ui/view.lua index d7d11ee06..701e3f95b 100644 --- a/xmake/core/ui/view.lua +++ b/xmake/core/ui/view.lua @@ -80,7 +80,7 @@ function view:init(name, bounds) self._NAME = name -- init cursor - self._CURSOR = point {0, 0} + self._CURSOR = point{0, 0} -- init bounds and window self:bounds_set(bounds) |
