amagnasco / xwpe

Upload of an abandoned ncurses-based programming environment
http://www.identicalsoftware.com/xwpe/
GNU General Public License v2.0
29 stars 6 forks source link

Replace does not work as expected #73

Open gbonnema opened 7 years ago

gbonnema commented 7 years ago

After solving #68 (Search with regex does not work as intended) and rewriting parts of the search algorithms (without changing functionality), I need to test and refactor the replace. Replace leans heavily on the search result. It is unclear whether after the refactoring, the replace still works properly. I might have to go to the original code to test how it worked back then, if I run into trouble.

First sign of trouble is that undo after a replace leads to signal 11 or segment fault.

This could be the result of my changes, or could have been so all along. This I will have to test. A regression would do wonders here.

gbonnema commented 7 years ago

I checked out master (from amagnasco) and had to correct a typo due to a link error before I could implement xwpe. After testing, it turns out undo did not work properly in this version. It did not segment fault (so I introduced that error somehow), but it did disfunction. In stead of replacing only the word I changed, it deleted the line the word was on and on the next line inserted the unchanged word at the same position as on the original line.

Remark that this code is virtually unchanged with respect to the original code. This was commit commit b3062d968825386f23ab935bfcda8b5d3d176091 (HEAD -> master, origin/master, origin/HEAD). I will tag this commit as testversion for comparison to changes. In future release we will have the release-tag for checking out the correct comparison commit. At the moment we have none.

This means I will have to refactor and debug the replace in order to get it working properly.

gbonnema commented 7 years ago

This comment was removed and placed in a new issue: #76.