diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-07-28 16:46:57 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-07-28 16:46:57 +0200 |
commit | 9966b21a57277986217aa28237d6c247ebd060d7 (patch) | |
tree | 0123999d430636663fe3d21f0ee0c9eb20e55331 /src/po | |
parent | 93723a4ef18f260b82d89759db2f1eeae730c4ec (diff) | |
download | vim-git-9966b21a57277986217aa28237d6c247ebd060d7.tar.gz |
patch 8.0.0794: checking translations fails with multiple NLv8.0.0794
Problem: The script to check translations fails if there is more than one
NL in one line.
Solution: Count the number of NL characters. Make count() accept a string.
Diffstat (limited to 'src/po')
-rw-r--r-- | src/po/check.vim | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/po/check.vim b/src/po/check.vim index ba98ae7aa..3bcbef395 100644 --- a/src/po/check.vim +++ b/src/po/check.vim @@ -114,14 +114,12 @@ endif func! CountNl(first, last) let nl = 0 for lnum in range(a:first, a:last) - if getline(lnum) =~ '\\n' - let nl += 1 - endif + let nl += count(getline(lnum), "\n") endfor return nl endfunc -" Check that the \n at the end of the msid line is also present in the msgstr +" Check that the \n at the end of the msgid line is also present in the msgstr " line. Skip over the header. /^"MIME-Version: while 1 @@ -138,7 +136,7 @@ while 1 let transcount = CountNl(strlnum, end - 1) " Allow for a few more or less line breaks when there are 2 or more if origcount != transcount && (origcount <= 2 || transcount <= 2) - echomsg 'Mismatching "\\n" in line ' . line('.') + echomsg 'Mismatching "\n" in line ' . line('.') if error == 0 let error = lnum endif |