Commit Graph

71 Commits

Author SHA1 Message Date
Christian Brabandt 5db4c408bd
Update copyright notifications 2018-01-05 10:37:59 +01:00
Edward Betts 3b304f36ae
Correct spelling mistake. 2017-11-25 21:14:31 +00:00
David Antaramian 42522f994a Fixes typo introduced in a10d321
Commmit a10d321809 introduced a small typo
spelling a previously set variable `trailing_fmt` as `trailing_fm`. This
causes Vim to report `trailing_fm` as an undefined variable. In this
change, the variable is properly referenced as `trailing_fmt`.
2017-06-30 18:45:21 -04:00
Christian Brabandt a10d321809
whitespace: move s:variables around
Will make sure, that even after setting the whitespace extension
variables, they are taken correctly into account.
2017-06-30 21:37:37 +02:00
Christian Brabandt f86f1e8103
whitespace: Only refresh on changes to buffer
Should prevent too many redraws of Vim
2017-06-26 10:04:43 +02:00
Alexey Zhikhartsev 3c6135d75f
Add a function to disable whitespace-detection
Useful to call for particular file types (e.g., .tex files):
ftplugin/tex.vim:
    call airline#extensions#whitespace#disable()
2017-02-26 10:35:17 +01:00
Jorrit Visser 8776a3e058 Truncation fix
Line numbers are now displayed before the error, instead of after, preventing truncation (and thus making the whitespace/indent section essentially useless in smaller terminals)
2017-02-07 14:20:56 +01:00
Benjamin Thomas 78439b2b35 Fix whitespace symbol empty string has extra space
This makes it so if the whitespace symbol (g:airline#extensions#whitespace#symbol) is an empty string, we don't end up wth two characters at the beginning of the message.
2016-10-02 01:22:50 -07:00
Christian Brabandt 513afd25bc Merge pull request #1263 from thawk/master
Set script encoding to avoid script parsing problem in non UTF-8 VIM
2016-09-24 21:55:50 +02:00
thawk 45d77ca909 Add 'scriptencoding utf-8' to all scripts 2016-09-24 08:16:30 +08:00
R.Chavignat da457ae5ea Add support for b:airline_whitespace_checks variable and documentation 2016-09-22 14:27:07 +02:00
Bill Neubauer 460ed02864 Add Go to the list of C-like languages. 2016-07-26 10:06:40 +09:00
Christian Brabandt 409e8b0cbd refactor shortening code 2016-07-02 10:20:07 +02:00
Christian Brabandt bc095bcde1 limit whitespace check output for smaller screens
Sometimes, if a buffer triggers many whitespace check warnings,
and the Vim window size is too small, other parts of the statusline
might become unreadable.

Therefore, if the window size is smaller than say 120 characters
and the whitespace warning > 9 chars, limit it to 10 characters
and inidicate, that there is more to come
2016-07-01 11:10:51 +02:00
Michael Henry e67b2847ea Add the b:airline_whitespace_disabled feature.
If the per-buffer variable b:airline_whitespace_disabled is defined
and non-zero, whitespace checking will be disabled for that buffer.
2016-05-14 15:56:48 -04:00
Christian Brabandt 727208d766 Do not draw separators for empty sections
This is a little bit a hack, because by the time the separators are
added, it is not clear, if the following section is empty, therefore
we need to parse the content of the following section and eval the
expressions to find out, if this is empty

Remarks:
- catch all exceptions when eval'ing statusline

- make sure, that the seperators are highlighted
  even when skipping empty regions (highlight group
  names need to be adjusted)

- if a section is defined as empty, it will be removed completly from
  the statusline. This means, it won't be called on the next update
  and may not refresh properly (e.g. when the whitespace check
  triggers, therefore, the whitesapce extension has to call an
  explicit redraw whenever it is supposed to be refreshed)
2016-05-12 21:40:56 +02:00
John Byrne a5fab144aa Made c_like_langs customisable via g:airline#extenstions#c_like_langs 2016-04-20 20:44:50 +02:00
Adrian Cowan 066d936076 Add Java as an exception in mixed-indent-file
Java allows "/** */"-style comments; add it as an exception in mixed-indent-file.
2016-04-07 14:55:39 +10:00
Alexandros Tasos dba50e9eea Add CUDA as an exception in mixed-indent-file 2016-03-24 23:53:13 +02:00
Tayler Mulligan c8048973cd extensions#whitespace: fix .ld mixed indent false positive
Similar to #1065 and #1081, adds link scripts to be excluded.

Adds a list containing C-like languages to ignore, which implement
multiline comments as:
/*
 *
 ...
 */

Comment below filetype check reflects all exclusions (c-like)
2016-03-16 16:19:55 -07:00
Tri Nguyen 48423832d4 extensions#whitespace: fix false positive for check_mix_indent_file() for JS file 2016-03-07 22:22:07 -05:00
Frederic Chanal 8fde76dd63 extensions#whitespace: fix false positive for check_mix_indent_file()
This patch prevents check_mix_indent_file() form notifying a "mix-ident-file"
when working where C/CPP using space and comment like:
/**
 * Some comment on the 1st column that shall not trigger check_indent_file()
 */
This kind of file can be found in linux kernel for example.
2016-02-26 14:29:51 +01:00
Christian Brabandt 1d072bf019 Do not check for mixed whitespace in Makefiles
Skip indent and mixed-indent-file check for Makefiles.

fixes #1017
2016-02-09 20:16:12 +01:00
Christian Brabandt 7352c8ee9e Detect inconsistent mixed indentation in a file
This is an extension to the whitespace extension.
It can now detect, if there is mixed indentation used within a file,
e.g. (using space for indentation on some lines and using tabs on other
lines.

This fixes #560
2016-02-06 17:46:56 +01:00
Bailey Ling b7a74b1748 remove deprecated variables
over 2 years is more than enough warning...
2016-01-28 09:54:14 -05:00
Christian Brabandt 453f4b759f Allow to customize the trailing whitespace regexp
Currently, vim-airline uses hard-coded '\s$' to check for trailing
whitespace. However you might want to check for different values.
Therefore, set the variable
g:airline#extensions#whitespace#trailing_regexp to the required regexp
value.

closes #663
2016-01-27 14:18:28 +01:00
Bailey Ling 048b24a916 happy 2016! 2016-01-14 21:38:38 -05:00
Kazuo Teramoto 5c799511c9 Add check for long lines to extensions#whitespace
Check for lines > textwidth, disabled by default.
2015-10-05 11:40:55 -03:00
Bailey Ling 491b3335cd Merge pull request #763 from h3xx/master
Fix grammatical error in comment
2015-05-19 21:11:48 -04:00
Dan Church bb2d6d8436 Fix grammatical error in comment 2015-04-28 12:25:26 -05:00
Emil Renner Berthing e6ca2ac58d whitespace: add more lenient mixed whitespace algorithm 2015-04-14 19:01:08 +02:00
Bailey Ling 1ca6ffb6d0 happy 2015
resolves #692.
2015-02-13 21:47:43 -05:00
Bailey Ling 13ee9f456a address syntax errors
resolves #683
2015-01-03 19:38:17 -05:00
Bailey Ling 81430cbdf6 append to the existing value in case the user defined it. 2014-04-20 14:52:06 +00:00
Christian Brabandt 931367d9fb Enable :AirlineToggleWhitespace,
even if g:airline#extensions#whitespace#enabled is disabled
2014-04-20 00:39:43 +02:00
Bailey Ling e49eac95a3 add support for configurable whitespace checking algorithms and default it to the simplest one. resolves #484 2014-04-19 14:27:14 -04:00
Bailey Ling abee990d30 handle cases where the augroup has not be defined yet. resolves #492 2014-04-19 14:16:36 -04:00
Davit Samvelyan 7b0d80050a Now trailing tabs are also reported, fixed bug when trailings with mixed tabs and spaces were being reported as mixed indents, case when count of spaces at the end of tabbed indentation less then tabstop does not reported as mixed indent anymore. 2014-04-05 16:41:27 +05:00
Bailey Ling d99112d6c6 improve whitespace detection. resolves #452. 2014-03-09 21:58:42 -04:00
Bailey Ling baed8ac063 happy 2014 2014-01-19 23:44:44 -05:00
Bailey Ling df2f33d6a5 specify maximum for whitespace checking. resolves #378. 2013-12-13 16:38:32 -05:00
Bailey Ling 31f36740c8 look up whitespace checks all the time. resolves #330. 2013-11-03 14:03:52 -05:00
bling bfe35ed76c replace all instance of space with the no-break space. resolves #256. 2013-09-22 11:29:27 -04:00
Bailey Ling 93b9fa7c75 fix spacing when both trailing/indent occurs. 2013-09-11 21:01:25 +00:00
farseer90718 e117af9dd0 Disable white space detection for unmodifiable buffers 2013-09-11 10:08:51 +08:00
Bailey Ling 2066410156 use at least 2 spaces to be considered an indent. fixes #177. 2013-09-04 18:10:45 +00:00
Bailey Ling 54ec1f39ca test some commands 2013-08-30 20:57:34 -04:00
Bailey Ling c6d996d5ca define the rest of the extensions. 2013-08-30 22:07:45 +00:00
Bailey Ling 6c5672d686 update documentation. 2013-08-28 02:36:12 +00:00
Bailey Ling 6fc8c00ef1 place syntastic and whitespace into parts. 2013-08-27 23:38:34 +00:00