Bug 292766

Summary: [Usability] KatePart should clearly indicate when it is in read-only mode
Product: [Frameworks and Libraries] frameworks-ktexteditor Reporter: Tim Barber <timothy.andrew.barber>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: wishlist CC: addressforspam2003, cmertes, michel.ludwig, mogliii
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: All   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Tim Barber 2012-01-29 09:04:59 UTC
Version:           unspecified (using KDE 4.8.0) 
OS:                MS Windows

Everything in Kile works so far as I can tell (PDFLaTeX, ViewPDF).  Viewing the PDF in Okular works fine too.  However, I cannot type anything in the .tex file!!  The keyboard input doesn't work in the editor!!  However, it does work elsewhere such as if I go to configure settings.  Weird.  It also happens in Kate.  Seems to work elsewhere such as Kopete and Konqueror.

Reproducible: Always

Steps to Reproduce:
Simply run Kile and open a .tex or .bib file.

Actual Results:  
The same as above.

Expected Results:  
Allow typing with the keyboard in order to edit .tex files in Kile.

When I installed KDE using the WIndows installer, I had issues with downloading.  I kept receiving checksum errors and could not get any applications to work because of .dll errors.  I finally switched my compiler to MinGW4 when installing.  I kept getting checksum errors, but now the apps work except for this Kile issue.  I also initially only installed Kile and Okular (and Kate after searching and finding out you need that too).  I tried to install additional apps to see if this would help such as the Plasma desktop and basic app package.  However, this did not help as well.  I would be greatly appreciative if this could be solved as I hate Windows (I usually use Ubuntu) but have to use it periodically.  I found out that Kile, my favorite LaTeX editor, could be installed on Windows and I was elated.  However, I have run into this small issue, :P! Thanks for your time and attention.
Comment 1 Tim Barber 2012-01-30 20:19:42 UTC
Ok, so I installed the KDE package for Windows on another machine and it works fine!  I can type. Soooo, I chose the 64-bit MinGW4 compiler and everything else like last time.  I only chose to install Kile, Okular, and Kate.  I did notice that I did not receive any checksum download errors this time.  Sooo, I dunno, I will uninstall and try to reinstall on the other machine to see if it fixes the problem.  It seems it may be an issue with the download errors since that seems to be the only difference?
Comment 2 Tim Barber 2012-01-30 20:32:37 UTC
Ok, I tried to open another .tex file and could not write in it on the machine where one .tex file worked fine.  ???
Comment 3 Patrick Spendrin 2012-02-23 17:43:41 UTC
is that reproduceable per file?
Comment 4 Tim Barber 2012-04-30 16:02:07 UTC
Sorry for not responding as I had kind of given up on Kile in Windows.  However, now I am experiencing similar problems with the keyboard input after upgrading from 11.10 to 12.04.  This is really frustrating as documents (.tex files) that worked fine before, now no longer allow me to type in them!  I can select and scroll with the mouse but no typing!!!!  Funny thing too is that it only happens for a few documents.  I did receive some warning that I haven't seen before when I first opened Kile after upgrading and it was restoring my previous session.  Something to the effect that a line had too many characters?  Sorry, but I foolishly didn't pay attention to it and checked the box not to notify me again :(.  Could there be an issue with the folder and file name structure being too long?  I figure this would be an issue in Windows only, but this is the only thing I can come up with right now.

Here is a post on askubuntu.com where someone is having similar yet different situation with Kile and keyboard issues.

kile does not get keyboard input, respond to Alt+F

I use 11.10 with gnome 3 and Unity. In either case, I use two KDE apps a lot - kile and kate. Since the latest upgrade, I have observed a few problems:

a] I can never use Alt+F to select the file menu (works with other apps), yet when I press Alt, kile's menu comes up in the status bar.

b] A few times every day, while using kile (haven't used kate as much recently), the keyboard stops responding (just in the 'editor' portion, rather than in structure-tree navigation). I cannot enter any text, but mouse works fine. I usually restart kile to continue working.

One inconsistent way to reproduce it (multiple times today):

I cut text from one open document using Ctrl-X

switched to another document in the same kile window using Ctrl-Tab, then this happened.

c] Sometimes, in kate, I can type in the editor but the keyboard won't work in the 'File open dialog'.

How do I fix the above?
Comment 5 Michel Ludwig 2012-04-30 17:00:57 UTC
(In reply to comment #4)
> How do I fix the above?

When it becomes impossible to write in the editor, can you check whether read-only mode is disabled (Tools / Read Only Mode)?
Comment 6 mogliii 2012-04-30 17:46:37 UTC
What kind of files are you opening? Or does this also happen in new files?

I had a problem once because Kate restricted the number of characters per line, and if exceeded, opened the file read-only. And the limit is afaik very low.
Comment 7 Tim Barber 2012-04-30 22:50:41 UTC
(In reply to comment #5)

OMG.  That's it!!  I knew it would be something silly like that.

> (In reply to comment #4)
> > How do I fix the above?
> 
> When it becomes impossible to write in the editor, can you check whether
> read-only mode is disabled (Tools / Read Only Mode)?
Comment 8 Tim Barber 2012-04-30 22:52:42 UTC
(In reply to comment #6)

Ah, yes!  That was the error I was getting in Kile.  They were files I was using previously (so old files, not new ones).  Weird how that was happening.  Now I just need to go back and see if this is what was happening in my KDE for Windows!

> What kind of files are you opening? Or does this also happen in new files?
> 
> I had a problem once because Kate restricted the number of characters per
> line, and if exceeded, opened the file read-only. And the limit is afaik
> very low.
Comment 9 Tim Barber 2012-04-30 22:54:16 UTC
Forgot to mention, THX!!  I'll change the bug to resolved once I check the Windows KDE/Kile.
Comment 10 mogliii 2012-05-03 07:45:24 UTC
One more note about this:

Can Kile be adjusted to set the character limit per line of Kate to a much larger number by default?

For source code 1024 can be sufficient, but .tex files are normally one line <-> one paragraph. Thus lines can become very long and 1024 appears ridiculously low in that context.

Or add a custom warning message when opening files and hitting this limit.
Comment 11 Tim Barber 2012-05-06 19:48:50 UTC
Ok, so the Read Only mode was enabled as well which when disabled solved my KDE-Kile Windows problem as well.  Not sure if I should mark this as RESOLVED yet?
Comment 12 Tim Barber 2012-05-06 19:53:38 UTC
I agree about the character limit being very low.  I did experience an error message regarding the limit when I upgraded from Ubuntu 11.10 to 12.04.  However, silly me did not make the connection!

(In reply to comment #10)
> One more note about this:
> 
> Can Kile be adjusted to set the character limit per line of Kate to a much
> larger number by default?
> 
> For source code 1024 can be sufficient, but .tex files are normally one line
> <-> one paragraph. Thus lines can become very long and 1024 appears
> ridiculously low in that context.
> 
> Or add a custom warning message when opening files and hitting this limit.
Comment 13 cmertes 2012-11-08 15:48:04 UTC
Without having found this bug I would have lost my mind. I never purposefully activated the read-only mode. Can we make this bug a wishlist entry to have some kind of indication of the read-only mode? A color change or something similarly hard to miss? A checkbox in some huge menu as the only indication why the whole software stopped working? Really? There must be something in the KDE human interface guidelines to prohibit such a behavior.

Alternative to an indication, kile could detect that someone is persistently trying to type despite the read-only mode and issue a warning.

Or having a read-only mode checkbox can be made entirely opt-in. How many people use it, really?

Besides, it's not only Windows as a platform of course so that could be changed in the bug description, too.
Comment 14 addressforspam2003 2013-01-28 19:56:28 UTC
I just started trying out Kile and came across this problem. I only realised there was a 'Read Only Mode' by googling and finding other frustrated folk out there. Basically I nearly just assumed Kile was broken and useless on my system or something.

If you are in read only mode for a file there should be a big red banner across the top of the file saying so. Many new users will not have come across such a mode before (I have not and I'm a developer using many different IDEs). I'm using Mint Linux 14 and the (Ubuntu) software repository version, not that it matters.
Comment 15 Dominik Haumann 2013-01-29 08:46:21 UTC
From KDE 4.10 on, Kate and KWrite display in the title bar the suffix [read only], example:
"somedocument.tex [read-only]". There still is no visual indicator.

The change was made in the following commit:
https://projects.kde.org/projects/kde/kde-baseapps/kate/repository/revisions/e5a6f98c649e4fe4cc01af55ad925b7b7b643517

There, you can also see that KTE::Document will emit the signal
  void readWriteChanged (KTextEditor::Document *document);
in KDE >= 4.10. Maybe this is something that Kile can use to add a [read only] as well in the title.

Another note: Kate Part also saved the read-only flag when closing and opening a file again (read-only was part of the meta-data). This also changed in KDE 4.10: read-only is not part of the meta-data anymore.

Changing the background-color is not a good idea, since it decreases the readability, and kate part is also used in other contexts (e.g. Konqueror as read-only part for text fiels).

With respect to the line length limit: Currently, Kile can only disable it by overwriting in kilerc:
[Kate Document Defaults]
Line Length Limit=0 # 0 = disable

The line length was by the way increased to 4096. Still, Kile users (tex writers) tend to write everything into one single line. This is probably simply because Kate Part supports the dynamic word wrap. The idea of the dynamic word wrap was initially that if a line does not entirely fit, show the remainig parts in the next line(s). It was never meant to write entire paragraphs into one single line. This is bad habit anyway, especially when using version control systems (svn, git, ...), because then, when chaning one single character, the entire line changes, resulting in pretty bad diffs.
So consider starting a new line manually for each sentence, or at least every few sentences...
Comment 16 Michel Ludwig 2013-01-29 09:18:39 UTC
(In reply to comment #15)
> There, you can also see that KTE::Document will emit the signal
>   void readWriteChanged (KTextEditor::Document *document);
> in KDE >= 4.10. Maybe this is something that Kile can use to add a [read
> only] as well in the title.

Yes, that's a good suggestion. I'll add that.

> The line length was by the way increased to 4096. Still, Kile users (tex
> writers) tend to write everything into one single line. This is probably
> simply because Kate Part supports the dynamic word wrap. The idea of the
> dynamic word wrap was initially that if a line does not entirely fit, show
> the remainig parts in the next line(s). It was never meant to write entire
> paragraphs into one single line. This is bad habit anyway, especially when
> using version control systems (svn, git, ...), because then, when chaning
> one single character, the entire line changes, resulting in pretty bad diffs.
> So consider starting a new line manually for each sentence, or at least
> every few sentences...

I've heard from some users that they tend to write long lines because KatePart cannot search for strings across line boundaries (without using regular expressions).
Comment 17 Doug McGarrett 2013-01-29 16:55:28 UTC
On 01/29/2013 03:25 AM, Michel Ludwig wrote:
> https://bugs.kde.org/show_bug.cgi?id=292766
>
> Michel Ludwig <michel.ludwig@kdemail.net> changed:
>
>             What    |Removed                     |Added
> ----------------------------------------------------------------------------
>               Status|UNCONFIRMED                 |CONFIRMED
>              Version|unspecified                 |Git
>            Component|other                       |part
>             Assignee|kde-windows@kde.org         |kwrite-bugs-null@kde.org
>              Product|kde-windows                 |kate
>       Ever confirmed|0                           |1
>              Summary|Keyboard input does not     |[Usability] KatePart should
>                     |work in Kile or Kate        |clearly indicate when it is
>                     |                            |in read-only mode
>             Severity|critical                    |wishlist
>                   OS|MS Windows                  |All
>
This message to me with the following note in dim type on the bottom.

You are receiving this mail because:
You are the assignee for the bug.

I am not a developer. I don't know what kile is. I have used Kate in Linux and
Windows without any difficulty.

Please take me off your list as "assignee for the bug."

Doug McGarret
Comment 18 Jekyll Wu 2013-01-29 18:07:11 UTC
(In reply to comment #17)
> Please take me off your list as "assignee for the bug."
> 
> Doug McGarret

Nobody has ever assigned this bug to you.  Check whether you are watching kwrite-bug-null@kde.org or kde-windows@kde.org .
Comment 19 Andrius 2013-01-30 10:22:25 UTC
Doug,

The 'kde-windows@kde.org' is the mailing list set as assignee for Windows
bugs, so developers in this mailing list can be notified of those specific
bugs. This doesn't mean _you_ are the assignee.
 --
Andrius.
2013/1/29 Doug <dmcgarrett@optonline.net>

> On 01/29/2013 03:25 AM, Michel Ludwig wrote:
>
>> https://bugs.kde.org/show_bug.**cgi?id=292766<https://bugs.kde.org/show_bug.cgi?id=292766>
>>
>> Michel Ludwig <michel.ludwig@kdemail.net> changed:
>>
>>             What    |Removed                     |Added
>> ------------------------------**------------------------------**
>> ----------------
>>               Status|UNCONFIRMED                 |CONFIRMED
>>              Version|unspecified                 |Git
>>            Component|other                       |part
>>             Assignee|kde-windows@kde.org         |
>> kwrite-bugs-null@kde.org
>>              Product|kde-windows                 |kate
>>       Ever confirmed|0                           |1
>>              Summary|Keyboard input does not     |[Usability] KatePart
>> should
>>                     |work in Kile or Kate        |clearly indicate when
>> it is
>>                     |                            |in read-only mode
>>             Severity|critical                    |wishlist
>>                   OS|MS Windows                  |All
>>
>> This message to me with the following note in dim type on the bottom.
>
>
> You are receiving this mail because:
> You are the assignee for the bug.
>
> I am not a developer. I don't know what kile is. I have used Kate in Linux
> and
> Windows without any difficulty.
>
> Please take me off your list as "assignee for the bug."
>
> Doug McGarret
>
>
> ______________________________**_________________
> Kde-windows mailing list
> Kde-windows@kde.org
> https://mail.kde.org/mailman/**listinfo/kde-windows<https://mail.kde.org/mailman/listinfo/kde-windows>
>
Comment 20 Christoph Cullmann 2019-05-19 14:57:53 UTC
Dear user, this wish list item is now closed, as it wasn't touched in the last year and no contributor stepped up to implement it.

The Kate/KTextEditor team is small and we can just try to keep up with fixing bugs.

Therefore wishes that show no activity for a years or more will be closed from now on to keep at least a bit overview about 'current' wishs of the users.
If you want your feature to be implemented, please step up to provide some patch for it.

If you think it is really needed, you can reopen your request, but keep in mind,
if no new good arguments are made and no people get attracted to help out to implement it,
it will expire in a year again.

We have a nice website https://kate-editor.org that provides all the information needed to contribute, please make use of it.

Patches can be handed in via https://phabricator.kde.org/differential/

Greetings
Christoph Cullmann