| [ Return to Bugs & Features | Roadmap 1.3 | SVN ⇄ GIT ]
STR #3272
Application: | FLTK Library |
Status: | 1 - Closed w/Resolution |
Priority: | 3 - Moderate, e.g. unable to compile the software |
Scope: | 3 - Applies to all machines and operating systems |
Subsystem: | Core Library |
Summary: | linenumber_width with wrap_mode on Fl_Text_Display |
Version: | 1.3.4 |
Created By: | superbem |
Assigned To: | AlbrechtS |
Fix Version: | 1.3.4 (SVN: v11205) |
Update Notification: | |
Trouble Report Files:
Trouble Report Comments:
|
#1 | superbem 21:32 Jan 05, 2016 |
| Linenumber_width with wrap_mode on Fl_Text_Display, does not resize text well. The last letters stays behind the vertical scrollbar. | |
|
#2 | superbem 21:42 Jan 05, 2016 |
| Solved on Fl_Text_Display.cxx 539:text_area.x = X+scrollbar_width()+LEFT_MARGIN+mLineNumWidth; 540:text_area.w = W-scrollbar_width()-LEFT_MARGIN-RIGHT_MARGIN-mLineNumWidth; 544:text_area.x = X+LEFT_MARGIN +mLineNumWidth; 545:text_area.w = W-scrollbar_width()-LEFT_MARGIN-RIGHT_MARGIN-mLineNumWidth;
and commented on 597 // add linenum width to the text area - LZA / STR#2621 // if (mLineNumWidth > 0) { // text_area.x += mLineNumWidth; // text_area.w -= mLineNumWidth; // } | |
|
#3 | superbem 22:15 Jan 05, 2016 |
| also on 482:text_area.x = X+LEFT_MARGIN+mLineNumWidth; 484:text_area.w = W-LEFT_MARGIN-RIGHT_MARGIN-mLineNumWidth; | |
|
#4 | superbem 01:30 Jan 06, 2016 |
| Also regarding the slow scrolling when on wrap mode, I found that no using the method wrap_mode an only setting the vars:
mNeedAbsTopLineNum=1; mWrapMarginPix=text_area.w; mContinuousWrap=1;
and on void Fl_Text_Display::update_v_scrollbar(){ if(clock()-cloc>10000){ mNBufferLines = count_lines(0, buffer()->length(), true); cloc=clock(); } mVScrollBar->value(mTopLineNum, mNVisibleLines, 1, mNBufferLines+2); mVScrollBar->linesize(3); }
I think instead of the clock thing, a startingscroll would fit better, as it only needs to be called once when scrolling. | |
|
#5 | superbem 08:21 Jan 21, 2016 |
| I attatched the file with the resize function without that those annoying bugs, from branch 11018. The slow scroll when in wrap mode, and without text disapearing behind the scrollbar when linenumbers are on. Hope you use it. | |
|
#6 | AlbrechtS 14:54 Feb 20, 2016 |
| Thank you very much for the report and the patch. The patch looks good and seems to work - basically.
There are some points I'm still testing, and my patch will be slightly different, but I'm making progress... | |
|
#7 | AlbrechtS 04:27 Feb 21, 2016 |
| Part 1 (wrap mode with line numbers) is fixed in svn r11202/11203. | |
|
#8 | AlbrechtS 09:03 Feb 22, 2016 |
| Fixed in Subversion repository.
The commit in svn r11205 was much more than I had intended and much more than the proposed patch did. I refactored some code, simplified some decisions, and I tried to optimize the calculations in wrap mode. I hope I got everything w/o breaking anything else.
Also fixed: Positioning of scrollbars with left and top alignment interfered with line numbers. Now all combinations of scroll bar positions and line numbers should be okay.
Note: I used the modified test/editor.cxx (committed in svn r11204) to test large editor buffers (up to 1 Mio. lines). This is still slow in some circumstances, but it is much better than the previous version. I could not find significant slowness up to 50.000 or 100.000 lines (FWIW: created from src/Fl_Text_Display.cxx by duplication of contents ...). To use the new test features you must define the preprocessor macro DEV_TEST. This enables buttons to resize the window, move the scrollbars, and toggle wrap mode and line numbers.
Please test and report if this fixes the issue for you. Can you compare with your patch and tell me if one or the other is better (faster)?
Are there still other things to fix in this context? | |
|
#9 | superbem 11:45 Feb 23, 2016 |
| Thanks, concerning this context it's working fine now. I want the text display to have code folding, but I guess it's a feature request. It's somehow related. I don't have any code for that yet. | |
|
#10 | AlbrechtS 16:56 Feb 23, 2016 |
| Thanks for confirmation. I will close this STR now.
OT: Code folding is certainly a feature request and should be requested in a separate STR (one STR == one issue to make STR management easier).
Note: FLTK 1.3 is closed for new feature requests, you'd need to file the STR for 1.4-feature. However, code folding is not very likely to be implemented in Fl_Text_Display. IMHO this should be in a separate class anyway (derived from Fl_Text_Display or Fl_Text_Editor, maybe). | |
[ Return to Bugs & Features ]
|
| |