magiblot / turbo

An experimental text editor based on Scintilla and Turbo Vision.
Other
461 stars 35 forks source link

Split turbo-specific features from EditorWindow into a subclass #19

Closed electroly closed 3 years ago

electroly commented 3 years ago

This code was hastily prepared and I don't expect it to be mergeable as-is, but it can serve as a proof of concept for the desired division of responsibilities.

I refactored the EditorWindow class so that everything turbo-specific (generally the window management and file handling stuff) is in a subclass (still called EditorWindow), with a new BaseEditorWindow class offering a convenient extension point for external users. I've implemented a subclass of BaseEditorWindow in tmbasic and it seems to be working ok. I haven't finished the integration work, but I don't think any upstream changes are required for the rest.

I also extended the Clipboard class to allow a subclass to implement fallback behavior when libclipboard fails.

magiblot commented 3 years ago

Thank you! I will look at it during the next days.

electroly commented 3 years ago

I had to make some additional changes, but I've got everything working now including syntax coloring using my own lexer.

image

It's working very nicely!

electroly commented 3 years ago

Closing this PR now that https://github.com/electroly/tmbasic/pull/4 has been merged.