From 00b070b7e6da43ce082976b59f685c812e841d7f Mon Sep 17 00:00:00 2001 From: Angel Ortega Date: Mon, 27 Feb 2012 12:49:17 +0000 Subject: [PATCH] Make 'keep_eol' behaviour more intuitive (Closes: #1294). --- RELEASE_NOTES | 2 ++ TODO | 4 ++-- mp_file.mpsl | 7 +++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/RELEASE_NOTES b/RELEASE_NOTES index 5b72587..941d241 100644 --- a/RELEASE_NOTES +++ b/RELEASE_NOTES @@ -23,6 +23,8 @@ Minimum Profit Release Notes - The `build' action remembers the last Makefile target. - The `section_list' action sets the list selector to the most appropriate section regarding the current cursor position. + - Fixed bugs: + - Make `keep_eol' behaviour more intuitive (bug #1294). 5.2.1 ----- diff --git a/TODO b/TODO index 4b0f06c..8f37909 100644 --- a/TODO +++ b/TODO @@ -6,8 +6,6 @@ Release Critical Bugs * 1286: Add an action to move to previous section. * 1287: Add an action to move to next section. - * 1294: If the `keep_eol' config variable is not set, EOLs should - be forced. * 1295: Delete backspace+char pairs when piping help. Open Bugs @@ -368,5 +366,7 @@ Closed * 1293: Add a mp.pipes() game (Fri, 20 Jan 2012 12:58:44 +0100). * 1284: Add version control support (git, svn, etc) (Tue, 14 Feb 2012 12:25:04 +0100). + * 1294: If the `keep_eol' config variable is not set, EOLs should + be forced (Mon, 27 Feb 2012 12:47:26 +0000). Email bugs to angel@triptico.com diff --git a/mp_file.mpsl b/mp_file.mpsl index eee4a55..d5355e8 100644 --- a/mp_file.mpsl +++ b/mp_file.mpsl @@ -377,7 +377,7 @@ sub mp.save_th(f, doc) /* mp.save() helper */ { local nl = 0; - local eol = doc.eol || mp.config.eol; + local eol = mp.config.keep_eol && doc.eol || mp.config.eol; doc.disk_op = 1; @@ -624,9 +624,8 @@ sub mp.open(filename) /* store the encoding */ d.encoding = DETECTED_ENCODING || ENCODING || ''; - /* if original EOL is to be kept, store it */ - if (mp.config.keep_eol) - d.eol = mp.last_seen_eol; + /* always keep original EOL */ + d.eol = mp.last_seen_eol; return d; } -- 2.11.4.GIT