summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2017-05-18 17:50:39 +0100
committerw0rp <devw0rp@gmail.com>2017-05-20 19:02:36 +0100
commitea1627f5ce5620806644a525f5dc8523187fd69f (patch)
tree5f7c8d6760c5c3d802961a06697ee93de3b4a8e4
parent0b743389e526caa7c9065405917da84f83a59b17 (diff)
downloadale-ea1627f5ce5620806644a525f5dc8523187fd69f.zip
Start experimenting with generic functions for fixing problems
-rw-r--r--autoload/ale/fix/generic.vim12
1 files changed, 12 insertions, 0 deletions
diff --git a/autoload/ale/fix/generic.vim b/autoload/ale/fix/generic.vim
new file mode 100644
index 00000000..5c5b2007
--- /dev/null
+++ b/autoload/ale/fix/generic.vim
@@ -0,0 +1,12 @@
+" Author: w0rp <devw0rp@gmail.com>
+" 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