1

Remove options

This commit is contained in:
Alex Yatskov 2024-05-13 20:03:57 -07:00
parent 2b2d831837
commit 1d46f84163
2 changed files with 19 additions and 30 deletions

View File

@ -7,8 +7,6 @@ local opt_curr = {
comma_prefix = false, comma_prefix = false,
comma_prefix_indent = false, comma_prefix_indent = false,
line_max = 32, line_max = 32,
line_prefix = '',
trim_inner_spaces = true,
}, },
go = { go = {
comma_last = true, comma_last = true,
@ -39,9 +37,9 @@ local function get()
for param_name, param_value in pairs(opt_curr.default) do for param_name, param_value in pairs(opt_curr.default) do
file_opt[param_name] = param_value file_opt[param_name] = param_value
if file_opt_curr then if file_opt_curr then
param_value = file_opt_curr[param_name] local param_value_curr = file_opt_curr[param_name]
if param_value ~= nil then if param_value_curr ~= nil then
file_opt[param_name] = param_value file_opt[param_name] = param_value_curr
end end
end end
end end

View File

@ -296,11 +296,6 @@ function Param:trim()
self:slice(1, #self.text - #self.text:match('%s*$')) self:slice(1, #self.text - #self.text:match('%s*$'))
self:slice(1 + #self.text:match('^%s*'), #self.text) self:slice(1 + #self.text:match('^%s*'), #self.text)
if self.text:match('^' .. self.opt.line_prefix) then
self:slice(1 + #self.opt.line_prefix, #self.text)
end
if self.opt.trim_inner_spaces then
local text = '' local text = ''
local literals = {} local literals = {}
local offset = self.offset local offset = self.offset
@ -319,7 +314,6 @@ function Param:trim()
self.text = text self.text = text
self.literals = literals self.literals = literals
end
return #self.text > 0 return #self.text > 0
end end
@ -391,9 +385,9 @@ function ParamList:parse()
for col = start_col, stop_col do for col = start_col, stop_col do
self:update(line:sub(col, col), brace_stack, Cursor.new(row, col)) self:update(line:sub(col, col), brace_stack, Cursor.new(row, col))
end end
end
self:flush() self:flush()
end
end end
-- --
@ -535,7 +529,6 @@ function WrapContext:wrap()
local is_last_param = i == #self.params.parsed local is_last_param = i == #self.params.parsed
if self.opt.comma_prefix then if self.opt.comma_prefix then
builder:update(self.opt.line_prefix)
if not is_first_param then if not is_first_param then
builder:update(', ') builder:update(', ')
elseif self.opt.comma_prefix_indent and not is_last_param then elseif self.opt.comma_prefix_indent and not is_last_param then
@ -543,7 +536,6 @@ function WrapContext:wrap()
end end
cursor = self:update_builder_param(builder, param) or cursor cursor = self:update_builder_param(builder, param) or cursor
else else
builder:update(self.opt.line_prefix)
cursor = self:update_builder_param(builder, param) or cursor cursor = self:update_builder_param(builder, param) or cursor
if not is_last_param or self.opt.comma_last then if not is_last_param or self.opt.comma_last then
builder:update(',') builder:update(',')
@ -562,7 +554,6 @@ function WrapContext:wrap()
end end
if self.opt.brace_last_wrap then if self.opt.brace_last_wrap then
builder:update(self.opt.line_prefix)
builder:update(self.suffix) builder:update(self.suffix)
builder:flush() builder:flush()
end end