Bug 340550 - [vi mode] when doing paragraph report, merges with the next paragraph
Summary: [vi mode] when doing paragraph report, merges with the next paragraph
Status: RESOLVED FIXED
Alias: None
Product: kile
Classification: Applications
Component: editor (show other bugs)
Version: 2.1.3
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: Michel Ludwig
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-01 13:27 UTC by Guus
Modified: 2021-02-08 20:56 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Guus 2014-11-01 13:27:00 UTC
When under vi mode I use the command "gqap" this command should format exactly one paragraph, and it does. However, it also deletes the empty line effectively merging the formatted paragraph with the next paragraph. From standard vi I do not have this problem.

Can anyone confirm this behaviour? 

Reproducible: Always

Steps to Reproduce:
1. Create two paragraphs in a latex document.
2. Position the cursor in the first of the two paragraphs
3. in command mode do "gqap" which should format the paragraph within the linewidth defined (usually 78 characters).


Actual Results:  
The result is a formatted paragraph plus the editor deletes the empty line following the first paragraph merging it with the second.

Expected Results:  
It should format like it did, without deleting the empty line after the paragraph.

I rated it a normal bug, although there really is a workaround (re-insert the empty line). It is just annoying. If there is an easy fix, that would be marvelous.
Comment 1 Andrew Crouthamel 2018-11-12 02:43:32 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!
Comment 2 Andrew Crouthamel 2018-11-21 04:22:04 UTC
Dear Bug Submitter,

This is a reminder that this bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? This bug will be moved back to REPORTED Status for manual review later, which may take a while. If you are able to, please lend us a hand.

Thank you for helping us make KDE software even better for everyone!
Comment 3 Bug Janitor Service 2021-02-08 11:44:11 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/102
Comment 4 Jan Paul Batrina 2021-02-08 20:56:58 UTC
Git commit 94374c9ca84bf3089598b6b19baeab44b505e816 by Jan Paul Batrina.
Committed on 08/02/2021 at 11:40.
Pushed by cullmann into branch 'master'.

[Vimode] Do not remove empty lines when reformatting

In vimode, "gqap" also selects empty lines. As an implementation detail,
we use joinLines() which happily gobbles up empty lines.

M  +1    -0    autotests/src/vimode/modes.cpp
M  +23   -1    src/vimode/modes/normalvimode.cpp

https://invent.kde.org/frameworks/ktexteditor/commit/94374c9ca84bf3089598b6b19baeab44b505e816