Skip to content

Commit edfa732

Browse files
committed
Add clojure_sublimed_select_topmost_form command
1 parent 76b7697 commit edfa732

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
### WIP
22

33
- Clarified some symbol/keyword edge cases in syntax
4+
- Add `clojure_sublimed_select_topmost_form` command
45

56
### 4.3.1 - Nov 4, 2024
67

Clojure Sublimed Light.sublime-color-scheme

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@
3535
"bracket_contents_foreground": "var(active)",
3636
"tags_options": "underline",
3737
"tags_foreground": "var(active)",
38-
"gutter": "#F8F8F8",
39-
"gutter_foreground": "#DDDDDD",
40-
"gutter_foreground_highlight": "#DDDDDD",
38+
// "gutter": "#E6E6E6",
39+
"gutter_foreground": "#CCC",
40+
"gutter_foreground_highlight": "#CCC",
4141
},
4242
"rules":
4343
[ {"name": "Strings",

Default.sublime-commands

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@
8080
"caption": "Clojure Sublimed: Pretty-print selection",
8181
"command": "clojure_sublimed_pretty_print"
8282
},
83+
{
84+
"caption": "Clojure Sublimed: Select topmost form",
85+
"command": "clojure_sublimed_select_topmost_form"
86+
},
8387
{
8488
"caption": "Clojure Sublimed: Toggle comment",
8589
"command": "clojure_sublimed_toggle_comment"

cs_indent.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,13 @@ def run(self, edit):
159159
formatted = cs_printer.format(form, node, limit = cs_common.wrap_width(view))
160160
view.replace(edit, region, formatted)
161161

162+
class ClojureSublimedSelectTopmostFormCommand(sublime_plugin.TextCommand):
163+
def run(self, edit):
164+
view = self.view
165+
sel = view.sel()
166+
for region in [r for r in sel]:
167+
sel.add(cs_parser.topmost_form(view, region.begin()))
168+
162169
def cljfmt_indent(view, point):
163170
i = None
164171
try:

0 commit comments

Comments
 (0)