Merge remote-tracking branch 'krobelus/validate-empty-prompt'

This commit is contained in:
Maxime Coste 2024-01-17 20:59:26 +11:00
commit 4bb1f17928
6 changed files with 18 additions and 4 deletions

View File

@ -866,7 +866,8 @@ void regex_prompt(Context& context, String prompt, char reg, T func)
RegisterManager::instance()[reg].set(context, str.str()); RegisterManager::instance()[reg].set(context, str.str());
break; break;
case PromptEvent::Validate: case PromptEvent::Validate:
RegisterManager::instance()[reg].set(context, str.str()); if (not str.empty())
RegisterManager::instance()[reg].set(context, str.str());
context.push_jump(); context.push_jump();
break; break;
} }

View File

@ -1,10 +1,13 @@
ui_out -ignore 7 ui_out -ignore 7
ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "i" ] }' ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "i" ] }'
ui_out -ignore 4
ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "a" ] }' ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "a" ] }'
ui_out -ignore 8 ui_out -ignore 4
ui_in '{ "jsonrpc": "2.0", "method": "mouse_press", "params": [ "left", 0, 2 ] }' ui_in '{ "jsonrpc": "2.0", "method": "mouse_press", "params": [ "left", 0, 2 ] }'
ui_out -ignore 4
ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "b" ] }' ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "b" ] }'
ui_out -ignore 8 ui_out -ignore 4
ui_in '{ "jsonrpc": "2.0", "method": "mouse_release", "params": [ "left", 0, 4 ] }' ui_in '{ "jsonrpc": "2.0", "method": "mouse_release", "params": [ "left", 0, 4 ] }'
ui_out -ignore 4
ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "c<esc>" ] }' ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "c<esc>" ] }'
ui_out -ignore 1 ui_out -ignore 4

View File

@ -0,0 +1 @@
abab

View File

@ -0,0 +1,7 @@
ui_out -ignore 7
ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "xsa<ret>" ] }'
ui_out -ignore 6
ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "xs<ret>" ] }'
ui_out -ignore 5
ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "xs<ret>" ] }'
ui_out -ignore 5