patch 9.1.1479: regression when displaying localized percentage position
Problem: regression when displaying localized percentage position
(after v9.1.1291)
Solution: calculate percentage first (Emir SARI)
Cleanups made in ec032de broke the Turkish percent display, failing to
prepend it properly in cases between 0 and 10. In Turkish, the percent
sign is prepended to the number, so it was displaying it as `% 5`
(should have been `%5`), while displaying numbers bigger than 9 properly.
related: #17597
Signed-off-by: Emir SARI <emir_sari@icloud.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/testdir/test_normal.vim b/src/testdir/test_normal.vim
index cbd90ec..a8fe7b5 100644
--- a/src/testdir/test_normal.vim
+++ b/src/testdir/test_normal.vim
@@ -4377,4 +4377,30 @@
bwipe!
endfunc
+func Test_pos_percentage_in_turkish_locale()
+ throw 'Skipped: FIXME: please remove throw when Turkish locale has been updated!'
+ CheckRunVimInTerminal
+ defer execute(':lang C')
+
+ try
+ let dir = expand('$VIMRUNTIME/lang/tr/')
+ let target = expand('$VIMRUNTIME/lang/tr/LC_MESSAGES/')
+ let tr = '../po/tr.mo'
+ call mkdir(dir, 'R')
+ call mkdir(target, '')
+ call filecopy(tr, target .. 'vim.mo')
+ lang tr_TR.UTF-8
+ let buf = RunVimInTerminal('', {'rows': 5})
+ call term_sendkeys(buf, ":lang tr_TR.UTF-8\<cr>")
+ call term_sendkeys(buf, ":put =range(1,40)\<cr>")
+ call term_sendkeys(buf, ":5\<cr>")
+ call WaitForAssert({-> assert_match('%8$', term_getline(buf, 5))})
+
+ call StopVimInTerminal(buf)
+ catch /E197:/
+ " can't use Turkish locale
+ throw 'Skipped: Turkish locale not available'
+ endtry
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab nofoldenable