andreikop / enki

A text editor for programmers
http://enki-editor.org
GNU General Public License v2.0
161 stars 38 forks source link

Preview hangs when markdown opened #460

Closed abitrolly closed 5 years ago

abitrolly commented 5 years ago

I am using master. When I chosen Vim mode tutorial from the help menu it worked okay, but then I right clicked and selected Show source in preview area to see if I can change font to monospace. It is when it hung for the first time and now it hangs just when Vim mode tutorial is selected.

andreikop commented 5 years ago

Does it hang if you open REAME.md and show Preview?

andreikop commented 5 years ago

And watch the source

abitrolly commented 5 years ago

Hangs with README.md too.

And watch the source

How to do this?

andreikop commented 5 years ago

Which PyQt5 do you use? From repo or from pip? Could you try another variant?

What is your PyQt5 version?

abitrolly commented 5 years ago

How to check which PyQt5 is there? If python3 -m enki --version showed that, I could paste it. Below is the info from About window.

 Version 18.08.0
 Qutepart 3.1.0 (with binary parser)
 Qt 5.11.1
andreikop commented 5 years ago

Hmm, it seems like preview hangs for you. I'm surprised.

I have 3 suspects:

Could you please open .html file in Enki and see preview? Does Enki hang?

bjones1 commented 5 years ago

This is just a wild guess, but sometimes regex works poorly in the preview sync. Can you pip3 uninstall regex and see if that helps?

andreikop commented 5 years ago

@abitrolly ?

abitrolly commented 5 years ago

Enki hangs with .html preview.

dnf uninstall python3-regex fixed all hangs. :open_mouth:

andreikop commented 5 years ago

I've disabled preview sync. I hope somebody would have time to make a better fix.

abitrolly commented 5 years ago

https://github.com/andreikop/enki/commit/33896d770c58ce5bc3e3215ebbf7375e4e284a12

dglent commented 10 months ago

I have this error after removing the package codechat:

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/enki/plugins/preview/__init__.py", line 467, in _onDocumentChanged
    self._createDock()
  File "/usr/lib/python3.8/site-packages/enki/plugins/preview/__init__.py", line 497, in _createDock
    self._dock = PreviewDock()
  File "/usr/lib/python3.8/site-packages/enki/plugins/preview/preview.py", line 482, in __init__
    self.previewSync = PreviewSync(self)
  File "/usr/lib/python3.8/site-packages/enki/plugins/preview/preview_sync.py", line 168, in __init__
    if not findApproxTextInTarget:
NameError: name 'findApproxTextInTarget' is not defined

It needs to define findApproxTextInTarget in any case: https://github.com/andreikop/enki/blob/33896d770c58ce5bc3e3215ebbf7375e4e284a12/enki/plugins/preview/preview_sync.py#L38

i did this:

try:
    pass
    # Approx matching is disabled because of issue #460
    # from .approx_match import findApproxTextInTarget
except ImportError as e:
    findApproxTextInTarget = None
finally:
    findApproxTextInTarget = None
andreikop commented 10 months ago

PR is welcome!

dglent commented 10 months ago

PR is welcome!

No need, i was not updated :) https://github.com/andreikop/enki/commit/aafee43a1d4c9d8f4e15055b1e13a20578d990ce