Comments (7)
Good use case, good write up. Thanks for the issue!
I specifically have the extension set to not run when there is text highlighted (see the !editorHasSelection
portion), but to be honest I don't remember why. Maybe it doesn't delete the highlighted text if my extension runs in that case?
I imagine most of the time spent on this issue will be trying to figure out what poor behaviors come from allowing it to run when text is highlighted, and how to mitigate them.
from vsc-python-indent.
Minor nitpick, shouldn't the desired behavior be
my_dict = {'a': 1,
'b': 2}
# No trailing space and code is aligned
instead of
my_dict = {'a': 1,
'b': 2}
# No trailing space and code is aligned
?
from vsc-python-indent.
Yikes! That is NOT how it looked when I submitted or previewed it. Now when I go to edit it, I have to take off spaces and check the preview to make sure it's aligned. The two views are not the same! Very strange. I guess I'm going to have to double-check the post after posting too.
from vsc-python-indent.
I'm surprised you didn't document that. Your documentation is very thorough.
I specifically have the extension set to not run when there is text highlighted
I can change that setting in my package.json for your extension and test it out and provide feedback.
I think the reason my alignment for the code was off is because the font is not fixed-width. Any idea how to change that? It should be a GitHub setting now a browser one.
from vsc-python-indent.
OK after removing !editorHasSelection and !editorHasMultipleSelections from lines 32 and 37 of package.json, the space from the beginning of the selection on the first line to the end of the selection on the new line is still highlighted.
The pipes and dots in between represent the highlighted section:
my_dict = {'a': 1,|
..........|'b': 2}
from vsc-python-indent.
It turns out the selected text wasn't even being deleted (since the extension was now responsible for doing it). All that was needed was 4 lines of code at the beginning to delete the selection first. I submitted a pull request.
from vsc-python-indent.
This should now work correctly in version 1.1.0. Please upgrade and re-open if the issue persists.
from vsc-python-indent.
Related Issues (20)
- install extension offline, not compatible version HOT 1
- Extension causes high cpu load HOT 2
- Maybe adjust behavior of useTabOnHangingIndent? HOT 1
- keepHangingBracketOnLine doesn't seem to be working for square brackets HOT 3
- Automatic dedent for return doesn't always work HOT 12
- One space get inserted HOT 1
- # region Description invalid
- Connection to server got closed. Server will not be restarted. HOT 2
- Fail to generate Indentation for a specific file and code copied from that file HOT 1
- Pattern matching syntax HOT 1
- Possibility to transfer functionality to other languages? HOT 1
- The plug-in is not compatible with vscode-neovim HOT 7
- Enter when in a if-line HOT 1
- Which theme does demo.gif use? HOT 2
- Publish to open-vsx.org? HOT 3
- Extreme lag from pressing Enter to action when extension is running in remote (ssh) host. HOT 6
- multiple indent blank lines will not clear white space before line HOT 2
- Highlighting ` *` and pressing enter doesn't do anything. HOT 1
- python Indentation of the current line is automatically reduced after line wrap HOT 2
- Add extra 3 whitespaces when add new line and broke indent HOT 3
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 vsc-python-indent.