Comments (5)
@jaredpar Is there any way to capture Ctrl-Z after hitting Ctrl-K F or Ctrl-K D in Visual Studio SDK?
If you can find time to help with this, it would be great. Thanks.
from fantomas.
It is possible to capture Ctrl+Z but I don't think that is what you want to do here. It sounds like you just want the caret position to be correct on an undo / redo of the format document command. If that is the case the best way to do this is to use an undo transaction to track the caret. After which it will be properly adjusted on all undo / redo operations. I will send out a sample here in just a bit.
from fantomas.
Note if you're interested in the subtle insanity that is VS undo I have a bit of documentation here
https://github.com/jaredpar/VsVim/blob/master/Src/VimCore/UndoRedoOperations.fs
Should have a PR for this bug in the next hour or so.
from fantomas.
I just sent a pull request which fixes this bug. Undo / Redo is a very tricky part of Visual Studio. It took me at least 4 tries in VsVim to really understand the details of how it works. Feel free to send me any questions about the code.
from fantomas.
@jaredpar Awesome. I will read the pull request and ask if anything is not clear.
from fantomas.
Related Issues (20)
- Unable to format Fable line (cannot determine if Expr Paren Fantomas.Core.SyntaxOak+ExprParenNode is uppercase or lowercase) HOT 2
- Trivia after mutable keyword is missing HOT 1
- Formatting can depend on cursor position HOT 4
- Misplaced comment in "else if" HOT 3
- Fantomas does not support extended interpolated strings HOT 4
- Many Ifdefs seem to cause parse error HOT 1
- Unmatched '{' error when formatting the code HOT 2
- Using `--check` gives error "todo WhileBang" HOT 9
- Breaks shorthand lambda atomicity for lowercase method invocations
- Consider relaxing ASTTransformer treatment of ranges in record fields HOT 1
- Unable to format F# 8 extended interpolated strings with curly braces HOT 3
- Move editor config to library rather than tool HOT 6
- "Incomplete declaration of a static construct" which the F# compiler accepts HOT 2
- Multiline secondary constructor HOT 4
- Equals sign should only be on same line if last tuple is multiline HOT 2
- Return type should go on next line
- Invalid F# code after formatting HOT 1
- Formatting removes necessary additional closing brackets for multiline interpolated strings HOT 1
- Fantomas reports an error when formatting interpolated string with tripple quotes HOT 7
- Idempotency problem when _.Property shorthand
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 fantomas.