t9md / atom-vim-mode-plus

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

search-current-word no longer respecting editor word boundaries #1008

Closed bennypowers closed 6 years ago

bennypowers commented 6 years ago

Check list

You have to check all before open issue.

Atom : 1.23.1 Electron: 1.6.15 Chrome : 56.0.2924.87 Node : 7.4.0

macOS High Sierra 10.13.2

VMP 1.24.4

I use atom's default word boundaries, including -.

In previous version of VMP, hitting * on a word-inside-hyphens would move to the next word.

I will illustrate previous behaviour with [s] to represent the normal-mode cursor over the s char.

word-in[s]ide-hyphens word inside hyphens word-inside-hyphens

// press *

word-inside-hyphens word [inside] hyphens word-inside-hyphens

// press *

word-inside-hyphens word inside hyphens word-[inside]-hyphens

Current behaviour:

word-in[s]ide-hyphens word inside hyphens word-inside-hyphens

// press *

word-inside-hyphens word inside hyphens [word-inside-hyphens]

// press *

[word-inside-hyphens] word inside hyphens word-inside-hyphens

I would like * to respect word boundaries again.

This also affect commands like c o i l

My use-case is searching for terms in dash prefixed customElement names, like

  <link rel="lazy-import" href="./pages/eve-terms/eve-terms.html" group="terms">
  <script>
    this.importLazyGroup('terms')
  </script>

I should note the it would also be useful to have both behaviours, e.g. for transforming the first line below to the second

<link rel="import" href="../../../bower_components/iron-form/iron-form.html">
<link rel="import" href="../../../bower_components/paper-input/paper-input.html">

Thank you for the awesome plugin. It makes a huge difference to my daily work.

t9md commented 6 years ago

OK I could reproduce it. I haven't changed that code in recent release. So it still works in grammar like markdown, javascript.

But at least I could reproduce this issue in HTML grammar.

I believe what have changed is HTML grammar's nonWordCharacters definition.

t9md commented 6 years ago

To be clear

I technically make this behavior grammar independent( I thinks which is the behavior you want ). But priority is not high, I'm working on different project now and it's more important for me than this issue .

bennypowers commented 6 years ago

Thanks for looking into it, I appreciate your diagnosis. Sounds like I might be able to override the new defaults in config. Will post if I succeed