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

Projects
None yet
2 participants
@kaushalmodi
Copy link
Contributor

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.

Prevent opening an already open file in counsel-grep
* 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

continuous-integration/travis-ci/push The Travis CI build is in progress
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@abo-abo

This comment has been minimized.

Copy link
Owner

commented May 13, 2017

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.