comparison runtime/tools/unicode.vim @ 25062:042560a16d4e v8.2.3068

patch 8.2.3068: Unicode tables are slightly outdated Commit: https://github.com/vim/vim/commit/d887297ad0164516dd52cdab0308c3626337d124 Author: Christian Brabandt <cb@256bit.org> Date: Sun Jun 27 21:30:14 2021 +0200 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)
author Bram Moolenaar <Bram@vim.org>
date Sun, 27 Jun 2021 21:45:02 +0200
parents bbca88cd13d5
children 3ee335235412
comparison
equal deleted inserted replaced
25061:d4239ea7cdd6 25062:042560a16d4e
193 func! BuildWidthTable(pattern, tableName) 193 func! BuildWidthTable(pattern, tableName)
194 let start = -1 194 let start = -1
195 let end = -1 195 let end = -1
196 let ranges = [] 196 let ranges = []
197 let dataidx = 0 197 let dataidx = 0
198 " Account for indentation differences between ambiguous and doublewidth
199 " table in mbyte.c
200 if a:pattern == 'A'
201 let spc = ' '
202 else
203 let spc = "\t"
204 endif
198 for p in s:widthprops 205 for p in s:widthprops
199 if p[1][0] =~ a:pattern 206 if p[1][0] =~ a:pattern
200 if p[0] =~ '\.\.' 207 if p[0] =~ '\.\.'
201 " It is a range. we don't check for composing char then. 208 " It is a range. we don't check for composing char then.
202 let rng = split(p[0], '\.\.') 209 let rng = split(p[0], '\.\.')
227 if start >= 0 && end + 1 == n 234 if start >= 0 && end + 1 == n
228 " continue with same range. 235 " continue with same range.
229 else 236 else
230 if start >= 0 237 if start >= 0
231 " produce previous range 238 " produce previous range
232 call add(ranges, printf("\t{0x%04x, 0x%04x},", start, end)) 239 call add(ranges, printf("%s{0x%04x, 0x%04x},", spc, start, end))
233 if a:pattern == 'A' 240 if a:pattern == 'A'
234 call add(s:ambitable, [start, end]) 241 call add(s:ambitable, [start, end])
235 else 242 else
236 call add(s:doubletable, [start, end]) 243 call add(s:doubletable, [start, end])
237 endif 244 endif
241 let end = n_last 248 let end = n_last
242 endif 249 endif
243 endif 250 endif
244 endfor 251 endfor
245 if start >= 0 252 if start >= 0
246 call add(ranges, printf("\t{0x%04x, 0x%04x},", start, end)) 253 call add(ranges, printf("%s{0x%04x, 0x%04x},", spc, start, end))
247 if a:pattern == 'A' 254 if a:pattern == 'A'
248 call add(s:ambitable, [start, end]) 255 call add(s:ambitable, [start, end])
249 else 256 else
250 call add(s:doubletable, [start, end]) 257 call add(s:doubletable, [start, end])
251 endif 258 endif
252 endif 259 endif
253 260
254 " New buffer to put the result in. 261 " New buffer to put the result in.
255 new 262 new
256 exe "file " . a:tableName 263 exe "file " . a:tableName
257 call setline(1, " static struct interval " . a:tableName . "[] =") 264 if a:pattern == 'A'
258 call setline(2, " {") 265 call setline(1, "static struct interval " . a:tableName . "[] =")
266 call setline(2, "{")
267 else
268 call setline(1, " static struct interval " . a:tableName . "[] =")
269 call setline(2, " {")
270 endif
259 call append('$', ranges) 271 call append('$', ranges)
260 call setline('$', getline('$')[:-2]) " remove last comma 272 call setline('$', getline('$')[:-2]) " remove last comma
261 call setline(line('$') + 1, " };") 273 if a:pattern == 'A'
274 call setline(line('$') + 1, "};")
275 else
276 call setline(line('$') + 1, " };")
277 endif
262 wincmd p 278 wincmd p
263 endfunc 279 endfunc
264 280
265 281
266 " Get characters from a list of lines in form "12ab .." or "12ab..56cd ..." 282 " Get characters from a list of lines in form "12ab .." or "12ab..56cd ..."