helm-swoop icon indicating copy to clipboard operation
helm-swoop copied to clipboard

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

Open dolorsitatem opened this issue 6 years ago • 1 comments

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 avatar Nov 26 '18 23:11 dolorsitatem

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)

dolorsitatem avatar Nov 27 '18 16:11 dolorsitatem