Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor list:refresh #2

Open
alexanderjeurissen opened this issue Mar 2, 2021 · 0 comments
Open

Refactor list:refresh #2

alexanderjeurissen opened this issue Mar 2, 2021 · 0 comments

Comments

@alexanderjeurissen
Copy link
Owner

alexanderjeurissen commented Mar 2, 2021

qedit.nvim/lua/qedit.lua

Lines 17 to 22 in 6d8c1e9

local old_list = module.state[bufnr]
_G.old_list = old_list
-- Step 1. Persist modified tmpfile / list state
cmd('silent! write!')
old_list:refresh() -- reload list based on current list buffer

instead of:

  1. Retrieving old list from module.state
  2. Refreshing the list
  3. Creating a new list instance based on the updated internal list

Do on refresh:

  1. Store old collection
  2. Reload buffer
  3. Reassign items based on new list
  4. Return new items, old items
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant