Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toooo long working #2

Closed
insolution opened this issue Jun 10, 2013 · 19 comments
Closed

Toooo long working #2

insolution opened this issue Jun 10, 2013 · 19 comments

Comments

@insolution
Copy link

insolution commented Jun 10, 2013

in Notepad ++, css
When the file is big, if i use script in the beginning of the file, its ok, and fast enough.
But if I use script in the end of the file, it works for a 30 second or longer.
in Notepad ++ calculations or some tags
after calculation is done cursor moves to some lines upper at the file, than if it should be.

Sorry for my English, here is the video demonstration of the problem

http://insolution.ru/css_html_problem.avi


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@sergeche
Copy link
Member

It happens because of how N++ works with text. It treats text as a series of bytes, not charters (thus, any UTF character is represented as a series of bytes). In this case, I have to convert current document from bytes to characters (and vice versa) in order to make Emmet work properly. So, the larger your document, the more time it takes to convert it on each operation.

I don’t have a solution for this problem right now.

@insolution
Copy link
Author

Хм... интересно, а можно тут по-русски писать? Долго переводить...

Вопрос такой.. насколько я понимаю, не весь документ инкодируется, а только от начала документа до курсора... нельзя ли задать ограничение, чтобы обрабатывалась только та часть, которая от начала строки, а не от начала документа, ну или хотя-бы килобайтное ограничение поставить. Чтобы от курсора и на килобайт назад максимум обрабатывалось?

@insolution
Copy link
Author

ой.. нечаянно закрыл

Если так и не получится ничего исправить.. подскажите, какой редактор лучше всего совместим с emmet?

@insolution insolution reopened this Jun 12, 2013
@sergeche
Copy link
Member

Я посмотрю на API, но в общем виде — нет. Дело в том, что Emmet в неявном виде опрашивает весь документ, например, чтобы определить тэг, внутри которого происходит разворачивание аббревиатуры, чтобы правильно определить название тэгов (см. Implicit tag names).

Я позже попробую что-нибудь с этим сделать, но пока все найденные мной решения сводятся именно к тому, чтобы постоянно кодировать байты в символы и обратно.

@ArkadiuszMichalski
Copy link

I don't agree. We have old version in Python:
http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Plugin_Central#ZenCodingPython
I see the same person make this both plugin (Dave Brotherstone) but Emmet works worse (working slow, lost cursor position with some operations). Old Zen Coding don't have this issue.

Any solution at this moment?

@sdelfi
Copy link

sdelfi commented Nov 27, 2013

Тогда почему в таком случае ZenCoding работает быстро? Хотя на сколько понял, это плагин, работающий не через API notepad++, я правильно понимаю?

@sergeche
Copy link
Member

@scriptishuser I don’t understand what you don’t agree with.

While Zen Coding and Emmet both share the same NPP wrapper, these plugins are different: Zen Coding had Python implementation and Emmet is written entirely on JS so I’m using PyV8 to run JS in Python.

PyV8 isn’t a bottleneck here, but Scintilla’s (editor component of NPP) way of working with text. JS works with UTF16-encoded text and Scintilla operates with bytes, e.g. 1 character of UTF16 text can be represented by 1–4 (or event more) bytes in Scintilla.

So I can’t just pass content from Scintilla to JS and vice versa because your multi bytes characters will be broken, I have to encode it to UTF first and then decode back to ASCII. And I have to do the verst same thing when Emmet asks to replace certain range of text in editor.

If you find a solution for operating with characters instead of bytes in Scintilla, it will solve the issue

@ArkadiuszMichalski
Copy link

Maybe I did not make myself clear. I mean that there are ways to create an efficient implementation in NPP. This version work without speed problem (I test all this version):

http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Plugin_Central#Z
http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Plugin_Central#jN
http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Plugin_Central#ZenCodingPython

I don't understand why you can't use the above solutions. Maybe in Emmet you use sth news, and this solutions don't have such power.

It is a pity that there is no easy solution, because the NPP is a popular editor, and at this point we have to sit on the old version. But better any old version than nothing, without ZC I can't create markup:) I guess time to change the editor, I see that everyone migrate to the Sublime Text.

PS. Can you try ask Don Ho (NPP author)? Maybe he will give a solution to this problem. If no, I can make topic in NPP forum and put link to this thread. I do not know if this helps, but it is always worth a try.

@sergeche
Copy link
Member

sergeche commented Jan 3, 2014

I’ve used jN in previous versions of plugin: it has major problems with global shortcuts and modal dialogs, as well as outdated JS engine.

@radojica
Copy link

radojica commented Jan 4, 2014

This plugin is much better then zen-coding...but since this bug exist I can not use use it...or I can but I need to wait about 15 seconds to respond for every command :(

Can't you just make it the same way as zen-coding plugin is made ( because zen coding work perfect )

@kmvan
Copy link

kmvan commented Mar 3, 2014

I got the problem too. So crazy.

@ianchanning
Copy link

I too have the same problem. I'm using a Windows 8 / Core i7 / 8GM RAM machine.

Its consistently 3s at best to expand an abbreviation where as the old Zen Coding plugin is effectively instantaneous. So the excellent suggestion of using the Tab shortcut key works perfectly for the old plugin as it doesn't get in the way of the usual tab usage, but using this Emmet plugin then there is a 3s delay if you try to press the tab key whilst it figures out if there is a abreviation to do or not.

The loss of speed takes away any benefit of the new features, so until this is fixed I'll just use the old plugin unless there's some aspect of it that only works in Emmet, then I'll take the hit of waiting.

To be clear, I'm using the Zen Coding Python plugin - the one that this is forked from. So the changes made in this fork must be causing the problem.

@kmvan
Copy link

kmvan commented Mar 5, 2014

ls英语屌炸天,I too have!

@henrix343
Copy link

same problem here.

@srmahmud2
Copy link

Still the same prob!
is there any update on emmet with notepad++?

@eight04
Copy link

eight04 commented Feb 25, 2016

I tried to implement the plugin with jN: https://github.com/eight04/jn-npp-emmet It is much faster without this problem.

@brunoais
Copy link

I wonder.... Why not start at the cursor position and locate the first '\n' from the cursor location, then only work on that substring to find where to change and finally, make the replacement at that point?
I didn't see the API for notepad++, so correct me if I'm wrong but, any worthy editor will tell the offset of the current cursor and will allow replacing and inserting at a certain point.
Given that, a line for example ("|" is the cursor):
prefix text somewhere blink| what suffix?
The plugin gets the bytes for:
prefix text somewhere blink|

To which they are replaced with:

prefix text somewhere <blink>|

And all that text before what was worked on by emmet is kept intact, byte by byte.
Is that not possible? Is that a limitation of np++ plugin interface?

@thrnd
Copy link

thrnd commented Oct 29, 2017

Are there some old versions of npp/ps/emmet that work fast together?

Может быть есть какие-то старые версии нпп/питонскрипта/еммета, которые шустро раскукоживают аббревиатуры в теги?
Очень не хочется переходить на другой редактор.

@eight04
Copy link

eight04 commented Oct 29, 2017

@randomnf The old version of Emmet is called Zen Coding, you can find it from plugin manager.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests