# Module editor

The API that is available for Nimscript.

# Imports

common

# Types

    UiElement = enum
      Main, Prompt, Console

# Procs

    proc setCaret(x: Natural) {.raises: [], tags: [].}

    proc getCaret(): Natural {.raises: [], tags: [].}

    proc openTab(name: string): bool {.raises: [], tags: [].}

    proc closeTab() {.raises: [], tags: [].}

    proc gotoPos(line: Natural; col = - 1) {.raises: [], tags: [].}

    proc clear() {.raises: [], tags: [].}

    proc setFocus(element: UiElement) {.raises: [], tags: [].}

    proc setPrompt(text: string) {.raises: [], tags: [].}

    proc getPrompt(): string {.raises: [], tags: [].}

    proc setSelection(a: Natural; b: int) {.raises: [], tags: [].}

    proc getSelection(): (int, int) {.raises: [], tags: [].}

    proc currentLineNumber(): Natural {.raises: [], tags: [].}

    proc currentFilename(): string {.raises: [], tags: [].}

    proc remove(a, b: Natural) {.raises: [], tags: [].}

    proc insert(text: string) {.raises: [], tags: [].}

    proc setLang(lang: SourceLanguage) {.raises: [], tags: [].}

    proc getLang(): SourceLanguage {.raises: [], tags: [].}

    proc charAt(i: int): char {.raises: [], tags: [].}

    proc tokenAt(i: int): TokenClass {.raises: [], tags: [].}

    proc getHistory(i: int): string {.raises: [], tags: [].}

    proc historyLen(): int {.raises: [], tags: [].}

    proc runConsoleCmd(cmd: string) {.raises: [], tags: [].}

    proc getSearchPath(i: int): string {.raises: [], tags: [].}

    proc addSearchPath(path: string) {.raises: [], tags: [].}

    proc setStatus(msg: string) {.raises: [], tags: [].}

    proc save() {.raises: [], tags: [].}

    proc saveAs(filename: string) {.raises: [], tags: [].}

    proc defineAlias(key, value: string) {.raises: [], tags: [].}

    proc getCurrentIdent(del = false): string {.raises: [], tags: [].}

  Retrives the current identifier, the one left to the caret. If del is true, the identifier is removed.