comparison src/mark.c @ 21403:d387121083a4 v8.2.1252

patch 8.2.1252: ":marks" may show '< and '> mixed up Commit: https://github.com/vim/vim/commit/54c3fcd852f9d986f81547429e850b3364f058d6 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jul 19 22:09:06 2020 +0200 patch 8.2.1252: ":marks" may show '< and '> mixed up Problem: ":marks" may show '< and '> mixed up. Solution: Show the mark position as where '< and '> would jump.
author Bram Moolenaar <Bram@vim.org>
date Sun, 19 Jul 2020 22:15:03 +0200
parents 9064044fd4f6
children e82579016863
comparison
equal deleted inserted replaced
21402:a7733fa5dbe0 21403:d387121083a4
702 ex_marks(exarg_T *eap) 702 ex_marks(exarg_T *eap)
703 { 703 {
704 char_u *arg = eap->arg; 704 char_u *arg = eap->arg;
705 int i; 705 int i;
706 char_u *name; 706 char_u *name;
707 pos_T *posp, *startp, *endp;
707 708
708 if (arg != NULL && *arg == NUL) 709 if (arg != NULL && *arg == NUL)
709 arg = NULL; 710 arg = NULL;
710 711
711 show_one_mark('\'', arg, &curwin->w_pcmark, NULL, TRUE); 712 show_one_mark('\'', arg, &curwin->w_pcmark, NULL, TRUE);
729 show_one_mark('"', arg, &curbuf->b_last_cursor, NULL, TRUE); 730 show_one_mark('"', arg, &curbuf->b_last_cursor, NULL, TRUE);
730 show_one_mark('[', arg, &curbuf->b_op_start, NULL, TRUE); 731 show_one_mark('[', arg, &curbuf->b_op_start, NULL, TRUE);
731 show_one_mark(']', arg, &curbuf->b_op_end, NULL, TRUE); 732 show_one_mark(']', arg, &curbuf->b_op_end, NULL, TRUE);
732 show_one_mark('^', arg, &curbuf->b_last_insert, NULL, TRUE); 733 show_one_mark('^', arg, &curbuf->b_last_insert, NULL, TRUE);
733 show_one_mark('.', arg, &curbuf->b_last_change, NULL, TRUE); 734 show_one_mark('.', arg, &curbuf->b_last_change, NULL, TRUE);
734 show_one_mark('<', arg, &curbuf->b_visual.vi_start, NULL, TRUE); 735
735 show_one_mark('>', arg, &curbuf->b_visual.vi_end, NULL, TRUE); 736 // Show the marks as where they will jump to.
737 startp = &curbuf->b_visual.vi_start;
738 endp = &curbuf->b_visual.vi_end;
739 if ((LT_POS(*startp, *endp) || endp->lnum == 0) && startp->lnum != 0)
740 posp = startp;
741 else
742 posp = endp;
743 show_one_mark('<', arg, posp, NULL, TRUE);
744 show_one_mark('>', arg, posp == startp ? endp : startp, NULL, TRUE);
745
736 show_one_mark(-1, arg, NULL, NULL, FALSE); 746 show_one_mark(-1, arg, NULL, NULL, FALSE);
737 } 747 }
738 748
739 static void 749 static void
740 show_one_mark( 750 show_one_mark(