From fb597eea2466f8d8bbd587f2a344dcfecfc9dc34 Mon Sep 17 00:00:00 2001 From: Stephan Badragan Date: Sat, 18 May 2024 12:39:53 -0700 Subject: [PATCH] removing vim.schedule for init --- lua/grug-far/actions/replace.lua | 12 +++++------- lua/grug-far/actions/sync.lua | 12 +++++------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/lua/grug-far/actions/replace.lua b/lua/grug-far/actions/replace.lua index 60cbed9a..0f5f6723 100644 --- a/lua/grug-far/actions/replace.lua +++ b/lua/grug-far/actions/replace.lua @@ -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' diff --git a/lua/grug-far/actions/sync.lua b/lua/grug-far/actions/sync.lua index cd57cceb..41843d5f 100644 --- a/lua/grug-far/actions/sync.lua +++ b/lua/grug-far/actions/sync.lua @@ -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'