Skip to content

Commit

Permalink
perf: improve lazy loading to 7 -> 4 modules (#255)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikavilpas authored Jul 25, 2024
1 parent 65bff77 commit e29f633
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion integration-tests/cypress/e2e/lazy-loading.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ describe("lazy loading yazi.nvim", () => {
// NOTE: if this number changes in the future, it's ok. This test is just
// to make sure that we don't accidentally load all modules up front due to
// an unrelated change.
cy.contains("Loaded 7 modules")
cy.contains("Loaded 4 modules")
})
})
6 changes: 3 additions & 3 deletions lua/yazi/config.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
---@module "plenary.path"

local openers = require('yazi.openers')
local keybinding_helpers = require('yazi.keybinding_helpers')

local M = {}

function M.default()
local openers = require('yazi.openers')
---@type YaziConfig
return {
log_level = vim.log.levels.OFF,
Expand Down Expand Up @@ -63,6 +61,8 @@ end
---@param config YaziConfig
---@param context YaziActiveContext
function M.set_keymappings(yazi_buffer, config, context)
local keybinding_helpers = require('yazi.keybinding_helpers')

if config.keymaps == false then
return
end
Expand Down

0 comments on commit e29f633

Please sign in to comment.