Skip to content

Commit

Permalink
removing vim.schedule for init
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan Badragan authored and MagicDuck committed May 18, 2024
1 parent 00d4508 commit fb597ee
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
12 changes: 5 additions & 7 deletions lua/grug-far/actions/replace.lua
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,11 @@ local function replace(params)
local startTime

-- initiate replace in UI
vim.schedule(function()
vim.api.nvim_buf_set_option(buf, 'modifiable', false)
state.status = 'progress'
state.progressCount = 0
state.actionMessage = getActionMessage(nil, filesCount, filesTotal)
renderResultsHeader(buf, context)
end)
vim.api.nvim_buf_set_option(buf, 'modifiable', false)
state.status = 'progress'
state.progressCount = 0
state.actionMessage = getActionMessage(nil, filesCount, filesTotal)
renderResultsHeader(buf, context)

local reportMatchingFilesUpdate = vim.schedule_wrap(function(files)
state.status = 'progress'
Expand Down
12 changes: 5 additions & 7 deletions lua/grug-far/actions/sync.lua
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,11 @@ local function sync(params)
local changesTotal = #changedFiles

-- initiate sync in UI
vim.schedule(function()
vim.api.nvim_buf_set_option(buf, 'modifiable', false)
state.status = 'progress'
state.progressCount = 0
state.actionMessage = getActionMessage(nil, changesCount, changesTotal)
renderResultsHeader(buf, context)
end)
vim.api.nvim_buf_set_option(buf, 'modifiable', false)
state.status = 'progress'
state.progressCount = 0
state.actionMessage = getActionMessage(nil, changesCount, changesTotal)
renderResultsHeader(buf, context)

local reportSyncedFilesUpdate = vim.schedule_wrap(function()
state.status = 'progress'
Expand Down

0 comments on commit fb597ee

Please sign in to comment.