Skip to content

Commit 22e4025

Browse files
devvaannshabose
authored andcommitted
fix: give max-width to emmet for html so that it doesn't cover up the whole screen
1 parent 7b125ae commit 22e4025

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

src/extensions/default/HTMLCodeHints/main.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,20 @@ define(function (require, exports, module) {
143143
* @returns {jQuery} - A jQuery element representing the formatted hint.
144144
*/
145145
function formatEmmetHint(abbr) {
146-
// Create the main container for the hint text.
146+
// Create the main container for the hint
147147
var $hint = $("<span>")
148-
.addClass("emmet-hint")
148+
.addClass("emmet-hint");
149+
150+
// Create a wrapper for the text content
151+
var $textContent = $("<span>")
152+
.addClass("emmet-text-content")
149153
.text(abbr);
150154

151155
// style in brackets_patterns_override.less file
152156
let $icon = $(`<span class="emmet-code-hint">Emmet</span>`);
153157

154-
// Append the icon to the hint element
158+
// Append both text content and icon to the main container
159+
$hint.append($textContent);
155160
$hint.append($icon);
156161

157162
return $hint;

src/styles/brackets_patterns_override.less

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,7 +602,9 @@ a:focus {
602602
.dropdown-menu {
603603
box-shadow: 0 3px 9px @bc-shadow;
604604
max-height: 160px;
605+
max-width: 400px;
605606
overflow-y: auto;
607+
overflow-x: hidden;
606608
padding: 0;
607609

608610
.dark & {
@@ -748,6 +750,16 @@ a:focus {
748750
margin-right: 48px !important;
749751
}
750752

753+
.emmet-text-content {
754+
display: inline-block;
755+
max-width: 320px;
756+
overflow: hidden;
757+
text-overflow: ellipsis;
758+
white-space: nowrap;
759+
vertical-align: top;
760+
line-height: inherit;
761+
}
762+
751763
#codehint-desc {
752764
background: @bc-codehint-desc;
753765
position: absolute;

0 commit comments

Comments
 (0)