From 94e82cc6f6ca03287281fd2f330f1551ae629e47 Mon Sep 17 00:00:00 2001 From: ThaCuber <70547062+thacuber2a03@users.noreply.github.com> Date: Wed, 11 Oct 2023 22:31:34 -0400 Subject: fix fatal motiontrail error when mixed with settings (#316) * fix fatal motiontrail error when mixed with settings * bump version * bump a little less --- manifest.json | 2 +- plugins/motiontrail.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index 929929f..892bd27 100644 --- a/manifest.json +++ b/manifest.json @@ -1314,7 +1314,7 @@ }, { "description": "Adds a motion-trail to the caret *([gif](https://user-images.githubusercontent.com/3920290/83256814-085ccb00-a1ab-11ea-9e35-e6633cbed1a9.gif))*", - "version": "0.2", + "version": "0.2.1", "path": "plugins/motiontrail.lua", "id": "motiontrail", "mod_version": "3" diff --git a/plugins/motiontrail.lua b/plugins/motiontrail.lua index 5c8a270..0401e10 100644 --- a/plugins/motiontrail.lua +++ b/plugins/motiontrail.lua @@ -90,7 +90,7 @@ function DocView:draw_caret(x, y) self.last_doc_pos[caret_idx] = self.last_doc_pos[caret_idx] or {} local line, col = self.doc:get_selection_idx(caret_idx) - if self.draws <= 1 then + if (self.draws or 0) <= 1 then local lsx, lsy = self.last_pos[caret_idx][1] or x, self.last_pos[caret_idx][2] or y local lsl, lsc = self.last_doc_pos[caret_idx][1], self.last_doc_pos[caret_idx][2] local w, h = get_caret_size(self, caret_idx) -- cgit v1.2.3