Skip to content

Conversation

ailin-nemui
Copy link
Contributor

@ailin-nemui ailin-nemui commented Aug 7, 2019

  • fix /set hide_colors
  • fix line IDs on perl side
  • reimplement the colour stripping in line2text

@ailin-nemui
Copy link
Contributor Author

another attempt at #1063

@ailin-nemui
Copy link
Contributor Author

ailin-nemui commented Aug 7, 2019

  • reimplement glib code, do not require newer glib

  • design doesn't waste twice the memory, uses cache and original formats

  • completely removed the old textbuffer representation ( https://github.com/shabble/irssi-docs/wiki/Notes-256-Colour#textbuffer-encoding )

    • this may have some drawbacks:
      • texts are no longer NUL-safe
      • additional escaping routines would need to be introduced if text is supposed to contain formatting codes
    • benefits
      • one less layer of indirection
      • NUL-terminated strings, no weird issues with cut off UTF8 (although we fixed that)
      • simpler code
  • the textbuffer-formats is an extra module, so if we unhook the signals it should go back to the "old way" of storing pre-rendered text

Todos

  • differentiate between deleted formats and empty lines
  • fix all the bugs

  • we should check if the removal of the optimised textbuffer has any visible performance implications

@vague666

This comment has been minimized.

@vague666
Copy link
Member

vague666 commented Aug 7, 2019

/scrollback redraw seems to work well, too bad it's not done automatically yet :)

@ailin-nemui
Copy link
Contributor Author

-> under what circumstances would we "want" an automated scrollback redraw?

@vague666
Copy link
Member

vague666 commented Aug 7, 2019

/set theme and /format .... imo, and /window theme
basically in all instances :)
Maybe control it with a setting

@ailin-nemui

This comment has been minimized.

@ailin-nemui ailin-nemui force-pushed the reformat2 branch 2 times, most recently from 91f3b14 to 831e18e Compare August 8, 2019 19:55
@dequis

This comment has been minimized.

@ailin-nemui ailin-nemui changed the title reapply a theme to previous formats reapply a theme to previous formats& ircv3 Aug 13, 2019
@dequis

This comment has been minimized.

@ailin-nemui ailin-nemui changed the title reapply a theme to previous formats& ircv3 reapply a theme to previous formats Aug 13, 2019
@ailin-nemui
Copy link
Contributor Author

ailin-nemui commented Aug 13, 2019

the code is mostly split into 3 parts;

  • ripping out the old textbuffer implementation and storing the line texts and formats
  • the expando caching in special-vars
  • the perl code

@ailin-nemui
Copy link
Contributor Author

you should be able to review each commit individually, but it's still a big hairy lump

for the view_update_line_cache in textbuffer-view.c, it would make sense to review with white-space ignored (?w=1 )

@ailin-nemui
Copy link
Contributor Author

@irssi/developers please test

@vague666
Copy link
Member

vague666 commented Mar 25, 2020

There's some drawing issues
tested with 1079.diff on HEAD, Irssi v1.2-dev-522-g991e24fb-dirty and themes https://irssi-import.github.io/themes/elite.theme and https://bitbucket.org/realnot/dirssi/src/master/

irssi elite dirssi
HEAD + diff elite.theme patched dirssi.theme patched
g991e24fb elite.theme unpatched dirssi.theme unpatched

Also, I'd still like the scrollback to be redrawn automatically if possible when theme is applied

@ailin-nemui
Copy link
Contributor Author

thank you very much for the detailed report. btw the auto redraw will come, just not in this PR!

@ailin-nemui ailin-nemui changed the title reapply a theme to previous formats reapply a theme to previous formats Mar 29, 2020
@ailin-nemui
Copy link
Contributor Author

I think I fixed dirssi, still need to check elite

@ailin-nemui
Copy link
Contributor Author

@irssi/developers last chance to review....

@ailin-nemui ailin-nemui added the auto-merge This PR is scheduled for merge if no further comments are opened label Apr 20, 2020
@ailin-nemui ailin-nemui force-pushed the reformat2 branch 6 times, most recently from 1a55b3c to 2ceb4a9 Compare April 21, 2020 21:17
- completely removed the old textbuffer representation (
  https://github.com/shabble/irssi-docs/wiki/Notes-256-Colour#textbuffer-encoding
  )

- textbuffer-formats is an extra module, so if we unhook the signals it
  should go back to the "old way" of storing pre-rendered tex

- design uses cache, original formats and list of arguments
- the expando values need to be stored now that the lines are
  reformattable, otherwise the old values are lost (and they depend on
  context only available at the time the line is initially printed)

- the cache is collected from the special-vars evaluation code

- the cache is controlled by the textbuffer-formats code, and stored in
  the text_buffer_format_rec
@ailin-nemui ailin-nemui force-pushed the reformat2 branch 2 times, most recently from f6474d7 to 138ff1a Compare April 28, 2020 13:40
- compatibility shim for new line

- make format accessible from perl

- fix perl line IDs being mixed up due to wrapper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge This PR is scheduled for merge if no further comments are opened
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants