mirror of
https://github.com/atom/atom.git
synced 2026-02-16 17:45:24 -05:00
Resolve references to Internal
This commit is contained in:
@@ -5,13 +5,13 @@ Theme = require 'theme'
|
||||
module.exports =
|
||||
class AtomTheme extends Theme
|
||||
|
||||
# Internal: Given a path, this loads it as a stylesheet.
|
||||
# Given a path, this loads it as a stylesheet.
|
||||
#
|
||||
# stylesheetPath - A {String} to a stylesheet
|
||||
loadStylesheet: (stylesheetPath)->
|
||||
@stylesheets[stylesheetPath] = window.loadStylesheet(stylesheetPath)
|
||||
|
||||
# Internal: Loads the stylesheets found in a `package.cson` file.
|
||||
# Loads the stylesheets found in a `package.cson` file.
|
||||
load: ->
|
||||
if fsUtils.extension(@path) in ['.css', '.less']
|
||||
@loadStylesheet(@path)
|
||||
|
||||
@@ -232,7 +232,7 @@ class EditSession
|
||||
newIndentString = @buildIndentString(newLevel)
|
||||
@buffer.change([[bufferRow, 0], [bufferRow, currentIndentString.length]], newIndentString)
|
||||
|
||||
# Internal: Given a line, this gets the indentation level.
|
||||
# Given a line, this retrieves the indentation level.
|
||||
#
|
||||
# line - A {String} in the current {Buffer}.
|
||||
#
|
||||
@@ -246,7 +246,7 @@ class EditSession
|
||||
else
|
||||
0
|
||||
|
||||
# Internal: Constructs the string used for tabs.
|
||||
# Constructs the string used for tabs.
|
||||
buildIndentString: (number) ->
|
||||
if @softTabs
|
||||
_.multiplyString(" ", number * @getTabLength())
|
||||
|
||||
@@ -353,7 +353,7 @@ class Editor extends View
|
||||
|
||||
# {Delegates to: EditSession.selectToScreenPosition}
|
||||
selectToScreenPosition: (position) -> @activeEditSession.selectToScreenPosition(position)
|
||||
|
||||
|
||||
# {Delegates to: EditSession.transpose}
|
||||
transpose: -> @activeEditSession.transpose()
|
||||
|
||||
@@ -681,7 +681,6 @@ class Editor extends View
|
||||
@activeEditSession.finalizeSelections()
|
||||
@syncCursorAnimations()
|
||||
|
||||
|
||||
afterAttach: (onDom) ->
|
||||
return unless onDom
|
||||
@redraw() if @redrawOnReattach
|
||||
@@ -820,43 +819,6 @@ class Editor extends View
|
||||
@scrollVertically(pixelPosition, options)
|
||||
@scrollHorizontally(pixelPosition)
|
||||
|
||||
# Internal: Scrolls the editor vertically to a given position.
|
||||
scrollVertically: (pixelPosition, {center}={}) ->
|
||||
scrollViewHeight = @scrollView.height()
|
||||
scrollTop = @scrollTop()
|
||||
scrollBottom = scrollTop + scrollViewHeight
|
||||
|
||||
if center
|
||||
unless scrollTop < pixelPosition.top < scrollBottom
|
||||
@scrollTop(pixelPosition.top - (scrollViewHeight / 2))
|
||||
else
|
||||
linesInView = @scrollView.height() / @lineHeight
|
||||
maxScrollMargin = Math.floor((linesInView - 1) / 2)
|
||||
scrollMargin = Math.min(@vScrollMargin, maxScrollMargin)
|
||||
margin = scrollMargin * @lineHeight
|
||||
desiredTop = pixelPosition.top - margin
|
||||
desiredBottom = pixelPosition.top + @lineHeight + margin
|
||||
if desiredBottom > scrollBottom
|
||||
@scrollTop(desiredBottom - scrollViewHeight)
|
||||
else if desiredTop < scrollTop
|
||||
@scrollTop(desiredTop)
|
||||
|
||||
# Internal: Scrolls the editor horizontally to a given position.
|
||||
scrollHorizontally: (pixelPosition) ->
|
||||
return if @activeEditSession.getSoftWrap()
|
||||
|
||||
charsInView = @scrollView.width() / @charWidth
|
||||
maxScrollMargin = Math.floor((charsInView - 1) / 2)
|
||||
scrollMargin = Math.min(@hScrollMargin, maxScrollMargin)
|
||||
margin = scrollMargin * @charWidth
|
||||
desiredRight = pixelPosition.left + @charWidth + margin
|
||||
desiredLeft = pixelPosition.left - margin
|
||||
|
||||
if desiredRight > @scrollView.scrollRight()
|
||||
@scrollView.scrollRight(desiredRight)
|
||||
else if desiredLeft < @scrollView.scrollLeft()
|
||||
@scrollView.scrollLeft(desiredLeft)
|
||||
|
||||
# Given a buffer range, this highlights all the folds within that range
|
||||
#
|
||||
# "Highlighting" essentially just adds the `selected` class to the line
|
||||
@@ -1043,6 +1005,44 @@ class Editor extends View
|
||||
|
||||
### Internal ###
|
||||
|
||||
|
||||
# Scrolls the editor vertically to a given position.
|
||||
scrollVertically: (pixelPosition, {center}={}) ->
|
||||
scrollViewHeight = @scrollView.height()
|
||||
scrollTop = @scrollTop()
|
||||
scrollBottom = scrollTop + scrollViewHeight
|
||||
|
||||
if center
|
||||
unless scrollTop < pixelPosition.top < scrollBottom
|
||||
@scrollTop(pixelPosition.top - (scrollViewHeight / 2))
|
||||
else
|
||||
linesInView = @scrollView.height() / @lineHeight
|
||||
maxScrollMargin = Math.floor((linesInView - 1) / 2)
|
||||
scrollMargin = Math.min(@vScrollMargin, maxScrollMargin)
|
||||
margin = scrollMargin * @lineHeight
|
||||
desiredTop = pixelPosition.top - margin
|
||||
desiredBottom = pixelPosition.top + @lineHeight + margin
|
||||
if desiredBottom > scrollBottom
|
||||
@scrollTop(desiredBottom - scrollViewHeight)
|
||||
else if desiredTop < scrollTop
|
||||
@scrollTop(desiredTop)
|
||||
|
||||
# Scrolls the editor horizontally to a given position.
|
||||
scrollHorizontally: (pixelPosition) ->
|
||||
return if @activeEditSession.getSoftWrap()
|
||||
|
||||
charsInView = @scrollView.width() / @charWidth
|
||||
maxScrollMargin = Math.floor((charsInView - 1) / 2)
|
||||
scrollMargin = Math.min(@hScrollMargin, maxScrollMargin)
|
||||
margin = scrollMargin * @charWidth
|
||||
desiredRight = pixelPosition.left + @charWidth + margin
|
||||
desiredLeft = pixelPosition.left - margin
|
||||
|
||||
if desiredRight > @scrollView.scrollRight()
|
||||
@scrollView.scrollRight(desiredRight)
|
||||
else if desiredLeft < @scrollView.scrollLeft()
|
||||
@scrollView.scrollLeft(desiredLeft)
|
||||
|
||||
calculateDimensions: ->
|
||||
fragment = $('<div class="line" style="position: absolute; visibility: hidden;"><span>x</span></div>')
|
||||
@renderedLines.append(fragment)
|
||||
@@ -1526,7 +1526,7 @@ class Editor extends View
|
||||
pasteboard.write(path) if path?
|
||||
|
||||
### Internal ###
|
||||
|
||||
|
||||
bindToKeyedEvent: (key, event, callback) ->
|
||||
binding = {}
|
||||
binding[key] = event
|
||||
|
||||
@@ -7,8 +7,6 @@ module.exports =
|
||||
class LineMap
|
||||
maxScreenLineLength: 0
|
||||
|
||||
### Internal ###
|
||||
|
||||
constructor: ->
|
||||
@screenLines = []
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ module.exports =
|
||||
class Pasteboard
|
||||
signatureForMetadata: null
|
||||
|
||||
# Internal: Creates an `md5` hash of some text.
|
||||
# Creates an `md5` hash of some text.
|
||||
#
|
||||
# text - A {String} to encrypt.
|
||||
#
|
||||
|
||||
@@ -94,7 +94,7 @@ class Point
|
||||
|
||||
[new Point(0, column), new Point(@row, rightColumn)]
|
||||
|
||||
# Internal: Compares two `Point`s.
|
||||
# Compares two `Point`s.
|
||||
#
|
||||
# other - The {Point} to compare against
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user