Komodo / KomodoEdit

Komodo Edit is a fast and free multi-language code editor. Written in JS, Python, C++ and based on the Mozilla platform.
http://www.komodoide.com/komodo-edit
Other
2.16k stars 303 forks source link

Cannot force indentation to TABS #2211

Closed bbak closed 7 years ago

bbak commented 7 years ago

Short Summary

In Prefs->Editor->Indentation I've set use Tabs as well as disallowed file contents to override this. And I've done that on Global as well as Project Level as well as on per FileType (PHP in my case). I've also renamed 'doc-state.xmlc' while Komodo was closed.

Still, when opening a existing PHP file from the project, Indentation defaults to SPACES. In File Prefs the use Tabs setting is disabled. If I change it on file-level, everything is ok - until I close and reopen the file again.

In prefs.xml there's a <boolean id="useTabs">1</boolean> setting, which is not found in the .komodoproject file (even though the checkbox is on if I open Project Prefs).

Manually adding <boolean id="useTabs">1</boolean> (right after <boolean id="useSmartTabs">0</boolean> to the .komodoproject file doesn't change anything.

Expected results

Use TABS

Actual results

Uses SPACES

Platform Information

Win 10, Komodo IDE 10.1.3

mitchell-as commented 7 years ago

Hi, thanks for doing your homework :) What happens when you open that same PHP file outside of your project? Does it open with tabs or spaces?

Naatan commented 7 years ago

To elaborate on @mitchell-as's question - please close your project via Project > Close All Projects, then try opening your files again.

bbak commented 7 years ago

Ha, touché. I really thought I had all use cases covered.

Same behavior. File Pref "use Tabs" is unchecked and the editor is indenting with SPACES.

No difference if I close and repopen Komodo after closing the Project or just close the Project.

mitchell-as commented 7 years ago

Okay, and how about a random PHP file that Komodo has never seen before? (Both without an open project and with an open project.)

bbak commented 7 years ago

With Project open: same result. Without Project open: same result.

Naatan commented 7 years ago

Ok, so it's very likely to be something in your global prefs.

Could you share your prefs.xml? It is located in your profile folder. Please send it to support@activestate.com and reference this bug report.

bbak commented 7 years ago

Done

Naatan commented 7 years ago

Unfortunately we were not able to reproduce the issue with your prefs.xml.

Can you reproduce this using Help > Troubleshooting > Restart in Safe-mode ?

Please verify that when restarting in safe-mode Komodo should be using the default UI (all your settings would be temporarily reset).

mitchell-as commented 7 years ago

Forgive the silly question, but the PHP files you are opening, do they already use spaces as indentation, but you are expecting Komodo to convert them to tabs? Or when you open a PHP file and press the "Tab" key, you get some number of spaces auto-inserted? I tried importing your prefs.xml file, opened an existing PHP file whose sole contents are

<?php

When I press "Tab", I get a tab inserted, not spaces. When I opened another existing PHP file whose sole contents are

<?php
<TAB>echo 'hi';

I see a tab character and pressing "Tab" yields a tab (not spaces).

bbak commented 7 years ago

OMG ! It was a good idea to ask silly questions! A 3rd Party Package, installed via composer, that we're using as a starting point in quite every project, came with it's own (hidden, of course) .editorconfig file, forcing SPACES! Looks like this is the root cause.

So, basically my own fault - I forgot that Komodo uses them by default. Sorry for wasting your time.

Nevertheless, some indicator (perhaps in the file prefs) that a .editorconfig File is overriding something could prevent confusion. :-)

Naatan commented 7 years ago

Nevertheless, some indicator (perhaps in the file prefs) that a .editorconfig File is overriding something could prevent confusion. :-)

Good point, I'll have a think on this :)

Defman21 commented 7 years ago

@Naatan there is an opened issue for that :)

th3coop commented 7 years ago

@Defman21 I thought that sounded familiar: https://github.com/Komodo/KomodoEdit/issues/2011