RichTextFX icon indicating copy to clipboard operation
RichTextFX copied to clipboard

这个报错是什么原因引起的?

Open gfek2001zz opened this issue 1 month ago • 8 comments

Image

正常输入就会有这个错误

gfek2001zz avatar Dec 01 '25 05:12 gfek2001zz

I'm having a look but would you have the context from which your code is being called. It is very likely the issue you are facing is in the way you call the code, not the code itself (else other would have faced this issue too).

The error messages seems to indicate that you text has 1 (or 2) character(s) (hence bounds [0, 1]) and that in your code you tried to access position 29.

Also, what version of the library are you using?

Symeon94 avatar Dec 01 '25 06:12 Symeon94

Image 我通过继承方式,并重写了 Image Image Image Image

gfek2001zz avatar Dec 02 '25 06:12 gfek2001zz

Image

报错是这行代码

gfek2001zz avatar Dec 02 '25 06:12 gfek2001zz

I don't think there is an issue with the library, it is more a question for StackOverflow or similar forums as you are having issues debugging your code.

That being said, I'll try to help you still. It's a lot of code which I don't have context for and I'm not even sure is relevant. Best is, if you have located the place of your issue that you either debug your code, or you use the good old method and print some values. What are we looking for? Check the content of your CodeArea (or whatever class you are using from the library) and print it. Also print the imstart and imlength values. You'll discover (as I'm expecting) that your imlength is giving you a value not in match with the content.

As for the root cause, you'll have to investigate to find it out ;-)

I hope that helps

Symeon94 avatar Dec 02 '25 06:12 Symeon94

I think you are focusing on the wrong part. You need to find the place in your code that calls this code. What are you doing to trigger the exception? Can you locate the exact line in your code where it happens?

(Update: I was responding to your response, but it dissappeared)

Symeon94 avatar Dec 02 '25 07:12 Symeon94

@gfek2001zz Please use English. All issues and discussions in this project are in English, and the maintainers communicate in English as well. If you’re not comfortable writing in English, you can use AI translation tools.

PavelTurk avatar Dec 10 '25 13:12 PavelTurk

OK

---原始邮件--- 发件人: @.> 发送时间: 2025年12月10日(周三) 晚上9:48 收件人: @.>; 抄送: @.@.>; 主题: Re: [FXMisc/RichTextFX] 这个报错是什么原因引起的? (Issue #1297)

PavelTurk left a comment (FXMisc/RichTextFX#1297)

@gfek2001zz Please use English. All issues and discussions in this project are in English, and the maintainers communicate in English as well. If you’re not comfortable writing in English, you can use AI translation tools.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

gfek2001zz avatar Dec 10 '25 13:12 gfek2001zz

sorry,I've been quite busy lately.

I can't let you review the code for the time being. 

---原始邮件--- 发件人: @.> 发送时间: 2025年12月2日(周二) 下午3:34 收件人: @.>; 抄送: @.@.>; 主题: Re: [FXMisc/RichTextFX] 这个报错是什么原因引起的? (Issue #1297)

Symeon94 left a comment (FXMisc/RichTextFX#1297)

I think you are focusing on the wrong part. You need to find the place in your code that calls this code. What are you doing to trigger the exception? Can you locate the exact line in your code where it happens?

(Update: I was responding to your response, but it dissappeared)

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

gfek2001zz avatar Dec 10 '25 14:12 gfek2001zz