updating jump to line

This commit is contained in:
2026-01-01 19:12:46 -08:00
parent cc0c187481
commit 2542690eca
5 changed files with 478 additions and 474 deletions

2
.idea/editor.xml generated
View File

@@ -19,7 +19,7 @@
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooManyArgs/@EntryIndexedValue" value="WARNING" type="string" /> <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooManyArgs/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCStyleCast/@EntryIndexedValue" value="SUGGESTION" type="string" /> <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCStyleCast/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCVQualifierCanNotBeAppliedToReference/@EntryIndexedValue" value="WARNING" type="string" /> <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCVQualifierCanNotBeAppliedToReference/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassCanBeFinal/@EntryIndexedValue" value="HINT" type="string" /> <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassCanBeFinal/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassIsIncomplete/@EntryIndexedValue" value="WARNING" type="string" /> <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassIsIncomplete/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeedsConstructorBecauseOfUninitializedMember/@EntryIndexedValue" value="WARNING" type="string" /> <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeedsConstructorBecauseOfUninitializedMember/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeverUsed/@EntryIndexedValue" value="WARNING" type="string" /> <option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />

2
.idea/kte.iml generated
View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<module classpath="CMake" type="CPP_MODULE" version="4"> <module classpath="CIDR" type="CPP_MODULE" version="4">
<component name="FacetManager"> <component name="FacetManager">
<facet type="Python" name="Python facet"> <facet type="Python" name="Python facet">
<configuration sdkName="" /> <configuration sdkName="" />

View File

@@ -2350,7 +2350,8 @@ cmd_newline(CommandContext &ctx)
} }
// Insert replacement if provided // Insert replacement if provided
if (!with.empty()) { if (!with.empty()) {
buf->insert_text(static_cast<int>(y), static_cast<int>(p), std::string_view(with)); buf->insert_text(static_cast<int>(y), static_cast<int>(p),
std::string_view(with));
if (u) { if (u) {
buf->SetCursor(p, y); buf->SetCursor(p, y);
u->Begin(UndoType::Insert); u->Begin(UndoType::Insert);
@@ -2405,6 +2406,8 @@ cmd_newline(CommandContext &ctx)
ctx.editor.SetStatus(err.empty() ? std::string("Failed to open ") + value : err); ctx.editor.SetStatus(err.empty() ? std::string("Failed to open ") + value : err);
} else { } else {
ctx.editor.SetStatus(std::string("Opened ") + value); ctx.editor.SetStatus(std::string("Opened ") + value);
// Center the view on the cursor (e.g. if the buffer restored a cursor position)
cmd_center_on_cursor(ctx);
// Close the prompt so subsequent typing edits the buffer, not the prompt // Close the prompt so subsequent typing edits the buffer, not the prompt
ctx.editor.CancelPrompt(); ctx.editor.CancelPrompt();
} }
@@ -4202,11 +4205,12 @@ cmd_reflow_paragraph(CommandContext &ctx)
// Replace paragraph lines via PieceTable-backed operations // Replace paragraph lines via PieceTable-backed operations
for (std::size_t i = para_end; i + 1 > para_start; --i) { for (std::size_t i = para_end; i + 1 > para_start; --i) {
buf->delete_row(static_cast<int>(i)); buf->delete_row(static_cast<int>(i));
if (i == 0) break; // prevent wrap on size_t if (i == 0)
break; // prevent wrap on size_t
} }
// Insert new lines starting at para_start // Insert new lines starting at para_start
std::size_t insert_y = para_start; std::size_t insert_y = para_start;
for (const auto &ln : new_lines) { for (const auto &ln: new_lines) {
buf->insert_row(static_cast<int>(insert_y), std::string_view(ln)); buf->insert_row(static_cast<int>(insert_y), std::string_view(ln));
insert_y += 1; insert_y += 1;
} }

View File

@@ -73,6 +73,7 @@ TerminalFrontend::Init(Editor &ed)
have_old_sigint_ = true; have_old_sigint_ = true;
} }
} }
return true; return true;
} }

View File

@@ -192,8 +192,6 @@ main(int argc, const char *argv[])
} else if (req_term) { } else if (req_term) {
use_gui = false; use_gui = false;
} else { } else {
// Default depends on build target: kge defaults to GUI, kte to terminal // Default depends on build target: kge defaults to GUI, kte to terminal
#if defined(KTE_DEFAULT_GUI) #if defined(KTE_DEFAULT_GUI)
use_gui = true; use_gui = true;
@@ -307,6 +305,7 @@ main(int argc, const char *argv[])
return 1; return 1;
} }
bool running = true; bool running = true;
while (running) { while (running) {
fe->Step(editor, running); fe->Step(editor, running);