Skip to content

Commit fb8b6d2

Browse files
author
Marc Jakobi
committed
style(lua): run stylua
1 parent b7297f5 commit fb8b6d2

4 files changed

Lines changed: 10 additions & 24 deletions

File tree

lua/fff/conf.lua

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ local M = {}
33
---@class fff.conf.State
44
local state = {
55
---@type table | nil
6-
config = nil
6+
config = nil,
77
}
88

99
local DEPRECATION_RULES = {
@@ -175,15 +175,11 @@ end
175175

176176
--- Setup the file picker with the given configuration
177177
--- @param config table Configuration options
178-
function M.setup(config)
179-
vim.g.fff = config
180-
end
178+
function M.setup(config) vim.g.fff = config end
181179

182180
--- @return table the fff configuration
183181
function M.get()
184-
if not state.config then
185-
init()
186-
end
182+
if not state.config then init() end
187183
return state.config
188184
end
189185

lua/fff/core.lua

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,21 +68,16 @@ local function setup_global_autocmds(config)
6868
end
6969

7070
--- @return boolean
71-
M.is_file_picker_initialized = function()
72-
return state.file_picker_initialized
73-
end
71+
M.is_file_picker_initialized = function() return state.file_picker_initialized end
7472

7573
---@return fff.fuzzy
7674
M.ensure_initialized = function()
77-
if state.initialized then
78-
return fuzzy
79-
end
75+
if state.initialized then return fuzzy end
8076
state.initialized = true
8177

8278
local config = require('fff.conf').get()
8379
if config.logging.enabled then
84-
local log_success, log_error =
85-
pcall(fuzzy.init_tracing, config.logging.log_file, config.logging.log_level)
80+
local log_success, log_error = pcall(fuzzy.init_tracing, config.logging.log_file, config.logging.log_level)
8681
if log_success then
8782
M.log_file_path = log_error
8883
else

lua/fff/main.lua

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ M.state = { initialized = false }
77

88
--- Setup the file picker with the given configuration
99
--- @param config table Configuration options
10-
function M.setup(config)
11-
vim.g.fff = config
12-
end
10+
function M.setup(config) vim.g.fff = config end
1311

1412
--- Find files in current directory
1513
function M.find_files()
@@ -54,8 +52,8 @@ end
5452
--- @param max_results number Maximum number of results
5553
--- @return table List of matching files
5654
function M.search(query, max_results)
57-
local fuzzy = require('fff.core').ensure_initialized()
58-
max_results = max_results or require('fff.config').get().max_results
55+
local fuzzy = require('fff.core').ensure_initialized()
56+
max_results = max_results or require('fff.config').get().max_results
5957
local ok, search_result = pcall(fuzzy.fuzzy_search_files, query, max_results, nil, nil)
6058
if ok and search_result.items then return search_result.items end
6159
return {}

lua/fff/picker_ui.lua

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,7 @@ function M.create_ui()
269269

270270
if not M.state.ns_id then M.state.ns_id = vim.api.nvim_create_namespace('fff_picker_status') end
271271

272-
local debug_enabled_in_preview = M.enabled_preview()
273-
and config
274-
and config.debug
275-
and config.debug.show_scores
272+
local debug_enabled_in_preview = M.enabled_preview() and config and config.debug and config.debug.show_scores
276273

277274
local terminal_width = vim.o.columns
278275
local terminal_height = vim.o.lines

0 commit comments

Comments
 (0)