[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 22b4662 2/3: Show "special" characters in vim
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 22b4662 2/3: Show "special" characters in vim |
Date: |
Tue, 6 Mar 2018 08:33:43 -0500 (EST) |
branch: master
commit 22b4662183ea726902f039bd860f897c3497ba4c
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Show "special" characters in vim
---
README.schroot | 12 ++++++++++++
test_coding_rules.cpp | 8 +++++++-
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/README.schroot b/README.schroot
index b1ed6e9..722e842 100644
--- a/README.schroot
+++ b/README.schroot
@@ -235,6 +235,18 @@ highlight TabLineSel ctermbg=239
ctermfg=202
" From tpope's 'sensible.vim':
set tabpagemax=50
+" Show invisibles: 'eol' and 'tab' are meant to be unobtrusive,
+" while 'nbsp' and 'trail' are meant to stand out; 'extends' and
+" 'precedes' normally wouldn't be seen because of 'set wrap'.
+set list
+" On second thought, 'eol' should probably be left alone.
+" set listchars=nbsp:◙,eol:☜,tab:☞☞,extends:»,precedes:«,trail:▒
+set listchars=nbsp:◙,tab:☞☞,extends:»,precedes:«,trail:▒
+highlight clear NonText
+highlight NonText ctermfg=gray " eol, extends, precedes
+highlight clear SpecialKey
+highlight SpecialKey ctermfg=red " nbsp, tab, trail
+
let g:netrw_liststyle=3
map <Tab> <C-W>w
diff --git a/test_coding_rules.cpp b/test_coding_rules.cpp
index f4bb695..5c1c11e 100644
--- a/test_coding_rules.cpp
+++ b/test_coding_rules.cpp
@@ -298,10 +298,16 @@ void taboo
/// Throw if the file contains a character outside the union of
/// ISO-8859-15 and the minimal POSIX whitespace set " \f\n\r\t\v".
///
-/// To locate violations: "grep -P '[\x00-\x08\x0e-\x1f\x7f-\x9f]'".
+/// To locate violations:
+/// LC_ALL=C grep -P '[\x00-\x08\x0e-\x1f\x7f-\x9f]' list-of-files
void assay_non_latin(file const& f)
{
+ if(f.phyloanalyze("^README.schroot$"))
+ {
+ return;
+ }
+
static boost::regex const forbidden(R"([\x00-\x08\x0e-\x1f\x7f-\x9f])");
if(boost::regex_search(f.data(), forbidden))
{