Menu

#1811 Lua: MarginLeft and MarginRight broken

Bug
open-accepted
3
2016-02-21
2016-02-20
No

Here is a simple test script to run in SciTE

print("Left " .. editor.MarginLeft)
editor.MarginLeft = 12
print("Left " .. editor.MarginLeft)

print("Right " .. editor.MarginRight)
editor.MarginRight = 12
print("Right " .. editor.MarginRight)

Both the margins are 1 (which is the default value) and then after being set, their values are 0. Visully you can also tell the left margin changes from 1 to 0.

It appears it is due to the way they are defined in IFaceTable.cxx. They are:

{"MarginLeft", 2156, 2155, iface_int, iface_void}
{"MarginRight", 2158, 2157, iface_int, iface_void}

However they actually defined as taking "<unused>, int pixels". These seem to be the only properties that carry their values in the 2nd parameter rather than the first.

Discussion

  • Neil Hodgson

    Neil Hodgson - 2016-02-21
    • labels: --> scite, script
    • status: open --> open-accepted
    • assigned_to: Neil Hodgson
    • Priority: 5 --> 3
     
  • Neil Hodgson

    Neil Hodgson - 2016-02-21

    Reversing the order in the IFaceTable entry is not sufficient to fix this. Support would have to be added for properties that use lParam for setting. Since 3 of the 4 margins can be set with the *blank.margin* properties, this is a low priority issue.

     
  • Justin Dailey

    Justin Dailey - 2016-02-21

    Yeah it's a bit of a corner case, so not a big deal

     

Log in to post a comment.

MongoDB Logo MongoDB