Skip to content

Commit efbb5bb

Browse files
committed
luafmt and lint fix
1 parent b2b48a3 commit efbb5bb

27 files changed

Lines changed: 118 additions & 49 deletions

lua/fzy/native.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,20 @@ end
8585
-- Constants
8686

8787
local SCORE_GAP_LEADING = -0.005
88+
_ = SCORE_GAP_LEADING
8889
local SCORE_GAP_TRAILING = -0.005
90+
_ = SCORE_GAP_TRAILING
8991
local SCORE_GAP_INNER = -0.01
9092
local SCORE_MATCH_CONSECUTIVE = 1.0
93+
_ = SCORE_MATCH_CONSECUTIVE
9194
local SCORE_MATCH_SLASH = 0.9
95+
_ = SCORE_MATCH_SLASH
9296
local SCORE_MATCH_WORD = 0.8
97+
_ = SCORE_MATCH_WORD
9398
local SCORE_MATCH_CAPITAL = 0.7
99+
_ = SCORE_MATCH_CAPITAL
94100
local SCORE_MATCH_DOT = 0.6
101+
_ = SCORE_MATCH_DOT
95102
local SCORE_MAX = math.huge
96103
local SCORE_MIN = -math.huge
97104
local MATCH_MAX_LENGTH = 1024

lua/fzy/quicksort.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ end
3434
local function table_with_size(size, default_value)
3535
local t = {}
3636
for i = 1, size do
37+
_ = i
3738
table.insert(t, default_value)
3839
end
3940
return t

lua/fzy/test.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
local export = require('fzy')
1010

1111
local function print_table(tbl)
12+
_ = print_table
1213
if type(tbl) ~= 'table' then
1314
print(tbl)
1415
return

lua/guihua/diffview.lua

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,7 @@ local function parse_diff_lines(lines)
259259
for _, line in ipairs(lines) do
260260
local kind = 'context'
261261
local text = line
262-
if is_diff_header(line) then
263-
kind = 'header'
264-
elseif line:match('^-%-%-%s') or line:match('^%+%+%+%s') then
262+
if is_diff_header(line) or line:match('^-%-%-%s') or line:match('^%+%+%+%s') then
265263
kind = 'header'
266264
elseif line:sub(1, 1) == '-' and not line:match('^%-{3}%s') then
267265
kind = 'delete'

lua/guihua/float_test.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ function float()
2626
height = height,
2727
style = 'minimal',
2828
}
29+
_ = opts
2930

3031
local top = '' .. string.rep('', width + 2) .. ''
3132
local mid = '' .. string.rep(' ', width + 2) .. ''

lua/guihua/floating.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,7 @@ end
326326
-- term({ cmd = 'git diff --', border = 'single', external = false })
327327

328328
local function test(prompt)
329+
_ = test
329330
local b, w, c = floating_buf({
330331
win_width = 30,
331332
win_height = 6,
@@ -334,6 +335,8 @@ local function test(prompt)
334335
prompt = prompt,
335336
focus = true,
336337
})
338+
_ = w
339+
_ = c
337340
local data = { 'floating buf', 'line1', 'line2', 'line3', 'line4', 'line5' }
338341
for i = 1, 10, 1 do
339342
vim.api.nvim_buf_set_lines(b, i, -1, false, { data[i] })
@@ -346,6 +349,7 @@ local function test(prompt)
346349
end
347350

348351
local function test2(prompt)
352+
_ = test2
349353
local b, w, c = floating_buf({
350354
win_width = 30,
351355
win_height = 8,
@@ -355,6 +359,8 @@ local function test2(prompt)
355359
title = 'title',
356360
enter = true,
357361
})
362+
_ = w
363+
_ = c
358364
local data = { 'floating buf', 'linea', 'lineb', 'linec', 'lined', 'linee' }
359365
for i = 1, 10, 1 do
360366
vim.api.nvim_buf_set_lines(b, i, -1, false, { data[i] })
@@ -365,7 +371,11 @@ local function test2(prompt)
365371
end
366372

367373
local function test_mask(t)
374+
_ = test_mask
368375
local b, w, c = floating_buf_mask(t)
376+
_ = b
377+
_ = w
378+
_ = c
369379
end
370380
-- test2(true)
371381

lua/guihua/gui.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ local trace = require('guihua.log').trace
44
local api = vim.api
55

66
local ns_id = vim.api.nvim_create_namespace('guihua_gui')
7+
_ = ns_id
78

89
local function get_listview()
910
return require('guihua.listview')

lua/guihua/highlight.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ return {
22
setup = function(opts)
33
opts = opts or {}
44
local sel, listbg, textbg, border = 'Visual', 'NormalFloat', 'NormalFloat', 'FloatBorder'
5+
_ = border
56
if vim.fn.hlID('TelescopePromptBorder') > 0 then
67
border = 'TelescopePromptBorder'
78
listbg = 'TelescopeNormal'

lua/guihua/input.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ local function wrap_text(text, width)
6565
end
6666

6767
local function line_text(ctx)
68+
_ = line_text
6869
if ctx == nil or ctx.buf == nil or not api.nvim_buf_is_valid(ctx.buf) then
6970
return (ctx and ctx.prompt) or ''
7071
end
@@ -621,7 +622,7 @@ if false then
621622
end
622623

623624
if false then
624-
working_directory = function()
625+
local working_directory = function()
625626
return vim.fn.getcwd()
626627
end
627628
local function default_export_path(format_name)

lua/guihua/listview.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function ListView:initialize(...)
7575
-- Apply to common groups used by markdown / treesitter: @markup.strikethrough,
7676
-- @text.strike, markdownStrike, markdownDeleted. Use util helper to set
7777
-- window-local namespace overrides.
78-
local ft = opts.ft or self.ft or ''
78+
ft = ft or self.ft or ''
7979
if ft == 'markdown' or opts.disable_strikethrough then
8080
util.disable_win_strikethrough(self.win, self.ns, '@markup.strikethrough')
8181
util.disable_win_strikethrough(self.win, self.ns, '@text.strike')

0 commit comments

Comments
 (0)