Skip to content

Commit

Permalink
Merge pull request #2 from WhiteVoidia/master
Browse files Browse the repository at this point in the history
Add ability to hide commands from history; 'clear' command no longer also puts '__init__' command into history
  • Loading branch information
needim committed Dec 5, 2013
2 parents f08ba0a + b221211 commit 2844cbb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
9 changes: 5 additions & 4 deletions js/termic.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Termic

@addCommand('clear', 'Clears the screen', () ->
@terminal.innerHTML = ''
@runCommand '__init__', []
@runCommand '__init__', [], true
)

@listen()
Expand Down Expand Up @@ -98,9 +98,10 @@ class Termic
else if list.length > 1
@appendToTerminal @createFormat 'termic-suggestions', "Suggestions: #{list.join(', ')}"

runCommand: (command, params) ->
@_history.splice 0, 0, "#{command} #{params.join(' ')}"
@_history_index = -1
runCommand: (command, params, hidden = false) ->
if (!hidden)
@_history.splice 0, 0, "#{command} #{params.join(' ')}"
@_history_index = -1

if @commands[command]
@appendToTerminal @createFormat "termic-entry", @commands[command].handler?.call(@, params)
Expand Down
16 changes: 10 additions & 6 deletions js/termic.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2844cbb

Please sign in to comment.