ilai-deutel / kibi Goto Github PK
View Code? Open in Web Editor NEWA text editor in ≤1024 lines of code, written in Rust
License: Other
A text editor in ≤1024 lines of code, written in Rust
License: Other
Currently, tests fail on WASI, likely due to WebAssembly/WASI#306:
$ cargo wasi test
running 9 tests
test config::tests::ini_processing_error_propagation ... Error: failed to run main module `.../target/wasm32-wasi/debug/deps/kibi-0e014d2d22062c7e.wasm`
Caused by:
0: failed to invoke command default
1: wasm trap: wasm `unreachable` instruction executed
wasm backtrace:
0: 0xaf1d7 - <unknown>!__rust_start_panic
1: 0x8a2d3 - <unknown>!rust_panic
2: 0x410bc - <unknown>!std::panicking::rust_panic_with_hook::h5cd357190ec2dc27
3: 0xace7d - <unknown>!std::panicking::begin_panic::{{closure}}::h2b921c6015217a8c
4: 0xaea75 - <unknown>!std::sys_common::backtrace::__rust_end_short_backtrace::h7804c064a89e5468
5: 0xad127 - <unknown>!std::panicking::begin_panic::h74bbbdc216a2be15
6: 0xaed39 - <unknown>!std::sys::wasi::os::temp_dir::h7c1705b1d80bf88f
7: 0xaf0c4 - <unknown>!std::env::temp_dir::h8de49376550872b5
8: 0xa3189 - <unknown>!tempfile::Builder::tempdir::he99c51adad158d09
9: 0xa0aa1 - <unknown>!tempfile::dir::TempDir::new::h467eed705bdbfad5
10: 0x64c6b - <unknown>!kibi::config::tests::ini_processing_helper::h04a043013200609f
11: 0x43ad2 - <unknown>!kibi::config::tests::ini_processing_error_propagation::hd9e29b0360fe1c0e
12: 0xaa1be - <unknown>!kibi::config::tests::ini_processing_error_propagation::{{closure}}::hd20dc0108869c254
13: 0xab2e1 - <unknown>!core::ops::function::FnOnce::call_once::h470aa8b99eb85c41
14: 0xaf0b7 - <unknown>!test::__rust_begin_short_backtrace::hdb236f9e8ab372e2
15: 0xaf032 - <unknown>!core::ops::function::FnOnce::call_once{{vtable.shim}}::h46e94de7b5f8562e
16: 0x20873 - <unknown>!test::run_test::run_test_inner::hb0fda869795a04b5
17: 0x1f050 - <unknown>!test::run_test::h5e16ffceb7355d13
18: 0x4765 - <unknown>!test::console::run_tests_console::hbd9d6e4ac7994c7e
19: 0x21c76 - <unknown>!test::test_main::ha1139bbdf0c18c77
20: 0x7fb9b - <unknown>!test::test_main_static::h88b81b227e6e27db
21: 0xae6bf - <unknown>!kibi::main::hcb06a8996b2c438e
22: 0xaa3cc - <unknown>!core::ops::function::FnOnce::call_once::hb9394b846f8ebed8
23: 0xa9ac3 - <unknown>!std::sys_common::backtrace::__rust_begin_short_backtrace::ha02a7b57bbe40130
24: 0xa6e84 - <unknown>!std::rt::lang_start::{{closure}}::h3ed9764642bc7713
25: 0x728f3 - <unknown>!std::rt::lang_start_internal::h114e06638993fc12
26: 0x92ab7 - <unknown>!std::rt::lang_start::hefbdca51d9ded6ce
27: 0xae610 - <unknown>!__original_main
28: 0xae96a - <unknown>!_start
29: 0xaf0a3 - <unknown>!_start.command_export
note: using the `WASMTIME_BACKTRACE_DETAILS=1` environment variable to may show more debugging information
Since update #9 and #26 were resolved, I wanted to test with the lastest version.
I did cargo install --git https://github.com/ilai-deutel/kibi.git
Doing the command kibi
in both cmd or powershell results in the same error.
It freezes on this.
D:\>kibi
�[999C�[999B�[6n
Then doing Ctrl+C
D:\>kibi
�[999C�[999B�[6n�[2J�[HError: Could not obtain cursor position
Ctrl-F
should search for a string in row.chars
, not row.render
.
For instance, a tab character should not be matched when a space is queried. Currently, a tab character is rendered as one or several spaces, so it will be matched.
Hi! I'm looking into packaging kibi for Gentoo Linux, and I noticed v0.2.2 was released quite some time ago (2021) and many commits have been made since then
Could you consider tagging a new release? Thanks!
Here's a mock-up of what I have so far if you are interested:
# Copyright 2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Auto-Generated by cargo-ebuild 0.5.4-r1
EAPI=8
CRATES="
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
"
inherit cargo
DESCRIPTION="A text editor in less than 1024 lines of code with syntax highlighting, search and more."
# Double check the homepage as the cargo_metadata crate
# does not provide this value so instead repository is used
HOMEPAGE="https://github.com/ilai-deutel/kibi"
SRC_URI="${CARGO_CRATE_URIS}"
# License set may be more restrictive as OR is not respected
# use cargo-license for a more accurate license picture
LICENSE="Apache-2.0 Apache-2.0-with-LLVM-exceptions MIT Unicode-DFS-2016 Unlicense"
SLOT="0"
KEYWORDS="~amd64"
DEPEND=""
RDEPEND="${DEPEND}"
BDEPEND=""
# rust does not use *FLAGS from make.conf, silence portage warning
# update with proper path to binaries this crate installs, omit leading /
QA_FLAGS_IGNORED="usr/bin/${PN}"
For Python and Groovy, both """
and '''
can be used as multi-line string delimiters, but the current configuration files only allow for one variant.
I f duplicated a line by accident or not wanting an entire line, there should be a feature for removing the unwanted line. #114
Describe the bug
When I start kibi on termux, i returns a "Permission Denied" error (as you can see in the sreenshot )
Note: I have all permissions required to edit the file.
To Reproduce
Use pkg install kibi
and try to open a file. Note: same error is given if kibi is installed with cargo install kibi
Expected behavior
Open editor and start editing the file
Screenshots
System information:
Thanks for this really good work, Woomy
Just to let you know that I've just pushed a package for kibi
to pkgsrc.
https://mail-index.netbsd.org/pkgsrc-changes/2020/10/28/msg223145.html
Is the lack of support for resizing the terminal on windows due to technical limitations or just a feature that is yet to be added?
We currently run code coverage on Unix and MacOS platforms. We should support Windows as well.
See https://doc.rust-lang.org/rustc/instrument-coverage.html for context
Add an option to show non-printable characters, similar to bat
:
Hi,
I am trying to build kibi for Windows 10 but it fails with compilation errors.
Can you please help.
OS Name: Microsoft Windows 10 Enterprise
OS Version: 10.0.19041 N/A Build 19041
OS Manufacturer: Microsoft Corporation
OS Configuration: Standalone Workstation
$ cargo build --release --locked --all-features
Compiling kibi v0.1.2 (C:\Users\vanand\kibi\kibi)
error[E0433]: failed to resolve: could not find `sys` in `nix`
--> src\editor.rs:6:10
|
6 | use nix::sys::termios::Termios;
| ^^^ could not find `sys` in `nix`
error[E0432]: unresolved imports `signal_hook::iterator`, `signal_hook::SIGWINCH`
--> src\editor.rs:7:19
|
7 | use signal_hook::{iterator::Signals, SIGWINCH};
| ^^^^^^^^ ^^^^^^^^ no `SIGWINCH` in the root
| |
| could not find `iterator` in `signal_hook`
error[E0432]: unresolved imports `libc::STDIN_FILENO`, `libc::STDOUT_FILENO`, `libc::TIOCGWINSZ`, `libc::VMIN`, `libc::VTIME`
--> src\terminal.rs:3:12
|
3 | use libc::{STDIN_FILENO, STDOUT_FILENO, TIOCGWINSZ, VMIN, VTIME};
| ^^^^^^^^^^^^ ^^^^^^^^^^^^^ ^^^^^^^^^^ ^^^^ ^^^^^
| | | | | |
| | | | | no `VTIME` in the root
| | | | | help: a similar name exists in the module: `ETIME`
| | | | no `VMIN` in the root
| | | no `TIOCGWINSZ` in the root
| | no `STDOUT_FILENO` in the root
| no `STDIN_FILENO` in the root
error[E0432]: unresolved imports `nix::pty`, `nix::sys`
--> src\terminal.rs:4:11
|
4 | use nix::{pty::Winsize, sys::termios};
| ^^^ ^^^ could not find `sys` in `nix`
| |
| could not find `pty` in `nix`
error[E0433]: failed to resolve: could not find `ioctl_read_bad` in `nix`
--> src\terminal.rs:35:10
|
35 | nix::ioctl_read_bad!(get_ws, TIOCGWINSZ, Winsize);
| ^^^^^^^^^^^^^^ could not find `ioctl_read_bad` in `nix`
error[E0412]: cannot find type `Termios` in this scope
--> src\editor.rs:109:19
|
109 | orig_termios: Termios,
| ^^^^^^^ not found in this scope
error[E0412]: cannot find type `Error` in crate `nix`
--> src\error.rs:8:14
|
8 | Nix(nix::Error),
| ^^^^^ not found in `nix`
|
help: possible candidates are found in other modules, you can import them into scope
|
3 | use core::fmt::Error;
|
3 | use crate::error::Error;
|
3 | use std::error::Error;
|
3 | use std::fmt::Error;
|
and 1 other candidate
error[E0412]: cannot find type `Error` in crate `nix`
--> src\error.rs:33:16
|
33 | impl From<nix::Error> for Error {
| ^^^^^ not found in `nix`
|
help: possible candidates are found in other modules, you can import them into scope
|
3 | use core::fmt::Error;
|
3 | use crate::error::Error;
|
3 | use std::error::Error;
|
3 | use std::fmt::Error;
|
and 1 other candidate
error[E0412]: cannot find type `Error` in crate `nix`
--> src\error.rs:35:23
|
35 | fn from(err: nix::Error) -> Self { Self::Nix(err) }
| ^^^^^ not found in `nix`
|
help: possible candidates are found in other modules, you can import them into scope
|
3 | use core::fmt::Error;
|
3 | use crate::error::Error;
|
3 | use std::error::Error;
|
3 | use std::fmt::Error;
|
and 1 other candidate
error[E0412]: cannot find type `Error` in crate `nix`
--> src\terminal.rs:8:71
|
8 | pub(crate) fn set_termios(term: &termios::Termios) -> Result<(), nix::Error> {
| ^^^^^ not found in `nix`
|
help: possible candidates are found in other modules, you can import them into scope
|
1 | use core::fmt::Error;
|
1 | use crate::error::Error;
|
1 | use std::error::Error;
|
1 | use std::fmt::Error;
|
and 1 other candidate
error[E0425]: cannot find function `get_ws` in this scope
--> src\terminal.rs:43:14
|
43 | unsafe { get_ws(STDOUT_FILENO, maybe_ws.as_mut_ptr()).ok().map(|_| maybe_ws.assume_init()) }
| ^^^^^^ not found in this scope
error: aborting due to 11 previous errors
UTF-8 characters are correctly loaded / saved, but not correctly displayed.
Expected:
🇬🇧 The quick brown fox jumps over the lazy dog
🇫🇷 Voix ambiguë d'un cœur qui, au zéphyr, préfère les jattes de kiwis.
Actual:
ð¬ð§ The quick brown fox jumps over the lazy dog
ð«ð· Voix ambiguë d'un cÃÂur qui, au zéphyr, préfère les jattes de kiwis.
Describe the bug
i install the kibi via command --cargo install kibi.
my os is win10,and i put config files at the location of "C:\Users\Administrator\AppData\Kibi\syntax.d" which is according to the guide(A configuration file can be located at %APPDATA%\Kibi\config.ini.).
but when i open the build.rs ,the Syntax highlighting does not take effect.
To Reproduce
Expected behavior
Screenshots
System information:
rustc --version
):rustc 1.68.2 (9eb3afe9e 2023-03-27)kibi --version
):v0.2.2Additional context
The editor supports UTF-8 characters, but they are not accepted for prompts (search for a query that contains non-ASCII characters, enter a file name that contains non-ASCII characters).
See Job #92.8:
$ rustup component add rustfmt
error: component 'rustfmt' for target 'x86_64-unknown-linux-gnu' is unavailable for download for channel nightly
Sometimes not all components are available in any given nightly.
The command "rustup component add rustfmt" failed and exited with 1 during .
kibi /dev/random
should fail with an error message
std::os::unix::fs::FileTypeExt can be used to determine the file type.
On UNIX platforms, we call update_window_size
when a SIGWINCH
signal is received.
Similarly, we should update the window size on Windows when the console is resized.
rustfmt
cargo-clippy
cargo-audit
Code coverage must be run on different platforms (Linux, MacOS, Windows).
It looks like grcov
supports these platforms, as opposed to the more popular but Linux-only tarpaulin
.
An action is available: https://github.com/actions-rs/grcov
This seems like an awesome project, I might even switch from my current editor, Micro!
However these features are essential to my workflow :p
Maintaining a history of commands and being able to apply/revert them could be a substantial change. Investigate whether it is possible without going over the line constraint.
A shortcut could be use to cut and paste lines. (Suggested by @andradei in #8 (comment))
This could be similar to Ctrl-K
/ Ctrl-U
in nano.
Is your feature request related to a problem? Please describe.
Hi, after using a feature (like search) the bottom line with the shortcut hints goes away. I would find it useful if the shortcuts stayed visible, otherwise I have to keep closing/re-opening while I'm still learning the shortcuts.
I'm happy to submit a PR to add this if it's wanted.
Setup continuous deployment:
Example CD pipelines for inspiration:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.