Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tutor: raw text not shown while editing element #28172

Closed
goyalyashpal opened this issue Apr 4, 2024 · 8 comments
Closed

tutor: raw text not shown while editing element #28172

goyalyashpal opened this issue Apr 4, 2024 · 8 comments
Labels
closed:question issues that are closed as usage questions

Comments

@goyalyashpal
Copy link

goyalyashpal commented Apr 4, 2024

Problem

wherever some data from syntax is hidden in the rendered output, it becomes hard to edit that. it's like editing with a blindfold.

  • * asterisks disappear while trying to type them - it becomes impossible to know where to end them or where there extent lies
  • heading labels, the label is hidden: # title {label}
  • links, target is hidden: [label](target)

This is a header with a label
# This is a header with a label {*label*}

A link to help for the 'breakindent' option
A link to help for the ['breakindent']('breakindent') option

image

Steps to reproduce

  1. nvim
  2. :e <nvim-dir>/share/nvim/runtime/tutor/tutor.tutor
  3. :let g:tutor_debug = 1 (as instructed at 22gg)
  4. 82gg or 108gg
  5. try to add a heading label or link target:
    • observe that the label or target becomes hidden; and it's very hard to edit them

Expected behavior

while editing an element, it should be fully exposed in its raw form.
many markdown editors do this like typora

edit: this showed up by entering unneeded dangling asterisks
infact, i don't know how, but nvim inside the :Tutor, i did actually saw the underlying markup when editing an element accidently. but i can't figure it out how did i do that.

Neovim version (nvim -v)

NVIM v0.9.5

Vim (not Nvim) behaves the same?

not applicable

Operating system/version

windows 10.0.19045 N/A Build 19045

Terminal name/version

mintty 3.7.1 (x86_64-pc-msys)

$TERM environment variable

xterm

Installation

in msys2 mingw-w64-x86_64-neovim pkg via command: pacboy -S neovim:x

@goyalyashpal goyalyashpal added the bug issues reporting wrong behavior label Apr 4, 2024
@goyalyashpal goyalyashpal changed the title [tutor^2] label instructions incomplete [tutor^2] rendered text hides the raw data Apr 4, 2024
@goyalyashpal goyalyashpal changed the title [tutor^2] rendered text hides the raw data raw text not shown while editing element in tutor Apr 4, 2024
@goyalyashpal goyalyashpal changed the title raw text not shown while editing element in tutor raw text not shown while editing element in tutor^2 Apr 4, 2024
@goyalyashpal
Copy link
Author

jump to 0:17



mintty_T4HCPqbKie.mp4

@justinmk
Copy link
Member

justinmk commented Apr 4, 2024

Thanks for the report. Can you try the development version?

  • The Releases page has pre-built archives for Linux/Windows/macOS.
  • Check :version to confirm that you are using the latest version.

@justinmk justinmk added the needs:response waiting for reply from the author label Apr 4, 2024
@justinmk justinmk changed the title raw text not shown while editing element in tutor^2 tutor: raw text not shown while editing element Apr 4, 2024
@justinmk justinmk added the complexity:low Low-risk, self-contained. Do NOT ask "can I work on this", just read CONTRIBUTING.md label Apr 4, 2024
@goyalyashpal

This comment was marked as outdated.

@github-actions github-actions bot removed the needs:response waiting for reply from the author label Apr 4, 2024
@justinmk
Copy link
Member

justinmk commented Apr 4, 2024

yeah, it is the latest version. 😃

by "latest" I mean the 0.10 dev version which I specifically mentioned. I linked to prebuilt binaries that you can download, you don't need scoop.

@skepticspriggan
Copy link

The conceallevel should be 0 according to the filetype plugin after enabling debug mode by following the instructions in the tutor.tutor file. However, :set conceallevel? shows the conceallevel actually remains at 2.

@goyalyashpal
Copy link
Author

goyalyashpal commented Apr 5, 2024

bug reproduced on latest dev too.
and as shared by @skepticspriggan above, this has to do with the conceallevel setting indeed.

i am thinking smth like conceal_while_editing or conceal_on_cursor setting should be there which defaults to off.
the name is kept starting with "conceal" so that users can find the related ones better together

:version
NVIM v0.10.0-dev-2801+g75b80516d
Build type: RelWithDebInfo
LuaJIT 2.1.1710088188
Run ":verbose version" for more info

@listout
Copy link

listout commented Apr 5, 2024

I'm guessing that the logic in the lines are not being sourced properly or after not sourced after entering :Tutor tutor? As the values of buftype and concealcursor remains unaffected as well.

However if you do :let g:tutor_debug = 1 before :Tutor tutor everything looks as intended.

@zeertzjq
Copy link
Member

zeertzjq commented Jun 4, 2024

I don't think this is a bug. As mentioned in the tutor, this only works if you edit the tutor after setting g:tutor_debug:

First, you'll need to enable "debug" mode
~~~ cmd
    :let g:tutor_debug = 1
~~~
This will allow saving changes to the tutor files and will disable conceals, so
you can more easily check your changes.

After this, create a new .tutor file (we will be practicing on this very file, so you
don't need to do this now):
~~~ cmd
    :e new-tutorial.tutor

@zeertzjq zeertzjq closed this as not planned Won't fix, can't repro, duplicate, stale Jun 4, 2024
@zeertzjq zeertzjq added closed:question issues that are closed as usage questions and removed bug issues reporting wrong behavior runtime funtime complexity:low Low-risk, self-contained. Do NOT ask "can I work on this", just read CONTRIBUTING.md labels Jun 4, 2024
@zeertzjq zeertzjq removed this from the backlog milestone Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed:question issues that are closed as usage questions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants