diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2012-08-23 23:56:35 +0200 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2012-08-23 23:56:35 +0200 |
| commit | e4fd839ddaaf3fc68df2cb502a633a2ae6a9f86f (patch) | |
| tree | 681b2a63eb9b9497b97697e3f1479a7b20270427 /src/window.cc | |
| parent | 0d8cce272831cd896d0e69d7c86cc9afc521eb11 (diff) | |
use a strongly typed int CharCount for character counts
Diffstat (limited to 'src/window.cc')
| -rw-r--r-- | src/window.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/window.cc b/src/window.cc index cc60d1f1..c330a7ec 100644 --- a/src/window.cc +++ b/src/window.cc @@ -56,7 +56,7 @@ void Window::update_display_buffer() BufferIterator line_end = buffer().iterator_at_line_end(pos); BufferIterator end; - if (line_end - pos > m_dimensions.column) + if (CharCount(line_end - pos) > m_dimensions.column) end = pos + m_dimensions.column; else end = line_end; @@ -100,7 +100,7 @@ void Window::scroll_to_keep_cursor_visible_ifn() // (this is only valid if highlighting one line and multiple lines put // the cursor in the same position, however I do not find any sane example // of highlighters not doing that) - int column = 0; + CharCount column = 0; for (auto& atom : lines.back()) { if (atom.content.has_buffer_range() and @@ -136,7 +136,7 @@ String Window::status_line() const oss << buffer().name(); if (buffer().is_modified()) oss << " [+]"; - oss << " -- " << (int)cursor.line+1 << "," << cursor.column+1 + oss << " -- " << (int)cursor.line+1 << "," << (int)cursor.column+1 << " -- " << selections().size() << " sel -- "; if (is_editing()) oss << "[Insert]"; |
