Skip to content

whitespace at end of line in commit msg eats cursor #247

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
extrawurst opened this issue Aug 27, 2020 · 14 comments
Closed

whitespace at end of line in commit msg eats cursor #247

extrawurst opened this issue Aug 27, 2020 · 14 comments
Labels
bug Something isn't working good first issue Good for newcomers
Milestone

Comments

@extrawurst
Copy link
Collaborator

image

move cursor one left:
image

@extrawurst extrawurst added bug Something isn't working good first issue Good for newcomers labels Aug 27, 2020
@extrawurst extrawurst modified the milestones: v0.10, v0.11 Aug 27, 2020
@ciaranmooney
Copy link

ciaranmooney commented Sep 17, 2020

I think I understand where this might be coming from. I believe the building of the output of a TextInput component mixes the styling and content to a point where the above issue can occur.

As part of #197 I am partway through refactoring how TextInput builds up the Text return value. Where the String containing the characters and the styling are built up in stages. See this branch.

My changes are currently broken with regards to an existing test and UTF-8 (the carriage return symbol). Once that is sorted I'll write another test for the above scenario to see if the issue has been solved as part of my changes.

@edfloreshz
Copy link
Contributor

I'm not very familiar with the project but I'd like to try to fix the issue.

@extrawurst
Copy link
Collaborator Author

@edfloreshz I think @ciaranmooney is working on this already, please make sure to checkout his branch first, so we don't have two people fixing the same issue :)

@ciaranmooney
Copy link

ciaranmooney commented Oct 4, 2020

@edfloreshz Indeed, I believe my refactor of the TextComponent will remove this issue (see my branch). Although I haven't tested it yet. I've got my head around how the area is working so I feel well placed to solve this issue.

@edfloreshz
Copy link
Contributor

Okay, thanks for letting me know @ciaranmooney @extrawurst! 🙂

@extrawurst
Copy link
Collaborator Author

@ciaranmooney is this still coming in at some point? maybe other might want to look into this particular issue until then so we can clear it for 0.11

@ciaranmooney
Copy link

I am afraid I will have to concede defeat to this issue and allow others to take a crack at it.

@pm100
Copy link
Contributor

pm100 commented Oct 30, 2020

can you explain what the bug is, I dont see it

@extrawurst
Copy link
Collaborator Author

On the screenshots you can see that the underscore indicating the cursor position disappears when under a space at the end of a line

@pm100
Copy link
Contributor

pm100 commented Oct 31, 2020

how did you get that new line in there?

And I have no cursor when typing only when backtracking (left / right arrow), is that right?

@extrawurst
Copy link
Collaborator Author

extrawurst commented Oct 31, 2020

You can use the external editor to get linebreaks in there. If you do not see the underscore you see the bug :)

@pm100
Copy link
Contributor

pm100 commented Oct 31, 2020

got it, let me tackle this - i suspect its a tui issue

@pm100
Copy link
Contributor

pm100 commented Oct 31, 2020

as i suspected this is a tui bug, I have filed a bug with them and a solution

fdehau/tui-rs#404

when they fix it the trailing " " character needs to be a trailing NBSP character

const NBSP: &str = "\u{00a0}";

there is a simple work round for gitui, which is to use a '_' character instead of a space at the end of the line while editing. This looks slightly odd because the underline character is slightly different to the underline of a space. But its barely noticeable. You want a PR for that? It means there is an always visible cursor which is nice.

The alternative is to turn of text wrap but I dont think thats a good idea.

@extrawurst
Copy link
Collaborator Author

Screenflick Movie 87

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants