Skip to content
Discussion options

You must be logged in to vote

Mhhh implementing this exactly as you state is difficult because you'd have to put the choiceNode inside a dynamicNode to change it, and updating from inside the dynamicNode is currently forbidden.

But I have another suggestion that should be similarly good: As I understand it, you're essentially using the choiceNode to put easily readable labels to less-readable dates.
I'd implement this by using ext_opts to show this readable lable, while just switching between the already-correct choices:

local function date_at(when)
	return d(1, function()
		local out = vim.system({"date", "--iso-8601", "-d", when}):wait()
		-- remove trailing \n
		local datestring = out.stdout:sub(1,-2)

		return sn(nil

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@benlubas
Comment options

Answer selected by benlubas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants