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

Automatically Opens Previous Session of a File That's Too Large to Process #336

Open
blipson opened this issue Nov 8, 2018 · 7 comments

Comments

@blipson
Copy link

blipson commented Nov 8, 2018

I opened a file in XiEditor that turned out to be too large to process (31.5 MB). The editor started using all of my CPU and making my macbook overheat, so I went into the activity monitor and force killed the process. Now whenever I open XiEditor it has that previous session cached and attempts to open the large file again, thus causing it to crash and forcing me to kill the process again. Is there a way to change the settings to not restore from a previous session by default? Or perhaps a way to clear out the cache of the software so it doesn't have that previous session information anymore? I tried uninstalling and re-cloning to no avail, it seems the session information is stored somewhere outside of the repo itself.

@scholtzan
Copy link
Member

scholtzan commented Nov 8, 2018

The application state, such as opened documents is for me saved in ~/Library/Saved Application State/com.levien.XiEditor.savedState/. Deleting the files there should reset it.

But generally opening large files should not have this effect. Someone should look into that. So thanks a lot for letting us know!

@blipson
Copy link
Author

blipson commented Nov 8, 2018

Cleared that directory and was able to open XiEditor without problems!

@jansol
Copy link
Contributor

jansol commented Nov 9, 2018

Definitely something weird going on there. I have no problems opening my ~1GB concatenated IRC log file. Takes a while but doesn't use any meaningful amount of CPU.

One problem I can think of is if your file has long lines and you have word wrap enabled - word wrap is kinda useless at the moment. Does that happen to be the case by chance?

@cmyr
Copy link
Member

cmyr commented Nov 9, 2018

word wrap is actually working reasonably well at the moment, although performance still isn't quite where we'd want it to be. Files with no newlines are likely still a problem, though.

@blipson
Copy link
Author

blipson commented Nov 9, 2018

It does have excessively long individual lines. Each line has about 17,500 characters. It's a series of inserts to a database with 731 columns (don't ask). How do you disable word wrap? I could see if that helps.

@blipson
Copy link
Author

blipson commented Nov 9, 2018

Found it in the settings. I already had it disabled, so that's not the issue.

#####################################################################
# User settings must be in $XI_CONFIG/preferences.xiconfig, where   #
# '$XI_CONFIG' is the Xi configuration directory for your platform. #
#                                                                   #
# These settings can also be overridden for a particular syntax;    #
# add your overrides in (for example) '$XI_CONFIG/rust.xiconfig'.   #
#####################################################################


# The width of a tab, in spaces.
tab_size = 4

# Insert spaces when the tab key is pressed.
translate_tabs_to_spaces = true

# If translate_tabs_to_spaces is true, backspace will delete multiple
# spaces, up to the previous tab stop.
use_tab_stops = true

# List of paths to additional plugins
plugin_search_path = []

font_face = "Inconsolata"

# In points
font_size = 14

# Automatically match current indentation level on newline.
auto_indent = false

# Allow scrolling past the last line of a document.
scroll_past_end = false

# If non-zero, indicates the column at which lines will be wrapped.
wrap_width = 0

# If true, wraps lines at the edge of the view. Overrides 'wrap_width'.
word_wrap = false

@cmyr
Copy link
Member

cmyr commented Nov 9, 2018

Yea, this sounds like #20.

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

5 participants
@scholtzan @jansol @cmyr @blipson and others