usernamehw / vscode-incrementor

Advanced increment / decrement actions for (almost) anything.
https://marketplace.visualstudio.com/items?itemName=usernamehw.incrementor
MIT License
3 stars 1 forks source link

Enums in dashed strings #2

Closed usernamehw closed 4 years ago

usernamehw commented 4 years ago

Taken from original repo

I have setup a new enum that would be really useful for CSS box model properties:

[
    "top",
    "right",
    "bottom",
    "left"
]

It works only if used in directly matching properties like:

.someClass {
    position: relative;
    top: 3px;
}

Putting the cursor on the top property, and hitting the shortcut will cycle as expected. However I would love if it could work for the other ton of css properties that have these positional properties in their name. Here are some examples:

.someClass {
    border-bottom: 1px solid black;
    margin-left: 5px;
    padding-right: 10px;
    ...
}

There are loads of these and it would be super useful to be able to quickly switch the direction using your extension.

From what I read, an enum value cannot start with a - so it means I can't create another enum like so:

[
    "-top",
    "-right",
    "-bottom",
    "-left"
]
usernamehw commented 4 years ago

Fixed by 96655b03594a30acdcf477daa8f296da88c57ef2