Skip to content

Commit dace7b8

Browse files
committed
fix: problem should hover along with number dials if both present
1 parent 99ce468 commit dace7b8

File tree

5 files changed

+81
-32
lines changed

5 files changed

+81
-32
lines changed

src/extensions/default/QuickView/numberPreviewProvider.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -203,19 +203,20 @@ define(function (require, exports, module) {
203203

204204
function filterQuickView(popovers){
205205
// rgb(10 , 100, 20), hover over these kind of numbers should open color quick view if present over number view
206-
let numberQuickView, colorQuickView;
206+
let hasColorQuickView = false;
207207
for(let popover of popovers){
208-
if(popover.providerInfo.provider.QUICK_VIEW_NAME === exports.QUICK_VIEW_NAME){
209-
numberQuickView = popover;
210-
} else if(popover.providerInfo.provider.QUICK_VIEW_NAME === colorGradientProvider.QUICK_VIEW_NAME){
211-
colorQuickView = popover;
208+
if(popover.providerInfo.provider.QUICK_VIEW_NAME === colorGradientProvider.QUICK_VIEW_NAME){
209+
hasColorQuickView = true;
210+
break;
212211
}
213212
}
214-
if(colorQuickView){
215-
return [colorQuickView];
213+
if(hasColorQuickView){
214+
popovers = popovers.filter((popover) => {
215+
return popover.providerInfo.provider.QUICK_VIEW_NAME !== exports.QUICK_VIEW_NAME;
216+
});
216217
}
217218

218-
return [numberQuickView] || popovers;
219+
return popovers;
219220
}
220221

221222
prefs.on("change", PREF_ENABLED_KEY, function () {

src/features/QuickViewManager.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,8 @@ define(function (require, exports, module) {
363363
content: $("<div id='quick-view-popover-root'></div>")
364364
};
365365
// Each provider return popover { start, end, content}
366-
for(let result of popoverResults){
366+
for(let i=0; i<popoverResults.length; i++) {
367+
const result = popoverResults[i];
367368
if(_isResultBeforePopoverStart(editor, popover, result)){
368369
popover.start = result.start;
369370
}
@@ -373,7 +374,11 @@ define(function (require, exports, module) {
373374
if(result.editsDoc){
374375
popover.editsDoc = true;
375376
}
376-
popover.content.append(result.content);
377+
let cssClass = `class='quick-view-partition'`;
378+
if(i === (popoverResults.length - 1)) {
379+
cssClass = "";
380+
}
381+
popover.content.append($(`<div ${cssClass} ></div>`).append(result.content));
377382
}
378383

379384
let startCoord = editor.charCoords(popover.start),

src/language/CodeInspection.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,8 +532,6 @@ define(function (require, exports, module) {
532532
for (let resultProvider of resultProviderEntries) {
533533
let errors = (resultProvider.result && resultProvider.result.errors) || [];
534534
for (let error of errors) {
535-
// todo: add error.message on hover
536-
// add gutter markers
537535
let line = error.pos.line || 0;
538536
let ch = error.pos.ch || 0;
539537
let gutterMessage = gutterErrorMessages[line] || [];

src/styles/brackets.less

Lines changed: 61 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -152,35 +152,67 @@ html, body {
152152
}
153153

154154
.editor-text-fragment-error{
155-
text-decoration-style: wavy;
156-
text-decoration-line: underline;
157-
text-decoration-color: @error-underline-text;
158-
text-decoration-thickness: 1px;
159-
text-decoration-skip-ink: none;
155+
border-bottom:2px dotted @error-underline-text;
156+
display: inline-block;
157+
position: relative;
158+
}
159+
160+
.editor-text-fragment-error:after{
161+
content: '';
162+
width: 100%;
163+
border-bottom:2px dotted @error-underline-text;
164+
position: absolute;
165+
display:block;
166+
bottom: -3px;
167+
left: 2px;
160168
}
161169

162170
.editor-text-fragment-warn{
163-
text-decoration-style: wavy;
164-
text-decoration-line: underline;
165-
text-decoration-color: @warn-underline-text;
166-
text-decoration-thickness: 1px;
167-
text-decoration-skip-ink: none;
171+
border-bottom:2px dotted @warn-underline-text;
172+
display: inline-block;
173+
position: relative;
174+
}
175+
176+
.editor-text-fragment-warn:after{
177+
content: '';
178+
width: 100%;
179+
border-bottom:2px dotted @warn-underline-text;
180+
position: absolute;
181+
display:block;
182+
bottom: -3px;
183+
left: 2px;
168184
}
169185

170186
.editor-text-fragment-info{
171-
text-decoration-style: dashed;
172-
text-decoration-line: underline;
173-
text-decoration-color: @info-underline-text;
174-
text-decoration-thickness: 1px;
175-
text-decoration-skip-ink: none;
187+
border-bottom:2px dotted @info-underline-text;
188+
display: inline-block;
189+
position: relative;
190+
}
191+
192+
.editor-text-fragment-info:after{
193+
content: '';
194+
width: 100%;
195+
border-bottom:2px dotted @info-underline-text;
196+
position: absolute;
197+
display:block;
198+
bottom: -3px;
199+
left: 2px;
176200
}
177201

178202
.editor-text-fragment-spell-error{
179-
text-decoration-style: wavy;
180-
text-decoration-line: underline;
181-
text-decoration-color: @spell-underline-text;
182-
text-decoration-thickness: 1px;
183-
text-decoration-skip-ink: none;
203+
border-bottom:2px dotted @spell-underline-text;
204+
display: inline-block;
205+
position: relative;
206+
}
207+
208+
.editor-text-fragment-spell-error:after{
209+
content: '';
210+
width: 100%;
211+
border-bottom:2px dotted @spell-underline-text;
212+
position: absolute;
213+
display:block;
214+
bottom: -3px;
215+
left: 2px;
184216
}
185217

186218
.hidden-element{
@@ -1940,6 +1972,15 @@ a, img {
19401972
}
19411973
}
19421974

1975+
.quick-view-partition {
1976+
border-bottom: 2px solid @bc-quick-view-separator;
1977+
.dark & {
1978+
border-bottom: 2px solid @dark-bc-quick-view-separator;
1979+
}
1980+
padding-bottom: 5px;
1981+
margin-bottom: 5px;
1982+
}
1983+
19431984
#quick-view-container.active {
19441985
transform: scale(1);
19451986
opacity: 1;

src/styles/brackets_core_ui_variables.less

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@
147147
@bc-codehint-desc-type-details: #1473e6;
148148
@bc-codehint-desc-documentation:#424242;
149149

150+
// quick view
151+
@bc-quick-view-separator: #c3c6c5;
152+
@dark-bc-quick-view-separator: #505050;
153+
150154
/* Dark Core UI variables -----------------------------------------------------------------------------*/
151155

152156
// General

0 commit comments

Comments
 (0)