withoutboats / notty

A new kind of terminal
GNU Affero General Public License v3.0
2.31k stars 41 forks source link

Fix tab right case. #17

Closed waynr closed 8 years ago

waynr commented 8 years ago

Naive fix for #13

withoutboats commented 8 years ago

I've got to try to figure out what the hell this boolean is about, I'm sure I excluded this case for a reason.

Sorry I am a very sloppy side project maintainer.

waynr commented 8 years ago

@withoutboats https://github.com/withoutboats/notty/commit/c6604df143159c6251ad50b183a2b69d83d69846

With this in mind I think the logic on this case https://github.com/withoutboats/notty/blob/master/src/datatypes/mod.rs#L149 should be sufficient to prevent anything bad happening if true is set and the new position would not exceed the width of the window.

withoutboats commented 8 years ago

You're right, if the cursor isn't at the edge of a grid it doesn't matter if it should wrap or not. Could you also make this change to the similar tab-left branch, then I'll merge?

Does this close #13 on your system, or does your ls tab past the end of the line as well?

waynr commented 8 years ago

This does close #13 in the sense that ls works, but it doesn't fix the case where the user tabs past the end of the line.

waynr commented 8 years ago

Also, I made the requested left-tab movement change.

withoutboats commented 8 years ago

Merged in. :smile: It fixed ls on my system too, so I closed that particular issue (breaking the most obvious command to run to check if its working is a bigger problem than not allowing tab right past the end of line).