Lua.OnSave, GetViewForFixingWhenBufferCommand
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
Style.TrimWhitespaceOnSave = true
|
||||
Style.ClangFormatOnSave = false
|
||||
|
||||
INTERNET_BROWSER = 'C:/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe'
|
||||
|
||||
SDLK_CTRL = 1073742048
|
||||
@@ -284,4 +287,17 @@ function OnCommand(e)
|
||||
end
|
||||
|
||||
function OnInit()
|
||||
end
|
||||
|
||||
function OnSave(buffer_id)
|
||||
local dont_trim_lines_with_caret = false
|
||||
ConvertLineEndingsToLF(buffer_id, dont_trim_lines_with_caret)
|
||||
if Style.TrimWhitespaceOnSave then
|
||||
TrimTrailingWhitespace(buffer_id, dont_trim_lines_with_caret)
|
||||
end
|
||||
|
||||
local name = GetBufferNameByID(buffer_id)
|
||||
if Style.ClangFormatOnSave and (name:match(".c$") or name:match(".h$") or name:match(".cpp$") or name:match(".hpp$")) then
|
||||
ApplyClangFormat(buffer_id)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user