linde12 / kod Goto Github PK
View Code? Open in Web Editor NEWterminal text editor written in Go, using xi-editor as backend
License: MIT License
terminal text editor written in Go, using xi-editor as backend
License: MIT License
As described by @sjoshid:
If you move cursor to end of last line and hit return, the cursor doesnt move to next line. But if you start typing it enters the line in correct location.
How did you get xi-core ? It seems its rust based... ?
Could ou ad somethng to the readme.
BTW this looks really nice. The way the RPC works is super clean.
Try typing æøå into the editor.
When copying some text from outside and pasting it in kod
, some characters and words are skipped.
Does anyone face a similar problem? I tried this with gnome-terminal and xterm with latest commit on xi core repository (xi-editor/xi-editor@25d2a72).
When you use Ctrl+Q to close Kod, the terminal looks bad. So bad.
Using F1 works as expected.
Here when you press F1 Kod calls close() and then kod finishes the editor.
Here But when you press Ctrl+Q, Kod only calls os.Exit()
I can send a pull request., but I would like to know how it should be done.
If I'm not wrong, F1 is to exit the whole editor and Ctrl+Q is to close the current view but for now we can only have 1 view, right? If so, do you think that they should do the same thing until Kod supports multiple views (if it will)?
We're not entirely sure when "update" is called, but i'm guessing it's when e.g. a third party plugin will do some changes to the code. E.g. syntect.
Essentially it's not sure whether "update" works or not and we want to remove the use of the addLines
method so that we can remove it completely.
I'm new to go, so I don't know if this is a bug or my own ignorance, but when I run
go get github.com/linde12/kod
I get the following error:
gocode/src/github.com/linde12/kod/kod.go:10:2: local import "./editor" in non-local package
And I don't know where to go from there.
On startup we show line numbers for the full height of the editor, but once the users moves the cursor the line numbers update to only extend to the length of the document.
We should only display line numbers for the lines, not the whole window.
I have tried editor today and have some further issues to implement.
I didn't find them on exisiting issues and main README TODO list
installation went smoothly, kudos for that.
now I have numbered lines, and I can type, but that's it. Oh, the cursor keys work too.
but ... I need a howto for dummies: key combination to e.g. save, quit, mark-copy-paste, etc. ?
not even Ctrl-c does anything anymore.
thanks!
The core introduced a breaking change and i haven't had the time to update kod yet.
I think this can be fixed somewhere in the ApplyUpdate method in editor/linecache.go
There are a few editors which have implemented this already. I believe xi-tui(rust) amongst other should work with the latest version. There is also some documentation about this in the xi-editor project.
When trying to write RTL languages such as Arabic or Aramaic (the two I happen to be working with regularly, didn't try an unconnected one like Hebraic), it looks like this:
The expected result would be like what e.g. gxi displays:
Note that in the second screenshot, some will argue that the RTL languages should not be aligned to the left edge of the window. I disagree partly. That's good behaviour for documents that are RTL only but mostly, in a text editor, one will be working with LTR/RTL-mixed documents, where it's much less confusing to have a main direction, so the above is actually really nice and shows that xi-core itself doesn't seem to have a problem with it.
It would help people who doesn't have any previous experience with Go (like me!) but want to get started quickly and try this project.
Check linenumbers in other editors.
Fixes use with termite and possibly other terminals.
Fix is easy, attached is an example patch (but feel free to ignore and handle otherwise) which does what you'd expect :).
Built on Windows and opened the same file (kod.go
) in both Visual Studio Code
and kod
launched from Powershell
. The screenshot is from the builtin terminal in VS Code
, but I get the same result in a standalone Powershell
window.
In the following screenshot the cursor is in the same position in both panes, on line 16 (15 in kod
). You can see that the rest of the file past the cursor does not render in kod
. The entire file is rendered on first load, but as soon as the cursor is moved the rest of the file disappears.
Additionally, there is noticeable flicker whenever the cursor moves.
If you type a lot of lines until your cursor is not in the viewport and you save, then you start moving the cursor up, it will move multiple lines and then crash.
Edit: And if it doesn't crash it just starts acting weird. But it will eventually crash.
just wondering if still being worked on? last commit was 2 years ago more or less.
The default keybinds to move per word, move to the start/end of line, etc. Are different in each platform, at least on windows and mac.
If Kod is still going to use "normal" keybinds (arrows to move, ctrl-s to save), it should make sense to make the default keybinds the same of their respective platforms. This should be impossible for mac because of "cmd" key but "ctrl" could be used instead.
This shouldn't be hard to do, at least until there is another way to handle input like a vim-like plugin.
/Users/maverick/xi-editor/rust/target/debug/xi-core:/Users/maverick/go¬/bin:/Users/maverick/go/bin:/Users/maverick/.cargo/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/go/bin:/opt/X11/bin¬:/Users/maverick/Library/Android/sdk/tools:/Users/maverick/Library/Android/sdk/platform-tools
Above is my $PATH, but every time I run kod
it tells me that "xi-core" is not in PATH. Not sure what is the problem. From my understanding of exec.LookPath, this should not be happening, as it should be checking $PATH
I am on MacOS.
I tried adding this within the buffer part of the views, but it was kind of hairy to keep adding offsets depending on the width of the gutter.
I think it's better to have the gutter as a separate view, just like the topbar and bottombar.
kod
without arguments could mean "create new document".After getting and building the application, this happens after trying to execute the built executable:
panic: runtime error: index out of range
goroutine 1 [running]:
github.com/linde12/kod/editor.(*Editor).Start(0xc42007e3c0)
/Users/daniel/src/golang/src/github.com/linde12/kod/editor/editor.go:139 +0x6f2
main.main()
/Users/daniel/src/golang/src/kod/kod.go:42 +0x23f
Go version: go version go1.9.3 darwin/amd64
(installed via Homebrew)
Just curious if this project is dead or if you'll continue working on it.
Scanner has a line size limit.
From the docs of scanner
// Programs that need more control over error handling or large tokens, or must run sequential scans on a reader, should use bufio.Reader instead
This is the error thrown when the line from xi-code is too long:
ErrTooLong = errors.New("bufio.Scanner: token too long")
I can work on the issue
user@machine ~ $ git clone https://github.com/linde12/kod.git
[...]
user@machine ~ $ cd kod
user@machine ~/kod $ which xi-core
/home/user/.cargo/bin/xi-core
user@machine ~/kod $ go build
kod.go:10:2: cannot find package "github.com/linde12/kod/editor" in any of:
/usr/lib64/golang/src/github.com/linde12/kod/editor (from $GOROOT)
/home/user/go/src/github.com/linde12/kod/editor (from $GOPATH)
user@machine ~/kod $
Are the instructions missing anything or am I doing something wrong?
Hi,
I'm trying to run kod like ./kod sample
which gives me the following. I'm new to xi-editor, kod and Go. Am I missing something?
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x4821df]
goroutine 1 [running]:
panic(0x5e6000, 0xc82000e130)
/usr/lib/go-1.6/src/runtime/panic.go:481 +0x3e6
github.com/linde12/kod/editor.(*InputHandler).Insert(0x0, 0xc820430018, 0x1)
$HOME/Documents/xi-kod/src/github.com/linde12/kod/editor/inputhandler.go:77 +0x36f
github.com/linde12/kod/editor.(*View).HandleEvent(0xc8202383c0, 0x7f76ed79e7e8, 0xc82000b4e0)
$HOME/Documents/xi-kod/src/github.com/linde12/kod/editor/view.go:140 +0xe5
github.com/linde12/kod/editor.(*Editor).handleEvent(0xc8200147d0, 0x7f76ed79e7e8, 0xc82000b4e0)
$HOME/Documents/xi-kod/src/github.com/linde12/kod/editor/editor.go:50 +0xcf
github.com/linde12/kod/editor.(*Editor).Start(0xc8200147d0)
$HOME/Documents/xi-kod/src/github.com/linde12/kod/editor/editor.go:188 +0x58a
main.main()
$HOME/Documents/xi-kod/src/github.com/linde12/kod/kod.go:42 +0x42d
kod startup failes with terminal entry not found
in st even before telling me that I forgot the file name. I tried xterm, where it works as expected, and urxvt, where it starts but has lots of rendering issues.
I didn't try fancy GTK or QT based terminal emulators.
UPDATE: Related to gdamore/tcell#118 . As soon as I change $TERM
accordingly, it works.
./kod.go:46:23: too many arguments in call to editor.NewEditor
have (readwriter, string)
want (io.ReadWriter)
Seems like some changes where done in commit cebc8591#diff-a4099a04e355d56f90cecf992fc01a06L52. But the signature is still wrong for editor.NewEditor.
Am I doing something wrong?
Kod right now doesn't have a license. So, if i'm not wrong, legally kod is not libre software 😢
Using MacOS Mojave, ITerm and default MacOS terminal.
If I write lines until they fill the viewport I cannot see the new lines. Kod still receives my input because if I delete the first lines I can see what I wrote.
I can work on it. I just need a clue about why it doesn't work on mac because I see that it works on linux (I suppose, by looking at the screenshot in README.md)
currently plugins aren't loaded because now you have to explicitly set a config_dir and pass to xi-core.
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.