Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#370 New File Ignores Custom Properties

Bug
open-postponed
Neil Hodgson
SciTE (619)
3
2005-11-11
2005-11-10
Anonymous
No

In my user properties file, I have done things like:

tab.size.$(file.patterns.html)=4
indent.size.$(file.patterns.html)=4
use.tabs.$(file.patterns.html)=1

If I create a new blank document, add some text, then
save it as an html file (.html), my custom peroperties
are not applied to that document. Hitting TAB yields an
8 character-wide tab stop instead of 4.

If I close that new file, and reopen it, my custom
properties are applied correctly, and I get a
4-character wide tab stop.

The same thing happens for other file groups... like perl:

tab.size.$(file.patterns.perl)=4
indent.size.$(file.patterns.perl)=4
use.tabs.$(file.patterns.perl)=0

Opening existing files, the tabs are 4 spaces. Creating
a new document, and saving it as a .pl file, yields the
default behaviour (8 character-wide tab stop) form the
perl.properties file.

If I add thse customizations above to the actual
html.properties or perl.properties files, the same
things happen. It appears that newly saved documents
don't pick up some or all of their properties for their
extension/file type.

Discussion

  • Neil Hodgson
    Neil Hodgson
    2005-11-11

    Logged In: YES
    user_id=12579

    The reason for this was probably that if the user had
    changed the tab settings using the Options | Change
    Indentation Settings then you don't want to revert when the
    user performs Save As or Save. SciTE doesn't try to see if a
    Save As resulted in a change to the extension which could be
    a trigger for a larger reevaluation of properties.
    I won't be working on this in the near future and will only
    accept a patch that provides a clear rationale for when
    these settings should be changed and the relationship of any
    automatic settings with the user's choice using the dialog.

     
  • Neil Hodgson
    Neil Hodgson
    2005-11-11

    • priority: 5 --> 3
    • assigned_to: nobody --> nyamatongwe
    • status: open --> open-postponed
     
  • Logged In: NO

    I guess I don't get it then. If I create a new document,
    then save that document as a .pl file, I expect it to pick
    up all of the settings that I have declared in
    perl.properties, and any settings I have in my users file
    that override perl.properties; just as would happn if I
    reopend the new .pl file at a later time.

    If I do a file -> new, that buffer is currently language
    agnostic until it get's same with a specific file extension.
    Once that save occurrs, I would think people expect it to
    act exactly the same as it does when reloaded again
    later/next day, etc.

    I understand the part about not wanting to override the
    users choices in the new file after a save/save as, but
    that's exactly what will happen the minute the file is
    reloaded in a new/another instance/another day.

     
  • Neil Hodgson
    Neil Hodgson
    2005-11-14

    Logged In: YES
    user_id=12579

    Once you have created a new document it gets assigned the
    full set of properties of the default language, including
    indentation settings. Now you may (or may not) manually set
    the indentation settings. SciTE doesn't remember. Then you
    save as .pl so SciTE finds most of your .pl settings and
    applies them but doesn't do so for indentation settings as
    you may have set them manually.
    When you do file -> new the file is assumed to have the
    extension given in default.file.ext.
    Setting indentation manually is an ephemeral choice and will
    be forgotten if you open the file again tomorrow. That
    doesn't mean it is OK to drop the user's recent explicit
    choice which I expect to last until the file is closed.