Commit aeb68fa
committed
Add filetype blacklist
Exist languages with significant trailing whitespace, e.g. Markdown.
Adds the flag `b:strip_trailing_whitespace_enabled` for selectively
disabling the plugin on a per-buffer basis. The tracking of modified
lines still always has to happen though, to support re-enabling the
plugin.
In the autocmd group `strip_trailing_whitespace_filetype` an autocommand
is added for the `FileType` event that blacklists diff and Markdown
files and activates the plugin for other filetypes. To get rid of the
default behaviour:
:autocmd! strip_trailing_whitespace_filetype
Alternatively an explicit global variable could have been added as a
more easily customizable blacklist. However, since a buffer toggle is
warranted also for one-off situations, this was not preferred.1 parent 6aea8b0 commit aeb68fa
2 files changed
+33
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
| 221 | + | |
| 222 | + | |
221 | 223 | | |
222 | 224 | | |
223 | 225 | | |
| |||
237 | 239 | | |
238 | 240 | | |
239 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
240 | 248 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
0 commit comments