Changeset 743e17b in mainline
- Timestamp:
- 2009-09-16T21:25:30Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 985e26d2, e5d4294
- Parents:
- 884b461
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/edit/edit.c
r884b461 r743e17b 72 72 /** Current position of the caret */ 73 73 tag_t caret_pos; 74 75 /** 76 * Ideal column where the caret should try to get. This is used 77 * for maintaining the same column during vertical movement. 78 */ 79 int ideal_column; 74 80 } pane_t; 75 81 … … 141 147 sheet_get_cell_pt(&doc.sh, &coord, dir_before, &pt); 142 148 sheet_place_tag(&doc.sh, &pt, &pane.caret_pos); 149 pane.ideal_column = coord.column; 143 150 144 151 if (argc == 2) { … … 605 612 coord_t coord; 606 613 int num_rows; 614 bool pure_vertical; 607 615 608 616 tag_get_pt(&pane.caret_pos, &pt); … … 617 625 if (coord.row > num_rows) coord.row = num_rows; 618 626 } 627 628 /* For purely vertical movement try attaining @c ideal_column. */ 629 pure_vertical = (dcolumn == 0 && align_dir == dir_before); 630 if (pure_vertical) 631 coord.column = pane.ideal_column; 619 632 620 633 /* … … 626 639 sheet_place_tag(&doc.sh, &pt, &pane.caret_pos); 627 640 641 /* For non-vertical movement set the new value for @c ideal_column. */ 642 if (!pure_vertical) { 643 spt_get_coord(&pt, &coord); 644 pane.ideal_column = coord.column; 645 } 646 628 647 caret_update(); 629 648 }
Note:
See TracChangeset
for help on using the changeset viewer.