Kile complains about "too long lines"

Bug #997004 reported by der_vegi
60
This bug affects 13 people
Affects Status Importance Assigned to Milestone
kate
Won't Fix
Medium
kile (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

When I open files with longer blocks of text, kile reports an error "The file [...].bib/.tex was opened and contained too long lines (more than 1 024 characters). Too long lines were wrapped and the document is set to read-only mode, as saving will modify its content." Kile then breaks these longer blocks of text in an inconvenient way, sometimes in the middle of commands ( "\" break "cite") or in the middle of formulas.

Kile also complains about too long .bib files.

Sample "too long" .tex file attached.

This is a regression introduced by the upgrade from kile version 2.1.0-1ubuntu1 to 2.1.0-1ubuntu2.

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: kile 1:2.1.0-1ubuntu2
ProcVersionSignature: Ubuntu 3.2.0-24.37-generic 3.2.14
Uname: Linux 3.2.0-24-generic x86_64
ApportVersion: 2.0.1-0ubuntu7
Architecture: amd64
Date: Wed May 9 10:43:13 2012
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
SourcePackage: kile
UpgradeStatus: Upgraded to precise on 2012-05-08 (1 days ago)

Revision history for this message
In , Mboquien (mboquien) wrote :

Version: 2.1.1 (using KDE 4.8.0)
OS: Linux

When opening a latex document with kile i get the following message: "The file [...] was opened and contained too long lines (more than 1 024 characters). Too long lines were wrapped and the document is set to read-only mode, as saving will modify its content."

Reproducible: Didn't try

Steps to Reproduce:
Open a file with long lines.

Actual Results:
The above message is displayed.

Expected Results:
No message is displayed and no action is taken. Long lines are perfectly fine (at least i never had a problem with them with strings much longer than 1024 chars).

Thanks!

Revision history for this message
In , Mboquien (mboquien) wrote :

It also causes problems with long lines that are commented because after the forced wrapping, chars after the position 1024 are not commented anymore. Is there a workaround in the meantime?

Revision history for this message
In , Mboquien (mboquien) wrote :

Reassigned to kate as the problem comes from it rather than kile.

Revision history for this message
In , Dhaumann (dhaumann) wrote :

Of course there is a workaround: Change the auto-wrap column from 1024 to 10000 or whatever value you prefer.

Wrapped lines not having a comment character anymore is indeed a problem. Just the same as with static word-wrap at column 80...

Revision history for this message
In , Mboquien (mboquien) wrote :

Ah indeed, i could not find the option, i expected it to be in one of the wrapping option groups. I have found it now.

Revision history for this message
In , Hugo Costelha (hugo-costelha) wrote :

I changed the value to 0 and it worked just fine.

Maybe adding a tip or help message saying you can change it to 0 in order not to impose such limit would be just fine.

Revision history for this message
In , Ian McDonald (ian-mcdonald-jandi) wrote :

Can someone say where the option is so that I can alter? This is also a relatively new bug/regression as didn't have it in Ubuntu 11.10 but do have it in Ubuntu 12.04

Revision history for this message
In , Hugo Costelha (hugo-costelha) wrote :

(In reply to comment #6)
> Can someone say where the option is so that I can alter? This is also a
> relatively new bug/regression as didn't have it in Ubuntu 11.10 but do have
> it in Ubuntu 12.04

Settings -> Configure Kate -> Open/Save -> Line Lenght Limit

Revision history for this message
der_vegi (m-may) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in kile (Ubuntu):
status: New → Confirmed
Revision history for this message
Helder (he7d3r) wrote :
Revision history for this message
der_vegi (m-may) wrote :

Ah, thanks. Workaround from the KDE bug:
"Change the auto-wrap column from 1024 to 0 or whatever value you prefer". Setting can be found in "Settings -> Configure Kile -> Open/Save -> Line Length Limit".

Revision history for this message
In , Alexis-gm (alexis-gm) wrote :

The work around does not work for me. I tried setting the line lenght limit to 0 and to 10000 in both kile and kate, but I still can't edit my file. Even more frustrating is that now when I open the file with the long lines, no message appears at all, and the file appears to be locked.

This bug existed for me with kubuntu 11.10 and now with kubuntu 12.04.

Revision history for this message
ArTaX (marco-zannoni) wrote :

The workaround in #4 worked for me, but the file remains locked and I cannot modify it... I cannot find a solution for this, any idea?

Changed in kate:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
der_vegi (m-may) wrote :

Strange. My workaround does work for me when I set the limit to '0', I can edit the file afterwards.

Revision history for this message
ArTaX (marco-zannoni) wrote :

@der_vegi
Let me be more clear.
I opened a tex source and I experienced this problem. I googled, found this post and set the limit to "0".
Then I reopened the tex source and I cannot edit the file.
I opened an older version of the same source (very similar) and I can edit it.
I renamed the original tex source and I can edit it.

So it seems that kile/kate put a not-writable attribute to the original file that I opened...
Obviously my workaround was to rename the file and continue my work, but this is a bug.

Revision history for this message
Doug Lipinski (dmlipinski) wrote :

Same problem here. I wonder who decided this was a nice "feature" to include. Apparently the files that have been opened as read only due to the line length restriction are logged somewhere in ~/.kde/ and are opened as read only in all future instances without a warning.

A quick and dirty fix:
1) open a terminal
2) remove the .kde directory from your home directory
     user@machine:~$ rm -rf ~/.kde
3) open kile
     user@machine:~$ kile &
4) allow long lines
     settings --> configure kile --> open/save --> line length limit = 0
5) enable dynamic word wrap (if you want)
     settings --> configure kile --> appearance --> dynamic word wrap
6) close kile and repeat steps 3-6 for kate if you want

Revision history for this message
In , Cullmann-t (cullmann-t) wrote :

Tools -> Read only mode
Turn that off after loading, and you can edit.
Otherwise, increase the limit.

Changed in kate:
status: Confirmed → Won't Fix
Revision history for this message
Xvani (fredrile+launchpad) wrote :

Won't fix? WTF?

Revision history for this message
thecalbear@gmail.com (lethalfang) wrote :

I ran into the same problem quite a few times. Could not make any edit in old files. The funny thing is, if I copy-and-paste everything into a new empty document, the problem went away. So it could not just be the length of the line, because the length was the same in copy-and-paste, but somehow the problem went away.

Revision history for this message
Martin Weis (martin-weis-newsadress) wrote :

FYI: The "read only mode" can be toggled in menu Tools, e.g. if it is persisting after reopening a document.

Revision history for this message
Harisankar (harisankarh) wrote :

Doing Fix #4 and then fix #17 worked for me running Kile v2.1.0(KDE 4.8.5) on Ubuntu 12.04 LTS. Thank you

Revision history for this message
Tiger (stefan-bina) wrote :

Ad #22 This solution worked for me as well, but please be aware it deletes all your settings in your KDE programs. I totally had to reconfigure all of them again.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.