Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: apply padding to right side multi-line markers #5636

Merged
merged 1 commit into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading