Add information about cursor row and column positions in the editor area
There isn't any information about where my cursor is currently.
Users would feel greater when they are debugging their Python project since python is strict with indentation of code with the help of the reference of the cursor position. This suggestion is largely influenced by the VS Code editor.
Actually I've already solved this problem by modifying [frontend/src/routes/_oh.app._index/code-editor-component.tsx] . Here's how I worked it out :
- State management: Use React's useState hook to create a state called cursorPosition that stores the position of the cursor (row and column numbers).
- Register events for cursor position changes: In the handleEditorDidMount callback, use Monaco Editor's onDidChangeCursorPosition event to monitor cursor position changes. When the cursor position changes, this code updates the cursorPosition state, storing the row and column numbers of the current cursor.
- Cursor Position Display: In the component's JSX return, the cursorPosition state is used to dynamically display the current cursor position.
Here's what my local implementation looks like :
Ah this is cool! If you have a change that is working, why not open a PR? I'm sure others would appreciate the improvement. Just need to make sure @rbren and @amanape approve the PR since it's a UI tweak.
Thanks for opening that PR! Seems like just needs a conflict resolution for merging!
This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for over 30 days with no activity.