Comments (7)
This is only possible if you're not running the thing after just opening a file, what is the extra value by doing this(other than saving a few cpu cycles)?
from isort.
This is really specific to the kate plugin, as I was informed by another kate plugin writer that replacing all text can lead to worse then expected performance degredation. Even so i may not implement it as it seems to me something that should be optimized in kate itself
from isort.
Ah, ok.. Perhaps something to share with the kate development team. :)
from isort.
Agreed changing this to wontfix and will notify them :)
from isort.
there is nothing to notify about...
from isort.
@zaufi does your old comment about Kate having to reparse, highlight, setup undo action, & etc no longer apply? I suppose an undo action is actually the desired behavior (as if something happens undesired when sorting I do want the user to be able to undo it). However, when initially writing the plugin I assumed Kate was smart enough to not re-parse / repaint everything if only a small portion of the file had changed (ie it shouldn't be faster to diff the changes that smartly reinsert - then just for me to reinsert the text) but your comment made me believe otherwise? Did I misunderstand the issue?
from isort.
@timothycrosley yes, it is -- if u r going to setText()
kate will do a lot of work... but there is no other way to do so: if u tell to a KTextEditor::Document
to replace whole text w/ smth else, kate do not care about what it contains before... it just clear()
internal buffer (setting undo action, and remembering line marks) and do everything from the beginning (starting from lines split and finishing w/ restoring marks). Thanx to fast CPUs we have nowadays it happens fast enough, but resetting whole document is a bad practise anyway.
And I bet nobody in the kate team will take care about "what if 99% of the reinserted text is the same as it was before" and handle this case... Kate's internals are complicated enough already even w/o this "feature"... and kate team work hard to make it faster (for example having too much RegExps
in a syntax file also considered as a bad practise :) -- not talking about resetting a whole document... so it is a matter of plugin writer to make it as fast as he can... If u can't -- don't worry. Just hope users w/ fast CPUs will notice nothing ;-)
from isort.
Related Issues (20)
- Doesn't support python 3.12 HOT 1
- Chinese code causes errors HOT 1
- isort doesn't respect config when it is inside subfolders HOT 2
- Unrecognized arguments: --profile black HOT 6
- Fix broken integration tests HOT 2
- Lots of new direct dependencies `[5.13]` HOT 1
- New Yarg dependency adds `site-packages/tests` directory HOT 4
- pip install "isort[colors]" no longer installs colorama HOT 3
- Incorrect identification of first and third party modules
- It seems `--jobs` and `--diff` cannot be used together
- try isort page is b0rk
- from xyz import (abc, # isort:skip yo, hey) HOT 1
- Can we add a json schema to complete pyproject.toml's [tool.isort]?
- isort 5.11.2 fails to install in pre-commit HOT 4
- Import in one line if the import fits within the line-length HOT 4
- files configuration option missing from config file(s) HOT 2
- Non-idempotency with commented multiline imports
- [self tests] test_black_pyi_file fails with black 24.2.0
- [self tests] test_isort_should_warn_on_empty_custom_config_issue_1433 fails against Pytest 8
- `--skip-gitignore` still traverses files/directories in .gitignore'd directories HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from isort.