emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/csv-mode 56ed871dc2: Fix skipping of empty fields when


From: Filipp Gunbin
Subject: [elpa] externals/csv-mode 56ed871dc2: Fix skipping of empty fields when transposing rows with quotes
Date: Wed, 23 Mar 2022 12:34:08 -0400 (EDT)

branch: externals/csv-mode
commit 56ed871dc2feb9a12dce84a590ef9f049cc0405a
Author: Filipp Gunbin <fgunbin@fastmail.fm>
Commit: Filipp Gunbin <fgunbin@fastmail.fm>

    Fix skipping of empty fields when transposing rows with quotes
    
    * csv-mode.el (csv--collect-fields): Don't do csv-forward-field if on
    separator, otherwise empty fields are missed.
---
 csv-mode.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/csv-mode.el b/csv-mode.el
index 24ed55b7fb..c78c44222e 100644
--- a/csv-mode.el
+++ b/csv-mode.el
@@ -1321,7 +1321,10 @@ point is assumed to be at the beginning of the line."
        (split-string row-text csv-separator-regexp)
       (save-excursion
        (while (< (setq field-start (point)) row-end-position)
-         (csv-forward-field 1)
+          ;; csv-forward-field will skip a separator if point is on
+          ;; it, and we'll miss an empty field
+          (unless (memq (following-char) csv-separator-chars)
+           (csv-forward-field 1))
          (push
           (buffer-substring-no-properties field-start (point))
           fields)



reply via email to

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