jsmdcui 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (258) hide show
  1. package/CHANGELOG.md +76 -0
  2. package/LICENSE +22 -0
  3. package/README.md +285 -0
  4. package/package.json +17 -0
  5. package/project_structure.txt +35 -0
  6. package/runmd.mjs +240 -0
  7. package/runtime/colorschemes/atom-dark.micro +33 -0
  8. package/runtime/colorschemes/bubblegum.micro +31 -0
  9. package/runtime/colorschemes/cmc-16.micro +47 -0
  10. package/runtime/colorschemes/cmc-tc.micro +43 -0
  11. package/runtime/colorschemes/darcula.micro +34 -0
  12. package/runtime/colorschemes/default.micro +1 -0
  13. package/runtime/colorschemes/dracula-tc.micro +49 -0
  14. package/runtime/colorschemes/dukedark-tc.micro +38 -0
  15. package/runtime/colorschemes/dukelight-tc.micro +38 -0
  16. package/runtime/colorschemes/dukeubuntu-tc.micro +38 -0
  17. package/runtime/colorschemes/geany.micro +29 -0
  18. package/runtime/colorschemes/gotham.micro +29 -0
  19. package/runtime/colorschemes/gruvbox-tc.micro +29 -0
  20. package/runtime/colorschemes/gruvbox.micro +26 -0
  21. package/runtime/colorschemes/material-tc.micro +36 -0
  22. package/runtime/colorschemes/monokai-dark.micro +28 -0
  23. package/runtime/colorschemes/monokai.micro +34 -0
  24. package/runtime/colorschemes/one-dark.micro +39 -0
  25. package/runtime/colorschemes/railscast.micro +37 -0
  26. package/runtime/colorschemes/simple.micro +33 -0
  27. package/runtime/colorschemes/solarized-tc.micro +31 -0
  28. package/runtime/colorschemes/solarized.micro +30 -0
  29. package/runtime/colorschemes/sunny-day.micro +29 -0
  30. package/runtime/colorschemes/twilight.micro +40 -0
  31. package/runtime/colorschemes/zenburn.micro +30 -0
  32. package/runtime/help/actions.md +161 -0
  33. package/runtime/help/cdp.md +119 -0
  34. package/runtime/help/colors.md +421 -0
  35. package/runtime/help/commands.md +161 -0
  36. package/runtime/help/copypaste.md +149 -0
  37. package/runtime/help/defaultkeys.md +148 -0
  38. package/runtime/help/help.md +285 -0
  39. package/runtime/help/keybindings.md +355 -0
  40. package/runtime/help/linter.md +90 -0
  41. package/runtime/help/options.md +709 -0
  42. package/runtime/help/plugins.md +544 -0
  43. package/runtime/help/tutorial.md +112 -0
  44. package/runtime/jsplugins/cdp/cdp-server.js +1161 -0
  45. package/runtime/jsplugins/cdp/cdp.js +192 -0
  46. package/runtime/jsplugins/chapter/chapter.js +108 -0
  47. package/runtime/jsplugins/diff/diff.js +46 -0
  48. package/runtime/jsplugins/example/example.js +110 -0
  49. package/runtime/jsplugins/linter/linter.js +281 -0
  50. package/runtime/plugins/autoclose/autoclose.lua +75 -0
  51. package/runtime/plugins/ftoptions/ftoptions.lua +17 -0
  52. package/runtime/plugins/literate/README.md +5 -0
  53. package/runtime/plugins/literate/literate.lua +55 -0
  54. package/runtime/plugins/status/help/status.md +21 -0
  55. package/runtime/plugins/status/status.lua +62 -0
  56. package/runtime/syntax/LICENSE +22 -0
  57. package/runtime/syntax/PowerShell.yaml +128 -0
  58. package/runtime/syntax/README.md +63 -0
  59. package/runtime/syntax/ada.yaml +43 -0
  60. package/runtime/syntax/apacheconf.yaml +59 -0
  61. package/runtime/syntax/arduino.yaml +101 -0
  62. package/runtime/syntax/asciidoc.yaml +51 -0
  63. package/runtime/syntax/asm.yaml +123 -0
  64. package/runtime/syntax/ats.yaml +99 -0
  65. package/runtime/syntax/awk.yaml +44 -0
  66. package/runtime/syntax/b.yaml +87 -0
  67. package/runtime/syntax/bat.yaml +57 -0
  68. package/runtime/syntax/c.yaml +60 -0
  69. package/runtime/syntax/caddyfile.yaml +23 -0
  70. package/runtime/syntax/cake.yaml +7 -0
  71. package/runtime/syntax/clojure.yaml +38 -0
  72. package/runtime/syntax/cmake.yaml +42 -0
  73. package/runtime/syntax/coffeescript.yaml +56 -0
  74. package/runtime/syntax/colortest.yaml +19 -0
  75. package/runtime/syntax/conky.yaml +17 -0
  76. package/runtime/syntax/cpp.yaml +91 -0
  77. package/runtime/syntax/crontab.yaml +36 -0
  78. package/runtime/syntax/crystal.yaml +72 -0
  79. package/runtime/syntax/csharp.yaml +52 -0
  80. package/runtime/syntax/css.yaml +44 -0
  81. package/runtime/syntax/csx.yaml +8 -0
  82. package/runtime/syntax/cuda.yaml +68 -0
  83. package/runtime/syntax/cython.yaml +52 -0
  84. package/runtime/syntax/d.yaml +121 -0
  85. package/runtime/syntax/dart.yaml +46 -0
  86. package/runtime/syntax/default.yaml +10 -0
  87. package/runtime/syntax/dockerfile.yaml +36 -0
  88. package/runtime/syntax/dot.yaml +29 -0
  89. package/runtime/syntax/elixir.yaml +30 -0
  90. package/runtime/syntax/elm.yaml +38 -0
  91. package/runtime/syntax/erb.yaml +42 -0
  92. package/runtime/syntax/erlang.yaml +45 -0
  93. package/runtime/syntax/fish.yaml +48 -0
  94. package/runtime/syntax/forth.yaml +34 -0
  95. package/runtime/syntax/fortran.yaml +64 -0
  96. package/runtime/syntax/freebsd-kernel.yaml +14 -0
  97. package/runtime/syntax/fsharp.yaml +48 -0
  98. package/runtime/syntax/gdscript.yaml +61 -0
  99. package/runtime/syntax/gemini.yaml +19 -0
  100. package/runtime/syntax/gentoo-ebuild.yaml +48 -0
  101. package/runtime/syntax/gentoo-etc-portage.yaml +23 -0
  102. package/runtime/syntax/git-commit.yaml +35 -0
  103. package/runtime/syntax/git-config.yaml +14 -0
  104. package/runtime/syntax/git-rebase-todo.yaml +19 -0
  105. package/runtime/syntax/gleam.yaml +69 -0
  106. package/runtime/syntax/glsl.yaml +26 -0
  107. package/runtime/syntax/gnuplot.yaml +15 -0
  108. package/runtime/syntax/go.yaml +62 -0
  109. package/runtime/syntax/godoc.yaml +17 -0
  110. package/runtime/syntax/golo.yaml +73 -0
  111. package/runtime/syntax/gomod.yaml +31 -0
  112. package/runtime/syntax/graphql.yaml +47 -0
  113. package/runtime/syntax/groff.yaml +30 -0
  114. package/runtime/syntax/groovy.yaml +111 -0
  115. package/runtime/syntax/haml.yaml +16 -0
  116. package/runtime/syntax/hare.yaml +52 -0
  117. package/runtime/syntax/haskell.yaml +52 -0
  118. package/runtime/syntax/hc.yaml +52 -0
  119. package/runtime/syntax/html.yaml +70 -0
  120. package/runtime/syntax/html4.yaml +25 -0
  121. package/runtime/syntax/html5.yaml +25 -0
  122. package/runtime/syntax/ini.yaml +23 -0
  123. package/runtime/syntax/inputrc.yaml +14 -0
  124. package/runtime/syntax/java.yaml +37 -0
  125. package/runtime/syntax/javascript.yaml +124 -0
  126. package/runtime/syntax/jinja2.yaml +19 -0
  127. package/runtime/syntax/json.yaml +39 -0
  128. package/runtime/syntax/jsonnet.yaml +92 -0
  129. package/runtime/syntax/julia.yaml +57 -0
  130. package/runtime/syntax/justfile.yaml +40 -0
  131. package/runtime/syntax/keymap.yaml +27 -0
  132. package/runtime/syntax/kickstart.yaml +16 -0
  133. package/runtime/syntax/kotlin.yaml +66 -0
  134. package/runtime/syntax/kvlang.yaml +67 -0
  135. package/runtime/syntax/ledger.yaml +14 -0
  136. package/runtime/syntax/lfe.yaml +17 -0
  137. package/runtime/syntax/lilypond.yaml +26 -0
  138. package/runtime/syntax/lisp.yaml +17 -0
  139. package/runtime/syntax/log.yaml +92 -0
  140. package/runtime/syntax/lua.yaml +111 -0
  141. package/runtime/syntax/mail.yaml +25 -0
  142. package/runtime/syntax/makefile.yaml +38 -0
  143. package/runtime/syntax/man.yaml +12 -0
  144. package/runtime/syntax/markdown.yaml +49 -0
  145. package/runtime/syntax/mc.yaml +23 -0
  146. package/runtime/syntax/meson.yaml +51 -0
  147. package/runtime/syntax/micro.yaml +34 -0
  148. package/runtime/syntax/mpdconf.yaml +13 -0
  149. package/runtime/syntax/msbuild.yaml +6 -0
  150. package/runtime/syntax/nanorc.yaml +16 -0
  151. package/runtime/syntax/nftables.yaml +30 -0
  152. package/runtime/syntax/nginx.yaml +22 -0
  153. package/runtime/syntax/nim.yaml +27 -0
  154. package/runtime/syntax/nix.yaml +32 -0
  155. package/runtime/syntax/nu.yaml +114 -0
  156. package/runtime/syntax/objc.yaml +60 -0
  157. package/runtime/syntax/ocaml.yaml +43 -0
  158. package/runtime/syntax/octave.yaml +83 -0
  159. package/runtime/syntax/odin.yaml +64 -0
  160. package/runtime/syntax/pascal.yaml +45 -0
  161. package/runtime/syntax/patch.yaml +14 -0
  162. package/runtime/syntax/peg.yaml +16 -0
  163. package/runtime/syntax/perl.yaml +58 -0
  164. package/runtime/syntax/php.yaml +60 -0
  165. package/runtime/syntax/pkg-config.yaml +12 -0
  166. package/runtime/syntax/po.yaml +12 -0
  167. package/runtime/syntax/pony.yaml +37 -0
  168. package/runtime/syntax/pov.yaml +21 -0
  169. package/runtime/syntax/privoxy-action.yaml +14 -0
  170. package/runtime/syntax/privoxy-config.yaml +10 -0
  171. package/runtime/syntax/privoxy-filter.yaml +12 -0
  172. package/runtime/syntax/proto.yaml +40 -0
  173. package/runtime/syntax/prql.yaml +84 -0
  174. package/runtime/syntax/puppet.yaml +22 -0
  175. package/runtime/syntax/python2.yaml +60 -0
  176. package/runtime/syntax/python3.yaml +80 -0
  177. package/runtime/syntax/r.yaml +32 -0
  178. package/runtime/syntax/raku.yaml +42 -0
  179. package/runtime/syntax/reST.yaml +18 -0
  180. package/runtime/syntax/renpy.yaml +15 -0
  181. package/runtime/syntax/rpmspec.yaml +43 -0
  182. package/runtime/syntax/ruby.yaml +73 -0
  183. package/runtime/syntax/rust.yaml +78 -0
  184. package/runtime/syntax/sage.yaml +60 -0
  185. package/runtime/syntax/scad.yaml +53 -0
  186. package/runtime/syntax/scala.yaml +33 -0
  187. package/runtime/syntax/sed.yaml +13 -0
  188. package/runtime/syntax/sh.yaml +69 -0
  189. package/runtime/syntax/sls.yaml +15 -0
  190. package/runtime/syntax/smalltalk.yaml +55 -0
  191. package/runtime/syntax/solidity.yaml +41 -0
  192. package/runtime/syntax/sql.yaml +35 -0
  193. package/runtime/syntax/stata.yaml +67 -0
  194. package/runtime/syntax/svelte.yaml +27 -0
  195. package/runtime/syntax/swift.yaml +103 -0
  196. package/runtime/syntax/systemd.yaml +16 -0
  197. package/runtime/syntax/tcl.yaml +18 -0
  198. package/runtime/syntax/terraform.yaml +87 -0
  199. package/runtime/syntax/tex.yaml +32 -0
  200. package/runtime/syntax/toml.yaml +56 -0
  201. package/runtime/syntax/twig.yaml +55 -0
  202. package/runtime/syntax/typescript.yaml +49 -0
  203. package/runtime/syntax/v.yaml +80 -0
  204. package/runtime/syntax/vala.yaml +26 -0
  205. package/runtime/syntax/verilog.yaml +60 -0
  206. package/runtime/syntax/vhdl.yaml +37 -0
  207. package/runtime/syntax/vi.yaml +31 -0
  208. package/runtime/syntax/vue.yaml +64 -0
  209. package/runtime/syntax/xml.yaml +37 -0
  210. package/runtime/syntax/xresources.yaml +14 -0
  211. package/runtime/syntax/yaml.yaml +34 -0
  212. package/runtime/syntax/yum.yaml +12 -0
  213. package/runtime/syntax/zig.yaml +52 -0
  214. package/runtime/syntax/zscript.yaml +72 -0
  215. package/runtime/syntax/zsh.yaml +52 -0
  216. package/single-exe/README.md +80 -0
  217. package/single-exe/assetsHelper.js +90 -0
  218. package/single-exe/assetsLoader.mjs +85 -0
  219. package/single-exe/compiled.js +149 -0
  220. package/single-exe/entry.mjs +9 -0
  221. package/single-exe/packAssets.sh +7 -0
  222. package/src/buffer/backup.js +160 -0
  223. package/src/buffer/buffer.js +126 -0
  224. package/src/buffer/fixed3-codec.js +140 -0
  225. package/src/buffer/loc.js +38 -0
  226. package/src/buffer/message.js +29 -0
  227. package/src/config/clean.js +172 -0
  228. package/src/config/colorscheme.js +99 -0
  229. package/src/config/config.js +122 -0
  230. package/src/config/defaults.js +109 -0
  231. package/src/cui/rpc.mjs +259 -0
  232. package/src/cui/server.mjs +116 -0
  233. package/src/display/ansi-style.js +60 -0
  234. package/src/highlight/highlighter.js +243 -0
  235. package/src/highlight/parser.js +225 -0
  236. package/src/index.js +8009 -0
  237. package/src/lua/engine.js +71 -0
  238. package/src/platform/archive.js +50 -0
  239. package/src/platform/clipboard.js +278 -0
  240. package/src/platform/commands.js +137 -0
  241. package/src/plugins/js-bridge.js +983 -0
  242. package/src/plugins/manager.js +674 -0
  243. package/src/runtime/assets.js +90 -0
  244. package/src/runtime/compiled.js +25 -0
  245. package/src/runtime/encodings.js +10 -0
  246. package/src/runtime/registry.js +134 -0
  247. package/src/screen/cell-buffer.js +81 -0
  248. package/src/screen/events.js +263 -0
  249. package/src/screen/screen.js +142 -0
  250. package/src/screen/vt100.js +571 -0
  251. package/src/shell/shell.js +70 -0
  252. package/testapp.md +55 -0
  253. package/tests/backup.test.js +133 -0
  254. package/tests/cmphex3b64.js +95 -0
  255. package/tests/pty-demo.js +492 -0
  256. package/tests/wv-client.js +96 -0
  257. package/tui +5 -0
  258. package/wui +5 -0
@@ -0,0 +1,33 @@
1
+ color-link comment "blue"
2
+ color-link constant "red"
3
+ color-link identifier "cyan"
4
+ color-link statement "yellow"
5
+ color-link symbol "yellow"
6
+ color-link preproc "magenta"
7
+ color-link type "green"
8
+ color-link special "magenta"
9
+ color-link ignore "default"
10
+ color-link error ",brightred"
11
+ color-link todo ",brightyellow"
12
+ color-link hlsearch "black,yellow"
13
+ color-link statusline "black,white"
14
+ color-link indent-char "black"
15
+ color-link line-number "yellow"
16
+ color-link current-line-number "red"
17
+ color-link diff-added "green"
18
+ color-link diff-modified "yellow"
19
+ color-link diff-deleted "red"
20
+ color-link gutter-error ",red"
21
+ color-link gutter-warning "red"
22
+ #Cursor line causes readability issues. Disabled for now.
23
+ #color-link cursor-line "white,black"
24
+ color-link color-column "white"
25
+ #No extended types. (bool in C)
26
+ color-link type.extended "default"
27
+ #No bracket highlighting.
28
+ color-link symbol.brackets "default"
29
+ #Color shebangs the comment color
30
+ color-link preproc.shebang "comment"
31
+ color-link match-brace ",magenta"
32
+ color-link tab-error "brightred"
33
+ color-link trailingws "brightred"
@@ -0,0 +1,31 @@
1
+ color-link default "#839496,#002833"
2
+ color-link comment "#586E75,#002833"
3
+ color-link identifier "#268BD2,#002833"
4
+ color-link constant "#2AA198,#002833"
5
+ color-link constant.specialChar "#DC322F,#002833"
6
+ color-link statement "#859900,#002833"
7
+ color-link symbol "#859900,#002833"
8
+ color-link preproc "#CB4B16,#002833"
9
+ color-link type "#B58900,#002833"
10
+ color-link special "#268BD2,#002833"
11
+ color-link underlined "#D33682,#002833"
12
+ color-link error "bold #CB4B16,#002833"
13
+ color-link todo "bold #D33682,#002833"
14
+ color-link hlsearch "#002833,#B58900"
15
+ color-link statusline "#003541,#839496"
16
+ color-link tabbar "#003541,#839496"
17
+ color-link indent-char "#003541,#002833"
18
+ color-link line-number "#586E75,#003541"
19
+ color-link current-line-number "#586E75,#002833"
20
+ color-link diff-added "#00AF00"
21
+ color-link diff-modified "#FFAF00"
22
+ color-link diff-deleted "#D70000"
23
+ color-link gutter-error "#003541,#CB4B16"
24
+ color-link gutter-warning "#CB4B16,#002833"
25
+ color-link cursor-line "#003541"
26
+ color-link color-column "#003541"
27
+ color-link type.extended "#839496,#002833"
28
+ color-link symbol.brackets "#839496,#002833"
29
+ color-link match-brace "#002833,#268BD2"
30
+ color-link tab-error "#D75F5F"
31
+ color-link trailingws "#D75F5F"
@@ -0,0 +1,30 @@
1
+ color-link comment "bold brightgreen"
2
+ color-link constant "cyan"
3
+ color-link constant.specialChar "red"
4
+ color-link identifier "blue"
5
+ color-link statement "green"
6
+ color-link symbol "green"
7
+ color-link preproc "brightred"
8
+ color-link type "yellow"
9
+ color-link special "blue"
10
+ color-link underlined "magenta"
11
+ color-link error "bold brightred"
12
+ color-link todo "bold magenta"
13
+ color-link hlsearch "black,yellow"
14
+ color-link statusline "black,brightblue"
15
+ color-link tabbar "black,brightblue"
16
+ color-link indent-char "black"
17
+ color-link line-number "bold brightgreen,black"
18
+ color-link current-line-number "bold brightgreen,default"
19
+ color-link diff-added "green"
20
+ color-link diff-modified "yellow"
21
+ color-link diff-deleted "red"
22
+ color-link gutter-error "black,brightred"
23
+ color-link gutter-warning "brightred,default"
24
+ color-link cursor-line "black"
25
+ color-link color-column "black"
26
+ color-link type.extended "default"
27
+ color-link symbol.brackets "default"
28
+ color-link match-brace ",blue"
29
+ color-link tab-error "brightred"
30
+ color-link trailingws "brightred"
@@ -0,0 +1,29 @@
1
+ color-link default "0,230"
2
+ color-link comment "244"
3
+ color-link constant.string "17"
4
+ color-link constant "88"
5
+ color-link identifier "22"
6
+ color-link statement "0,230"
7
+ color-link symbol "89"
8
+ color-link preproc "22"
9
+ color-link type "88"
10
+ color-link special "22"
11
+ color-link underlined "61,230"
12
+ color-link error "88"
13
+ color-link todo "210"
14
+ color-link hlsearch "0,253"
15
+ color-link statusline "233,229"
16
+ color-link tabbar "233,229"
17
+ color-link indent-char "229"
18
+ color-link line-number "244"
19
+ color-link diff-added "34"
20
+ color-link diff-modified "214"
21
+ color-link diff-deleted "160"
22
+ color-link gutter-error "88"
23
+ color-link gutter-warning "88"
24
+ color-link cursor-line "229"
25
+ #color-link color-column "196"
26
+ color-link current-line-number "246"
27
+ color-link match-brace "230,22"
28
+ color-link tab-error "210"
29
+ color-link trailingws "210"
@@ -0,0 +1,40 @@
1
+ # Twilight color scheme
2
+ color-link default "#F8F8F8,#141414"
3
+ color-link color-column "#1B1B1B"
4
+ color-link comment "#5F5A60"
5
+ color-link constant "#CF6A4C"
6
+ #color-link constant.number "#CF6A4C"
7
+ color-link constant.specialChar "#DDF2A4"
8
+ color-link constant.string "#8F9D6A"
9
+ color-link current-line-number "#868686,#1B1B1B"
10
+ color-link cursor-line "#1B1B1B"
11
+ color-link divider "#1E1E1E"
12
+ color-link error "#D2A8A1"
13
+ color-link diff-added "#00AF00"
14
+ color-link diff-modified "#FFAF00"
15
+ color-link diff-deleted "#D70000"
16
+ color-link gutter-error "#9B859D"
17
+ color-link gutter-warning "#9B859D"
18
+ color-link hlsearch "#141414,#C0C000"
19
+ color-link identifier "#9B703F"
20
+ color-link identifier.class "#DAD085"
21
+ color-link identifier.var "#7587A6"
22
+ color-link indent-char "#515151"
23
+ color-link line-number "#868686,#1B1B1B"
24
+ color-link current-line-number "#868686,#141414"
25
+ color-link preproc "#E0C589"
26
+ color-link special "#E0C589"
27
+ color-link statement "#CDA869"
28
+ color-link statusline "#515151,#1E1E1E"
29
+ color-link symbol "#AC885B"
30
+ color-link symbol.brackets "#F8F8F8"
31
+ color-link symbol.operator "#CDA869"
32
+ color-link symbol.tag "#AC885B"
33
+ color-link tabbar "#F2F0EC,#2D2D2D"
34
+ color-link todo "#8B98AB"
35
+ color-link type "#F9EE98"
36
+ color-link type.keyword "#CDA869"
37
+ color-link underlined "#8996A8"
38
+ color-link match-brace "#141414,#E0C589"
39
+ color-link tab-error "#D75F5F"
40
+ color-link trailingws "#D75F5F"
@@ -0,0 +1,30 @@
1
+ color-link default "188,237"
2
+ color-link comment "108,237"
3
+ color-link constant.string "174,237"
4
+ color-link constant.number "116,237"
5
+ color-link constant "181,237"
6
+ color-link identifier "223,237"
7
+ color-link statement "223,237"
8
+ color-link symbol "223,237"
9
+ color-link preproc "223,237"
10
+ color-link type "187,237"
11
+ color-link special "181,237"
12
+ color-link underlined "188,237"
13
+ color-link error "115,236"
14
+ color-link todo "bold 254,237"
15
+ color-link hlsearch "230,22"
16
+ color-link statusline "186,236"
17
+ color-link tabbar "186,236"
18
+ color-link indent-char "238,237"
19
+ color-link line-number "248,238"
20
+ color-link diff-added "34"
21
+ color-link diff-modified "214"
22
+ color-link diff-deleted "160"
23
+ color-link gutter-error "237,174"
24
+ color-link gutter-warning "174,237"
25
+ color-link cursor-line "238"
26
+ color-link color-column "238"
27
+ color-link current-line-number "188,237"
28
+ color-link match-brace "237,223"
29
+ color-link tab-error "167"
30
+ color-link trailingws "167"
@@ -0,0 +1,161 @@
1
+ # Actions
2
+ - Actions can be used with the `act` / `action` command
3
+ - (not implemented) or bound to keys via `bind`.
4
+
5
+ # Cursor Movement
6
+
7
+ - CursorUp
8
+ - CursorDown
9
+ - CursorLeft
10
+ - CursorRight
11
+ - CursorWordLeft
12
+ - CursorWordRight
13
+ - WordLeft
14
+ - WordRight
15
+ - SubWordLeft
16
+ - SubWordRight
17
+ - StartOfLine
18
+ - StartOfText
19
+ - StartOfTextToggle
20
+ - EndOfLine
21
+ - CursorStart
22
+ - CursorEnd
23
+ - Start
24
+ - End
25
+ - ParagraphPrevious
26
+ - ParagraphNext
27
+ - PageUp
28
+ - PageDown
29
+ - CursorPageUp
30
+ - CursorPageDown
31
+ - HalfPageUp
32
+ - HalfPageDown
33
+ - CursorToViewTop
34
+ - CursorToViewCenter
35
+ - CursorToViewBottom
36
+ - ScrollUp
37
+ - ScrollDown
38
+ - Center
39
+
40
+ # Selection
41
+
42
+ - SelectUp
43
+ - SelectDown
44
+ - SelectLeft
45
+ - SelectRight
46
+ - SelectWordLeft
47
+ - SelectWordRight
48
+ - SelectSubWordLeft
49
+ - SelectSubWordRight
50
+ - SelectToStartOfLine
51
+ - SelectToEndOfLine
52
+ - SelectToStartOfText
53
+ - SelectToStartOfTextToggle
54
+ - SelectToStart
55
+ - SelectToEnd
56
+ - SelectPageUp
57
+ - SelectPageDown
58
+ - SelectToParagraphPrevious
59
+ - SelectToParagraphNext
60
+ - SelectAll
61
+ - SelectLine
62
+ - Deselect
63
+
64
+ # Editing
65
+
66
+ - Backspace
67
+ - Delete
68
+ - InsertNewline
69
+ - InsertTab
70
+ - Undo
71
+ - Redo
72
+ - DeleteWordLeft
73
+ - DeleteWordRight
74
+ - IndentLine
75
+ - OutdentLine
76
+ - IndentSelection
77
+ - OutdentSelection
78
+ - MoveLinesUp
79
+ - MoveLinesDown
80
+ - DuplicateLine
81
+ - Duplicate
82
+ - DeleteLine
83
+ - ToggleComment
84
+ - Retab
85
+
86
+ # Clipboard
87
+
88
+ - Copy
89
+ - CopyLine
90
+ - Cut
91
+ - CutLine
92
+ - Paste
93
+ - PastePrimary
94
+
95
+ # Search
96
+
97
+ - Find
98
+ - FindNext
99
+ - FindPrevious
100
+ - FindLiteral
101
+ - ToggleHighlightSearch
102
+ - UnhighlightSearch
103
+ - ResetSearch
104
+
105
+ # File and Buffers
106
+
107
+ - Save
108
+ - SaveAs
109
+ - SaveAll
110
+ - OpenFile
111
+ - Quit
112
+ - ForceQuit
113
+ - QuitAll
114
+
115
+ # Tabs
116
+
117
+ - AddTab
118
+ - NextTab
119
+ - PreviousTab
120
+ - PrevTab
121
+ - FirstTab
122
+ - LastTab
123
+
124
+ # Splits
125
+
126
+ - VSplitAction
127
+ - HSplitAction
128
+ - NextSplit
129
+ - PreviousSplit
130
+ - FirstSplit
131
+ - LastSplit
132
+ - Unsplit
133
+
134
+ # Diff
135
+
136
+ - DiffNext
137
+ - DiffPrevious
138
+ - ToggleDiffGutter
139
+
140
+ # Autocomplete
141
+
142
+ - Autocomplete
143
+ - CycleAutocompleteBack
144
+
145
+ # Navigation
146
+
147
+ - JumpLine
148
+ - JumpToMatchingBrace
149
+
150
+ # UI and Modes
151
+
152
+ - CommandMode
153
+ - ShellMode
154
+ - ToggleHelp
155
+ - ToggleRuler
156
+ - ToggleKeyMenu
157
+ - ToggleOverwriteMode
158
+ - Escape
159
+ - ClearInfo
160
+ - ClearStatus
161
+ - None
@@ -0,0 +1,119 @@
1
+ #!/usr/bin/env bun
2
+
3
+ // ─── CDP (Chrome DevTools Protocol) ────────────────────────────────────────
4
+ //
5
+ // bunmicro can act as a CDP target, letting external scripts control it
6
+ // the same way Playwright or Bun.WebView controls a browser.
7
+ //
8
+ // ── Starting the server ────────────────────────────────────────────────────
9
+ //
10
+ // Inside the editor:
11
+ // Ctrl-E cdp → 127.0.0.1:9222
12
+ // Ctrl-E cdp 9000 → 127.0.0.1:9000
13
+ // Ctrl-E cdp --public → 0.0.0.0:9222
14
+ // Ctrl-E cdp 9000 --public → 0.0.0.0:9000
15
+ // Ctrl-E cdp --address=192.168.1.1 → 192.168.1.1:9222
16
+ // Ctrl-E cdp 9000 --address=192.168.1.1 → 192.168.1.1:9000
17
+ //
18
+ // From the command line (Chrome-style):
19
+ // bunmicro --remote-debugging-port=9222 file.txt
20
+ // bunmicro --remote-debugging-port=9222 --remote-debugging-address=0.0.0.0 file.txt
21
+ //
22
+ // Once running, status bar shows: CDP@<port> server running
23
+ // Running cdp again shows: CDP@<port> already running
24
+ //
25
+ // ── Connecting ─────────────────────────────────────────────────────────────
26
+ //
27
+ // Bun.WebView:
28
+ // const view = new Bun.WebView({
29
+ // backend: { type: "chrome", url: "ws://127.0.0.1:9222" }
30
+ // });
31
+ //
32
+ // Playwright (Node/Bun):
33
+ // const browser = await chromium.connectOverCDP("http://127.0.0.1:9222");
34
+ //
35
+ // ── Available methods ───────────────────────────────────────────────────────
36
+ //
37
+ // view.navigate(url) open file or URL in editor (Ctrl-E open)
38
+ // view.type(text) insert text at cursor
39
+ // view.press(key, opts?) send a key press
40
+ // key: "Enter","Backspace","Tab","Escape",
41
+ // "ArrowUp/Down/Left/Right",
42
+ // "Home","End","PageUp","PageDown",
43
+ // or single char "a"
44
+ // opts: { modifiers: bitmask }
45
+ // Alt=1 Ctrl=2 Meta=4 Shift=8
46
+ // view.click(x, y) move cursor to column x, line y (1-based)
47
+ // view.scroll(dx, dy) move cursor by dx cols and dy lines
48
+ // view.scrollTo(selector) find text or #anchor and jump to it
49
+ // view.evaluate(jsCode) run JS inside bunmicro's plugin context
50
+ // e.g. "micro.cmd.save()"
51
+ // view.goBack() switch to previous tab (PrevTab)
52
+ // view.goForward() switch to next tab (NextTab)
53
+ // view.resize(w, h) accepted by protocol but not yet implemented
54
+ //
55
+ // ── Example script below ───────────────────────────────────────────────────
56
+ // ctrl-a ctrl-c = select+copy all
57
+ // ctrl-t = new tab
58
+ // ctrl-v = paste
59
+ // ctrl-s filename.js enter
60
+ // run with bun filename.js
61
+
62
+ const cdpUrl = "ws://127.0.0.1:9222";
63
+
64
+ const view = new Bun.WebView({
65
+ backend: {
66
+ type: "chrome",
67
+ url: cdpUrl,
68
+ },
69
+ });
70
+
71
+ view.onNavigated = (url, title) => {
72
+ console.log(`[navigated] ${title || "(no title)"} — ${url.slice(0, 80)}`);
73
+ };
74
+
75
+ const delay = Bun.sleep
76
+ const startInterval = 1000
77
+ const interval = 500
78
+
79
+ try {
80
+
81
+ await delay(startInterval);
82
+
83
+ await view.navigate("https://raw.githubusercontent.com/jjtseng93/bunmicro/refs/heads/main/hlw.md");
84
+ await delay(interval);
85
+
86
+ await view.evaluate(
87
+ "micro.cmd.tab()"
88
+ );
89
+ await delay(interval);
90
+
91
+ await view.goBack();
92
+ await delay(interval);
93
+
94
+ //await view.goForward();
95
+ //await delay(interval);
96
+
97
+ await view.scrollTo("#hello");
98
+ await view.evaluate('micro.action.StartOfLine()');
99
+ await delay(interval);
100
+
101
+ await view.type("# Bun is great");
102
+ await delay(interval);
103
+
104
+ await view.press("Enter");
105
+ await delay(interval);
106
+
107
+ await view.click(3,3);
108
+ await delay(interval);
109
+ await view.scroll(4,3);
110
+
111
+ await view.resize(1280, 720);
112
+ await delay(interval);
113
+
114
+ console.log(
115
+ Bun.markdown.ansi('### All done')
116
+ )
117
+ } finally {
118
+ view.close();
119
+ }