All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.pkl.thirdparty.jline.reader.Highlighter Maven / Gradle / Ivy

Go to download

Fat Jar containing pkl-cli, pkl-codegen-java, pkl-codegen-kotlin, pkl-config-java, pkl-core, pkl-doc, and their shaded third-party dependencies.

There is a newer version: 0.27.1
Show newest version
/*
 * Copyright (c) 2002-2021, the original author(s).
 *
 * This software is distributable under the BSD license. See the terms of the
 * BSD license in the documentation provided with this software.
 *
 * https://opensource.org/licenses/BSD-3-Clause
 */
package org.pkl.thirdparty.jline.reader;

import java.util.regex.Pattern;

import org.pkl.thirdparty.jline.utils.AttributedString;

public interface Highlighter {

    /**
     * Highlight buffer
     * @param reader LineReader
     * @param buffer the buffer to be highlighted
     * @return highlighted buffer
     */
    AttributedString highlight(LineReader reader, String buffer);

    /**
     * Refresh highlight configuration
     */
    default void refresh(LineReader reader) {}

    /**
     * Set error pattern to be highlighted
     * @param errorPattern error pattern to be highlighted
     */
    void setErrorPattern(Pattern errorPattern);

    /**
     * Set error index to be highlighted
     * @param errorIndex error index to be highlighted
     */
    void setErrorIndex(int errorIndex);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy