kstenschke / shifter-plugin

Intelligent string/code manipulation plugin for Jetbrains IDEs: Detects shiftable type of word/line/selection and manipulates it on keyboard shortcut
http://plugins.jetbrains.com/plugin/6149
Apache License 2.0
105 stars 13 forks source link

Incorrect behaviour while shifting pixel values #3

Closed markusha closed 11 years ago

markusha commented 11 years ago

I've noticed some buggy behaviour while dealing with negative pixel values. How to reproduce:

  1. In a css file create some element rule with the property with positive pixel value (e.g. body { margin: 10px; }).
  2. Start decreasing this value with the Shift-down hotkey.
  3. When the value reaches "-1px" you'll notice some buggy behaviour, i. e. while pressing the Shift-down hotkey the sequence of values will be "-1px", "-0px", "--1px", "--0px", "---1px" and so on.
bazzik commented 11 years ago

Got the same behaviour. A bit annoying when working with values close to 0 -- I can easily add few - (minuses) accidentally (most likely it's because I'm using default shortcut .. and pressing correct 4 keys simultaneously is a bit hard for me).

kstenschke commented 11 years ago

Shifting of negative numeric and CSS length values is now supported with version 1.1.2

Though i am quite used to the pressing of the 4 keys- what's your suggestions for a better key combo?

bazzik commented 11 years ago

Thanks for fixing it!

Yeah -- I'm also pressing 4 keys one-by-one actually (Ctrl+Shift+Alt+< / > -- in that order). It's just whole 4 keys to press, which is not convenient.

For myself I have changed it to Alt+PageUp / PageDown. Can also be Alt+Numpad + / Alt + Numpad - (convenient if you are using that area to enter digits), but

BTW I wonder if you can confirm if this is expected behaviour or a bug. PHP file:

<?php
$a = 'abbra cadabra 22!';

Try to decrement 22. I would expect to see 21, 20, 19 etc .. but instead I've got 11, 00, // and then it stops. When incrementing it: 33, 44, 55, 66, 77, 88, 99, :: and then it stops (no more incrementing/decrementing is possible).

kstenschke commented 11 years ago

Andriy, thank you again for reporting that issue.

This was a bug, caused by the wrong order of priorities among the many different types of magically detected shiftable strings (there's a type "mono-character string" which shifts e.g. '------' to '......'. It had precedence over numeric shiftable values by mistake).

With version 1.1.2 also this is fixed.