ianharrigan / haxeui-rich-text

Rich text components for haxeui
4 stars 1 forks source link

Shirt+Tab : remove indentation of the line #3

Open MangelMaxime opened 10 years ago

MangelMaxime commented 10 years ago

The added code allow the user to remove the indentation when he place his cursor at the beginning of a line and press Shit+Tab.

It's try to remove 4 spaces at max.

ianharrigan commented 10 years ago

Does this work on other platforms? (neko/cpp)?

MangelMaxime commented 10 years ago

You have right, I forgot to add the #if flash etc. condition.

It's not working for neko/cpp at the moment because I need to write one of the flash function by myself. Sorry about that...

MangelMaxime commented 10 years ago

In fact, like you said in this issue https://github.com/openfl/openfl/issues/205, there are essentials part missing for the neko/cpp target.

So best thing, we can to is to surround my code with a condition #if flash..

Just for information, your tab isn't work on neko/cpp too.

ianharrigan commented 10 years ago

Is there any chance you open a new issue for the tabs on cpp/neko in the main haxeui repo? Ive been using tabs with no problems on those targets. (Maybe with a screen shot or something like that?)

Cheers, Ian

MangelMaxime commented 10 years ago

For the tab, this is because neko/cpp targets don't implements the selection for what I saw on OpenFL.

You use :

replaceSelectedText("    ");

But, this function is implemented only for the flash target. This is what I mean by the tab replacement doesn't work on neko/cpp.

    public function replaceSelectedText(s:String):Void {
        var tf:TextField = cast(_textDisplay.display, TextField);
        #if flash
            tf.replaceSelectedText(s);
        #end
    }

I will open an issue if you want but at the moment this is more an OpenFL issue like you have opened here