1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2025-02-25 02:46:01 +01:00

Fix characters yanking

This commit is contained in:
Alex Plate 2021-01-23 02:18:04 +03:00
parent 28abf15720
commit 51f1e6f866
No known key found for this signature in database
GPG Key ID: 0B97153C8FFEC09F
5 changed files with 29 additions and 5 deletions
CHANGES.md
src/com/maddyhome/idea/vim
test/org/jetbrains/plugins/ideavim/extension/surround

View File

@ -26,6 +26,9 @@ usual beta standards.
### Fixes:
* [VIM-2202](https://youtrack.jetbrains.com/issue/VIM-2202) Fix macro recording for ex command and search
* [VIM-1799](https://youtrack.jetbrains.com/issue/VIM-1799)
[VIM-1794](https://youtrack.jetbrains.com/issue/VIM-179a)
Special characters are not interpreted on yanking
## 0.64, 2020-12-23

View File

@ -36,6 +36,7 @@ class DeleteCharacterAction : ChangeEditorActionHandler.ForEachCaret() {
rawCount: Int,
argument: Argument?
): Boolean {
"\n"
return VimPlugin.getChange().deleteCharacter(editor, caret, 1, false)
}
}

View File

@ -344,13 +344,19 @@ public class RegisterGroup implements PersistentStateComponent<Element> {
final PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
if (file == null) return text;
String rawText = TextBlockTransferable.convertLineSeparators(text, "\n", transferableDatas);
String escapedText;
for (CopyPastePreProcessor processor : CopyPastePreProcessor.EP_NAME.getExtensionList()) {
escapedText = processor.preprocessOnCopy(file, textRange.getStartOffsets(), textRange.getEndOffsets(), rawText);
if (escapedText != null) {
return escapedText;
if (OptionsManager.INSTANCE.getIdeacopypreprocess().getValue()) {
String escapedText;
for (CopyPastePreProcessor processor : CopyPastePreProcessor.EP_NAME.getExtensionList()) {
escapedText = processor.preprocessOnCopy(file, textRange.getStartOffsets(), textRange.getEndOffsets(), rawText);
if (escapedText != null) {
return escapedText;
}
}
}
return text;
}

View File

@ -90,6 +90,9 @@ object OptionsManager {
val ideawrite = addOption(BoundStringOption("ideawrite", "ideawrite", IdeaWriteData.all, IdeaWriteData.allValues))
val ideavimsupport = addOption(BoundListOption("ideavimsupport", "ideavimsupport", arrayOf("dialog"), arrayOf("dialog", "singleline", "dialoglegacy")))
// This should be removed in the next versions
val ideacopypreprocess = addOption(ToggleOption("ideacopypreprocess", "ideacopypreprocess", false))
fun isSet(name: String): Boolean {
val option = getOption(name)
return option is ToggleOption && option.getValue()

View File

@ -429,4 +429,15 @@ class VimSurroundExtensionTest : VimTestCase() {
typeText(parseKeys("cs(]"))
myFixture.checkResult(after)
}
fun `test change new line`() {
val before = """
"\n"
""".trimIndent()
configureByText(before)
typeText(parseKeys("cs\"'"))
val after = """'\n'"""
myFixture.checkResult(after)
}
}