products/sources/formale sprachen/Isabelle/Tools/jEdit/dist/macros/Emacs image not shown  

Quellcode-Bibliothek

© Kompilation durch diese Firma

[Weder Korrektheit noch Funktionsfähigkeit der Software werden zugesichert.]

Datei:   Sprache: Unknown

rahmenlose Ansicht.bsh DruckansichtCS {CS[81] Ada[125] Abap[151]}Entwicklung

/**
 * Convert the portion of the current word to title case, starting at the
 * caret and moving to the end of the word. Emulates the Emacs "capitalize-word"
 * function.
 */


source (MiscUtilities.constructPath(dirname(scriptPath), "EmacsUtil.bsh"));

void emacsCapitalizeWord()
{
    caret = eatNonAlphanums();

    // Adjust to beginning of the word (skipping any non-word chars)

    textArea.goToNextWord (false);
    endOfWord = textArea.getCaretPosition();

    textArea.setCaretPosition (caret);
    selection = new Selection.Range (caret, endOfWord);

    word = textArea.getText (caret, endOfWord - caret);
    if (word.length() > 0)
    {
        ch = word.toCharArray();
        ch[0] = Character.toUpperCase (ch[0]);
        
        for (i = 1; i < ch.length; i++)
            ch[i] = Character.toLowerCase (ch[i]);
        
        textArea.setSelection (selection);
        textArea.setSelectedText (new String (ch));
        textArea.removeFromSelection (selection);
    }
}

emacsCapitalizeWord();


[ Verzeichnis aufwärts0.134unsichere Verbindung  ]