PreviousNextTracker indexSee it online !

(190/212) 491 - Search And Replace Directory specific per window

I use different jEdit windows (or views) for each code base I'm working on. It would save a lot of time if the Directory search drop down default were set specific to each window.

Submitted slim180 - 2014-12-28 11:51:01.319000 Assigned
Priority 5 Labels
Status open Group v5.2
Resolution None

Comments

2017-10-31 11:50:22.947000
ngc

If you use ProjectViewer, it has a "Search in Projct Root" and "Search in Directory".

Project Viewer can show different projects per View.

Does this help?

Or would a macro help which sets the current directory as the search base?

Search in current directory:

import org.gjt.sp.jedit.search.SearchDialog;
import org.gjt.sp.jedit.search.DirectoryListSet;

File path= new File(buffer.getPath());
DirectoryListSet searchIn= new DirectoryListSet((path.getParentFile()).toString(), "*", true);
String selected = jEdit.getActiveView().getTextArea().getSelectedText();
SearchAndReplace.setSearchFileSet(searchIn);
SearchDialog.showSearchDialog(view, selected, SearchDialog.DIRECTORY);


If so, I'd like to close this as "won't fix" UPDATE: I changed my mind. See further below.

2017-11-02 23:47:58.531000
tsourick

Skeeve, do you think real tracking of active view and having a list of dirs in memory to switch between them is a bad idea?

2017-11-03 00:14:16.448000
ngc

I thought it's not a good idea and wanted to object.

But now I tested and agree now that it IS a good idea because the current behaviour eels wrong.

What I did:

1. Opened 2 views.
2. Opened Search in first view and set a directory to search in
3. Opened Search in second view and set another directory to search in
4. Closed the first view's search
5. Opened the first view's search -> It has the second view's directory -> BAD!

If it were just one search dialog, I think it's okay. But as we have a new search dialog per view, all the settings in these dialogs should be view-specific.