<commit_before>helpers = require './spec-helper'

describe "Panes", ->
  [editor, editorView, vimState] = []

  beforeEach ->
    vimMode = atom.packages.loadPackage('vim-mode')
    vimMode.activateResources()

    editorView = helpers.cacheEditor(editorView)
    editor = editorView.editor

    vimState = editorView.vimState
    vimState.activateCommandMode()
    vimState.resetCommandMode()

  keydown = (key, options={}) ->
    options.element ?= editorView[0]
    helpers.keydown(key, options)

  describe "switch panes", ->
    beforeEach ->
      editor.setText("abcde\n")
      atom.workspaceView = {
        focusPaneViewOnRight: ->
        focusPaneViewOnLeft: ->
        focusPaneViewBelow: ->
        focusPaneViewAbove: ->
        getActivePaneItem: -> editor
        getActiveView: -> editorView
      }

    describe "focus pane right", ->
      beforeEach ->
        spyOn(atom.workspaceView, 'focusPaneViewOnRight')

      it "focuses the pane on the right", ->
        keydown('w', ctrl: true)
        keydown('l')

        expect(atom.workspaceView.focusPaneViewOnRight).toHaveBeenCalled()

    describe "focus pane left", ->
      beforeEach ->
        spyOn(atom.workspaceView, 'focusPaneViewOnLeft')

      it "focuses the pane on the left", ->
        keydown('w', ctrl: true)
        keydown('h')

        expect(atom.workspaceView.focusPaneViewOnLeft).toHaveBeenCalled()

    describe "focus pane below", ->
      beforeEach ->
        spyOn(atom.workspaceView, 'focusPaneViewBelow')

      it "focuses the pane on the below", ->
        keydown('w', ctrl: true)
        keydown('j')

        expect(atom.workspaceView.focusPaneViewBelow).toHaveBeenCalled()

    describe "focus pane above", ->
      beforeEach ->
        spyOn(atom.workspaceView, 'focusPaneViewAbove')

      it "focuses the pane on the above", ->
        keydown('w', ctrl: true)
        keydown('k')

        expect(atom.workspaceView.focusPaneViewAbove).toHaveBeenCalled()
<commit_msg>rename spec descriptions to use keybinding names<commit_after>helpers = require './spec-helper'

describe "Panes", ->
  [editor, editorView, vimState] = []

  beforeEach ->
    vimMode = atom.packages.loadPackage('vim-mode')
    vimMode.activateResources()

    editorView = helpers.cacheEditor(editorView)
    editor = editorView.editor

    vimState = editorView.vimState
    vimState.activateCommandMode()
    vimState.resetCommandMode()

  keydown = (key, options={}) ->
    options.element ?= editorView[0]
    helpers.keydown(key, options)

  describe "switch panes", ->
    beforeEach ->
      editor.setText("abcde\n")
      atom.workspaceView = {
        focusPaneViewOnRight: ->
        focusPaneViewOnLeft: ->
        focusPaneViewBelow: ->
        focusPaneViewAbove: ->
        getActivePaneItem: -> editor
        getActiveView: -> editorView
      }

    describe "the ctrl-w l keybinding", ->
      beforeEach ->
        spyOn(atom.workspaceView, 'focusPaneViewOnRight')

      it "focuses the pane on the right", ->
        keydown('w', ctrl: true)
        keydown('l')

        expect(atom.workspaceView.focusPaneViewOnRight).toHaveBeenCalled()

    describe "the ctrl-w h keybinding", ->
      beforeEach ->
        spyOn(atom.workspaceView, 'focusPaneViewOnLeft')

      it "focuses the pane on the left", ->
        keydown('w', ctrl: true)
        keydown('h')

        expect(atom.workspaceView.focusPaneViewOnLeft).toHaveBeenCalled()

    describe "the ctrl-w j keybinding", ->
      beforeEach ->
        spyOn(atom.workspaceView, 'focusPaneViewBelow')

      it "focuses the pane on the below", ->
        keydown('w', ctrl: true)
        keydown('j')

        expect(atom.workspaceView.focusPaneViewBelow).toHaveBeenCalled()

    describe "the ctrl-w k keybinding", ->
      beforeEach ->
        spyOn(atom.workspaceView, 'focusPaneViewAbove')

      it "focuses the pane on the above", ->
        keydown('w', ctrl: true)
        keydown('k')

        expect(atom.workspaceView.focusPaneViewAbove).toHaveBeenCalled()

{'fraction_non_alphanumeric': 0.12065541211519365, 'fraction_numerical': 0.0004965243296921549, 'mean_word_length': 2.7340129749768303, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4296068', 'n_tokens_mistral': 1248, 'n_tokens_neox': 1192, 'n_words': 244}