2022-12-15 04:00:54 +00:00
|
|
|
---
|
2023-08-26 15:30:51 +00:00
|
|
|
title: Module hilbish.editor
|
2022-12-15 04:00:54 +00:00
|
|
|
description: interactions for Hilbish's line reader
|
|
|
|
layout: doc
|
|
|
|
menu:
|
|
|
|
docs:
|
|
|
|
parent: "API"
|
|
|
|
---
|
|
|
|
|
|
|
|
## Introduction
|
|
|
|
The hilbish.editor interface provides functions to
|
|
|
|
directly interact with the line editor in use.
|
|
|
|
|
|
|
|
## Functions
|
2023-09-02 18:18:40 +00:00
|
|
|
|||
|
|
|
|
|----|----|
|
|
|
|
|<a href="#editor.getLine">getLine() -> string</a>|Returns the current input line.|
|
|
|
|
|<a href="#editor.getVimRegister">getVimRegister(register) -> string</a>|Returns the text that is at the register.|
|
2023-12-04 00:54:00 +00:00
|
|
|
|<a href="#editor.insert">insert(text)</a>|Inserts text into the Hilbish command line.|
|
|
|
|
|<a href="#editor.getChar">getChar() -> string</a>|Reads a keystroke from the user. This is in a format of something like Ctrl-L.|
|
2023-09-02 18:18:40 +00:00
|
|
|
|<a href="#editor.setVimRegister">setVimRegister(register, text)</a>|Sets the vim register at `register` to hold the passed text.|
|
|
|
|
|
|
|
|
<hr><div id='editor.getLine'>
|
|
|
|
<h4 class='heading'>
|
|
|
|
hilbish.editor.getLine() -> string
|
|
|
|
<a href="#editor.getLine" class='heading-link'>
|
|
|
|
<i class="fas fa-paperclip"></i>
|
|
|
|
</a>
|
|
|
|
</h4>
|
|
|
|
|
2023-12-02 12:23:49 +00:00
|
|
|
Returns the current input line.
|
2023-08-26 15:30:51 +00:00
|
|
|
#### Parameters
|
|
|
|
This function has no parameters.
|
2023-09-02 20:01:57 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<hr><div id='editor.getVimRegister'>
|
2023-09-02 18:18:40 +00:00
|
|
|
<h4 class='heading'>
|
|
|
|
hilbish.editor.getVimRegister(register) -> string
|
|
|
|
<a href="#editor.getVimRegister" class='heading-link'>
|
|
|
|
<i class="fas fa-paperclip"></i>
|
|
|
|
</a>
|
|
|
|
</h4>
|
2022-12-15 04:00:54 +00:00
|
|
|
|
2023-12-02 12:23:49 +00:00
|
|
|
Returns the text that is at the register.
|
2023-08-26 15:30:51 +00:00
|
|
|
#### Parameters
|
2023-12-04 00:54:00 +00:00
|
|
|
`string` **`register`**
|
|
|
|
|
|
|
|
|
2023-09-02 20:01:57 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<hr><div id='editor.insert'>
|
2023-09-02 18:18:40 +00:00
|
|
|
<h4 class='heading'>
|
|
|
|
hilbish.editor.insert(text)
|
|
|
|
<a href="#editor.insert" class='heading-link'>
|
|
|
|
<i class="fas fa-paperclip"></i>
|
|
|
|
</a>
|
|
|
|
</h4>
|
2022-12-15 04:00:54 +00:00
|
|
|
|
2023-12-04 00:54:00 +00:00
|
|
|
Inserts text into the Hilbish command line.
|
2023-08-26 15:30:51 +00:00
|
|
|
#### Parameters
|
2023-12-04 00:54:00 +00:00
|
|
|
`string` **`text`**
|
|
|
|
|
|
|
|
|
2023-09-02 20:01:57 +00:00
|
|
|
</div>
|
|
|
|
|
2023-11-12 01:57:15 +00:00
|
|
|
<hr><div id='editor.getChar'>
|
|
|
|
<h4 class='heading'>
|
|
|
|
hilbish.editor.getChar() -> string
|
|
|
|
<a href="#editor.getChar" class='heading-link'>
|
|
|
|
<i class="fas fa-paperclip"></i>
|
|
|
|
</a>
|
|
|
|
</h4>
|
2022-12-15 04:00:54 +00:00
|
|
|
|
2023-12-04 00:54:00 +00:00
|
|
|
Reads a keystroke from the user. This is in a format of something like Ctrl-L.
|
2023-11-12 01:57:15 +00:00
|
|
|
#### Parameters
|
|
|
|
This function has no parameters.
|
|
|
|
</div>
|
|
|
|
|
2023-09-02 20:01:57 +00:00
|
|
|
<hr><div id='editor.setVimRegister'>
|
2023-09-02 18:18:40 +00:00
|
|
|
<h4 class='heading'>
|
|
|
|
hilbish.editor.setVimRegister(register, text)
|
|
|
|
<a href="#editor.setVimRegister" class='heading-link'>
|
|
|
|
<i class="fas fa-paperclip"></i>
|
|
|
|
</a>
|
|
|
|
</h4>
|
2022-12-15 04:00:54 +00:00
|
|
|
|
2023-12-02 12:23:49 +00:00
|
|
|
Sets the vim register at `register` to hold the passed text.
|
2023-08-26 15:30:51 +00:00
|
|
|
#### Parameters
|
2023-12-04 00:54:00 +00:00
|
|
|
`string` **`text`**
|
|
|
|
|
|
|
|
|
2023-09-02 20:01:57 +00:00
|
|
|
</div>
|
|
|
|
|