Skip to content

Commit 0cb249f

Browse files
author
Marc Jakobi
committed
fix(rec): choices not working properly
1 parent 66a1101 commit 0cb249f

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

lua/haskell-snippets/data.lua

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---@mod haskell-snippets.data
1+
---@mod haskell-snippets.datadat
22

33
---@brief [[
44
--- Snippets related to data
@@ -97,16 +97,19 @@ local record_field_choice
9797
record_field_choice = function()
9898
return sn(nil, {
9999
choice(1, {
100-
dynamic(1, function()
101-
return sn(nil, { text { '', util.indent_str() .. '}' } })
102-
end),
103100
sn(nil, {
104-
dynamic(1, function()
101+
insert(1),
102+
dynamic(2, function()
103+
return sn(nil, { text { '', util.indent_str() .. '}' } })
104+
end),
105+
}),
106+
sn(nil, {
107+
insert(1),
108+
dynamic(2, function()
105109
return sn(nil, { text { '', util.indent_str() .. ', ' } })
106110
end),
107-
insert(2),
108-
text(' :: '),
109111
insert(3),
112+
text(' :: '),
110113
dynamic(4, record_field_choice),
111114
}),
112115
}),
@@ -137,9 +140,8 @@ data.rec = s({
137140
end),
138141
insert(5),
139142
text(' :: '),
140-
insert(6),
141-
dynamic(7, record_field_choice),
142-
choice(8, {
143+
dynamic(6, record_field_choice),
144+
choice(7, {
143145
text(''),
144146
sn(nil, {
145147
dynamic(1, function()

0 commit comments

Comments
 (0)