Add minimap for wxSTC (PR #25887)

58 views
Skip to first unread message

VZ

unread,
Oct 16, 2025, 6:24:29 PM (13 days ago) Oct 16
to wx-...@googlegroups.com, Subscribed

You can view, comment on, or merge this pull request online at:

  https://github.com/wxWidgets/wxWidgets/pull/25887

Commit Summary

  • e4fc22b Avoid using Tab and Shift+Tab as accelerators
  • 98299a5 Make wxStyledTextCtrl::TextHeight() const
  • 57321c6 Experiment with document map in wxSTC sample
  • 5c90cf4 Make the overlay more opaque while dragging under non-MSW too
  • 9bf20b8 Prevent Scintilla from handling double clicks in the map
  • d3dd229 Don't scroll when starting to drag
  • d673988 Add convenient GetThumbTopPos() function
  • 86e0b4d Simplify and improve map thumb positioning logic
  • 5089cbc Handle double clicks in the map as simple clicks
  • 246f8a6 Don't allow Ctrl+mouse wheel zooming in the map
  • b919877 Prevent removing the document or the map in ShowDocumentMap()
  • 57713dd Merge branch 'master' into stc-document-map
  • 1ad623e Store backing store bitmap in wxStyledTextCtrl
  • 0cae6fe Use wxBitmap object and not pointer in SurfaceImpl
  • 0adeee4 Store the last 8 used brushes in wxSTC implementation
  • 2bb24ff Reuse the same string buffer for STC-to-wx string conversions
  • 097e4e5 Avoid casting arbitrary wxDC to wxMemoryDC in wxSTC
  • 3373135 Disable bounding box updates for wxDCs used in wxSTC
  • 0fbfa47 Make VisibleFromDocLine/DocLineFromVisible() const too
  • 08b041c Use variable instead of hardcoded number for folding margin
  • df2f85d Do not set the lexer for the map wxSTC instance
  • 87e81bc Use number of displayed, and not document, lines in the map code
  • 0a19b1a Add wxStyledTextCtrl::GetDisplayLineCount()
  • 2fae0ea Merge branch 'master' into stc-document-map
  • 96be24e Wrap lines in the main document used with the map for testing
  • cc089bf Add separate m_isDragging instead of reusing m_dragOffset
  • 7db3003 Initialize m_mapLineHeight only once
  • 4150ab8 Collect information about visible lines in LinesInfo struct
  • f7d6277 Rename GetMapLineAtPoint() to GetDocLineAtMapPoint()
  • 4a440d6 Sync map and document properly when lines are wrapped
  • 4444810 Merge remote-tracking branch 'origin/master' into stc-document-map
  • 2ef91eb Rename all "editor" variables to start with "edit" instead
  • bc322eb Fix multiple bugs in determining position when dragging
  • c35886a Merge branch 'master' into stc-document-map
  • 187f68f Replace {map,edit}Display with {map,edit}Max in LinesInfo
  • f0d9d90 Improve skipping scroll events caused by the program itself
  • 5500f3d Really fix map sync when lines can be wrapped
  • 9396c19 Add MapVisibleFromEditVisible() helper function
  • 87c8ce0 Fix scrolling the editor while dragging the thumb
  • 58cd52d Fix SyncEditPosition() for the case of wrapped lines too
  • 7d7caf4 Extract iteration algorithm in its own function
  • 42ac97b Increase the line number margin width
  • b11d995 Add wxStyledTextCtrl::SetMirrorFoldingCtrl()
  • 68a55e9 Synchronize folding in the map and the main editor
  • 42e8785 Add Edit::ToggleLineNumbers() to the sample
  • 4bb71db Move wxStyledTextCtrlMiniMap from stc sample to the library

File Changes

(25 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25887@github.com>

VZ

unread,
Oct 16, 2025, 7:50:02 PM (13 days ago) Oct 16
to wx-...@googlegroups.com, Push

@vadz pushed 1 commit.

  • e66a8ec Move wxStyledTextCtrlMiniMap from stc sample to the library


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25887/before/4bb71dbf14225f98f09659fdedf1eaf28a9a271f/after/e66a8ec98c4f386dd9e57c7c41dd6eed90f16469@github.com>

VZ

unread,
Oct 16, 2025, 8:11:46 PM (13 days ago) Oct 16
to wx-...@googlegroups.com, Push

@vadz pushed 2 commits.

  • f0b72c3 Move wxStyledTextCtrlMiniMap from stc sample to the library
  • 6d52485 Add documentation for wxStyledTextCtrlMiniMap


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25887/before/e66a8ec98c4f386dd9e57c7c41dd6eed90f16469/after/6d52485ec6b2511d396d7dd815d0821a4015ef92@github.com>

Eran Ifrah

unread,
Oct 17, 2025, 2:57:27 AM (13 days ago) Oct 17
to wx-...@googlegroups.com, Subscribed
eranif left a comment (wxWidgets/wxWidgets#25887)

Nice! Looking forward to use this.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25887/c3414134354@github.com>

VZ

unread,
Oct 19, 2025, 9:10:26 AM (10 days ago) Oct 19
to wx-...@googlegroups.com, Push

@vadz pushed 2 commits.

  • b3449e1 Add possibility to customize wxStyledTextCtrlMiniMap thumb colours
  • c39b5d9 Don't scroll wxStyledTextCtrl used by wxStyledTextCtrlMiniMap


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25887/before/6d52485ec6b2511d396d7dd815d0821a4015ef92/after/c39b5d9494937aafb7bfefe877394ccb186b91c6@github.com>

VZ

unread,
Oct 19, 2025, 9:11:42 AM (10 days ago) Oct 19
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#25887)

I think this should be good to merge now. The API is (intentionally) very simple, the idea is that you can simply create a mini map for an existing control and it just works.

Please let me know if anybody has any comments/objections!


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25887/c3419657298@github.com>

Eran Ifrah

unread,
Oct 19, 2025, 9:25:44 AM (10 days ago) Oct 19
to wx-...@googlegroups.com, Subscribed
eranif left a comment (wxWidgets/wxWidgets#25887)

One of the more useful things I am using mini-map (in my case, I implemented it as a second wxSTC which I am manually syncing between the two) is the ability to view error markers.

It comes in very handy to be able to view all the compiler errors / warnings on the minimap and quickly jump to fix them. I tried to manually add a marker in the "main" edit view, but it does not being reflected in the "mini-map".

Can this be done easily?

minimap.png (view on web)


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25887/c3419666387@github.com>

VZ

unread,
Oct 19, 2025, 9:48:21 AM (10 days ago) Oct 19
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#25887)

This is indeed not supported currently, but I think it could be done by mirroring calls to Marker{Add,Delete,DeleteAll}() to the minimap control just as it's currently done for folds.

Markers seem to be simpler, so it should be already possible to just call all these functions on both the main editor and the map manually, but we could still replace SetMirrorFoldingCtrl() by just SetMirrorCtrl() and mirror them there automatically.

Can you confirm that doing this would work for you (by checking if calling MarkerAdd() manually does)?


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25887/c3419681441@github.com>

Eran Ifrah

unread,
Oct 19, 2025, 9:53:28 AM (10 days ago) Oct 19
to wx-...@googlegroups.com, Subscribed
eranif left a comment (wxWidgets/wxWidgets#25887)

Sure, will try this locally.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25887/c3419684955@github.com>

Eran Ifrah

unread,
Oct 20, 2025, 4:05:52 AM (9 days ago) Oct 20
to wx-...@googlegroups.com, Subscribed
eranif left a comment (wxWidgets/wxWidgets#25887)

It works.

Below is a diff of the changes I did. A quick summary of the changes (I also did a small change to the CMakeLists.txt to generate a compile_commands.json so code completion with clangd will work flawlessly):

Refactor mirror control to synchronize markers in addition to folding

  • Rename SetMirrorFoldingCtrl() to SetMirrorCtrl() to reflect expanded functionality
  • Synchronize marker operations (define, add, delete, etc.) with mirror control
  • Update marker-related methods to propagate changes to mirror control
  • Rename internal member variable m_mirrorFoldingCtrl to m_mirrorCtrl
  • Update documentation to clarify that both folding states and markers are synchronized
  • Enable CMAKE_EXPORT_COMPILE_COMMANDS for better IDE/tooling support
  • Create symbolic link for compile_commands.json in source directory
  • Fix sample code to add markers after creating mini-map to ensure proper synchronization
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8bec92df37..bba94566bc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -9,6 +9,8 @@
 
 cmake_minimum_required(VERSION 3.5...4.1)
 
+set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+
 if(NOT CMAKE_CONFIGURATION_TYPES)
     get_property(HAVE_MULTI_CONFIG_GENERATOR GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
     # Set default configuration types for multi-config generators
@@ -106,3 +108,8 @@ include(build/cmake/main.cmake)
 if(wxBUILD_SAMPLES AND wxUSE_GUI)
     set_directory_properties(PROPERTIES VS_STARTUP_PROJECT minimal)
 endif()
+
+file(CREATE_LINK
+    "${CMAKE_BINARY_DIR}/compile_commands.json"
+    "${CMAKE_SOURCE_DIR}/compile_commands.json"
+    SYMBOLIC)
diff --git a/include/wx/stc/stc.h b/include/wx/stc/stc.h
index 46c0051e75..cc00edce36 100644
--- a/include/wx/stc/stc.h
+++ b/include/wx/stc/stc.h
@@ -5853,10 +5853,13 @@ public:
     %pythoncode "_stc_utf8_methods.py"
 #endif
 
-    // Specify that folding in the given control should be synchronized with
-    // folding in this control, i.e. whenever a fold is opened/closed in this
-    // one, it will be opened/closed in the mirror control as well.
-    void SetMirrorFoldingCtrl(wxStyledTextCtrl* mirrorFoldingCtrl);
+    // Establishes a mirror control to keep synchronized with this control.
+    // When set, folding states and markers are automatically synchronized between
+    // this control and the specified mirror control.
+    //
+    // @param mirrorCtrl Pointer to the wxStyledTextCtrl to use as mirror control,
+    //                   or nullptr to remove the mirror relationship.
+    void SetMirrorCtrl(wxStyledTextCtrl* mirrorCtrl);
 
 
     // implement wxTextEntryBase pure virtual methods
@@ -6122,7 +6125,7 @@ protected:
 private:
     wxBitmap m_buffer;
 
-    wxStyledTextCtrl*   m_mirrorFoldingCtrl = nullptr;
+    wxStyledTextCtrl*   m_mirrorCtrl = nullptr;
 
     friend class ScintillaWX;
 #endif // !SWIG
diff --git a/samples/stc/stctest.cpp b/samples/stc/stctest.cpp
index 2cc884de70..f16c17a1e9 100644
--- a/samples/stc/stctest.cpp
+++ b/samples/stc/stctest.cpp
@@ -898,8 +898,6 @@ void App::ShowDocumentMap(wxWindow* parent)
 
     auto* const edit = new Edit(splitter);
     edit->LoadFile("C:\\msys64\\home\\eran\\devl\\codelite\\Plugin\\ai\\LLMManager.cpp");
-    edit->MarkerDefine(3, wxSTC_MARK_ROUNDRECT, *wxRED, *wxRED);
-    edit->MarkerAdd(10, 3);
 
     // Show line numbers in the margin, which are hidden by default.
     edit->ToggleLineNumbers();
@@ -907,7 +905,11 @@ void App::ShowDocumentMap(wxWindow* parent)
     edit->SetWrapMode(wxSTC_WRAP_WORD);
     edit->SetWrapVisualFlags(wxSTC_WRAPVISUALFLAG_END);
 
-    auto* const map = new wxStyledTextCtrlMiniMap(splitter, edit);
+    auto* const map = new wxStyledTextCtrlMiniMap(splitter, edit);
+
+    // Need to add markers after we created the mini-map
+    edit->MarkerDefine(3, wxSTC_MARK_ROUNDRECT, *wxRED, *wxRED);
+    edit->MarkerAdd(10, 3);
 
     splitter->SplitVertically(edit, map);
     splitter->SetMinimumPaneSize(dialog.FromDIP(10));
diff --git a/src/stc/minimap.cpp b/src/stc/minimap.cpp
index 831d84b413..3df0da869b 100644
--- a/src/stc/minimap.cpp
+++ b/src/stc/minimap.cpp
@@ -205,7 +205,7 @@ wxStyledTextCtrlMiniMap::Create(wxWindow* parent, wxStyledTextCtrl* edit)
     SetCursor(wxCURSOR_ARROW);
 
     // Ensure that folds in the map are synchronized with the main editor.
-    edit->SetMirrorFoldingCtrl(this);
+    edit->SetMirrorCtrl(this);
 
     // Scroll the editor when the map is scrolled.
     Bind(wxEVT_STC_UPDATEUI, &wxStyledTextCtrlMiniMap::OnMapUpdate, this);
diff --git a/src/stc/stc.cpp b/src/stc/stc.cpp
index 8acd6c0f85..8ea3b9942a 100644
--- a/src/stc/stc.cpp
+++ b/src/stc/stc.cpp
@@ -615,53 +615,69 @@ void wxStyledTextCtrl::SetIMEInteraction(int imeInteraction)
 void wxStyledTextCtrl::MarkerDefine(int markerNumber, int markerSymbol,
                 const wxColour& foreground,
                 const wxColour& background) {
+    if ( m_mirrorCtrl )
+        m_mirrorCtrl->MarkerDefine(markerNumber, markerSymbol, foreground, background);
 
-                SendMsg(SCI_MARKERDEFINE, markerNumber, markerSymbol);
-                if (foreground.IsOk())
-                    MarkerSetForeground(markerNumber, foreground);
-                if (background.IsOk())
-                    MarkerSetBackground(markerNumber, background);
+    SendMsg(SCI_MARKERDEFINE, markerNumber, markerSymbol);
+    if (foreground.IsOk())
+        MarkerSetForeground(markerNumber, foreground);
+    if (background.IsOk())
+        MarkerSetBackground(markerNumber, background);
 }
 
 // Set the foreground colour used for a particular marker number.
 void wxStyledTextCtrl::MarkerSetForeground(int markerNumber, const wxColour& fore)
 {
+    if ( m_mirrorCtrl )
+        m_mirrorCtrl->MarkerSetForeground(markerNumber, fore);
     SendMsg(SCI_MARKERSETFORE, markerNumber, wxColourAsLong(fore));
 }
 
 // Set the background colour used for a particular marker number.
 void wxStyledTextCtrl::MarkerSetBackground(int markerNumber, const wxColour& back)
 {
+    if ( m_mirrorCtrl )
+        m_mirrorCtrl->MarkerSetForeground(markerNumber, back);
     SendMsg(SCI_MARKERSETBACK, markerNumber, wxColourAsLong(back));
 }
 
 // Set the background colour used for a particular marker number when its folding block is selected.
 void wxStyledTextCtrl::MarkerSetBackgroundSelected(int markerNumber, const wxColour& back)
 {
+    if ( m_mirrorCtrl )
+        m_mirrorCtrl->MarkerSetBackgroundSelected(markerNumber, back);
     SendMsg(SCI_MARKERSETBACKSELECTED, markerNumber, wxColourAsLong(back));
 }
 
 // Enable/disable highlight for current folding block (smallest one that contains the caret)
 void wxStyledTextCtrl::MarkerEnableHighlight(bool enabled)
 {
+    if ( m_mirrorCtrl )
+        m_mirrorCtrl->MarkerEnableHighlight(enabled);
     SendMsg(SCI_MARKERENABLEHIGHLIGHT, enabled, 0);
 }
 
 // Add a marker to a line, returning an ID which can be used to find or delete the marker.
 int wxStyledTextCtrl::MarkerAdd(int line, int markerNumber)
 {
+    if ( m_mirrorCtrl )
+        m_mirrorCtrl->MarkerAdd(line, markerNumber);
     return SendMsg(SCI_MARKERADD, line, markerNumber);
 }
 
 // Delete a marker from a line.
 void wxStyledTextCtrl::MarkerDelete(int line, int markerNumber)
 {
+    if ( m_mirrorCtrl )
+        m_mirrorCtrl->MarkerDelete(line, markerNumber);
     SendMsg(SCI_MARKERDELETE, line, markerNumber);
 }
 
 // Delete all markers with a particular number from all lines.
 void wxStyledTextCtrl::MarkerDeleteAll(int markerNumber)
 {
+    if ( m_mirrorCtrl )
+        m_mirrorCtrl->MarkerDeleteAll(markerNumber);
     SendMsg(SCI_MARKERDELETEALL, markerNumber, 0);
 }
 
@@ -686,18 +702,24 @@ int wxStyledTextCtrl::MarkerPrevious(int lineStart, int markerMask)
 
 // Define a marker from a bitmap
 void wxStyledTextCtrl::MarkerDefinePixmap(int markerNumber, const char* const* xpmData) {
-        SendMsg(SCI_MARKERDEFINEPIXMAP, markerNumber, (sptr_t)xpmData);
+    if ( m_mirrorCtrl )
+        m_mirrorCtrl->MarkerDefinePixmap(markerNumber, xpmData);
+    SendMsg(SCI_MARKERDEFINEPIXMAP, markerNumber, (sptr_t)xpmData);
 }
 
 // Add a set of markers to a line.
 void wxStyledTextCtrl::MarkerAddSet(int line, int markerSet)
 {
+    if ( m_mirrorCtrl )
+        m_mirrorCtrl->MarkerAddSet(line, markerSet);
     SendMsg(SCI_MARKERADDSET, line, markerSet);
 }
 
 // Set the alpha used for a marker that is drawn in the text area, not the margin.
 void wxStyledTextCtrl::MarkerSetAlpha(int markerNumber, int alpha)
 {
+    if ( m_mirrorCtrl )
+        m_mirrorCtrl->MarkerSetAlpha(markerNumber, alpha);
     SendMsg(SCI_MARKERSETALPHA, markerNumber, alpha);
 }
 
@@ -2215,8 +2237,8 @@ void wxStyledTextCtrl::SetFoldLevel(int line, int level)
 {
     SendMsg(SCI_SETFOLDLEVEL, line, level);
 
-    if ( m_mirrorFoldingCtrl )
-        m_mirrorFoldingCtrl->SetFoldLevel(line, level);
+    if ( m_mirrorCtrl )
+        m_mirrorCtrl->SetFoldLevel(line, level);
 }
 
 // Retrieve the fold level of a line.
@@ -2266,8 +2288,8 @@ void wxStyledTextCtrl::SetFoldExpanded(int line, bool expanded)
 {
     SendMsg(SCI_SETFOLDEXPANDED, line, expanded);
 
-    if ( m_mirrorFoldingCtrl )
-        m_mirrorFoldingCtrl->SetFoldExpanded(line, expanded);
+    if ( m_mirrorCtrl )
+        m_mirrorCtrl->SetFoldExpanded(line, expanded);
 }
 
 // Is a header line expanded?
@@ -2281,8 +2303,8 @@ void wxStyledTextCtrl::ToggleFold(int line)
 {
     SendMsg(SCI_TOGGLEFOLD, line, 0);
 
-    if ( m_mirrorFoldingCtrl )
-        m_mirrorFoldingCtrl->ToggleFold(line);
+    if ( m_mirrorCtrl )
+        m_mirrorCtrl->ToggleFold(line);
 }
 
 // Switch a header line between expanded and contracted and show some text after the line.
@@ -2290,8 +2312,8 @@ void wxStyledTextCtrl::ToggleFoldShowText(int line, const wxString& text)
 {
     SendMsg(SCI_TOGGLEFOLDSHOWTEXT, line, (sptr_t)(const char*)wx2stc(text));
 
-    if ( m_mirrorFoldingCtrl )
-        m_mirrorFoldingCtrl->ToggleFoldShowText(line, text);
+    if ( m_mirrorCtrl )
+        m_mirrorCtrl->ToggleFoldShowText(line, text);
 }
 
 // Set the style of fold display text.
@@ -2328,8 +2350,8 @@ void wxStyledTextCtrl::FoldLine(int line, int action)
 {
     SendMsg(SCI_FOLDLINE, line, action);
 
-    if ( m_mirrorFoldingCtrl )
-        m_mirrorFoldingCtrl->FoldLine(line, action);
+    if ( m_mirrorCtrl )
+        m_mirrorCtrl->FoldLine(line, action);
 }
 
 // Expand or contract a fold header and its children.
@@ -2337,8 +2359,8 @@ void wxStyledTextCtrl::FoldChildren(int line, int action)
 {
     SendMsg(SCI_FOLDCHILDREN, line, action);
 
-    if ( m_mirrorFoldingCtrl )
-        m_mirrorFoldingCtrl->FoldChildren(line, action);
+    if ( m_mirrorCtrl )
+        m_mirrorCtrl->FoldChildren(line, action);
 }
 
 // Expand a fold header and all children. Use the level argument instead of the line's current level.
@@ -2352,8 +2374,8 @@ void wxStyledTextCtrl::FoldAll(int action)
 {
     SendMsg(SCI_FOLDALL, action, 0);
 
-    if ( m_mirrorFoldingCtrl )
-        m_mirrorFoldingCtrl->FoldAll(action);
+    if ( m_mirrorCtrl )
+        m_mirrorCtrl->FoldAll(action);
 }
 
 // Ensure a particular line is visible by expanding any header line hiding it.
@@ -2379,8 +2401,8 @@ void wxStyledTextCtrl::SetFoldFlags(int flags)
 {
     SendMsg(SCI_SETFOLDFLAGS, flags, 0);
 
-    if ( m_mirrorFoldingCtrl )
-        m_mirrorFoldingCtrl->SetFoldFlags(flags);
+    if ( m_mirrorCtrl )
+        m_mirrorCtrl->SetFoldFlags(flags);
 }
 
 // Ensure a particular line is visible by expanding any header line hiding it.
@@ -5479,14 +5501,14 @@ int wxStyledTextCtrl::ReplaceTargetRERaw(const char* text, int length)
     return SendMsg(SCI_REPLACETARGETRE, length, reinterpret_cast<sptr_t>(text));
 }
 
-void wxStyledTextCtrl::SetMirrorFoldingCtrl(wxStyledTextCtrl* mirrorFoldingCtrl)
+void wxStyledTextCtrl::SetMirrorCtrl(wxStyledTextCtrl* mirrorCtrl)
 {
-    m_mirrorFoldingCtrl = mirrorFoldingCtrl;
+    m_mirrorCtrl = mirrorCtrl;
 
     // Set the fold flags to the same value as in this control in case they had
     // been changed before calling this function.
-    if ( m_mirrorFoldingCtrl )
-        m_mirrorFoldingCtrl->SetFoldFlags(m_swx->foldFlags);
+    if ( m_mirrorCtrl )
+        m_mirrorCtrl->SetFoldFlags(m_swx->foldFlags);
 }
 
 #if WXWIN_COMPATIBILITY_3_0


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25887/c3420987550@github.com>

Eran Ifrah

unread,
Oct 20, 2025, 4:13:18 AM (9 days ago) Oct 20
to wx-...@googlegroups.com, Subscribed
eranif left a comment (wxWidgets/wxWidgets#25887)

BTW, there is a small drawing glitch on Windows 11: If you scroll the "Document Map" using the scrollbar, the gray area has some drawing artifacts. Clicking anywhere in the minimap demo, fixes this. Probably a missing "Refresh" call after scrolling is over.

See attached screenshot.
minimap-drawing-glitches.png (view on web)


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25887/c3421009569@github.com>

VZ

unread,
Oct 20, 2025, 7:13:12 AM (9 days ago) Oct 20
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#25887)

BTW, there is a small drawing glitch on Windows 11: If you scroll the "Document Map" using the scrollbar, the gray area has some drawing artifacts.

Just to confirm: this is with the latest state of this branch, including c39b5d9? Because it was supposed to fix exactly this (and did, in my testing...).


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25887/c3421630767@github.com>

Eran Ifrah

unread,
Oct 20, 2025, 7:21:14 AM (9 days ago) Oct 20
to wx-...@googlegroups.com, Subscribed
eranif left a comment (wxWidgets/wxWidgets#25887)

I am missing this commit (I applied this patch locally by applying: https://github.com/wxWidgets/wxWidgets/pull/25887.diff and this was done before you added that commit).


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25887/c3421658669@github.com>

VZ

unread,
Oct 20, 2025, 7:26:49 AM (9 days ago) Oct 20
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#25887)

Actually, looking at your patch, you definitely don't have this commit in your tree (because it doesn't apply to the header with this change), please get the latest branch and the refresh problem should go away.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25887/c3421675177@github.com>

VZ

unread,
Oct 20, 2025, 7:31:07 AM (9 days ago) Oct 20
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#25887)

It works.

Below is a diff of the changes I did.

Thanks for checking, but the diff can't be used as is, unfortunately: it modifies generated files and so the changes will be lost the next time src/stc/gen_iface.py is run.

The straightforward way of doing it properly would be to modify this script to add the custom function definitions to it just as I did for folding, but looking at the number of functions, it doesn't seem very appealing, so I think that it would be better to let the script know about the mirrored functions in some way, so that it could add mirroring code automatically. I don't have time to do it right now, but I'll try to do it later if nobody else beats me to it.

Also, it's not great that all the markers defined before establishing the mirror relationship have to be manually applied to the map. Could we use MarkerNext() to get all the existing markers and apply them automatically? If not, we at least need to document this carefully.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25887/c3421687725@github.com>

Eran Ifrah

unread,
Oct 20, 2025, 7:34:24 AM (9 days ago) Oct 20
to wx-...@googlegroups.com, Subscribed
eranif left a comment (wxWidgets/wxWidgets#25887)

Also, it's not great that all the markers defined before establishing the mirror relationship have to be manually applied to the map. Could we use MarkerNext() to get all the existing markers and apply them automatically? If not, we at least need to document this carefully

We should also need to "copy" all the marker definitions as well.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25887/c3421697268@github.com>

VZ

unread,
Oct 20, 2025, 7:28:49 PM (9 days ago) Oct 20
to wx-...@googlegroups.com, Push

@vadz pushed 2 commits.

  • 4c8a629 Refresh the map when syncing its position even when not scrolling
  • 8014390 Don't sync edit after map changes originating from the editor


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25887/before/c39b5d9494937aafb7bfefe877394ccb186b91c6/after/8014390a86bf018ae1f4ffe7aca2ace8598628d4@github.com>

VZ

unread,
Oct 20, 2025, 8:06:51 PM (9 days ago) Oct 20
to wx-...@googlegroups.com, Push

@vadz pushed 3 commits.

  • 647d79a Rename wxSTC::SetMirrorFoldingCtrl() to SetMirrorCtrl()
  • 104d1d4 Make generating of mirroring methods more maintainable
  • 9d75245 Synchronize markers with the mirror control too


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25887/before/8014390a86bf018ae1f4ffe7aca2ace8598628d4/after/9d75245d081a5519a638939e486c625b488e48c2@github.com>

VZ

unread,
Oct 20, 2025, 8:08:03 PM (9 days ago) Oct 20
to wx-...@googlegroups.com, Subscribed
vadz left a comment (wxWidgets/wxWidgets#25887)

@eranif Please check if 9d75245 works for you.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25887/c3424191378@github.com>

VZ

unread,
Oct 20, 2025, 8:09:21 PM (9 days ago) Oct 20
to wx-...@googlegroups.com, Push

@vadz pushed 1 commit.

  • e17485d Merge branch 'master' into stc-document-map


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25887/before/9d75245d081a5519a638939e486c625b488e48c2/after/e17485d4c50ebb63fbad2e0bbd1afa9d7c6e5312@github.com>

VZ

unread,
Oct 21, 2025, 11:38:48 AM (8 days ago) Oct 21
to wx-...@googlegroups.com, Push

@vadz pushed 4 commits.

  • 1fd6aa0 Don't explicitly refresh the map when the editor contents change
  • 3d94c35 Don't synchronize map position on resize to avoid unwanted jumps
  • 5af5010 Don't hide editor vertical scrollbar when using minimap
  • b5255ef Add wxStyledTextCtrlMiniMap::SetEdit()


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25887/before/e17485d4c50ebb63fbad2e0bbd1afa9d7c6e5312/after/b5255ef92704a8365e28a9093d5958e3dee32b59@github.com>

VZ

unread,
Oct 28, 2025, 6:47:31 PM (21 hours ago) Oct 28
to wx-...@googlegroups.com, Push

@vadz pushed 2 commits.

  • 32a009d Fix document pointer memory leak in wxStyledTextCtrlMiniMap
  • 6f9bd5e Document limitations of wxStyledTextCtrlMiniMap synchronization


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25887/before/b5255ef92704a8365e28a9093d5958e3dee32b59/after/6f9bd5e49dc913874a79fb5107a87baff9a785ef@github.com>

VZ

unread,
Oct 28, 2025, 7:32:57 PM (20 hours ago) Oct 28
to wx-...@googlegroups.com, Subscribed

Merged #25887 into master.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/pull/25887/issue_event/20566781122@github.com>

Reply all
Reply to author
Forward
0 new messages