diff options
| author | nyamatongwe <unknown> | 2011-04-27 12:44:42 +1000 | 
|---|---|---|
| committer | nyamatongwe <unknown> | 2011-04-27 12:44:42 +1000 | 
| commit | 600468ec99bf587b81c6bf7da949e27cc76a9b33 (patch) | |
| tree | fc2d583db928eb663199d5ebfc9e3f90cf5387a2 | |
| parent | 3604e209946b37930f31ce0798df22f6ba34cae8 (diff) | |
| download | scintilla-mirror-600468ec99bf587b81c6bf7da949e27cc76a9b33.tar.gz | |
Fold marker fixes for wrapped lines. Bug #3291579.
From Marko Njezic.
| -rw-r--r-- | src/Editor.cxx | 23 | ||||
| -rw-r--r-- | src/LineMarker.cxx | 2 | 
2 files changed, 20 insertions, 5 deletions
| diff --git a/src/Editor.cxx b/src/Editor.cxx index 2e8654ca4..05531a650 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -1745,6 +1745,7 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) {  				int lineDoc = cs.DocFromDisplay(visibleLine);  				PLATFORM_ASSERT(cs.GetVisible(lineDoc));  				bool firstSubLine = visibleLine == cs.DisplayFromDoc(lineDoc); +				bool lastSubLine = visibleLine == (cs.DisplayFromDoc(lineDoc + 1) - 1);  				// Decide which fold indicator should be displayed  				level = pdoc->GetLevel(lineDoc); @@ -1768,11 +1769,19 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) {  								else  									marks |= 1 << folderEnd;  							} -						} else if (levelNum > SC_FOLDLEVELBASE){ +						} else if (levelNum > SC_FOLDLEVELBASE) {  							marks |= 1 << SC_MARKNUM_FOLDERSUB;   						}  					} else { -						marks |= 1 << SC_MARKNUM_FOLDERSUB; +						if (levelNum < levelNextNum) { +							if (cs.GetExpanded(lineDoc)) { +								marks |= 1 << SC_MARKNUM_FOLDERSUB; +							} else if (levelNum > SC_FOLDLEVELBASE) { +								marks |= 1 << SC_MARKNUM_FOLDERSUB; +							} +						} else if (levelNum > SC_FOLDLEVELBASE) { +							marks |= 1 << SC_MARKNUM_FOLDERSUB; + 						}  					}  					needWhiteClosure = false;  				} else if (level & SC_FOLDLEVELWHITEFLAG) { @@ -1803,10 +1812,14 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) {  						if (levelNext & SC_FOLDLEVELWHITEFLAG) {  							marks |= 1 << SC_MARKNUM_FOLDERSUB;  							needWhiteClosure = true; -						} else if (levelNextNum > SC_FOLDLEVELBASE) { -							marks |= 1 << SC_MARKNUM_FOLDERMIDTAIL; +						} else if (lastSubLine) { +							if (levelNextNum > SC_FOLDLEVELBASE) { +								marks |= 1 << SC_MARKNUM_FOLDERMIDTAIL; +							} else { +								marks |= 1 << SC_MARKNUM_FOLDERTAIL; +							}  						} else { -							marks |= 1 << SC_MARKNUM_FOLDERTAIL; +							marks |= 1 << SC_MARKNUM_FOLDERSUB;  						}  					} else {  						marks |= 1 << SC_MARKNUM_FOLDERSUB; diff --git a/src/LineMarker.cxx b/src/LineMarker.cxx index 747c5ff12..b97c9fd5a 100644 --- a/src/LineMarker.cxx +++ b/src/LineMarker.cxx @@ -77,6 +77,8 @@ void LineMarker::Draw(Surface *surface, PRectangle &rcWhole, Font &fontForCharac  	case LineMarker::head :  		head = backSelected;  		tail = backSelected; +		if (markType == SC_MARK_VLINE) +			body = backSelected;  		break;  	case LineMarker::body :  		head = backSelected; | 
