Commit bb213bb
Allow to find beginning and end of line from a specific point
I didn't find an easy way to determine whether the cursor is in the
last prompt line or what the prompt line number even is. And one
cannot assume the prompt line is the last line of the buffer beacuse
vterm is basically a rectangle filling the whole buffer. As a
consequence `(line-number-at-pos (point-max))` _doesn't work_
because `(point-max)` _doesn't work_.
With this patch, it is possible to find the prompt line using:
(line-number-at-pos (vterm--get-beginning-of-line
(vterm--get-cursor-point)))))
And in case the command in prompt is long and wraps into multiple
lines, its end can be found using:
(line-number-at-pos (vterm--get-end-of-line
(vterm--get-cursor-point)))))1 parent 3e5a9b7 commit bb213bb
1 file changed
+10
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1679 | 1679 | | |
1680 | 1680 | | |
1681 | 1681 | | |
1682 | | - | |
1683 | | - | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
1684 | 1686 | | |
| 1687 | + | |
1685 | 1688 | | |
1686 | 1689 | | |
1687 | 1690 | | |
1688 | 1691 | | |
1689 | 1692 | | |
1690 | 1693 | | |
1691 | 1694 | | |
1692 | | - | |
1693 | | - | |
| 1695 | + | |
| 1696 | + | |
| 1697 | + | |
| 1698 | + | |
1694 | 1699 | | |
| 1700 | + | |
1695 | 1701 | | |
1696 | 1702 | | |
1697 | 1703 | | |
| |||
0 commit comments