Browse Source

Improve gemtext formatting in modal while cview bug isn't fixed

v0.6.0-dev
bacardi55 10 months ago
parent
commit
66b5b2195a
  1. 1
      CHANGELOG.md
  2. 1
      docs/TUI.md
  3. 4
      ui/tltui.go
  4. 4
      ui/tuishortcuts.go

1
CHANGELOG.md

@ -17,6 +17,7 @@ CHANGELOG
* #35: parser v2: Improve parser to be compatible with proposition 15 of the RFC (https://codeberg.org/bacardi55/gemini-tinylog-rfc/issues/15) that allow multiple break line in posts. Also improve parsing in general.
* Implement a modal for entry details via alt+enter
* Implement `tui_show_stub` option to show the stub to copy instead (or additionally) of copying it to the clipboard. Can be useful if you run gtl without X and/or are using tools like tmux to copy texts. Idea is from @szczezuja.
* Implement entry selection via mouse left click and simplify highlights code.
## Smaller improvements:
* [TUI] Add optional limit to number of displayed entries: Allow to limit the number of entries displayed in the timeline. See `tui_max_entries` option in README.

1
docs/TUI.md

@ -30,6 +30,7 @@ R: Open tinylog in $EDITOR and optionaly copy a response stub to the specific en
O: Open link(s) in selected entry. # since v0.6.0
T: If the selected entry is a response to another tinylog entry, will open the original entry in a popup.
Alt+Enter: Open the selected entry in a modal. Also show buttons to open links (O), Open a thread (T) or start a reply (R)
Left Click on an entry: Select the clicked entry
```
## TUI subscription shortcuts

4
ui/tltui.go

@ -40,8 +40,8 @@ type TlTUI struct {
Clipboard TlClipboard
Muted []string
NbEntries int
TlConfig *core.TlConfig
TlStream *core.TlStream
TlConfig *core.TlConfig
TlStream *core.TlStream
}
func (TlTui *TlTUI) InitApp() {

4
ui/tuishortcuts.go

@ -440,7 +440,7 @@ func threadHandler(ev *tcell.EventKey) *tcell.EventKey {
toggleFormModal()
} else {
fe := gemtextFormatModal(tlfi)
fe = "[-:-:u]Original entry[-]:\n\n" + fe
fe = "Original entry:\n\n" + fe
updateFormModalContent(fe, "Ok", "", nil)
TlTui.FormModal.SetTextAlign(cview.AlignLeft)
toggleFormModal()
@ -460,7 +460,7 @@ func gemtextFormatModal(tlfi *core.TlFeedItem) string {
d := formatElapsedTime(t.Sub(tlfi.Published))
a := tlfi.Author
//c := strings.Replace(gemtextFormat(tlfi.Content, false, TlTui.TlConfig.Tui_status_emoji), "\n", "\n\n", -1)
c := strings.Replace(tlfi.Content, "\n", "\n\n", -1)
c := tlfi.Content
fe := d + " - " + tlfi.Published.Format(TlTui.TlConfig.Date_format) + "\n\n" + a + "\n\n" + c + "\n"
return fe

Loading…
Cancel
Save