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

helm-do-ag breaks in hs-minor-mode on this specific source file #389

Open
Davidj361 opened this issue Mar 31, 2022 · 0 comments
Open

helm-do-ag breaks in hs-minor-mode on this specific source file #389

Davidj361 opened this issue Mar 31, 2022 · 0 comments

Comments

@Davidj361
Copy link

Davidj361 commented Mar 31, 2022

  • Emacs version
    27.2
  • Operating system
    Ubuntu 20.04
  • Search command(ag, pt, ack etc) and version
    rg 11.0.2
  • Last value of helm-ag--last-command
    ("rg" "--smart-case" "--no-heading" "--color=never" "--line-number" "--max-columns=512" "--ignore=.#" "--ignore=.o" "--ignore=~" "--ignore=.bin" "--ignore=.lbin" "--ignore=.so" "--ignore=.a" "--ignore=.ln" "--ignore=.blg" "--ignore=.bbl" "--ignore=.elc" "--ignore=.lof" "--ignore=.glo" "--ignore=.idx" "--ignore=.lot" "--ignore=.fmt" "--ignore=.tfm" "--ignore=.class" "--ignore=.fas"
    "--ignore=
    .lib" "--ignore=.mem" "--ignore=.x86f" "--ignore=.sparcf" "--ignore=.dfsl" "--ignore=.pfsl" "--ignore=.d64fsl" "--ignore=.p64fsl" "--ignore=.lx64fsl" "--ignore=.lx32fsl" "--ignore=.dx64fsl" "--ignore=.dx32fsl" "--ignore=.fx64fsl" "--ignore=.fx32fsl" "--ignore=.sx64fsl" "--ignore=.sx32fsl" "--ignore=.wx64fsl" "--ignore=.wx32fsl" "--ignore=.fasl" "--ignore=.ufsl"
    "--ignore=
    .fsl" "--ignore=.dxl" "--ignore=.lo" "--ignore=.la" "--ignore=.gmo" "--ignore=.mo" "--ignore=.toc" "--ignore=.aux" "--ignore=.cp" "--ignore=.fn" "--ignore=.ky" "--ignore=.pg" "--ignore=.tp" "--ignore=.vr" "--ignore=.cps" "--ignore=.fns" "--ignore=.kys" "--ignore=.pgs" "--ignore=.tps" "--ignore=.vrs" "--ignore=.pyc" "--ignore=*.pyo" "--ignore=SCCS" "--ignore=RCS"
    "--ignore=CVS" "--ignore=MCVS" "--ignore=.src" "--ignore=.svn" "--ignore=.git" "--ignore=.hg" "--ignore=.bzr" "--ignore=_MTN" "--ignore=_darcs" "--ignore={arch}" "supp")

Actual behavior

syl20bnr/spacemacs#15437

2022-03-31.16-23-44.mp4

Doing helm-do-ag in hs-minor-mode and searching for 'supp' in this code gives an error of:
Search failed: there is an unmatched expression somewhere or we are at the beginning/end of file. [4 times]

void foobar(Foo1 * foo1, Bar1 * bar2)
{
    if (((foo->supp)&&(foo1->sec || d.s ||
        (foo->offset &&
            (abs(bar2->sec) >=
          foo->offset)))) || ((!foo->supp) && (foo1->sec))){
}

A comment from the spacemacs issue:

The issue comes from hs-minor-mode which is used by helm internally which seems to have an issue with the open curly bracket.

The build in version of this package is used in spacemacs-evil therefore its active. Please open a bug report upstream.

Edit:
As a fast workaround you can disable this mode, then helm will not use it and the error should be gone.

Expected behavior

When I jump to the entry it should take me to the correct line such as line 3.

Steps to reproduce

  1. Create /tmp/emacs
  2. Create this file /tmp/emacs/.emacs
(setq-default indent-tabs-mode nil)

(require 'package)

(setq package-archives
      '(
        ;; ("gnu" . "https://elpa.gnu.org/packages/")
        ("melpa" . "https://melpa.org/packages/")
        ;; ("nongnu" . "https://elpa.nongnu.org/nongnu/")
        ))

(let ((my-pkgs '(helm helm-ag)))
  (when (seq-remove 'package-installed-p my-pkgs)
    (package-refresh-contents)
    (mapc (lambda (pkg) (package-install pkg t)) my-pkgs)))

(global-set-key (kbd "M-x") #'helm-M-x)
(global-set-key (kbd "C-x r b") #'helm-filtered-bookmarks)
(global-set-key (kbd "C-x C-f") #'helm-find-files)
(setq helm-ag-base-command "rg --smart-case --no-heading --color=never")

(helm-mode 1)
  1. HOME=/tmp/emacs emacs
  2. Open a test.c with the code above
  3. Enable hs-minor-mode in buffer
  4. helm-do-ag and search for 'supp'
@Davidj361 Davidj361 changed the title helm-do-ag breaks in hs-minor-mode on this specific code helm-do-ag breaks in hs-minor-mode on this specific source file Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant