]> git.gir.st - VimFx.git/commit
Fix a `z-index` bug for markers with the same hint
authorSimon Lydell <simon.lydell@gmail.com>
Sat, 20 Feb 2016 08:35:11 +0000 (09:35 +0100)
committerSimon Lydell <simon.lydell@gmail.com>
Sat, 20 Feb 2016 08:45:13 +0000 (09:45 +0100)
commit82db663729437b8fae9809893e3079972a49fc93
treef81c437b4055fb7a3ea4b940518928e2e924dcb7
parent26696f709def16a7ccc1a18e62ec342f310326d5
Fix a `z-index` bug for markers with the same hint

Regression since commit 1176cde8.

- `element.style.zIndex`: Always string.
- `element.style.zIndex = value`: Turns `value` into a string.
- `a = '5'; a++`: `a` is now `6`.
- `element.style.zIndex++`: If the previous value was `'5'`, the new value is
  `'6'`. This method was used before above commit.
- `element.style.zIndex += 1`: If the previous value was `'5'`, the new value is
  `'51'`. This was introduced by above commit.

The above really shows that you should always be explicit about types. Since
`element.style.zIndex` is always a string, `element.style.zIndex++` was a
terrible hack that happened to work, but caused a bug when it was rewritten to
a seemingly equivalent expression.

This commit first reads the `z-index` of the element and explicitly makes it a
`Number`, allowing incrementing to work as expected.
extension/lib/hints.coffee
Imprint / Impressum