Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make adding multiple console nodes work.

  • Loading branch information...
commit a218dc35cdc15399c82c8fb21aab19ef7781eefb 1 parent 7021877
@alloy authored
Showing with 13 additions and 3 deletions.
  1. +13 −2 lib/irb/cocoa/list_view.rb
  2. +0 −1  lib/irb/cocoa/view_controller.rb
View
15 lib/irb/cocoa/list_view.rb
@@ -88,6 +88,7 @@ def needsLayoutStartingAtListItemAtIndex(listItemIndex, withWidth:width)
end
frame = self.frame
+ frame.origin.y -= y - frame.size.height unless nested? # TODO or unless expanding
frame.size.width = width
frame.size.height = y
@updatingFrameForNewLayout = true
@@ -121,12 +122,21 @@ def enclosingListView
end
def addListItem(item)
- addSubview(item, positioned:NSWindowBelow, relativeTo:@inputField)
+ items = subviews
+ if items.size == 1
+ addSubview(item, positioned:NSWindowBelow, relativeTo:@inputField)
+ else
+ addSubview(item, positioned:NSWindowAbove, relativeTo:items[-2])
+ end
end
def needsLayoutAfterChildListViewToggledStartingAtListItem(listItem)
needsLayoutStartingAtListItem(listItem)
end
+
+ def needsLayoutStartingAtListItemAtIndex(listItemIndex)
+ super(listItemIndex - 1) # offset for @inputFieldContainer
+ end
end
class ScrollableListView < NSScrollView
@@ -146,6 +156,7 @@ def init
if super
self.backgroundColor = NSColor.whiteColor
self.hasHorizontalScroller = false
+ self.hasVerticalScroller = true
clipFrame = contentView.frame
self.contentView = ClipViewWithGutter.alloc.initWithFrame(clipFrame)
@@ -187,7 +198,7 @@ def isFlipped
# we add the disclosure triangle here, because otherwise we can't ask the listView yet if it's nested.
def viewDidMoveToSuperview
- addDisclosureTriangle if @node.respond_to?(:children)
+ addDisclosureTriangle if @node.expandable?
end
def disclosureTriangleX
View
1  lib/irb/cocoa/view_controller.rb
@@ -119,7 +119,6 @@ def receivedResult(result)
addConsoleNode(ObjectNode.nodeForObject(result))
@delegate.receivedResult(self)
makeInputFieldPromptForInput
- scrollWebViewToBottom
end
def receivedOutput(output)
Please sign in to comment.
Something went wrong with that request. Please try again.