Browse Source

Fixed open duplicating lines.

cameron
Cameron Weinfurt 4 years ago
parent
commit
a532b698bb
  1. 17
      src/Buffer.cpp

17
src/Buffer.cpp

@ -154,22 +154,25 @@ bool Buffer::open(const string & new_file_name)
line = extra_text;
}
curr_line += line;
// TODO: What is this section
if (curr_line.length() > maximum_length_) {
vector<string> v_split_line = split_line(curr_line);
for (auto e: v_split_line) {
cout << e << endl;
v_lines_.push_back(e);
}
}
else {
// Push the contents of curr_p as it has the last line in the file.
v_lines_.push_back(curr_line);
curr_line = "";
}
file_name_ = new_file_name;
ix_top_line_ = 0;
}
return true;
// Push the contents of curr_p as it has the last line in the file.
v_lines_.push_back(curr_line);
ix_top_line_ = 0;
file_name_ = new_file_name;
return true;
}
bool Buffer::go(int link)

Loading…
Cancel
Save