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

`set previewwindow` doesn't work for popup window #4523

Closed
skywind3000 opened this issue Jun 11, 2019 · 8 comments

Comments

Projects
None yet
4 participants
@skywind3000
Copy link

commented Jun 11, 2019

Vim: 8.1.1517
System: Debian 9

Reproduce

let winid = popup_create([], {"minwidth": 40, "minheight": 15})
call win_execute(winid, "set previewwindow")
pedit /etc/hosts

Expecting result:

Command pedit should open /etc/hosts in a window with a non-zero &previewwindow. As we already set previewwindow for the new popup window, the file should be previewed in the popup.

Actuall result:

previewwindow in the popup is totally ignored and pedit open another preview window.

@skywind3000

This comment has been minimized.

Copy link
Author

commented Jun 11, 2019

Or, can there be a way to display a part of a file in the popup window ??

@brammool

This comment has been minimized.

Copy link
Contributor

commented Jun 11, 2019

@skywind3000

This comment has been minimized.

Copy link
Author

commented Jun 12, 2019

It would be convenient if readfile has additional arguments to specify a line range. useful for big files.

@andymass

This comment has been minimized.

Copy link

commented Jun 12, 2019

Although it is probably more useful to show only part of a file.

This might be a problem because syntax highlighting might not work on a partial file

@skywind3000

This comment has been minimized.

Copy link
Author

commented Jun 12, 2019

This might be a problem because syntax highlighting might not work on a partial file

It is possible to apply syntax highlighting on a partial file, see:

:h syn-sync
@chrisbra

This comment has been minimized.

Copy link
Member

commented Jun 12, 2019

It would be convenient if readfile has additional arguments to specify a line range. useful for big files.

readfile returns a list, you can give additional list indices to limit what will be returned. Or are you worried, that this will take too much memory? Than you might need to pre-process the file first.

@andymass

This comment has been minimized.

Copy link

commented Jun 12, 2019

It is possible to apply syntax highlighting on a partial file, see:
:h syn-sync

True.. but isn't it simpler to just display part of an existing buffer? Similarly, I can imagine someone would want to do :ptag in a popup window at the cursor.

@brammool

This comment has been minimized.

Copy link
Contributor

commented Jun 12, 2019

@brammool brammool closed this in 8d24104 Jun 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.