fix: Copying strings and bad names

This commit is contained in:
WerWolv 2023-01-28 21:12:08 +01:00
parent 86be1ef1ec
commit c861bf9a5e
9 changed files with 6 additions and 16 deletions

View File

@ -653,7 +653,7 @@
"hex.builtin.view.hex_editor.copy.crystal": "Crystal Array",
"hex.builtin.view.hex_editor.copy.csharp": "C# Array",
"hex.builtin.view.hex_editor.copy.go": "Go Array",
"hex.builtin.view.hex_editor.copy.hex": "Hex String",
"hex.builtin.view.hex_editor.copy.ascuu": "Hex String",
"hex.builtin.view.hex_editor.copy.html": "HTML",
"hex.builtin.view.hex_editor.copy.java": "Java Array",
"hex.builtin.view.hex_editor.copy.js": "JavaScript Array",

View File

@ -649,14 +649,14 @@
"hex.builtin.view.help.name": "Help",
"hex.builtin.view.help.pattern_cheat_sheet": "Pattern Language Cheat Sheet",
"hex.builtin.view.hex_editor.copy.address": "Address",
"hex.builtin.view.hex_editor.copy.ascii": "Text Area",
"hex.builtin.view.hex_editor.copy.ascii": "ASCII String",
"hex.builtin.view.hex_editor.copy.base64": "Base64",
"hex.builtin.view.hex_editor.copy.c": "C Array",
"hex.builtin.view.hex_editor.copy.cpp": "C++ Array",
"hex.builtin.view.hex_editor.copy.crystal": "Crystal Array",
"hex.builtin.view.hex_editor.copy.csharp": "C# Array",
"hex.builtin.view.hex_editor.copy.go": "Go Array",
"hex.builtin.view.hex_editor.copy.hex": "Hex String",
"hex.builtin.view.hex_editor.copy.hex_view": "Hex View",
"hex.builtin.view.hex_editor.copy.html": "HTML",
"hex.builtin.view.hex_editor.copy.java": "Java Array",
"hex.builtin.view.hex_editor.copy.js": "JavaScript Array",

View File

@ -646,14 +646,12 @@
"hex.builtin.view.help.name": "Aiuto",
"hex.builtin.view.help.pattern_cheat_sheet": "Pattern Language Cheat Sheet",
"hex.builtin.view.hex_editor.copy.address": "***** MISSING TRANSLATION *****",
"hex.builtin.view.hex_editor.copy.ascii": "***** MISSING TRANSLATION *****",
"hex.builtin.view.hex_editor.copy.base64": "Base64",
"hex.builtin.view.hex_editor.copy.c": "C Array",
"hex.builtin.view.hex_editor.copy.cpp": "C++ Array",
"hex.builtin.view.hex_editor.copy.crystal": "Crystal Array",
"hex.builtin.view.hex_editor.copy.csharp": "C# Array",
"hex.builtin.view.hex_editor.copy.go": "Go Array",
"hex.builtin.view.hex_editor.copy.hex": "Hex Stringa",
"hex.builtin.view.hex_editor.copy.html": "HTML",
"hex.builtin.view.hex_editor.copy.java": "Java Array",
"hex.builtin.view.hex_editor.copy.js": "JavaScript Array",

View File

@ -646,14 +646,12 @@
"hex.builtin.view.help.name": "ヘルプ",
"hex.builtin.view.help.pattern_cheat_sheet": "パターン言語リファレンス",
"hex.builtin.view.hex_editor.copy.address": "***** MISSING TRANSLATION *****",
"hex.builtin.view.hex_editor.copy.ascii": "***** MISSING TRANSLATION *****",
"hex.builtin.view.hex_editor.copy.base64": "Base64",
"hex.builtin.view.hex_editor.copy.c": "C 配列",
"hex.builtin.view.hex_editor.copy.cpp": "C++ 配列",
"hex.builtin.view.hex_editor.copy.crystal": "Crystal 配列",
"hex.builtin.view.hex_editor.copy.csharp": "C# 配列",
"hex.builtin.view.hex_editor.copy.go": "Go 配列",
"hex.builtin.view.hex_editor.copy.hex": "文字列",
"hex.builtin.view.hex_editor.copy.html": "HTML",
"hex.builtin.view.hex_editor.copy.java": "Java 配列",
"hex.builtin.view.hex_editor.copy.js": "JavaScript 配列",

View File

@ -646,14 +646,12 @@
"hex.builtin.view.help.name": "도움말",
"hex.builtin.view.help.pattern_cheat_sheet": "패턴 언어 치트시트",
"hex.builtin.view.hex_editor.copy.address": "***** MISSING TRANSLATION *****",
"hex.builtin.view.hex_editor.copy.ascii": "***** MISSING TRANSLATION *****",
"hex.builtin.view.hex_editor.copy.base64": "Base64",
"hex.builtin.view.hex_editor.copy.c": "C 배열",
"hex.builtin.view.hex_editor.copy.cpp": "C++ 배열",
"hex.builtin.view.hex_editor.copy.crystal": "Crystal 배열",
"hex.builtin.view.hex_editor.copy.csharp": "C# 배열",
"hex.builtin.view.hex_editor.copy.go": "Go 배열",
"hex.builtin.view.hex_editor.copy.hex": "문자열",
"hex.builtin.view.hex_editor.copy.html": "HTML",
"hex.builtin.view.hex_editor.copy.java": "Java 배열",
"hex.builtin.view.hex_editor.copy.js": "JavaScript 배열",

View File

@ -646,14 +646,12 @@
"hex.builtin.view.help.name": "Ajuda",
"hex.builtin.view.help.pattern_cheat_sheet": "Pattern Language Cheat Sheet",
"hex.builtin.view.hex_editor.copy.address": "***** MISSING TRANSLATION *****",
"hex.builtin.view.hex_editor.copy.ascii": "***** MISSING TRANSLATION *****",
"hex.builtin.view.hex_editor.copy.base64": "Base64",
"hex.builtin.view.hex_editor.copy.c": "C Array",
"hex.builtin.view.hex_editor.copy.cpp": "C++ Array",
"hex.builtin.view.hex_editor.copy.crystal": "Crystal Array",
"hex.builtin.view.hex_editor.copy.csharp": "C# Array",
"hex.builtin.view.hex_editor.copy.go": "Go Array",
"hex.builtin.view.hex_editor.copy.hex": "String",
"hex.builtin.view.hex_editor.copy.html": "HTML",
"hex.builtin.view.hex_editor.copy.java": "Java Array",
"hex.builtin.view.hex_editor.copy.js": "JavaScript Array",

View File

@ -646,14 +646,12 @@
"hex.builtin.view.help.name": "幫助",
"hex.builtin.view.help.pattern_cheat_sheet": "模式語言小抄",
"hex.builtin.view.hex_editor.copy.address": "地址",
"hex.builtin.view.hex_editor.copy.ascii": "文字區域",
"hex.builtin.view.hex_editor.copy.base64": "Base64",
"hex.builtin.view.hex_editor.copy.c": "C 陣列",
"hex.builtin.view.hex_editor.copy.cpp": "C++ 陣列",
"hex.builtin.view.hex_editor.copy.crystal": "Crystal 陣列",
"hex.builtin.view.hex_editor.copy.csharp": "C# 陣列",
"hex.builtin.view.hex_editor.copy.go": "Go 陣列",
"hex.builtin.view.hex_editor.copy.hex": "字串",
"hex.builtin.view.hex_editor.copy.html": "HTML",
"hex.builtin.view.hex_editor.copy.java": "Java 陣列",
"hex.builtin.view.hex_editor.copy.js": "JavaScript 陣列",

View File

@ -100,7 +100,7 @@ namespace hex::plugin::builtin {
return std::string(result.begin(), result.end());
});
ContentRegistry::DataFormatter::add("hex.builtin.view.hex_editor.copy.ascii", [](prv::Provider *provider, u64 offset, size_t size) {
ContentRegistry::DataFormatter::add("hex.builtin.view.hex_editor.copy.hex_view", [](prv::Provider *provider, u64 offset, size_t size) {
constexpr static auto HeaderLine = "Hex View 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F\n";
std::string result;
result.reserve(std::string(HeaderLine).size() * size / 0x10);

View File

@ -669,7 +669,7 @@ namespace hex::plugin::builtin {
std::string buffer(selection.size, 0x00);
buffer.reserve(selection.size);
provider->read(selection.getStartAddress() + provider->getBaseAddress() + provider->getCurrentPageAddress(), buffer.data(), selection.size);
provider->read(selection.getStartAddress(), buffer.data(), selection.size);
ImGui::SetClipboardText(buffer.c_str());
}
@ -980,7 +980,7 @@ namespace hex::plugin::builtin {
copyBytes(*selection);
if (ImGui::BeginMenu("hex.builtin.view.hex_editor.menu.edit.copy_as"_lang, selection.has_value() && providerValid)) {
if (ImGui::MenuItem("hex.builtin.view.hex_editor.copy.hex"_lang, (CTRLCMD_NAME + " + "s + SHIFT_NAME + " + C"s).c_str()))
if (ImGui::MenuItem("hex.builtin.view.hex_editor.copy.ascii"_lang, (CTRLCMD_NAME + " + "s + SHIFT_NAME + " + C"s).c_str()))
copyString(*selection);
if (ImGui::MenuItem("hex.builtin.view.hex_editor.copy.address"_lang))
ImGui::SetClipboardText(hex::format("0x{:08X}", selection->getStartAddress()).c_str());