Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Commit

Permalink
Refactor "clear" context command // Issue #392
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankravets committed Dec 30, 2017
1 parent f67c6a7 commit c526d54
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 5 additions & 0 deletions lib/status-bar.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class StatusBar extends View
return unless @activeTerminal
return if @activeTerminal.isAnimating()
@activeTerminal.open() if @activePrevTerminalView()
'platformio-ide-terminal:clear': => @clear()
'platformio-ide-terminal:close': => @destroyActiveTerm()
'platformio-ide-terminal:close-all': => @closeAll()
'platformio-ide-terminal:rename': => @runInActiveView (i) -> i.rename()
Expand Down Expand Up @@ -325,6 +326,10 @@ class StatusBar extends View
@activeTerminal = @terminalViews[0]
@activeTerminal.toggle()

clear: ->
@destroyActiveTerm()
@newTerminalView()

setStatusColor: (event) ->
color = event.type.match(/\w+$/)[0]
color = atom.config.get("platformio-ide-terminal.iconColors.#{color}").toRGBAString()
Expand Down
3 changes: 0 additions & 3 deletions lib/view.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -441,9 +441,6 @@ class PlatformIOTerminalView extends View

paste: ->
@input atom.clipboard.read()
clear: ->
@terminal.destroy()
@displayTerminal()

insertSelection: (customText) ->
return unless editor = atom.workspace.getActiveTextEditor()
Expand Down

0 comments on commit c526d54

Please sign in to comment.