helpers: writeCyclicBuffer: fix drawing part of separator

This commit is contained in:
Andrzej Rybczak
2012-10-12 16:11:54 +02:00
parent c1d665bf9e
commit 33fb33dc8d

View File

@@ -162,7 +162,10 @@ void writeCyclicBuffer(const NC::WBuffer &buf, NC::Window &w, size_t &start_pos,
};
write_buffer(start_pos);
for (size_t i = 0; i < separator.length() && len < width; ++i)
size_t i = 0;
if (start_pos > s.length())
i = start_pos - s.length();
for (; i < separator.length() && len < width; ++i)
{
len += wcwidth(separator[i]);
if (len > width)
@@ -172,7 +175,7 @@ void writeCyclicBuffer(const NC::WBuffer &buf, NC::Window &w, size_t &start_pos,
write_buffer(0);
++start_pos;
if (start_pos >= s.length())
if (start_pos >= s.length() + separator.length())
start_pos = 0;
}
else