This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Kwrite 4.8.3 Breaks Long Lines

Tags: None
(comma "," separated)
User avatar
Archie
Registered Member
Posts
15
Karma
0
OS

Kwrite 4.8.3 Breaks Long Lines

Mon May 07, 2012 9:53 am
Hi. KDE 4.8.3 on PCLinuxOS 64-bit.

In opening already existing text files, a popup message warns the document "was opened and contained too many long lines (more than 1024 characters). Too long lines were wrapped and the document is set to read-only mode, as saving will modify its content."

Is there a way to bypass this limitation? Perhaps a patch to the source code (I believe it's Kate) so we can repackage the app again?

Thank you for any assistance.

Peace and much respect,
Archie

EDIT:

Never mind, I found the way to set the Line Length Limit to unlimited.

Just in case anyone runs into the same problem, go to Settings > Configure Editor. Click Open/Save and change the Line Length Limit from 1024 to 0. Click OK and your long lines are back for editing.


What is necessary is never unwise. --Sarek, 2258.42
mpictor
Registered Member
Posts
7
Karma
0
OS

Re: Kwrite 4.8.3 Breaks Long Lines

Sun Jun 24, 2012 5:02 pm
I just upgraded and ran into this problem myself. I am very disappointed that this change was made. KDE, what were you thinking?!

This is a very poorly thought out change. You don't tell us how to override, which means that Kate and KDevelop are useless for people who need to edit large files and who don't find the undocumented workaround. Undocumented. UNDOCUMENTED!!!!! >:(

There are a lot of other people who are upset as well: http://olezfdtd.wordpress.com/2012/04/0 ... -and-kile/

What's the problem with long lines? Do they screw up syntax highlighting or something? Then show the user a message like

Code: Select all
This file has extremely long lines (up to nnnn characters).
         This can cause <feature xyz> to malfunction.
                [Disable]             [Try anyway]
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS

Re: Kwrite 4.8.3 Breaks Long Lines

Sun Jun 24, 2012 5:31 pm
As far as I know, the reason is that kate gets somewhat slow if you have very long lines and try to edit that file. I also think the default limit was raised to 2^16 chars recently, which sounds more acceptable. But that's not in 4.8.

The reasoning behind this limitation was, I think, that kate is meant to be an editor for program source code, which will almost never contain such long lines.

Greetings


I'm working on the KDevelop IDE.
mpictor
Registered Member
Posts
7
Karma
0
OS

Re: Kwrite 4.8.3 Breaks Long Lines

Sun Jun 24, 2012 8:41 pm
scummos wrote:As far as I know, the reason is that kate gets somewhat slow if you have very long lines and try to edit that file. I also think the default limit was raised to 2^16 chars recently, which sounds more acceptable. But that's not in 4.8.


Ok, good :)

The reasoning behind this limitation was, I think, that kate is meant to be an editor for program source code, which will almost never contain such long lines.


I'm not so certain about that "almost never" part :)

Here's a tarball with two C++ files. One file has a line with >42000 characters; the other file has >407000 lines.
https://docs.google.com/open?id=0B1aZBD ... HU0aXk1b2M

If you want proof that it's valid c++:
Code: Select all
git clone git://github.com/stepcode/stepcode.git sc
mkdir sc/build
cd sc/build
git checkout 6e6fb8197ca3eb
cmake .. -DBUILD_SCHEMAS=ALL
make p21read_sdai_ap239_arm_lf
make generate_cpp_210e3_wip_v1_41_mim_lf   

wc -lL 210e3_wip_v1_41_mim_lf/SdaiAll.cc ap239_arm_lf/SdaiAP239_PRODUCT_LIFE_CYCLE_SUPPORT_ARM_LF.cc

The last line prints the number of lines and max line length for two files.

I cannot guarantee that it will compile with anything other than GCC, including clang; MSVC and Borland are both known to have problems with code generated by this program (>2048 chars in a static string, >127 nested if-else, >16384 functions in a compilation unit, etc... :D )

Regards
Mark
User avatar
scummos
Global Moderator
Posts
1175
Karma
7
OS

Re: Kwrite 4.8.3 Breaks Long Lines

Sun Jun 24, 2012 11:22 pm
Hi there,

no doubt you can do that! Of course you can. It's just... it usually doesn't happen. (Although 1024 chars is *really* low, for LaTeX source files I can easily exceed that number, as I usually write a paragraph without newlines, and use the editor line wrapping feature instead)

I also don't think the limit is a good idea. I just wanted to explain the reasoning behind it.

Greetings,
Sven


I'm working on the KDevelop IDE.
User avatar
Archie
Registered Member
Posts
15
Karma
0
OS

Re: Kwrite 4.8.3 Breaks Long Lines

Sun Jul 01, 2012 1:57 am
However the default settings was implemented at least it's good to know there's an option to override the "imposed" limitation.


What is necessary is never unwise. --Sarek, 2258.42


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell