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 - [65cat] "Find" action not recordable by macro recording
Summary: [65cat] "Find" action not recordable by macro recording
Status: NEW
Alias: None
Product: editor
Classification: Unclassified
Component: Macros (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P2 blocker with 5 votes (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-10 17:26 UTC by ulfzibis
Modified: 2017-08-02 19:28 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.