emacsorphanage / helm-swoop

Efficiently hopping squeezed lines powered by Emacs helm interface
GNU General Public License v3.0
689 stars 55 forks source link

Relative numbers in other buffers change to "0" after swoop #135

Open dolorsitatem opened 5 years ago

dolorsitatem commented 5 years ago

When using relative line numbers, helm-swoop sets all other buffer line numbers to "0". This is on Windows 7 with Emacs 26.1.

  1. Initialize packages: M-: (package-initialize)

  2. Make some new windows: C-x 2 C-x 3

  3. Switch to other window, enter some data, toggle relative line numbers: C-x o C-x b <RET> C-u 10 <RET> M-x linum-relative-mode

  4. Switch to other window and search for text: C-x o M-x helm-swoop C-n C-n C-n

helm-swoop

dolorsitatem commented 5 years ago

It seems that the problem is caused by two actions: making a selection or quitting the helm buffer. I noticed that if I switched buffers, the line numbers reset. So, here's a kludge: switch buffers and switch back after selecting or quitting.

  (defun my-reset-linum-hack ()
    "Hack to reset line numbers by switching to next buffer and switching back."
    (progn
      (switch-to-buffer (other-buffer (current-buffer) 1))
      (switch-to-buffer (other-buffer (current-buffer) 1))))
  (add-hook 'helm-after-action-hook 'my-reset-linum-hack)
  (add-hook 'helm-quit-hook 'my-reset-linum-hack)