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.

Bug 146810

Summary: [65cat] "Find" action not recordable by macro recording
Product: editor Reporter: ulfzibis <ulfzibis>
Component: MacrosAssignee: Svata Dedic <sdedic>
Status: NEW ---    
Severity: blocker    
Priority: P2    
Version: 6.x   
Hardware: PC   
OS: Windows XP   
Issue Type: ENHANCEMENT Exception Reporter:

Description ulfzibis 2008-09-10 17:26:16 UTC
[ BUILD # : 200809031401 ]
[ JDK VERSION : 1.6.0_07 ]

Assume I have following code:

String[] names = {
  "Peter", // my father
  "Laura", // my mother
  "Paul", // my brother
  "Betty", // my sister
  ...
{

If I want to delete the comments and put all string literals in one
line I need to record a macro like following:

find(","), select-begin, next-line, find("\""), backspace,
select-end, insert(" ")

If I come to "Find" my cursor is in the nice find toolbar, but I
can't hit return-key to continue in the editors pane to continue
recording my macro.

I set this P2, because without "Find", macro recording is nearly
worthless.
Comment 1 Miloslav Metelka 2008-09-12 09:48:14 UTC
The macros do not currently support any parameters passing so marking this as a feature request.

BTW I find using regexps in search/replace rather powerful e.g. if you would select your four lines and press Ctrl+H for
replace you can check "Regular Expressions" checkbox and enter
 "//.*[\n]"
 into Find What field and nothing into "Replace With" field and doing Replace All will concatenate lines and remove
comments. There would be some extra whitespace so you could possibly use regexp groups (text enclosed in parenthesis) to
achieve better results:
Find what: "[ ]*(".*",).*[\n]"
Replace with: " $1"
Comment 2 ulfzibis 2008-09-12 13:50:23 UTC
> BTW I find using regexps in search/replace rather powerful e.g. if you would select 

BTW I find learning local languages rather powerful, e.g. if you are in need of a toilet meandering in an exotic airport
hall while just on stopover, local language knowledge would be to your advantage, if your nose is in poor condition. ;-)

I also think, this is more an enhancement of existing macro processing, than a new feature.
Comment 3 ulfzibis 2008-09-12 14:02:36 UTC
Anyway, thanks for encouraging me learning regex.

I tried it several times, but Chinese must be easier. ;-)

Comment 4 karmagfa 2008-09-13 04:21:53 UTC
Hi,

I am leaving in Taiwan since 6 years, and I confirm that learning regexp is easier than Chinese.
Comment 5 CaptainStarbuck 2017-08-02 19:28:00 UTC
People have asked about Find/Replace with macros over the last 6 years since this ticket was first entered. I'll +1 this. I was just looking for same functionality. See bug 207532, comment 20 for a use case ... and other examples throughout this tracker and in forums where complex and repetitive find/replace operations are performed. Current alternatives might be to use an external tool like AutoHotKey or PhraseExpress, depending on requirements. But NB macros really should be enhanced a bit in each point-release to control more of the IDE and content.