Opened 8 years ago

Closed 7 years ago

Last modified 7 years ago

#7955 closed bug (fixed)

[BTextView] can't set cursor to the end of this file

Reported by: diver Owned by: leavengood
Priority: normal Milestone: R1
Component: Kits/Interface Kit Version: R1/Development
Keywords: Cc: x-otic@…
Blocked By: Blocking:
Has a Patch: yes Platform: All

Description

I can't move cursor to the end of the line in this file using StyledEdit.

Attachments (2)

unreachable_end_of_line.txt (66 bytes ) - added by diver 8 years ago.
CorrectTabWidth.patch (1000 bytes ) - added by x-ist 7 years ago.
Correction of tab width calculation in BTextView.

Download all attachments as: .zip

Change History (8)

by diver, 8 years ago

Attachment: unreachable_end_of_line.txt added

comment:1 by x-ist, 7 years ago

Has a Patch: set

comment:2 by x-ist, 7 years ago

Cc: x-otic@… added
Component: Applications/StyledEditKits/Interface Kit
Owner: changed from korli to axeld
Summary: [StyledEdit] can't set cursor to the end of this file[BTextView] can't set cursor to the end of this file

In fact this appears to be a BTextView issue. In rare cases such as described above BTextView happens to calculate the width of a tab close to zero (e.g. 0.000031). This patch adds a fallback to the default tab width in that case. Fixes #7955.

This bug is visible under really seldom conditions. I could reproduce it with that exact string and with the default font (DejaVu Sans Book) only. Other fonts used with that string did not reveal this behaviour. However, it can be reproduced by pasting that text into the navigator editbox of Tracker, which indicated that it is an Interface Kit issue.

Last edited 7 years ago by x-ist (previous) (diff)

by x-ist, 7 years ago

Attachment: CorrectTabWidth.patch added

Correction of tab width calculation in BTextView.

comment:3 by leavengood, 7 years ago

Owner: changed from axeld to leavengood
Status: newin-progress

I'll test this patch and try to commit it this week. Taking ownership.

in reply to:  3 comment:4 by x-ist, 7 years ago

Replying to leavengood:

I'll test this patch and try to commit it this week. Taking ownership.

Thanks a lot!

comment:5 by leavengood, 7 years ago

Resolution: fixed
Status: in-progressclosed

Thanks for the patch, I applied it in hrev44500 (woohoo, nice even number.)

Just a note for the future: when doing git commit messages it is generally preferred to have the first line 50 characters or less, then a blank line and more detail, wrapped at 72 characters. As you may notice in the above I fixed your commit message to be like that. Here is a blog post with more detail and the reasoning:

http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html

Also you had a line with extra whitespace in your patch, which we like to avoid. I fixed it though.

comment:6 by x-ist, 7 years ago

Thanks for your obligingness! I'll pay attention to that.

Note: See TracTickets for help on using tickets.