Skip to content

Commit

Permalink
fix: apply padding to right side multi-line markers (#5636)
Browse files Browse the repository at this point in the history
  • Loading branch information
akoreman authored Aug 30, 2024
1 parent a6ead2f commit c7549aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/layer/marker.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ class Marker {
} else {
this.elt(
clazz + " ace_br1 ace_start",
"height:"+ height+ "px;"+ "right:0;"+ "top:"+top+ "px;left:"+ left+ "px;" + (extraStyle || "")
"height:"+ height+ "px;"+ "right:" + padding + "px;"+ "top:"+top+ "px;left:"+ left+ "px;" + (extraStyle || "")
);
}
// from start of the last line to the selection end
Expand Down Expand Up @@ -197,7 +197,7 @@ class Marker {
this.elt(
clazz + (radiusClass ? " ace_br" + radiusClass : ""),
"height:"+ height+ "px;"+
"right:0;"+
"right:" + padding + "px;"+
"top:"+ top+ "px;"+
"left:"+ padding+ "px;"+ (extraStyle || "")
);
Expand Down
4 changes: 2 additions & 2 deletions src/marker_group_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@ module.exports = {
assert.equal(markerSize.height, lineHeight);
// Should start at the 13th character (including 4px offset)
assert.equal(markerSize.left, 12 * characterWidth + 4);
// Shoud be as wide as the marker layer - 12 characters and the offset.
assert.equal(markerSize.width, editor.renderer.$markerBack.element.getBoundingClientRect().width - 12 * characterWidth - 4);
// Shoud be as wide as the marker layer - 12 characters and the offset on both sides.
assert.equal(markerSize.width, editor.renderer.$markerBack.element.getBoundingClientRect().width - 12 * characterWidth - 4 - 4);
},
"test: should default to markers of text type": function() {
editor.resize(true);
Expand Down

0 comments on commit c7549aa

Please sign in to comment.