#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.


  • Skeeve

    Skeeve - 2017-10-31

    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();
    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.

    Last edit: Skeeve 2017-11-03
  • Roman Tsourick

    Roman Tsourick - 2017-11-02

    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?

    • Skeeve

      Skeeve - 2017-11-03

      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.


Log in to post a comment.