GithubHelp home page GithubHelp logo

Comments (27)

sinaru avatar sinaru commented on June 18, 2024 2

@jesusreal Thank you. If you have read my comment carefully, you would realize that "auto-save.sublime-package" is an archive and as mentioned, you need to first open it using an archive manager. Since you had encountered a problem with the approach, I checked whether there is an easier way. And there is. So please follow below instructions, as mentioned by Sublime Text 3 official guide.
Also please note that I have never used or seen how these packages work, it's just that I tried out with intuition to resolve this bug. So sorry if my first approach is somewhat untidy.

New way

  1. First go to sublime user's package folder. /home/<user>/.config/sublime-text-3/Packages/
  2. Then create a folder called auto-save which is the package name.
  3. Download and save this auto-save.py in the newly created folder . tip: click 'view raw' content then save the file as 'auto-save.py'
  4. Restart Sublime Text.
  5. Now when auto complete is visible, auto save will not be invoked which means auto complete will not hide.

Important Notes

  • Make sure you have Sublime Text 3 build 3103 which has the new method which I used to patch the bug.
  • The link to download auto-save.py is from the patch I proposed to the owner of this plugin. You can see the status of the PR request at [https://github.com//pull/27].
  • As I stated everywhere, this is not a perfect patch, but will be significantly less irritating than the auto complete hiding bug. In other words this change causes the save not to get called when auto complete popup is visible. So any file changes made while auto complete is visible is not saved.

PS
I think this new way to override the plugin behavior(as per Sublime Text docs) is more easier and better than my first approach. So until the original author resolve this issue in the package, I hope this patch will help you. If you want to use the latest auto-save package (that is going to include updates, bug fixes, etc), remove the folder that created earlier in user's package folder. Otherwise still this patch version will be loaded instead.

I hope now everything is clear. :)

from auto-save.

alvitawa avatar alvitawa commented on June 18, 2024 1

Why not just add a setting 'save_when_autocompleting'? And set it to false if you don't want it to save when the popup is open. I imagine some people would like the plugin to save the file even when they are typing with autocomplete (which would become possible without the popup closing if sublime changes the behavior of the save command), but others (like me), would still want it to wait until you have entered something.

from auto-save.

exaesel avatar exaesel commented on June 18, 2024

Agree. I would like to set time between events 'save' or plugin prevent to hide auto-complementation menu.

from auto-save.

radiantnode avatar radiantnode commented on June 18, 2024

+1

from auto-save.

mohammadkhoeini avatar mohammadkhoeini commented on June 18, 2024

+1

from auto-save.

mohammadkhoeini avatar mohammadkhoeini commented on June 18, 2024

i don't now how your codes work with having a guess your code run some thing like ( ctrl +s) maybe adding ( ctrl + space ) right after that can solve the problem

from auto-save.

czhang03 avatar czhang03 commented on June 18, 2024

@molikh That is a good idea, but what if it is not autocopleting when it saves?

from auto-save.

scholer avatar scholer commented on June 18, 2024

Am I correct in my understandings that: When auto-save saves the document after a change, that action is causing your "other" plugin's auto-completion window to become hidden. (If you can specify what plugin, that might make it easier to debug...)

The only thing auto-save does when it saves the document is to invoke view.run_command("save"). I do not think this should be made much more complex, since that could result in unknown side-effects. Instead it would seem to me that saving the document by invoking view.run_command("save") should not by itself hide any UI elements. The fact that it does should be fixed in Sublime Text or somewhere else. Not in auto-save.

from auto-save.

czhang03 avatar czhang03 commented on June 18, 2024

My problem is with latexing @scholer

from auto-save.

sinaru avatar sinaru commented on June 18, 2024

@scholer When auto complete is visible and if I press ctrl+s (invoking save) auto complete hides. In my case I'm talking about the default auto complete pop up that comes with Sublime text 3. So maybe it is the default behavior in Sublime text to hide the auto complete when saving the document. I don't think you can point out Sublime Text is behaving incorrectly since when a user press "ctrl+s" he would not need auto complete anymore.

But with auto save, I find it as a bug. Right now the only get around I found is to increase delay time of auto save. "auto_save_delay_in_seconds": 5. But I don't find that is acceptable either. It is very important to fix this bug asap.

Thanks.

PS: I believe the same issue is mentioned earlier [https://github.com//issues/7]

from auto-save.

czhang03 avatar czhang03 commented on June 18, 2024

There is a new API in sublime text 3 view.is_auto_compelet_visiable() may help with this.

from auto-save.

scholer avatar scholer commented on June 18, 2024

@sinaru Whether or not ctrl+s keystroke should hide auto-complete popups, I'm not sure. But I am sure that invoking view.run_command("save") should not hide auto-complete popups. Or, at least there should be some parameter to disable hiding of popups when the save command is invoked. It is probably doable to resolve the issue by altering *auto-save *, e.g. using the new view.is_auto_compelet_visiable() API that @chantisnake mentioned. But that will make the plugin significantly more complex and ugly. We would have to either (a) restore the auto-complete popup, or (b) delay auto-save until there is no popup visible. And added complexity often has unforeseeable side-effects. Solving problems this way is kind of like if you discover you have a hole in your roof and you put a bucket under the hole to collect the water when it rains, but then the bucket flows over so you create an intricate Rube Goldberg machine to empty the bucket into your drain. Instead of just plugging the hole in your roof. sigh

from auto-save.

mohammadkhoeini avatar mohammadkhoeini commented on June 18, 2024

there is no bug. not in auto-complete and sublime.
sublime should close all lint's when ctrl+s compressed and auto-save just do that.
it's an improvement request.
i am a front-end web developer, so i want auto-save work very fast ( like set time = 0.1 s) to see my changes, and i want to see lint's from my packages too ( like lint in sass , css , js ... ).(whe
so do u think there is a way to do that? ( maybe my solution work)

from auto-save.

sinaru avatar sinaru commented on June 18, 2024

As @chantisnake mentioned I tried out View.is_auto_complete_visible(). Please do mind the following solution as it is hacky. Also note that the function is available from build 3103. So if you have an older version, I assume it will not work.

First you have to open the installed auto-save package using an archive manager. '/home/user/.config/sublime-text-3/Installed Packages/auto-save.sublime-package'
Then open auto_save.py with a code editor. Go to line 59 and change the if statement to add another condition to check the visibility of auto complete.

if view.is_dirty() and not view.is_loading() and not view.is_auto_complete_visible():
        if not backup: # Save file
          view.run_command("save")
 ....

save changes and restart sublime. Now when the auto complete is visible, save is not invoked. This is just a dirty hack didn't test much but seem to work. I hope someone fix this bug in code.

from auto-save.

mohammadkhoeini avatar mohammadkhoeini commented on June 18, 2024

after i change that . auto-save dosent work at all.

after update sublime 3 it's work correctly

thanks a lot

from auto-save.

sinaru avatar sinaru commented on June 18, 2024

@molikh
Go to 'help -> about ..' and see if your build is 3103. If lower this function is not available. If so undo the change.
This is original line 59 in auto_save.py.

if view.is_dirty() and not view.is_loading():

I did was added another condition. Note view is simple in code not capital.

if view.is_dirty() and not view.is_loading() and not view.is_auto_complete_visible():

By pressing ctrl+` you can also get console view in sublime so that if there is any syntax errors it will display.

from auto-save.

minaeid90 avatar minaeid90 commented on June 18, 2024

doesn't work for me attribute error

File "auto_save in /home/minaeid/.config/sublime-text-3/Installed
Packages/auto-save.sublime-package", line 59, in callback
AttributeError: 'View' object has no attribute 'is_auto_complete_visible'

On Wed, Feb 10, 2016 at 10:35 AM, Sinaru Gunawardena <
[email protected]> wrote:

@molikh https://github.com/molikh
Go to 'help -> about ..' and see if your build is 3103. If lower this
function is not available. If so undo the change.
This is original line 59 in auto_save.py.

if view.is_dirty() and not view.is_loading():

I did was added another condition. Note view is simple in code not
capital.

if view.is_dirty() and not view.is_loading() and not view.is_auto_complete_visible():

By pressing ctrl+` you can also get console view in sublime so that if
there is any syntax errors it will display.


Reply to this email directly or view it on GitHub
#21 (comment)
.

from auto-save.

sinaru avatar sinaru commented on June 18, 2024

@minaeid90 Please check your Sublime build number. Like I said this only works on Build 3103 which is the latest one. This is because function is_auto_complete_visible is added in that version. If you have an older one, download and install the latest one.
For some reason, if you have build 3103 and still getting this error, I do see the cause. Sorry. You can undo the change then.

@molikh glad it helped.

Note This change causes the save not to get called when auto complete popup is visible. So any file changes made while auto complete is visible is not saved.

from auto-save.

czhang03 avatar czhang03 commented on June 18, 2024

view.is_auto_complete_visible() only works in the latest version in sublime text 3

I think this update has pushed in less than a week to my windows machine. I don't know about mac or linux

from auto-save.

jesusreal avatar jesusreal commented on June 18, 2024

@sinaru Could you please let me know how to access the auto_save.py? I can only open "auto-save.sublime-package" with sublime but then I only see hexadecimal. Thanks a lot for the info and for finding a solution to this issue.

from auto-save.

jesusreal avatar jesusreal commented on June 18, 2024

Hi @sinaru, thanks a lot for making it clearer and taking the time to write such a detailed information. Awesome!

from auto-save.

sameernyaupane avatar sameernyaupane commented on June 18, 2024

thanks @sinaru for the workaround. I hope this feature gets included in the plugin. It is really annoying currently with the autocomplete disappearing each time the file is saved.

from auto-save.

mmcev106 avatar mmcev106 commented on June 18, 2024

Any update on this issue? @sinaru's seems to have taken his fix down.

from auto-save.

vitr00x1 avatar vitr00x1 commented on June 18, 2024

@sinaru thank you it work

from auto-save.

tohidbiglari avatar tohidbiglari commented on June 18, 2024

i install auto-svae plugin but hide autoComplete fast how slove this problem?
tanks

from auto-save.

alvitawa avatar alvitawa commented on June 18, 2024

@tohidbiglari

You can install my fork https://github.com/alvitawa/auto-save instead of the version in package manager, and set 'save_when_autocompleting' to false in your settings.

from auto-save.

jamesfzhang avatar jamesfzhang commented on June 18, 2024

Should be fixed in 1.0.8

from auto-save.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.