summaryrefslogtreecommitdiffstats
path: root/runtime
diff options
context:
space:
mode:
authorChristian Brabandt <cb@256bit.org>2021-06-27 21:30:14 +0200
committerBram Moolenaar <Bram@vim.org>2021-06-27 21:30:14 +0200
commitd887297ad0164516dd52cdab0308c3626337d124 (patch)
treee98d66e8da8cbe529487ed6d15e800ab33bf25dd /runtime
parent1d1ce613cdc74721499660b1d8911de164e2862d (diff)
patch 8.2.3068: Unicode tables are slightly outdatedv8.2.3068
Problem: Unicode tables are slightly outdated. Solution: Update the tables for Unicode release 13. (Christian Brabandt closes #8430)
Diffstat (limited to 'runtime')
-rw-r--r--runtime/tools/unicode.vim26
1 files changed, 21 insertions, 5 deletions
diff --git a/runtime/tools/unicode.vim b/runtime/tools/unicode.vim
index 5859f34738..6da013ef89 100644
--- a/runtime/tools/unicode.vim
+++ b/runtime/tools/unicode.vim
@@ -195,6 +195,13 @@ func! BuildWidthTable(pattern, tableName)
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 @@ func! BuildWidthTable(pattern, tableName)
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 @@ func! BuildWidthTable(pattern, tableName)
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 @@ func! BuildWidthTable(pattern, tableName)
" 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