raspu / Highlightr

iOS & OSX Syntax Highlighter.
MIT License
1.66k stars 261 forks source link

Better SwiftUI Support #79

Open L1cardo opened 4 years ago

L1cardo commented 4 years ago

Is it possible to let Highlightr support SwiftUI better?

conorgriffin commented 3 years ago

@L1cardo does it even work in SwiftUI as it is? I'd appreciate an example of how you use it now

L1cardo commented 3 years ago

@L1cardo does it even work in SwiftUI as it is? I'd appreciate an example of how you use it now

Actually I didn't use this in my project. I recommend you two other options: https://github.com/Pictarine/CodeMirror-SwiftUI https://github.com/dwarvesf/CodeViewer

conorgriffin commented 3 years ago

Neither of those seem to work on Big Sur, both throw errors like these

2020-11-26 20:44:12.080748+0000 Test[41128:2780002] -[WKWebView _setDrawsTransparentBackground:] is deprecated and should not be used.
2020-11-26 20:44:12.119370+0000 Test[41128:2780002] CDN - client insert callback function client = 0 type = 17 function = 0x7fff2c11382d local_olny = false
2020-11-26 20:44:12.119445+0000 Test[41128:2780002] CDN - client setup_remote_port
2020-11-26 20:44:12.119504+0000 Test[41128:2780002] CDN - Bootstrap Port: 1799
2020-11-26 20:44:12.119713+0000 Test[41128:2780002] CDN - Remote Port: 32271 (com.apple.CoreDisplay.Notification)
2020-11-26 20:44:12.119774+0000 Test[41128:2780002] CDN - client setup_local_port
2020-11-26 20:44:12.119818+0000 Test[41128:2780002] CDN - Local Port: 32003
2020-11-26 20:44:12.257456+0000 Test[41128:2780002] [Process] 0x7fefb1059820 - [pageProxyID=5, webPageID=6, PID=0] WebPageProxy::processDidTerminate: (pid 0), reason 3
2020-11-26 20:44:12.257662+0000 Test[41128:2780002] [Loading] 0x7fefb1059820 - [pageProxyID=5, webPageID=6, PID=0] WebPageProxy::dispatchProcessDidTerminate: reason = 3
2020-11-26 20:44:12.322629+0000 Test[41128:2780002] [Process] 0x7fefb1059820 - [pageProxyID=5, webPageID=6, PID=0] WebPageProxy::processDidTerminate: (pid 0), reason 3
2020-11-26 20:44:12.332905+0000 Test[41128:2780002] [Loading] 0x7fefb1059820 - [pageProxyID=5, webPageID=6, PID=0] WebPageProxy::dispatchProcessDidTerminate: reason = 3
2020-11-26 20:44:12.332961+0000 Test[41128:2780002] [Process] 0x7fefb1059820 - [pageProxyID=5, webPageID=6, PID=0] WebPageProxy::tryReloadAfterProcessTermination: process crashed and the client did not handle it, not reloading the page because we reached the maximum number of attempts
L1cardo commented 3 years ago

Neither of those seem to work on Big Sur, both throw errors like these


2020-11-26 20:44:12.080748+0000 Test[41128:2780002] -[WKWebView _setDrawsTransparentBackground:] is deprecated and should not be used.

2020-11-26 20:44:12.119370+0000 Test[41128:2780002] CDN - client insert callback function client = 0 type = 17 function = 0x7fff2c11382d local_olny = false

2020-11-26 20:44:12.119445+0000 Test[41128:2780002] CDN - client setup_remote_port

2020-11-26 20:44:12.119504+0000 Test[41128:2780002] CDN - Bootstrap Port: 1799

2020-11-26 20:44:12.119713+0000 Test[41128:2780002] CDN - Remote Port: 32271 (com.apple.CoreDisplay.Notification)

2020-11-26 20:44:12.119774+0000 Test[41128:2780002] CDN - client setup_local_port

2020-11-26 20:44:12.119818+0000 Test[41128:2780002] CDN - Local Port: 32003

2020-11-26 20:44:12.257456+0000 Test[41128:2780002] [Process] 0x7fefb1059820 - [pageProxyID=5, webPageID=6, PID=0] WebPageProxy::processDidTerminate: (pid 0), reason 3

2020-11-26 20:44:12.257662+0000 Test[41128:2780002] [Loading] 0x7fefb1059820 - [pageProxyID=5, webPageID=6, PID=0] WebPageProxy::dispatchProcessDidTerminate: reason = 3

2020-11-26 20:44:12.322629+0000 Test[41128:2780002] [Process] 0x7fefb1059820 - [pageProxyID=5, webPageID=6, PID=0] WebPageProxy::processDidTerminate: (pid 0), reason 3

2020-11-26 20:44:12.332905+0000 Test[41128:2780002] [Loading] 0x7fefb1059820 - [pageProxyID=5, webPageID=6, PID=0] WebPageProxy::dispatchProcessDidTerminate: reason = 3

2020-11-26 20:44:12.332961+0000 Test[41128:2780002] [Process] 0x7fefb1059820 - [pageProxyID=5, webPageID=6, PID=0] WebPageProxy::tryReloadAfterProcessTermination: process crashed and the client did not handle it, not reloading the page because we reached the maximum number of attempts

I haven't tried them on Big Sur yet, but they worked well on Catalina

helje5 commented 2 years ago

I also got one: https://github.com/ZeeZide/CodeEditor, which seems to work fine.