Repository: lapce/lapce
File: lapce-data/src/data.rs (Rust)

Code before:
                .map(|i| (i.size, i.pos))
                .unwrap_or_else(|_| (Size::new(800.0, 600.0), Point::new(0.0, 0.0)));
            let info = WindowInfo {
                size,
                pos,
                maximised: false,
                tabs: TabsInfo {
                    active_tab: 0,
                    workspaces: vec![],
                },
            };
            let window = LapceWindowData::new(
                keypress.clone(),
                latest_release.clone(),
                false,
                log_file.clone(),
                None,
                panel_orders.clone(),
                event_sink.clone(),
                &info,
                db.clone(),
            );
            windows.insert(window.window_id, window);
        }

        if let Some((window_id, data)) = windows.iter().next() {
            for file in files {
                let file_path = match file.path.canonicalize() {
                    Ok(v) => v,
                    _ => pwd.join(file.path),
                };
                for (widget_id, _) in &data.tabs {
                    if let Some(pos) = file.linecol {
                        // jump to line and column
                        if let Err(err) = event_sink.submit_command(
                            LAPCE_UI_COMMAND,
                            LapceUICommand::JumpToLineColLocation(
                                None,
                                EditorLocation {
                                    path: file_path.clone(),
                                    position: Some(pos), // line info is included in column variable
                                    scroll_offset: None,
                                    history: None,
                                },
                                false,
                            ),
                            Target::Widget(*widget_id),
                        ) {
                            log::warn!("Failed to lauch: {err}");
                        } else {
                            break;

Review comment (bug):
There is very little time, so I did not dig deep. But there seems to be a bug here. The program crashes if you try to access ".../lapce/README.md:5" or ".../lapce/README.md:5:1". It looks like the problem is UTF-8 encoding and different length of characters in bytes.

Code after:
                event_sink.clone(),
                &info,
                db.clone(),
            );
            windows.insert(window.window_id, window);
        }

        if let Some((window_id, data)) = windows.iter().next() {
            for file in files {
                let file_path = match file.path.canonicalize() {
                    Ok(v) => v,
                    _ => pwd.join(&file.path),
                };
                for (widget_id, _) in &data.tabs {
                    if let Some(pos) = file.linecol {
                        // jump to line and column
                        if let Err(err) = event_sink.submit_command(
                            LAPCE_UI_COMMAND,
                            LapceUICommand::JumpToLineColLocation(
                                None,
                                EditorLocation {
                                    path: file_path.clone(),
                                    position: Some(pos), // line info is included in column variable
                                    scroll_offset: None,
                                    history: None,
                                },
                                false,
                            ),
                            Target::Widget(*widget_id),
                        ) {
                            log::warn!("Failed to lauch: {err}");
                        } else {
                            break;
                        };
                    } else {
                        // open the file
                        if let Err(err) = event_sink.submit_command(
                            LAPCE_UI_COMMAND,
                            LapceUICommand::OpenFile(file_path.clone(), false),
                            Target::Window(*window_id),
                        ) {
                            log::warn!("Failed to lauch: {err}");
                        } else {
                            break;
                        };
                    }
                }
            }
        }

        #[cfg(feature = "updater")]