Add line number toggle

This commit is contained in:
No Time To Play 2023-09-15 06:55:49 +00:00
parent 8ca9f92b56
commit 66775e7782
1 changed files with 12 additions and 0 deletions

View File

@ -178,7 +178,9 @@ set file_types {
set file_name ""
set search_term ""
set _word_wrap 1
set _line_nums 1
namespace eval font_size {
variable minimum 6
@ -395,6 +397,8 @@ $m add command -label "Export..." -command do_export \
$m add separator
$m add checkbutton -label "Word wrap" -under 0 -var _word_wrap \
-command {tk_util::word_wrap $editor}
$m add checkbutton -label "Line numbers" -under 0 -var _line_nums \
-command {toggle_lines $editor}
$m add separator
$m add command -label "Bigger font" -under 0 -accel "Ctrl +" \
-command {font_size incr $editor}
@ -864,6 +868,14 @@ proc escape html {
return [string map $chars $html]
}
proc toggle_lines widget {
if {[$widget cget -linemap]} {
$widget configure -linemap 0
} else {
$widget configure -linemap 1
}
}
proc alert message {
global window_title
tk_messageBox -parent . \