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

Typora adds extra spaces when renaming file #2017

Closed
MateuszKubuszok opened this issue Dec 10, 2018 · 4 comments
Closed

Typora adds extra spaces when renaming file #2017

MateuszKubuszok opened this issue Dec 10, 2018 · 4 comments

Comments

@MateuszKubuszok
Copy link

I've noticed that sometimes, when I try to rename file, typora add spaces to the name.

E.g. today when I selected rename on file somefile-name.md which I wanted to rename to 2018-12-10-somefile-name.md before moving it from _drafts to _posts (Jekyll blog), When input dialog opened it already had somethin like somefile-name.md .

I've noticed the prefixed spaces and removed them, but I overlooked the extra spaces added after .md which later on caused me some headache (file was no longer recognized as markdown).

I have version 0.9.60, Arch Linux. I cannot remember if that is consistent (mis)behavior, but I think it happened to me few times already (though it didn't caused me as many issues as today so I forgot about it soon after).

@abnerlee
Copy link
Contributor

abnerlee commented Dec 10, 2018

How you rename file, or how to reproduce this?

Rename in file tree or rename from other operations?

@MateuszKubuszok
Copy link
Author

Left panel, Files tab, file list view, right-click and rename. I see that it is very hard to reproduce that behavior, so it will probably take me some time until I find out what else is needed to trigger it.

@MateuszKubuszok
Copy link
Author

Today it appeared again. I created a screen shot:
screenshot from 2018-12-23 23-43-59
where you can see that there are some spaces after the extension.

I noticed few things:

  • when I selected the rename command from right-click menu on file, the spaces were added at the beginning and at the end. I haven't presses enter, but instead clicked on the content to cancel rename. I checked that filename wasn't changed on file system,
  • when I selected rename again, situation repeated, but this time I had more spaces prepended and appended,
  • I repeated this about 4-5 times in total, each time getting a little bit more spaces,
  • then I tried to take a screenshot and search if I can create some memory dump or create a log to send here,
  • when I returned to the window to make a screenshot I noticed that "new" spaces doesn't appear - on rename I have some constant number of spaces prepended and appended, but it doesn't change anymore,
  • the change is only visible in the input box - when I cancel rename I see the filename without any changes, even though when I will try to rename again I will once again get input box with extra spaces at the begging and the end. Since I am cancelling the command, actual filename on the disc is unaffected, it is only broken in some internal state within typora.

At the moment of writing this I have file

"adt-through-the-looking-glass.md"`

which is seen by rename command as

"                                                                        adt-through-the-looking-glass.md                                                            "

I still haven't found a way of reproducing it - it appears to me as if under certain conditions Typora went into a invalid state, which would (visibly) affect only one command. After restart the behavior got back to normal. I guess at some point it will happen again, so if there is a way for me to log something I will happily provide it the next time it happens if I only learn how (that debug feature doesn't add "inspect element" command on right-mouse click on that bar on the left).

@abnerlee
Copy link
Contributor

abnerlee commented Jan 9, 2019

should be fixed in new release. added a "trim" for rename operation.

@abnerlee abnerlee closed this as completed Jan 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants