Skip to content

Commit ea5f808

Browse files
committed
test: set line length to 100
1 parent 1a9b63c commit ea5f808

25 files changed

+587
-183
lines changed

.stylua.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
column_width = 120
1+
column_width = 100
22
line_endings = "Unix"
33
indent_type = "Spaces"
44
indent_width = 2

runtime/lua/vim/_editor.lua

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,12 @@ function vim._cs_remote(rcid, server_addr, connect_error, args)
739739
f_tab = true
740740
elseif subcmd == 'silent' then
741741
f_silent = true
742-
elseif subcmd == 'wait' or subcmd == 'wait-silent' or subcmd == 'tab-wait' or subcmd == 'tab-wait-silent' then
742+
elseif
743+
subcmd == 'wait'
744+
or subcmd == 'wait-silent'
745+
or subcmd == 'tab-wait'
746+
or subcmd == 'tab-wait-silent'
747+
then
743748
return { errmsg = 'E5600: Wait commands not yet implemented in nvim' }
744749
elseif subcmd == 'tab-silent' then
745750
f_tab = true
@@ -795,7 +800,11 @@ function vim.deprecate(name, alternative, version, plugin, backtrace)
795800
local message = name .. ' is deprecated'
796801
plugin = plugin or 'Nvim'
797802
message = alternative and (message .. ', use ' .. alternative .. ' instead.') or message
798-
message = message .. ' See :h deprecated\nThis function will be removed in ' .. plugin .. ' version ' .. version
803+
message = message
804+
.. ' See :h deprecated\nThis function will be removed in '
805+
.. plugin
806+
.. ' version '
807+
.. version
799808
if vim.notify_once(message, vim.log.levels.WARN) and backtrace ~= false then
800809
vim.notify(debug.traceback('', 2):sub(2), vim.log.levels.WARN)
801810
end

runtime/lua/vim/_meta.lua

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,13 @@ do -- buffer option accessor
102102
if type(k) == 'string' then
103103
_setup()
104104
if win_options[k] then
105-
error(string.format([['%s' is a window option, not a buffer option. See ":help %s"]], k, k))
105+
error(
106+
string.format([['%s' is a window option, not a buffer option. See ":help %s"]], k, k)
107+
)
106108
elseif glb_options[k] then
107-
error(string.format([['%s' is a global option, not a buffer option. See ":help %s"]], k, k))
109+
error(
110+
string.format([['%s' is a global option, not a buffer option. See ":help %s"]], k, k)
111+
)
108112
end
109113
end
110114

@@ -132,9 +136,13 @@ do -- window option accessor
132136
if type(k) == 'string' then
133137
_setup()
134138
if buf_options[k] then
135-
error(string.format([['%s' is a buffer option, not a window option. See ":help %s"]], k, k))
139+
error(
140+
string.format([['%s' is a buffer option, not a window option. See ":help %s"]], k, k)
141+
)
136142
elseif glb_options[k] then
137-
error(string.format([['%s' is a global option, not a window option. See ":help %s"]], k, k))
143+
error(
144+
string.format([['%s' is a global option, not a window option. See ":help %s"]], k, k)
145+
)
138146
end
139147
end
140148

@@ -252,7 +260,12 @@ local function assert_valid_value(name, value, types)
252260
end
253261

254262
error(
255-
string.format("Invalid option type '%s' for '%s', should be %s", type_of_value, name, table.concat(types, ' or '))
263+
string.format(
264+
"Invalid option type '%s' for '%s', should be %s",
265+
type_of_value,
266+
name,
267+
table.concat(types, ' or ')
268+
)
256269
)
257270
end
258271

runtime/lua/vim/diagnostic.lua

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,10 @@ local all_namespaces = {}
6868
---@private
6969
local function to_severity(severity)
7070
if type(severity) == 'string' then
71-
return assert(M.severity[string.upper(severity)], string.format('Invalid severity: %s', severity))
71+
return assert(
72+
M.severity[string.upper(severity)],
73+
string.format('Invalid severity: %s', severity)
74+
)
7275
end
7376
return severity
7477
end
@@ -277,7 +280,8 @@ local function set_diagnostic_cache(namespace, bufnr, diagnostics)
277280
for _, diagnostic in ipairs(diagnostics) do
278281
assert(diagnostic.lnum, 'Diagnostic line number is required')
279282
assert(diagnostic.col, 'Diagnostic column is required')
280-
diagnostic.severity = diagnostic.severity and to_severity(diagnostic.severity) or M.severity.ERROR
283+
diagnostic.severity = diagnostic.severity and to_severity(diagnostic.severity)
284+
or M.severity.ERROR
281285
diagnostic.end_lnum = diagnostic.end_lnum or diagnostic.lnum
282286
diagnostic.end_col = diagnostic.end_col or diagnostic.col
283287
diagnostic.namespace = namespace
@@ -477,7 +481,8 @@ local function next_diagnostic(position, search_forward, bufnr, opts, namespace)
477481
bufnr = get_bufnr(bufnr)
478482
local wrap = vim.F.if_nil(opts.wrap, true)
479483
local line_count = vim.api.nvim_buf_line_count(bufnr)
480-
local diagnostics = get_diagnostics(bufnr, vim.tbl_extend('keep', opts, { namespace = namespace }), true)
484+
local diagnostics =
485+
get_diagnostics(bufnr, vim.tbl_extend('keep', opts, { namespace = namespace }), true)
481486
local line_diagnostics = diagnostic_lines(diagnostics)
482487
for i = 0, line_count do
483488
local offset = i * (search_forward and 1 or -1)
@@ -966,7 +971,10 @@ M.handlers.virtual_text = {
966971
if opts.virtual_text.format then
967972
diagnostics = reformat_diagnostics(opts.virtual_text.format, diagnostics)
968973
end
969-
if opts.virtual_text.source and (opts.virtual_text.source ~= 'if_many' or count_sources(bufnr) > 1) then
974+
if
975+
opts.virtual_text.source
976+
and (opts.virtual_text.source ~= 'if_many' or count_sources(bufnr) > 1)
977+
then
970978
diagnostics = prefix_source(diagnostics)
971979
end
972980
if opts.virtual_text.severity then
@@ -1274,7 +1282,9 @@ function M.open_float(opts, ...)
12741282
-- LSP servers can send diagnostics with `end_col` past the length of the line
12751283
local line_length = #vim.api.nvim_buf_get_lines(bufnr, lnum, lnum + 1, true)[1]
12761284
diagnostics = vim.tbl_filter(function(d)
1277-
return d.lnum == lnum and math.min(d.col, line_length - 1) <= col and (d.end_col >= col or d.end_lnum > lnum)
1285+
return d.lnum == lnum
1286+
and math.min(d.col, line_length - 1) <= col
1287+
and (d.end_col >= col or d.end_lnum > lnum)
12781288
end, diagnostics)
12791289
end
12801290

@@ -1328,9 +1338,10 @@ function M.open_float(opts, ...)
13281338
diagnostics = prefix_source(diagnostics)
13291339
end
13301340

1331-
local prefix_opt = if_nil(opts.prefix, (scope == 'cursor' and #diagnostics <= 1) and '' or function(_, i)
1332-
return string.format('%d. ', i)
1333-
end)
1341+
local prefix_opt =
1342+
if_nil(opts.prefix, (scope == 'cursor' and #diagnostics <= 1) and '' or function(_, i)
1343+
return string.format('%d. ', i)
1344+
end)
13341345

13351346
local prefix, prefix_hl_group
13361347
if prefix_opt then

runtime/lua/vim/filetype.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ local extension = {
176176
bsdl = 'bsdl',
177177
bst = 'bst',
178178
btm = function(path, bufnr)
179-
return (vim.g.dosbatch_syntax_for_btm and vim.g.dosbatch_syntax_for_btm ~= 0) and 'dosbatch' or 'btm'
179+
return (vim.g.dosbatch_syntax_for_btm and vim.g.dosbatch_syntax_for_btm ~= 0) and 'dosbatch'
180+
or 'btm'
180181
end,
181182
bzl = 'bzl',
182183
bazel = 'bzl',
@@ -2169,7 +2170,10 @@ local function sort_by_priority(t)
21692170
local sorted = {}
21702171
for k, v in pairs(t) do
21712172
local ft = type(v) == 'table' and v[1] or v
2172-
assert(type(ft) == 'string' or type(ft) == 'function', 'Expected string or function for filetype')
2173+
assert(
2174+
type(ft) == 'string' or type(ft) == 'function',
2175+
'Expected string or function for filetype'
2176+
)
21732177

21742178
local opts = (type(v) == 'table' and type(v[2]) == 'table') and v[2] or {}
21752179
if not opts.priority then

0 commit comments

Comments
 (0)