Move current line into history when pressing down in input bar
This commit is contained in:
parent
ff63a9d8bd
commit
edb34144c7
1 changed files with 8 additions and 1 deletions
|
@ -167,7 +167,14 @@ models.service('models', ['$rootScope', '$filter', function($rootScope, $filter)
|
||||||
};
|
};
|
||||||
|
|
||||||
var getHistoryDown = function(currentLine) {
|
var getHistoryDown = function(currentLine) {
|
||||||
if (historyPos < 0 || historyPos >= history.length) {
|
if (historyPos === history.length) {
|
||||||
|
// stash on history like weechat does
|
||||||
|
if (currentLine !== undefined && currentLine !== '') {
|
||||||
|
history.push(currentLine);
|
||||||
|
historyPos++;
|
||||||
|
}
|
||||||
|
return '';
|
||||||
|
} else if (historyPos < 0 || historyPos > history.length) {
|
||||||
// Can't go down from out of bounds or last message
|
// Can't go down from out of bounds or last message
|
||||||
return currentLine;
|
return currentLine;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue