Skip to content

Commit 2bf721b

Browse files
committed
formatting
1 parent 5cc0f5e commit 2bf721b

File tree

1 file changed

+33
-35
lines changed

1 file changed

+33
-35
lines changed

lua/banana/nml/ast.lua

Lines changed: 33 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,8 @@ function M.Ast:_mountComponent()
256256
if not self:_isComponent() then
257257
log.throw(
258258
"Cannot mount tag '"
259-
.. self.tag
260-
.. "' as a component because it is not a component"
259+
.. self.tag
260+
.. "' as a component because it is not a component"
261261
)
262262
end
263263
if self.componentTree ~= nil then
@@ -646,18 +646,18 @@ end
646646
function M.numToRoman(num)
647647
local roman = {
648648
{ 1000, "M" },
649-
{ 900, "CM" },
650-
{ 500, "D" },
651-
{ 400, "CD" },
652-
{ 100, "C" },
653-
{ 90, "XC" },
654-
{ 50, "L" },
655-
{ 40, "XL" },
656-
{ 10, "X" },
657-
{ 9, "IX" },
658-
{ 5, "V" },
659-
{ 4, "IV" },
660-
{ 1, "I" },
649+
{ 900, "CM" },
650+
{ 500, "D" },
651+
{ 400, "CD" },
652+
{ 100, "C" },
653+
{ 90, "XC" },
654+
{ 50, "L" },
655+
{ 40, "XL" },
656+
{ 10, "X" },
657+
{ 9, "IX" },
658+
{ 5, "V" },
659+
{ 4, "IV" },
660+
{ 1, "I" },
661661
}
662662
local ret = ""
663663
for _, v in ipairs(roman) do
@@ -803,7 +803,7 @@ function M.Ast:_defaultStyles()
803803
local doc = self:ownerDocument()
804804
for _, attr in pairs(self.attributes) do
805805
if type(attr) == "table" then
806-
doc:_loadPreScriptFor(function (opts)
806+
doc:_loadPreScriptFor(function(opts)
807807
attr.tempval = attr.fn(doc)
808808
end, self:_getScriptRoot(), self:_getLoadedParams())
809809
end
@@ -1421,13 +1421,13 @@ function M.Ast:_resolveUnits(parentWidth, parentHeight)
14211421
"ch",
14221422
math.floor(
14231423
self:_firstStyleComputedValue("width", 0)
1424-
/ self:_firstStyleValue("aspect-ratio", 1)
1425-
/ 2
1424+
/ self:_firstStyleValue("aspect-ratio", 1)
1425+
/ 2
14261426
),
14271427
math.floor(
14281428
self:_firstStyleComputedValue("width", 0)
1429-
/ self:_firstStyleValue("aspect-ratio", 1)
1430-
/ 2
1429+
/ self:_firstStyleValue("aspect-ratio", 1)
1430+
/ 2
14311431
)
14321432
),
14331433
}
@@ -1436,14 +1436,12 @@ function M.Ast:_resolveUnits(parentWidth, parentHeight)
14361436
if aspectRatio == 0 then
14371437
log.warn(
14381438
self.tag
1439-
..
1440-
" element has aspect-ratio set to <= 0. Ignoring this because negative or 0 aspect ratios can cause infinite loops"
1439+
.. " element has aspect-ratio set to <= 0. Ignoring this because negative or 0 aspect ratios can cause infinite loops"
14411440
)
14421441
else
14431442
log.warn(
14441443
self.tag
1445-
..
1446-
" element has aspect-ratio, width, and height set. aspect-ratio will do nothing because both width and height are set"
1444+
.. " element has aspect-ratio, width, and height set. aspect-ratio will do nothing because both width and height are set"
14471445
)
14481446
end
14491447
end
@@ -1615,10 +1613,10 @@ function M.Ast:getAttribute(name)
16151613
return nil
16161614
end
16171615
return vim.iter(self.classes)
1618-
:map(function (k, _)
1616+
:map(function(k, _)
16191617
return k
16201618
end)
1621-
:join(" ")
1619+
:join(" ")
16221620
end
16231621
local ret = self.attributes[name]
16241622
if type(ret) == "table" then
@@ -1883,7 +1881,7 @@ end
18831881
function M.Ast:childIterWithI()
18841882
local i = 0
18851883
local retI = 0
1886-
return function ()
1884+
return function()
18871885
i = i + 1
18881886
retI = retI + 1
18891887
while type(self.nodes[i]) ~= "table" do
@@ -1901,7 +1899,7 @@ end
19011899
---@return fun():(Banana.Ast|string)?
19021900
function M.Ast:allChildIter()
19031901
local i = 0
1904-
return function ()
1902+
return function()
19051903
--flame.new("Ast:childIter")
19061904
i = i + 1
19071905
--flame.pop()
@@ -1914,7 +1912,7 @@ end
19141912
---@return fun():Banana.Ast?
19151913
function M.Ast:childIter()
19161914
local i = 0
1917-
return function ()
1915+
return function()
19181916
--flame.new("Ast:childIter")
19191917
i = i + 1
19201918
while type(self.nodes[i]) ~= "table" do
@@ -2028,23 +2026,23 @@ end
20282026
---@return fun():boolean
20292027
function M.Ast:_parseRemapMod(mod)
20302028
if mod == "hover" then
2031-
return function ()
2029+
return function()
20322030
return self:isHovering()
20332031
end
20342032
elseif mod == "line-hover" then
2035-
return function ()
2033+
return function()
20362034
return self:isLineHovering()
20372035
end
20382036
elseif type(mod) == "number" then
2039-
return function ()
2037+
return function()
20402038
local count = vim.v.count
20412039
return count == mod
20422040
end
20432041
end
20442042
error(
20452043
"Attempting to use ast remap mod '"
2046-
.. mod
2047-
.. "' even though it has not been defined"
2044+
.. mod
2045+
.. "' even though it has not been defined"
20482046
)
20492047
end
20502048

@@ -2105,15 +2103,15 @@ function M.Ast:attachRemap(mode, lhs, mods, rhs, opts)
21052103
-- :totable()
21062104
if type(rhs) == "string" then
21072105
local oldRhs = rhs
2108-
rhs = function ()
2106+
rhs = function()
21092107
vim.api.nvim_feedkeys(
21102108
vim.api.nvim_replace_termcodes(oldRhs, true, true, true),
21112109
mode,
21122110
true
21132111
)
21142112
end
21152113
end
2116-
local actualRhs = function ()
2114+
local actualRhs = function()
21172115
if self:isHidden() then
21182116
return false
21192117
end

0 commit comments

Comments
 (0)