From 4b8eb5091468d2450d9d1232bc15cbba6f8d7005 Mon Sep 17 00:00:00 2001 From: skywind3000 Date: Wed, 21 Mar 2018 20:45:34 +0800 Subject: [PATCH] fixed: minor bugs --- z.lua | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/z.lua b/z.lua index 8f744bb..f0d23ce 100644 --- a/z.lua +++ b/z.lua @@ -779,6 +779,16 @@ function z_print(M, number) for i = #N, 1, -1 do local record = N[i] local line = record.score + while true do + local tail = line:sub(-1, -1) + if tail ~= '0' and tail ~= '.' then + break + end + line = line:sub(1, -2) + if tail == '.' then + break + end + end local dx = maxsize - line:len() if dx > 0 then line = line .. string.rep(' ', dx) @@ -811,7 +821,9 @@ function z_cd(patterns) return nil end local last = patterns[#patterns] - if last == '~' then + if last == '~' or last == '~/' then + return os.path.expand('~') + elseif windows and last == '~\\' then return os.path.expand('~') end if os.path.isabs(last) and os.path.isdir(last) then