This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /// Literal strings translate to slices into static memory. This is different from | |
| /// trans_slice_vstore() above because it doesn't need to copy the content anywhere. | |
| pub fn trans_lit_str<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, | |
| lit_expr: &ast::Expr, | |
| str_lit: InternedString, | |
| dest: Dest) | |
| -> Block<'blk, 'tcx> { | |
| debug!("trans_lit_str(lit_expr={}, dest={})", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pub fn trans_lit_str<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, | |
| lit_expr: &ast::Expr, | |
| str_lit: InternedString, | |
| dest: Dest) | |
| -> Block<'blk, 'tcx> { | |
| /*! | |
| * Literal strings translate to slices into static memory. This is | |
| * different from trans_slice_vstore() above because it doesn't need to copy | |
| * the content anywhere. | |
| */ | |
| debug!("trans_lit_str(lit_expr={}, dest={})", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| right now, mostly killing the extra whitespace myself, moving it up, and using visual block to change things | |
| the function isn't guaranteed to be left aligned, it may be indented | |
| The reformatting of the comment is just `V(move)gq` |
@espadrine thanks! Now to look at all those chunks and grok them... :)
My muscle memory suggests:
Cursor inside the comment block:
?^\s*\/\/*<enter>
v
/^\s*\*\/<enter>
:s!\^\(\s*\)\*!\1///!
:'<dd
:'>dd
gv
D
?\<fn\>
]P
k
'[gq
Something like that anyway. When you're building the actual macro, I always like "ap "ad$ (assuming macro is in register a)
I think @espadrine and my suggestions do converse things - his takes the /// comment and makes it a /*, mine might do the reverse. He does include the qc to create the actual macro - I always need to do the edit a few times by hand before I want to do that.
@nyarly yeah, that seems about right. it is /* -> /// that I want, . regardless, thank you! time to dig in...
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
qc/\/\/\/<cr>v/^pub<cr>kd/{$<cr>p+lvlc*!<esc>+<ctrl-v>/^ +[^\/]<cr>kmellc *<esc><backtick>elli/<esc>qor something like that, for a macro namedc.