Closed philgyford closed 6 years ago
Interesting issue. At this point, I can't decide whether this is bug of vmp or atom itself. Btw, I haven't experienced it.
I frequently toggle invisible chars while editing via shortcut invoking custom toggle-invisible
command in init.js
.
Of course I tried clicking to toggle this setting from settings > editor menu this time. But have no issue, can hide/show invisible special characters.
I'm really interesting what behavior of vmp startup can break showInvisibles feature.
Did you tried with default syntax theme? what syntax theme you use?
Aha, init.js
! I'd forgotten all about that...
It turns out I had the below in my init.coffee
, and something about that was preventing this setting from working. Judging by current instructions this is outdated now.
######################################################################
# Extending vim-mode-plus
# General service consumer function
# From https://github.com/t9md/atom-vim-mode-plus/wiki/ExtendVimModePlusInInitFile#overview
consumeService = (packageName, providerName, fn) ->
if atom.packages.isPackageActive(packageName)
pack = atom.packages.getActivePackage(packageName)
fn(pack.mainModule[providerName]())
else
disposable = atom.packages.onDidActivatePackage (pack) ->
if pack.name is packageName
disposable.dispose()
fn(pack.mainModule[providerName]())
# In vim-mode-plus, stop `d` putting the delete text on the clipboard.
# Add this to keymap too:
# 'atom-text-editor.vim-mode-plus:not(.insert-mode)':
# '\\ d': 'vim-mode-plus-user:delete-with-backhole-register'
# From https://github.com/t9md/atom-vim-mode-plus/wiki/ExtendVimModePlusInInitFile#advanced-deletewithbackholeregister
consumeService 'vim-mode-plus', 'provideVimModePlus', (service) ->
{Base} = service
Delete = Base.getClass('Delete')
class DeleteWithBackholeRegister extends Delete
@commandPrefix: 'vim-mode-plus-user'
@registerCommand()
execute: ->
@vimState.register.name = "_"
super
I can't get the newer version of DeleteWithBackholeRegister working - I get 'Unexpected token .' with it in my init.js
, but that's a different problem!
If I:
Then the 'Show Invisibles' option in Settings > Editor works as expected - invisible characters appear and disappear. If I enable vim-mode-plus at this point, 'Show Invisibles' still works.
But, if I:
Then the 'Show Invisibles' option has no effect. If invisible characters are currently visible, they remain visible no matter how I change the setting. And if they're currently invisible, they remain invisible. If I disable vim-mode-plus at this point then 'Show Invisibles' still no longer works.
vim-mode-plus version: 1.26.0