chore: format with stylua 0.12.0 (#1730)

This commit is contained in:
Simon Hauser
2022-01-31 20:34:53 +01:00
committed by GitHub
parent 3a3c9a3c8b
commit f262e7d56d
3 changed files with 24 additions and 20 deletions

View File

@@ -3,4 +3,4 @@ line_endings = "Unix"
indent_type = "Spaces" indent_type = "Spaces"
indent_width = 2 indent_width = 2
quote_style = "AutoPreferDouble" quote_style = "AutoPreferDouble"
no_call_parentheses = true call_parentheses = "None"

View File

@@ -2,21 +2,23 @@ local entry_display = require "telescope.pickers.entry_display"
describe("truncate", function() describe("truncate", function()
for _, ambiwidth in ipairs { "single", "double" } do for _, ambiwidth in ipairs { "single", "double" } do
for _, case in ipairs { for _, case in
{ args = { "abcde", 6 }, expected = { single = "abcde", double = "abcde" } }, ipairs {
{ args = { "abcde", 5 }, expected = { single = "abcde", double = "abcde" } }, { args = { "abcde", 6 }, expected = { single = "abcde", double = "abcde" } },
{ args = { "abcde", 4 }, expected = { single = "abc", double = "ab" } }, { args = { "abcde", 5 }, expected = { single = "abcde", double = "abcde" } },
{ args = { "アイウエオ", 11 }, expected = { single = "アイウエオ", double = "アイウエオ" } }, { args = { "abcde", 4 }, expected = { single = "abc…", double = "ab…" } },
{ args = { "アイウエオ", 10 }, expected = { single = "アイウエオ", double = "アイウエオ" } }, { args = { "アイウエオ", 11 }, expected = { single = "アイウエオ", double = "アイウエオ" } },
{ args = { "アイウエオ", 9 }, expected = { single = "アイウエ", double = "アイウ" } }, { args = { "アイウエオ", 10 }, expected = { single = "アイウエ", double = "アイウエオ" } },
{ args = { "アイウエオ", 8 }, expected = { single = "アイウ…", double = "アイウ…" } }, { args = { "アイウエオ", 9 }, expected = { single = "アイウ", double = "アイウ…" } },
{ args = { "├─┤", 7 }, expected = { single = "├─┤", double = "├─┤" } }, { args = { "アイウエオ", 8 }, expected = { single = "アイウ…", double = "アイウ…" } },
{ args = { "├─┤", 6 }, expected = { single = "├─┤", double = "├─┤" } }, { args = { "├─┤", 7 }, expected = { single = "├─┤", double = "├─┤" } },
{ args = { "├─┤", 5 }, expected = { single = "├─┤", double = "" } }, { args = { "├─┤", 6 }, expected = { single = "├─┤", double = "─┤" } },
{ args = { "├─┤", 4 }, expected = { single = "├─┤", double = "├…" } }, { args = { "├─┤", 5 }, expected = { single = "├─┤", double = "├…" } },
{ args = { "├─┤", 3 }, expected = { single = "├─┤", double = "" } }, { args = { "├─┤", 4 }, expected = { single = "├─┤", double = "" } },
{ args = { "├─┤", 2 }, expected = { single = "", double = "" } }, { args = { "├─┤", 3 }, expected = { single = "─┤", double = "" } },
} do { args = { "├─┤", 2 }, expected = { single = "├…", double = "" } },
}
do
local msg = ("can truncate: ambiwidth = %s, [%s, %d] -> %s"):format( local msg = ("can truncate: ambiwidth = %s, [%s, %d] -> %s"):format(
ambiwidth, ambiwidth,
case.args[1], case.args[1],

View File

@@ -15,10 +15,12 @@ describe("builtin.find_files", function()
tester.run_file "find_files__with_ctrl_n" tester.run_file "find_files__with_ctrl_n"
end) end)
for _, configuration in ipairs { for _, configuration in
{ sorting_strategy = "descending" }, ipairs {
{ sorting_strategy = "ascending" }, { sorting_strategy = "descending" },
} do { sorting_strategy = "ascending" },
}
do
it("should not display devicons when disabled: " .. disp(configuration), function() it("should not display devicons when disabled: " .. disp(configuration), function()
tester.run_string(string.format( tester.run_string(string.format(
[[ [[