Skip to content

Commit dd3180d

Browse files
committed
feat(cpp): add two more postfix
1 parent a22273c commit dd3180d

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ tmss! -> absl::flat_hash_map<std::string, std::string>
208208
| Trig | Desc (placehoder: `?`) | Expr before cursor |
209209
| :-------: | -------------------------------------------------------------------- | :----------------: |
210210
| `.be` | Expands to begin and end exprs. | `any_expr` |
211+
| `.cbe` | Expands to cbegin and cend exprs. | `any_expr` |
211212
| `.mv` | Wraps with `std::move(?)`. | `any_expr` |
212213
| `.fwd` | Wraps with `std::forward<decltype(?)>(?)`. | `any_expr` |
213214
| `.val` | Wraps with `std::declval<?>()`. | `any_expr` |
@@ -216,6 +217,7 @@ tmss! -> absl::flat_hash_map<std::string, std::string>
216217
| `.ts` | Switches indent's coding style between `CamelCase` and `snake_case`. | `indent` |
217218
| `.sc` | Wraps with `static_cast<>(?)`. | `any_expr` |
218219
| `.single` | Wraps with `ranges::views::single(?)`. | `any_expr` |
220+
| `.await` | Expands to `co_await ?`. | `any_expr` |
219221
| `.in` | Expands to `if (...find)` statements. | `any_expr` |
220222

221223
</details>

lua/luasnip-snippets/snippets/cpp/postfix.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,18 @@ return {
5959
"?.begin(), ?.end()",
6060
"Completes an expr with both begin() and end()"
6161
),
62+
expr_tsp(
63+
".cbe",
64+
"?.cbegin(), ?.cend()",
65+
"Completes an expr with both cbegin() and cend()"
66+
),
6267
expr_tsp(".mv", "std::move(?)"),
6368
expr_tsp(".fwd", "std::forward<decltype(?)>(?)"),
6469
expr_tsp(".val", "std::declval<?>()"),
6570
expr_tsp(".dt", "decltype(?)"),
6671
expr_tsp(".uu", "(void)?"),
6772
expr_tsp(".single", "ranges::views::single(?)"),
73+
expr_tsp(".await", "co_await ?"),
6874

6975
tsp.treesitter_postfix({
7076
trig = ".ts",

0 commit comments

Comments
 (0)