Skip to content

File Not Sync When Box Sync Software update the org file #1007

Closed
@epirus

Description

@epirus

Describe the bug

maybe it's buffer cache
I use the cursor just use the below code fix problem but I dont whether it will affect the buffer feature

---Reload the file if it has been modified
---@return OrgPromise<OrgFile>
function OrgFile:reload()

  local lines = {}
  local f = io.open(self.filename, "r")
  if f then
    for line in f:lines() do
      table.insert(lines, line)
    end
    f:close()
  end
  -- clean memoize cache
  self.get_headlines = nil
  self.get_top_level_headlines = nil
  self.get_headlines_including_archived = nil
  self.root = nil
  self.parser = nil
  return Promise.resolve(self:_update_lines(lines))
end

Steps to reproduce

Here is the problem

  1. open neovim
  2. run agenda
  3. box software sync someone org file
  4. agenda press r and not load the file content

Expected behavior

maybe it's buffer cache
I use the cursor just use the below code fix problem but I dont whether it will affect the buffer feature

Emacs functionality

No response

Minimal init.lua

-- Enter your minimal_init.lua here

Screenshots and recordings

No response

nvim-orgmode version

0.6.0

OS / Distro

macos

Neovim version/commit

NVIM v0.11.2

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions