naturalcrit / homebrewery

Create authentic looking D&D homebrews using only markdown
https://homebrewery.naturalcrit.com
MIT License
1.1k stars 326 forks source link

Make tabs visible in codemirror pane #1622

Open ericscheid opened 3 years ago

ericscheid commented 3 years ago

It can be helpful to see if white space is a tab or spaces, (sometimes this can also affect the rendering, which might be a bug but if tabs are invisible it's also maddening to debug)

So .. add this to styles..

.cm-tab { 
  background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAMCAQAAACOs/baAAAARUlEQVR4nGJgIAG8JkXxUAcCtDWemcGR1lY4MvgzCEKY7jSBjgxBDAG09UEQzAe0AMwMHrSOAwEGRtpaMIwAAAAA//8DAG4ID9EKs6YqAAAAAElFTkSuQmCC);
  background-position: right;
  background-repeat: no-repeat;
}

image

ericscheid commented 3 years ago

This can go into both V3 and Legacy as a non-breaking tweak.

calculuschild commented 2 years ago

Added via #1819

ericscheid commented 2 years ago

This was the image we used to indicate a tabbed space (effected via a data: uri)

image.png

It was not well received by the community. "Too much clutter".

It might work better as a 1 character wide arrow, with the rest of the width being transparent being a floating dot for each character space (to make clear cases of SPACE SPACE TAB)

Would also be good to have some kind of toggle for "show invisibles" in the snippet bar, possibly as a toggle button adjacent to the undo/redo buttons. (We could later put other editor-ui-toggle widgets there too, e.g. something to invoke find/replace).

5e-Cleric commented 1 month ago

Reopening as this was pulled back and forgotten about until eric brought it back.

5e-Cleric commented 1 month ago

the toggle seems to be the most important part of this, we should probably add a button with the same icon MS Word uses, ¶ (PILCROW U+00B6)

ericscheid commented 1 month ago

Not just tab characters though .. would also be helpful to show trailing spaces that trigger line breaks.

See #3743