Skip to content

Commit

Permalink
Updated dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Nimaoth committed Jan 17, 2025
1 parent 9017ebb commit b774902
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 18 deletions.
6 changes: 1 addition & 5 deletions config/keybindings_vim.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1113,13 +1113,9 @@ proc loadVimKeybindings*() {.expose("load-vim-keybindings").} =
editor.updateTargetColumn()

addTextCommandBlockDesc "", "/", "open search bar":
commandLine(r".set-search-query \")
editor.openSearchQuery()
if getActiveEditor().isTextEditor(editor):
var arr = newJArray()
arr.add newJString("file")
discard editor.runAction("move-last", arr)
editor.setMode("insert")
editor.updateTargetColumn()

addTextCommandBlockDesc "", r"\\", "open global search bar":
commandLine(r"search-global \")
Expand Down
6 changes: 3 additions & 3 deletions nev.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ bin = @["nev"]
requires "nim >= 2.0.0"
requires "nimgen >= 0.5.4"
requires "https://github.com/Nimaoth/vmath#661bdaa"
requires "https://github.com/Nimaoth/pixie >= 5.0.8"
requires "https://github.com/Nimaoth/pixie >= 5.0.9"
requires "chroma >= 0.2.7"
requires "winim >= 3.9.4"
requires "fusion >= 1.2"
Expand All @@ -33,13 +33,13 @@ requires "results >= 0.5.0"
requires "chronos >= 4.0.3"
requires "fsnotify#725614b59f1179fc739871594d959660e032c4eb"
requires "https://github.com/Nimaoth/ws >= 0.5.0"
requires "https://github.com/Nimaoth/windy >= 0.0.2"
requires "https://github.com/Nimaoth/windy >= 0.0.3"
requires "https://github.com/Nimaoth/wasm3 >= 0.1.17"
requires "https://github.com/Nimaoth/lrucache.nim >= 1.1.4"
requires "https://github.com/Nimaoth/boxy >= 0.4.4"
requires "https://github.com/Nimaoth/nimtreesitter-api >= 0.1.17"
requires "https://github.com/Nimaoth/nimwasmtime >= 0.2.1"
requires "https://github.com/Nimaoth/nimsumtree >= 0.4.1"
requires "https://github.com/Nimaoth/nimsumtree >= 0.4.2"

# Use this to include all treesitter languages (takes longer to download)
requires "https://github.com/Nimaoth/nimtreesitter >= 0.1.6"
Expand Down
18 changes: 9 additions & 9 deletions nimble.lock
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@
}
},
"pixie": {
"version": "5.0.8",
"vcsRevision": "710ea68f5a775dbf11242c5a6099a241af802e0d",
"version": "5.0.9",
"vcsRevision": "16d28531b59c0239e9f66d15f07e3ae6e4db0491",
"url": "https://github.com/Nimaoth/pixie",
"downloadMethod": "git",
"dependencies": [
Expand All @@ -132,7 +132,7 @@
"crunchy"
],
"checksums": {
"sha1": "2e787f1aa2457741c4453bc48952c1c61e741981"
"sha1": "001a5e30d0ff33f70d3dc9144a9c825a777e2316"
}
},
"shady": {
Expand Down Expand Up @@ -349,13 +349,13 @@
}
},
"nimsumtree": {
"version": "0.4.1",
"vcsRevision": "9b0bcb9dc98cfc97c28694657d10af09228a937b",
"version": "0.4.2",
"vcsRevision": "b640747a0262b3aac132dd8885c20f7c6c8ce692",
"url": "https://github.com/Nimaoth/nimsumtree",
"downloadMethod": "git",
"dependencies": [],
"checksums": {
"sha1": "24f97753950e0ee16d4b0271752b7576dac33afd"
"sha1": "fa0573f4bc8394b29f049812a086237db7d690f6"
}
},
"nimtreesitter": {
Expand Down Expand Up @@ -445,8 +445,8 @@
}
},
"windy": {
"version": "0.0.2",
"vcsRevision": "88c236aa063566e8cdf51ffca65d1baaa1b9a64e",
"version": "0.0.3",
"vcsRevision": "fd6279718e0cc021f046fa294242845129829cc1",
"url": "https://github.com/Nimaoth/windy",
"downloadMethod": "git",
"dependencies": [
Expand All @@ -456,7 +456,7 @@
"ws"
],
"checksums": {
"sha1": "24e28d958500ba8a55574faad4e111028f64aade"
"sha1": "74a34badb416d48a2f02cc783f113018e8400a1b"
}
},
"winim": {
Expand Down
15 changes: 15 additions & 0 deletions scripting/editor_text_api_wasm.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1913,6 +1913,21 @@ proc setSearchQuery*(self: TextDocumentEditor; query: string;
argsJsonString.cstring)


proc editor_text_openSearchQuery_void_TextDocumentEditor_string_bool_bool_wasm(
arg: cstring): cstring {.importc.}
proc openSearchQuery*(self: TextDocumentEditor; query: string = "";
scrollToPreview: bool = true; select: bool = true) {.
gcsafe, raises: [].} =
var argsJson = newJArray()
argsJson.add self.toJson()
argsJson.add query.toJson()
argsJson.add scrollToPreview.toJson()
argsJson.add select.toJson()
let argsJsonString = $argsJson
let res {.used.} = editor_text_openSearchQuery_void_TextDocumentEditor_string_bool_bool_wasm(
argsJsonString.cstring)


proc editor_text_setSearchQueryFromMove_Selection_TextDocumentEditor_string_int_string_string_wasm(
arg: cstring): cstring {.importc.}
proc setSearchQueryFromMove*(self: TextDocumentEditor; move: string;
Expand Down
13 changes: 12 additions & 1 deletion src/platform/terminal_platform.nim
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,17 @@ proc fillRect(self: TerminalPlatform, bounds: Rect, color: chroma.Color) =
self.buffer.fillBackground(bounds.x.int, bounds.y.int, bounds.xw.int - 1, bounds.yh.int - 1)
self.buffer.setBackgroundColor(bgNone)

proc drawRect(self: TerminalPlatform, bounds: Rect, color: chroma.Color) =
let mask = if self.masks.len > 0:
self.masks[self.masks.high]
else:
rect(vec2(0, 0), self.size)

let bounds = bounds and mask

self.setForegroundColor(color)
self.buffer.drawRect(bounds.x.int, bounds.y.int, bounds.xw.int - 1, bounds.yh.int - 1)

# proc drawRect(self: TerminalPlatform, bounds: Rect, color: chroma.Color) =
# let mask = if self.masks.len > 0:
# self.masks[self.masks.high]
Expand Down Expand Up @@ -555,7 +566,7 @@ proc drawNode(builder: UINodeBuilder, platform: TerminalPlatform, node: UINode,
for command in node.renderCommands.commands:
case command.kind
of RenderCommandKind.Rect:
platform.fillRect(command.bounds + nodePos, command.color)
platform.drawRect(command.bounds + nodePos, command.color)
of RenderCommandKind.FilledRect:
platform.fillRect(command.bounds + nodePos, command.color)
of RenderCommandKind.Text:
Expand Down

0 comments on commit b774902

Please sign in to comment.