Skip to content
This repository was archived by the owner on Oct 5, 2022. It is now read-only.

Panel auto hide option, for when there is nothing to show #185

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/ide-haskell.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ module.exports = IdeHaskell =
'''
enum: ['bottom', 'left', 'top', 'right']

panelAutoHide:
type: "boolean"
default: false
description: "Hide panel when there are no messages to show"

cleanConfig: ->
[ 'onSaveCheck'
, 'onSaveLint'
Expand Down
6 changes: 6 additions & 0 deletions lib/output-panel/output-panel.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ class OutputPanel
else
@panel.show()

hide: ->
@panel.hide()

show: ->
@panel.show()

destroy: ->
@disposables.dispose()
@panel.destroy()
Expand Down
10 changes: 9 additions & 1 deletion lib/plugin-manager.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ class PluginManager
@controllers = new WeakMap
@disposables.add @emitter = new Emitter

@disposables.add @onResultsUpdated ({types}) => @updateEditorsWithResults(types)
@disposables.add @onResultsUpdated ({types}) =>
@panelAutoHide() if atom.config.get('ide-haskell.panelAutoHide')
@updateEditorsWithResults(types)

@createOutputViewPanel(state)
@subscribeEditorController()
Expand Down Expand Up @@ -56,6 +58,12 @@ class PluginManager
onResultsUpdated: (callback) =>
@checkResults.onDidUpdate callback

panelAutoHide: ->
if @checkResults.results.length > 0
@outputView?.show()
else
@outputView?.hide()

controller: (editor) ->
@controllers?.get? editor

Expand Down