{"thread":{"id":"57803","subject":"[PATCH] git-gui: Indicate cursor position in commit buffer","startedAt":"2022-04-27T00:25:32Z","lastAt":"2022-04-27T00:25:32Z","messageCount":1,"participants":["mitchr"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"454483","messageId":"20220427002520.99115-1-mitchr@mitchr.dev","threadId":"57803","inReplyTo":null,"subject":"[PATCH] git-gui: Indicate cursor position in commit buffer","fromName":"mitchr","fromEmail":"mitchr@mitchr.dev","sentAt":"2022-04-27T00:25:20Z","receivedAt":"2022-04-27T00:25:32Z","isPatch":true,"sender":{"key":"mitchr@mitchr.dev","avatar":null},"body":"From: Mitchell Riley <mitchr@mitchr.dev>\n\nAdd a visual indicator for both the line and column position of the \ncursor to the bottom right of the commit buffer.\n\nSigned-off-by: Mitchell Riley <mitchr@mitchr.dev>\n\n---\n git-gui.sh | 15 +++++++++++++++\n 1 file changed, 15 insertions(+)\n\ndiff --git a/git-gui.sh b/git-gui.sh\nindex 201524c..a0cdf5c 100755\n--- a/git-gui.sh\n+++ b/git-gui.sh\n@@ -3411,8 +3411,10 @@ if {![is_enabled nocommit]} {\n #\n ${NS}::frame .vpane.lower.commarea.buffer\n ${NS}::frame .vpane.lower.commarea.buffer.header\n+${NS}::frame .vpane.lower.commarea.buffer.footer\n set ui_comm .vpane.lower.commarea.buffer.frame.t\n set ui_coml .vpane.lower.commarea.buffer.header.l\n+set ui_comm_pos .vpane.lower.commarea.buffer.footer\n \n if {![is_enabled nocommit]} {\n \t${NS}::checkbutton .vpane.lower.commarea.buffer.header.amend \\\n@@ -3465,10 +3467,23 @@ ${NS}::scrollbar .vpane.lower.commarea.buffer.frame.sby \\\n \t-orient vertical \\\n \t-command [list $ui_comm yview]\n \n+set line 0\n+set col 0\n+${NS}::label $ui_comm_pos.ll -text \"Ln \"\n+${NS}::label $ui_comm_pos.lb -textvariable line\n+${NS}::label $ui_comm_pos.cl -text \", Col \"\n+${NS}::label $ui_comm_pos.cb -textvariable col\n+bind $ui_comm <KeyRelease> {lassign [split [$ui_comm index insert] \".\"] line col}\n+pack $ui_comm_pos.cb -side right\n+pack $ui_comm_pos.cl -side right\n+pack $ui_comm_pos.lb -side right\n+pack $ui_comm_pos.ll -side right\n+\n pack .vpane.lower.commarea.buffer.frame.sbx -side bottom -fill x\n pack .vpane.lower.commarea.buffer.frame.sby -side right -fill y\n pack $ui_comm -side left -fill y\n pack .vpane.lower.commarea.buffer.header -side top -fill x\n+pack .vpane.lower.commarea.buffer.footer -side bottom -fill x\n pack .vpane.lower.commarea.buffer.frame -side left -fill y\n pack .vpane.lower.commarea.buffer -side left -fill y\n \n-- \n2.32.0\n\n"}]}