summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2016-06-12 19:01:34 +0200
committermakefu <github@syntax-fehler.de>2016-06-12 19:01:34 +0200
commit2f940d77f1d5f3350adbbd946f0474260d36e0b4 (patch)
treea1b640d0b9641eb729bb04a73c748fda53523e72
parented1d336fc85935b73d9f8a2486ea3e95503ab655 (diff)
parent29442eda7c864265ccf23df0b350572d5527dd86 (diff)
Merge remote-tracking branch 'cd/master'
-rw-r--r--krebs/4lib/types.nix6
-rw-r--r--tv/2configs/vim.nix32
2 files changed, 21 insertions, 17 deletions
diff --git a/krebs/4lib/types.nix b/krebs/4lib/types.nix
index 678ae7a60..4742877a7 100644
--- a/krebs/4lib/types.nix
+++ b/krebs/4lib/types.nix
@@ -334,7 +334,8 @@ types // rec {
# TODO two slashes
absolute-pathname = mkOptionType {
name = "POSIX absolute pathname";
- check = s: s == "/" || (pathname.check s && substring 0 1 s == "/");
+ check = x: let xs = splitString "/" x; xa = head xs; in
+ xa == "/" || (xa == "" && all filename.check (tail xs));
merge = mergeOneOption;
};
@@ -342,7 +343,8 @@ types // rec {
# TODO normalize slashes
pathname = mkOptionType {
name = "POSIX pathname";
- check = s: isString s && all filename.check (splitString "/" s);
+ check = x: let xs = splitString "/" x; in
+ all filename.check (if head xs == "" then tail xs else xs);
merge = mergeOneOption;
};
diff --git a/tv/2configs/vim.nix b/tv/2configs/vim.nix
index 0d87d97af..826c2d4ca 100644
--- a/tv/2configs/vim.nix
+++ b/tv/2configs/vim.nix
@@ -264,30 +264,32 @@ let
];
sigil = ''\(${concatStringsSep ''\|'' startAlts}\)[ \t\r\n]*'';
in /* vim */ ''
- syn include @${lang}Syntax syntax/${lang}.vim
+ syn include @nix_${lang}_syntax syntax/${lang}.vim
unlet b:current_syntax
- syn region ${lang}Block_NixSTRING
- \ matchgroup=NixExit
- \ extend
- \ start='${replaceStrings ["'"] ["\\'"] sigil}"'
+ syn match nix_${lang}_sigil
+ \ X${replaceStrings ["X"] ["\\X"] sigil}\ze\('''\|"\)X
+ \ nextgroup=nix_${lang}_region
+ \ transparent
+
+ syn region nix_${lang}_region
+ \ matchgroup=NixSTRING
+ \ start='"'
\ skip='\\"'
\ end='"'
- \ contains=@${lang}Syntax
+ \ contained
+ \ contains=@nix_${lang}_syntax
- syn region ${lang}Block_NixIND_STRING
- \ matchgroup=NixExit
- \ extend
- \ start="${replaceStrings ["\""] ["\\\""] sigil}'''"
+ syn region nix_${lang}_region
+ \ matchgroup=NixIND_STRING
+ \ start="'''"
\ skip="'''\('\|[$]\|\\[nrt]\)"
\ end="'''"
- \ contains=@${lang}Syntax
+ \ contained
+ \ contains=@nix_${lang}_syntax
syn cluster NixSubLangs
- \ add=@${lang}Syntax,${lang}Block_NixSTRING,${lang}Block_NixIND_STRING
-
- hi link ${lang}Block_NixSTRING Statement
- hi link ${lang}Block_NixIND_STRING Statement
+ \ add=nix_${lang}_region,@nix_${lang}_syntax
'') {
c = {};
cabal = {};