Skip to content

Java Keyword Demo #400

@WinXaito

Description

@WinXaito

Hello,

I would like to be able to refresh the "hightlight" when opening the file, but with this code, the "highlight" is only done after editing the file.

codeArea.richChanges()
                .filter(ch -> !ch.getInserted().equals(ch.getRemoved()))
                .successionEnds(Duration.ofMillis(100))
                .supplyTask(this::computeHighlightingAsync)
                .awaitLatest(codeArea.richChanges())
                .filterMap(t -> {
                    if(t.isSuccess()) {
                        return Optional.of(t.get());
                    } else {
                        t.getFailure().printStackTrace();
                        return Optional.empty();
                    }
                })
                .subscribe(this::applyHighlighting);

This is the code found in the java keyword demo in Async

How can I do this?

Thank you !

[This text has been translated from a translation site, original language: French]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions