mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2025-08-01 15:59:06 +02:00
Add label field to VimOutputPanel
This commit is contained in:
parent
9cc69e41ee
commit
e515278ba3
src/main/java/com/maddyhome/idea/vim
vim-engine/src/main/kotlin/com/maddyhome/idea/vim/api
@ -85,6 +85,17 @@ class ExOutputModel(private val myEditor: WeakReference<Editor>) : VimOutputPane
|
||||
isActiveInTestMode = newValue.isNotEmpty()
|
||||
}
|
||||
}
|
||||
override var label: String
|
||||
get() {
|
||||
val notNullEditor = editor ?: return ""
|
||||
val panel = ExOutputPanel.getNullablePanel(notNullEditor) ?: return ""
|
||||
return panel.myLabel.text
|
||||
}
|
||||
set(value) {
|
||||
val notNullEditor = editor ?: return
|
||||
val panel = ExOutputPanel.getNullablePanel(notNullEditor) ?: return
|
||||
panel.myLabel.text = value
|
||||
}
|
||||
|
||||
fun output(text: String) {
|
||||
this.text = text
|
||||
|
@ -47,7 +47,7 @@ import static com.maddyhome.idea.vim.api.VimInjectorKt.injector;
|
||||
public class ExOutputPanel extends JPanel {
|
||||
private final @NotNull Editor myEditor;
|
||||
|
||||
private final @NotNull JLabel myLabel = new JLabel("more");
|
||||
public final @NotNull JLabel myLabel = new JLabel("more");
|
||||
private final @NotNull JTextArea myText = new JTextArea();
|
||||
private final @NotNull JScrollPane myScrollPane =
|
||||
new JBScrollPane(myText, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
|
||||
|
@ -17,6 +17,11 @@ interface VimOutputPanel {
|
||||
*/
|
||||
val text: String
|
||||
|
||||
/**
|
||||
* The text in the bottom of the output panel, e.g. `-- MORE --`
|
||||
*/
|
||||
var label: String
|
||||
|
||||
/**
|
||||
* Appends the specified text to the existing content of the output panel.
|
||||
* If 'isNewLine' is true, the text will begin on a new line.
|
||||
|
Loading…
Reference in New Issue
Block a user