[line_buffer] fix long line issue

Fixes #980
pull/1031/head
Tim Stack 2 years ago
parent 4e74491e84
commit 3df07139b3

@ -101,7 +101,7 @@ run_cap_test() {
sed -ibak \
-e "s;${test_dir};{test_dir};g" \
-e "s;${builddir};{builddir};g" \
-e "s;${builddir};{test_dir};g" \
-e "s;${top_srcdir};{top_srcdir};g" \
-e "s;${top_srcdir_parent};{top_srcdir_parent};g" \
${test_file_base}_${test_hash}.out

@ -990,7 +990,7 @@ line_buffer::load_next_line(file_range prev_line)
auto offset = prev_line.next_offset();
ssize_t request_size = INITIAL_REQUEST_SIZE;
retval.li_file_range.fr_offset = offset;
if (this->lb_buffer.empty()) {
if (this->lb_buffer.empty() || !this->in_range(offset)) {
this->fill_range(offset, this->lb_buffer.capacity());
} else if (offset == this->lb_file_offset + this->lb_buffer.size()) {
if (!this->fill_range(offset, INITIAL_REQUEST_SIZE)) {

@ -136,7 +136,6 @@ view_curses::mvwattrline(WINDOW* window,
auto& sa = al.get_attrs();
auto& line = al.get_string();
std::vector<utf_to_display_adjustment> utf_adjustments;
int exp_offset = 0;
std::string full_line;
require(lr_chars.lr_end >= 0);
@ -198,7 +197,6 @@ view_curses::mvwattrline(WINDOW* window,
lr_bytes.lr_end += abs(offset);
}
#endif
exp_offset += offset;
utf_adjustments.emplace_back(lpc, offset);
for (; offset && (lpc + 1) < line.size();
lpc++, offset++)

@ -9,7 +9,7 @@
# The files loaded into the session were:
;INSERT OR IGNORE INTO environ (name, value) VALUES ('LOG_DIR_0', '{builddir}')
;INSERT OR IGNORE INTO environ (name, value) VALUES ('LOG_DIR_0', '{test_dir}')
:open $LOG_DIR_0/support-dump/logfile_access_log.0
:rebuild

Loading…
Cancel
Save