Need help with macro creating a new view unconnected to the current one
Submitted by Thursday, 15 September, 2011 - 13:36
on
Hi, I would like to create a macro that would close currently open buffer, open it in a new view and run another macro (*) in the new view on the buffer. The second macro often takes a minute or more, and I'd like to be able to work with the original view in the meantime. I need some help on how to create an unconnected new view with only the one buffer.
1) I have tried to use the 'View/New view' command, but it opens all the buffers in the new view which are open in the original view, no matter what bufferscope I try to set.
2) I have used macro recorder and wrote this code:
bsm = jEdit.getBufferSetManager();
if (bsm.getScope() == BufferSet.Scope.global) {
jEdit.newView(view);
}
else {
View.ViewConfig config = new View.ViewConfig();
config.docking = view.getViewConfig().docking;
jEdit.newView(view,buffer,config);
}
It opens only the current buffer in a new view, ok, but the view is still connected to the original and running the macro (*) still freezes the original view.
3) I tried launching the new view from command line with the options -newview -noserver, which worked fine to create an unconnected view, where running macro (*) did not freeze the original view, but the new view still opened all the buffers as in the original.
Any help would be appreciated. I am using the latest jedit4.5pre1 daily version.
tvojeho
P.S. I tried submitting this to jedit-users list, but my message bounced back.
1) I have tried to use the 'View/New view' command, but it opens all the buffers in the new view which are open in the original view, no matter what bufferscope I try to set.
2) I have used macro recorder and wrote this code:
bsm = jEdit.getBufferSetManager();
if (bsm.getScope() == BufferSet.Scope.global) {
jEdit.newView(view);
}
else {
View.ViewConfig config = new View.ViewConfig();
config.docking = view.getViewConfig().docking;
jEdit.newView(view,buffer,config);
}
It opens only the current buffer in a new view, ok, but the view is still connected to the original and running the macro (*) still freezes the original view.
3) I tried launching the new view from command line with the options -newview -noserver, which worked fine to create an unconnected view, where running macro (*) did not freeze the original view, but the new view still opened all the buffers as in the original.
Any help would be appreciated. I am using the latest jedit4.5pre1 daily version.
tvojeho
P.S. I tried submitting this to jedit-users list, but my message bounced back.