How can I hide left margin?

At this time, I don't need the left margin, so it's currently loss of workspace to me.

So far, I couldn't find an option yet to hide it.

Can the left margin be hidden in Micro Focus option settings?

  • Verified Answer

    Currently, the left margin cannot be hidden if you are using SOURCEFORMAT(FIXED) or SOURCEFORMAT(VARIABLE) directives. The default for .NET code is VARIABLE and the default for native code is FIXED. Using these formats the COBOL Area A begins in column 8 and the comment indicator is in column 7. The margins containing characters 1 thru 7 will always be displayed. 

    If you change the source format you are using to SOURCEFORMAT"FREE" then the concept of Area A and B goes away and you can begin coding in Column 1 and then the margin will not be displayed. You can change the source format directly in the Project Properties page under the COBOL tab.

     

  • Ah, I see ... It looks the effect is the same as unchecking the "Show margins" option at Tools > Options > Text Editor > Micro Focus COBOL > Margins.

    That's not truely what I'm looking for, I'm afraid, as it still displays the left margin, yet with a white background instead of the lightgray background, so it's still taking up screen ressource and cursor movement action.

    I was looking for an option that's rather collapsing the left margin (see animated GIF image attached).

    I understand that this is uncommon for COBOL, I know. Particularly as it would hide the comment column. (Yet, the greenish comment code color would still unveil the comments.) I'm just asking if such option does exist.

    You know, I don't require the left margin at this time, so I was looking for such option because for me, at this time, the left margin is merely a nuisance due to the cursor movements I need to perform using the arrow keys in almost each line to exit the margin. This is particularly true with (yet) empty code lines.

  • You could try scrolling the horizontal scrollbar on the editor past the margin. For the most part it seems to stick and not go back to the beginning while editing code.

  • Nice Idea

    If your workspace is larger than a few dozen columns, though, there will never be a horizontal scrollbar.

    I tried your suggestion just for fun and noticed that the behavior you suggested is only temporary (as I would have expected). As soon as the cursor enters the left margin (e.g. hit <END>, <ARROW RIGHT>), the editor viewport scrolls along.

  • I think I put a wrong emphasis to my quesion. I't less about hiding it visually than rather locking it for cursor movement, just like the Visual Studio left margin, which is generally used to show break points or line numbers.

    The following animation depicts the currently redundant keyboard action that's required for escaping the cursor from the left margin.

    The left pane depicts the current situation whereas the right pane depicts the desired situation. I emphasized redundant keyboard hits in red (on the left).

    Micro Focus COBOL - Lock left margin_.gif

     

  • Today I noticed that all I was missing was to execute "Edit > Advanced > Format Document" after switching to the "FREE" source format you suggested.

    After executing Format Document, the leading margin characters were automatically removed and (eventually) I recognized they are redundant in FREE source format mode (in contrast to the other modes).

    Lesson learned.

    Thanks a lot, Chris, for your very valuable suggestion!