Skip to content

Commit

Permalink
fix colspec for getDef
Browse files Browse the repository at this point in the history
  • Loading branch information
sunderme committed Oct 5, 2024
1 parent 6d30b6f commit 3c07928
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/tablemanipulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ QString LatexTables::getDef(QDocumentCursor &cur)
int offset=match.capturedStart(2);
QString matched = match.captured(2);
QString prefix=opt.left(offset);
opt=matched;
opt=handleColSpec(opt);
// handle cursor selection more precisely in case of multiline arguments
const int posColspec=line.indexOf("colspec");
QString pre=line.left(posColspec);
Expand Down
4 changes: 4 additions & 0 deletions src/tests/tablemanipulation_t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,10 @@ void TableManipulationTest::getDef_data(){
<< "\\begin{tblr}{\nabc,\n\tcolspec={ll}\n}\na&b\\\\\nc&d\\\\\ne&f\\\\\n\\end{tabular}\n"
<< 2 << 0
<< "ll";
QTest::newRow("colspec in multiline3")
<< "\\begin{tblr}{\nabc,\n\tcolspec={ll},width={2cm}\n}\na&b\\\\\nc&d\\\\\ne&f\\\\\n\\end{tabular}\n"
<< 2 << 0
<< "ll";
}
void TableManipulationTest::getDef(){
QFETCH(QString, text);
Expand Down

0 comments on commit 3c07928

Please sign in to comment.