Session, a Micro plugin

Timeline
Login

Timeline

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

50 most recent check-ins

2026-06-03
06:21
If $XDG_STATE_HOME environment variable is set, state directory is $XDG_STATE_HOME/micro. Otherwise, state directory is config.ConfigDir/session. Now absolute path of session file is displayed. If mkparents is false and state directory does not exist, emit error message instructing user to create it first. leaf check-in: 97b8d6588c user: rossgohlke tags: trunk
02:53
Transfer public.workdir_slugify() to buff.public.slugify.workdir() so buff can use it to differentiate scratch files. check-in: 426900ead1 user: rossgohlke tags: trunk
2026-05-26
17:48
Update external and function documentation. check-in: 1c582a3666 user: rossgohlke tags: trunk
02:52
In restore, fix case where syncbuffers is false and replaceemptybuffer is true. Now modrestore.in_list_buffer() returns a dictionary of results with new test, node, for kind and parent. Remove table reversal in modrestore.close_buffers() because it does not effect the outcome. There is no need to remove later panes first. Now modrestore.close_buffers() closes runtime buffers with different node or different position. check-in: 50c8af7054 user: rossgohlke tags: trunk
00:18
Fix replaceemptybuffer implementation in modrestore.open_buffer(). check-in: 894db99afd user: rossgohlke tags: trunk
00:09
Now modrestore.open_buffer() accounts for parent ID offset if syncbuffers is false. check-in: 4eead07a8c user: rossgohlke tags: trunk
2026-05-25
22:10
Changes cosmetics in postinit(). check-in: 481430530a user: rossgohlke tags: trunk
21:45
Change session_home to module.session_home to conform with new normalization guidelines. check-in: 00c8c98182 user: rossgohlke tags: trunk
19:22
Move module.is_active_buffer() and module.open_pane() since they do not depend on session data. Add message container to distinguish from error. check-in: 34678c6fe9 user: rossgohlke tags: trunk
18:49
Add functions module.do_skip_buffer(name) module.list_buffers() to encapsulate logic for excluding files based on savehelp and savenoname options so it can be shared between save() and list(). List is still valid as a separate command because it shows the session file path, but buff.list.buf() is preferred as a keybinding. check-in: 75a6d3b1ae user: rossgohlke tags: trunk
18:25
Now open_buffer() only checks if current bufpane is different from session bufpane if current bufpane also has not changed. Replace keeptabs option with syncbuffers, which is now false by default, meaning existing buffers will not be closed or replaced unless the user sets syncbuffers to true; this is the opposite of the original behavior and implemented to prevent lost work with default settings. Add replaceemptybuffer option with true default value which sets syncbuffers to true if there is only one existing buffer and its name is exactly "No name"; this does not match "No name +", which indicates an unsaved buffer with content. Add savenoname option with false default value; when true, preserves buffers named "No name" in the session file. check-in: 8f70e648da user: rossgohlke tags: trunk
15:26
Switch buffer table from array to dictionary with named fields. Add kind and parent fields for preserving split direction and parent pane. Replace buffer listing functions with new plugin buff. Update save() to use new file format. check-in: b5c1c3cdf6 user: rossgohlke tags: trunk
2026-05-22
23:32
Move workdir_slugify to public.workdir_slugify, which is for use by other plugins, not as a keybinding, to distinguish it from public functions which are for such use. check-in: 1c7f3f6b5a user: rossgohlke tags: trunk
23:27
Change action container to command, since they are commands. check-in: 4e9baf516a user: rossgohlke tags: trunk
23:24
Disable go.filepath since it is not in use; change filepath variables to name. check-in: d770f62c37 user: rossgohlke tags: trunk
23:07
Make open_buffer() private because accessing it externally does not make sense since the tab might not exist. check-in: 4197a1c272 user: rossgohlke tags: trunk
22:20
Remove defaultsplit option now that we know how to get split direction. check-in: 935f97cf93 user: rossgohlke tags: trunk
22:05
Remove replaced and obsolete functions. check-in: fb1845c1c6 user: rossgohlke tags: trunk
22:01
Replace get_buffers() with buflist.buf() in every action except save. check-in: 5116d0dd28 user: rossgohlke tags: trunk
19:58
Fix buflist.pane() call in module.open_pane(). check-in: d18e1596f0 user: rossgohlke tags: trunk
2026-05-20
12:39
Change container names to avoid conflicts: util to module, restore to modrestore. Simplify global function names. When I did this, restore function clashed with restore container, resulting in Micro emitting error "No such function exists" or similar when pressing restore keybind. Prepare for replacing buffer list functions with buflist. check-in: b017503644 user: rossgohlke tags: trunk
2026-05-16
18:10
Rearrange functions. check-in: 9d70add0e4 user: rossgohlke tags: trunk
16:54
Remove restore.open_filepath. check-in: 03bcfbb29d user: rossgohlke tags: trunk
16:53
Rename restore.open_filepath to open_buffer which accepts different arguments, especially table record instead of individual argument strings. Making it global allows it to be used by other plugins. The session prefix should make it clear that the user is working with session file format. check-in: 06b235e6fd user: rossgohlke tags: trunk
15:46
restore.open_buffer() is poorly implemented. It has too many arguments which it is just passing through to other functions. Move all but active logic back to session_restore, rename to restore.is_active_buffer(). check-in: 4af3df5043 user: rossgohlke tags: trunk
14:59
Make util.get_buffers() global since it encapsulates and exposes modular logic which could be used by other plugins. is borderline util because it depends on session file format. check-in: 75ffc64fa6 user: rossgohlke tags: trunk
14:26
I am finally satisfied that I am not going to look at this code in a week and wonder what the hell I was thinking. check-in: f184057861 user: rossgohlke tags: trunk
14:22
Stop adding and removing double quotes around filepath in session file; fix restoring Help commands. check-in: a1a2283f6e user: rossgohlke tags: trunk
13:36
Fix SetActive for pane in session_restore. check-in: b31b8fbedd user: rossgohlke tags: trunk
13:16
Remove commented function util.get_workdir_file. check-in: 12c9f22f63 user: rossgohlke tags: trunk
12:44
Rename util.get_workdir_file to workdir_slugify which is global so it can be accessed from outside the plugin. check-in: e4f84303c1 user: rossgohlke tags: trunk
04:32
Remove unused filepath import. check-in: 0679d88c06 user: rossgohlke tags: trunk
03:39
Upgrade session_save(): * Get permissions from micro home directory first, return false on error * If we can't read the permissions of this directory, the parent of session subdirectory, we cannot continue * Offer better fallbacks for session file permissions * Check for other well-known files in micro home directory * Set default value for final fallback check-in: ef57948acf user: rossgohlke tags: trunk
02:58
Rename util.is_open_filepath() to restore.in_list_buffer(). check-in: f4590e579d user: rossgohlke tags: trunk
02:11
Rename restore.read_filepath to restore.read_session_file. check-in: cc7db6ab71 user: rossgohlke tags: trunk
02:06
Rename util.is_exist_buffer to util.is_open_filepath. check-in: 3d5d2a7cf9 user: rossgohlke tags: trunk
02:03
Resolve ambiguity of util.open_pane() only depending on plugin option by keeping it in util, accepting value as parameter, using the value of helpsplit if parameter not passed and passing defaultsplit from restore.open_filepath(). check-in: 5d87202968 user: rossgohlke tags: trunk
01:23
Remove commented functions. check-in: a6994d4397 user: rossgohlke tags: trunk
01:20
Replace util.get_session_dir with local variable session_home to eliminate ambiguity of a session function with no external dependencies -- besides an option. check-in: 927b7beda5 user: rossgohlke tags: trunk
00:59
Either I understand the logic and I am removing a redundancy, or I don't understand the logic and I am removing critical functionality. I am removing util.validate_pane(). 1. Only restore uses it, ultimately. 1. Restore should consider every pane for removal. * I don't recall the point of excluding Help, when savehelp is false, from consideration. * If restore encounters a Help pane and savehelp is false, the same rules should apply as to whether it is removed. * Maybe the idea had to do with assuming the same value for savehelp was used during save, so no Help panes should exist in session file, and that if you intended to ignore Help, those panes should survive restore. * If that is the case, I no longer think that is correct. * All panes should be considered for removal during restore. ## Actions 1. Remove util.validate_pane(). 1. Rename runtime.get_panes() to util.get_panes() because it no longer has session dependencies. 1. Rename runtime.get_buffers() to util.get_buffers() because it no longer has session dependencies. check-in: 68586ef939 user: rossgohlke tags: trunk
2026-05-15
21:12
Rename util.format_session_dir to util.get_session_dir and util.format_session_dir to util.get_workdir_file. check-in: 31d8d48810 user: rossgohlke tags: trunk
21:09
Rename util.is_active_runtime_buffer to util.is_active_buffer, since runtime is now redundant. check-in: b98acc0bed user: rossgohlke tags: trunk
20:54
Restored InfoBar message in session_restore; moved fragments at bottom to Micro documentation in Textop. check-in: a1e57d167c user: rossgohlke tags: trunk
20:02
Move local container initialization to top. check-in: d17fb399ef user: rossgohlke tags: trunk
19:51
Rename format_file_path to format_workdir_file with option to disable extension. check-in: c053fa6373 user: rossgohlke tags: trunk
19:45
Activate shadow function for format_file_path. check-in: f4034e34dc user: rossgohlke tags: trunk
19:41
Update functions to pass session directory and file name separately so they can be used without pattern matching. check-in: 5ce8cc9d7e user: rossgohlke tags: trunk
19:14
Move logic for working directory base file name into util.format_workdir_path(); move logic to calculate session directory into util.format_session_dir(). check-in: 2aa798e3a7 user: rossgohlke tags: trunk
18:38
Add thoughts on per-instance home directories to roadmap. check-in: 02f3f3270a user: rossgohlke tags: trunk
18:05
Display the session file path in session_show(). check-in: 7b16363ae1 user: rossgohlke tags: trunk