Skip to content

regression: buffer-local options are reset when saving a file #3687

@matthias314

Description

@matthias314

Since #3625 buffer-local options are reset to their default values when saving a file.

As a example, put the following into your init.lua:

local micro = import("micro")
local config = import("micro/config")

function preinit()
    config.RegisterCommonOption("plugin", "option", "old")
end

function onBufferOpen(buf)
    buf.Settings["plugin.option"] = "new"
    return true
end

function showoption(bp)
    micro.TermMessage(bp.Buf.Settings["plugin.option"])
end

and bind showoption to some key. Open a file and press that key. This shows "new". After (modifying and) saving the file, one instead gets "old".

The commit 698511c has this issue. The previous commit c61670e is fine.

CC @Neko-Box-Coder

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions