jEdit Community - Resources for users of the jEdit Text Editor
previous date
Submitted by char_skd1 on Wednesday, 27 September, 2006 - 03:29
I was wondering if anyone can help me figure out how to modify the insert date macro to give me the date + or - the current day.

example: text here (date here) more copy here.

Thanks for any help.
SearchAndreplace.find()
Submitted by Irtytsch on Monday, 18 September, 2006 - 06:19
(Sorry for my bad English. I hope you understand my question)

I have to search a String in a known part of a text. So, I'm looking for a method find(View view, Buffer buffer, int start, int end) in the class SearchAndReplace. But i can't find.

How can I do that?

Thank you
How do you manipulate the Selected Text?
Submitted by LDiracDelta on Friday, 15 September, 2006 - 16:17
I want to write a macro that grabs out the selected text, manipulates it ( using something other than a search and replace) and then re-inserts the text back into the buffer. What are the magic classes and things I need to do to make this happen?
How do you manipulate the Selected Text?
Submitted by LDiracDelta on Friday, 15 September, 2006 - 16:17
I want to write a macro that grabs out the selected text, manipulates it ( using something other than a search and replace) and then re-inserts the text back into the buffer. What are the magic classes and things I need to do to make this happen?
How to import the current date from two or three days ago?
Submitted by SCJ on Tuesday, 29 August, 2006 - 22:41
Can anyone help me write a macro that will import the date from one, two or three days ago.

Example- On August, 29th, 2006 the macro would generate the following text into a document:

Posted from: 08/26/06

I'm also wondering how to create a simple macro to create bold tags around a selected group of text? I thought this would be simple to find. Perhaps I am just looking in the wrong place? Any help is much appreciated. Thanks!
java.lang.RuntimeException: Invalid screen line count: 0
Submitted by oimara475 on Tuesday, 29 August, 2006 - 20:16
Hi,

I am trying to run a very simple macro, which should find duplicated lines and delete the second one.


textArea.goToBufferStart(false);
SearchAndReplace.setSearchString("(^  LK-\\d+)(.+$\\n)([\\w\\W]*?)(^  LK-\\d+)\\2");
SearchAndReplace.setAutoWrapAround(true);
SearchAndReplace.setReverseSearch(false);
SearchAndReplace.setIgnoreCase(false);
SearchAndReplace.setRegexp(true);
SearchAndReplace.setSearchFileSet(new CurrentBufferSet());
SearchAndReplace.setReplaceString("$1$2$3");
SearchAndReplace.setBeanShellReplace(false);
while (SearchAndReplace.find(view) == true)
{
textArea.goToBufferStart(false);
SearchAndReplace.replaceAll(view);
}


While the macro is executing, the following error occurs, several times.

java.lang.RuntimeException: Invalid screen line count: 0
at org.gjt.sp.jedit.textarea.DisplayManager.getScreenLineCount(DisplayManager.java:187)
at org.gjt.sp.jedit.textarea.FirstLine.physDown(FirstLine.java:167)
at org.gjt.sp.jedit.textarea.DisplayManager.setFirstPhysicalLine(DisplayManager.java:621)
at org.gjt.sp.jedit.textarea.JEditTextArea.setFirstPhysicalLine(JEditTextArea.java:545)
at org.gjt.sp.jedit.textarea.JEditTextArea.scrollTo(JEditTextArea.java:767)
at org.gjt.sp.jedit.textarea.JEditTextArea.scrollTo(JEditTextArea.java:673)
at org.gjt.sp.jedit.search.SearchAndReplace.find(SearchAndReplace.java:641)
at org.gjt.sp.jedit.search.SearchAndReplace.find(SearchAndReplace.java:498)
at sun.reflect.GeneratedMethodAccessor18.invoke(Unknown Source)
(...)

The same problem with this macro:

textArea.goToBufferStart(false);
SearchAndReplace.setSearchString("^(  LK-)(\\d+)");
SearchAndReplace.setAutoWrapAround(false);
SearchAndReplace.setReverseSearch(false);
SearchAndReplace.setIgnoreCase(false);
SearchAndReplace.setRegexp(true);
SearchAndReplace.setSearchFileSet(new CurrentBufferSet());
SearchAndReplace.setBeanShellReplace(true);
SearchAndReplace.setReplaceString("_1 + (textArea.getSelectionStartLine() - 2)");

var n = textArea.getLineCount();
for (i = 0; i <= n - 2; i++)
{
SearchAndReplace.find(view);
SearchAndReplace.replace(view);
}

Has anybody got a hint, what the problem might be?

Martin
substring error
Submitted by OBI_Ron on Saturday, 26 August, 2006 - 02:16
Hello Everyone,
I am creating a macro, using hypersearch_results_to_buffer as a starting point. I have modified the macro so far so that the path is not included. Now, I would like to strip out the line number. Using the following code:
traverseTree(javax.swing.tree.DefaultMutableTreeNode node, StringBuffer results){
if (node.getUserObject() instanceof org.gjt.sp.jedit.search.HyperSearchFileNode)
{
path = node.getUserObject().path;
match = node.getFirstChild();
while(match != null)
{
text = match.getUserObject().str;
results.append(text + "\n");
match = match.getNextSibling();

I get results like:

1770: material CabinetBase
1792: material CabinetBase_Panel_01.jpg.001

So I try to modify the block to:

text = match.getUserObject().str;
myStrLoc = (text.indexOf(":")+1);
text = text.subString(myStrLoc);
results.append(text + "\n");
match = match.getNextSibling();
However, every time I try to run the macro, I get the following error:

Sourced file: C:\Program Files\jEdit\macros\Misc\HyperSearch_Results_to_Buffer2.bsh : Error in method invocation: Method subString( int ) not found in class'java.lang.String' : at Line: 37 : in file: C:\Program Files\jEdit\macros\Misc\HyperSearch_Results_to_Buffer2.bsh : text .subString ( myStrLoc )

Called from method: writeHypersearchResultsToBuffer : at Line: 81 : in file: C:\Program Files\jEdit\macros\Misc\HyperSearch_Results_to_Buffer2.bsh : writeHypersearchResultsToBuffer ( view )

I have tried using text = text.subString(1); and text = text.subString(1,8);
...but I get the same results.
What am I missing?? Thanks in advance for your help!!
Difference between Jedit 4.2 and 4.3pre6
Submitted by Fabio2006 on Friday, 18 August, 2006 - 05:48
Hello Developpers
I have a lite Script who work fine in Jedit 4.2 but not in 4.3pre5 and not in 4.3pre6.
The Console Window open and wait but there are errors in the Command Window and in the BeanShell Window.
Is there any idea what I can change?
Regrads,
Fabio

import console.Console;
{
Buffer b = view.getBuffer();
String strName = b.getName();
String strPath = b.getPath();

String strCmd = new String("java.exe -jar \"C:\\Programme\\Interlis\\ili2c\\ili2c.jar\" --without-warnings \"" + strPath + "\"");
runCommandInConsole(view, "System", strCmd);
}

1) Console Window Errors:

[error] BeanShell: java.lang.NoClassDefFoundError: org/gjt/sp/jedit/search/RESea
rchMatcher
...and a lot of more error lines...

2) BeanShell Window Errors:

java.lang.NoClassDefFoundError: org/gjt/sp/jedit/search/RESearchMatcher
...and a lot of more error lines...
Difference between Jedit 4.2 and 4.3pre6
Submitted by Fabio2006 on Thursday, 17 August, 2006 - 10:44
Hello Developpers I have a lite Script who work fine in Jedit 4.2 but not in 4.3pre5 and not in 4.3pre6. The Console Window open and wait but there are errors in the Command Window and in the BeanShell Window. Is there any idea what I can change? Regrads, Fabio import console.Console; { Buffer b = view.getBuffer(); String strName = b.getName(); String strPath = b.getPath(); String strCmd = new String("java.exe -jar \"C:\\Programme\\Interlis\\ili2c\\ili2c.jar\" --without-warnings \"" + strPath + "\""); runCommandInConsole(view, "System", strCmd); } 1) Console Window: [error] BeanShell: java.lang.NoClassDefFoundError: org/gjt/sp/jedit/search/RESea rchMatcher [error] BeanShell: at console.StreamThread.(StreamThread.java:226) [error] BeanShell: at console.ConsoleProcess.(ConsoleProcess.java:65) [error] BeanShell: at console.SystemShell.execute(SystemShell.java:222) [error] BeanShell: at console.Console.run(Console.java:429) [error] BeanShell: at console.Console.run(Console.java:226) [error] BeanShell: at console.Console.run(Console.java:202) [error] BeanShell: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Metho d) [error] BeanShell: at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Sourc e) [error] BeanShell: at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown S ource) [error] BeanShell: at java.lang.reflect.Method.invoke(Unknown Source) [error] BeanShell: at bsh.Reflect.invokeOnMethod(Reflect.java:148) [error] BeanShell: at bsh.Reflect.invokeObjectMethod(Reflect.java:80) [error] BeanShell: at bsh.Name.invokeMethod(Name.java:856) [error] BeanShell: at bsh.BSHMethodInvocation.eval(BSHMethodInvocation.java:72) [error] BeanShell: at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:1 02) [error] BeanShell: at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:4 7) [error] BeanShell: at bsh.BSHBlock.evalBlock(BSHBlock.java:130) [error] BeanShell: at bsh.BSHBlock.eval(BSHBlock.java:80) [error] BeanShell: at bsh.BshMethod.invokeImpl(BshMethod.java:349) [error] BeanShell: at bsh.BshMethod.invoke(BshMethod.java:246) [error] BeanShell: at bsh.BshMethod.invoke(BshMethod.java:179) [error] BeanShell: at bsh.Name.invokeLocalMethod(Name.java:956) [error] BeanShell: at bsh.Name.invokeMethod(Name.java:805) [error] BeanShell: at bsh.BSHMethodInvocation.eval(BSHMethodInvocation.java:72) [error] BeanShell: at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:1 02) [error] BeanShell: at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:4 7) [error] BeanShell: at bsh.BSHBlock.evalBlock(BSHBlock.java:130) [error] BeanShell: at bsh.BSHBlock.eval(BSHBlock.java:80) [error] BeanShell: at bsh.BSHBlock.eval(BSHBlock.java:46) [error] BeanShell: at bsh.Interpreter.eval(Interpreter.java:641) [error] BeanShell: at org.gjt.sp.jedit.BeanShell._runScript(BeanShell.java:339) [error] BeanShell: at org.gjt.sp.jedit.BeanShell._runScript(BeanShell.java:284) [error] BeanShell: at org.gjt.sp.jedit.BeanShell.runScript(BeanShell.java:210) [error] BeanShell: at org.gjt.sp.jedit.Macros$BeanShellHandler.runMacro(Macros. java:1012) [error] BeanShell: at org.gjt.sp.jedit.Macros$Macro.invoke(Macros.java:435) [error] BeanShell: at org.gjt.sp.jedit.gui.InputHandler.invokeAction(InputHandl er.java:229) [error] BeanShell: at org.gjt.sp.jedit.jEdit$3.invokeAction(jEdit.java:2933) [error] BeanShell: at org.gjt.sp.jedit.EditAction$Wrapper.actionPerformed(EditA ction.java:224) [error] BeanShell: at javax.swing.AbstractButton.fireActionPerformed(Unknown So urce) [error] BeanShell: at javax.swing.AbstractButton$Handler.actionPerformed(Unknow n Source) [error] BeanShell: at javax.swing.DefaultButtonModel.fireActionPerformed(Unknow n Source) [error] BeanShell: at javax.swing.DefaultButtonModel.setPressed(Unknown Source) [error] BeanShell: at javax.swing.AbstractButton.doClick(Unknown Source) [error] BeanShell: at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown So urce) [error] BeanShell: at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseRelea sed(Unknown Source) [error] BeanShell: at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source ) [error] BeanShell: at java.awt.Component.processMouseEvent(Unknown Source) [error] BeanShell: at javax.swing.JComponent.processMouseEvent(Unknown Source) [error] BeanShell: at java.awt.Component.processEvent(Unknown Source) [error] BeanShell: at java.awt.Container.processEvent(Unknown Source) [error] BeanShell: at java.awt.Component.dispatchEventImpl(Unknown Source) [error] BeanShell: at java.awt.Container.dispatchEventImpl(Unknown Source) [error] BeanShell: at java.awt.Component.dispatchEvent(Unknown Source) [error] BeanShell: at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) [error] BeanShell: at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) [error] BeanShell: at java.awt.LightweightDispatcher.dispatchEvent(Unknown Sour ce) [error] BeanShell: at java.awt.Container.dispatchEventImpl(Unknown Source) [error] BeanShell: at java.awt.Window.dispatchEventImpl(Unknown Source) [error] BeanShell: at java.awt.Component.dispatchEvent(Unknown Source) [error] BeanShell: at java.awt.EventQueue.dispatchEvent(Unknown Source) [error] BeanShell: at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unk nown Source) [error] BeanShell: at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unkno wn Source) [error] BeanShell: at java.awt.EventDispatchThread.pumpEvents(Unknown Source) [error] BeanShell: at java.awt.EventDispatchThread.pumpEvents(Unknown Source) [error] BeanShell: at java.awt.EventDispatchThread.run(Unknown Source) 2) BeanShell Window: java.lang.NoClassDefFoundError: org/gjt/sp/jedit/search/RESearchMatcher at console.StreamThread.(StreamThread.java:226) at console.ConsoleProcess.(ConsoleProcess.java:65) at console.SystemShell.execute(SystemShell.java:222) at console.Console.run(Console.java:429) at console.Console.run(Console.java:226) at console.Console.run(Console.java:202) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at bsh.Reflect.invokeOnMethod(Reflect.java:148) at bsh.Reflect.invokeObjectMethod(Reflect.java:80) at bsh.Name.invokeMethod(Name.java:856) at bsh.BSHMethodInvocation.eval(BSHMethodInvocation.java:72) at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:102) at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:47) at bsh.BSHBlock.evalBlock(BSHBlock.java:130) at bsh.BSHBlock.eval(BSHBlock.java:80) at bsh.BshMethod.invokeImpl(BshMethod.java:349) at bsh.BshMethod.invoke(BshMethod.java:246) at bsh.BshMethod.invoke(BshMethod.java:179) at bsh.Name.invokeLocalMethod(Name.java:956) at bsh.Name.invokeMethod(Name.java:805) at bsh.BSHMethodInvocation.eval(BSHMethodInvocation.java:72) at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:102) at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:47) at bsh.BSHBlock.evalBlock(BSHBlock.java:130) at bsh.BSHBlock.eval(BSHBlock.java:80) at bsh.BSHBlock.eval(BSHBlock.java:46) at bsh.Interpreter.eval(Interpreter.java:641) at org.gjt.sp.jedit.BeanShell._runScript(BeanShell.java:339) at org.gjt.sp.jedit.BeanShell._runScript(BeanShell.java:284) at org.gjt.sp.jedit.BeanShell.runScript(BeanShell.java:210) at org.gjt.sp.jedit.Macros$BeanShellHandler.runMacro(Macros.java:1012) at org.gjt.sp.jedit.Macros$Macro.invoke(Macros.java:435) at org.gjt.sp.jedit.gui.InputHandler.invokeAction(InputHandler.java:229) at org.gjt.sp.jedit.jEdit$3.invokeAction(jEdit.java:2933) at org.gjt.sp.jedit.EditAction$Wrapper.actionPerformed(EditAction.java:224) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.AbstractButton.doClick(Unknown Source) at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source) at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source) at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source)
Console:How to change the Command properties from script?
Submitted by mabra on Sunday, 16 July, 2006 - 00:38
Hello,

in the ongoing process to adapt all my work the JEdit Smiling
I am also finding some limits though. For example, I'll just execute a buffer with a script engine and the console plug-in does this. But I would like to control, if a COMMAND uses a buffer via TO_BUFFER or just outputs into the console itself.

Is there any way to modify the running buffers properties from the running script?

I just tried:

this.toBuffer = true;

but - even this don't raise any errors - it just does not work. Providing the GUI for this is easy.
Any help would be great!

Thanks so far and best regards,

Manfred
XInsert: -xinsert_script- macro parsing fails:workaround
Submitted by mabra on Monday, 10 July, 2006 - 20:16
Hi All ! I am new to jEdit and try to organize my work around it now. While writing a library for the XInsert plugin - to be used with VBScript - I got a strange problem. The statement: if( (filename.lastIndexOf(".") != 0) && (filename.lastIndexOf(".") > firstPos) ) { .... } could not be parsed and the library was out of order and unusable. This seems to be the fact, because XInsert expects xml !!! <item name="TransformFromVBStoWSF" type="xinsert_script"> {@ ... XInsert expects xml here!!! } </item> The workaround I used, was to include the script/macro part into another CDATA section: <item name="TransformFromVBStoWSF" type="xinsert_script"> <![CDATA[ my inital text here, also xml and must be escaped ]]> <![CDATA[ {@ .... the macro statement will now left as is and works fine } ]]> </item> This prevents the xml-parser to interpret the macro code and everything is ok. I found no better docs and discovered it this way. May be, this helps others too. Any other solution is very welcome.

Best regards,
Manfred
How to delete a marker from a buffer in a macro?
Submitted by mabra on Wednesday, 5 July, 2006 - 13:32
Hi All,

I insert a marker into a buffer, before I make some modifications to it;Just to remember my starting position. After I finish my task, I will remove the marker, but this fails.

My code[snippet] is as follows:

char mc = 'X';
buffer.addMarker(mc, 6);

... my buffer-modies here ...

Marker m = buffer.getMarker(mc);
buffer.removeMarker(m.getPosition());

The marker is stil there [and "m" is NOT null!]

Any help would be really very welcome.
Thanks,
Manfred
Macro to auto save open buffer when jEdit looses focus
Submitted by stellari on Friday, 16 June, 2006 - 20:18
I just started using jEdit, very nice program!

Is there a macro/plugin to automatically save the open buffers once jEdit window looses focus...
i.e. the user switches to another program?

Something already done would be nice.

Thanks a lot for any suggestion and comment!
jEdit 4.2 question: How to tell if a file exists on a VFS using the FTP Plugin?
Submitted by txporter on Thursday, 25 May, 2006 - 03:35
I use the FTP plugin to give me remote access to files. I am trying to write a macro to look in the directory of the file I have open in a buffer and determine if another file exists in the same directory.

On a local file system I would simply create a File instance using a path string I constructed and check to see if it exists, like this:

dirname = dir(buffer.getPath());
FQPN = dirname + "new file name";
java.io.File newFile = new java.io.File(FQPN);
if (newFile.exists()) {
//do stuff
}


If I try this when my buffer is on my remote server, newFile.exists() always returns false, regardless of whether the file actually exists or not. I think this is because dirname is something like "ftp://myuserid@myremotehost:21/path/to/new_file_name" and the normal java.io.File.exists() method does not understand URI's like this.

Any ideas on how to tell if the remote file exists or not?

I tried unconditionally opening the file and checking the length of the buffer, expecting a new file to have zero length and then I could close it immediately, but since jEdit.openFile(view, pathToFile) does not seem to be a blocking operation, trying to get the buffer length did not work:


1. aBuffer = jEdit.openFile(view,FQPN);
2. if (aBuffer.getLength() == 0) {
3. // file is new, so close it, as I only want new buffer if file exists
4. }


Could I put a VFSManager.waitForRequests() call between line 1 & 2 to wait for the FTP I/O to complete before checking the buffer length? Is this a static call? If not how to I get access to the VFSManager instance associated with my FTP connection?

Thanks!!

Tom Porter
Sort Lines (editplus style sort)
Submitted by p8er on Thursday, 11 May, 2006 - 08:03
I wrote a macro to sort lines of selection or whole buffer.
After I finished it I found there is another sort lines macro here. (Oh! why I don't search it before write this one. )
But my macro is more powerful than the one exist, though the dialog of that one is more pretty. Sticking out tongue

------------------------------------
Here is the description of my macro, just like the sort tool in editplus 2.

Sort selected lines or whole buffer (when nothing is selected).
This is just similar to the sort function in Editplus 2.
Features:
  • Order - Either ascending order or descending order.
  • Starting column - Enter a column number from which the sorting operation begins. The text before this column number will be sorted when string after the column is the same. Enter an integer value great than or equals to 1.
  • Case sensitive - The case-sensitive comparison option.
  • Remove duplicates - Remove any duplicated line after the sorting option.
You can download it here -> download.
Or view the download page here -> download page.

Or you like the old one created by Pascal Dal Farra.
more sophisticated 'select between quotes'
Submitted by silverquick on Saturday, 29 April, 2006 - 05:17
I was playing around with Lee Turner's script (which appears to have started here: http://community.jedit.org/?q=node/view/1128), and because I work with PHP I wanted one to recognise both single and double quotes, and there's also the problem with his that if the caret is between quotations, the space between them gets selected. The latter's not that big of a problem, but trying to allow for both types of quotes is tough.

I thought I had it with this: basically track all openings and closings of quotes in the buffer prior to the caret (in PHP a ' inside "..." doesn't count and vice-versa), and if a quote is open at the caret, search after the caret to find its mate, and select between them. But then if a comment contains apostrophes or irregular double-quotes, this won't work! I could get very complicated and detect comments, but this is language-specific and what I've been thinking from the start is that it would be nice to abstract the searching from the quote syntax.

So my real question is: is there a way for a macro to interact with jEdit's syntax highlighter? It's a waste for my macro to do the work of finding quoted sections when jEdit has obviously already done the work. I'm envisioning methods get the token type of the text under the caret, get the boundaries of a given token section, etc. I've tried looking through the API docs, but (1) I'm don't really understand how the highlighting engine works, and (2) it all feels a little over my head. I am pretty green with Java.

Thanks for reading!
Commando and console 4.2.5.1
Submitted by beaubert on Sunday, 9 April, 2006 - 12:10
Hi, I have made a smal commando script to compile (with wmake) and run an application. This script do 2 thinks, first it compiles my app and then run it (in the system shell) in a directory specified by the user. This commando script works well with Jedit 4.2final but I'm unable to make It work with Jedit 4.3pre3 with console 4.2.5.1 and 2sdk1.5-sun: the compilation with wmake works fine but I'm unable to lauch my app ? But the 4 commands in the commando dialog are there but in only do the first two ... Is it a bug with console 4.2.5.1 ? Any ideas ? Here is the commando xml file: buf = new StringBuffer("cd "); buf.append(compildir); buf.toString(); buf = new StringBuffer(); if (target.equals("wmake_all")) { buf.append("wmake"); } else if (target.equals("wmake_debug")) { buf.append(" "); } else if (target.equals("wmake_clean")) { buf.append("wclean"); } buf.toString(); buf = new StringBuffer(); if (exe) { buf.append("cd "+casedir); } buf.toString(); buf = new StringBuffer(); if (exe) { buf.append(application+" .. "); buf.append(MiscUtilities.getFileName(casedir)); } buf.toString();
SearchAndReplace problem
Submitted by turtlecove on Wednesday, 15 March, 2006 - 18:57
I am writing a Macro that enables a simple kind of Wiki link in any text file. Basically if I run my macro, it finds the nearest words in [brackets] and uses that as a file name to open. It works well, but I added the feature to jump to an anchor [filename#anchor] and I cannot figure out how to get it to jump to text in a document. Here is what I have:

newbuffer=jEdit.openFile( view, WikiWord);
if (hasAnchor) {
SearchAndReplace.setSearchString(anchor);
SearchAndReplace.find( view, newbuffer, 0, true, false);
}

It behaves very erratically. It always opens the new file ok. But then it sometimes finds the anchor text, but usually does not. I've tried resetting the cursor to the top of the file to make sure it isn't past the anchor text:

view.getTextArea.setCaretPosition(0);

But that didn't help.
Strangely, if I add this:

Macros.message(view, "finding " + anchor);

before the find, it works! I suspect the popup window causes the interface to 'refresh' in some way bringing the newly opened file to some displayed state, as opposed to some open-but-not-yet-displayed-state... but I'm just guessing here...

Any help?
Automating ProjectViewer (Creating New Projects Programatically)
Submitted by philmaker on Wednesday, 8 March, 2006 - 07:47
I'm interested in writing a macro to generate all of my projects in ProjectViewer. Anyone know if this level of interaction with ProjectViewer is possible. I'm also having trouble generating the complete JavaDoc API for ProjectViewer - anyone know if this is available online?
How determine if a file is locked?
Submitted by a992400 on Saturday, 18 February, 2006 - 22:17
One of my macros saves open buffers, but it pops up an error message anytime it tries to save a file that is in use by another process, and I'd like to avoid that error message, by not trying to say that particular buffer. Is there a way to check a buffer and see if it is being used by another process?
User login
Browse archives
« November 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   101634
Context Free Art (*.cfdg)   0.31   46062
BBEdit scheme   1.0   18601
JBuilder scheme   .001   18502
ColdFusion scheme   1.0   18031
R Edit Mode - extensive version   0.1   17481
Advanced HTML edit mode   1.0   16213
Matlab Edit Mode   1.0   16075
jEdit XP icons   1.0   15236
XP icons for jEdit   1.1   14300