Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Invoking "Find in Files" twice closes the modal bar #4802

Closed
gruehle opened this issue Aug 16, 2013 · 5 comments
Closed

Invoking "Find in Files" twice closes the modal bar #4802

gruehle opened this issue Aug 16, 2013 · 5 comments
Assignees

Comments

@gruehle
Copy link
Member

gruehle commented Aug 16, 2013

Steps to repro

  1. Invoke "Find in Files" (with the keyboard shortcut or selecting the menu item)
  2. Invoke it again

Results
The modal bar closes.

This broke with the new modal bar animation.

@ghost ghost assigned njx Aug 16, 2013
@gruehle
Copy link
Member Author

gruehle commented Aug 16, 2013

To @njx, medium priority.

@rajeshsegu
Copy link

FindInFilesDialog() in FindinFiles.js should be a singleton, only one instance should exist. I don't understand why we keep recreating it instead of just resetting it.

Anyway, here is the fix running in my mind:

var _currentDialog;
    function _isCurrentDialogShowing(){
        return _currentDialog && !_currentDialog.closed;
    }

    function _setCurrentDialog(dialog){
        _currentDialog = dialog;
    }

In _doFindInFiles() method we just should not create another dialog if _isCurrentDialogShowing() is TRUE.

Let me know if you guys like the idea, I will be happy to make the change.

@njx
Copy link

njx commented Sep 19, 2013

The behavior of the modal bar being recreated all the time is a holdover from old CodeMirror code that we copied when originally creating the various find dialogs. I think you're right that it should probably just be a singleton whose content gets swapped out, but we would need to figure out how to make that work for all the various things that use it (find in files, find/replace, and quick open)--some of them behave a little differently. Needs more thought.

@njx
Copy link

njx commented Sep 19, 2013

Similar issue to #4500. Added a backlog item that should address this and other related bugs: https://trello.com/c/q2B82Zuv. Closing as move to backlog.

@njx njx closed this as completed Sep 19, 2013
@rajeshsegu
Copy link

@njx @gruehle I say, these are entirely different bugs as they are two different dialog instances. This use-case is to do with the "Find in Files" getting recreating multiple times. Personally, I think they are similar but needs different set of fixes.

I can still take it if you guys are ok. Let me know.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants