#7 Ability to switch off some editor features

Dawid Toton

Currently the editor doubles my " marks. Sometimes it's cumbersome and I need to switch it off. E.g. having pasted this:

options = -a -b -c

and correcting to:

let options = "-a -b -c";;

I got
let options = ""-a -b -c"";;
It is sometimes very disturbing.

Also I'd like to disable automatic code formatting (it's only my personal idiosyncrasy).

(BTW: I'd also love to enable so called virtual space, i.e. to be able to place cursor beyond EOL - but I have no idea how to do it in Eclipse.)


  • Emmanuel Dieul

    Emmanuel Dieul - 2007-10-24

    Logged In: YES
    Originator: NO

    OK. I've just added a support to disable some automatic completion (like completion for double quotes, square brackets...).

    However, I'd like to understand what you call "automatic code formatting". Is it only automatic indentation ? What's the problem behind this need ?

    PS: I don't know either for EOL and what can you do with this...

  • Dawid Toton

    Dawid Toton - 2007-10-24

    Logged In: YES
    Originator: YES

    Thanks for your efforts!

    You're right, I mean "automatic indentation" (it is invoked when pressing spacebar - that's why there's an impression of "code formatting").

    I have many problems with the auto-indentation. Here's just any example - today I came across the following problems:

    Want to write:
    let a=1
    let b=1
    let c=1
    let aaa a b c d e f g h = function
    | 1 -> 2
    | 3 -> 4
    let r = match 1 with
    | 5 -> 6

    But due to automatic indentation I get instead:

    let a=1
    let b=1
    _let c=1
    let aaa a b c d e f g h = function
    | 1 -> 2
    ______| 3 -> 4
    _____let r = match 1 with
    ______| 5 -> 6

    (spaces replaced with _ )

    As for EOL things (I meant "end of line"):
    Some editors allow to place the caret beyond the last character in line. Some do it by default (e.g. editors in Borland's IDEs - they go even further having an option called "cursor beyond EOF" i.e. end of file). Some let to enable it - e.g. "enable virtual space" setting (in MS VC++ AFAIR).

    I feel very uncomfortable and constrained if I can't go anywhere and start typing in arbitrary place. I haven't discovered such a capability in Eclipse, so I always have to produce whitespace in some awkward way: press spacebar and wait. I'd say it's embarassing.

    That's why I'm asking you to investigate the problem: is it necessary to avoid having the cursor in any place in your plugin?

    Last-minute news: the following function has problems with auto-indentation:
    let strip2 (strip enums&structs) =
    List.filter (fun x->
    (not (HString.has_prefix "enum" x)) && (String.contains x '(')

    The last bracket is shifted too far to the right (aligned with the last opening bracket). It should be aligned with the corresponding opening parenthesis (it's in the second line).
    This suggests that your implementation might be syntax-blind - for some reason may have treated '(' as an opening bracket.

    By the way, note that in order to recreate the incorrect form I've just pasted above in ODT's editor I really need to enable virtual space: be able to click in proper place and write the closing bracket. It's even very hard to write this line using spacebar to produce the indentation manually: if I press spacebar key and hold it for a moment, the ODT's lexer does syntax highlighting for so long time (the excerpt is taken from big sourcefile), that Eclipse decides to clear the queue of incoming "press key" events. So I end up having only few spaces in the line. No way.

  • Emmanuel Dieul

    Emmanuel Dieul - 2007-10-26

    Logged In: YES
    Originator: NO

    For your indentation problems (first part of your comment), the only and recommended option is to use ";;" to close unbalanced expressions like "let", "type"... Using ";;" clearly simplifies the indentation processor.

    Concerning the bracket, I'm going to investigate: the bracket matcher works fine but the indentation processor is wrong...

    For the "virtual space", I think I understand what you meant: when you click on an empty line (line with length 0), the line is filled with spaces to position the caret at the end of this line, just where you've clicked. Is it what you meant ? I don't think the Eclipse editor can do it...
    And, for your information, ODT doesn't constraint or make any assumptions about the caret position (except it's in the document range).

  • Emmanuel Dieul

    Emmanuel Dieul - 2011-09-25

    Included into the 2.0 release.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks