Browse Source

use if statement instead of ternary operator

pipelines/235045657
Jørgen Lien Sellæg 5 years ago
parent
commit
0a2f52f044
  1. 9
      src/source.cpp

9
src/source.cpp

@ -105,8 +105,13 @@ std::string Source::FixIt::string(BaseView &view) {
std::string to_pos, text; std::string to_pos, text;
if(type != Type::insert) { if(type != Type::insert) {
to_pos = std::to_string(offsets.second.line + 1) + ':' + std::to_string(offsets.second.index + 1); to_pos = std::to_string(offsets.second.line + 1) + ':' + std::to_string(offsets.second.index + 1);
text = in_current_view ? view.get_buffer()->get_text(view.get_iter_at_line_index(offsets.first.line, offsets.first.index), if(in_current_view) {
view.get_iter_at_line_index(offsets.second.line, offsets.second.index)) : ""; text = view.get_buffer()->get_text(view.get_iter_at_line_index(offsets.first.line, offsets.first.index),
view.get_iter_at_line_index(offsets.second.line, offsets.second.index));
}
else {
text = "";
}
} }
if(type == Type::insert) if(type == Type::insert)

Loading…
Cancel
Save