summaryrefslogtreecommitdiff
path: root/src/Fl_Text_Display.cxx
AgeCommit message (Collapse)Author
44 hourswipmaxim nikonov
2026-01-24Let Fl_Text_Editor and Fl_Input handle gracefully composed unicode characters.ManoloFLTK
2025-01-11 Fl_Text_Editor::wrap_mode(Fl_Text_Display::WRAP_AT_BOUNDS, 0) hurts ↵ManoloFLTK
scrolling (#1186)
2024-10-19Fixes Fl_Text_Display line number calculation. (#1088)Matthias Melcher
2024-10-15Fix documentation typos and trailing whitespaceAlbrecht Schlosser
2024-10-06Fl_Text_Display: Fix text selection off-by-one bug (#1080)Andrew Fuller
This seems to have been left over from when mouse text selection would start a text selection on the left side of the character and always extend the selection to include the character under the cursor. We now perform text selection based on whether the selection spans across the horizontal center of a character and so this next_char() causes the endpoint of the selection to be incorrectly shifted to the right.
2024-09-28Fix bug in Fl_Text_Display when tab is followed by multibyte charAndrew Fuller
When the user clicks the right half of a tab, we add 1 (the byte len of the tab) to obtain the starting index of the following character.
2024-08-12Further accelerating Fl_Text_Display (#596)Matthias Melcher
This commit adds lazy evaluation for the wrapped line calculation, making scrolling much more interactive.
2024-08-04Optimize Fl_Text_Display scrolling speed (#596).Matthias Melcher
2024-01-29RFC: Different approach to Editor tutorial (see #189) (#883)Matthias Melcher
Update test/editor code and tutorial (#189, #883) Different, sequential approach to Editor tutorial Co-authored-by: Albrecht Schlosser <albrechts.fltk@online.de>
2024-01-25Fix mousewheel problem with Fl_Text_Editor (issue #879)Greg Ercolano
When an Fl_Text_Editor ended up under the mouse, it took mousewheel events for itself, freezing navigation of a parent's Fl_Scroll. Patch handles mousewheel events for both up/down and left/right by checking: > If editor has no scrollbar (e.g. no content to scroll to), then mousewheel events for that scrollbar are ignored so the parent can be navigated. > If editor has a scrollbar, it handles wheel events until scroller reaches an extreme position (e.g. top or bottom), it starts ignoring wheel events so the parent can be navigated.
2024-01-11#885: Fixes keyboard text selection in Fl_Text_EditorMatthias Melcher
2023-12-28Adds Fl_Input RMB menu translation to test/preferencesMatthias Melcher
This also updates the RMB menu labels before every popup so that changing the labels after creating the widgets still reflects that change correctly.
2023-12-21Fix "Fl_Input popup menu customize doesn't work" (#874)ManoloFLTK
2023-11-26Restores mouse pointer before popping up cut/copy/paste menuMatthias Melcher
on Fl_Input and Fl_Text_Display Also adds &ndash; to Help View
2023-11-25Adds pulldown menu to Fl_Text_Display and ..._EditorMatthias Melcher
2023-11-23Added safety when calling Text_Display methodsMatthias Melcher
- before assigning a buffer (Github #845) - also fixed a warning form unused arg in Fl_Terminal
2023-11-07Fixes initial calculation of line number in Fl_Text_Display (#830)Matthias Melcher
2023-10-10Fix default color of ATTR_GRAMMAR/ATTR_SPELLING (#790)leen
2023-04-14Fixed leak in Fl_Text_Buffer #716Matthias Melcher
2023-02-07Fix "\todo TextDPosToLineAndCol does not exist"ManoloFLTK
2023-02-07Fix "\todo TextDEndOfLine and BufEndOfLine functions don't exist"ManoloFLTK
2023-02-06Fix "\todo Complete documentation of class Fl_String"ManoloFLTK
Also - fix "\todo Unicode?" in Fl_Text_Display::display_insert() after verification - fix "\todo [Internal] The user_data value must be implemented using \p fl_intptr_t" because that's now in place.
2023-01-28Fix comments and remove a 'todo' item from docsAlbrecht Schlosser
Comments and docs only, no code changes.
2022-12-09Suppress (GitHub CI/wayland) compiler warningAlbrecht Schlosser
[ 15%] Building CXX object src/CMakeFiles/fltk.dir/Fl_Text_Display.cxx.o .../fltk/src/Fl_Text_Display.cxx: In constructor ‘Fl_Text_Display::Fl_Text_Display(int, int, int, int, const char*)’: .../fltk/src/Fl_Text_Display.cxx:122:57: warning: ‘void* __builtin_memset(void*, int, long unsigned int)’ writing between 4 and 8589934584 bytes into a region of size 0 overflows the destination [-Wstringop-overflow=] 122 | for (int i=1; i<mNVisibleLines; i++) mLineStarts[i] = -1; | ~~~~~~~~~~~~~~~^~~~ .../fltk/src/Fl_Text_Display.cxx:120:39: note: at offset 4 into destination object of size 4 allocated by ‘operator new []’ 120 | mLineStarts = new int[mNVisibleLines]; | ^ This warning is IMHO obsolete because the code in question should not be executed at all (mNVisibleLines == 1). However, the compiler seems to substitute this with '__builtin_memset(...)' and analyzes "correctly" that memory at offset 4 would be overwritten but not that the written size would be 0. The "fix" uses a compiler macro and #if to clarify that this code must not be executed and should not be compiled (see comment why this code exists).
2022-12-09Fix Fl_Text_Display drawing of line numbers (#578)wcout
The formerly undrawn rectangle beneath (or above) the line numbers is now filled with FL_BACKGROUND_COLOR. Additionally the small rectangle between the scrollbars is now filled with FL_BACKGROUND_COLOR instead of FL_GRAY for consistency.
2022-11-24Fix two Visual Studio compiler warningsAlbrecht Schlosser
+ fix trailing whitespace (fluid)
2022-11-22Fix selection extension in Fl_Text_*, issue 196 (#550)Matthias Melcher
Selecting a text range programmatically would not sync some variables with the actual selection. This also fixes a crash bug in macOS when dragging text that was selected by buffer()->select() only.
2022-11-12Removed FIXME comment that was already solved.Matthias Melcher
2022-11-05Wayland/X11 hybrid: use "bool fl_disable_wayland;" declaration.ManoloFLTK
2022-09-26Replace all calls to sprintf() by calls to snprintf().ManoloFLTK
2022-01-30Adding Text_Display color variables. (#384)Matthias Melcher
2022-01-27Background color attribute for Fl_Text_Display. (#378)Matthias Melcher
* Background color attribute for Fl_Text_Display. * Adding attributes. * Avoid clipping horizontal * Fl_Text_Display underlining. * Better line positions * Typos, testing. * Documentation.
2022-01-16Rename FL/fl_string.h to FL/fl_string_functions.hAlbrecht Schlosser
This is part 1 of the final fix for a previous name clash on case insensitive file systems (fl_string.h vs. Fl_String.H).
2022-01-07Re-organize cross-platform support for text input methods.ManoloFLTK
FLTK 1.3 supports complex text input methods (TIMs) for the 3 platforms (X11, Windows, macOS). This support has an interface with FLTK that is common for X11 and Windows, via (undocumented) functions fl_set_spot(), fl_set_status() and fl_reset_spot(). In contrast, and because it's been developed independently, the interface between the macOS TIM and FLTK 1.3 is completely different : static functions FL::insertion_point_location() and Fl::reset_marked_text(). The present change implements a single TIM/FLTK interface used by all platforms based on functions fl_set_spot() and fl_reset_spot(). The previous macOS-specific functions FL::insertion_point_location() and Fl::reset_marked_text() are maintained only for compatibility with 1.3 and deprecated.
2022-01-05Fix whitespace and Makefile dependenciesAlbrecht Schlosser
No code changes
2021-12-17Updated Unicode utf8 byte limit in docs.Matthias Melcher
2021-12-17GitHub #233, documenting style buffers and utf8.Matthias Melcher
2021-12-12Fix IME problem (issue #270)YX
2021-12-08STR 3460.C: Code Properties remembers the editor's scroll bar position.Matthias Melcher
2021-03-13Fast pango (#201)ManoloFLTK
* Cache single unicode character widths under Xft+Pango
2021-02-13Remove compilation warnings issued by Visual Studio 2019.ManoloFLTK
2020-09-17Noted unused variable in Fl_Text_Display..Greg Ercolano
2020-09-16Added Fl_Text_Display::style_buffer(), solves issue #138Greg Ercolano
2020-08-01Implement + deploy fl_strdup()Greg Ercolano
2020-07-06Remove $Id$ tags, update URL's, and moreAlbrecht Schlosser
- remove obsolete svn '$Id$' tags from all source files - update .fl files and generated files accordingly - replace 'http://www.fltk.org' URL's with 'https://...' - replace bug report URL 'str.php' with 'bugs.php' - remove trailing whitespace - fix other whitespace errors flagged by Git - add and/or fix missing or wrong standard headers - convert tabs to spaces in all source files The only relevant code changes are in the fluid/ folder where some .fl files and other source files were used to generate the '$Id' headers and footers.
2020-03-08Update Fl_Text_Display documentationAlbrecht Schlosser
No code changes except minor formatting and trailing whitespace.
2020-02-11Fix static analyzer issues in Fl_Text_DisplayAlbrecht Schlosser
Remove unused variables and unused code to silence warnings.
2020-01-15Fix uninitialized vars in calls to fl_clip_box() (issue #6)Albrecht Schlosser
The main fixes are only to avoid static code analyzer warnings reported in issue #5, but there are also minor bug fixes included. These bug fixes are more of theoretical concerns though. Close #6.
2019-02-04Fixed Fl_Text_Editor selection range after paste (STR #3248).Matthias Melcher