Merge lp://staging/~mefrio-g/scratch/fix-1258260 into lp://staging/~elementary-apps/scratch/scratch

Proposed by Mario Guerriero
Status: Merged
Approved by: Niclas Lockner
Approved revision: 1281
Merged at revision: 1292
Proposed branch: lp://staging/~mefrio-g/scratch/fix-1258260
Merge into: lp://staging/~elementary-apps/scratch/scratch
Diff against target: 204 lines (+45/-26)
3 files modified
plugins/outline/CtagsSymbolResolver.vala (+7/-0)
plugins/outline/OutlinePlugin.vala (+29/-8)
plugins/outline/ValaSymbolResolver.vala (+9/-18)
To merge this branch: bzr merge lp://staging/~mefrio-g/scratch/fix-1258260
Reviewer Review Type Date Requested Status
Niclas Lockner (community) Approve
Review via email: mp+215567@code.staging.launchpad.net

Commit message

Don't show outline pane if there is nothing to outline. Fixes bug #1258260

To post a comment you must log in.
Revision history for this message
Niclas Lockner (niclasl) wrote :

The filter_generated_fields method in ValaSymbolResolver in unused now that the call at diff line 118 is removed. Should n't it be removed as well?

I noticed three situations where it doesn't work as expected:

When I start Scratch, the empty outline pane is shown alongside the welcome screen.

If the outline pane is shown when the last tab is closed (e.g. one single vala file opened and then closed), the outline pane is still shown alongside the welcome screen. If I instead let the last closed tab be a non-vala file, it works as expected.

If I open some new tabs with new or existing non-vala documents and then switch between them, the outline pane appears. It hides itself when I open yet another tab.

review: Needs Fixing
Revision history for this message
Niclas Lockner (niclasl) wrote :

And when I say that the pane is shown alongside the welcome screen, I mean that the buttons on the welcome screen are no longer centered and there's a large empty space to the right where the pane will be once a vala file is opened.

1278. By Mario Guerriero

fixed welcome screen and unsaved documents problems

Revision history for this message
Mario Guerriero (mefrio-g) wrote :

It should work as expected now. I also fixed some compilation warnings.

Revision history for this message
Niclas Lockner (niclasl) wrote :

It still doesn't work that well for me:

Open scratch (No tabs are open and the welcome screen is shown)

Open a Vala file
=> Outline pane has two Symbols tabs (the inactive tab isn't clickable)

Open a second Vala file
Switch between the tabs
=> The output pane no longer shows any content
=> For each switch, a new Symbols tab is added to the Outline pane

Close both tabs
=> failed assertion and SIGABRT when the last tab is closed

If I instead open Scratch, create a new document and then open a Vala document, it seems to work.
I can switch between the two tabs and the outline pane is shown or hidden accordingly. The outline pane also has the right content.

review: Needs Fixing
1279. By Mario Guerriero

do not add several useless symbols view to the left pane

Revision history for this message
Mario Guerriero (mefrio-g) wrote :

Everything should work as expected now. Thanks for your patience.

Revision history for this message
Niclas Lockner (niclasl) wrote :

Now it works much better, but there's still one bug:

If I open a vala file and a regular file (not a new document but an existing one) and then switch tab from the vala file to the non-vala file, the outline pane becomes empty but doesn't hide as it should.

If I instead open a vala file and a new empty document, it works as long as the new document isn't saved. Once saved, Scratch behaves as above.

Also, there's a conflict with trunk's ValaSymbolResolver.vala

review: Needs Fixing
Revision history for this message
Niclas Lockner (niclasl) wrote :

And if the code style is to be strictly followed:

Newline before diff line 26
Remove spaces on diff lines 66, 97, 104, 137, 139
Add space after if on diff line 99
Make a cuddled else if on diff lines 92-93

1280. By Mario Guerriero

fixed switch between vala and non-vala files

Revision history for this message
Mario Guerriero (mefrio-g) wrote :

It now works fine. I see the conflict project but to be honest I don't know how to fix it. Could you help me?

Revision history for this message
Niclas Lockner (niclasl) wrote :

Yes, now it works as expected :) Just the code style issues and the conflict left then.

To resolve the conflict, first merge with trunk:
bzr merge lp:scratch

which should give you:
Text conflict in plugins/outline/ValaSymbolResolver.vala
1 conflicts encountered.

After that, open plugins/outline/ValaSymbolResolver.vala and edit it so that it looks good (i.e. remove line 167-183 in this case)

After that, mark all conflicts as resolved:
bzr resolve

and commit the changes:
bzr commit -m "Merge changes from lp:scratch"

1281. By Mario Guerriero

Merge changes from lp:scratch

Revision history for this message
Mario Guerriero (mefrio-g) wrote :

It should be everything fine now. Thanks.

Revision history for this message
Niclas Lockner (niclasl) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches