mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-20 17:55:53 +02:00
Implement 'maxScrollbackLines' config for MRC module
This commit is contained in:
parent
3396944820
commit
ad305b4ccc
2 changed files with 9 additions and 0 deletions
|
@ -72,6 +72,8 @@ exports.getModule = class mrcModule extends MenuModule {
|
|||
this.log = Log.child( { module : 'MRC' } );
|
||||
this.config = Object.assign({}, _.get(options, 'menuConfig.config'), { extraArgs : options.extraArgs });
|
||||
|
||||
this.config.maxScrollbackLines = this.config.maxScrollbackLines || 500;
|
||||
|
||||
this.state = {
|
||||
socket: '',
|
||||
alias: this.client.user.username,
|
||||
|
@ -208,6 +210,10 @@ exports.getModule = class mrcModule extends MenuModule {
|
|||
|
||||
const padding = ' |00' + ' '.repeat(padAmount);
|
||||
chatLogView.addText(pipeToAnsi(msg + padding));
|
||||
|
||||
if(chatLogView.getLineCount() > this.config.maxScrollbackLines) {
|
||||
chatLogView.deleteLine(0);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -1104,6 +1104,9 @@
|
|||
art: MRC
|
||||
config: {
|
||||
cls: true
|
||||
|
||||
// max lines kept in scrollback buffer
|
||||
maxScrollbackLines: 500
|
||||
}
|
||||
form: {
|
||||
0: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue