{"action":"created","issue":{"url":"https://api.github.com/repos/trishume/syntect/issues/242","repository_url":"https://api.github.com/repos/trishume/syntect","labels_url":"https://api.github.com/repos/trishume/syntect/issues/242/labels{/name}","comments_url":"https://api.github.com/repos/trishume/syntect/issues/242/comments","events_url":"https://api.github.com/repos/trishume/syntect/issues/242/events","html_url":"https://github.com/trishume/syntect/issues/242","id":420770549,"node_id":"MDU6SXNzdWU0MjA3NzA1NDk=","number":242,"title":"Highlighting Scintilla widget with Syntect","user":{"login":"brupelo","id":18058492,"node_id":"MDQ6VXNlcjE4MDU4NDky","avatar_url":"https://avatars3.githubusercontent.com/u/18058492?v=4","gravatar_id":"","url":"https://api.github.com/users/brupelo","html_url":"https://github.com/brupelo","followers_url":"https://api.github.com/users/brupelo/followers","following_url":"https://api.github.com/users/brupelo/following{/other_user}","gists_url":"https://api.github.com/users/brupelo/gists{/gist_id}","starred_url":"https://api.github.com/users/brupelo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brupelo/subscriptions","organizations_url":"https://api.github.com/users/brupelo/orgs","repos_url":"https://api.github.com/users/brupelo/repos","events_url":"https://api.github.com/users/brupelo/events{/privacy}","received_events_url":"https://api.github.com/users/brupelo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2019-03-13T23:49:11Z","updated_at":"2019-03-17T23:36:56Z","closed_at":null,"author_association":"NONE","body":"Here's the thing, in the past I'd been playing around with lark-parser to highlight the syntax of a Scintilla widget with +/- succes. here you can see a very little example where you can see how lark & qscintilla are used [together](https://github.com/lark-parser/lark/blob/master/examples/qscintilla_json.py)\r\n\r\nThing is, syntax highlighting with Scintilla is really painful (as well as creating new lexers)... So I was considering this idea of being able to use textmate syntax&themes on a Scintilla widget by using syntect.\r\n\r\nThe idea would be creating some sort of generic Scintilla Lexer that would allow me to do so... At this point I've created python bindings out of mostly of the public syntect API but I'm not sure if this idea of mine is a good idea or not.\r\n\r\nIf you don't know too much about how QScintilla syntax highlighting works, here's a very good [explanation](https://qscintilla.com/syntax-highlighting/) about it. So, before trying anything and wasting any time I'd like to listen your thoughts about it, whether this is a good idea or not... and if it is, what'd be the best way to execute it and how long could take me.\r\n\r\nThanks.\r\n\r\nPs. I'm asking you before trying anything by myself cos I'm considering all your experience on this area & the fact you'll probably know all the pros & cons about using syntect highlighting with another text editors... It's not like I'm asking explicitely which or what function using... at this point I've already become familiar with the whole public API exposed by syntect, so... ;)"},"comment":{"url":"https://api.github.com/repos/trishume/syntect/issues/comments/473727203","html_url":"https://github.com/trishume/syntect/issues/242#issuecomment-473727203","issue_url":"https://api.github.com/repos/trishume/syntect/issues/242","id":473727203,"node_id":"MDEyOklzc3VlQ29tbWVudDQ3MzcyNzIwMw==","user":{"login":"brupelo","id":18058492,"node_id":"MDQ6VXNlcjE4MDU4NDky","avatar_url":"https://avatars3.githubusercontent.com/u/18058492?v=4","gravatar_id":"","url":"https://api.github.com/users/brupelo","html_url":"https://github.com/brupelo","followers_url":"https://api.github.com/users/brupelo/followers","following_url":"https://api.github.com/users/brupelo/following{/other_user}","gists_url":"https://api.github.com/users/brupelo/gists{/gist_id}","starred_url":"https://api.github.com/users/brupelo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brupelo/subscriptions","organizations_url":"https://api.github.com/users/brupelo/orgs","repos_url":"https://api.github.com/users/brupelo/repos","events_url":"https://api.github.com/users/brupelo/events{/privacy}","received_events_url":"https://api.github.com/users/brupelo/received_events","type":"User","site_admin":false},"created_at":"2019-03-17T23:36:56Z","updated_at":"2019-03-17T23:36:56Z","author_association":"NONE","body":"I've managed to use syntect to provide syntax higlighting on a scintilla widget and the performance is good enough without havint to rely on any clever trick... On the other hand, I can see there are quite a lot of issues/bugs... let's see first what Sublime Text looks like:\r\n\r\n![showcase](https://dl.dropboxusercontent.com/s/qjla36347c8g2oi/2019-03-18_00-01-22.gif)\r\n\r\nThe behaviour is rock solid, as expected from Sublime... now let's see how my little Scintilla experiment will look like:\r\n\r\n![showcase](https://dl.dropboxusercontent.com/s/3elxe153014w371/2019-03-18_00-02-47.gif)\r\n\r\nIssues: \r\n\r\n1) Bad highlighting on initial state, is this maybe because I'm using a broken monokai theme? I've downloaded this from some random place on the internet as syntect doesn't support official sublime's ones\r\n2) Non deterministic behaviour, you can see that in my above demo\r\n3) State becomes screwed up at certain point and you can't recover from it\r\n4) I'm parsing the whole text over and over, shouldn't syntect provide coherent nicer results this way?\r\n\r\nYou can find attached [here](https://www.dropbox.com/s/1akmbribadzqgax/mcve.7z?dl=1) a little reproducer. \r\n\r\nIn case you're interested to give it a shot, you'll need windows+py3.6.x+pyqt5\r\n\r\nThanks in advance."}}
{"actor":{"display_login":"brupelo"}}