t9md / atom-vim-mode-plus

vim-mode improved
https://atom.io/packages/vim-mode-plus
MIT License
1.4k stars 111 forks source link

Cannot use linewise sort on a visual selection #1098

Closed paradox460 closed 4 years ago

paradox460 commented 5 years ago

Attempting to do a linewise sort on a visual selection throws an error.

Steps to Reproduce

  1. Select some lines that are not sorted
  2. Execute Vim Mode Plus: Sort
  3. Atom throws an error and the lines are not sorted

Package Version
Atom 1.31.2
Vim Mode Plus 1.35.0
OS Version Mac OS X 10.11.6
debug info ```json { "atom": "1.31.2", "platform": "darwin", "release": "15.6.0", "vmpVersion": "1.35.0", "vmpConfig": { "automaticallyEscapeInsertModeOnActivePaneItemChange": true, "blackholeRegisteredOperators": [ "change*", "substitute*" ], "charactersToAddSpaceOnSurround": [ ")", "}", "]", ">" ], "highlightSearchExcludeScopes": [ "narrow" ], "ignoreCaseForSearch": true, "keymapCCToChangeInnerSmartWord": true, "keymapPToPutWithAutoIndent": true, "keymapSemicolonToInnerAnyPairInOperatorPendingMode": true, "keymapSemicolonToInnerAnyPairInVisualMode": true, "keymapUnderscoreToReplaceWithRegister": true, "keymapYToYankToLastCharacterOfLine": true, "numberRegex": "-?[0-9_]+", "sequentialPaste": true, "sequentialPasteMaxHistory": 5, "showHoverOnOperate": true, "showHoverSearchCounter": true, "useClipboardAsDefaultRegister": false } } ```
Atom Error Report Uncaught TypeError: null is not a function! **Atom**: 1.31.2 x64 **Electron**: 2.0.7 **OS**: Mac OS X 10.11.6 **Thrown From**: [vim-mode-plus](https://github.com/t9md/atom-vim-mode-plus) package 1.35.0 ### Stack Trace Uncaught TypeError: null is not a function! ``` At /Users/jeff.sandberg/.atom/packages/vim-mode-plus/lib/operation-stack.js:164 TypeError: null is not a function! at module.exports (/packages/git-plus/node_modules/core-js/modules/_a-function.js:2:38) at Array.sort (/packages/git-plus/node_modules/core-js/modules/es6.array.sort.js:21:36) at Object.changeArrayOrder (/packages/vim-mode-plus/lib/utils.js:1322:28) at Sort.getNewList (/packages/vim-mode-plus/lib/operator-transform-string.js:745:25) at Sort.getNewText (/packages/vim-mode-plus/lib/operator-transform-string.js:737:14) at Sort.mutateSelection (/packages/vim-mode-plus/lib/operator-transform-string.js:25:23) at Sort.mutateSelections (/packages/vim-mode-plus/lib/operator.js:258:12) at Sort.execute (/packages/vim-mode-plus/lib/operator.js:286:35) at OperationStack.execute (/packages/vim-mode-plus/lib/operation-stack.js:200:33) at OperationStack.process (/packages/vim-mode-plus/lib/operation-stack.js:193:12) at OperationStack.run (/packages/vim-mode-plus/lib/operation-stack.js:105:14) at /packages/vim-mode-plus/lib/vim-state.js:70:33) at CommandRegistry.handleCommandEvent (/Applications/Atom.app/Contents/Resources/app/src/command-registry.js:384:49) at KeymapManager.module.exports.KeymapManager.dispatchCommandEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:621:22) at KeymapManager.module.exports.KeymapManager.handleKeyboardEvent (/Applications/Atom.app/Contents/Resources/app/node_modules/atom-keymap/lib/keymap-manager.js:412:28) at WindowEventHandler.handleDocumentKeyEvent (/Applications/Atom.app/Contents/Resources/app/src/window-event-handler.js:110:40) ``` ### Commands ``` -3:02.4.0 vim-mode-plus:activate-linewise-visual-mode (input.hidden-input) 9x -3:02.3.0 vim-mode-plus:move-down (input.hidden-input) -3:00.7.0 vim-mode-plus:delete (input.hidden-input) -3:00.7.0 vim-mode-plus:move-up (input.hidden-input) -2:59.8.0 core:save (input.hidden-input) 10x -2:59.2.0 vim-mode-plus:move-up (input.hidden-input) -0:28.7.0 symbols-view:toggle-file-symbols (input.hidden-input) 2x -0:28 core:move-down (input.hidden-input) -0:26.9.0 core:move-up (input.hidden-input) -0:25.2.0 core:confirm (input.hidden-input) -0:15.2.0 vim-mode-plus:insert-below-with-newline (input.hidden-input) -0:14.1.0 spaces-in-braces:run-space-check (input.hidden-input) -0:12.2.0 vim-mode-plus:activate-normal-mode (input.hidden-input) -0:11.5.0 vim-mode-plus:activate-linewise-visual-mode (input.hidden-input) 2x -0:08.3.0 vim-mode-plus:move-down (input.hidden-input) -0:07.2.0 vim-mode-plus:sort (input.hidden-input) ``` ### Non-Core Packages ``` advanced-open-file 0.16.8 align-regexp 0.4.0 AtLilyPond 1.2.2 atom-alignment 0.13.0 atom-beautify 0.33.4 atom-elixir 0.2.3 atom-elixir-formatter 1.0.6 auto-indent 0.5.0 autocomplete-emojis 2.5.0 autocomplete-paths 2.12.2 blame 1.0.1 build 0.70.0 build-elixir 0.7.0 build-rake 0.1.1 busy-signal 1.4.3 choose-pane 0.8.0 color-picker 2.3.0 column-select 1.0.1 css-comb 2.5.0 ctags-status 1.3.7 dash 1.7.1 dockerletion 0.2.0 emmet 2.4.3 escape-utils 0.5.3 ex-mode 0.18.0 file-icons 2.1.25 fold-lines 0.2.2 gist 1.1.0 git-diff-popup 0.1.8 git-history 3.3.0 git-plus 8.1.0 git-time-machine 2.1.0 hard-wrap 1.7.1 highlight-column 0.5.4 highlight-line 0.12.0 highlight-selected 0.14.0 indentation-indicator 1.1.0 intentions 1.1.5 json-path-finder 0.1.9 jumpy 5.0.2 language-babel 2.85.0 language-cjsx 0.3.0 language-crystal-actual 0.37.2 language-diff 0.7.0 language-docker 1.1.8 language-dot 1.7.0 language-elixir 0.22.1 language-elvish 0.3.13 language-fish-shell 1.1.0 language-generic-config 1.4.0 language-gfm-enhanced 0.92.0 language-graphql 0.11.0 language-latex 1.2.0 language-log 1.10.1 language-lua 0.9.11 language-nginx 0.8.0 language-pfm 0.82.0 language-pug 0.0.22 language-rspec 0.12.1 language-slim 1.0.0 language-vue 0.23.1 latex-autocomplete 1.1.1 latex-plus 0.9.1 latexer 0.3.0 latextools 0.8.5 linter 2.2.0 linter-chktex 1.3.1 linter-coffeelint 2.0.1 linter-docker 0.3.2 linter-elixir-credo 1.1.0 linter-eslint 8.4.1 linter-js-yaml 1.3.0 linter-jshint 3.1.9 linter-jsonlint 1.3.0 linter-lua 1.0.4 linter-rubocop 2.2.3 linter-slim 1.0.0 linter-ui-default 1.7.1 linter-xmllint 1.4.4 live-archive 0.1.15 markdown-preview-enhanced 0.15.7 markdown-table-editor 1.1.1 markdown-writer 2.9.0 minimap 4.29.9 minimap-bookmarks 0.4.2 minimap-find-and-replace 4.5.2 minimap-git-diff 4.3.1 minimap-highlight-selected 4.6.1 minimap-linter 2.2.0 minimap-selection 4.5.0 multi-wrap-guide 1.1.6 narrow 0.65.1 open-this 0.5.0 pain-split 1.4.0 pandoc 0.2.2 pane-layout-plus 0.7.4 pdf-view 0.71.0 pigments 0.40.2 polymorph 2.2.3 prettier-atom 0.55.2 preview 0.17.0 quick-highlight 0.13.0 rails-snippets 2.19.0 rainbow-delimiters 2.1.2 red-wavy-underline 0.3.3 regex-railroad-diagram 0.19.4 relative-numbers 0.9.0 rubocop-auto-correct 1.5.1 ruby-block 0.3.6 ruby-block-converter 4.1.1 sequential-number 0.5.0 set-syntax 0.4.0 simple-align 0.2.0 snippet-generator 0.3.2 sort-lines 0.18.0 spaces-in-braces 0.1.0 string-looper 0.1.2 Sublime-Style-Column-Selection 1.7.5 sync-settings 0.8.6 tablr 1.8.3 tabs-to-spaces 1.0.5 tabular 0.1.0 tabularize 0.2.5 toggle-quotes 1.1.1 tomorrow-ui 0.3.0 transform 0.4.0 tree-view-git-modified 0.7.3 underline-trailing-whitespace 1.4.2 vim-mode-plus 1.35.0 vim-mode-plus-duplicate 0.3.0 vim-mode-plus-exchange 0.4.0 vim-mode-plus-move-selected-text 0.12.0 vim-mode-plus-move-to-symbols 0.5.0 white-cursor 0.7.0 wordcount 3.0.0 yard 0.5.1 ```

Checklist

You have to check all before open issue.

linkenneth commented 4 years ago

Is this still relevant? Your repro steps seem to work for me.