Comments (5)
You are right, looks like a bug. I'll try to fix it as soon as possible.
On the other hand, I want to rewrite the edition mode from scratch and this bug is quite related, so it should be addressed as soon as the new edition mode is in place.
Thanks for reporting it!
from gocui.
I came across the same problem today, the problem seems to be that the handlers are executed after the key was already put in to the field, hence it reads the last (now empty) line. It would be great if handlers were called before any other action happens and - even better - if they could prevent further actions (as in not putting them in the edit-field).
from gocui.
@tkausl is right. v.Line
return the line in the position y
(relative to the view's origin). Initially v.Line(0)
points to the internal line 0 because the origin is (0, 0); but, once you press enter, a new line is inserter and the origin is moved to (0, 1) so v.Line(0)
points to internal line 1 when the keybinding handler is executed.
After 76554e4 handlers are executed before edition (for key events) and after mouse actions. However I'm not sure about preventing further actions... In that case, it would be better to use a non-editing keybinding or setting v.Edition = false
temporarily.
What do you think?
from gocui.
@tkausl can you check PR #66? :)
from gocui.
Looks good for a start
from gocui.
Related Issues (20)
- Wrong layout when Title uses a different encoding HOT 1
- True color support ? HOT 2
- Keybindings not working on FreeBSD HOT 3
- Examples does not support east asian windows? HOT 1
- Can you support run jar packet? HOT 1
- force update HOT 6
- Add a project that using gocui HOT 1
- Update Screenshot Example HOT 1
- Start printing at cursor position
- Add lazygit to the list of projects HOT 1
- Better tags support HOT 2
- how to read input
- Support ANSI code for hyperlinks
- Add Omnivore to projects list.
- Lazydocker is not listed HOT 2
- Extended ANSI color codes are not supported
- Is the library still actively maintained?
- Chinese Support HOT 2
- KeyBinding For Mouse(Any of them) dosn't trigger HOT 2
- git-bug relies on gocui
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gocui.