Merge pull request #1 from Blquinn/source-buffer

Update SourceView to return SourceView.Buffer
This commit is contained in:
Drew Holzworth 2020-07-14 11:16:55 +10:00 committed by GitHub
commit e6aed8d93d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View file

@ -0,0 +1,12 @@
namespace GtkSource
{
public partial class SourceView : Gtk.TextView
{
new public GtkSource.Buffer Buffer
{
get => base.Buffer as GtkSource.Buffer;
set => base.Buffer = value;
}
}
}

View file

@ -59,6 +59,7 @@ namespace Samples
_textViewCode = new SourceView();
_textViewCode.ShowLineNumbers = true;
_textViewCode.Buffer.Language = new LanguageManager().GetLanguage("c-sharp");
_textViewCode.Margin = 3;
scroll2.Child = _textViewCode;