Monday, May 21st 2018, 7:06pm UTC+2

You are not logged in.

  • Login
  • Register

Dear visitor, welcome to SEGGER Forum. If this is your first visit here, please read the Help. It explains how this page works. You must be registered before you can use all the page's features. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.



Date of registration: May 14th 2014

Posts: 11


Friday, November 17th 2017, 12:03am

Problem with Widget MultiEdit not terminating with CR LF

I have had great success in implementing the MultiEdit Widget for use as a text editor in an embedded application.
The text files that the MultiEdit widget edits are script files for the application, and is stored on an SD card or USB stick.

One observation that I have noticed is that when I use MULTIEDIT_GetText() to save text to the SD or USB, MultiEdit only terminates lines with a LF and not a CRLF for each line of text.
This poses a problem when opening the exported MutiEdit file with Notepad when trying to edit the text file missing CR characters. More intelligent editors will automatically interpret the LF as a CRLF.

If I import a text file from NotePad (or another external text editor) into MULTIEDIT, the widget has no problems with the CRLF characters. It also will save the text file with the CRLF character intact.
If I change a line of text in MultiEdit followed by CR, then that line of text will not have CRLF, only LF.

My work around for this is I analyzer every character being stored to the USB or SD card, and if I detect a LF without the CR, I insert the CR before the LF.
This way text files saved from MultiEdit can be opened in an external text editor.

I thought I would let you know, perhaps a minor fix to a future revision.
Thanks again.

SEGGER - Schoenen

Super Moderator

Date of registration: Aug 13th 2015

Posts: 584


Thursday, November 23rd 2017, 4:18pm


This is the way the MULTIEDIT is indented to work. But, you can set a callback for the MULTIEDIT widget which adds an additional CR before a LF is added.

Please take a look at the sample attached. Maybe this is what you are looking for.

SEGGER - Schoenen has attached the following file:

Similar threads