The shortcut key Ctrl+K,Ctrl+D can format all the code. #423
Labels
No labels
Area-Accessibility
Area-Build
Area-CodeCompletion
Area-Document
Area-Documentation
Area-Editing
Area-Folding
Area-Highlighting
Area-i18n
Area-Indentation
Area-NetFx
Area-Rendering
Area-Search
Area-Snippets
dependencies
duplicate
Feedback Needed
help wanted
invalid
Issue-Bug
Issue-Discussion
Issue-Enhancement
Issue-Performance
Issue-Question
on-hold
Resolution-Answered
Resolution-By Design
Resolution-Duplicate
Resolution-Fixed
Resolution-Won't Fix
Up-for-Grabs
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-icsharpcode/AvalonEdit#423
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When we use Visual Studio and press Ctrl+K, Ctrl+D, the code will be formatted. And how can we achieve this functionality in avalonedit? And when we press Ctrl+D after Ctrl+K, the line where the cursor is located will be deleted.
I can answer half the question. I don't think AvalonEdit (or WPF) supports "chords" like Visual Studio out of the box (or if I does I'm unaware). To listen for Chords with AvalonEdit I use this code (you can use this for WPF in general). Here is an example to comment and uncomment code with Ctrl+K Ctrl+C and Ctrl+K Ctrl+U (I've gotten a lot of mileage out of this class).
Then you would setup your key bindings like this (I pass it two relay commands in this example):
Then here is the relay commands those calls (these might need a little work but they mostly work):