Skip to content

Instantly share code, notes, and snippets.

@joakimk
Last active April 5, 2018 13:10
Show Gist options
  • Select an option

  • Save joakimk/5e5fb68bb33ac93f378440ea91ae5b22 to your computer and use it in GitHub Desktop.

Select an option

Save joakimk/5e5fb68bb33ac93f378440ea91ae5b22 to your computer and use it in GitHub Desktop.

Revisions

  1. joakimk revised this gist Apr 5, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion init.coffee
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,7 @@ runTestInTmux = (focus) ->
    relativePath = fullPath.split(projectPath)[1]

    if focus
    line = atom.workspace.getActiveTextEditor().getLastCursor().getBufferPosition().row
    line = editor.getLastCursor().getBufferPosition().row
    relativePath = relativePath + ":" + line

    child.spawnSync("tmux", ["send-keys", "-l", "script/test " + relativePath + "\n"])
  2. joakimk revised this gist Apr 5, 2018. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions init.coffee
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # Atom -> Init Script...

    child = require 'child_process'
    child = require "child_process"

    runTestInTmux = (focus) ->
    editor = atom.workspace.getActiveTextEditor()
    @@ -14,10 +14,10 @@ runTestInTmux = (focus) ->
    line = atom.workspace.getActiveTextEditor().getLastCursor().getBufferPosition().row
    relativePath = relativePath + ":" + line

    child.spawnSync('tmux', ['send-keys', '-l', 'script/test ' + relativePath + '\n'])
    child.spawnSync("tmux", ["send-keys", "-l", "script/test " + relativePath + "\n"])

    atom.commands.add 'atom-text-editor', 'custom:save-and-run-test-at-current-line', ->
    atom.commands.add "atom-text-editor", "custom:save-and-run-test-at-current-line", ->
    runTestInTmux(true)

    atom.commands.add 'atom-text-editor', 'custom:save-and-run-test', ->
    atom.commands.add "atom-text-editor", "custom:save-and-run-test", ->
    runTestInTmux(false)
  3. joakimk revised this gist Apr 5, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion keymap.cson
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Atom -> Keymap
    # Atom -> Keymap...

    'atom-text-editor.vim-mode-plus:not(.insert-mode)':
    'm': 'custom:save-and-run-test-at-current-line'
  4. joakimk revised this gist Apr 5, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion keymap.cson
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    # Atom - Keymap
    # Atom -> Keymap

    'atom-text-editor.vim-mode-plus:not(.insert-mode)':
    'm': 'custom:save-and-run-test-at-current-line'
  5. joakimk created this gist Apr 5, 2018.
    23 changes: 23 additions & 0 deletions init.coffee
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    # Atom -> Init Script...

    child = require 'child_process'

    runTestInTmux = (focus) ->
    editor = atom.workspace.getActiveTextEditor()
    editor.save()

    fullPath = editor.getPath()
    projectPath = atom.project.getDirectories()[0].getPath() + "/"
    relativePath = fullPath.split(projectPath)[1]

    if focus
    line = atom.workspace.getActiveTextEditor().getLastCursor().getBufferPosition().row
    relativePath = relativePath + ":" + line

    child.spawnSync('tmux', ['send-keys', '-l', 'script/test ' + relativePath + '\n'])

    atom.commands.add 'atom-text-editor', 'custom:save-and-run-test-at-current-line', ->
    runTestInTmux(true)

    atom.commands.add 'atom-text-editor', 'custom:save-and-run-test', ->
    runTestInTmux(false)
    5 changes: 5 additions & 0 deletions keymap.cson
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    # Atom - Keymap

    'atom-text-editor.vim-mode-plus:not(.insert-mode)':
    'm': 'custom:save-and-run-test-at-current-line'
    'M': 'custom:save-and-run-test'