aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/po
diff options
context:
space:
mode:
authorJan Edmund Lazo <janedmundlazo@hotmail.com>2018-07-23 11:27:16 -0400
committerJan Edmund Lazo <janedmundlazo@hotmail.com>2018-07-23 11:50:37 -0400
commit1ed5abfe888b364e372ac280fb2ebf971f4fce23 (patch)
tree2cb29b581c3ea9d2eae0211bcc663006c4650482 /src/nvim/po
parentd551a49958230077f9bc78587636227b2518149a (diff)
downloadrneovim-1ed5abfe888b364e372ac280fb2ebf971f4fce23.tar.gz
rneovim-1ed5abfe888b364e372ac280fb2ebf971f4fce23.tar.bz2
rneovim-1ed5abfe888b364e372ac280fb2ebf971f4fce23.zip
vim-patch:8.0.0794: checking translations fails with multiple NL
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. https://github.com/vim/vim/commit/9966b21a57277986217aa28237d6c247ebd060d7
Diffstat (limited to 'src/nvim/po')
-rw-r--r--src/nvim/po/check.vim8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/nvim/po/check.vim b/src/nvim/po/check.vim
index 33a4709e8f..ba5cad6c3e 100644
--- a/src/nvim/po/check.vim
+++ b/src/nvim/po/check.vim
@@ -117,14 +117,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
@@ -141,7 +139,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