"Edit mode" button inactive (greyed) in Compare by content
Moderators: Hacker, petermad, Stefan2, white
"Edit mode" button inactive (greyed) in Compare by content
Hello,
I have strange case, when want compare 2 text files (.html being more accurate) I see them in both panels, can click button "compare", "Next difference" , "Previous Difference" and rest but button "Edit mode" is not active (grayed, not clickable), not know why. Both compared files are circa 250 kB size , circa 1800 lines of text, so no so large as one could assume that's the cause.
In Help file I read description of Compare:
Compare Starts the comparison between the two chosen files. If the two files are identical, this will be shown with a dialog box only. Otherwise the differences will be shown in the two text windows. Binary files will be shown in hexadecimal mode, and text files in text mode. Files up to 2 MB will be loaded completely into memory, so the originals will remain editable. Larger files will only be mapped to memory, i.e. they remain locked during the comparison.
My files are far less than 2 MB....
I wanted to make edit one of compared files when watching differences from other panel but can't click "Edit mode" button
I have strange case, when want compare 2 text files (.html being more accurate) I see them in both panels, can click button "compare", "Next difference" , "Previous Difference" and rest but button "Edit mode" is not active (grayed, not clickable), not know why. Both compared files are circa 250 kB size , circa 1800 lines of text, so no so large as one could assume that's the cause.
In Help file I read description of Compare:
Compare Starts the comparison between the two chosen files. If the two files are identical, this will be shown with a dialog box only. Otherwise the differences will be shown in the two text windows. Binary files will be shown in hexadecimal mode, and text files in text mode. Files up to 2 MB will be loaded completely into memory, so the originals will remain editable. Larger files will only be mapped to memory, i.e. they remain locked during the comparison.
My files are far less than 2 MB....
I wanted to make edit one of compared files when watching differences from other panel but can't click "Edit mode" button
Re: "Edit mode" button inactive (greyed) in Compare by content
Where are the files located? (local, USB, server, ...)
Are they are write protected? (can you modify them outside of compare?)
Are they are write protected? (can you modify them outside of compare?)
Re: "Edit mode" button inactive (greyed) in Compare by content
Both are on my local ssd disk, I can edit them normally when opened in Notepad++ or under F4 in Tc but not in Edit mode as above 

Re: "Edit mode" button inactive (greyed) in Compare by content
The files are most likely pretty large. By default TC maps files with 1048576 bytes or more into memory, disabling the ability to edit them in the "Compare by content" window. There is a setting to change this, see TC help, section 4.b):
Regards
Dalai
I vaguely remember that the value might be the sum of both file sizes, but I'm not sure.MaxCompareSizeInMem=1048576
Compare by content: Size limit for files which are loaded completely in memory for comparison. Larger files are mapped into memory.
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Re: "Edit mode" button inactive (greyed) in Compare by content
files are 250 KB only, and 1048576 is circa 1 MB, so my files are 1/4 of that limit, isn't it ?
Re: "Edit mode" button inactive (greyed) in Compare by content
Sorry, I somehow missed that you mentioned the file size in the OP already.
Are there very long lines in these files, something like 4096 characters or more?
Regards
Dalai
Are there very long lines in these files, something like 4096 characters or more?
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Re: "Edit mode" button inactive (greyed) in Compare by content
unfortunately yes, there are very long lines inside, scripts in Javascropt which someone put as oneliner, over 8000 long as I see in Notepad++, so because it's script then don't know in which place I can "break" it to split to 2 lines, to not break the code. As I suppose it's cause as you suggested ?
If yes then OK, I can live with it, at least now I know TC limitation.
If yes then OK, I can live with it, at least now I know TC limitation.
Re: "Edit mode" button inactive (greyed) in Compare by content
Yes, overly long lines and file size are the two main reasons why the edit mode gets disabled.
If you can, insert line breaks to shorten the lines. Usually JS code should keep working when inserting a line break after a statement (terminated by a semicolon).
Regards
Dalai
If you can, insert line breaks to shorten the lines. Usually JS code should keep working when inserting a line break after a statement (terminated by a semicolon).
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Re: "Edit mode" button inactive (greyed) in Compare by content
Thank you Dalai for help, in spare time I'll test if I can break that long lines of code without messing the code. Btw I checked, these 3 looong lines are jQuery code imported into that html file. Someone put them inside instead of putting only short url to download jQuery live.
/* --- jQuery 1.6.2: http://jquery.com/ --- */
Ane below are mentioned 3 lines, but what is interesting, I checked how each of these 3 lines ends at far far right side after scrolling to end of these lines and:
1st line: .............trigger:function(c,d,e,g){var h=c.type||c,i=[],j;h.indexOf("!")>=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.
2nd line: .............(this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])(j),d=d.concat(j
3rd line: .............:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window);
So it looks like last line (3) ends with ; but 1st h=i. and 2nd concat(j end totally random, but not being dev cant be sure.
/* --- jQuery 1.6.2: http://jquery.com/ --- */
Ane below are mentioned 3 lines, but what is interesting, I checked how each of these 3 lines ends at far far right side after scrolling to end of these lines and:
1st line: .............trigger:function(c,d,e,g){var h=c.type||c,i=[],j;h.indexOf("!")>=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.
2nd line: .............(this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])(j),d=d.concat(j
3rd line: .............:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window);
So it looks like last line (3) ends with ; but 1st h=i. and 2nd concat(j end totally random, but not being dev cant be sure.
Re: "Edit mode" button inactive (greyed) in Compare by content
It's possible that JS doesn't really care about line breaks (and much more about syntax), but since I know very very little about JS I can't really say.
Regards
Dalai
Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
- ghisler(Author)
- Site Admin
- Posts: 50541
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: "Edit mode" button inactive (greyed) in Compare by content
Normally there shouldn't be a problem breaking such code into multiple lines. You need to add a line break at specific locations, though ,e.g. after a ";" or before a "{" should always work.
The reason why there is a character limit is that Windows crashes with some display adapters when trying to display a text string longer than a certain limit. This limit is 32768 characters on Windows NT based systems. TC will split longer strings into multiple calls in read only mode, but this would be difficult in edit mode.
In Tc 10 and older, the limit was 16350 characters on all systems, so you may want to update if the lines are shorter than 32768 characters.
The reason why there is a character limit is that Windows crashes with some display adapters when trying to display a text string longer than a certain limit. This limit is 32768 characters on Windows NT based systems. TC will split longer strings into multiple calls in read only mode, but this would be difficult in edit mode.
In Tc 10 and older, the limit was 16350 characters on all systems, so you may want to update if the lines are shorter than 32768 characters.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com