Skip to content

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

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

Conversation

kaushalmodi
Copy link
Contributor

  • 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
Copy link
Owner

abo-abo commented May 13, 2017

Thanks.

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

Successfully merging this pull request may close these issues.

2 participants