Bug 258980 - indentation setting reset on file save or file open
Summary: indentation setting reset on file save or file open
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: indentation (show other bugs)
Version: 0.2
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-06 09:23 UTC by Becheru Petru-Ioan
Modified: 2012-11-01 12:55 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Becheru Petru-Ioan 2010-12-06 09:23:38 UTC
Version:           0.2 (using KDE 4.5.80) 
OS:                Linux

If you open a C file (or cpp) or JavaScript file the indentation will be reset to C Style. If you set it back to normal, on file save the indentation will be reset again to C Style.

Reproducible: Always

Steps to Reproduce:
I like normal indentation and I set it to be the default on kate(Settings-> Configure Kate ->Editor Component ->Editing ->Indentation ->Default Indentation Mode ->Normal).

I) On file open
1. Set indentation to normal.
2. Open a C(.c), C++(.cpp), JavaScript(.js), Ruby(.rb) file.
3. Check indention (menu Tools ->Indentation) to see that it changed to "C Style"(for C, C++, JS) or Ruby(for Ruby)

II) On file save
lets say you have a file opened for edit and you set indentation to Normal. 
1. If you save the file(Ctrl+s) the indentation _changes_ to the default for that file type("C Style" for C, C++, JavaScript and "Ruby" for Ruby).
2. If you again change indentation to Normal and save the file, again the indentation is changed.

Actual Results:  
The indentation is changed from Normal to the default indentation for the file type on file save and file open.

Expected Results:  
1) Kate MUST keep indention profile at least on file save! 
2) On file open Kate should ask the user if he wants the indentation to be changed from Normal to the default indentation(or we need to have an option iin the config dialog dealing with this)

OS: Linux (x86_64) release 2.6.35-23-generic
Compiler: cc
Comment 1 Dominik Haumann 2011-06-25 18:27:12 UTC
1. Open settings dialog and go to config page 'Open/Save'.
2. switch to Modes & Filetypes tab
3. Choose e.g. "Sources/C++"
4. Then "Indentation Mode" combo box shows which indenter will be selected.

The default indenter (more correctly: Fallback Indenter?) is used for all files where no indenter is available.

But you have a point, saving should not switch the indent mode anymore.
Comment 2 Becheru Petru-Ioan 2011-08-09 10:45:28 UTC
>But you have a point, saving should not switch the indent mode anymore.
 Then this bug should be marked as NEW.
Comment 3 Christoph Cullmann 2012-11-01 12:55:16 UTC
Git commit 81982bb631e043b4773ae8649382c72d871f1805 by Christoph Cullmann.
Committed on 01/11/2012 at 13:54.
Pushed by cullmann into branch 'master'.

fix that indentation mode is forgot on save if user did set it

M  +6    -4    part/document/katedocument.cpp
M  +11   -1    part/document/katedocument.h
M  +1    -0    part/utils/kateautoindent.cpp
M  +1    -0    part/utils/katecmds.cpp

http://commits.kde.org/kate/81982bb631e043b4773ae8649382c72d871f1805