-
-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Continous saving of current tabs and tab-zooms #742
Continous saving of current tabs and tab-zooms #742
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is mostly working - thanks! A couple of issues:
-
Changing the default font with
<Control>scroll
does not change settings because at the moment the Terminal Widget changes the font directly. You need to change the scroll handler to activate the relevant window action instead. -
I suggest you split the
save_opened_terminals
function up so that you can change the zooms and uris settings independently to save unnecessary work being done.
343f4da
to
24ce4cc
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You seem to have repeated a lot of code in save_open_terminals_with_zooms
? Can you just call the split functions?
Adding another signal to the terminal widget is not the best solution - you can just activate the appropriate action in the scroll handler instead of calling increment_size
and decrement_size
. This can be done with code like
window.get_simple_action (MainWindow.ACTION_ZOOM_FONT_IN).activate (null);
(other examples of this pattern are already used in the code)
I have made a couple of other comments inline.
552e4eb
to
c963ac5
Compare
c963ac5
to
0cbd59d
Compare
|
Maybe would be a better solution to make again one function but with bool value I think I processed all notes. Thank you for reviewing. |
Handle the situation when is opened first terminal, then second one, second one is closed and then is laptop rebooted. Without this code would be saved tabs and tab-zooms from second terminal but should be from first one. |
…sed another terminal)
9a9d24a
to
db5843a
Compare
@ldrahnik I am fine with you merging the saving functions back into one with an extra parameter. |
…pdates filtered out by bool args
@jeremypw Refactored to one function but with 2 bool parameters because I realized I do not know how to do that with only 1 - 1. state save only tabs, 2. state save only zooms, 3. state save both |
It could be done with an enum as a parameter but probably not worth it in this case. |
@ldrahnik One small thing I noticed - Other than that it seems to work well now! |
6f679aa
to
2e059a2
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is good to go now - thanks for your contribution!
Need to fix CI workflow (or override) before can be merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, missed the fact that one of the unit tests now fails (CI was failing anyway in other PRs for an unrelated reason). The error given is
▶ 2/3 ERROR:../src/tests/Application.vala:155:__lambda53_: assertion failed (n_tabs == 1): (2 == 1) ERROR
Not immediately obvious why this PR should affect the number of tabs - I'll investigate.
@ldrahnik I have pushed a PR to merge into this one that should fix the unit testing issue for now. The unit tests should probably be rewritten/extended to take continuous saving (or not) into account but that is complicated so can be left for another PR. |
@jeremypw Merged. |
Fixes #741