Komodo Edit 9.1.0 Indentation Problem

I’m using CakePHP, so have files that end with “.ctp” and I have those configured to syntax highlight and behave like PHP files. However, the indentation of these files does not work. I have it configured in Preferences to use 4 spaces (no tabs), and when I indent on these files it uses 8 spaces. There is no way I can find to fix this. I’m using Komodo Edit 9.1.0. Thanks.

You may want to review this FAQ about our indentation preferences settings. Our preferences system is very robust over all which can make it confusing at first but it provides a high-level of customizability (not a word).

The FAQ should sort you out. Please let us know if you continue to have issues.

  • Carey

I have been using Komodo Edit for years now and am quite familiar with the preferences. With the new release of 9, this bug just surfaced. Please look into it before blanket answer of “See Preferences”. Thanks.

Apologies, but me blindly trying to reproduce a reported indentation issue without first confirming basic information would be a waste of both of our time. Also, even veterans make mistakes so please have patience.

Are you using a project for these files? Can you confirm that the indent settings for the Project and Files are not set to 8?

Also the Languages specific indentations may be set to 8 as well.

  • Carey

Yes, it is in a project. I have confirmed that PHP files within the same project are indenting just fine. It appears to only be the files ending with “.ctp” which are CakePHP specific view files. Somewhere there could be a project setting for 8 spaces - all the settings I’ve seen are set to 4 spaces. As far as I can tell the preferences for my Komodo Edit 9 are identical to those in my Komodo Edit 8, and the same ctp files behave correctly in 8 but not in 9.

Perhaps your Preferences > File Associations might be messed up for “*.ctp” files. By default ctp is associated with PHP and it’s working fine for me in ctp files.

Just noting one of your first comments above. What do you mean there? Are you setting ALL ctp files that you open to 4 spaces in the file level preferences?

  • Carey

Yes, in preferences every file should set to 4 spaces (no tabs). It appears this only occurs on ctp files that were previously saved with tabs (not spaces).

I think you missunderstood what Carey was asking.

Please check what language “.ctp” files are associated with for you under Preferences > File Associations, then go to Preferences > Editor > Indentation and check the indentation settings for that language.

Finally, if that doesn’t work, could you create an all-new .ctp file and see if its indentation is being properly set?

Thanks

I’ve verified “.ctp” is in the file associattions as PHP. I’ve verified the file indentation is set to use 4 spaces, not tabs, and I’ve created a new .ctp file and the indentation is working properly. However, it is still not working on existing .ctp files where the indentation was set previously to use tabs or 2 spaces (not 4 spaces).

Thanks for confirming. That is to be expected. Global preferences do not override file level preferences so any preferences that got set in previously opened files will remain.

We haven’t implemented removing a single files preferences set but you can do a hard reset by deleting doc-state.xmlc from you Komodo profile: Q: Resetting preferences RE showing whitespace and line-ending characters?

That should fix this.

  • Carey

Note Komodo should not be running when you delete the doc-state.xmlc file.

This is not the same behavior when using Komodo Edit 8. Previously it handles this situation just fine, but since using 9, this problem has surfaced. I never had to delete an xmlc file when using 8.

It is exactly the same behaviour as Komodo 8, its not because you didnt run into it that it didnt exist before.

We are looking into ways of making this functionality more obvious and less erroneous.

So why does this exact same file work properly in 8 but not in 9? The same file opened in 8 will show the correct indentation, but does not in 9, and won’t even let me correct it in any way. Whatever settings I change in 9, I cannot change the indentation to 4 spaces.

Because you were using Komodo 9 when the problem started happening. Komodo 8 and Komodo 9 do not share settings, Komodo 9 only inherits them from Komodo 8 when it is first launched.

You are confusing correlation with causation.

I’ve spent a lot of time (too much) trying to make sure the settings for both 8 and 9 are identical. I still do not understand why it still works fine in 8 but not in 9. I’ve used Komodo Edit for years and I’ve never had any problems until I started using 9.

You can move this ticket to resolved as well. I think it is related to my other issue. Thanks.

Well done. To clarify how he resolved that - he had to remove his preferences at all. So hard reset.

I also experienced this issue when I had the PHP files that suppose to use SPACES but would use TABS for indentation. Komodo ver. 9.1.3. I transferred settings from Komodo 8.

What helped me is opening the file and going into Edit->Current File Preferences->Editor->Indentation.
Mark Prefer Tab characters over space as ENABLED (was DISABLED originally). Click OK. If you test it, it would be TABBING obviously.
Then again go to Edit->Current File Preferences->Editor->Indentation and uncheck Prefer Tab characters over space. Click OK. Now if you test it you should see SPACES instead of TABS.

The same can be achieved in General Preferences. But for some reason it would not fix the TABBING for all docs in the current project. It would have to be done for each file you open. And then it would save the settings when next time you open it.

I work with files as Projects. I remember Komodo 8 had a preference for Indentation on a project level, but Komodo 9 does not and it seems to be causing some kind of overwriting.

Maybe as Defman suggested removing preferences does help to resolve it on a project level too, but it is a drag to reset since I have made many adjustments for colors and fonts.

I like Komodo 9, but it freezes for me a lot (I am on Yosemite 10.10.5). For example when dealing with saving these TABBING settings and pressing OK, I would have to RELOAD Komodo since the sidebar with the list of my Project files (loaded using SFTP) would stop responding, nothing happens when I click/doubleclick on files. But I am guessing this is a separate issue.

Hope this helps some who do not wish to do the full reset.

This is a bug. I’m looking into this now to file a report. Those prefs should still be in Project Properties.

Did you uncheck “Allow file contenst to override Tab and Indentation settings” under Global > Editor > Indentation?

Great post, @nookeen. Thanks a lot for sharing your findings. This will be super helpful for someone and alerts us to some potential problems.

  • Carey