Skip to content

Commit 2848962

Browse files
author
aitzkora
committed
fix the history's bug
1 parent 871bb65 commit 2848962

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/textline/history.d

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ class History
3737
void loadHistoryFile()
3838
{
3939
auto fname = environment.get("HOME") ~ "/.komando_hist";
40-
historyLength = 1;
4140
history[0] = content;
41+
historyLength = 1;
4242
if (!fname.exists)
4343
{
4444
historyFile = File( fname, "w");
@@ -52,7 +52,7 @@ class History
5252
foreach(line ; historyFile.byLine)
5353
{
5454
if (historyLength > maxHistoryLength-1) break;
55-
history[historyLength++] = line[];
55+
history[historyLength++] = line[].dup;
5656
if (isDebugOn) debugFile.writeln(history[historyLength-1]);
5757
}
5858
}

0 commit comments

Comments
 (0)