Closed arkocal closed 9 years ago
Now there is only one public variable left, which I think is ok :smile:
Actually, I believe we can simplify this and some other code here. I introduced is_collapsible_start
/is_collapsible_end
to have a flexible solution for deciding whether there should be an arrow or not but we now know that both of these variables are really the same as output_line.is_prompt_line
.
Therefore my suggestion is to get rid of those two variables entirely and replace them with checks for is_prompt_line
like you are already doing here. Additionally, is_collapsible
should include a check for the current line as well (i.e. whether it is a prompt line); that way, double checks like here can be avoided.
I am personally OK with linking LineView
and LineContainer
in the way you proposed because there really seems to be no other method to achieve the desired effect. However, following the pattern used elsewhere in the code (such as TerminalView
and TerminalOutputView
), the LineContainer
instance should be passed to the LineView
through the constructor rather than set afterwards. That way, there is no need to have any public variables at all :+1:
Merged! What a lovely improvement :) The UI looks so much better now!
I made a few variables that should actually remain private public. If the solution is OK, I am going to resolve that using getters / setters etc. but I wanted you to have a look first because I am not quite sure if it is a good idea to "connect" those classes.