mirror of
https://github.com/atom/atom.git
synced 2026-01-24 22:38:20 -05:00
Add static TextEditor.viewForOverlayItem method to avoid using global
This commit is contained in:
committed by
Antonio Scandurra
parent
5297e7ab1a
commit
1676617218
@@ -58,6 +58,7 @@ if global.isGeneratingSnapshot
|
||||
|
||||
clipboard = new Clipboard
|
||||
TextEditor.setClipboard(clipboard)
|
||||
TextEditor.viewForOverlayItem = (item) -> atom.views.getView(item)
|
||||
|
||||
global.atom = new AtomEnvironment({
|
||||
clipboard,
|
||||
|
||||
@@ -54,6 +54,7 @@ export default async function () {
|
||||
|
||||
const clipboard = new Clipboard()
|
||||
TextEditor.setClipboard(clipboard)
|
||||
TextEditor.viewForOverlayItem = (item) -> atom.views.getView(item)
|
||||
|
||||
const applicationDelegate = new ApplicationDelegate()
|
||||
const environmentParams = {
|
||||
|
||||
@@ -70,6 +70,7 @@ module.exports = ({blobStore}) ->
|
||||
|
||||
clipboard = new Clipboard
|
||||
TextEditor.setClipboard(clipboard)
|
||||
TextEditor.viewForOverlayItem = (item) -> atom.views.getView(item)
|
||||
|
||||
testRunner = require(testRunnerPath)
|
||||
legacyTestRunner = require(legacyTestRunnerPath)
|
||||
|
||||
@@ -732,7 +732,7 @@ class TextEditorComponent {
|
||||
|
||||
addOverlayDecorationToRender (decoration, marker) {
|
||||
const {class: className, item, position, avoidOverflow} = decoration
|
||||
const element = atom.views.getView(item)
|
||||
const element = TextEditor.viewForOverlayItem(item)
|
||||
const screenPosition = (position === 'tail')
|
||||
? marker.getTailScreenPosition()
|
||||
: marker.getHeadScreenPosition()
|
||||
|
||||
@@ -65,6 +65,8 @@ class TextEditor extends Model
|
||||
TextEditorComponent ?= require './text-editor-component'
|
||||
TextEditorComponent.didUpdateScrollbarStyles()
|
||||
|
||||
@viewForOverlayItem: (item) -> item
|
||||
|
||||
serializationVersion: 1
|
||||
|
||||
buffer: null
|
||||
|
||||
Reference in New Issue
Block a user