replit / codemirror-indentation-markers Goto Github PK
View Code? Open in Web Editor NEWA CodeMirror extension that renders indentation markers
Home Page: https://www.npmjs.com/package/@replit/codemirror-indentation-markers
License: MIT License
A CodeMirror extension that renders indentation markers
Home Page: https://www.npmjs.com/package/@replit/codemirror-indentation-markers
License: MIT License
Lines that are empty or only contain whitespace have indentation markers that appear a few units to the left of lines that have content:
Live repro: https://repro-codemirror-indentation-markers-7.glitch.me
Hi,
Assuming you have a document in markdown like:
- one
- two
- three
four
five
The plugin draws a line on first four lines, which doesn't look good.
I found a quick fix to hide line in blank lines after the indent by adding that to my theme:
"span span.cm-indentation-marker": {
display: "none",
},
Maybe you'll find it useful and add it to the code as a default :) (or do it in some nicer way than ugly CSS hack ;) )
As shown below, when the cursor is at a statement after a block (print
below), the previous block (the if
block below) seems to still be highlighted as the active block, which is not expected. If a blank line is inserted above print
, then the outer block is highlighted when the cursor is at print
as expected.
I understand that some of the detection logic may be upstream, so I'm not sure if this is the right place to file this issue.
I'm currently exploring hooking up this plugin to Chrome DevTools by default (as requested in crbug/1479986). However testing this a on a bunch of files, in some cases (for example the proxy.js
file in the coffee-cart.netlify.app test app) the indentation seems off by 1 or 2 levels.
Hi Everyone,
I noticed that the indentation guides extend to the end of the enclosing scope, even if there's no code in the additional lines. This approach is valid, but it differs from the behavior of other common editors like VS Code.
I propose adjusting the indentation guides to terminate at the last line of code within a scope. I believe this subtle adjustment could provide a cleaner and more intuitive visual representation of code structure.
Before:
class Foo:
| def __init__(self, bars):
| | self.bars = []
| | if bars:
| | | self.bars = bars
| | |
| | |
| def print_bars(self):
| | for element in self.bars:
| | | print(element)
| | |
| | |
...
After:
class Foo:
| def __init__(self, bars):
| | self.bars = []
| | if bars:
| | | self.bars = bars
|
|
| def print_bars(self):
| | for element in self.bars:
| | | print(element)
...
And then for languages that use curly braces, it would better represent the scope of the code even if the brackets aren't properly formatted:
Before:
if (true){
| doSomething()}
|
|
...
After:
if (true){
| doSomething()}
...
If there's any interest, I can go ahead and make a pull request. It's a pretty easy change.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.