prompt-toolkit / pyvim

Pure Python Vim clone.
BSD 3-Clause "New" or "Revised" License
2.53k stars 163 forks source link

pyvim shortcuts ">>" and "<<" do not honour "ts" setting #102

Open michiel5342 opened 6 years ago

michiel5342 commented 6 years ago

I have upgraded to the newest pyvim (0.0.21) and python-prompt-toolkit (1.0.15) releases, but my problem persists. I am using PyVim as my "Vim" editor on a daily basis, but now I came across a behaviour which I think is a bug. I have analysed it and found it to be related to a feature in python-prompt-toolkit.

The scenario is simple: I am editing a html-file and want to indent a block of tags. I have set the "ts" option to 2 spaces. Nevertheless, the ">>" keyboard-shortcut renders 4 spaces indent.

Searching up the dependencies I found out, that the "indent" and "unindent" functions in python-prompt-toolkit.buffer.py use an indent string of four hard-coded spaces, and so do not honour the "ts" settings. I am unsure, whether this is a pyvim rather than a prompt-toolkit issue, but I would very much like this to be corrected.

With thanks for your wonderful Vi-clone, Michiel J.L. Rademakers, The Netherlands.

jonathanslenders commented 6 years ago

Hi @michiel5342,

Thanks a lot for taking the time to write this issue. In prompt_toolkit, this is still hard-coded indeed. I guess this needs to become an option in prompt_toolkit, which is then exposed through the "ts" option in Pyvim.

Right now, my focus is mainly on prompt_toolkit 2.0 for the moment, but then I should have some time to improve all the other projects.