Skip to content

Commit 81a71ea

Browse files
authored
Merge pull request #55 from vim-jp/before-8.0
prepare for 8.0 release
2 parents ccc430c + 09dbfa9 commit 81a71ea

File tree

4 files changed

+524
-390
lines changed

4 files changed

+524
-390
lines changed

README.mkd README.md

File renamed without changes.

runtime/doc/vim.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ When N is omitted, open one tab page for each file.
321321
\-R
322322
Read-only mode.
323323
The 'readonly' option will be set.
324-
You can still edit the buffer, but will be prevented from accidently
324+
You can still edit the buffer, but will be prevented from accidentally
325325
overwriting a file.
326326
If you do want to overwrite a file, add an exclamation mark to the Ex command,
327327
as in ":w!".

src/po/check.vim

+55-21
Original file line numberDiff line numberDiff line change
@@ -30,36 +30,66 @@ func! GetMline()
3030
return substitute(idline, '[^%]*\(%[-+ #''.0-9*]*l\=[dsuxXpoc%]\)\=', '\1', 'g')
3131
endfunc
3232

33-
" This only works when 'wrapscan' is set.
33+
" This only works when 'wrapscan' is not set.
3434
let s:save_wrapscan = &wrapscan
35-
set wrapscan
35+
set nowrapscan
3636

3737
" Start at the first "msgid" line.
3838
1
39-
/^msgid
40-
let startline = line('.')
39+
/^msgid\>
40+
41+
" When an error is detected this is set to the line number.
42+
" Note: this is used in the Makefile.
4143
let error = 0
4244

4345
while 1
4446
if getline(line('.') - 1) !~ "no-c-format"
45-
let fromline = GetMline()
47+
" go over the "msgid" and "msgid_plural" lines
48+
let prevfromline = 'foobar'
49+
while 1
50+
let fromline = GetMline()
51+
if prevfromline != 'foobar' && prevfromline != fromline
52+
echomsg 'Mismatching % in line ' . (line('.') - 1)
53+
echomsg 'msgid: ' . prevfromline
54+
echomsg 'msgid ' . fromline
55+
if error == 0
56+
let error = line('.')
57+
endif
58+
endif
59+
if getline('.') !~ 'msgid_plural'
60+
break
61+
endif
62+
let prevfromline = fromline
63+
endwhile
64+
4665
if getline('.') !~ '^msgstr'
47-
echo 'Missing "msgstr" in line ' . line('.')
48-
let error = 1
49-
endif
50-
let toline = GetMline()
51-
if fromline != toline
52-
echo 'Mismatching % in line ' . (line('.') - 1)
53-
echo 'msgid: ' . fromline
54-
echo 'msgstr: ' . toline
55-
let error = 1
66+
echomsg 'Missing "msgstr" in line ' . line('.')
67+
if error == 0
68+
let error = line('.')
69+
endif
5670
endif
71+
72+
" check all the 'msgstr' lines
73+
while getline('.') =~ '^msgstr'
74+
let toline = GetMline()
75+
if fromline != toline
76+
echomsg 'Mismatching % in line ' . (line('.') - 1)
77+
echomsg 'msgid: ' . fromline
78+
echomsg 'msgstr: ' . toline
79+
if error == 0
80+
let error = line('.')
81+
endif
82+
endif
83+
if line('.') == line('$')
84+
break
85+
endif
86+
endwhile
5787
endif
5888

59-
" Find next msgid.
60-
" Wrap around at the end of the file, quit when back at the first one.
61-
/^msgid
62-
if line('.') == startline
89+
" Find next msgid. Quit when there is no more.
90+
let lnum = line('.')
91+
silent! /^msgid\>
92+
if line('.') == lnum
6393
break
6494
endif
6595
endwhile
@@ -74,12 +104,16 @@ endwhile
74104
"
75105
1
76106
if search('msgid "\("\n"\)\?\([EW][0-9]\+:\).*\nmsgstr "\("\n"\)\?[^"]\@=\2\@!') > 0
77-
echo 'Mismatching error/warning code in line ' . line('.')
78-
let error = 1
107+
echomsg 'Mismatching error/warning code in line ' . line('.')
108+
if error == 0
109+
let error = line('.')
110+
endif
79111
endif
80112

81113
if error == 0
82-
echo "OK"
114+
echomsg "OK"
115+
else
116+
exe error
83117
endif
84118

85119
let &wrapscan = s:save_wrapscan

0 commit comments

Comments
 (0)