justmoon / relative-numbers

Relative line numbers package for Atom
https://atom.io/packages/relative-numbers
MIT License
37 stars 16 forks source link

Incompatible with Atom's "Toggle Line Numbers" feature #44

Open despairblue opened 7 years ago

despairblue commented 7 years ago

When trying to hide the line numbers this will break.

[Enter steps to reproduce:]

  1. open text editor.
  2. execute Toggle Line Numbers from command palette.
  3. execute Toggle Line Numbers again.

Atom: 1.19.0 x64 Electron: 1.6.9 OS: Mac OS X 10.12.5 Thrown From: Atom Core

Stack Trace

Uncaught NotFoundError: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.

At /Applications/Atom.app/Contents/Resources/app/node_modules/etch/lib/patch.js:123

Error: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.
    at updateChildren (/Applications/Atom.app/Contents/Resources/app/node_modules/etch/lib/patch.js:123:27)
    at patch (/Applications/Atom.app/Contents/Resources/app/node_modules/etch/lib/patch.js:18:15)
    at updateChildren (/Applications/Atom.app/Contents/Resources/app/node_modules/etch/lib/patch.js:77:13)
    at patch (/Applications/Atom.app/Contents/Resources/app/node_modules/etch/lib/patch.js:18:15)
    at Object.updateSync (/Applications/Atom.app/Contents/Resources/app/node_modules/etch/lib/component-helpers.js:108:26)
    at LineNumberGutterComponent.update (/Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:3029:18)
    at updateComponent (/Applications/Atom.app/Contents/Resources/app/node_modules/etch/lib/patch.js:52:19)
    at patch (/Applications/Atom.app/Contents/Resources/app/node_modules/etch/lib/patch.js:16:25)
    at updateChildren (/Applications/Atom.app/Contents/Resources/app/node_modules/etch/lib/patch.js:77:13)
    at patch (/Applications/Atom.app/Contents/Resources/app/node_modules/etch/lib/patch.js:18:15)
    at updateChildren (/Applications/Atom.app/Contents/Resources/app/node_modules/etch/lib/patch.js:77:13)
    at patch (/Applications/Atom.app/Contents/Resources/app/node_modules/etch/lib/patch.js:18:15)
    at Object.updateSync (/Applications/Atom.app/Contents/Resources/app/node_modules/etch/lib/component-helpers.js:108:26)
    at GutterContainerComponent.update (/Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:2920:18)
    at updateComponent (/Applications/Atom.app/Contents/Resources/app/node_modules/etch/lib/patch.js:52:19)
    at patch (/Applications/Atom.app/Contents/Resources/app/node_modules/etch/lib/patch.js:16:25)
    at updateChildren (/Applications/Atom.app/Contents/Resources/app/node_modules/etch/lib/patch.js:77:13)
    at patch (/Applications/Atom.app/Contents/Resources/app/node_modules/etch/lib/patch.js:18:15)
    at updateChildren (/Applications/Atom.app/Contents/Resources/app/node_modules/etch/lib/patch.js:77:13)
    at patch (/Applications/Atom.app/Contents/Resources/app/node_modules/etch/lib/patch.js:18:15)
    at Object.updateSync (/Applications/Atom.app/Contents/Resources/app/node_modules/etch/lib/component-helpers.js:108:26)
    at TextEditorComponent.updateSyncBeforeMeasuringContent (/Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:369:16)
    at TextEditorComponent.updateSync (/Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:266:16)
    at etch.getScheduler.updateDocument (/Applications/Atom.app/Contents/Resources/app/src/text-editor-component.js:220:46)
    at ViewRegistry.module.exports.ViewRegistry.performDocumentUpdate (/Applications/Atom.app/Contents/Resources/app/src/view-registry.js:187:15)
    at /Applications/Atom.app/Contents/Resources/app/src/view-registry.js:3:65

Commands

     -1:53.5.0 core:confirm (input.hidden-input)
     -1:53.5.0 editor:toggle-line-numbers (atom-text-editor.editor.vim-mode-plus.normal-mode)
     -1:51.3.0 vim-mode-plus-ex-mode:toggle-setting (input.hidden-input)
     -1:50 core:confirm (input.hidden-input)
     -1:50 editor:toggle-line-numbers (atom-text-editor.editor.vim-mode-plus.normal-mode)
     -0:52.7.0 core:backspace (input.hidden-input)
     -0:48.4.0 vim-mode-plus-ex-mode:toggle-setting (input.hidden-input)
     -0:46.8.0 editor:consolidate-selections (input.hidden-input)
     -0:46.8.0 core:cancel (input.hidden-input)
     -0:44.2.0 vim-mode-plus-ex-mode:toggle-setting (input.hidden-input)
     -0:43.1.0 core:confirm (input.hidden-input)
     -0:43.1.0 editor:toggle-line-numbers (atom-text-editor.editor.vim-mode-plus.normal-mode)
     -0:35.8.0 vim-mode-plus-ex-mode:toggle-setting (input.hidden-input)
  2x -0:34.7.0 core:backspace (input.hidden-input)
     -0:33.1.0 core:confirm (input.hidden-input)
     -0:33.1.0 editor:toggle-line-numbers (atom-text-editor.editor.vim-mode-plus.normal-mode)

Non-Core Packages

advanced-open-file 0.16.6 
atom-beautify 0.30.4 
atom-debugger 0.1.6 
atom-fuzzy-grep 0.16.0 
atom-handlebars 1.3.0 
atom-jinja2 0.6.0 
atom-keyboard-macros-vim 0.1.6 
atom-lupa 0.7.40 
atom-typescript 11.0.6 
atomic-chrome 0.3.2 
autocomplete-emojis 2.5.0 
autocomplete-paths 1.0.5 
blame 0.12.0 
bug-report 0.7.1 
busy-signal 1.4.3 
character-table 0.4.3 
choose-pane 0.7.0 
color-picker 2.2.5 
cursor-history 0.12.0 
dash 1.7.1 
docblockr 0.11.0 
editorconfig 2.2.2 
elm-format 2.2.0 
elmjutsu 5.6.2 
file-icons 2.1.10 
flow-ide 1.8.1 
git-plus 7.9.3 
gitignore-snippets 0.2.5 
grammar-token-limit 0.1.1 
graphviz-preview-plus 1.4.3 
haskell-grammar 0.4.0 
highlight-selected 0.13.1 
html-to-elm 0.2.0 
hyperclick 0.1.3 
indentation-indicator 1.1.0 
intentions 1.1.5 
js-hyperclick 1.11.0 
jumpy 3.1.3 
keybinding-cheatsheet 0.1.1 
language-ansible 0.2.1 
language-babel 2.70.2 
language-docker 1.1.8 
language-dot 1.7.0 
language-dotfiles 1.1.0 
language-elm 1.5.0 
language-env 0.2.0 
language-fish-shell 1.0.5 
language-graphql 0.9.0 
language-hugo 0.3.1 
language-ini 1.19.0 
language-latex 1.1.0 
language-lua 0.9.11 
language-nimrod 0.1.0 
language-ocaml 1.9.5 
language-reason 0.0.3 
language-rust 0.4.12 
language-swift 0.5.0 
language-thrift 1.0.2 
linter 2.2.0 
linter-alex 4.0.0 
linter-coffeelint 1.2.1 
linter-elm-make 0.23.7 
linter-eslint 8.2.1 
linter-js-yaml 1.2.7 
linter-markdown 5.1.0 
linter-refmt 0.3.1 
linter-rust 0.8.0 
linter-shellcheck 1.4.4 
linter-tslint 1.7.0 
linter-ui-default 1.6.4 
markdown-preview-plus 2.4.10 
maximize-panes 0.2.0 
merge-conflicts 1.4.5 
narrow 0.50.3 
nix 2.1.0 
nuclide 0.244.0 
nuclide-format-js 0.0.41 
ocaml-merlin 0.14.4 
one-tab 0.10.0 
open-on-bitbucket 0.5.0 
open-this 0.4.0 
package-cop 0.2.10 
package-sync 1.1.0 
pdf-view 0.59.0 
pigments 0.40.2 
platformio-ide-terminal 2.5.5 
prettier-atom 0.37.0 
project-folder 1.5.0 
racer 0.20.0 
reason-refmt 0.3.2 
regex-railroad-diagram 0.19.3 
relative-numbers 0.8.0 
rustfmt 0.1.3 
set-syntax 0.3.2 
sort-lines 0.14.0 
split-diff 1.4.3 
standardjs-snippets 2.6.0 
tabs-to-spaces 1.0.3 
tool-bar 1.1.0 
vim-mode-plus 0.96.2 
vim-mode-plus-ex-mode 0.9.1 
vim-mode-plus-project-find-from-search 0.2.0 

Update: removed mention of vim-mode-plus which has nothing to do with this.

t9md commented 7 years ago

@despairblue you should update issue description for explicitness, vim-mode-plus is irrelevant.

  1. open text editor.
  2. execute Toggle Line Numbers from command palette.
  3. execute Toggle Line Numbers again.

I'm not sure cause is Atom-core or logic of this package, haven't investigated by my side.

despairblue commented 7 years ago

@t9md You're right. I somehow assumed hiding the line numbers via ! was a vim-mode-plus functionality. My bad.

Thanks for your work, you're awesome!