From 0a2f52f04462622865a4bb67fc6eb081e7baf8af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20Sverre=20Lien=20Sell=C3=A6g?= Date: Wed, 9 Sep 2020 14:44:22 +0200 Subject: [PATCH] use if statement instead of ternary operator --- src/source.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/source.cpp b/src/source.cpp index 6ee6d23..b0a8f67 100644 --- a/src/source.cpp +++ b/src/source.cpp @@ -105,8 +105,13 @@ std::string Source::FixIt::string(BaseView &view) { std::string to_pos, text; if(type != Type::insert) { 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), - view.get_iter_at_line_index(offsets.second.line, offsets.second.index)) : ""; + if(in_current_view) { + 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)