feat(ui): more intuitive :substitute confirm prompt #31787

Problem:  Unknown key mappings listed in substitute confirm message.
Solution: Include hints as to what the key mappings do.
This commit is contained in:
luukvbaal
2025-01-02 15:40:39 +01:00
committed by GitHub
parent 48e2a73610
commit 43d552c566
36 changed files with 79 additions and 75 deletions

View File

@ -192,7 +192,7 @@ following: >
Vim finds the first occurrence of "Professor" and displays the text it is
about to change. You get the following prompt: >
replace with Teacher (y/n/a/q/l/^E/^Y)?
replace with Teacher? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)
At this point, you must enter one of the following answers:

View File

@ -3793,10 +3793,11 @@ static int do_sub(exarg_T *eap, const proftime_T timeout, const int cmdpreview_n
curwin->w_p_fen = save_p_fen;
snprintf(IObuff, IOSIZE, _("replace with %s (y/n/a/q/l/^E/^Y)?"), sub);
char *prompt = xstrdup(IObuff);
typed = prompt_for_input(prompt, HLF_R, true, NULL);
xfree(prompt);
char *p = _("replace with %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)");
snprintf(IObuff, IOSIZE, p, sub);
p = xstrdup(IObuff);
typed = prompt_for_input(p, HLF_R, true, NULL);
xfree(p);
p_lz = save_p_lz;
RedrawingDisabled = temp;

View File

@ -1353,8 +1353,8 @@ msgid "E146: Regular expressions can't be delimited by letters"
msgstr "E146: Patrone kan nie deur letters afgebaken word nie"
#, c-format
msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
msgstr "vervang met %s (y/n/a/q/l/^E/^Y)?"
msgid "replace with %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgstr "vervang met %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up (^E)/down(^Y)"
msgid "(Interrupted) "
msgstr "(Onderbreek) "

View File

@ -1241,8 +1241,8 @@ msgstr "E146: Les expressions regulars no poden estar delimitades per lletres"
# <20>amb<6D> o <20>per<65> + tecles. eac
#: ../ex_cmds.c:3964
#, c-format
msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
msgstr "substituir amb %s (y/n/a/q/l/^E/^Y)?"
msgid "replace with %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgstr "substituir amb %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
#: ../ex_cmds.c:4379
msgid "(Interrupted) "

View File

@ -1255,8 +1255,8 @@ msgstr "E146: Regul
#: ../ex_cmds.c:3964
#, c-format
msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
msgstr "nahradit za %s (y/n/a/q/l/^E/^Y)?"
msgid "replace with %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgstr "nahradit za %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
#: ../ex_cmds.c:4379
msgid "(Interrupted) "

View File

@ -1255,8 +1255,8 @@ msgstr "E146: Regul
#: ../ex_cmds.c:3964
#, c-format
msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
msgstr "nahradit za %s (y/n/a/q/l/^E/^Y)?"
msgid "replace with %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgstr "nahradit za %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
#: ../ex_cmds.c:4379
msgid "(Interrupted) "

View File

@ -984,8 +984,8 @@ msgid "E146: Regular expressions can't be delimited by letters"
msgstr "E146: Regulære udtryk kan ikke afgrænses af bogstaver"
#, c-format
msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
msgstr "erstat med %s (y/n/a/q/l/^E/^Y)?"
msgid "replace with %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgstr "erstat med %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgid "(Interrupted) "
msgstr "(Afbrudt) "

View File

@ -666,8 +666,8 @@ msgstr "E146: Regul
#: ../ex_cmds.c:3958
#, c-format
msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
msgstr "ersetze durch %s (y/n/a/q/l/^E/^Y)?"
msgid "replace with %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgstr "ersetze durch %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
#: ../ex_cmds.c:4373
msgid "(Interrupted) "

View File

@ -1199,8 +1199,8 @@ msgid "E146: Regular expressions can't be delimited by letters"
msgstr "E146: Regular expressions cannot be delimited by letters"
#: ../ex_cmds.c:3964
#, c-format
msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
#, c-format"
msgid "replace with %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgstr ""
#: ../ex_cmds.c:4379

View File

@ -950,8 +950,8 @@ msgid "E146: Regular expressions can't be delimited by letters"
msgstr "E146: Ne eblas limigi regulesprimon per literoj"
#, c-format
msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
msgstr "ĉu anstataŭigi per %s (y/n/a/q/l/^E/^Y)?"
msgid "replace with %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgstr "ĉu anstataŭigi per %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgid "(Interrupted) "
msgstr "(Interrompita) "

View File

@ -1243,8 +1243,8 @@ msgstr "E146: Las expresiones regulares no se pueden delimitar con letras"
#: ../ex_cmds.c:3964
#, c-format
msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
msgstr "¿Reemplazar con %s (y/n/a/q/l/^E/^Y)?"
msgid "replace with %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgstr "¿Reemplazar con %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
#: ../ex_cmds.c:4379
msgid "(Interrupted) "

View File

@ -1521,8 +1521,8 @@ msgid "E146: Regular expressions can't be delimited by letters"
msgstr "E146: Säännöllistä ilmausta ei voi rajata kirjaimilla"
#, c-format
msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
msgstr "korvaa kohteella %s (y/n/a/q/l/^E/^Y)?"
msgid "replace with %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgstr "korvaa kohteella %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgid "(Interrupted) "
msgstr "(Keskeytetty)"

View File

@ -855,8 +855,8 @@ msgstr ""
"lettres"
#, c-format
msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
msgstr "remplacer par %s (y/n/a/q/l/^E/^Y)?"
msgid "replace with %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgstr "remplacer par %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgid "(Interrupted) "
msgstr "(Interrompu) "

View File

@ -972,8 +972,8 @@ msgstr ""
"E146: N<> cheada<64>tear litreacha mar theormharc<72>ir<69> ar shloinn ionada<64>ochta"
#, c-format
msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
msgstr "cuir %s ina ionad (y/n/a/q/l/^E/^Y)?"
msgid "replace with %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgstr "cuir %s? ina ionad (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgid "(Interrupted) "
msgstr "(Idirbhriste) "

View File

@ -1227,8 +1227,8 @@ msgstr "E146: Le espressioni regolari non possono essere delimitate da lettere"
#: ../ex_cmds.c:3964
#, c-format
msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
msgstr "sostituire con %s (y/n/a/q/l/^E/^Y)?"
msgid "replace with %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgstr "sostituire con %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
#: ../ex_cmds.c:4379
msgid "(Interrupted) "

View File

@ -867,8 +867,8 @@ msgid "E146: Regular expressions can't be delimited by letters"
msgstr "E146: <20><><EFBFBD><EFBFBD>ɽ<EFBFBD><C9BD><EFBFBD><EFBFBD>ʸ<EFBFBD><CAB8><EFBFBD>Ƕ<EFBFBD><C7B6>ڤ뤳<DAA4>Ȥ<EFBFBD><C8A4>Ǥ<EFBFBD><C7A4>ޤ<EFBFBD><DEA4><EFBFBD>"
#, c-format
msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
msgstr "%s <20><><EFBFBD>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD>? (y/n/a/q/l/^E/^Y)"
msgid "replace with %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgstr "%s <20><><EFBFBD>ִ<EFBFBD><D6B4><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD>? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgid "(Interrupted) "
msgstr "(<28><><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4>ޤ<EFBFBD><DEA4><EFBFBD>) "

View File

@ -2998,8 +2998,8 @@ msgid "E146: Regular expressions can't be delimited by letters"
msgstr "E146: 正規表現は文字で区切ることができません"
#, c-format
msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
msgstr "%s に置換しますか? (y/n/a/q/l/^E/^Y)"
msgid "replace with %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgstr "%s に置換しますか? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgid "(Interrupted) "
msgstr "(割込まれました) "

View File

@ -1221,8 +1221,8 @@ msgstr "E146: 정규표현식은 글자로 구분될 수 없습니다"
#: ../ex_cmds.c:3964
#, c-format
msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
msgstr "%s(으)로 바꿈 (y/n/a/q/l/^E/^Y)?"
msgid "replace with %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgstr "%s(으)로 바꿈? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
#: ../ex_cmds.c:4379
msgid "(Interrupted) "

View File

@ -1236,8 +1236,8 @@ msgstr "E146: Regul
#: ../ex_cmds.c:3964
#, c-format
msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
msgstr "Erstatt med %s (y/n/a/q/l/^E/^Y)?"
msgid "replace with %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgstr "Erstatt med %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
#: ../ex_cmds.c:4379
msgid "(Interrupted) "

View File

@ -1223,8 +1223,8 @@ msgstr "E146: reguliere expressies kunnen niet begrensd worden door letters"
#: ../ex_cmds.c:3964
#, c-format
msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
msgstr "vervang door %s (y/n/a/q/l/^E/^Y)?"
msgid "replace with %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgstr "vervang door %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
#: ../ex_cmds.c:4379
msgid "(Interrupted) "

View File

@ -1236,8 +1236,8 @@ msgstr "E146: Regul
#: ../ex_cmds.c:3964
#, c-format
msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
msgstr "Erstatt med %s (y/n/a/q/l/^E/^Y)?"
msgid "replace with %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgstr "Erstatt med %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
#: ../ex_cmds.c:4379
msgid "(Interrupted) "

View File

@ -1207,8 +1207,8 @@ msgstr "E146: Wzorce regularne nie mogą być rozgraniczane literami"
#: ../ex_cmds.c:3964
#, c-format
msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
msgstr "zamień na %s (y/n/a/q/l/^E/^Y)?"
msgid "replace with %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgstr "zamień na %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
#: ../ex_cmds.c:4379
msgid "(Interrupted) "

View File

@ -4216,8 +4216,8 @@ msgstr "E146: Express
#: ../ex_cmds.c:3958
#, c-format
msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
msgstr "substituir por %s (y/n/a/q/l/^E/^Y)?"
msgid "replace with %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgstr "substituir por %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
#: ../ex_cmds.c:4373
msgid "(Interrupted) "

View File

@ -1215,8 +1215,8 @@ msgstr "E146: Регулярные выражения не могут разде
#: ../ex_cmds.c:3964
#, c-format
msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
msgstr "заменить на %s? (y/n/a/q/l/^E/^Y)"
msgid "replace with %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgstr "заменить на %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
#: ../ex_cmds.c:4379
msgid "(Interrupted) "

View File

@ -1224,8 +1224,8 @@ msgstr "E146: Regul
#: ../ex_cmds.c:3964
#, c-format
msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
msgstr "nahradi<64> %s (y/n/a/q/l/^E/^Y)?"
msgid "replace with %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgstr "nahradi<64> %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
#: ../ex_cmds.c:4379
msgid "(Interrupted) "

View File

@ -1224,8 +1224,8 @@ msgstr "E146: Regul
#: ../ex_cmds.c:3964
#, c-format
msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
msgstr "nahradi<64> %s (y/n/a/q/l/^E/^Y)?"
msgid "replace with %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgstr "nahradi<64> %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
#: ../ex_cmds.c:4379
msgid "(Interrupted) "

View File

@ -1201,8 +1201,8 @@ msgid "E146: Regular expressions can't be delimited by letters"
msgstr "E146: Регуларни изрази не могу да се раздвајају словима"
#, c-format
msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
msgstr "заменити са %s (y/n/a/q/l/^E/^Y)?"
msgid "replace with %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgstr "заменити са %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgid "(Interrupted) "
msgstr "(Прекинуто)"

View File

@ -2628,8 +2628,8 @@ msgstr "E146: Regulj
#: ../ex_cmds.c:3958
#, c-format
msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
msgstr "ers<72>tt med %s (y/n/a/q/l/^E/^Y)?"
msgid "replace with %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgstr "ers<72>tt med %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
#: ../ex_cmds.c:4373
msgid "(Interrupted) "

View File

@ -1867,8 +1867,8 @@ msgid "E146: Regular expressions can't be delimited by letters"
msgstr "E146: Düzenli ifadeler harflerle sınırlandırılamaz"
#, c-format
msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
msgstr "%s ile değiştir (y/n/a/q/l/^E/^Y)?"
msgid "replace with %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgstr "%s ile değiştir? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgid "(Interrupted) "
msgstr "(Yarıda kesildi) "

View File

@ -3008,8 +3008,8 @@ msgid "E146: Regular expressions can't be delimited by letters"
msgstr "E146: Регулярні вирази не можна розділяти літерами"
#, c-format
msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
msgstr "Замінити на %s (y/n/a/q/l/^E/^Y)?"
msgid "replace with %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgstr "Замінити на %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgid "(Interrupted) "
msgstr "(Перервано) "

View File

@ -779,8 +779,8 @@ msgid "E146: Regular expressions can't be delimited by letters"
msgstr "E146: Không thể phân cách biểu thức chính quy bằng chữ cái"
#, c-format
msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
msgstr "thay thế bằng %s? (y/n/a/q/l/^E/^Y)"
msgid "replace with %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgstr "thay thế bằng %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgid "(Interrupted) "
msgstr "(bị dừng)"

View File

@ -1991,8 +1991,8 @@ msgstr "E146: 正则表达式不能用字母作分界"
#. Same highlight as wait_return().
#: ../ex_cmds.c:3952
#, c-format
msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
msgstr "替换为 %s (y/n/a/q/l/^E/^Y)"
msgid "replace with %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgstr "替换为 %s(y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
#: ../ex_cmds.c:4462
msgid "(Interrupted) "

View File

@ -1267,8 +1267,8 @@ msgstr "E146: Regular expression 無法用字母分隔 (?)"
#: ../ex_cmds.c:3964
#, c-format
msgid "replace with %s (y/n/a/q/l/^E/^Y)?"
msgstr "取代為 %s (y/n/a/q/^E/^Y)?"
msgid "replace with %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
msgstr "取代為 %s? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)"
#: ../ex_cmds.c:4379
msgid "(Interrupted) "

View File

@ -220,8 +220,10 @@ describe(':substitute', function()
{2:o}ne |
two |
three |
{1:~ }|*4
{6:replace with (y/n/a/q/l/^E/^Y)?}^ |
{1:~ }|*2
{3: }|
{6:replace with ? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^}|
{6:E)/down(^Y)}^ |
]])
end)
end)

View File

@ -1485,10 +1485,10 @@ describe('cmdheight=0', function()
it('when substitute text', function()
command('set cmdheight=0 noruler laststatus=3')
feed('ifoo<ESC>')
screen:try_resize(screen._width, 6)
screen:try_resize(screen._width, 7)
screen:expect([[
fo^o |
{1:~ }|*4
{1:~ }|*5
{3:[No Name] [+] }|
]])
@ -1497,14 +1497,15 @@ describe('cmdheight=0', function()
{2:foo} |
{3: }|
|*2
{6:replace with bar (y/n/a/q}|
{6:/l/^E/^Y)?}^ |
{6:replace with bar? (y)es/(}|
{6:n)o/(a)ll/(q)uit/(l)ast/s}|
{6:croll up(^E)/down(^Y)}^ |
]])
feed('y')
screen:expect([[
^bar |
{1:~ }|*4
{1:~ }|*5
{3:[No Name] [+] }|
]])

View File

@ -141,7 +141,7 @@ describe('ui/ext_messages', function()
content = { { '' } },
hl_id = 18,
pos = 0,
prompt = 'replace with X (y/n/a/q/l/^E/^Y)?',
prompt = 'replace with X? (y)es/(n)o/(a)ll/(q)uit/(l)ast/scroll up(^E)/down(^Y)',
},
},
})