File tree Expand file tree Collapse file tree
src/vs/workbench/services/hover/browser Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import { HoverWidget as BaseHoverWidget, renderHoverAction } from 'vs/base/brows
1616import { Widget } from 'vs/base/browser/ui/widget' ;
1717import { AnchorPosition } from 'vs/base/browser/ui/contextview/contextview' ;
1818import { IOpenerService } from 'vs/platform/opener/common/opener' ;
19+ import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService' ;
1920
2021const $ = dom . $ ;
2122
@@ -48,7 +49,8 @@ export class HoverWidget extends Widget {
4849 options : IHoverOptions ,
4950 @IKeybindingService private readonly _keybindingService : IKeybindingService ,
5051 @IConfigurationService private readonly _configurationService : IConfigurationService ,
51- @IOpenerService private readonly _openerService : IOpenerService
52+ @IOpenerService private readonly _openerService : IOpenerService ,
53+ @IWorkbenchLayoutService private readonly _workbenchLayoutService : IWorkbenchLayoutService ,
5254 ) {
5355 super ( ) ;
5456
@@ -141,7 +143,7 @@ export class HoverWidget extends Widget {
141143 // Get horizontal alignment and position
142144 let targetLeft = this . _target . x !== undefined ? this . _target . x : Math . min ( ...targetBounds . map ( e => e . left ) ) ;
143145 if ( targetLeft + this . _hover . containerDomNode . clientWidth >= document . documentElement . clientWidth ) {
144- this . _x = document . documentElement . clientWidth - 1 ;
146+ this . _x = document . documentElement . clientWidth - ( this . _workbenchLayoutService . hasWindowBorder ( ) ? 3 : 1 ) ;
145147 this . _hover . containerDomNode . classList . add ( 'right-aligned' ) ;
146148 } else {
147149 this . _x = targetLeft ;
You can’t perform that action at this time.
0 commit comments