MCPcopy Create free account
hub / github.com/IChooseYou/Reclass / applyCommandRowPills

Method applyCommandRowPills

src/editor.cpp:815–877  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

813}
814
815void RcxEditor::applyCommandRowPills() {
816 if (m_meta.isEmpty() || m_meta[0].lineKind != LineKind::CommandRow) return;
817
818 constexpr int line = 0;
819 QString t = getLineText(m_sci, line);
820
821 clearIndicatorLine(IND_HEX_DIM, line);
822 clearIndicatorLine(IND_CLASS_NAME, line);
823
824 // Dim the [▾] type-selector chevron
825 ColumnSpan chevron = commandRowChevronSpan(t);
826 if (chevron.valid)
827 fillIndicatorCols(IND_HEX_DIM, line, chevron.start, chevron.end);
828
829 // Dim label text: source arrow/placeholder + its ▾ dropdown arrow
830 ColumnSpan srcSpan = commandRowSrcSpan(t);
831 if (srcSpan.valid) {
832 int quotePos = t.indexOf('\'', srcSpan.start);
833 int kindEnd = (quotePos > srcSpan.start) ? quotePos : srcSpan.end;
834 while (kindEnd > srcSpan.start && t[kindEnd - 1].isSpace()) kindEnd--;
835 if (kindEnd > srcSpan.start)
836 fillIndicatorCols(IND_HEX_DIM, line, srcSpan.start, kindEnd);
837 // Dim the source ▾ dropdown arrow to match (like struct▾)
838 int srcDrop = t.indexOf(QChar(0x25BE));
839 int rootStart = commandRowRootStart(t);
840 if (srcDrop >= 0 && (rootStart < 0 || srcDrop < rootStart))
841 fillIndicatorCols(IND_HEX_DIM, line, srcDrop, srcDrop + 1);
842 }
843 // Dim all " · " separators
844 int searchFrom = 0;
845 while (true) {
846 int tag = t.indexOf(QStringLiteral(" \u00B7"), searchFrom);
847 if (tag < 0) break;
848 fillIndicatorCols(IND_HEX_DIM, line, tag, tag + 3);
849 searchFrom = tag + 3;
850 }
851
852 // Dim base address to match source/struct grey
853 ColumnSpan addrSpan = commandRowAddrSpan(t);
854 if (addrSpan.valid)
855 fillIndicatorCols(IND_HEX_DIM, line, addrSpan.start, addrSpan.end);
856
857 // Root class styling (type dim + class-name teal, no underline)
858 ColumnSpan rt = commandRowRootTypeSpan(t);
859 if (rt.valid) {
860 fillIndicatorCols(IND_HEX_DIM, line, rt.start, rt.end);
861 int drop = t.indexOf(QChar(0x25BE), rt.start);
862 if (drop >= 0)
863 fillIndicatorCols(IND_HEX_DIM, line, drop, qMin(drop + 2, t.size()));
864 }
865 ColumnSpan rn = commandRowRootNameSpan(t);
866 if (rn.valid) {
867 fillIndicatorCols(IND_CLASS_NAME, line, rn.start, rn.end);
868 }
869
870 // Dim trailing opening brace to match the rest of the command row grey
871 for (int i = t.size() - 1; i >= 0; --i) {
872 if (t[i] == ' ' || t[i] == '\t') continue;

Callers

nothing calls this directly

Calls 8

getLineTextFunction · 0.85
commandRowChevronSpanFunction · 0.85
commandRowRootStartFunction · 0.85
commandRowAddrSpanFunction · 0.85
commandRowRootTypeSpanFunction · 0.85
commandRowRootNameSpanFunction · 0.85
commandRowSrcSpanFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected