Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #8890
    owilsky
    Participant

    Hi,

    I have a bug in 10.0.1.
    Steps to reproduce:

    1. customize toolbar to include “Marks”
    2. customize marks properties for current configuration:
    – check Show Returns
    – check Show End of File
    – check Show Tabs
    – check Show Spaces
    – (so check first four checkboxes, leave rest unchecked)
    3. Click on marks button on toolbar to enable marks. You see the desired marks. All is fine.
    4. Click on marks button on toolbar to disable marks. You still see small dots for spaces. I think these should also disappear.

    #8891
    Yutaka Emura
    Keymaster

    Hi owilsky,

    The Marks command toggles only new line, EOF and tab marks, and does not include spaces. This is the specification. On v10, you can use independent commands on the View menu to toggle each mark.

    #8892
    owilsky
    Participant

    Oh.. I see. What a pity… would be nice to have a one click solution to show or hide all desired marks.

    #8893
    zhouzh2
    Participant

    Hi owilsky,
    you can use a macro to toggle marks. There is a simple marco somewhere in the forum, I couldn’t find it though, I just post it here again.

    #title = "Marks"
    #tooltip = "Toggle Marks ON/OFF"

    // Displays or Hides Marks.

    myobject = document.Config;

    if (myobject.Mark.ShowReturns==0 && myobject.Mark.ShowEOF==0 && myobject.Mark.ShowTabs==0 && myobject.Mark.ShowSpaces==0 && myobject.Mark.ShowDBSpaces==0 && myobject.Mark.CrLfDifferent==0 && myobject.Mark.ShowIndentGuides==0 && myobject.Mark.ShowControlCharacters==0) {
    myobject.Mark.ShowReturns="true"; // Returns
    myobject.Mark.ShowEOF="true"; // End of File
    myobject.Mark.ShowTabs="true"; // Tabs
    myobject.Mark.ShowSpaces="true"; // Spaces
    myobject.Mark.ShowDBSpaces="true"; // Wide Spaces
    myobject.Mark.CrLfDifferent="true"; // CR and LF with Different Marks
    myobject.Mark.ShowIndentGuides="true"; // Indent Guides
    myobject.Mark.ShowControlCharacters="true"; // Control Characters
    }
    else {
    myobject.Mark.ShowReturns="false"; // Returns
    myobject.Mark.ShowEOF="false"; // End of File
    myobject.Mark.ShowTabs="false"; // Tabs
    myobject.Mark.ShowSpaces="false"; // Spaces
    myobject.Mark.ShowDBSpaces="false"; // Wide Spaces
    myobject.Mark.CrLfDifferent="false"; // CR and LF with Different Marks
    myobject.Mark.ShowIndentGuides="false"; // Indent Guides
    myobject.Mark.ShowControlCharacters="false"; // Control Characters
    }

    myobject.Save();

    You can comment the marks you don’t want to make the macro suitable to your needs.

    #8900
    owilsky
    Participant

    Hi tried this which should do what I want.

    #title = "Marks" 
    #tooltip = "Toggle Marks ON/OFF"

    editor.ExecuteCommandByID(4370); //EEID_VIEW_MARKS (4370)
    if(document.Config.Mark.ShowReturns) document.Config.Mark.ShowSpaces = true;
    else document.Config.Mark.ShowSpaces = false;

    document.Config.Save();

    Unfortunately document.Config.Mark.ShowSpaces = true does not do anything for me. What do I do wrong?

    Oliver

    #8901
    Yutaka Emura
    Keymaster

    Hello owilsky,

    You will need to load the Config object into the memory before you can modify and save it. Please rewrite like this:

    #title = "Marks" 
    #tooltip = "Toggle Marks ON/OFF"

    editor.ExecuteCommandByID(4370); //EEID_VIEW_MARKS (4370)
    cfg = document.Config;
    if(cfg.Mark.ShowReturns) cfg.Mark.ShowSpaces = true;
    else cfg.Mark.ShowSpaces = false;

    cfg.Save();

    #8906
    owilsky
    Participant

    OK, works now. Thanks.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.