[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nano-devel] pasting into a line deletes its bookmark
From: |
Marco Diego Aurélio Mesquita |
Subject: |
Re: [Nano-devel] pasting into a line deletes its bookmark |
Date: |
Mon, 17 Dec 2018 23:49:16 -0200 |
User-agent: |
NeoMutt/20170113 (1.7.2) |
On Mon, Dec 17, 2018 at 06:49:13PM -0200, Marco Diego Aurélio Mesquita wrote:
> On Mon, Dec 17, 2018 at 08:03:43PM +0100, Benno Schulenberg wrote:
> >
> > Op 17-12-18 om 19:26 schreef Marco Diego Aurélio Mesquita:
> > > Please consider the attached patch.
> >
> > That keeps the bookmark when something is pasted into a bookmarked
> > line. Which is good. But it is not enough: after pasting, press
> > Undo (M-U). The bookmark is gone.
> >
>
> Please consider the attached patch.
Please, ignore my previous mail.
It looks like managing bookmarked lines has many corner cases which
I overlooked.
To improved the situation, I decided to enumerate some test-cases,
found and fixed some bugs.
The test cases start with the following text:
12431234
b1
qwerqwer
b2
asdfasdf
I then did the following actions, carefully testing after each one
if bookmarks behaved as expected:
1 - bookmarked b1
2 - unbookmarked b1
3 - bookmarked b2
4 - unbookmarked b2
5 - bookmarked b1
6 - bookmarked b2
7 - removed b1
8 - undo
7 - removed b2
8 - undo
9 - removed line before b1
10 - undo
11 - removed line before b2
12 - undo
13 - add text in b1 line, selected added text and cut it
14 - undo
15 - add text in b2 line, selected added text and cut it
16 - undo
17 - selected and cut "234" and pasted it in b1 line
18 - undo
17 - selected and cut "wer" and pasted it in b2 line
18 - undo
19 - pressed delete on the line before b1
20 - pressed delete on the line before b2
21 - undo
22 - selected text spanning both b1 and b2, cut, and paste on
another place
23 - undo
On each of these cases, the "undo" means "undo until the text is
fully recovered".
The attached patch is a work in progress and fixes all the bugs
found with above test cases.
I still plan to add more test cases to cover the zap feature,
delete previous/next word, delete until end of line/file and run
external programs. If I find new bugs with these new test cases,
I'll plan to fix them.
After new test cases, fixed bugs, no new bugs found and once I'm
more confident, I'll clean up the patch and send an updated version.
Thanks!
wip.diff
Description: Text Data
- [Nano-devel] [PATCH 1/3 V13] new feature: bindable functions for toggling and jumping to bookmarks, Benno Schulenberg, 2018/12/17
- [Nano-devel] [PATCH 2/3 V13] bindings: hard-bind the bookmark functions to M-Ins and M-PgUp/M-PgDn, Benno Schulenberg, 2018/12/17
- [Nano-devel] [PATCH 3/3 V13] docs: add descriptions of the bindable bookmark functions, Benno Schulenberg, 2018/12/17
- Re: [Nano-devel] [PATCH 1/3 V13] new feature: bindable functions for toggling and jumping to bookmarks, Benno Schulenberg, 2018/12/17
- [Nano-devel] pasting into a line deletes its bookmark, Benno Schulenberg, 2018/12/17
- Re: [Nano-devel] pasting into a line deletes its bookmark, Marco Diego Aurélio Mesquita, 2018/12/17
- Re: [Nano-devel] pasting into a line deletes its bookmark, Benno Schulenberg, 2018/12/17
- Re: [Nano-devel] pasting into a line deletes its bookmark, Marco Diego Aurélio Mesquita, 2018/12/17
- Re: [Nano-devel] pasting into a line deletes its bookmark,
Marco Diego Aurélio Mesquita <=
- Re: [Nano-devel] pasting into a line deletes its bookmark, Benno Schulenberg, 2018/12/18
- Re: [Nano-devel] pasting into a line deletes its bookmark, Marco Diego Aurélio Mesquita, 2018/12/18
- Re: [Nano-devel] pasting into a line deletes its bookmark, Benno Schulenberg, 2018/12/19