Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent opening an already open file in counsel-grep #1001

Conversation

@kaushalmodi
Copy link
Contributor

@kaushalmodi kaushalmodi commented May 12, 2017

  • counsel.el (counsel-grep-action): If a file is already open in
    a buffer, get that buffer's handle using get-file-buffer. This
    is to prevent the scenario where a file is already opened using
    find-file-literally. In that case, if find-file is attempted for
    the same file, user is nagged with question if they intended to
    switch to opening the file normally from "literally". Situation
    escalates when the file is huge (100's of MB).

    Do find-file only if the searched file is not yet opened in any
    buffer.

* counsel.el (counsel-grep-action): If a file is already open in
  a buffer, get that buffer's handle using get-file-buffer.  This
  is to prevent the scenario where a file is already opened using
  find-file-literally.  In that case, if find-file is attempted for
  the same file, user is nagged with question if they intended to
  switch to opening the file normally from "literally".  Situation
  escalates when the file is huge (100's of MB).

  Do find-file only if the searched file is not yet opened in any
  buffer.
@abo-abo abo-abo merged commit 399d74f into abo-abo:master May 13, 2017
1 of 2 checks passed
Loading
@abo-abo
Copy link
Owner

@abo-abo abo-abo commented May 13, 2017

Thanks.

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants