jEdit Community - Resources for users of the jEdit Text Editor
Invoking actions within a macro
Submitted by DanF on Wednesday, 25 August, 2004 - 06:26
Ok, here's how I'm doing it:
jEdit.getAction("find-next").invoke(view);
... but something's wrong. The action gets executed in some kind of strange silent mode. Messages aren't shown in the status bar (like "Search string not found!"), no confirm dialog box asks "Continue search from beginning?" (if auto-wrap is disabled), etc.

How do I invoke an action inside a macro? Are there other ways of doing this?
Comment viewing options
Select your preferred way to display the comments and click 'Save settings' to activate your changes.
try view.getInputHandler().in
by orutherfurd on Wed, 01/09/2004 - 16:14
try view.getInputHandler().invokeAction("find-next");
 
Thanks! Doesn't work as expected
by DanF on Thu, 02/09/2004 - 00:59
Hi orutherfurd, I'm still getting the same behavior over here though. I was wondering if there's an explanation for this.

Try this out, create a macro with a single statement:
view.getInputHandler().invokeAction("find-next");
Now try these things to reproduce what I'm getting here:
  1. Search for some word that's not in the buffer, you'll get a beep or two and "Search string not found!" will show up in the status bar. Now close the Find dialog, go to the Search menu and click on Find Next. You'll get the same thing (beep + status bar message). If, however, you run the macro, none of these things happen (at least over here, how about you?) Sad
  2. Repeat above, but disable Auto wrap in the Find dialog. You should get a "No more matches found. Continue search from beginning?" confirmation window. It also shows up when you click on the Find Next menu item. It doesn't show up with the macro though.
Is there an explanation for this? Should I report it as a bug? I just want my macro to perform a find-next as if the user clicked or used the shortcut for it.

I'd really appreciate your thoughts on this, thanks for replying. Smiling
User login
Browse archives
« April 2024  
MoTuWeThFrSaSu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
 
Poll
Are you interested in language packs for jEdit?
Yes, and I could help maintain translations
26%
Yes, I'd like to have translations
32%
Indifferent
35%
No, that'd be bad (please comment)
7%
Total votes: 1093
Syndication
file   ver   dls
German Localization light   4.4.2.1   82348
Context Free Art (*.cfdg)   0.31   46055
JBuilder scheme   .001   18495
BBEdit scheme   1.0   18116
ColdFusion scheme   1.0   18024
R Edit Mode - extensive version   0.1   17473
Advanced HTML edit mode   1.0   16206
Matlab Edit Mode   1.0   16068
jEdit XP icons   1.0   15229
XP icons for jEdit   1.1   14293