add special characters \u \U \l \L to fakevim substitute command

vim substitute (:s/) hast the option to use special characters
\u \U \l \L in the replacement part to change the case of the
following letters. This was not present in fakevim.

Change-Id: I13785db24018283c242d94fd7892765657570176
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Timon Riedelbauch
2021-02-01 02:46:07 +01:00
parent d1934fa1c4
commit 002db1fa42
2 changed files with 76 additions and 4 deletions

View File

@@ -3006,6 +3006,18 @@ void FakeVimPlugin::test_vim_substitute()
COMMAND("undo | s/[bcef]//g", "a d");
COMMAND("undo | s/\\w//g", " ");
COMMAND("undo | s/f\\|$/-/g", "abc de-");
// modifiers
data.setText("abC dEfGh");
COMMAND("s/b...E/\\u&", "aBC dEfGh");
COMMAND("undo | s/b...E/\\U&/g", "aBC DEfGh");
COMMAND("undo | s/C..E/\\l&/g", "abc dEfGh");
COMMAND("undo | s/b...E/\\L&/g", "abc defGh");
COMMAND("undo | s/\\(b...E\\)/\\u\\1/g", "aBC dEfGh");
COMMAND("undo | s/\\(b...E\\)/\\U\\1/g", "aBC DEfGh");
COMMAND("undo | s/\\(C..E\\)/\\l\\1/g", "abc dEfGh");
COMMAND("undo | s/\\(b...E\\)/\\L\\1/g", "abc defGh");
}
void FakeVimPlugin::test_vim_ex_commandbuffer_paste()