-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Various enhancements #2660
base: master
Are you sure you want to change the base?
Various enhancements #2660
Conversation
Sorry for the late review. Unfortunately this approach adds too much complexity to Ace, since it means we can't use any of string methods, and deltas produced by Ace can't be used by other javascript code (e.g ShareJS). The better approach would be to modify selection code to not allow placing cursor in the middle of the surrogate pair. |
Bugs exist: - cursor pos after fold - marker position update - variable width Tab instead of fixed characters width - screen to document positioning Area of improvement: - Clickable within virtual Tab problem - Multiple renderings during initialization due to scrollbar caused width changes
…single character More fix is needed!
Yes, agree that it was not perfect solution. I am experiencing the fixing of variable font width problem with about 90% completeness. The problem is indeed not only cursor positioning but also multiple UTF-16 characters for a single visible character (i.e. Invalid delete/move left/move right). It is not only U+10000 or above characters but also character with accent combination character such as the Thai character ก่ which consists of two UTF-16 characters. |
- Needs rigorous testing - Update test cases
- Needs rigorous testing - Update test cases
…-sink functional) - Needs rigorous testing - Update test cases
…y double UTF-16 characters Updated test cases to match enhancement
Fix missing vertical scrollbar for large document
|
While this adds many improvements it adds many regression as well
btw seems like in 2f737da you have added files from master without merging so it shows all the changes from master branch mixed with your changes |
The principle of tuning is not to tune fast the code but to reduce the memory consumption on large document. And by the fact that Array in javascript is not actually an array. Memory consumption: var test = Array(100000000);
for (var i = 0; i < test.length; i++)
test[i] = [0];
console.log(test.length); vs var test = Array(100000000);
for (var i = 0; i < test.length; i++)
if (i%100==0)
test[i] = [0];
console.log(test.length); Retrieval var test = Array(10000000);
for (var i = 0; i < test.length; i++)
test[i] = [0];
var total=0;
var start = new Date();
for (var i = 0; i < test.length; i++)
total+=test[i][0];
var end = new Date();
console.log(end.getTime()-start.getTime()); // 18ms vs var test = Array(10000000);
for (var i = 0; i < test.length; i++)
if (i%1000==0)
test[i] = [0];
var total=0;
var start = new Date();
for (var k in test)
total+=test[k][0];
var end = new Date();
console.log(end.getTime()-start.getTime()); // 6ms In normal usage, fold lines should be much less than the document length. Surely, there are rooms for further improvement such as adding another variable for keys, but it adds another memory overhead. It is to be by testing combined with actual usage scenario to find the optimal solution for the balance between memory usage and speed. Large memory allocation = reducing speed |
Updating array with holes when new line is inserted is significantly slower than a normal array,
yes, and documents with >20 million lines are not the intended usage scenario. Supporting them is of course nice, but that shouldn't break small documents. |
e.g.
Extended Chinese characters and emoticons
𠎀
😁👍👌😄👏