cute-jumper / org-table-sticky-header

Sticky header for org-mode tables
36 stars 4 forks source link

Save match data is necessary #7

Closed swhahn closed 7 years ago

swhahn commented 7 years ago

Hello, I'm using your package since since several weeks, it's nice. Today I came about a problem when using query-replace to change the content of an org-table; it throw a exception. After digging it down I saw, that the problem occurs if the screen scrolls vertically. The match data where lost. So it is necessary to save the match data, here is my proposal of change:

@@ -168,7 +168,8 @@ org-table-sticky-header--fetch-header
 (defun org-table-sticky-header--scroll-function (win start-pos)
   (unless (= org-table-sticky-header--last-win-start start-pos)
     (setq org-table-sticky-header--last-win-start start-pos)
-    (org-table-sticky-header--fetch-header)))
+    (save-match-data
+      (org-table-sticky-header--fetch-header))))

 ;;;###autoload
 (define-minor-mode org-table-sticky-header-mode

With kind regards, Stefan

cute-jumper commented 7 years ago

Thanks for reporting this! I've applied the changes. Should be in Melpa soon.