How to return the Console's process code?
Submitted by
stretch6555 on
Tuesday, 10 April, 2007 - 05:48
Hi,
I've been trying to write some simple beanshell code which calls some methods from the Console plugin. In one part of this code I'm calling the following method:
runInSystemShell(view, "latex " + file);
Now in examples like the above, the program (in this case "latex") returns a process or error level number when it finishes. If the program completes without errors, it returns 0. If it encounters an error it usually returns a non-zero process code. Is there a beanshell/Java command or Console method that will return this process code?? Unfortunately, the above method (runInSystemShell) doesn't return a value so I don't know what the process code is after it completes.
Any help appreciated. Thanks.
Buffer selection within a macro
Submitted by
Anonym on
Wednesday, 28 March, 2007 - 11:30
Hello all,
first of all I would like to thank the developers. jEdit is a brilliant tool. The opportunity to write own java based macros is an excellent feature. Unfortunately I have some problems in regard to pick up the right buffer for an automatic safe. But before I go into detail I have to mention, that I am not an experienced Java programmer.
What I try to do is to manipulate data from file A and try to safe it in file B.
For this purpose I take the data out of buffer A use the tokenizer to extract the needed data and write that into buffer B.
Therefore I have written the following code:
editPane.prevBuffer();
textArea.setSelectedText(sNewLine+"\n");
textArea.goToNextLine(false);
editPane.nextBuffer();
The pitty is, that I have to ensure that the order in the buffer selector is correct. That is a little bit unconvienient. Does anyone know if there is an opportunity to select the right buffer by its path or filename?
Anything like: editPane.selectBuffer(string filename/path);
I went through the whole helpfile and online wiki, but didn't found anything how I can manage that task. I also tried to record a macro but the file selection was not recorded.
Thank you for your response.
Best wishes, Andre
Need someone to maintain the JTA plugin
Submitted by
poleta33 on
Friday, 9 February, 2007 - 13:15
Hi
The JTA plugin is the ONLY features that really miss to jedit : it consists in having multiple connections onto differents servers to execute commands (much more powerfull than the console plugin which is limited to the current station you use)...
so this plugin is not maintained anymore... if someone can try this challenge !
more information here : http://sourceforge.net/tracker/index.php?func=detail&aid=1627596&group_id=588&atid=350588
Searching for a file in a list of directories
Submitted by
turtlecove on
Wednesday, 6 December, 2006 - 19:54
I am trying to find a single specified file in a set of directories. The filename is currently selected, the directories are listed at the bottom of my text file as follows: [path:adirectory][path:anotherdirectory][path:yetanotherdirectory].
The paths are searched recursively (ie: subdirectories are searched as well), or alternatively I can allow globs in the paths like so: [path:C:\toplevel\projects\*\]
I've got searching the current document for [path:xxxx]. I've got the selected filename.
What I am having trouble with is searching the filesystem for the filename. I am trying to figure out how to use DirectoryListSet to do this, but I cannot see how it can be used alone without involving the GUI. I also tried to figure it out using File.list(), but cannot figure out how to specify a filter.
Any help I've found googling around has been in Java, not Beanshell, and since I'm not expert at either I cannot figure out how to translate the Java solutions into Beanshell.
Any help?
How do I launch the appropriate application for a file?
Submitted by
turtlecove on
Wednesday, 6 December, 2006 - 19:34
I am trying to write a macro that opens the file named in the selection with the appropriate application. For example, [mysheet.xls] would start Excel and open the file mysheet.xls, [mytext.txt] would open Notepad...
I've tried sending the filename to cmd.exe, but that doesn't work. I've tried sending it to Explorer but that just views it in explorer.
Here's what I have (not working properly):
// launch app to open file NOT WORKING!
/*
os = System.getProperty("os.name");
if(os.indexOf("Windows 9") == -1 && os.indexOf("Windows M") == -1) {
comspec = "cmd.exe /C ";
} else {
comspec = "command.exe /C ";
}
*/
comspec="explorer.exe ";
if (myfile.matches("[\\/]")) {
command=comspec+myfile;
} else {
// handle relative paths:
command=comspec+buffer.getDirectory()+myfile;
}
// Macros.error( view, "launching "+command);
setAccessibility(true);
runtime = new java.lang.Runtime();
runtime.exec(command);
return;
Search and replace with the filename
Submitted by
poil on
Monday, 27 November, 2006 - 17:22
Hi
I'm struggling to write a macro that will search for a string and replace it with that buffer's file name, or better still, a substring of the filename, across all open buffers.
I'm currently trying to use SearchAndReplace.setBeanShellReplace(true) and putting variable names in SearchAndReplace.setReplaceString("theName") with no luck.
Anyone got a macro like this?
Thanks
Cool macro to share
Submitted by
pieroxy on
Monday, 16 October, 2006 - 20:06
I have this macro I wrote a while ago that "indents" a piece of code (C, Java, Javascript). I like it over the various beautifiers plugins for the following reasons:
1. It keeps the lines as they are, it justs indents them, so that part of the coding style is preserved.
2. The macro will indent just the selection, not all the file, making the change an easy and visible one.
How shall I share the macro so as it is well exposed? It's around 500 lines and I doubt it is worth getting into the default install (how do one macro gets elected to get in the default install?). I'd also like some user feedback on it.
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
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 !!!
-
{@
... XInsert expects xml here!!!
}
The workaround I used, was to include the script/macro part into another CDATA section:
-
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!