Bug 457888 - Kate doesn't respect indentation configuration
Summary: Kate doesn't respect indentation configuration
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: indentation (other bugs)
Version First Reported In: 22.04.3
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-14 18:25 UTC by tnemeth
Modified: 2022-08-15 16:50 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Source file where tabs style auto-detection didn't work. (9.73 KB, text/x-csrc)
2022-08-15 15:48 UTC, tnemeth
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tnemeth 2022-08-14 18:25:24 UTC
SUMMARY

Hi !

I always configure my text editors so that indentation is 8 spaces (no tabs). I did the same in kate and it always worked until recently. Now, whatever the configuration, it always insert only 4 spaces. Kate developers may be in the EVIL clan of the 4-spaces (and less) intendation but they should not force their bellefs on the Good Old Fashion clan ;)


STEPS TO REPRODUCE
1. Open kate's configuration dialog, on the "Modification" section, "Indentation" tab.
2. Select 8 for both "Tabs width" and "Indentation width", with the "Spaces" radio button selected.
3. Open a file and add indentations... Several, on several lines. With text after that. Just like in a C file.

OBSERVED RESULT
Only 4 spaces are added. Not only that but a feint vertical line is displayed at each theoretical 4-spaces tab-stops instead of what has been configured.

EXPECTED RESULT
It should have been 8 spaces inserted and the vertical line should have been at each 8-spaces tab-stops.


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Debian GNU/Linux
KDE Plasma Version: 5.25.4
KDE Frameworks Version:  5.96.0
Qt Version: 5.15.4

ADDITIONAL INFORMATION
The BackSpace action in indentation zone doesn't work anymore also, it seems.
Comment 1 Waqar Ahmed 2022-08-15 13:02:29 UTC
What does it say at the bottom right in the statusbar i.e., what are the indentation settings there?

Also, do you have "Auto detect file indentation" enabled in the settings? And do you have any `.kateproject` or `.editorconfig` file, if so, then settings specified in those file will be preferred.
Comment 2 tnemeth 2022-08-15 14:45:35 UTC
(In reply to Waqar Ahmed from comment #1)
> What does it say at the bottom right in the statusbar i.e., what are the
> indentation settings there?

   "Soft tabs: 8"
 

> Also, do you have "Auto detect file indentation" enabled in the settings?

    I was but as soon as I saw it, I deactivated it.

> And do you have any `.kateproject` or `.editorconfig` file, if so, then
> settings specified in those file will be preferred.

    I don't have those files.

    However after having restarted kate without "Auto detect file indentation", that bug didn't appear anymore.
    I simply had to restart kate with the option deactivated...
Comment 3 Waqar Ahmed 2022-08-15 15:02:58 UTC
Ok so its fixed for you now?

Did you create a new file or was it an already existing file? And if it was an existing file can you share the file where the auto indent detection was failing or maybe a reduced version of the file with which we can repro the bug? Would be great if we can improve it.
Comment 4 tnemeth 2022-08-15 15:48:14 UTC
Created attachment 151341 [details]
Source file where tabs style auto-detection didn't work.
Comment 5 tnemeth 2022-08-15 15:54:07 UTC
(In reply to Waqar Ahmed from comment #3)
> Ok so its fixed for you now?

    It seems.


> Did you create a new file or was it an already existing file?

    It was an existing file... Well it was all the files of a C project. In attachment
    the one I was working on.

> And if it was
> an existing file can you share the file where the auto indent detection was
> failing or maybe a reduced version of the file with which we can repro the
> bug? Would be great if we can improve it.

    I don't understand what's happening : after having enabled back again the
   "Auto detect file indentation", kate doesn't miss-detect that file indentation
   style.

    I'm suspicious of something : katepart had been upgraded a few days ago.
    ktexteditor-katepart:amd64 (5.94.0-4, 5.96.0-1)...

    Could it be a version / configuration file format change that had gone wrong
    at a point ? And now that the configuration file is matching the current Kate
    version, there's no way to reproduce the problem...
Comment 6 Waqar Ahmed 2022-08-15 16:50:31 UTC
Hmm, could be that some setting was stored/read incorrectly and was messing things up. Not sure what though. Anyways, marking it as fixed for now but if it comes back feel free to reopen