I think, the recognition of end of line characters is
In the RemoveTrailingSpaces, i used:
relewin = re.compile('\r\n', re.M)
releunix = re.compile('[^\r]\n', re.M)
relemac = re.compile('\r[^\n]', re.M)
text = DrDocument.GetText()
#check line endings
win = unix = mac = 0
win = 1
unix = 1
mac = 1
mixed = win + unix + mac
#correct the lineendings before
if mixed > 1:
wx.MessageDialog(DrFrame, "Line endings mixed", "Remove trailing Whitespace", wx.ICON_EXCLAMATION).ShowModal()
Now: if one line ending is crlf, then WIN is display in the status bar.
Wouldn't it be better, if one opens a file,
the first eol char is used to display the mode,
and the eol mode should be set to this mode (?)
if the line endings are mixed, then in the statusbar,
there could be: "UNIX mixed"
Thanks, this is in 3.7.6 (not the trailing whitespace bit)
Log in to post a comment.