emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[BUG] colview.el regexp - capture operator when title is empty


From: Sławomir Grochowski
Subject: [BUG] colview.el regexp - capture operator when title is empty
Date: Mon, 19 Aug 2024 12:45:32 +0200

Hello,

I have found a bug in regexp.
Test that need to pass to fix it is below.

>From 9710f6befb1bd4eee2d508d7baaee95e825a68dc Mon Sep 17 00:00:00 2001
From: Slawomir Grochowski <slawomir.grochowski@gmail.com>
Date: Mon, 19 Aug 2024 12:30:49 +0200
Subject: [PATCH] testing/lisp/test-org-colview.el: add test to pass to fix a
 bug

---
 testing/lisp/test-org-colview.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/testing/lisp/test-org-colview.el b/testing/lisp/test-org-colview.el
index 6b603c31b..8615ef760 100644
--- a/testing/lisp/test-org-colview.el
+++ b/testing/lisp/test-org-colview.el
@@ -90,7 +90,12 @@
   (should
    (equal `(("ITEM" "ITEM" nil "+" "%.1f"))
           (org-columns-compile-format
-           "%ITEM{+;%.1f}"))))
+           "%ITEM{+;%.1f}")))
+  (should
+   ;; Bug - when the title is empty, the regular expression will not capture 
the operator.
+   (equal '(("ITEM" "ITEM" nil "X" nil))
+          (org-columns-compile-format
+           "%ITEM(){X}"))))
 
 (ert-deftest test-org-colview/substring-below-width ()
   "Test `org-columns--truncate-below-width'."
-- 
2.30.2

Steps to reproduce:
1. add new column with an empty title and select one of the operators.
2. press 's' when the cursor is the added column - operator should be
selected, but it's empty. 

Regards,
-- 
Slawomir Grochowski

reply via email to

[Prev in Thread] Current Thread [Next in Thread]