Open BernhardBln opened 3 years ago
Where is mentioned that it duplicates the line?
Oh, found it :) That is wrong :-)
Not quite the fix I hoped for but fair enough 😂
Duplicating selection is more universal, not sure if it is worth to make a line feature.
I agree, easiest solution would be to have a "duplicate selection / whole line" toggle button in the settings where you could change this globally for all StringManipulation duplicate actions.
Would love to help, but honestly never done an IntelliJ plugin...
Describe the bug I feel there is some inconsistency regarding the "duplicate and increment" feature.
In the docs it is mentioned that it "duplicates the line" which it does when you just have the cursor in the current line. It does not duplicate the full lines however when you make a selection.
IntelliJ internally has two different commands, "duplicate" and "duplicate line", where the latter always duplicates the full lines.
I think it would make more sense to duplicate full lines rather than just selections (or at least make it configurable in the settings).
To Reproduce Steps to reproduce the behavior:
In case you properly select everything:
and then choose "duplicate and increment", this will work as expected:
However, if you just select just somewhere in the middle, like this:
this will produce broken code:
Expected behavior
The line duplication should work the same way as the "duplicate line" feature in IntelliJ, duplicating whole lines instead of just the selection.
Environment : IntelliJ IDEA 2020.3.3 (Ultimate Edition) Build #IU-203.7717.56, built on March 15, 2021 Licensed to Bernhard Streit Subscription is active until April 24, 2021. Runtime version: 11.0.10+8-b1145.96 x86_64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. macOS 10.16 GC: ParNew, ConcurrentMarkSweep Memory: 5391M Cores: 16 Registry: analyze.exceptions.on.the.fly=true, ide.tooltip.initialDelay=674, ide.appIcon.requestAttention=false Non-Bundled Plugins: AceJump, IdeaVIM, org.jetbrains.IdeaVim-EasyMotion, com.github.holgerbrandl.pasteimages/, google-java-format, com.crunch42.openapi, EclipseCodeFormatter, GrepConsole, String Manipulation, com.dubreuia, com.krrrr38.idea.mockito.postfix, com.sunny.plugin.MockitoGenPlugin, com.jetbrains.codeWithMe, idea.plugin.protoeditor, org.sonarlint.idea, MavenRunHelper, intellij.prettierJS, org.jetbrains.kotlin, org.bitstrings.idea.plugins.TestInsanity, org.mapstruct.intellij, PlantUML integration