From ab57026dc46a228306711b747c7778cff895b4bd Mon Sep 17 00:00:00 2001 From: Sven Van Caekenberghe Date: Wed, 6 Nov 2024 17:11:25 +0100 Subject: [PATCH] Fix PureGitFile editor/contents confusion and reimplement AbstractFileReference>>#gtEditorView reuse --- src/GToolkit4Git/PureGitFile.extension.st | 32 ++++++++--------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/src/GToolkit4Git/PureGitFile.extension.st b/src/GToolkit4Git/PureGitFile.extension.st index eec282a..1db1828 100644 --- a/src/GToolkit4Git/PureGitFile.extension.st +++ b/src/GToolkit4Git/PureGitFile.extension.st @@ -71,21 +71,6 @@ PureGitFile >> gtBlameFor: composite [ weight: 2.0 ] -{ #category : #'*GToolkit4Git' } -PureGitFile >> gtContentsFor: composite [ - - | text | - [ text := self contents ] - on: ZnCharacterEncodingError - do: [ ^ composite empty ]. - ^ composite textEditor - title: 'Contents'; - priority: 30; - tooltip: 'Current contents in work tree on file system'; - glamorousCodeFontAndSize; - text: [ text ] -] - { #category : #'*GToolkit4Git' } PureGitFile >> gtDetails [ ^ super gtDetails , { @@ -107,12 +92,17 @@ PureGitFile >> gtEditorFor: composite [ [ text := self contents ] on: ZnCharacterEncodingError do: [ ^ composite empty ]. - ^ composite forward - title: 'Editor'; - priority: 35; - tooltip: 'Edit current contents in work tree on file system'; - object: [ self fileReference ]; - view: #gtContentsFor: + ^ composite explicit + title: 'Contents'; + priority: 30; + tooltip: 'Current contents in work tree on file system'; + stencil: [ | pane | + pane := self fileReference gtEditorView. + pane + childNamed: #editor + ifFound: [ :editor | + editor aptitude: BrGlamorousCodeEditorAptitude ]. + pane ] ] { #category : #'*GToolkit4Git' }