File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11-- moran_pin.lua
2- -- version: 0.1.3
2+ -- version: 0.1.4
33-- author: kuroame
44-- license: GPLv3
55-- You may copy, distribute and modify the software as long as you track
88-- along with build & install instructions.
99
1010-- changelog
11+ -- 0.1.4: make commit counter always start from 0
1112-- 0.1.3: use C-- and C-= (C-+) to reorder candidates
1213-- 0.1.2: add freestyle mode, add switch to enable/disable pin
1314-- 0.1.1: simple configuration
@@ -160,14 +161,14 @@ function user_db.toggle_pin_status(input, cand_text)
160161 local pinned_res = pin_db :query (input .. sep_t )
161162 if pinned_res ~= nil then
162163 local key = input .. sep_t .. cand_text
163- local max_commits = 0
164+ local max_commits = - 1
164165 for k , v in pinned_res :iter () do
165166 local unpacked = user_db .unpack_entry (k , v )
166167 if unpacked then
167168 -- found existing entry here
168169 if key == k then
169170 -- if it's an active one, set its commit counter to -1 to tombstone it
170- if unpacked .commits > 0 then
171+ if unpacked .commits >= 0 then
171172 user_db .tombstone (key )
172173 -- good to leave now
173174 return
You can’t perform that action at this time.
0 commit comments