aziz / SublimeANSI

ANSI escape codes color highlighting for SublimeText 3
225 stars 40 forks source link

ANSIescape stopped working in Sublime 3.1 #49

Closed lassevalentini closed 6 years ago

lassevalentini commented 6 years ago

Happened due to breaking changes in the Default example plugin exec.py. Included the exec.py from the previous version of sublime instead.

jfcherng commented 6 years ago

Thank you :+1:

jfcherng commented 6 years ago

Unfortunately, this patch makes my ST pop up a panel which reads __init__() got an unexpected keyword argument 'update_phantoms_only' every time I open a file so I have to reverse this patch.

lassevalentini commented 6 years ago

Seems like the correct thing to do is use the new exec and add reverese compatibility. I think the problem is that in the previous version, the data argument in on_data were a byte array, where now it is a string. Should I try to detect if it is a byte array and just do encoding/decoding based on that?

jfcherng commented 6 years ago

That looks good.

I notice that there is no codec-related codes in class ExecCommand(sublime_plugin.WindowCommand, ProcessListener) in the new exec.py.

It looks like just removing the codec-related code in def on_data_process(self, proc, data): make this plugin working again.

Could you try this patch? https://github.com/aziz/SublimeANSI/commit/d5ac09de5d5fb6effa46ee59354f869851a0c52d

lassevalentini commented 6 years ago

My concern would be older versions of sublime then - why i thought sniffing would be preferred.

jfcherng commented 6 years ago

Commit https://github.com/aziz/SublimeANSI/commit/d5ac09de5d5fb6effa46ee59354f869851a0c52d would take care of BC.