Open Files With Long Lines in KWrite, Kate and Kile
In a recent KDE upgrade, the katepart text editor, which powers, kwrite, kile and kate, has been modified to open files with long lines as read only.
Sometimes it will tell you about this in a warning, sometimes you’ll just notice that you cannot modify the file.
It also turns out that the maximum line length is actually very short: 1024 characters. You will have no trouble finding log files with lines longer than this.
After some poking around we’ve figured out that the maximum line length is configurable:
Go to
settings
> configure editor
> open/save
There you can change the
line length limit
The value 0 means that there is no maximum.
Hit Ok
and you’re good to go again.
As a side note: this is a very annoying change. Kate was working fine for us. This new change might fix some bug somewhere, but made the software unusable for our scenario, with absolutely no documentation or hint on how restore the previous behavior. Sometimes you don’t even get a warning that the file was loaded read only (many keyboards have suffered because of this)
Edit: Apparently Kile remembers the read only state of a document. It will keep a document read only if it was previously read only, even after you made the change in the settings. You can turn off read only mode for the active mode by deselecting it in the Tools
menu. Kate and KWrite do have this issue.
It can be even worse if as me you realize how to remove the read only option as then your file is cut… The alternative was to have a completely useless kile program! I finally gave kile up because of those annoyances (I had to reedit my very long tex file in texmaker because of this issues).
I don’t know who had the brilliant idea of this change but she or he can be full of glory for these changes ;)
Anyways, thanks a lot for this. I can sanely use kile and kate again!
Thanks for this! Saved me from figuring out the “bug” after upgrading to Ubuntu Precise
thanks for sharing this useful information!
Ubuntu people usually makes thing right, but this avoidable “bug” is definitely a fail!
Thanks, worked and solved the problem :)
thanks for the hint, really annoying way this change was introduced. in kate the option can be found here: Settings > Configure Kate… > Editor Component > Open/Save > Line Length Limit
Doesn’t really work for me – no matter what I set this setting to (e.g., I’ve tried 16384 and 0), the files are read only… Really annoying!
Doesn’t work for me either. Also with the option “unlimited” which follows after 0 in my case (because of kde 4.8.3 ?).
I haven’t updated kde yet. Maybe there is another issue in later versions.
edit: Just installed a new machine, upgraded to kde 4.8.3 and the fix still works
Setting the value to 0 should reset the behaviour to what it was pre 4.8
Thank you for your help!
I cannot reproduce the error anymore. :) . Actually I cannot say why it didn’t work the first time. I even restarted linux, which didn’t work and made me quiet “unhappy”.
It’s “just” working! Thanks again!
Apparently kile remembers the read-only state of a document.
A file that was previously opened in read-only mode will open again in read only mode, even after you have changed the setting.
You can disengage read only mode for the current file by going into the “Tools” menu and turn it off.
I will edit the main post with this info.
Thank you very much. I got confused with this error because I can edit the file just fine with vim and other editor.
Thanks! Especially the bit about the read only mode was very helpful to me.
Thanks, this solved my problem!
Thanks a lot, dude! :-)
I have the same problem as stated above. Changed the settings to a very large number, but Kate still loads my files in read only made. After searching all the settings I don’t see a “Tools” menu anywhere. What Tools menu? Where is it?
Any assistance appreciated. I am using Kate on Linux Mint – Debian 64 version.
You should change the value to 0 to enable the pre 4.8 behaviour.
In certain cases kile (maybe kate to, I don’t know) remembers the read only flag. You can disable “read only mode” in the tools menu, which is a global menu just like “file” and “edit”
I hope this gets it sorted for you.
Thank you!
I was parsing and converting a text file and I spent about half a day trying to figure out why when I opened the final file, there were more lines than they should … I thought that the original file had “hidden” delimiters that Octave took to be new line marks … I also thought that I was introducing odd characters in the parsing but when I couldn’t find any strange line break using vi I thought that it could be a Kwrite “feature” … I can now sleep!!!
Thanks again
Thanks mate!
I’m getting pretty annoyed by the seemingly random changes that pop up in many open-source programs lately.
Thanks! It’s weird this setting of infinite line limit is not set by default!
Thank you very much!! :D
Thank you!!
Thank you so much! I was so stresed/angry until I read this.
Including your two additions at the bottom. Such a life-saver!
What is the purpose of such limitation ?
Thank you…. This was messing up one of my base64 encoded files and was quite annoying. Thanks again!
Thank you! :)
Thank you!
This works so far for Kate on Debian 7 AMD64. This was driving me crazy – I had to deselect read only mode for every html file I tried to edit in Kate – it became very annoying, very rapidly. I was considering testing the impact resistance of my computer.
Thanks for posting the solution.