Skip to content

Commit c7549aa

Browse files
authored
fix: apply padding to right side multi-line markers (#5636)
1 parent a6ead2f commit c7549aa

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/layer/marker.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ class Marker {
165165
} else {
166166
this.elt(
167167
clazz + " ace_br1 ace_start",
168-
"height:"+ height+ "px;"+ "right:0;"+ "top:"+top+ "px;left:"+ left+ "px;" + (extraStyle || "")
168+
"height:"+ height+ "px;"+ "right:" + padding + "px;"+ "top:"+top+ "px;left:"+ left+ "px;" + (extraStyle || "")
169169
);
170170
}
171171
// from start of the last line to the selection end
@@ -197,7 +197,7 @@ class Marker {
197197
this.elt(
198198
clazz + (radiusClass ? " ace_br" + radiusClass : ""),
199199
"height:"+ height+ "px;"+
200-
"right:0;"+
200+
"right:" + padding + "px;"+
201201
"top:"+ top+ "px;"+
202202
"left:"+ padding+ "px;"+ (extraStyle || "")
203203
);

src/marker_group_test.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ module.exports = {
114114
assert.equal(markerSize.height, lineHeight);
115115
// Should start at the 13th character (including 4px offset)
116116
assert.equal(markerSize.left, 12 * characterWidth + 4);
117-
// Shoud be as wide as the marker layer - 12 characters and the offset.
118-
assert.equal(markerSize.width, editor.renderer.$markerBack.element.getBoundingClientRect().width - 12 * characterWidth - 4);
117+
// Shoud be as wide as the marker layer - 12 characters and the offset on both sides.
118+
assert.equal(markerSize.width, editor.renderer.$markerBack.element.getBoundingClientRect().width - 12 * characterWidth - 4 - 4);
119119
},
120120
"test: should default to markers of text type": function() {
121121
editor.resize(true);

0 commit comments

Comments
 (0)