patch 8.2.3068: Unicode tables are slightly outdated
Problem: Unicode tables are slightly outdated.
Solution: Update the tables for Unicode release 13. (Christian Brabandt
closes #8430)
diff --git a/runtime/tools/unicode.vim b/runtime/tools/unicode.vim
index 5859f34..6da013e 100644
--- a/runtime/tools/unicode.vim
+++ b/runtime/tools/unicode.vim
@@ -195,6 +195,13 @@
let end = -1
let ranges = []
let dataidx = 0
+ " Account for indentation differences between ambiguous and doublewidth
+ " table in mbyte.c
+ if a:pattern == 'A'
+ let spc = ' '
+ else
+ let spc = "\t"
+ endif
for p in s:widthprops
if p[1][0] =~ a:pattern
if p[0] =~ '\.\.'
@@ -229,7 +236,7 @@
else
if start >= 0
" produce previous range
- call add(ranges, printf("\t{0x%04x, 0x%04x},", start, end))
+ call add(ranges, printf("%s{0x%04x, 0x%04x},", spc, start, end))
if a:pattern == 'A'
call add(s:ambitable, [start, end])
else
@@ -243,7 +250,7 @@
endif
endfor
if start >= 0
- call add(ranges, printf("\t{0x%04x, 0x%04x},", start, end))
+ call add(ranges, printf("%s{0x%04x, 0x%04x},", spc, start, end))
if a:pattern == 'A'
call add(s:ambitable, [start, end])
else
@@ -254,11 +261,20 @@
" New buffer to put the result in.
new
exe "file " . a:tableName
- call setline(1, " static struct interval " . a:tableName . "[] =")
- call setline(2, " {")
+ if a:pattern == 'A'
+ call setline(1, "static struct interval " . a:tableName . "[] =")
+ call setline(2, "{")
+ else
+ call setline(1, " static struct interval " . a:tableName . "[] =")
+ call setline(2, " {")
+ endif
call append('$', ranges)
call setline('$', getline('$')[:-2]) " remove last comma
- call setline(line('$') + 1, " };")
+ if a:pattern == 'A'
+ call setline(line('$') + 1, "};")
+ else
+ call setline(line('$') + 1, " };")
+ endif
wincmd p
endfunc