SUMMARY When composing a message in KDE Connect SMS app, pressing Shift-Return in the message input field should insert the newline at the location of the cursor, replacing the selection if a selection is not empty, as many other messaging apps do. Related source code part: https://invent.kde.org/network/kdeconnect-kde/-/blob/master/smsapp/qml/SendingArea.qml?ref_type=heads#L87 STEPS TO REPRODUCE 1. Start writing a new SMS. 2. Enter some text (≥ 2 chars) to the field. 3. Place the cursor at any position except the end. 4. Press Shift-Return. OBSERVED RESULT A newline is appended to the complete end of the message. EXPECTED RESULT The newline should be placed at the cursor, replacing the selection (if applicable). SOFTWARE/OS VERSIONS KDE Connect 24.05.1 (currently version)
Confirmed this behavior. Thanks for the report. This is pretty clear looking at the code in smsapp/qml/SendingArea.qml, line 84 on, that it appends the newline to the text entry field: Keys.onReturnPressed: event => { if (event.key === Qt.Key_Return) { if (event.modifiers & Qt.ShiftModifier) { messageField.append("") } else { sendButton.clicked() event.accepted = true } } } I can't think of a way to improve this code off-hand. Tagging this as a junior job since it's probably a simple change, just needs someone to spend a little time researching the right solution and test it.
A possibly relevant merge request was started @ https://invent.kde.org/network/kdeconnect-kde/-/merge_requests/695
Git commit d03e964ed77a980b027e53f5d6534625a9a8218b by Albert Vaca Cintora, on behalf of Ryan Frew. Committed on 28/06/2024 at 11:19. Pushed by albertvaka into branch 'master'. Corrected newline inserting when using shift+return while writing SMS messages Shift+return was always inserting newline at the end of the current line of text, ignoring where the cursor was, and not overriding currently selected text M +3 -1 smsapp/qml/SendingArea.qml https://invent.kde.org/network/kdeconnect-kde/-/commit/d03e964ed77a980b027e53f5d6534625a9a8218b