Thu 19 Oct 2017 10:48:31 PM UTC, comment #12:
And, for the record, even more detailed testing, with the file that was attached in comment #6:
nano --ignore --softwrap --nowrap -T 182 nanocrap3.txt
Vertical navigation starting from row 1, column 1 (Down 6 times, Up 6 times, Right once, repeat) works properly and preserves all columns on all rows containing text (row 1, row 3, row 5, and row 6). Home also preserves the column as the first available one on each line. In short, everything still works as expected, with the columns preserved.
|
Thu 19 Oct 2017 09:21:58 PM UTC, comment #11:
(The previous testing, as well as this testing, is done with an 80x24 terminal.)
Even more detailed testing:
nano --ignore --softwrap --nowrap -T 219 nanocrap2.txt
Vertical navigation starting from row 1, column 1 (Down 5 times, Up 5 times, Right once, repeat) works properly and preserves all columns on all rows containing text (row 1, row 3, row 4, and row 5). Home also preserves the column as the first available one on each line. In short, everything still works as expected, with the columns preserved.
(file #42199)
|
Thu 19 Oct 2017 09:13:43 PM UTC, comment #10:
More detailed testing with current git and my patch from comment #9 applied:
nano --ignore --softwrap --nowrap -T 132 nanocrap.txt
Starting at row 1, column 1, pressing Down 5 times moves 5 rows down, and then pressing Up 5 times moves 5 rows up, as expected, with the columns preserved. Pressing Right, and repeating this for row 1, column 3 also works as expected. Repeating this for row 1, and columns 5, 7, 9, 10, 12, 14, 16, 18, 20, 22, 24, 25, 27, and 28 also works as expected, with the columns preserved.
Starting at row 4, column 265, pressing Up 3 times moves 3 rows up, and then pressing Down 3 times moves 3 rows down, as expected, with the columns preserved. Pressing Right, and repeating this for row 4, and columns 267, 269, 271, 273, 274, 276, 278, 280, 282, 284, 286, 288, 289, 290, 291, 293, 295, 297, 299, 301, 303, 305, 307, 309, 311, 313, 315, 317, and 319 also works as expected, with the columns preserved.
Starting at row 4, column 267 or later, pressing Home moves once to column 267, and pressing Up moves the cursor to column 161 of row 3, column 133 of row 2, and column 1 of row 1, as expected; this is of course different from ordinary vertical movement because Home keeps the cursor at the first available column of each line (shifting forward through overwide tabs), as it should.
(file #42198)
|
Thu 12 Oct 2017 09:12:45 PM UTC, comment #1:
I've looked into this, and I'm stumped for the moment. Either proper_x() will have to be extended to shift backwards as well as forwards, or your other idea of making the chunk iterators skip over chunks entirely taken up by tabs will have to be implemented.
I've made attempts at the latter, and I haven't been able to do anything except break things in new and interesting ways. However, maybe you can think of another way. If you want to make an attempt, keep in mind that most of the chunk iterator calls assume that one chunk always takes up one row of the screen. Breaking that assumption in all chunk iterator calls will lead to major problems; for example, with regard to display, place_the_cursor() needs to count exactly how many rows everything takes up. The tab skipping will have to only be used when moving vertically.
For the record, the two attempts are attached; they're both against git d011983. Maybe they can give you some ideas, if nothing else?
(file #42131, file #42132)
|