I hesitate to call this a “bug” in jEdit – but it’s an issue which occurs when interacting with common software on Windows. Yesterday I was using jEdit to open some files that were listed in an Excel spreadsheet I’d been given. To do this I was using Ctrl-C to copy the cell contents from Excel, switched to jEdit, and used Ctrl-V to paste the filename into the “File Name:” field on the “File Browser – Open” dialog in jEdit. When I did this the file would open without being syntax-highlighted. I could restore the syntax highlighting by hitting F5 to reload the file, but then as soon as I tried to search or type in the file a second buffer for the file would be opened.

 

After missing with this a bit I think I’ve figured out what was happening. When Excel copies the contents of a cell in which no text is selected to the clipboard it appends a CR/LF pair (standard DOS/Windows line ending convention) to the data. This can be observed by opening Notepad and pasting the clipboard contents into Notepad, where the cursor will end up on the next line. It appears that jEdit is considering everything up to the LF (newline) at the end of the data to be part of the filename, and thus if the “real” filename is xyz.sql, jEdit is seeing it as “xyz.sql” followed by a CR (carriage return). I’m surmising that because of this the file extension is seen as “.sql”+CR and thus the SQL syntax highlighting doesn’t get activated.

 

Note that I’ve got the default line separator (in Global Options – Encodings) set to “Unix (\n)” because most of the files I need to edit are on various *nix servers.

 

Request: either

1.       Change the file browser to strip CR’s off the end of a filename, or

2.       Add an option to do the above somewhere in Global Options.

 

My workarounds are to either type the name of the file (not onerous), or carefully highlight the filename text in the Excel cell so that it doesn’t include a CR/LF pair when subsequently copying the cell contents to the clipboard.

 

Thanks,

Bob Jarvis

The information contained in this e-mail message is privileged and/or
confidential and is intended only for the use of the individual or entity
named above.  If the reader of this message is not the intended
recipient, or the employee or agent responsible to deliver it to the
intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited.
If you have received this communication in error, please immediately
notify us by telephone (330-668-5000), and destroy the original
message.  Thank you.