After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 776356 - :sp doesn't work for the first time after :q
:sp doesn't work for the first time after :q
Status: RESOLVED FIXED
Product: gnome-builder
Classification: Other
Component: editor
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GNOME Builder Maintainers
GNOME Builder Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-12-21 18:16 UTC by Sourav Goyal
Modified: 2016-12-27 14:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
editor: make >>split command work all the time (5.79 KB, patch)
2016-12-27 10:33 UTC, Anoop Chandu
none Details | Review
editor: make >>split command work all the time (7.13 KB, patch)
2016-12-27 14:35 UTC, Anoop Chandu
committed Details | Review

Description Sourav Goyal 2016-12-21 18:16:02 UTC
Steps for reproduction

1. open a file
2. run :sp
2. run :q
3. run :sp
it doesn't work for the first time
Comment 1 Anoop Chandu 2016-12-27 10:33:53 UTC
Created attachment 342490 [details] [review]
editor: make >>split command work all the time

This is happening because all editor views  share same view-stack.split-down 
action state. This patch makes view-stack.split-down action not having any 
state and whenever it is activated it toggles split state of active view 
by getting and setting reverse state.
Comment 2 sébastien lafargue 2016-12-27 13:02:41 UTC
Review of attachment 342490 [details] [review]:

the terminal plugin use set_split_view too, so you need to implement get_split_view for it

::: libide/editor/ide-editor-view.c
@@ +468,3 @@
+  IdeEditorView *self = (IdeEditorView *)view;
+
+  return !(self->frame2 == NULL);

use return (self->frame2 != NULL);

::: libide/workbench/ide-layout-view.c
@@ +84,3 @@
+ide_layout_view_get_split_view (IdeLayoutView *self)
+{
+  g_return_if_fail (IDE_IS_LAYOUT_VIEW (self));

return a boolean so use :
g_return_val_if_fail (IDE_IS_LAYOUT_VIEW (self), FALSE);

when building, you should have seen a warning about that in the terminal
Comment 3 sébastien lafargue 2016-12-27 13:03:39 UTC
there's alsoo the fact that the libidemm part is not updated,
Comment 4 sébastien lafargue 2016-12-27 13:05:22 UTC
Christian, what is the politic about maintaining libidemm up-to-date ?
Comment 5 Anoop Chandu 2016-12-27 14:35:20 UTC
Created attachment 342500 [details] [review]
editor: make >>split command work all the time

get_split_view is implemented for terminal view also and made other fixes.

How libidemm affect this?
Comment 6 sébastien lafargue 2016-12-27 14:42:24 UTC
the libide methods are described in libidemm, for example for set_split_view here:

https://git.gnome.org/browse/gnome-builder/tree/libidemm/src/libide_methods.defs#n3116

so the patch work but libidemm is not up-to-date anymore.
Two solutions:
We keep it up-to-date on a patch per patch basis (more work)
or it's fixed later.
Comment 7 sébastien lafargue 2016-12-27 14:55:16 UTC
Attachment 342500 [details] pushed as f2a8419 - editor: make >>split command work all the time