History

Fix several titling annoyances

malc committed 5 years ago

Commit b3fc2211 parent 4343ccd1 file · +19 −9Browse files

Unified · Split

main.ml+19−9
@@ -804,6 +804,20 @@ let fillhelp () = · 803 unmodified lines
804 @ (("", 0, Noaction) :: loop [] sl) |> Array.of_list804 @ (("", 0, Noaction) :: loop [] sl) |> Array.of_list
805;;805;;
806 806
807let titlify path =
808 if emptystr path
809 then path
810 else
811 (if emptystr state.origin then path else state.origin)
812 |> Filename.basename |> Ffi.mbtoutf8;
813;;
814
815let settitle title =
816 conf.title <- title;
817 if not !ignoredoctitlte
818 then Wsi.settitle @@ "llpp: " ^ title;
819;;
820
807let opendoc path password =821let opendoc path password =
808 state.path <- path;822 state.path <- path;
809 state.password <- password;823 state.password <- password;
@@ -816,12 +830,7 @@ let opendoc path password = · 6 unmodified lines
816 Ffi.setpapercolor conf.papercolor;830 Ffi.setpapercolor conf.papercolor;
817 Ffi.setdcf conf.dcf;831 Ffi.setdcf conf.dcf;
818 832
819 let titlepath =833 Wsi.settitle @@ titlify path;
820 if emptystr state.origin
821 then path
822 else state.origin
823 in
824 Wsi.settitle ("llpp: " ^ Ffi.mbtoutf8 (Filename.basename titlepath));
825 wcmd U.dopen "%d %d %s\000%s\000%s\000"834 wcmd U.dopen "%d %d %s\000%s\000%s\000"
826 (btod conf.usedoccss) !layouth835 (btod conf.usedoccss) !layouth
827 path password conf.css;836 path password conf.css;
@@ -1375,8 +1384,7 @@ let act cmds = · 547 unmodified lines
1375 let s =1384 let s =
1376 match splitatchar args '\t' with1385 match splitatchar args '\t' with
1377 | "Title", v ->1386 | "Title", v ->
1378 conf.title <- v;1387 settitle v;
1379 if not !ignoredoctitlte then Wsi.settitle @@ "llpp: " ^ v;
1380 args1388 args
1381 | _, "" -> args1389 | _, "" -> args
1382 | c, v ->1390 | c, v ->
@@ -4470,7 +4478,9 @@ let uioh = object · 3087 unmodified lines
4470 method display = ()4478 method display = ()
4471 4479
4472 method title =4480 method title =
4473 if emptystr conf.title then Ffi.mbtoutf8 state.path else conf.title4481 if emptystr conf.title
4482 then titlify state.path
4483 else conf.title
4474 4484
4475 method key key mask =4485 method key key mask =
4476 begin match state.mode with4486 begin match state.mode with

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t