Skip to content
Merged

Dev #326

Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: astral-sh/setup-uv@c7f87aa956e4c323abf06d5dec078e358f6b4d04
- uses: astral-sh/setup-uv@v7.1.5
- name: run zizmor ci analysis tool
run: uvx zizmor --format sarif . > results.sarif
env:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v1.3.21
- Settable current working directory
- Fix window/terminal close bug

## v1.3.20
- PHP repl, Rust repl fixes
- Python3_original import indentation fix
Expand Down
58 changes: 29 additions & 29 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sniprun"
version = "1.3.20"
version = "1.3.21"
authors = ["michaelb <michael.bleuez2@gmail.com>"]
rust-version = "1.65"
edition = "2018"
Expand Down
3 changes: 3 additions & 0 deletions doc/sources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,9 @@ require'sniprun'.setup({
"TempFloatingWindow", --# implies LongTempFloatingWindow, which has no effect on its own
},

cwd = '.', --# set the working directory for build/run processes. By default or if set to '.',
--# is neovim's current working directory. Can be overwritten by interpreter-options

--# customize highlight groups (setting this overrides colorscheme)
--# any parameters of nvim_set_hl() can be passed as-is
snipruncolors = {
Expand Down
23 changes: 20 additions & 3 deletions doc/sources/common_options.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ EOF

The `use_on_filetypes` key is implicitely an option of every interpreter

```
```lua
interpreter_options = {
GFM_original = {
use_on_filetypes = {"markdown.pandoc", "rstudio" }
Expand Down Expand Up @@ -125,15 +125,15 @@ Almost every interpreter support either the "interpreter" or "compiler" key even

example:

```
```lua
interpreter_options = {
Python3_original = {
interpreter = "python3.9"
}
Rust_original = {
compiler = "/home/user/bin/rustc-patched -Zlocation-detail=none"
}
},
}
```

You can see what interpreters/compilers are being used at any time by watching sniprun's log for the line
Expand All @@ -148,3 +148,20 @@ Exceptions:
as they rely on the underlying interpreter for the code's block language and use its configuration.


### The "cwd" key

This key is supported by all interpreters and allows setting a specific
current working directory for all sub-processes (build, run, REPL processes...).

This key overwrites the global 'cwd' config field on a per-interpreter basis, which
itself defaults to the Neovim's current working directory.

If set, the pointed location must exist prior to running anything.

```lua
interpreter_options = {
Python3_original = {
cwd = "/tmp/python_projects"
}
}
```
Loading
Loading