diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2014-05-17 12:17:05 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2014-05-17 12:17:05 +0100 |
| commit | 03e5264df44794c942a5b1d45be3acd546819d5a (patch) | |
| tree | bfeb529e2669ad2d6d8bea7c8e50326b0e29dc7f /src/buffer.cc | |
| parent | 079d34b82a3690f28de3d33102eda4bb214ad13f (diff) | |
Remove per lines timestamp in Buffer
Diffstat (limited to 'src/buffer.cc')
| -rw-r--r-- | src/buffer.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/buffer.cc b/src/buffer.cc index 56a4350d..94ca9ce6 100644 --- a/src/buffer.cc +++ b/src/buffer.cc @@ -35,7 +35,7 @@ Buffer::Buffer(String name, Flags flags, std::vector<String> lines, for (auto& line : lines) { kak_assert(not line.empty() and line.back() == '\n'); - m_lines.emplace_back(Line{ m_changes.size()+1, pos, std::move(line) }); + m_lines.emplace_back(Line{ pos, std::move(line) }); pos += m_lines.back().length(); } @@ -88,7 +88,7 @@ void Buffer::reload(std::vector<String> lines, time_t fs_timestamp) for (auto& line : lines) { kak_assert(not line.empty() and line.back() == '\n'); - m_lines.emplace_back(Line{ m_changes.size()+1, pos, std::move(line) }); + m_lines.emplace_back(Line{ pos, std::move(line) }); pos += m_lines.back().length(); } m_fs_timestamp = fs_timestamp; @@ -460,12 +460,12 @@ ByteCoord Buffer::do_insert(ByteCoord pos, const String& content) { if (content[i] == '\n') { - m_lines.push_back({ m_changes.size()+1, offset + start, content.substr(start, i + 1 - start) }); + m_lines.push_back({ offset + start, content.substr(start, i + 1 - start) }); start = i + 1; } } if (start != content.length()) - m_lines.push_back({ m_changes.size()+1, offset + start, content.substr(start) }); + m_lines.push_back({ offset + start, content.substr(start) }); begin = pos.column == 0 ? pos : ByteCoord{ pos.line + 1, 0 }; end = ByteCoord{ line_count()-1, m_lines.back().length() }; @@ -487,18 +487,18 @@ ByteCoord Buffer::do_insert(ByteCoord pos, const String& content) if (start == 0) { line_content = prefix + line_content; - new_lines.push_back({ m_changes.size()+1, offset + start - prefix.length(), + new_lines.push_back({ offset + start - prefix.length(), std::move(line_content) }); } else - new_lines.push_back({ m_changes.size()+1, offset + start, std::move(line_content) }); + new_lines.push_back({ offset + start, std::move(line_content) }); start = i + 1; } } if (start == 0) - new_lines.push_back({ m_changes.size()+1, offset + start - prefix.length(), prefix + content + suffix }); + new_lines.push_back({ offset + start - prefix.length(), prefix + content + suffix }); else if (start != content.length() or not suffix.empty()) - new_lines.push_back({ m_changes.size()+1, offset + start, content.substr(start) + suffix }); + new_lines.push_back({ offset + start, content.substr(start) + suffix }); LineCount last_line = pos.line + new_lines.size() - 1; @@ -523,7 +523,7 @@ ByteCoord Buffer::do_erase(ByteCoord begin, ByteCoord end) const ByteCount length = distance(begin, end); String prefix = m_lines[begin.line].content.substr(0, begin.column); String suffix = m_lines[end.line].content.substr(end.column); - Line new_line = { m_changes.size()+1, m_lines[begin.line].start, prefix + suffix }; + Line new_line = { m_lines[begin.line].start, prefix + suffix }; ByteCoord next; if (new_line.length() != 0) |
