This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Indenting of pasted lines and parameters | ||
---|---|---|---|
Product: | editor | Reporter: | darrinps <darrinps> |
Component: | Formatting & Indentation | Assignee: | Dusan Balek <dbalek> |
Status: | REOPENED --- | ||
Severity: | blocker | CC: | gsporar, smig, ssteiner, wadechandler |
Priority: | P3 | ||
Version: | 6.x | ||
Hardware: | PC | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: |
Description
darrinps
2007-07-31 19:20:05 UTC
You can use smart-paste (ctrl-shift-v) to paste to the right position. The rest is rather an enhancement than a bug I opened a defect on the ctrl-shift-v suggestion you made as it does nothing (not even paste) in NB6M10 from the build of the 27th of July. I would still like to see the auto format take place like it does in Eclipse instead of needing to use the keystrokes though if time permits. Yes, CTRL-SHIFT-V pastes for me, but it does not do anything different. It seems to work exactly the same as CTRL-V. I'm not sure if I have tried this in the most recent dailies though, so next time I'm on my other system I'll try. It seems though this would be something we would want to do on paste in any editor which has a formatter. Is there any reason why paste would not be expected to put the pasted text into the format of the formatter associated with the given document? Well, a long ago there was a discussion about whether the default on ctrl-v should be formatted paste or regular paste and the result was that the formatted paste should be on an extra shortcut. Feel free to raise a discussion about this on nbui mailing list and I'll possibly revert it then. I think it makes more sense to have the regular ctrl-v paste "do the right thing", which would of course mean that it be smart about what and where it is pasting and adjust the indent accordingly. One of the goals of an IDE is to take care of all these irritating little things for me in the first place. It would be very rare for the automatic indent fix to be the wrong thing to do when pasting in Java code. I agree with swpalmer, If there is a formatter and it will be used for a file type then I'm not sure when it would be unwanted that the formatting matches the rest of the document. I guess if one opened a file and it was formatted differently they wouldn't want to have the formatting match the rest of their file, but how often will this actually be? I think it would be the minority use case. What would be wrong with simply doing the same thing that Eclipse does? In Eclipse, when you copy and paste, the newly pasted line is indented in relationship to the line above. The way it is now in Netbeans, every time I copy and paste, I then have to go and manually add or remove spaces to get the text to line up. In short, don't make the user use shortcut keys or anything manual at all...just do it like Eclipse (and other IDEs). *** Issue 128766 has been marked as a duplicate of this issue. *** *** Issue 56906 has been marked as a duplicate of this issue. *** Any idea what version this might make it into? Darin, Does it work with CTRL+SHIFT+V? Was that resolved? If it does you can change your keymap in Tools|Options|Keymap to switch the action around for the keystrokes. Obviously if CTRL+SHIFT+V doesn't work yet that won't be possible. I have used the CTRL-SHIFT-V rebound to CTRL-V workaround... and it is reasonable.. but if we want to go the extra mile, and match what the competition does... the past should also automatically add any missing imports for the pasted code (it is should know 100% which specific class needs importing if the code was copied or cut from another editor in the IDE) *** Bug 186429 has been marked as a duplicate of this bug. *** This old bug may not be relevant anymore. If you can still reproduce it in 8.2 development builds please reopen this issue. Thanks for your cooperation, NetBeans IDE 8.2 Release Boss like darrinps, I also almost always have to manually indent when pasting blocks of code inside other code - that's very annoying. Smart paste should be taking care of it, but it doesn't [NetBeans IDE 8.2 (Build 201609300101)] |