From ea1627f5ce5620806644a525f5dc8523187fd69f Mon Sep 17 00:00:00 2001 From: w0rp Date: Thu, 18 May 2017 17:50:39 +0100 Subject: [PATCH] Start experimenting with generic functions for fixing problems --- autoload/ale/fix/generic.vim | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 autoload/ale/fix/generic.vim diff --git a/autoload/ale/fix/generic.vim b/autoload/ale/fix/generic.vim new file mode 100644 index 0000000..5c5b200 --- /dev/null +++ b/autoload/ale/fix/generic.vim @@ -0,0 +1,12 @@ +" Author: w0rp +" Description: Generic functions for fixing files with. + +function! ale#fix#generic#RemoveTrailingBlankLines(buffer, lines) abort + let l:end_index = len(a:lines) - 1 + + while l:end_index > 0 && empty(a:lines[l:end_index]) + let l:end_index -= 1 + endwhile + + return a:lines[:l:end_index] +endfunction